APCLP51P ; IHS/CMI/LAB - 2003 DIABETES AUDIT PRINT ;
;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
;
;
S APCLQUIT=0
I APCLPREP=2 G CUML
;print ind audits first
S APCLPD=0 F S APCLPD=$O(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD)) Q:APCLPD'=+APCLPD!(APCLQUIT) D
.W:$D(IOF) @IOF
.W !,$$CTR("ASSESSMENT PREDIABETES/METABOLIC SYNDROME CARE, FY 2005",80)
.W !!,"AUDIT DATE: ",$$FMTE^XLFDT(APCLRED),?49,"REVIEWER: ",$$I(14)
.W !,"FACILITY NAME: ",$P(^DIC(4,DUZ(2),0),U),?49,"AREA: ",$$I(6)," SU: ",$$I(8)," FACILITY: ",$$I(10)
.W !,"# PTS ON PRE-DIABETES REGISTER: ",$$I(12)
.W !!,"TRIBAL AFFIL: ",$P($$I(120),U,1)," ",$E($P($$I(120),U,2),1,20)," ","COMMUNITY: ",$P($$I(121),U)," ",$E($P($$I(121),U,2),1,19)
.W !,"CHART #: ",$$I(16),?21,"DOB: ",$$I(18),?46,"SEX: ",$$I(20)
.W !,"DESIGNATED PRIMARY CARE PROVIDER: ",$$I(15)
.W !!,"CLASSIFICATION (all that apply):"
.W !?1,"1 IFG - ",$$I(200)
.S X=200 F S X=$O(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)) Q:X>200.99!(X="") D
..W !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
.W !?1,"2 IGT - ",$$I(210)
.S X=210 F S X=$O(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)) Q:X>210.99!(X="") D
..W !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
.W !?1,"3 METABOLIC SYNDROME - ",$$I(220)
.S X=220 F S X=$O(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)) Q:X>220.99!(X="") D
..W !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
.W !?1,"OTHER ABNORMAL GLUCOSE (790.29) - ",$$I(230)
.S X=230 F S X=$O(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)) Q:X>230.99!(X="") D
..W !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
.W !?1,"CMS Register DX: ",$$I(22)_" "_$$I(24)
.I $D(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,25)) W !?1,^(25)
.I $D(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,26)) W !?1,^(26)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !!,"Height: ",$$I(30)
.I $Y>(IOSL-4) D PAGE Q:APCLQUIT
.W !,"Last 3 Weights: " S APCLX=$$I(32)
.F APCLY=2:1:4 I $P(APCLX,"|",APCLY)]"" W !?3,$P(APCLX,"|",APCLY)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"Waist Circumference: ",$$I(33),?41,"ACE Inhibitor Use: ",$$I(60)
.I $Y>(IOSL-5) D PAGE Q:APCLQUIT
.W !!,"Last 3 Blood Pressures:",?41,"Aspirin/Anti-Platelet Therapy: ",$$I(62)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?2,$P($$I(36),";")
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?2,$P($$I(36),";",2),?41,"Lipid Lowering Agent: ",$$I(61)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?2,$P($$I(36),";",3)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"HTN (documented DX): ",$$I(34),?41,"Date of Last EKG: ",$$I(76)
.I $Y>(IOSL-2) D PAGE Q:APCLQUIT
.W !!,"EDUCATION (in past year)"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"Diet Instruction: ",$$I(44)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"Exercise Instruction: ",$$I(46),?41,"LABORATORY DATA"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?41,"Fasting Glucose (most recent):"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"TOBACCO USE: ",$$I(27),?45,$$I(90)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,"Referred for (or provided)",?41,"75 gm 2 hour glucose (most recent):"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,"Cessation Counseling: ",$$I(28),?45,$$I(91)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"DM THERAPY"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !,"Select all that currently apply",?41,"MOST RECENT SERUM VALUE IN THE PAST"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,$$I(51),?4,"1 Unknown/Refused/None",?41," 12 MONTHS"
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,$$I(54),?4,"2 Metformin ",?41,"Total Cholesterol: ",$$I(86)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,$$I(55),?4,"3 Acarbose ",?41,"HDL Cholesterol: ",$$I(89)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,$$I(56),?4,"4 Glitazones",?41,"LDL Cholesterol: ",$$I(88)
.I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?1,$$I(53),?4,"5 Other: Sulfonylurea, ",?41,"Triglycerides: ",$$I(90)
.I $Y>(IOSL-2) D PAGE Q:APCLQUIT
.W !?1,?4," Glyburide, glipizide, etc)"
.;I $Y>(IOSL-1) D PAGE Q:APCLQUIT
.W !?41,"Local Option question:"
CUML ;
I APCLPREP=2!(APCLPREP=3) D CUML^APCLP514
DONE ;
K ^TMP($J)
K ^XTMP("APCLP51",APCLJOB,APCLBTH),APCLJOB,APCLBTH
Q
I(I) ;
Q ^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,I)
;
PAGE ;
I $E(IOST)="C",IO=IO(0) W ! S DIR(0)="EO" D ^DIR K DIR I Y=0!(Y="^")!($D(DTOUT)) S APCLQUIT=1 Q
W:$D(IOF) @IOF
Q
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
APCLP51P ; IHS/CMI/LAB - 2003 DIABETES AUDIT PRINT ;
+1 ;;2.0;IHS PCC SUITE;**2**;MAY 14, 2009
+2 ;
+3 ;
+4 SET APCLQUIT=0
+5 IF APCLPREP=2
GOTO CUML
+6 ;print ind audits first
+7 SET APCLPD=0
FOR
SET APCLPD=$ORDER(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD))
IF APCLPD'=+APCLPD!(APCLQUIT)
QUIT
Begin DoDot:1
+8 IF $DATA(IOF)
WRITE @IOF
+9 WRITE !,$$CTR("ASSESSMENT PREDIABETES/METABOLIC SYNDROME CARE, FY 2005",80)
+10 WRITE !!,"AUDIT DATE: ",$$FMTE^XLFDT(APCLRED),?49,"REVIEWER: ",$$I(14)
+11 WRITE !,"FACILITY NAME: ",$PIECE(^DIC(4,DUZ(2),0),U),?49,"AREA: ",$$I(6)," SU: ",$$I(8)," FACILITY: ",$$I(10)
+12 WRITE !,"# PTS ON PRE-DIABETES REGISTER: ",$$I(12)
+13 WRITE !!,"TRIBAL AFFIL: ",$PIECE($$I(120),U,1)," ",$EXTRACT($PIECE($$I(120),U,2),1,20)," ","COMMUNITY: ",$PIECE($$I(121),U)," ",$EXTRACT($PIECE($$I(121),U,2),1,19)
+14 WRITE !,"CHART #: ",$$I(16),?21,"DOB: ",$$I(18),?46,"SEX: ",$$I(20)
+15 WRITE !,"DESIGNATED PRIMARY CARE PROVIDER: ",$$I(15)
+16 WRITE !!,"CLASSIFICATION (all that apply):"
+17 WRITE !?1,"1 IFG - ",$$I(200)
+18 SET X=200
FOR
SET X=$ORDER(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X))
IF X>200.99!(X="")
QUIT
Begin DoDot:2
+19 WRITE !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
End DoDot:2
+20 WRITE !?1,"2 IGT - ",$$I(210)
+21 SET X=210
FOR
SET X=$ORDER(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X))
IF X>210.99!(X="")
QUIT
Begin DoDot:2
+22 WRITE !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
End DoDot:2
+23 WRITE !?1,"3 METABOLIC SYNDROME - ",$$I(220)
+24 SET X=220
FOR
SET X=$ORDER(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X))
IF X>220.99!(X="")
QUIT
Begin DoDot:2
+25 WRITE !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
End DoDot:2
+26 WRITE !?1,"OTHER ABNORMAL GLUCOSE (790.29) - ",$$I(230)
+27 SET X=230
FOR
SET X=$ORDER(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X))
IF X>230.99!(X="")
QUIT
Begin DoDot:2
+28 WRITE !?3,^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,X)
End DoDot:2
+29 WRITE !?1,"CMS Register DX: ",$$I(22)_" "_$$I(24)
+30 IF $DATA(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,25))
WRITE !?1,^(25)
+31 IF $DATA(^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,26))
WRITE !?1,^(26)
+32 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+33 WRITE !!,"Height: ",$$I(30)
+34 IF $Y>(IOSL-4)
DO PAGE
IF APCLQUIT
QUIT
+35 WRITE !,"Last 3 Weights: "
SET APCLX=$$I(32)
+36 FOR APCLY=2:1:4
IF $PIECE(APCLX,"|",APCLY)]""
WRITE !?3,$PIECE(APCLX,"|",APCLY)
+37 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+38 WRITE !,"Waist Circumference: ",$$I(33),?41,"ACE Inhibitor Use: ",$$I(60)
+39 IF $Y>(IOSL-5)
DO PAGE
IF APCLQUIT
QUIT
+40 WRITE !!,"Last 3 Blood Pressures:",?41,"Aspirin/Anti-Platelet Therapy: ",$$I(62)
+41 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+42 WRITE !?2,$PIECE($$I(36),";")
+43 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+44 WRITE !?2,$PIECE($$I(36),";",2),?41,"Lipid Lowering Agent: ",$$I(61)
+45 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+46 WRITE !?2,$PIECE($$I(36),";",3)
+47 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+48 WRITE !,"HTN (documented DX): ",$$I(34),?41,"Date of Last EKG: ",$$I(76)
+49 IF $Y>(IOSL-2)
DO PAGE
IF APCLQUIT
QUIT
+50 WRITE !!,"EDUCATION (in past year)"
+51 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+52 WRITE !,"Diet Instruction: ",$$I(44)
+53 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+54 WRITE !,"Exercise Instruction: ",$$I(46),?41,"LABORATORY DATA"
+55 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+56 WRITE !?41,"Fasting Glucose (most recent):"
+57 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+58 WRITE !,"TOBACCO USE: ",$$I(27),?45,$$I(90)
+59 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+60 WRITE !?1,"Referred for (or provided)",?41,"75 gm 2 hour glucose (most recent):"
+61 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+62 WRITE !?1,"Cessation Counseling: ",$$I(28),?45,$$I(91)
+63 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+64 WRITE !,"DM THERAPY"
+65 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+66 WRITE !,"Select all that currently apply",?41,"MOST RECENT SERUM VALUE IN THE PAST"
+67 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+68 WRITE !?1,$$I(51),?4,"1 Unknown/Refused/None",?41," 12 MONTHS"
+69 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+70 WRITE !?1,$$I(54),?4,"2 Metformin ",?41,"Total Cholesterol: ",$$I(86)
+71 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+72 WRITE !?1,$$I(55),?4,"3 Acarbose ",?41,"HDL Cholesterol: ",$$I(89)
+73 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+74 WRITE !?1,$$I(56),?4,"4 Glitazones",?41,"LDL Cholesterol: ",$$I(88)
+75 IF $Y>(IOSL-1)
DO PAGE
IF APCLQUIT
QUIT
+76 WRITE !?1,$$I(53),?4,"5 Other: Sulfonylurea, ",?41,"Triglycerides: ",$$I(90)
+77 IF $Y>(IOSL-2)
DO PAGE
IF APCLQUIT
QUIT
+78 WRITE !?1,?4," Glyburide, glipizide, etc)"
+79 ;I $Y>(IOSL-1) D PAGE Q:APCLQUIT
+80 WRITE !?41,"Local Option question:"
End DoDot:1
CUML ;
+1 IF APCLPREP=2!(APCLPREP=3)
DO CUML^APCLP514
DONE ;
+1 KILL ^TMP($JOB)
+2 KILL ^XTMP("APCLP51",APCLJOB,APCLBTH),APCLJOB,APCLBTH
+3 QUIT
I(I) ;
+1 QUIT ^XTMP("APCLP51",APCLJOB,APCLBTH,"AUDIT",APCLPD,I)
+2 ;
PAGE ;
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
WRITE !
SET DIR(0)="EO"
DO ^DIR
KILL DIR
IF Y=0!(Y="^")!($DATA(DTOUT))
SET APCLQUIT=1
QUIT
+2 IF $DATA(IOF)
WRITE @IOF
+3 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 ;----------