CIMGAGPB ; CMI/TUCSON/LAB - aberdeen gpra print ; [ 05/31/00 3:11 PM ]
;;1.0;ABERDEEN GPRA REPORT;;JAN 22, 2000
;
;
PRINT ;
S CIMGPG=0
S CIMQUIT=""
S CIM3YE=$$FMADD^XLFDT(CIMED,-1096)
S CIM98B=$S(CIMQTR=0:($E(CIMED,1,3)-2),1:$E(CIMED,1,3)-1)_$E(CIMBD,4,7)
S CIM98E=($E(CIMED,1,3)-1)_$E(CIMED,4,7)
;S CIM98B=$S(CIMQTR<2:297,1:298)_$E(CIMBD,4,7)
;S CIM98E=$S(CIMQTR=1:297,1:298)_$E(CIMED,4,7)
S CIM983B=$$FMADD^XLFDT(CIM98E,-1096)
D ^CIMGAGPJ
S CIMQUIT="",CIMGPG=0
D PRINT1
Q
;
PRINT1 ;
D HEADER
W !!,"1/1 Diabetes",!,"Identify Area age-specific diabetes prevalence rates and incidence rates for",!,"American Indian/Alaska Native population.",!
I $Y>(IOSL-5) D HEADER Q:CIMQUIT
W !,"Prevalance of Diabetes"
W !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
S CIMGX=$$V(1,1),CIMGY=$$V(12,1)
S CIMG1=$$V(1,10),CIMG1B=$$V(12,10)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# active users",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
W !?3,"# w/ Diabetes Diagnosis",!?5,"before end of time period",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
12 ;
I $Y>(IOSL-7) D HEADER Q:CIMQUIT
W !!,"Incidence of Diabetes"
W !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
S CIMGX=$$V(11,1),CIMGY=$$V(13,1)
S CIMG1=$$V(11,10),CIMG1B=$$V(13,10)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# active users",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
W !?3,"# w/ 1st Diabetes Diagnosis",!?5,"during the time period",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
AGE11 ;
D HEADER Q:CIMQUIT
W !,"Age specific Diabetes Prevalance"
W !?40,"Age Distribution"
W !?23,"<1 yr",?30,"1-4",?37,"5-14",?44,"15-19",?51,"20-24",?56,"25-44",?65,"45-64",?72,">64 yrs",!
W !," BASELINE"
W !?2,"# active users"
S T=23 F X=2:1:9 S Y=$$V(12,X) W ?T,$$C(Y,0,6) S T=T+7
W !?2,"# w/Diabetes dx"
S T=23 F X=11:1:18 S Y=$$V(12,X) W ?T,$$C(Y,0,6) S T=T+7
K CIMX W !?2,"% with DM dx" S T=23 F X=11:1:18 S N=$$V(12,X),D=$$V(12,(X-9)),%=$S('D:"",1:(N/D)*100) W ?T,$S(%="":" .",1:$J(%,5,1)) S T=T+7 S $P(CIMX(X),U,2)=%
I $Y>(IOSL-7) D HEADER Q:CIMQUIT
W !,"CURRENT PERIOD"
W !?2,"# active users"
S T=23 F X=2:1:9 S Y=$$V(1,X) W ?T,$$C(Y,0,6) S T=T+7
W !?2,"# w/Diabetes dx"
S T=23 F X=11:1:18 S Y=$$V(1,X) W ?T,$$C(Y,0,6) S T=T+7
W !?2,"% with DM dx" S T=23 F X=11:1:18 S N=$$V(1,X),D=$$V(1,(X-9)),%=$S('D:"",1:(N/D)*100) W ?T,$S(%="":" .",1:$J(%,5,1)) S T=T+7 S $P(CIMX(X),U)=%
S T=23 W !!,"% Change" S X=0 F S X=$O(CIMX(X)) Q:X'=+X S N=$P(CIMX(X),U),O=$P(CIMX(X),U,2) W ?T,$J($$CALC(N,O),6) S T=T+7
AGE12 ;age distribution 1/2
I $Y>(IOSL-14) D HEADER Q:CIMQUIT
W !!!,"Age specific Diabetes Incidence"
W !?40,"Age Distribution"
W !?23,"<1 yr",?30,"1-4",?37,"5-14",?44,"15-19",?51,"20-24",?56,"25-44",?65,"45-64",?72,">64 yrs",!
W !," BASELINE"
W !?2,"# active users"
S T=23 F X=2:1:9 S Y=$$V(13,X) W ?T,$$C(Y,0,6) S T=T+7
W !?2,"# w/Diabetes dx"
S T=23 F X=11:1:18 S Y=$$V(13,X) W ?T,$$C(Y,0,6) S T=T+7
K CIMX W !?2,"% with DM dx" S T=23 F X=11:1:18 S N=$$V(13,X),D=$$V(13,(X-9)),%=$S('D:"",1:(N/D)*100) W ?T,$S(%="":" .",1:$J(%,5,1)) S T=T+7 S $P(CIMX(X),U,2)=%
I $Y>(IOSL-7) D HEADER Q:CIMQUIT
W !,"CURRENT PERIOD"
W !?2,"# active users"
S T=23 F X=2:1:9 S Y=$$V(11,X) W ?T,$$C(Y,0,6) S T=T+7
W !?2,"# w/Diabetes dx"
S T=23 F X=11:1:18 S Y=$$V(11,X) W ?T,$$C(Y,0,6) S T=T+7
W !?2,"% with DM dx" S T=23 F X=11:1:18 S N=$$V(11,X),D=$$V(11,(X-9)),%=$S('D:"",1:(N/D)*100) W ?T,$S(%="":" .",1:$J(%,5,1)) S T=T+7 S $P(CIMX(X),U)=%
S T=23 W !!,"% Change" S X=0 F S X=$O(CIMX(X)) Q:X'=+X S N=$P(CIMX(X),U),O=$P(CIMX(X),U,2) W ?T,$J($$CALC(N,O),6) S T=T+7
IND22 ;hgb
D HEADER Q:CIMQUIT
W !,"2/2 Diabetes",!,"Increase the proportion of I/T/U clients with diagnosed",!,"diabetes that have improved their glycemic control by 3% over BASELINE level.",!
W !,"Glycemic Control"
W !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
S CIMGX=$$V(1,10),CIMGY=$$V(12,10)
S CIMG1=$$V(14,1),CIMG1B=$$V(15,1)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# diagnosed diabetes",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
W !?3,"# w/ HGBA1C/GLUCOSE recorded within",!?5,"1 year of end of time period",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMGX=$$V(14,1),CIMGY=$$V(15,1)
S CIMG1=$$V(14,2),CIMG1B=$$V(15,2)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !!?3,"# w/ Acceptable Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(14,3),CIMG1B=$$V(15,3)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Fair Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(14,4),CIMG1B=$$V(15,4)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ High",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(14,5),CIMG1B=$$V(15,5)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Very High",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
W !!!?3,"# w/ HGBA1C or GLUCOSE recorded in both time periods"
S CIMGX=$$V(15,6)
W ?58,$$C(CIMGX,0,9)
W !!?3,"# whose control level improved at least one category" S CIMG1=$$V(15,7) W ?58,$$C(CIMG1,0,9)
W !?3,"# whose control level decreased or stayed the same" S CIMG2=$$V(15,8) W ?58,$$C(CIMG2,0,9)
W !?3,"# at acceptable level both periods" S CIMG3=$$V(15,9) W ?58,$$C(CIMG3,0,9)
W !!?3,"Percent improved" I CIMGX-CIMG3 S X=+((CIMG1-CIMG2)/(CIMGX-CIMG3)*100) W ?60,$J(X,6,1)
IND33 ;
D HEADER Q:CIMQUIT
W !,"3/3 Diabetes",!,"Increase the proportion of I/T/U clients with diagnosed",!,"diabetes and hypertension that have achieved diabetic blood",!,"pressure control.",!
W !,"Blood Pressure Control"
W !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
S CIMGX=$$V(1,10),CIMGY=$$V(12,10)
S CIMG1=$$V(17,1),CIMG1B=$$V(18,1)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# diagnosed diabetes",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
W !?3,"# w/ diagnosed Hypertension",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7),!
S CIMGX=$$V(17,1),CIMGY=$$V(18,1)
S CIMG1=$$V(17,2),CIMG1B=$$V(18,2)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Blood Pressure recorded within",!?5,"1 year of end of time period",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7),!
S CIMGX=$$V(17,2),CIMGY=$$V(18,2)
S CIMG1=$$V(17,3),CIMG1B=$$V(18,3)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Ideal Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(17,4),CIMG1B=$$V(18,4)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Target Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(17,5),CIMG1B=$$V(18,5)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Adequate Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(17,6),CIMG1B=$$V(18,6)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Inadequate Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
S CIMG1=$$V(17,7),CIMG1B=$$V(18,7)
S CIMG1P=$S(CIMGX:((CIMG1/CIMGX)*100),1:""),CIMG1BP=$S(CIMGY:((CIMG1B/CIMGY)*100),1:"")
W !?3,"# w/ Markedly Poor Control",?36,$$C(CIMG1B,0,9),?44,$J(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$J(CIMG1P,6,1),?72,$J($$CALC(CIMG1P,CIMG1BP),7)
D ^CIMGAGPC
I CIMQUIT G EXIT
D ^CIMGAGPK
EXIT ;
I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO",DIR("A")="End of report. Press ENTER" D ^DIR K DIR S:$D(DUOUT) DIRUT=1
Q
CALC(N,O) ;ENTRY POINT
;N is new
;O is old
NEW Z
I O=0!(N=0)!(O="")!(N="") Q "**"
NEW X,X2,X3
S X=N,X2=1,X3=0 D COMMA^%DTC S N=X
S X=O,X2=1,X3=0 D COMMA^%DTC S O=X
I +O=0 Q "**"
S Z=(((N-O)/O)*100),Z=$FN(Z,"+,",1)
Q Z
V(N,P) ;
NEW X,C S (X,C)=0 F S X=$O(CIMSUL(X)) Q:X'=+X S C=C+$P($G(^CIMAGP(X,N)),U,P)
Q C
C(X,X2,X3) ;
D COMMA^%DTC
Q X
G:'CIMGPG HEADER1
K DIR I $E(IOST)="C",IO=IO(0),'$D(ZTQUEUED) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S CIMQUIT=1 Q
W:$D(IOF) @IOF S CIMGPG=CIMGPG+1
W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",CIMGPG,!
W !,$$CTR("*** ABERDEEN AREA GPRA INDICATORS ***",80),!
W $S(CIMSUCNT=1:$$CTR(CIMSUNM),1:$$CTR("AREA AGGREGATE")),!
S X="Reporting Period: "_$$FMTE^XLFDT(CIMBD)_" to "_$$FMTE^XLFDT(CIMED) W $$CTR(X,80),!
S X="Baseline Period: "_$$FMTE^XLFDT(CIM98B)_" to "_$$FMTE^XLFDT(CIM98E) W $$CTR(X,80),!
W !,$TR($J("",80)," ","-")
Q
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
CIMGAGPB ; CMI/TUCSON/LAB - aberdeen gpra print ; [ 05/31/00 3:11 PM ]
+1 ;;1.0;ABERDEEN GPRA REPORT;;JAN 22, 2000
+2 ;
+3 ;
PRINT ;
+1 SET CIMGPG=0
+2 SET CIMQUIT=""
+3 SET CIM3YE=$$FMADD^XLFDT(CIMED,-1096)
+4 SET CIM98B=$SELECT(CIMQTR=0:($EXTRACT(CIMED,1,3)-2),1:$EXTRACT(CIMED,1,3)-1)_$EXTRACT(CIMBD,4,7)
+5 SET CIM98E=($EXTRACT(CIMED,1,3)-1)_$EXTRACT(CIMED,4,7)
+6 ;S CIM98B=$S(CIMQTR<2:297,1:298)_$E(CIMBD,4,7)
+7 ;S CIM98E=$S(CIMQTR=1:297,1:298)_$E(CIMED,4,7)
+8 SET CIM983B=$$FMADD^XLFDT(CIM98E,-1096)
+9 DO ^CIMGAGPJ
+10 SET CIMQUIT=""
SET CIMGPG=0
+11 DO PRINT1
+12 QUIT
+13 ;
PRINT1 ;
+1 DO HEADER
+2 WRITE !!,"1/1 Diabetes",!,"Identify Area age-specific diabetes prevalence rates and incidence rates for",!,"American Indian/Alaska Native population.",!
+3 IF $Y>(IOSL-5)
DO HEADER
IF CIMQUIT
QUIT
+4 WRITE !,"Prevalance of Diabetes"
+5 WRITE !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
+6 SET CIMGX=$$V(1,1)
SET CIMGY=$$V(12,1)
+7 SET CIMG1=$$V(1,10)
SET CIMG1B=$$V(12,10)
+8 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+9 WRITE !?3,"# active users",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
+10 WRITE !?3,"# w/ Diabetes Diagnosis",!?5,"before end of time period",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
12 ;
+1 IF $Y>(IOSL-7)
DO HEADER
IF CIMQUIT
QUIT
+2 WRITE !!,"Incidence of Diabetes"
+3 WRITE !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
+4 SET CIMGX=$$V(11,1)
SET CIMGY=$$V(13,1)
+5 SET CIMG1=$$V(11,10)
SET CIMG1B=$$V(13,10)
+6 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+7 WRITE !?3,"# active users",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
+8 WRITE !?3,"# w/ 1st Diabetes Diagnosis",!?5,"during the time period",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
AGE11 ;
+1 DO HEADER
IF CIMQUIT
QUIT
+2 WRITE !,"Age specific Diabetes Prevalance"
+3 WRITE !?40,"Age Distribution"
+4 WRITE !?23,"<1 yr",?30,"1-4",?37,"5-14",?44,"15-19",?51,"20-24",?56,"25-44",?65,"45-64",?72,">64 yrs",!
+5 WRITE !," BASELINE"
+6 WRITE !?2,"# active users"
+7 SET T=23
FOR X=2:1:9
SET Y=$$V(12,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+8 WRITE !?2,"# w/Diabetes dx"
+9 SET T=23
FOR X=11:1:18
SET Y=$$V(12,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+10 KILL CIMX
WRITE !?2,"% with DM dx"
SET T=23
FOR X=11:1:18
SET N=$$V(12,X)
SET D=$$V(12,(X-9))
SET %=$SELECT('D:"",1:(N/D)*100)
WRITE ?T,$SELECT(%="":" .",1:$JUSTIFY(%,5,1))
SET T=T+7
SET $PIECE(CIMX(X),U,2)=%
+11 IF $Y>(IOSL-7)
DO HEADER
IF CIMQUIT
QUIT
+12 WRITE !,"CURRENT PERIOD"
+13 WRITE !?2,"# active users"
+14 SET T=23
FOR X=2:1:9
SET Y=$$V(1,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+15 WRITE !?2,"# w/Diabetes dx"
+16 SET T=23
FOR X=11:1:18
SET Y=$$V(1,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+17 WRITE !?2,"% with DM dx"
SET T=23
FOR X=11:1:18
SET N=$$V(1,X)
SET D=$$V(1,(X-9))
SET %=$SELECT('D:"",1:(N/D)*100)
WRITE ?T,$SELECT(%="":" .",1:$JUSTIFY(%,5,1))
SET T=T+7
SET $PIECE(CIMX(X),U)=%
+18 SET T=23
WRITE !!,"% Change"
SET X=0
FOR
SET X=$ORDER(CIMX(X))
IF X'=+X
QUIT
SET N=$PIECE(CIMX(X),U)
SET O=$PIECE(CIMX(X),U,2)
WRITE ?T,$JUSTIFY($$CALC(N,O),6)
SET T=T+7
AGE12 ;age distribution 1/2
+1 IF $Y>(IOSL-14)
DO HEADER
IF CIMQUIT
QUIT
+2 WRITE !!!,"Age specific Diabetes Incidence"
+3 WRITE !?40,"Age Distribution"
+4 WRITE !?23,"<1 yr",?30,"1-4",?37,"5-14",?44,"15-19",?51,"20-24",?56,"25-44",?65,"45-64",?72,">64 yrs",!
+5 WRITE !," BASELINE"
+6 WRITE !?2,"# active users"
+7 SET T=23
FOR X=2:1:9
SET Y=$$V(13,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+8 WRITE !?2,"# w/Diabetes dx"
+9 SET T=23
FOR X=11:1:18
SET Y=$$V(13,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+10 KILL CIMX
WRITE !?2,"% with DM dx"
SET T=23
FOR X=11:1:18
SET N=$$V(13,X)
SET D=$$V(13,(X-9))
SET %=$SELECT('D:"",1:(N/D)*100)
WRITE ?T,$SELECT(%="":" .",1:$JUSTIFY(%,5,1))
SET T=T+7
SET $PIECE(CIMX(X),U,2)=%
+11 IF $Y>(IOSL-7)
DO HEADER
IF CIMQUIT
QUIT
+12 WRITE !,"CURRENT PERIOD"
+13 WRITE !?2,"# active users"
+14 SET T=23
FOR X=2:1:9
SET Y=$$V(11,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+15 WRITE !?2,"# w/Diabetes dx"
+16 SET T=23
FOR X=11:1:18
SET Y=$$V(11,X)
WRITE ?T,$$C(Y,0,6)
SET T=T+7
+17 WRITE !?2,"% with DM dx"
SET T=23
FOR X=11:1:18
SET N=$$V(11,X)
SET D=$$V(11,(X-9))
SET %=$SELECT('D:"",1:(N/D)*100)
WRITE ?T,$SELECT(%="":" .",1:$JUSTIFY(%,5,1))
SET T=T+7
SET $PIECE(CIMX(X),U)=%
+18 SET T=23
WRITE !!,"% Change"
SET X=0
FOR
SET X=$ORDER(CIMX(X))
IF X'=+X
QUIT
SET N=$PIECE(CIMX(X),U)
SET O=$PIECE(CIMX(X),U,2)
WRITE ?T,$JUSTIFY($$CALC(N,O),6)
SET T=T+7
IND22 ;hgb
+1 DO HEADER
IF CIMQUIT
QUIT
+2 WRITE !,"2/2 Diabetes",!,"Increase the proportion of I/T/U clients with diagnosed",!,"diabetes that have improved their glycemic control by 3% over BASELINE level.",!
+3 WRITE !,"Glycemic Control"
+4 WRITE !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
+5 SET CIMGX=$$V(1,10)
SET CIMGY=$$V(12,10)
+6 SET CIMG1=$$V(14,1)
SET CIMG1B=$$V(15,1)
+7 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+8 WRITE !?3,"# diagnosed diabetes",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
+9 WRITE !?3,"# w/ HGBA1C/GLUCOSE recorded within",!?5,"1 year of end of time period",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+10 SET CIMGX=$$V(14,1)
SET CIMGY=$$V(15,1)
+11 SET CIMG1=$$V(14,2)
SET CIMG1B=$$V(15,2)
+12 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+13 WRITE !!?3,"# w/ Acceptable Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+14 SET CIMG1=$$V(14,3)
SET CIMG1B=$$V(15,3)
+15 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+16 WRITE !?3,"# w/ Fair Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+17 SET CIMG1=$$V(14,4)
SET CIMG1B=$$V(15,4)
+18 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+19 WRITE !?3,"# w/ High",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+20 SET CIMG1=$$V(14,5)
SET CIMG1B=$$V(15,5)
+21 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+22 WRITE !?3,"# w/ Very High",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+23 WRITE !!!?3,"# w/ HGBA1C or GLUCOSE recorded in both time periods"
+24 SET CIMGX=$$V(15,6)
+25 WRITE ?58,$$C(CIMGX,0,9)
+26 WRITE !!?3,"# whose control level improved at least one category"
SET CIMG1=$$V(15,7)
WRITE ?58,$$C(CIMG1,0,9)
+27 WRITE !?3,"# whose control level decreased or stayed the same"
SET CIMG2=$$V(15,8)
WRITE ?58,$$C(CIMG2,0,9)
+28 WRITE !?3,"# at acceptable level both periods"
SET CIMG3=$$V(15,9)
WRITE ?58,$$C(CIMG3,0,9)
+29 WRITE !!?3,"Percent improved"
IF CIMGX-CIMG3
SET X=+((CIMG1-CIMG2)/(CIMGX-CIMG3)*100)
WRITE ?60,$JUSTIFY(X,6,1)
IND33 ;
+1 DO HEADER
IF CIMQUIT
QUIT
+2 WRITE !,"3/3 Diabetes",!,"Increase the proportion of I/T/U clients with diagnosed",!,"diabetes and hypertension that have achieved diabetic blood",!,"pressure control.",!
+3 WRITE !,"Blood Pressure Control"
+4 WRITE !?38,"BASELINE",?45," %",?56,"REPORT",?64," %",?71,"% CHANGE",!?38,"PERIOD",?56,"PERIOD"
+5 SET CIMGX=$$V(1,10)
SET CIMGY=$$V(12,10)
+6 SET CIMG1=$$V(17,1)
SET CIMG1B=$$V(18,1)
+7 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+8 WRITE !?3,"# diagnosed diabetes",?36,$$C(CIMGY,0,9),?54,$$C(CIMGX,0,9)
+9 WRITE !?3,"# w/ diagnosed Hypertension",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7),!
+10 SET CIMGX=$$V(17,1)
SET CIMGY=$$V(18,1)
+11 SET CIMG1=$$V(17,2)
SET CIMG1B=$$V(18,2)
+12 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+13 WRITE !?3,"# w/ Blood Pressure recorded within",!?5,"1 year of end of time period",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7),!
+14 SET CIMGX=$$V(17,2)
SET CIMGY=$$V(18,2)
+15 SET CIMG1=$$V(17,3)
SET CIMG1B=$$V(18,3)
+16 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+17 WRITE !?3,"# w/ Ideal Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+18 SET CIMG1=$$V(17,4)
SET CIMG1B=$$V(18,4)
+19 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+20 WRITE !?3,"# w/ Target Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+21 SET CIMG1=$$V(17,5)
SET CIMG1B=$$V(18,5)
+22 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+23 WRITE !?3,"# w/ Adequate Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+24 SET CIMG1=$$V(17,6)
SET CIMG1B=$$V(18,6)
+25 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+26 WRITE !?3,"# w/ Inadequate Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+27 SET CIMG1=$$V(17,7)
SET CIMG1B=$$V(18,7)
+28 SET CIMG1P=$SELECT(CIMGX:((CIMG1/CIMGX)*100),1:"")
SET CIMG1BP=$SELECT(CIMGY:((CIMG1B/CIMGY)*100),1:"")
+29 WRITE !?3,"# w/ Markedly Poor Control",?36,$$C(CIMG1B,0,9),?44,$JUSTIFY(CIMG1BP,6,1),?54,$$C(CIMG1,0,9),?62,$JUSTIFY(CIMG1P,6,1),?72,$JUSTIFY($$CALC(CIMG1P,CIMG1BP),7)
+30 DO ^CIMGAGPC
+31 IF CIMQUIT
GOTO EXIT
+32 DO ^CIMGAGPK
EXIT ;
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
IF '$DATA(ZTQUEUED)
WRITE !
SET DIR(0)="EO"
SET DIR("A")="End of report. Press ENTER"
DO ^DIR
KILL DIR
IF $DATA(DUOUT)
SET DIRUT=1
+2 QUIT
CALC(N,O) ;ENTRY POINT
+1 ;N is new
+2 ;O is old
+3 NEW Z
+4 IF O=0!(N=0)!(O="")!(N="")
QUIT "**"
+5 NEW X,X2,X3
+6 SET X=N
SET X2=1
SET X3=0
DO COMMA^%DTC
SET N=X
+7 SET X=O
SET X2=1
SET X3=0
DO COMMA^%DTC
SET O=X
+8 IF +O=0
QUIT "**"
+9 SET Z=(((N-O)/O)*100)
SET Z=$FNUMBER(Z,"+,",1)
+10 QUIT Z
V(N,P) ;
+1 NEW X,C
SET (X,C)=0
FOR
SET X=$ORDER(CIMSUL(X))
IF X'=+X
QUIT
SET C=C+$PIECE($GET(^CIMAGP(X,N)),U,P)
+2 QUIT C
C(X,X2,X3) ;
+1 DO COMMA^%DTC
+2 QUIT X
+1 IF 'CIMGPG
GOTO HEADER1
+2 KILL DIR
IF $EXTRACT(IOST)="C"
IF IO=IO(0)
IF '$DATA(ZTQUEUED)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET CIMQUIT=1
QUIT
+1 IF $DATA(IOF)
WRITE @IOF
SET CIMGPG=CIMGPG+1
+2 WRITE !?3,$PIECE(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",CIMGPG,!
+3 WRITE !,$$CTR("*** ABERDEEN AREA GPRA INDICATORS ***",80),!
+4 WRITE $SELECT(CIMSUCNT=1:$$CTR(CIMSUNM),1:$$CTR("AREA AGGREGATE")),!
+5 SET X="Reporting Period: "_$$FMTE^XLFDT(CIMBD)_" to "_$$FMTE^XLFDT(CIMED)
WRITE $$CTR(X,80),!
+6 SET X="Baseline Period: "_$$FMTE^XLFDT(CIM98B)_" to "_$$FMTE^XLFDT(CIM98E)
WRITE $$CTR(X,80),!
+7 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+8 QUIT
CTR(X,Y) ;EP - Center X in a field Y wide.
+1 QUIT $JUSTIFY("",$SELECT($DATA(Y):Y,1:IOM)-$LENGTH(X)\2)_X
+2 ;----------