APCLW12 ; IHS/CMI/LAB - CONT. APCLW1 ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;
;
SETE ;EP - set for each age
F S=AUPNSEX,"B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL USABLE PATS",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL USABLE PATS",S,APCLAGE)+1 S X="APCL"_S_"TUP" S @X=@X+1
F S=AUPNSEX,"B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL BMI",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL BMI",S,APCLAGE)+APCLBMI S X="APCL"_S_"BMI" S @X=@X+APCLBMI
I APCLBMI'<$P(^APCLBMI(APCLREF,0),U,5) D G SETE1
.F S=AUPNSEX,"B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"OBESE",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"OBESE",S,APCLAGE)+1 S X="APCL"_S_"OBE" S @X=@X+1
.Q
I APCLBMI'<$P(^APCLBMI(APCLREF,0),U,4) F S=AUPNSEX,"B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"OVERWEIGHT",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"OVERWEIGHT",S,APCLAGE)+1 S X="APCL"_S_"OVR" S @X=@X+1
SETE1 I APCLBMI<^XTMP("APCLW1",APCLJOB,APCLBTH,"LOW",AUPNSEX,APCLAGE) F S=AUPNSEX,"B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"LOW",S,APCLAGE)=APCLBMI
I APCLBMI<APCLBLOW S APCLBLOW=APCLBMI
S X="APCL"_AUPNSEX_"LOW" I APCLBMI<@X S @X=APCLBMI
I APCLBMI>APCLBHGH S APCLBHGH=APCLBMI
I APCLBMI>^XTMP("APCLW1",APCLJOB,APCLBTH,"HIGH",AUPNSEX,APCLAGE) F S=AUPNSEX,"B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"HIGH",S,APCLAGE)=APCLBMI
S X="APCL"_AUPNSEX_"HGH" I APCLBMI>@X S @X=APCLBMI
Q
SETG ;EP
F I=1:1 S APCLNN=$P(APCLBIN,";",I) Q:APCLNN="" S APCLX=$P(APCLNN,"-"),APCLY=$P(APCLNN,"-",2) I APCLAGE'<APCLX,APCLAGE'>APCLY S APCLAGE=I
D SETE
Q
SETGROUP ;EP
S APCLNN=APCLBIN,APCLA="" F I=1:1 S APCLX=$P(APCLNN,";",I) Q:APCLX="" D SETA
Q
SETA ;
F J="M","F","B" S ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL USABLE PATS",J,I)=0,^XTMP("APCLW1",APCLJOB,APCLBTH,"LOW",J,I)=999999,^XTMP("APCLW1",APCLJOB,APCLBTH,"HIGH",J,I)=0,^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL BMI",J,I)=0 D
.S ^XTMP("APCLW1",APCLJOB,APCLBTH,"OBESE",J,I)=0,^XTMP("APCLW1",APCLJOB,APCLBTH,"OVERWEIGHT",J,I)=0
Q
;
APCLW12 ; IHS/CMI/LAB - CONT. APCLW1 ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;
+3 ;
SETE ;EP - set for each age
+1 FOR S=AUPNSEX,"B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL USABLE PATS",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL USABLE PATS",S,APCLAGE)+1
SET X="APCL"_S_"TUP"
SET @X=@X+1
+2 FOR S=AUPNSEX,"B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL BMI",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL BMI",S,APCLAGE)+APCLBMI
SET X="APCL"_S_"BMI"
SET @X=@X+APCLBMI
+3 IF APCLBMI'<$PIECE(^APCLBMI(APCLREF,0),U,5)
Begin DoDot:1
+4 FOR S=AUPNSEX,"B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"OBESE",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"OBESE",S,APCLAGE)+1
SET X="APCL"_S_"OBE"
SET @X=@X+1
+5 QUIT
End DoDot:1
GOTO SETE1
+6 IF APCLBMI'<$PIECE(^APCLBMI(APCLREF,0),U,4)
FOR S=AUPNSEX,"B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"OVERWEIGHT",S,APCLAGE)=^XTMP("APCLW1",APCLJOB,APCLBTH,"OVERWEIGHT",S,APCLAGE)+1
SET X="APCL"_S_"OVR"
SET @X=@X+1
SETE1 IF APCLBMI<^XTMP("APCLW1",APCLJOB,APCLBTH,"LOW",AUPNSEX,APCLAGE)
FOR S=AUPNSEX,"B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"LOW",S,APCLAGE)=APCLBMI
+1 IF APCLBMI<APCLBLOW
SET APCLBLOW=APCLBMI
+2 SET X="APCL"_AUPNSEX_"LOW"
IF APCLBMI<@X
SET @X=APCLBMI
+3 IF APCLBMI>APCLBHGH
SET APCLBHGH=APCLBMI
+4 IF APCLBMI>^XTMP("APCLW1",APCLJOB,APCLBTH,"HIGH",AUPNSEX,APCLAGE)
FOR S=AUPNSEX,"B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"HIGH",S,APCLAGE)=APCLBMI
+5 SET X="APCL"_AUPNSEX_"HGH"
IF APCLBMI>@X
SET @X=APCLBMI
+6 QUIT
SETG ;EP
+1 FOR I=1:1
SET APCLNN=$PIECE(APCLBIN,";",I)
IF APCLNN=""
QUIT
SET APCLX=$PIECE(APCLNN,"-")
SET APCLY=$PIECE(APCLNN,"-",2)
IF APCLAGE'<APCLX
IF APCLAGE'>APCLY
SET APCLAGE=I
+2 DO SETE
+3 QUIT
SETGROUP ;EP
+1 SET APCLNN=APCLBIN
SET APCLA=""
FOR I=1:1
SET APCLX=$PIECE(APCLNN,";",I)
IF APCLX=""
QUIT
DO SETA
+2 QUIT
SETA ;
+1 FOR J="M","F","B"
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL USABLE PATS",J,I)=0
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"LOW",J,I)=999999
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"HIGH",J,I)=0
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"TOTAL BMI",J,I)=0
Begin DoDot:1
+2 SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"OBESE",J,I)=0
SET ^XTMP("APCLW1",APCLJOB,APCLBTH,"OVERWEIGHT",J,I)=0
End DoDot:1
+3 QUIT
+4 ;