Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACHSC6P1

ACHSC6P1.m

Go to the documentation of this file.
ACHSC6P1 ; IHS/ITSC/PMF - PRINT EXPENDITURE REPORT BY AGE GROUP ;   [ 10/16/2001   8:16 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
 ;
 S $P(^TMP("ACHSC6",$J,0),U,1,2)="^ACHSC6P1"
 I $D(ACHSQIO) F  S IOP=ACHSQIO D ^%ZIS Q:'POP  H 30
 K ^TMP("ACHSC6",$J,0,"ACHSQIO")
 U IO
 D BM^ACHSFU
 D LINES^ACHSFU
 D NOW^ACHS
 D COMP^ACHSC6P
 S (ACHSPG,ACHSTNP,ACHSTN43,ACHSTN64,ACHSESDA("T"),ACHSTWKL,ACHSTO43,ACHSTO64,ACHSTO57,ACHSTOA,ACHSTN57,ACHSTT3B,ACHSTOTT)=0
 S ACHS("*")=ACHS("*")_$E(ACHS("*"),1,53)
 S ACHS("=")=ACHS("=")_$E(ACHS("="),1,53)
 S ACHS("-")=ACHS("-")_$E(ACHS("-"),1,53)
 S ACHSLOC=$$LOC^ACHS,ACHSTY=$S(ACHSRPT=2:"CHS EXPENDITURE REPORT BY COMMUNITY",ACHSRPT=1:"CHS EXPENDITURE REPORT BY PATIENT ",1:"EXPENDITURE REPORT BY AGE GROUPS")
 D CITYST^ACHSC6P
 S ACHST1=$$FMTE^XLFDT(ACHSBDT)_" Thru "_$$FMTE^XLFDT(ACHSEDT)
 D HDR
 S ACHSGRP=""
A1 ;
 S ACHSGRP=$O(^TMP("ACHSC6",$J,"P",ACHSGRP))
 G TOT:ACHSGRP=""
 S ACHSSEX=""
A2 ;
 S ACHSSEX=$O(^TMP("ACHSC6",$J,"P",ACHSGRP,ACHSSEX))
 G A1:ACHSSEX="" S X=$G(^TMP("ACHSC6",$J,"P",ACHSGRP,ACHSSEX))
 S ACHST2=$S(ACHSGRP="A":"< 1",ACHSGRP="B":"1-4",ACHSGRP="C":"5-9",ACHSGRP="D":"10-14",ACHSGRP="E":"15-19",ACHSGRP="F":"20-24",ACHSGRP="G":"25-29",ACHSGRP="H":"30-39",ACHSGRP="I":"40-54",ACHSGRP="J":"55-64",1:" 65+")
 S ACHSNP=$P(X,U)
 S ACHSN43=$P(X,U,2)
 S ACHSESDA=$P(X,U,3)
 S ACHST43=$P(X,U,4)
 S ACHSN64=$P(X,U,5)
 S ACHSWKL=$P(X,U,6)
 S ACHST64=$P(X,U,7)
 S ACHSN57=$P(X,U,8)
 S ACHST57=$P(X,U,9)
 S ACHSTOA=$P(X,U,10)
 S ACHST3B=$P(X,U,11)
 S ACHSTOT=$P(X,U,12)
 I $Y>ACHSBM D RTRN^ACHS G TOT:$G(ACHSQUIT) D HDR
 W !,$J(ACHST2,5),?9,ACHSSEX,?16,$J(+ACHSNP,3),?25,$J(+ACHSN43,3),?35,$J(+ACHSESDA,3),?44,$J(ACHST43,8,2),?57,$J(+ACHSN64,3),?67,$J(+ACHSWKL,3),?75,$J(ACHST64,8,2),?89,$J(+ACHSN57,3),?96,$J(ACHST57,8,2),?109,$J(ACHST3B,8,2),?120,$J(ACHSTOT,12,2)
 S ACHSTNP=ACHSTNP+ACHSNP
 S ACHSTN43=ACHSTN43+ACHSN43
 S ACHSTN64=ACHSTN64+ACHSN64
 S ACHSESDA("T")=ACHSESDA("T")+ACHSESDA
 S ACHSTWKL=ACHSTWKL+ACHSWKL
 S ACHSTO43=ACHSTO43+ACHST43
 S ACHSTO64=ACHSTO64+ACHST64
 S ACHSTO57=ACHSTO57+ACHST57
 S ACHSTN57=ACHSTN57+ACHSN57
 S ACHSTOTT=ACHSTOTT+ACHSTOT
 S ACHSTT3B=ACHSTT3B+ACHST3B
 G A2
 ;
HDR ;
 S ACHSPG=ACHSPG+1
 W @IOF,!!,$$REPEAT^XLFSTR("*",132)
 W !,$$C^XBFUNC(ACHSLOC,132),!,ACHSTIME,?132-$L(ACHSTY)/2,ACHSTY,?122,"Page:",$J(ACHSPG,4),!,$$C^XBFUNC(ACHSCITY,132),!,$$C^XBFUNC(ACHST1,132),!,$$REPEAT^XLFSTR("*",132)
 W !!,$S(ACHSRPT1=1:"Inpatient",ACHSRPT1=3:"Outpatient",ACHSRPT1=2:"Dental",1:"All") W " Expenditures for ",$$LOC^ACHS," for Document",!,"Authorizations issued Between ",ACHST1
 W !!?1,"Age",?8,"Sex",?16,"# of",?27,"#",?35,"# 43",?45,"Total",?58,"#",?66,"# 64 ",?78,"Total",?89,"#",?97,"Total",?111,"Total",?125,"Total"
 W !,"Group",?16,"Pts",?26,"43's",?35,"Days",?45,"43 Dol",?57,"64's",?67,"Wkl",?78,"64 Dol",?88,"57's",?97,"57 Dol",?110,"3rd Party",?126,"Dol"
 W !,ACHS("=")
 Q
 ;
TOT ;
 W !!,ACHS("=")
 W !,"Totals",?16,$J(ACHSTNP,3),?25,$J(+ACHSTN43,3),?35,$J(+ACHSESDA("T"),3),?44,$J(ACHSTO43,8,2),?57,$J(+ACHSTN64,3),?67,$J(+ACHSTWKL,3),?75,$J(ACHSTO64,8,2),?89,$J(+ACHSTN57,3),?96,$J(ACHSTO57,8,2),?109,$J(ACHSTT3B,8,2),?123,$J(ACHSTOTT,9,2)
 D RTRN^ACHS
 W @IOF
 D ^%ZISC
 D KILL^ACHSC6P2
 Q
 ;