BDMD71P ; IHS/CMI/LAB - 2007 DIABETES AUDIT PRINT ;
;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
;
;
S BDMQUIT=0,BDMPG=0,BDMIOSL=$S($G(BDMGUI):55,1:IOSL)
I BDMPREP=3 G CUML
;print ind audits first
S BDMPD=0,BDMGUIC=0 F S BDMPD=$O(^XTMP("BDMDM71",BDMJOB,BDMBTH,"AUDIT",BDMPD)) Q:BDMPD'=+BDMPD!(BDMQUIT) D
.I $G(BDMGUI),BDMGUIC W !,"ZZZZZZZ",! ;maw
.S BDMGUIC=1
.W:$D(IOF) @IOF
.W $$CTR("ASSESSMENT OF DIABETES CARE, 2007 DATE AUDIT RUN: "_$$FMTE^XLFDT(BDMRED),80)
.;W !,$$CTR("DATE AUDIT RUN: "_$$FMTE^XLFDT(DT),80)
.W !,"AUDIT DATE: ",$$FMTE^XLFDT(BDMRED),?30,"FACILITY NAME: ",$P(^DIC(4,DUZ(2),0),U)
.W !,"AREA: ",$$I(6),?12,"SU: ",$$I(8),?30,"FACILITY: ",$$I(10),?48,"# PTS ON DM REGISTER: ",$$I(12)
.I $G(BDMSDPI)]"" W !,"Does you community receive SDPI grant funds? "_$S(BDMSDPI=1:"Yes",BDMSDPI=2:"No",BDMSDPI=3:"Don't know",1:"")
.I $G(BDMSDPI)=1 W " ",BDMSDPG
.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 !,"REVIEWER: ",$$I(14),?17,"CHART #: ",$$I(16),?35,"DOB: ",$$I(18),?55,"SEX: ",$$I(20)
.W !,$S($G(BDMPPN):"NAME: "_$P($G(^DPT(BDMPD,0)),U),1:"") S J=$S($G(BDMPPN):$L($P(^DPT(BDMPD,0),U))+10,1:0) W ?J,"PRIMARY CARE PROVIDER: ",$$I(15)
.W !!,"DATE OF DIABETES DIAGNOSIS:"
.W ?42,"Lipid Lowering Agent: " ;,$$I(61)
.W !?1,"CMS Register: ",$$I(22),?45,$$I(61)
.W !?1,"Problem List: ",$$I(23)
.W ?42,"IMMUNIZATIONS"
.W !?1,"1st DX recorded in PCC: ",$$I(21)
.W ?42,"Flu vaccine (past yr): ",$$I(64)
.W !,"Diabetes Type: ",$$I(29)
.W ?42,"Pneumovax Ever: ",$$I(66)
.W !?1,"CMS Register: ",$$I(24)
.W ?42,"Td in past 10 yrs: ",$$I(68)
.W !?1,"Problem List: ",$$I(25)
.W ?42,"PPD Status: ",$$I(70)
.W !?1,"PCC POV's: ",$$I(26)
.W ?42,"If PPD Pos, INH Tx Complete: "
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !
.W ?44,$P($$I(72),U)," ",$P($$I(72),U,2)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"TOBACCO USE: ",$$I(27)
.W ?42,"If PPD Neg, Last PPD: " W $$FMTE^XLFDT($$I(114))
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,"Referred for (or provided) Cessation"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,"Counseling: ",$$I(28)
.W ?42,"Date of Last EKG: ",$$I(76)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"VITAL STATISTICS"
.W ?42,"LABORATORY DATA"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Height: ",$$I(30)
.W ?42,"HbA1c (most recent): ",$P($$I(78),U,1)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.S %=$P($$I(32)," ",1),%=$$STRIP^XLFSTR($J(%,6,2)," ")
.W !,"Last Weight (in 2 yrs): ",%," ",$P($$I(32)," ",2,99)
.W ?45,"Date Obtained: ",$P($$I(78),U,2)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !," BMI: ",$$I(112)
.W ?42,"HbA1c (next most recent): ",$P($$I(78),U,4)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"HTN (documented DX): ",$$I(34)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Last 3 Blood Pressures (in past yr):"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,$P($$I(36),";")
.W ?42,"MOST RECENT SERUM VALUE (in the"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,$P($$I(36),";",2)
.W ?42,"past 12 months):"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,$P($$I(36),";",3)
.W ?43,"Creatinine: ",$$I(84)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !
.W ?43,"Tot Cholesterol: ",$$I(86)
.W !,"EXAMINATIONS (in past year)"
.W ?43,"HDL Cholesterol: ",$$I(89)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Foot exam-complete: "
.W ?43,"LDL Cholesterol: ",$$I(88)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,$$I(38)
.W ?43,"Triglycerides: ",$$I(90)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Eye exam (dilated/fundus): "
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,$$I(40)
.W ?43,"Urinalysis or A/C Ratio: "
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Dental exam: "
.W ?44,$$I(92)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,$$I(42)
.W ?43,"Proteinuria: "
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !
.W ?44,$$I(94)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"EDUCATION (in past year)"
.W ?43,"Microalbuminuria: "
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Diet Instruction: ",$$I(44)
.W ?44,$$I(96)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Exercise Instruction: ",$$I(46)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"DM Education (Other): ",$$I(48)
.;W ?42,"Self monitoring of blood glucose"
.;I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.;W !
.;W ?43,"documented in chart: ",$$I(98)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"DM THERAPY"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Select all that currently apply"
.W ?42,"Supplemental Section"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$$I(51),?4,"1 Diet & Exercise Alone"
.W ?42,"Does pt have depression as an active"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$$I(52),?4,"2 Insulin"
.W ?43,"problem? ",$$I(200)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$$I(53),?4,"3 Sulfonylurea "
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$$I(54),?4,"4 Metformin "
.W ?42,"If 'No', has pt been screened for"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$$I(55),?4,"5 Acarbose "
.W ?43,"depression in the past year?"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$$I(56),?4,"6 Glitazones"
.W ?44,$$I(210)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?1,$P($$I(57),U),?4,"9 Unknown/Refused" I $$I(57)]"" W " ",$P($$I(57),U,2)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"ACE Inhibitor/ARB Use: ",$$I(60)
.W ?43,"Local Option question:"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !,"Aspirin/AntiPlatelet Therapy: ",$$I(62)
.I $E(IOST,1,2)'="P-" W !! S DIR(0)="E" D ^DIR K DIR ;CMI/GRL 1/18/07
.;D PAGE Q:BDMQUIT
CUML ;
I BDMPREP=4!(BDMPREP=3) D CUML^BDMD714
DONE ;
K ^TMP($J)
K ^XTMP("BDMDM71",BDMJOB,BDMBTH),BDMJOB,BDMBTH
Q
I(I) ;
Q ^XTMP("BDMDM71",BDMJOB,BDMBTH,"AUDIT",BDMPD,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 BDMQUIT=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
;----------
BDMD71P ; IHS/CMI/LAB - 2007 DIABETES AUDIT PRINT ;
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
+2 ;
+3 ;
+4 SET BDMQUIT=0
SET BDMPG=0
SET BDMIOSL=$SELECT($GET(BDMGUI):55,1:IOSL)
+5 IF BDMPREP=3
GOTO CUML
+6 ;print ind audits first
+7 SET BDMPD=0
SET BDMGUIC=0
FOR
SET BDMPD=$ORDER(^XTMP("BDMDM71",BDMJOB,BDMBTH,"AUDIT",BDMPD))
IF BDMPD'=+BDMPD!(BDMQUIT)
QUIT
Begin DoDot:1
+8 ;maw
IF $GET(BDMGUI)
IF BDMGUIC
WRITE !,"ZZZZZZZ",!
+9 SET BDMGUIC=1
+10 IF $DATA(IOF)
WRITE @IOF
+11 WRITE $$CTR("ASSESSMENT OF DIABETES CARE, 2007 DATE AUDIT RUN: "_$$FMTE^XLFDT(BDMRED),80)
+12 ;W !,$$CTR("DATE AUDIT RUN: "_$$FMTE^XLFDT(DT),80)
+13 WRITE !,"AUDIT DATE: ",$$FMTE^XLFDT(BDMRED),?30,"FACILITY NAME: ",$PIECE(^DIC(4,DUZ(2),0),U)
+14 WRITE !,"AREA: ",$$I(6),?12,"SU: ",$$I(8),?30,"FACILITY: ",$$I(10),?48,"# PTS ON DM REGISTER: ",$$I(12)
+15 IF $GET(BDMSDPI)]""
WRITE !,"Does you community receive SDPI grant funds? "_$SELECT(BDMSDPI=1:"Yes",BDMSDPI=2:"No",BDMSDPI=3:"Don't know",1:"")
+16 IF $GET(BDMSDPI)=1
WRITE " ",BDMSDPG
+17 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)
+18 WRITE !,"REVIEWER: ",$$I(14),?17,"CHART #: ",$$I(16),?35,"DOB: ",$$I(18),?55,"SEX: ",$$I(20)
+19 WRITE !,$SELECT($GET(BDMPPN):"NAME: "_$PIECE($GET(^DPT(BDMPD,0)),U),1:"")
SET J=$SELECT($GET(BDMPPN):$LENGTH($PIECE(^DPT(BDMPD,0),U))+10,1:0)
WRITE ?J,"PRIMARY CARE PROVIDER: ",$$I(15)
+20 WRITE !!,"DATE OF DIABETES DIAGNOSIS:"
+21 ;,$$I(61)
WRITE ?42,"Lipid Lowering Agent: "
+22 WRITE !?1,"CMS Register: ",$$I(22),?45,$$I(61)
+23 WRITE !?1,"Problem List: ",$$I(23)
+24 WRITE ?42,"IMMUNIZATIONS"
+25 WRITE !?1,"1st DX recorded in PCC: ",$$I(21)
+26 WRITE ?42,"Flu vaccine (past yr): ",$$I(64)
+27 WRITE !,"Diabetes Type: ",$$I(29)
+28 WRITE ?42,"Pneumovax Ever: ",$$I(66)
+29 WRITE !?1,"CMS Register: ",$$I(24)
+30 WRITE ?42,"Td in past 10 yrs: ",$$I(68)
+31 WRITE !?1,"Problem List: ",$$I(25)
+32 WRITE ?42,"PPD Status: ",$$I(70)
+33 WRITE !?1,"PCC POV's: ",$$I(26)
+34 WRITE ?42,"If PPD Pos, INH Tx Complete: "
+35 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+36 WRITE !
+37 WRITE ?44,$PIECE($$I(72),U)," ",$PIECE($$I(72),U,2)
+38 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+39 WRITE !,"TOBACCO USE: ",$$I(27)
+40 WRITE ?42,"If PPD Neg, Last PPD: "
WRITE $$FMTE^XLFDT($$I(114))
+41 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+42 WRITE !?1,"Referred for (or provided) Cessation"
+43 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+44 WRITE !?1,"Counseling: ",$$I(28)
+45 WRITE ?42,"Date of Last EKG: ",$$I(76)
+46 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+47 WRITE !
+48 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+49 WRITE !,"VITAL STATISTICS"
+50 WRITE ?42,"LABORATORY DATA"
+51 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+52 WRITE !,"Height: ",$$I(30)
+53 WRITE ?42,"HbA1c (most recent): ",$PIECE($$I(78),U,1)
+54 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+55 SET %=$PIECE($$I(32)," ",1)
SET %=$$STRIP^XLFSTR($JUSTIFY(%,6,2)," ")
+56 WRITE !,"Last Weight (in 2 yrs): ",%," ",$PIECE($$I(32)," ",2,99)
+57 WRITE ?45,"Date Obtained: ",$PIECE($$I(78),U,2)
+58 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+59 WRITE !," BMI: ",$$I(112)
+60 WRITE ?42,"HbA1c (next most recent): ",$PIECE($$I(78),U,4)
+61 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+62 WRITE !,"HTN (documented DX): ",$$I(34)
+63 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+64 WRITE !,"Last 3 Blood Pressures (in past yr):"
+65 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+66 WRITE !?2,$PIECE($$I(36),";")
+67 WRITE ?42,"MOST RECENT SERUM VALUE (in the"
+68 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+69 WRITE !?2,$PIECE($$I(36),";",2)
+70 WRITE ?42,"past 12 months):"
+71 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+72 WRITE !?2,$PIECE($$I(36),";",3)
+73 WRITE ?43,"Creatinine: ",$$I(84)
+74 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+75 WRITE !
+76 WRITE ?43,"Tot Cholesterol: ",$$I(86)
+77 WRITE !,"EXAMINATIONS (in past year)"
+78 WRITE ?43,"HDL Cholesterol: ",$$I(89)
+79 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+80 WRITE !,"Foot exam-complete: "
+81 WRITE ?43,"LDL Cholesterol: ",$$I(88)
+82 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+83 WRITE !?2,$$I(38)
+84 WRITE ?43,"Triglycerides: ",$$I(90)
+85 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+86 WRITE !,"Eye exam (dilated/fundus): "
+87 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+88 WRITE !?2,$$I(40)
+89 WRITE ?43,"Urinalysis or A/C Ratio: "
+90 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+91 WRITE !,"Dental exam: "
+92 WRITE ?44,$$I(92)
+93 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+94 WRITE !?2,$$I(42)
+95 WRITE ?43,"Proteinuria: "
+96 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+97 WRITE !
+98 WRITE ?44,$$I(94)
+99 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+100 WRITE !,"EDUCATION (in past year)"
+101 WRITE ?43,"Microalbuminuria: "
+102 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+103 WRITE !,"Diet Instruction: ",$$I(44)
+104 WRITE ?44,$$I(96)
+105 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+106 WRITE !,"Exercise Instruction: ",$$I(46)
+107 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+108 WRITE !,"DM Education (Other): ",$$I(48)
+109 ;W ?42,"Self monitoring of blood glucose"
+110 ;I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
+111 ;W !
+112 ;W ?43,"documented in chart: ",$$I(98)
+113 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+114 WRITE !,"DM THERAPY"
+115 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+116 WRITE !,"Select all that currently apply"
+117 WRITE ?42,"Supplemental Section"
+118 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+119 WRITE !?1,$$I(51),?4,"1 Diet & Exercise Alone"
+120 WRITE ?42,"Does pt have depression as an active"
+121 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+122 WRITE !?1,$$I(52),?4,"2 Insulin"
+123 WRITE ?43,"problem? ",$$I(200)
+124 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+125 WRITE !?1,$$I(53),?4,"3 Sulfonylurea "
+126 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+127 WRITE !?1,$$I(54),?4,"4 Metformin "
+128 WRITE ?42,"If 'No', has pt been screened for"
+129 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+130 WRITE !?1,$$I(55),?4,"5 Acarbose "
+131 WRITE ?43,"depression in the past year?"
+132 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+133 WRITE !?1,$$I(56),?4,"6 Glitazones"
+134 WRITE ?44,$$I(210)
+135 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+136 WRITE !?1,$PIECE($$I(57),U),?4,"9 Unknown/Refused"
IF $$I(57)]""
WRITE " ",$PIECE($$I(57),U,2)
+137 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+138 WRITE !,"ACE Inhibitor/ARB Use: ",$$I(60)
+139 WRITE ?43,"Local Option question:"
+140 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+141 WRITE !,"Aspirin/AntiPlatelet Therapy: ",$$I(62)
+142 ;CMI/GRL 1/18/07
IF $EXTRACT(IOST,1,2)'="P-"
WRITE !!
SET DIR(0)="E"
DO ^DIR
KILL DIR
+143 ;D PAGE Q:BDMQUIT
End DoDot:1
CUML ;
+1 IF BDMPREP=4!(BDMPREP=3)
DO CUML^BDMD714
DONE ;
+1 KILL ^TMP($JOB)
+2 KILL ^XTMP("BDMDM71",BDMJOB,BDMBTH),BDMJOB,BDMBTH
+3 QUIT
I(I) ;
+1 QUIT ^XTMP("BDMDM71",BDMJOB,BDMBTH,"AUDIT",BDMPD,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 BDMQUIT=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 ;----------