BDMDC1A ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ; 15 Oct 2014 5:34 PM
;;2.0;DIABETES MANAGEMENT SYSTEM;**8**;JUN 14, 2007;Build 53
;
;
ACE ;
I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(110)) W !!,$P(V,U)
W !?5,"In patients with known hypertension*",?49,$$C($P(V,U,7)),?61,$$C($P(V,U,5)),?73,$$P($P(V,U,5),$P(V,U,7))
W !?5,"In patients with increased",?49,$$C($P(V,U,8)),?61,$$C($P(V,U,4)),?73,$$P($P(V,U,4),$P(V,U,8)),!?10,"urine albumin excretion**"
ASPIRIN ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(100)) W !!,$P(V,U)
W !?5,"In patients with diagnosed CVD",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
;W !?5,"None",?49,$$C($P(V,U,4)),?73,$$P($P(V,U,2),$P(V,U,4))
;
LIPID ;
I $Y>(BDMIOSL-13) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(115)) W !!,$P(V,U)
W !?5,"Yes",?49,$$C($P(V,U,6)),?61,$$C($P(V,U,4)),?73,$$P($P(V,U,4),$P(V,U,6))
W !?5,"Allergy or intolerant",?49,$$C($P(V,U,7)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,7))
W !!?5,"In patients with known CVD: "
W !?9,"Yes",?49,$$C($P(V,U,22)),?61,$$C($P(V,U,21)),?73,$$P($P(V,U,21),$P(V,U,22))
W !?9,"Allergy or intolerant",?49,$$C($P(V,U,17)),?61,$$C($P(V,U,16)),?73,$$P($P(V,U,16),$P(V,U,17))
W !!?5,"In patients aged 40-75: "
W !?9,"Yes",?49,$$C($P(V,U,19)),?61,$$C($P(V,U,8)),?73,$$P($P(V,U,8),$P(V,U,19))
W !?9,"Allergy or intolerant",?49,$$C($P(V,U,20)),?61,$$C($P(V,U,23)),?73,$$P($P(V,U,23),$P(V,U,20))
EXAMS ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(120)) W !!,$P(V,U) ;,?69,"(% refused)"
W !?5,"Foot Exam - Complete",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,6))," )"
W !?5,"Eye Exam - Dilated or Retinal Camera",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?5,"Dental Exam",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
;
EDUC ;
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(130)) W !!,$P(V,U) ;,?69,"(% refused)"
W !?5,"Nutritional - by any provider",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?5,"Nutritional - by RD",?49,$$C($P(V,U,10)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,10)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?5,"Physical Activity",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
W !?5,"Other",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5)) ;,?71,"( ",$$P($P(V,U,2),$P(V,U,9))," )"
W !?5,"Any of above topics",?49,$$C($P(V,U,6)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,6))
IMM ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(140)) W !!,$P(V,U)
W !?5,"Flu Vaccine during audit period",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?11,"Refused - Flu Vaccine",?49,$$C($P(V,U,6)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,6))
W !?5,"Pneumovax - ever",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4))
W !?11,"Refused - Pneumovax",?49,$$C($P(V,U,7)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,7))
W !?5,"Tetanus/Diphtheria - past 10 years",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5))
W !?11,"Refused - Tetanus/Diphtheria",?49,$$C($P(V,U,8)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,8))
W !?5,"Tdap - ever",?49,$$C($P(V,U,12)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,12))
W !?11,"Refused - Tdap",?49,$$C($P(V,U,13)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,13))
S C=$P(V,U,2)-$P(V,U,11)
W !?5,"Hepatitis B 3-dose series complete - ever",?49,$$C($P(V,U,9)),?61,$$C(C),?73,$$P(C,$P(V,U,9))
W !?11,"Refused - Hepatitis B",?49,$$C($P(V,U,10)),?61,$$C(C),?73,$$P(C,$P(V,U,10))
W !?11,"Immune - Hepatitis B",?49,$$C($P(V,U,11)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,11))
DEP ;
I $Y>(BDMIOSL-6) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(300)) W !!,"Depression An Active Problem"
W !?5,"Yes",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
S Z=$P(V,U,2)-$P(V,U,3)
W !?5,"No",?49,$$C(Z),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),Z)
;screening
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(301))
W !!?5,"In patients without active depression, screened"
W !?5,"for depression during the audit period:"
W !?13,"Screened",?49,$$C($P(V,U,3)),?61,$$C(Z),?73,$$P($P(V,U,2),$P(V,U,3))
W !?13,"Not Screened",?49,$$C($P(V,U,4)),?61,$$C(Z),?73,$$P($P(V,U,2),$P(V,U,4))
;
CREAT ;
W !!,"Laboratory Exams"
;
TOTAL ;
;
NONHDL ;
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(185))
S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)
W !!,"Non-HDL cholesterol",?49,$$C(T),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),T)
W !?5,"Non-HDL <130 mg/dl",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?5,"Non-HDL 130-159 mg/dl",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4))
W !?5,"Non-HDL 160-190 mg/dl",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5))
W !?5,"Non-HDL >190 mg/dl",?49,$$C($P(V,U,6)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,6))
W !?5,"Not tested or no valid result",?49,$$C($P(V,U,7)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,7))
LDL ;
I $Y>(BDMIOSL-9) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(190))
S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)
W !!,"LDL cholesterol",?49,$$C(T),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),T)
W !?5,"LDL <100 mg/dl",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?5,"LDL 100-129 mg/dl",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4))
W !?5,"LDL 130-160 mg/dl",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5))
W !?5,"LDL >160",?49,$$C($P(V,U,6)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,6))
W !?5,"Not tested or no valid result",?49,$$C($P(V,U,7)+$P(V,U,8)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,7)+$P(V,U,8))
HDL ;
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(195))
S T=$P(V,U,2)+$P(V,U,6) ;TOTAL PTS
S S=$P(V,U,3)+$P(V,U,4)+$P(V,U,7)+$P(V,U,8)
W !!,"HDL cholesterol",?49,$$C(S),?61,$$C(T),?73,$$P(T,S)
W !?3,"In females"
W !?5,"HDL =<50 mg/dl",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?5,"HDL >50 mg/dl",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4))
W !?5,"Not tested or no valid result",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5))
W !!?3,"In males"
W !?5,"HDL =<40 mg/dl",?49,$$C($P(V,U,7)),?61,$$C($P(V,U,6)),?73,$$P($P(V,U,6),$P(V,U,7))
W !?5,"HDL >40 mg/dl",?49,$$C($P(V,U,8)),?61,$$C($P(V,U,6)),?73,$$P($P(V,U,6),$P(V,U,8))
W !?5,"Not tested or no valid result",?49,$$C($P(V,U,9)),?61,$$C($P(V,U,6)),?73,$$P($P(V,U,6),$P(V,U,9))
TRIG ;
I $Y>(BDMIOSL-9) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(200))
S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)
W !!,"Triglycerides",?49,$$C(T),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),T)
W !?5,"TG =<400 mg/dl",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?5,"TG >400 mg/dl",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4))
W !?5,"Not tested or no valid result",?49,$$C($P(V,U,5)+$P(V,U,7)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,5)+$P(V,U,7))
;
GFR ;
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(175)) S T=$P(V,U,5)
W !!,"eGFR to assess kidney function",?49,$$C($P(V,U,5)),?61,$$C($P(BDMCUML(175),U,2)),?73,$$P($P(BDMCUML(175),U,2),$P(V,U,5)),!,"(In age 18 and above)"
W !,?7,"eGFR >= 60 ml/min",?49,$$C($P(V,U,6)),?61,$$C($P(BDMCUML(175),U,2)),?73,$$P($P(BDMCUML(175),U,2),$P(V,U,6))
W !,?7,"eGFR 30-59 ml/min",?49,$$C($P(V,U,7)),?61,$$C($P(BDMCUML(175),U,2)),?73,$$P($P(BDMCUML(175),U,2),$P(V,U,7))
W !,?7,"eGFR 15-29 ml/min",?49,$$C($P(V,U,8)),?61,$$C($P(BDMCUML(175),U,2)),?73,$$P($P(BDMCUML(175),U,2),$P(V,U,8))
W !,?7,"eGFR < 15 ml/min",?49,$$C($P(V,U,9)),?61,$$C($P(BDMCUML(175),U,2)),?73,$$P($P(BDMCUML(175),U,2),$P(V,U,9))
W !,?7,"eGFR Not tested or no valid result",?49,$$C($P(V,U,10)),?61,$$C($P(BDMCUML(175),U,2)),?73,$$P($P(BDMCUML(175),U,2),$P(V,U,10))
URIN ;
I $Y>(BDMIOSL-15) D HEADER Q:BDMQUIT
W !
S V=$G(BDMCUML(145))
W !,"Urine Albumin:Creatinine Ratio (UACR)"
W !?5,"Yes",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?5,"No",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,4))
W !!,"In patients with UACR:"
W !?5,"Urine albumin excretion - Normal <30 mg/g",?49,$$C($P(V,U,12)),?61,$$C($P(V,U,3)),?73,$$P($P(V,U,3),$P(V,U,12))
W !?5,"Urine albumin excretion - Increased",!?9,"30-300 mg/g",?49,$$C($P(V,U,13)),?61,$$C($P(V,U,3)),?73,$$P($P(V,U,3),$P(V,U,13))
W !?9,">300 mg/g",?49,$$C($P(V,U,14)),?61,$$C($P(V,U,3)),?73,$$P($P(V,U,3),$P(V,U,14))
W !!?2,"In patients age 18 and above ",!?11,"with eGFR =>30, UACR done",?49,$$C($P(V,U,21)),?61,$$C($P(V,U,20)),?73,$$P($P(V,U,20),$P(V,U,21))
;
CVD ;
I $Y>(BDMIOSL-4) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(250)) W !!,$P(V,U)
W !?5,"Diagnosed CVD",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
TBC ;
I $Y>(BDMIOSL-10) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(70)) W !!,$P(V,U)
W !!?5,"TB Test done (skin or blood)",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3))
W !?9,"If test done, skin test",?49,$$C($P(V,U,4)),?61,$$C($P(V,U,3)),?73,$$P($P(V,U,3),$P(V,U,4))
W !?9,"If test done, blood test",?49,$$C($P(V,U,5)),?61,$$C($P(V,U,3)),?73,$$P($P(V,U,3),$P(V,U,5))
W !?5,"If TB test done, positive result",?49,$$C($P(V,U,6)),?61,$$C($P(V,U,3)),?73,$$P($P(V,U,3),$P(V,U,6))
W !?5,"If positive TB test, treatment",?49,$$C($P(V,U,7)),?61,$$C($P(V,U,6)),?73,$$P($P(V,U,6),$P(V,U,7)),!?9,"completed"
W !?5,"If negative TB test, after DM",?49,$$C($P(V,U,8)),?61,$$C($P(V,U,9)),?73,$$P($P(V,U,9),$P(V,U,8)),!?9,"diagnosis"
;
COMBINED ;
I $Y>(BDMIOSL-4) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(260)) W !!,$P(V,U)
W !?5,"Patients meeting ALL of the following",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3)),!?5,"criteria: A1C <8.0, LDL <100, ",!?5,"and mean BP <140/<90"
I $Y>(BDMIOSL-4) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(270))
W !!?5,"In age 18 and above, patients with",?49,$$C($P(V,U,3)),?61,$$C($P(V,U,2)),?73,$$P($P(V,U,2),$P(V,U,3)),!?5,"both an eGFR and a UACR"
SDM ;
I $Y>(BDMIOSL-6) D HEADER Q:BDMQUIT
W !!!,"* Known hypertension: Has hypertension listed as an active problem, or ",!,"three visits with a diagnosis of hypertension ever (prior to the end ",!,"of the Audit period)."
W !,"** Increased urine albumin excretion: UACR =>30 mg/g."
Q
EXIT ;
I $E(IOST)="C",IO=IO(0) 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
;O is old
NEW Z
I O=0!(N=0) 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
S Z=(((N-O)/O)*100),Z=$FN(Z,"+,",1)
Q Z
P(D,N) ;return %
I 'D Q ""
I 'N Q " 0%"
NEW X S X=N/D,X=X*100,X=$J(X,3,0)
Q X_"%"
C(X,X2,X3) ;
I '$G(X2) S X2=0
I '$G(X3) S X3=6
D COMMA^%DTC
Q X
D HEADER^BDMDC14
CTR(X,Y) ;EP - Center X in a field Y wide.
Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
;----------
USR() ;EP -
Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
;----------
BDMDC1A ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ; 15 Oct 2014 5:34 PM
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**8**;JUN 14, 2007;Build 53
+2 ;
+3 ;
ACE ;
+1 IF $Y>(BDMIOSL-5)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(110))
WRITE !!,$PIECE(V,U)
+3 WRITE !?5,"In patients with known hypertension*",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(V,U,5)),?73,$$P($PIECE(V,U,5),$PIECE(V,U,7))
+4 WRITE !?5,"In patients with increased",?49,$$C($PIECE(V,U,8)),?61,$$C($PIECE(V,U,4)),?73,$$P($PIECE(V,U,4),$PIECE(V,U,8)),!?10,"urine albumin excretion**"
ASPIRIN ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(100))
WRITE !!,$PIECE(V,U)
+3 WRITE !?5,"In patients with diagnosed CVD",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 ;W !?5,"None",?49,$$C($P(V,U,4)),?73,$$P($P(V,U,2),$P(V,U,4))
+5 ;
LIPID ;
+1 IF $Y>(BDMIOSL-13)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(115))
WRITE !!,$PIECE(V,U)
+3 WRITE !?5,"Yes",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(V,U,4)),?73,$$P($PIECE(V,U,4),$PIECE(V,U,6))
+4 WRITE !?5,"Allergy or intolerant",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,7))
+5 WRITE !!?5,"In patients with known CVD: "
+6 WRITE !?9,"Yes",?49,$$C($PIECE(V,U,22)),?61,$$C($PIECE(V,U,21)),?73,$$P($PIECE(V,U,21),$PIECE(V,U,22))
+7 WRITE !?9,"Allergy or intolerant",?49,$$C($PIECE(V,U,17)),?61,$$C($PIECE(V,U,16)),?73,$$P($PIECE(V,U,16),$PIECE(V,U,17))
+8 WRITE !!?5,"In patients aged 40-75: "
+9 WRITE !?9,"Yes",?49,$$C($PIECE(V,U,19)),?61,$$C($PIECE(V,U,8)),?73,$$P($PIECE(V,U,8),$PIECE(V,U,19))
+10 WRITE !?9,"Allergy or intolerant",?49,$$C($PIECE(V,U,20)),?61,$$C($PIECE(V,U,23)),?73,$$P($PIECE(V,U,23),$PIECE(V,U,20))
EXAMS ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 ;,?69,"(% refused)"
SET V=$GET(BDMCUML(120))
WRITE !!,$PIECE(V,U)
+3 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,6))," )"
WRITE !?5,"Foot Exam - Complete",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
WRITE !?5,"Eye Exam - Dilated or Retinal Camera",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+5 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
WRITE !?5,"Dental Exam",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+6 ;
EDUC ;
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 ;,?69,"(% refused)"
SET V=$GET(BDMCUML(130))
WRITE !!,$PIECE(V,U)
+3 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
WRITE !?5,"Nutritional - by any provider",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
WRITE !?5,"Nutritional - by RD",?49,$$C($PIECE(V,U,10)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,10))
+5 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
WRITE !?5,"Physical Activity",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+6 ;,?71,"( ",$$P($P(V,U,2),$P(V,U,9))," )"
WRITE !?5,"Other",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+7 WRITE !?5,"Any of above topics",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,6))
IMM ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(140))
WRITE !!,$PIECE(V,U)
+3 WRITE !?5,"Flu Vaccine during audit period",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 WRITE !?11,"Refused - Flu Vaccine",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+5 WRITE !?5,"Pneumovax - ever",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+6 WRITE !?11,"Refused - Pneumovax",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,7))
+7 WRITE !?5,"Tetanus/Diphtheria - past 10 years",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?11,"Refused - Tetanus/Diphtheria",?49,$$C($PIECE(V,U,8)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,8))
+9 WRITE !?5,"Tdap - ever",?49,$$C($PIECE(V,U,12)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,12))
+10 WRITE !?11,"Refused - Tdap",?49,$$C($PIECE(V,U,13)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,13))
+11 SET C=$PIECE(V,U,2)-$PIECE(V,U,11)
+12 WRITE !?5,"Hepatitis B 3-dose series complete - ever",?49,$$C($PIECE(V,U,9)),?61,$$C(C),?73,$$P(C,$PIECE(V,U,9))
+13 WRITE !?11,"Refused - Hepatitis B",?49,$$C($PIECE(V,U,10)),?61,$$C(C),?73,$$P(C,$PIECE(V,U,10))
+14 WRITE !?11,"Immune - Hepatitis B",?49,$$C($PIECE(V,U,11)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,11))
DEP ;
+1 IF $Y>(BDMIOSL-6)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(300))
WRITE !!,"Depression An Active Problem"
+3 WRITE !?5,"Yes",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 SET Z=$PIECE(V,U,2)-$PIECE(V,U,3)
+5 WRITE !?5,"No",?49,$$C(Z),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),Z)
+6 ;screening
+7 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+8 SET V=$GET(BDMCUML(301))
+9 WRITE !!?5,"In patients without active depression, screened"
+10 WRITE !?5,"for depression during the audit period:"
+11 WRITE !?13,"Screened",?49,$$C($PIECE(V,U,3)),?61,$$C(Z),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+12 WRITE !?13,"Not Screened",?49,$$C($PIECE(V,U,4)),?61,$$C(Z),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+13 ;
CREAT ;
+1 WRITE !!,"Laboratory Exams"
+2 ;
TOTAL ;
+1 ;
NONHDL ;
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(185))
+3 SET T=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,5)+$PIECE(V,U,6)
+4 WRITE !!,"Non-HDL cholesterol",?49,$$C(T),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),T)
+5 WRITE !?5,"Non-HDL <130 mg/dl",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?5,"Non-HDL 130-159 mg/dl",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?5,"Non-HDL 160-190 mg/dl",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?5,"Non-HDL >190 mg/dl",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+9 WRITE !?5,"Not tested or no valid result",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,7))
LDL ;
+1 IF $Y>(BDMIOSL-9)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(190))
+3 SET T=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,5)+$PIECE(V,U,6)
+4 WRITE !!,"LDL cholesterol",?49,$$C(T),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),T)
+5 WRITE !?5,"LDL <100 mg/dl",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?5,"LDL 100-129 mg/dl",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?5,"LDL 130-160 mg/dl",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?5,"LDL >160",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+9 WRITE !?5,"Not tested or no valid result",?49,$$C($PIECE(V,U,7)+$PIECE(V,U,8)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,7)+$PIECE(V,U,8))
HDL ;
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(195))
+3 ;TOTAL PTS
SET T=$PIECE(V,U,2)+$PIECE(V,U,6)
+4 SET S=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,7)+$PIECE(V,U,8)
+5 WRITE !!,"HDL cholesterol",?49,$$C(S),?61,$$C(T),?73,$$P(T,S)
+6 WRITE !?3,"In females"
+7 WRITE !?5,"HDL =<50 mg/dl",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+8 WRITE !?5,"HDL >50 mg/dl",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+9 WRITE !?5,"Not tested or no valid result",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+10 WRITE !!?3,"In males"
+11 WRITE !?5,"HDL =<40 mg/dl",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(V,U,6)),?73,$$P($PIECE(V,U,6),$PIECE(V,U,7))
+12 WRITE !?5,"HDL >40 mg/dl",?49,$$C($PIECE(V,U,8)),?61,$$C($PIECE(V,U,6)),?73,$$P($PIECE(V,U,6),$PIECE(V,U,8))
+13 WRITE !?5,"Not tested or no valid result",?49,$$C($PIECE(V,U,9)),?61,$$C($PIECE(V,U,6)),?73,$$P($PIECE(V,U,6),$PIECE(V,U,9))
TRIG ;
+1 IF $Y>(BDMIOSL-9)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(200))
+3 SET T=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,5)+$PIECE(V,U,6)
+4 WRITE !!,"Triglycerides",?49,$$C(T),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),T)
+5 WRITE !?5,"TG =<400 mg/dl",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?5,"TG >400 mg/dl",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?5,"Not tested or no valid result",?49,$$C($PIECE(V,U,5)+$PIECE(V,U,7)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,5)+$PIECE(V,U,7))
+8 ;
GFR ;
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(175))
SET T=$PIECE(V,U,5)
+3 WRITE !!,"eGFR to assess kidney function",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(BDMCUML(175),U,2)),?73,$$P($PIECE(BDMCUML(175),U,2),$PIECE(V,U,5)),!,"(In age 18 and above)"
+4 WRITE !,?7,"eGFR >= 60 ml/min",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(BDMCUML(175),U,2)),?73,$$P($PIECE(BDMCUML(175),U,2),$PIECE(V,U,6))
+5 WRITE !,?7,"eGFR 30-59 ml/min",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(BDMCUML(175),U,2)),?73,$$P($PIECE(BDMCUML(175),U,2),$PIECE(V,U,7))
+6 WRITE !,?7,"eGFR 15-29 ml/min",?49,$$C($PIECE(V,U,8)),?61,$$C($PIECE(BDMCUML(175),U,2)),?73,$$P($PIECE(BDMCUML(175),U,2),$PIECE(V,U,8))
+7 WRITE !,?7,"eGFR < 15 ml/min",?49,$$C($PIECE(V,U,9)),?61,$$C($PIECE(BDMCUML(175),U,2)),?73,$$P($PIECE(BDMCUML(175),U,2),$PIECE(V,U,9))
+8 WRITE !,?7,"eGFR Not tested or no valid result",?49,$$C($PIECE(V,U,10)),?61,$$C($PIECE(BDMCUML(175),U,2)),?73,$$P($PIECE(BDMCUML(175),U,2),$PIECE(V,U,10))
URIN ;
+1 IF $Y>(BDMIOSL-15)
DO HEADER
IF BDMQUIT
QUIT
+2 WRITE !
+3 SET V=$GET(BDMCUML(145))
+4 WRITE !,"Urine Albumin:Creatinine Ratio (UACR)"
+5 WRITE !?5,"Yes",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?5,"No",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !!,"In patients with UACR:"
+8 WRITE !?5,"Urine albumin excretion - Normal <30 mg/g",?49,$$C($PIECE(V,U,12)),?61,$$C($PIECE(V,U,3)),?73,$$P($PIECE(V,U,3),$PIECE(V,U,12))
+9 WRITE !?5,"Urine albumin excretion - Increased",!?9,"30-300 mg/g",?49,$$C($PIECE(V,U,13)),?61,$$C($PIECE(V,U,3)),?73,$$P($PIECE(V,U,3),$PIECE(V,U,13))
+10 WRITE !?9,">300 mg/g",?49,$$C($PIECE(V,U,14)),?61,$$C($PIECE(V,U,3)),?73,$$P($PIECE(V,U,3),$PIECE(V,U,14))
+11 WRITE !!?2,"In patients age 18 and above ",!?11,"with eGFR =>30, UACR done",?49,$$C($PIECE(V,U,21)),?61,$$C($PIECE(V,U,20)),?73,$$P($PIECE(V,U,20),$PIECE(V,U,21))
+12 ;
CVD ;
+1 IF $Y>(BDMIOSL-4)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(250))
WRITE !!,$PIECE(V,U)
+3 WRITE !?5,"Diagnosed CVD",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
TBC ;
+1 IF $Y>(BDMIOSL-10)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(70))
WRITE !!,$PIECE(V,U)
+3 WRITE !!?5,"TB Test done (skin or blood)",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 WRITE !?9,"If test done, skin test",?49,$$C($PIECE(V,U,4)),?61,$$C($PIECE(V,U,3)),?73,$$P($PIECE(V,U,3),$PIECE(V,U,4))
+5 WRITE !?9,"If test done, blood test",?49,$$C($PIECE(V,U,5)),?61,$$C($PIECE(V,U,3)),?73,$$P($PIECE(V,U,3),$PIECE(V,U,5))
+6 WRITE !?5,"If TB test done, positive result",?49,$$C($PIECE(V,U,6)),?61,$$C($PIECE(V,U,3)),?73,$$P($PIECE(V,U,3),$PIECE(V,U,6))
+7 WRITE !?5,"If positive TB test, treatment",?49,$$C($PIECE(V,U,7)),?61,$$C($PIECE(V,U,6)),?73,$$P($PIECE(V,U,6),$PIECE(V,U,7)),!?9,"completed"
+8 WRITE !?5,"If negative TB test, after DM",?49,$$C($PIECE(V,U,8)),?61,$$C($PIECE(V,U,9)),?73,$$P($PIECE(V,U,9),$PIECE(V,U,8)),!?9,"diagnosis"
+9 ;
COMBINED ;
+1 IF $Y>(BDMIOSL-4)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(260))
WRITE !!,$PIECE(V,U)
+3 WRITE !?5,"Patients meeting ALL of the following",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3)),!?5,"criteria: A1C <8.0, LDL <100, ",!?5,"and mean BP <140/<90"
+4 IF $Y>(BDMIOSL-4)
DO HEADER
IF BDMQUIT
QUIT
+5 SET V=$GET(BDMCUML(270))
+6 WRITE !!?5,"In age 18 and above, patients with",?49,$$C($PIECE(V,U,3)),?61,$$C($PIECE(V,U,2)),?73,$$P($PIECE(V,U,2),$PIECE(V,U,3)),!?5,"both an eGFR and a UACR"
SDM ;
+1 IF $Y>(BDMIOSL-6)
DO HEADER
IF BDMQUIT
QUIT
+2 WRITE !!!,"* Known hypertension: Has hypertension listed as an active problem, or ",!,"three visits with a diagnosis of hypertension ever (prior to the end ",!,"of the Audit period)."
+3 WRITE !,"** Increased urine albumin excretion: UACR =>30 mg/g."
+4 QUIT
EXIT ;
+1 IF $EXTRACT(IOST)="C"
IF IO=IO(0)
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 ;O is old
+2 NEW Z
+3 IF O=0!(N=0)
QUIT "**"
+4 NEW X,X2,X3
+5 SET X=N
SET X2=1
SET X3=0
DO COMMA^%DTC
SET N=X
+6 SET X=O
SET X2=1
SET X3=0
DO COMMA^%DTC
SET O=X
+7 SET Z=(((N-O)/O)*100)
SET Z=$FNUMBER(Z,"+,",1)
+8 QUIT Z
P(D,N) ;return %
+1 IF 'D
QUIT ""
+2 IF 'N
QUIT " 0%"
+3 NEW X
SET X=N/D
SET X=X*100
SET X=$JUSTIFY(X,3,0)
+4 QUIT X_"%"
C(X,X2,X3) ;
+1 IF '$GET(X2)
SET X2=0
+2 IF '$GET(X3)
SET X3=6
+3 DO COMMA^%DTC
+4 QUIT X
+1 DO HEADER^BDMDC14
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 ;----------
USR() ;EP -
+1 QUIT $SELECT($GET(DUZ):$SELECT($DATA(^VA(200,DUZ,0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
+2 ;----------
LOC() ;EP - Return location name from file 4 based on DUZ(2).
+1 QUIT $SELECT($GET(DUZ(2)):$SELECT($DATA(^DIC(4,DUZ(2),0)):$PIECE(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
+2 ;----------