BDMDD1P ; IHS/CMI/LAB - 2016 DIABETES AUDIT PRINT ; 22 Sep 2015 7:20 AM
;;2.0;DIABETES MANAGEMENT SYSTEM;**9**;JUN 14, 2007;Build 78
;
;
S BDMQUIT=0,BDMPG=0,BDMIOSL=$S($G(BDMGUI):57,1:IOSL)
I BDMPREP=3 G CUML
I BDMPREP=5 G CUML
I BDMPREP=6 G CUML
;print ind audits first
S BDMPD=0,BDMGUIC=0 F S BDMPD=$O(^XTMP("BDMDM16",BDMJOB,BDMBTH,"AUDIT",BDMPD)) Q:BDMPD'=+BDMPD!(BDMQUIT) D
.I $G(BDMGUI),BDMGUIC W !,"ZZZZZZZ",! ;maw
.S BDMGUIC=1
.W:$D(IOF) @IOF
.S BDMPG=BDMPG+1 W:$G(BDMGUI) !! W $$CTR("ASSESSMENT OF DIABETES CARE, 2016 DATE AUDIT RUN: "_$$FMTE^XLFDT(DT)_" Page: "_BDMPG,80)
.W !!,"Audit Period Ending Date: ",$$FMTE^XLFDT(BDMRED),?40,"Facility Name: ",$E($P(^DIC(4,$S($G(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U),1,24)
.W !,"REVIEWER initials: ",$$I(14),?40,"Community: ",$$I(122)
.W !,"STATE of Residence: ",$P($$I(121),U)
.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,"CHART #: ",$$I(16)," DOB: ",$$I(18)," SEX: ",$$I(20)
.W !,"PRIMARY CARE PROVIDER: ",$$I(15)
.W !!,"DATE of Diabetes Diagnosis:"
.W !?2,"DM Reg: ",$S($$I(22)]"":$$I(22),1:"<not documented>")," Problem List: ",$S($$I(23)]"":$$I(23),1:"<not documented>")," 1st PCC DX: ",$$I(21)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.I $$I(26.5)]"" W !,$$I(26.5),!,$$I(26.6)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !,"DM TYPE: ",$$I(29)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"DM Register: ",$S($$I(24)]"":$$I(24),1:"<not documented>")," Problem List: ",$S($$I(25)]"":$$I(25),1:"<not documented>")," PCC POV's: ",$$I(26)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"Screened for tobacco use during Audit period: " S %=$$I(215) W $S($P(%,U,1)=3:"2 No",1:"1 Yes") ;_" "_$P($P(%,U,2)," ",2,999)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"Tobacco Use Status: ",$P($$I(27),U,2)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"Cessation Counseling received? " W $$I(28)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.S X=$$I(30)
.W !!,"HEIGHT (last ever): ",X ;$J($P(X," "),2,0)_" "_$P(X," ",2,99) ;ROUND HT KS 1208 2 DECIMALS THROUGHOUT 2016 PER K SHEFF
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.S %=$P($$I(32)," ",1) I %]"" S %=$$STRIP^XLFSTR($J(%,4,0)," ")
.W !,"Last WEIGHT in audit period: ",%," ",$P($$I(32)," ",2,99)," BMI: ",$$I(112)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"HTN (documented diagnosis): ",$$I(34)
.I $Y>(BDMIOSL-3) D PAGE Q:BDMQUIT
.W !,"Last 3 BLOOD PRESSURES during audit period:",?45,$P($$I(36),";",1)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?45,$P($$I(36),";",2)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?45,$P($$I(36),";",3)
.I $Y>(BDMIOSL-5) D PAGE Q:BDMQUIT
.W !!,"Examinations during audit period"
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"FOOT EXAM-comprehensive: ",?34,$$I(38)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"EYE EXAM (dilated or retinal imaging): " W:$E($$I(40))'=2 ! W ?5,$$I(40)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"DENTAL EXAM: ",?34,$$I(42)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"Education during audit period"
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"NUTRITION INSTRUCTION: ",?36,$P($$I(44),U) I $P($$I(44),U,2)]"" W !?10,$P($$I(44),U,2)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"PHYSICAL ACTIVITY INSTRUCTION: ",?36,$$I(46)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"DM Education (Other): ",?36,$$I(48)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"Mental Health"
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !?2,"Depression an active problem? ",$$I(200)
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !?2,"If 'No', Screened for depression during audit period:"
.W !?7,$$I(210)
.I $Y>(BDMIOSL-14) D PAGE Q:BDMQUIT
.W !!,"DM THERAPY Select all prescribed, as of the end of the audit period:"
.W !?3,$$I(51),?6,"1 Diet & Exercise Alone"
.W !?3,$$I(52),?6,"2 Insulin"
.W !?3,$$I(53),?6,"3 Sulfonylurea (glyburide, glipizide, others)"
.W !?3,$$I(98),?6,"4 Glinide (Prandin, Starlix)"
.W !?3,$$I(54),?6,"5 Metformin (Glucophage, others)"
.W !?3,$$I(55),?6,"6 Acarbose (Precose) or miglitol (Glyset)"
.W !?3,$$I(56),?6,"7 Pioglitazone (Actos) or rosiglitazone (Avandia)"
.W !?3,$$I(100),?6,"8 GLP-1 med (Byetta, Bydureon, Victoza, Tanzeum, Trulicity)"
.W !?3,$$I(59),?6,"9 DPP4 inhibitors (Januvia, Onglyza, Tradjenta, Nesina)"
.W !?3,$P($$I(99),U),?6,"10 Amylin Analog (Symlin)"
.W !?3,$P($$I(101),U),?6,"11 Bromocriptine (Cycloset)"
.W !?3,$P($$I(102),U),?6,"12 Colesevelam (Welchol)"
.W !?3,$P($$I(103),U),?6,"13 SGLT-2 inhibitor (Invokana, Farxiga, Jardiance)"
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !!,"ACE Inhibitor/ARB Prescribed, as of the end of the audit period: ",!?10,$$I(60)
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !,"Aspirin/Antiplatelet/Anticoagulant Therapy Prescribed, as of the end of the audit period: ",!?10,$$I(62)
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !,"Statin Therapy Prescribed, as of the end of the Audit period:",!?10,$$I(300)
.I $Y>(BDMIOSL-6) D PAGE Q:BDMQUIT
.W !!,"TB Testing"
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !,"TB test done: ",$P($$I(70),"||",1)
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !,"TB test result: ",$P($$I(70),"||",2)
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !?4,"If test Pos, INH Tx Complete: ",?33,$P($$I(72),U)," ",$P($$I(72),U,2)
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.W !?4,"If test Neg, Last test: ",?33,$$DATE^BDMS9B1($$I(114))
.W !!,"CVD: Cardiovascular disease diagnosed: ",?40,$$I(116)
.I $Y>(BDMIOSL-6) D PAGE Q:BDMQUIT
.W !!,"Immunizations"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"Influenza vaccine during audit period: ",?35,$$I(64)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"Pneumococcal vaccine - ever: ",?35,$$I(66)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"Td or Tdap in past 10 yrs: ",?35,$$I(68)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"Tdap ever: ",?35,$$I(216)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"HEP B 3 dose series complete - ever: ",?33,$$I(115)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"LABORATORY DATA - most recent result during audit period"
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"A1C: ",?28,$P($$I(78),U,2),?43,$$DATE^BDMS9B1($P($$I(78),U,1)),?60,$E($$VAL^XBDIQ1(9000010.09,+$P($$I(78),U,4),.01),1,19)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"Serum Creatinine: ",?28,$P($$I(84),U,1),?43,$P($$I(84),U,2),?60,$E($P($$I(84),U,3),1,19)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"eGFR value: ",?28,$P($$I(79),U,2),?43,$P($$I(79),U,3),?60,$P($$I(79),U,4)
.W !?2,"Total Cholesterol: ",?28,$P($$I(86),U,1),?43,$P($$I(86),U,2),?60,$E($P($$I(86),U,3),1,19)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"HDL Cholesterol: ",?28,$P($$I(89),U,1),?43,$P($$I(89),U,2),?60,$E($P($$I(89),U,3),1,19)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"LDL Cholesterol: ",?28,$P($$I(88),U,1),?43,$P($$I(88),U,2),?60,$E($P($$I(88),U,3),1,19)
.;I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.;W !?2,"Non-HDL Cholesterol: ",?28,$P($$I(117),U,1),?43,$P($$I(117),U,2),?60,$E($P($$I(117),U,3),1,19) ;,?43,$P($$I(90),U,2),?60,$E($P($$I(90),U,3),1,19)
.I $Y>(BDMIOSL-1) D PAGE Q:BDMQUIT
.W !?2,"Triglycerides: ",?28,$P($$I(90),U,1),?43,$P($$I(90),U,2),?60,$E($P($$I(90),U,3),1,19)
.I $Y>(BDMIOSL-5) D PAGE Q:BDMQUIT
.W !!,"Urine Protein Testing during audit period"
.S BDMUTT=$P($$I(92),U,5)
.W !!,"Quantitative Urine Albumin:Creatinine Ratio (UACR) performed? ",$S(BDMUTT=1:"Yes",1:"No") ;ihs/cmi/maw TODO not sure if this is the correct logic
.I $Y>(BDMIOSL-10) D PAGE Q:BDMQUIT
.W !?7,"UACR value: " I BDMUTT=1 W ?28,$P($$I(92),U,2),?43,$P($$I(92),U,3),?60,$E($P($$I(92),U,4),1,19)
.I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
.W !!,"COMBINED: Meets ALL: A1C <8.0, statin prescribed, mean BP <140/<90"
.I $$AGE^AUPNPAT(BDMPD,BDMADAT)<39 W !?5,"This is only calculated for patients 40 years of age and older." I 1
.E W !?5,$P($$I(118),U,1) ;,?43,$P($$I(90),U,2),?60,$E($P($$I(90),U,3),1,19
.I $Y>(BDMIOSL-2) D PAGE Q:BDMQUIT
.G:$$AGE^AUPNPAT(BDMPD,BDMADAT)<18 N1
.W !!,"Has e-GFR and UACR: ",$P($$I(119),U,1)
.I '$G(BDMGUI) I $Y>(BDMIOSL-6) D PAGE Q:BDMQUIT
N1 .W !!,"Local Option question: ",$$LOCN^BDMDD10(BDMPD,BDMDMRG)
.W !!,"Extended Local Option question: ",$$LOCT^BDMDD10(BDMPD,BDMDMRG)
.W ! ;!!,?10,"*UACR is the preferred test.",!?10,"See Audit 2016 Instructions for more information."
.I $E(IOST,1,2)'="P-" W !! S DIR(0)="E" D ^DIR K DIR
CUML ;
I BDMPREP=4!(BDMPREP=3) D CUML^BDMDD14
I BDMPREP=5 D SDPI^BDMDD1Q
I BDMPREP=6 D SDPI16^BDMDD1U
DONE ;
K ^TMP($J)
K ^XTMP("BDMTAX",BDMJOB,BDMBTH)
K ^XTMP("BDMDM16",BDMJOB,BDMBTH),BDMJOB,BDMBTH
Q
I(I) ;
Q $G(^XTMP("BDMDM16",BDMJOB,BDMBTH,"AUDIT",BDMPD,I))
;
PAGE ;
Q:$G(BDMDSP)
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
I BDMPG W:$D(IOF) @IOF
I $G(BDMGUI),BDMGUIC,'$G(BDMDSP) W !,"ZZZZZZZ",! ;maw
I $G(BDMGUI) W !!
S BDMPG=BDMPG+1
W $$CTR("ASSESSMENT OF DIABETES CARE, 2016 DATE AUDIT RUN: "_$$FMTE^XLFDT(DT)_" Page: "_BDMPG,80)
W !,"Audit Period Ending Date: ",$$FMTE^XLFDT(BDMRED)
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,"CHART #: ",$$I(16)," DOB: ",$$I(18)," SEX: ",$$I(20)
W !,$$REPEAT^XLFSTR("-",79)
Q
;
ACPCOQ() ;-- return none if no UACR, UPCR, Quant
I $P($$I(91),U)="X" Q ""
I $P($$I(93),U)="X" Q ""
I $P($$I(95),U)="X" Q ""
Q "X"
;
ACPCRES() ;-- return result from UACR UPCR
I $P($$I(91),U)="X" Q $P($$I(91),U,2)
I $P($$I(93),U)="X" Q $P($$I(93),U,2)
Q ""
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
QUANCHK() ;--check quantitative
I $P($$I(91),U)]"" Q ""
I $P($$I(93),U)]"" Q ""
Q $$I(95)
;
BDMDD1P ; IHS/CMI/LAB - 2016 DIABETES AUDIT PRINT ; 22 Sep 2015 7:20 AM
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**9**;JUN 14, 2007;Build 78
+2 ;
+3 ;
+4 SET BDMQUIT=0
SET BDMPG=0
SET BDMIOSL=$SELECT($GET(BDMGUI):57,1:IOSL)
+5 IF BDMPREP=3
GOTO CUML
+6 IF BDMPREP=5
GOTO CUML
+7 IF BDMPREP=6
GOTO CUML
+8 ;print ind audits first
+9 SET BDMPD=0
SET BDMGUIC=0
FOR
SET BDMPD=$ORDER(^XTMP("BDMDM16",BDMJOB,BDMBTH,"AUDIT",BDMPD))
IF BDMPD'=+BDMPD!(BDMQUIT)
QUIT
Begin DoDot:1
+10 ;maw
IF $GET(BDMGUI)
IF BDMGUIC
WRITE !,"ZZZZZZZ",!
+11 SET BDMGUIC=1
+12 IF $DATA(IOF)
WRITE @IOF
+13 SET BDMPG=BDMPG+1
IF $GET(BDMGUI)
WRITE !!
WRITE $$CTR("ASSESSMENT OF DIABETES CARE, 2016 DATE AUDIT RUN: "_$$FMTE^XLFDT(DT)_" Page: "_BDMPG,80)
+14 WRITE !!,"Audit Period Ending Date: ",$$FMTE^XLFDT(BDMRED),?40,"Facility Name: ",$EXTRACT($PIECE(^DIC(4,$SELECT($GET(BDMDUZ2):BDMDUZ2,1:DUZ(2)),0),U),1,24)
+15 WRITE !,"REVIEWER initials: ",$$I(14),?40,"Community: ",$$I(122)
+16 WRITE !,"STATE of Residence: ",$PIECE($$I(121),U)
+17 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)
+18 WRITE ?J,"CHART #: ",$$I(16)," DOB: ",$$I(18)," SEX: ",$$I(20)
+19 WRITE !,"PRIMARY CARE PROVIDER: ",$$I(15)
+20 WRITE !!,"DATE of Diabetes Diagnosis:"
+21 WRITE !?2,"DM Reg: ",$SELECT($$I(22)]"":$$I(22),1:"<not documented>")," Problem List: ",$SELECT($$I(23)]"":$$I(23),1:"<not documented>")," 1st PCC DX: ",$$I(21)
+22 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+23 IF $$I(26.5)]""
WRITE !,$$I(26.5),!,$$I(26.6)
+24 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+25 WRITE !,"DM TYPE: ",$$I(29)
+26 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+27 WRITE !?2,"DM Register: ",$SELECT($$I(24)]"":$$I(24),1:"<not documented>")," Problem List: ",$SELECT($$I(25)]"":$$I(25),1:"<not documented>")," PCC POV's: ",$$I(26)
+28 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+29 ;_" "_$P($P(%,U,2)," ",2,999)
WRITE !!,"Screened for tobacco use during Audit period: "
SET %=$$I(215)
WRITE $SELECT($PIECE(%,U,1)=3:"2 No",1:"1 Yes")
+30 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+31 WRITE !!,"Tobacco Use Status: ",$PIECE($$I(27),U,2)
+32 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+33 WRITE !?2,"Cessation Counseling received? "
WRITE $$I(28)
+34 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+35 SET X=$$I(30)
+36 ;$J($P(X," "),2,0)_" "_$P(X," ",2,99) ;ROUND HT KS 1208 2 DECIMALS THROUGHOUT 2016 PER K SHEFF
WRITE !!,"HEIGHT (last ever): ",X
+37 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+38 SET %=$PIECE($$I(32)," ",1)
IF %]""
SET %=$$STRIP^XLFSTR($JUSTIFY(%,4,0)," ")
+39 WRITE !,"Last WEIGHT in audit period: ",%," ",$PIECE($$I(32)," ",2,99)," BMI: ",$$I(112)
+40 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+41 WRITE !!,"HTN (documented diagnosis): ",$$I(34)
+42 IF $Y>(BDMIOSL-3)
DO PAGE
IF BDMQUIT
QUIT
+43 WRITE !,"Last 3 BLOOD PRESSURES during audit period:",?45,$PIECE($$I(36),";",1)
+44 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+45 WRITE !?45,$PIECE($$I(36),";",2)
+46 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+47 WRITE !?45,$PIECE($$I(36),";",3)
+48 IF $Y>(BDMIOSL-5)
DO PAGE
IF BDMQUIT
QUIT
+49 WRITE !!,"Examinations during audit period"
+50 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+51 WRITE !?2,"FOOT EXAM-comprehensive: ",?34,$$I(38)
+52 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+53 WRITE !?2,"EYE EXAM (dilated or retinal imaging): "
IF $EXTRACT($$I(40))'=2
WRITE !
WRITE ?5,$$I(40)
+54 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+55 WRITE !?2,"DENTAL EXAM: ",?34,$$I(42)
+56 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+57 WRITE !!,"Education during audit period"
+58 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+59 WRITE !?2,"NUTRITION INSTRUCTION: ",?36,$PIECE($$I(44),U)
IF $PIECE($$I(44),U,2)]""
WRITE !?10,$PIECE($$I(44),U,2)
+60 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+61 WRITE !?2,"PHYSICAL ACTIVITY INSTRUCTION: ",?36,$$I(46)
+62 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+63 WRITE !?2,"DM Education (Other): ",?36,$$I(48)
+64 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+65 WRITE !!,"Mental Health"
+66 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+67 WRITE !?2,"Depression an active problem? ",$$I(200)
+68 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+69 WRITE !?2,"If 'No', Screened for depression during audit period:"
+70 WRITE !?7,$$I(210)
+71 IF $Y>(BDMIOSL-14)
DO PAGE
IF BDMQUIT
QUIT
+72 WRITE !!,"DM THERAPY Select all prescribed, as of the end of the audit period:"
+73 WRITE !?3,$$I(51),?6,"1 Diet & Exercise Alone"
+74 WRITE !?3,$$I(52),?6,"2 Insulin"
+75 WRITE !?3,$$I(53),?6,"3 Sulfonylurea (glyburide, glipizide, others)"
+76 WRITE !?3,$$I(98),?6,"4 Glinide (Prandin, Starlix)"
+77 WRITE !?3,$$I(54),?6,"5 Metformin (Glucophage, others)"
+78 WRITE !?3,$$I(55),?6,"6 Acarbose (Precose) or miglitol (Glyset)"
+79 WRITE !?3,$$I(56),?6,"7 Pioglitazone (Actos) or rosiglitazone (Avandia)"
+80 WRITE !?3,$$I(100),?6,"8 GLP-1 med (Byetta, Bydureon, Victoza, Tanzeum, Trulicity)"
+81 WRITE !?3,$$I(59),?6,"9 DPP4 inhibitors (Januvia, Onglyza, Tradjenta, Nesina)"
+82 WRITE !?3,$PIECE($$I(99),U),?6,"10 Amylin Analog (Symlin)"
+83 WRITE !?3,$PIECE($$I(101),U),?6,"11 Bromocriptine (Cycloset)"
+84 WRITE !?3,$PIECE($$I(102),U),?6,"12 Colesevelam (Welchol)"
+85 WRITE !?3,$PIECE($$I(103),U),?6,"13 SGLT-2 inhibitor (Invokana, Farxiga, Jardiance)"
+86 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+87 WRITE !!,"ACE Inhibitor/ARB Prescribed, as of the end of the audit period: ",!?10,$$I(60)
+88 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+89 WRITE !,"Aspirin/Antiplatelet/Anticoagulant Therapy Prescribed, as of the end of the audit period: ",!?10,$$I(62)
+90 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+91 WRITE !,"Statin Therapy Prescribed, as of the end of the Audit period:",!?10,$$I(300)
+92 IF $Y>(BDMIOSL-6)
DO PAGE
IF BDMQUIT
QUIT
+93 WRITE !!,"TB Testing"
+94 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+95 WRITE !,"TB test done: ",$PIECE($$I(70),"||",1)
+96 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+97 WRITE !,"TB test result: ",$PIECE($$I(70),"||",2)
+98 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+99 WRITE !?4,"If test Pos, INH Tx Complete: ",?33,$PIECE($$I(72),U)," ",$PIECE($$I(72),U,2)
+100 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+101 WRITE !?4,"If test Neg, Last test: ",?33,$$DATE^BDMS9B1($$I(114))
+102 WRITE !!,"CVD: Cardiovascular disease diagnosed: ",?40,$$I(116)
+103 IF $Y>(BDMIOSL-6)
DO PAGE
IF BDMQUIT
QUIT
+104 WRITE !!,"Immunizations"
+105 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+106 WRITE !?2,"Influenza vaccine during audit period: ",?35,$$I(64)
+107 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+108 WRITE !?2,"Pneumococcal vaccine - ever: ",?35,$$I(66)
+109 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+110 WRITE !?2,"Td or Tdap in past 10 yrs: ",?35,$$I(68)
+111 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+112 WRITE !?2,"Tdap ever: ",?35,$$I(216)
+113 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+114 WRITE !?2,"HEP B 3 dose series complete - ever: ",?33,$$I(115)
+115 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+116 WRITE !!,"LABORATORY DATA - most recent result during audit period"
+117 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+118 WRITE !?2,"A1C: ",?28,$PIECE($$I(78),U,2),?43,$$DATE^BDMS9B1($PIECE($$I(78),U,1)),?60,$EXTRACT($$VAL^XBDIQ1(9000010.09,+$PIECE($$I(78),U,4),.01),1,19)
+119 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+120 WRITE !?2,"Serum Creatinine: ",?28,$PIECE($$I(84),U,1),?43,$PIECE($$I(84),U,2),?60,$EXTRACT($PIECE($$I(84),U,3),1,19)
+121 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+122 WRITE !?2,"eGFR value: ",?28,$PIECE($$I(79),U,2),?43,$PIECE($$I(79),U,3),?60,$PIECE($$I(79),U,4)
+123 WRITE !?2,"Total Cholesterol: ",?28,$PIECE($$I(86),U,1),?43,$PIECE($$I(86),U,2),?60,$EXTRACT($PIECE($$I(86),U,3),1,19)
+124 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+125 WRITE !?2,"HDL Cholesterol: ",?28,$PIECE($$I(89),U,1),?43,$PIECE($$I(89),U,2),?60,$EXTRACT($PIECE($$I(89),U,3),1,19)
+126 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+127 WRITE !?2,"LDL Cholesterol: ",?28,$PIECE($$I(88),U,1),?43,$PIECE($$I(88),U,2),?60,$EXTRACT($PIECE($$I(88),U,3),1,19)
+128 ;I $Y>(BDMIOSL-4) D PAGE Q:BDMQUIT
+129 ;W !?2,"Non-HDL Cholesterol: ",?28,$P($$I(117),U,1),?43,$P($$I(117),U,2),?60,$E($P($$I(117),U,3),1,19) ;,?43,$P($$I(90),U,2),?60,$E($P($$I(90),U,3),1,19)
+130 IF $Y>(BDMIOSL-1)
DO PAGE
IF BDMQUIT
QUIT
+131 WRITE !?2,"Triglycerides: ",?28,$PIECE($$I(90),U,1),?43,$PIECE($$I(90),U,2),?60,$EXTRACT($PIECE($$I(90),U,3),1,19)
+132 IF $Y>(BDMIOSL-5)
DO PAGE
IF BDMQUIT
QUIT
+133 WRITE !!,"Urine Protein Testing during audit period"
+134 SET BDMUTT=$PIECE($$I(92),U,5)
+135 ;ihs/cmi/maw TODO not sure if this is the correct logic
WRITE !!,"Quantitative Urine Albumin:Creatinine Ratio (UACR) performed? ",$SELECT(BDMUTT=1:"Yes",1:"No")
+136 IF $Y>(BDMIOSL-10)
DO PAGE
IF BDMQUIT
QUIT
+137 WRITE !?7,"UACR value: "
IF BDMUTT=1
WRITE ?28,$PIECE($$I(92),U,2),?43,$PIECE($$I(92),U,3),?60,$EXTRACT($PIECE($$I(92),U,4),1,19)
+138 IF $Y>(BDMIOSL-4)
DO PAGE
IF BDMQUIT
QUIT
+139 WRITE !!,"COMBINED: Meets ALL: A1C <8.0, statin prescribed, mean BP <140/<90"
+140 IF $$AGE^AUPNPAT(BDMPD,BDMADAT)<39
WRITE !?5,"This is only calculated for patients 40 years of age and older."
IF 1
+141 ;,?43,$P($$I(90),U,2),?60,$E($P($$I(90),U,3),1,19
IF '$TEST
WRITE !?5,$PIECE($$I(118),U,1)
+142 IF $Y>(BDMIOSL-2)
DO PAGE
IF BDMQUIT
QUIT
+143 IF $$AGE^AUPNPAT(BDMPD,BDMADAT)<18
GOTO N1
+144 WRITE !!,"Has e-GFR and UACR: ",$PIECE($$I(119),U,1)
+145 IF '$GET(BDMGUI)
IF $Y>(BDMIOSL-6)
DO PAGE
IF BDMQUIT
QUIT
N1 WRITE !!,"Local Option question: ",$$LOCN^BDMDD10(BDMPD,BDMDMRG)
+1 WRITE !!,"Extended Local Option question: ",$$LOCT^BDMDD10(BDMPD,BDMDMRG)
+2 ;!!,?10,"*UACR is the preferred test.",!?10,"See Audit 2016 Instructions for more information."
WRITE !
+3 IF $EXTRACT(IOST,1,2)'="P-"
WRITE !!
SET DIR(0)="E"
DO ^DIR
KILL DIR
End DoDot:1
CUML ;
+1 IF BDMPREP=4!(BDMPREP=3)
DO CUML^BDMDD14
+2 IF BDMPREP=5
DO SDPI^BDMDD1Q
+3 IF BDMPREP=6
DO SDPI16^BDMDD1U
DONE ;
+1 KILL ^TMP($JOB)
+2 KILL ^XTMP("BDMTAX",BDMJOB,BDMBTH)
+3 KILL ^XTMP("BDMDM16",BDMJOB,BDMBTH),BDMJOB,BDMBTH
+4 QUIT
I(I) ;
+1 QUIT $GET(^XTMP("BDMDM16",BDMJOB,BDMBTH,"AUDIT",BDMPD,I))
+2 ;
PAGE ;
+1 IF $GET(BDMDSP)
QUIT
+2 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
+3 IF BDMPG
IF $DATA(IOF)
WRITE @IOF
+4 ;maw
IF $GET(BDMGUI)
IF BDMGUIC
IF '$GET(BDMDSP)
WRITE !,"ZZZZZZZ",!
+5 IF $GET(BDMGUI)
WRITE !!
+6 SET BDMPG=BDMPG+1
+7 WRITE $$CTR("ASSESSMENT OF DIABETES CARE, 2016 DATE AUDIT RUN: "_$$FMTE^XLFDT(DT)_" Page: "_BDMPG,80)
+8 WRITE !,"Audit Period Ending Date: ",$$FMTE^XLFDT(BDMRED)
+9 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)
+10 WRITE ?J,"CHART #: ",$$I(16)," DOB: ",$$I(18)," SEX: ",$$I(20)
+11 WRITE !,$$REPEAT^XLFSTR("-",79)
+12 QUIT
+13 ;
ACPCOQ() ;-- return none if no UACR, UPCR, Quant
+1 IF $PIECE($$I(91),U)="X"
QUIT ""
+2 IF $PIECE($$I(93),U)="X"
QUIT ""
+3 IF $PIECE($$I(95),U)="X"
QUIT ""
+4 QUIT "X"
+5 ;
ACPCRES() ;-- return result from UACR UPCR
+1 IF $PIECE($$I(91),U)="X"
QUIT $PIECE($$I(91),U,2)
+2 IF $PIECE($$I(93),U)="X"
QUIT $PIECE($$I(93),U,2)
+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 ;----------
QUANCHK() ;--check quantitative
+1 IF $PIECE($$I(91),U)]""
QUIT ""
+2 IF $PIECE($$I(93),U)]""
QUIT ""
+3 QUIT $$I(95)
+4 ;