BDMD81A ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ;
;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
;
;
ASPIRIN ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(100)) W !!,$P(V,U)
W !?7,"Aspirin/Antiplatelet Rx",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
;W !?7,"Other Antiplatelet Rx",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
;W !?7,"Both ASA & Other Rx",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
W !?7,"None",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
W !?7,"Refused or Adverse Rxn",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
ACE ;
I $Y>(BDMIOSL-6) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(110)) W !!,$P(V,U)
W !?7,"Use in pts with overt proteinuria",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,3),$P(V,U,4))
W !?7,"Use in pts with known hypertension",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,5),$P(V,U,6))
LIPID ;
I $Y>(BDMIOSL-11) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(115)) W !!,$P(V,U)
W !?7,"Use in pts with total chol >=240",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,3),$P(V,U,4))
W !?7,"Use in pts with LDL chol > 100",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,5),$P(V,U,6))
W !!?7,"Of the ",$P(V,U,7)," pts taking a lipid agent:"
W !?9,"Statin drug prescribed:",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,7),$P(V,U,8))
W !?9,"Non-statin drug prescribed:",?53,$$C($P(V,U,9)),?65,$$P($P(V,U,7),$P(V,U,9))
W !?9,"Statin AND non-statin prescribed:",?53,$$C($P(V,U,10)),?65,$$P($P(V,U,7),$P(V,U,10))
W !!?7,"Refused or Adverse Reaction: ",?53,$$C($P(V,U,11))
EXAMS ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(120)) W !!,$P(V,U),?69,"(% refused)"
W !?7,"Foot Exam - Neuro & Vasc",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3)),?71,"( ",$$P($P(V,U,2),$P(V,U,6))," )"
W !?7,"Eye Exam - Dilated",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4)),?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?7,"Dental Exam",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5)),?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
;W !?7,"Pap Smear (Females Only)",?53,$$C($P(V,U,10)),?65,$$P($P(V,U,9),$P(V,U,10)),?71,"( ",$$P($P(V,U,9),$P(V,U,11))," )"
IMM ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(140)) W !!,$P(V,U),?69,"(% refused)"
W !?7,"Flu Vaccine - yearly",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3)),?71,"( ",$$P($P(V,U,2),$P(V,U,6))," )"
W !?7,"Pneumovax - once",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4)),?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?7,"Tetanus/Diptheria (q 10 yrs)",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5)),?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
URIN ;
I $Y>(BDMIOSL-14) D HEADER Q:BDMQUIT
W !!,"LABORATORY EXAMS",!
S V=$G(BDMCUML(145))
K PTOT
S PTOT=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)
W !,"Quantitative urine protein in the past 12 months",?53,$$C(PTOT),?65,$$P($P(BDMCUML(10),U,2),PTOT)
;TODO cmi/maw 12/26/2007 DM2008 how do we want UPCR and other quantitative to look
W !!,"Albumin:Creatinine ratio (UACR)",?53,$$C($P(V,U,3)),?65,$$P($P(BDMCUML(10),U,2),$P(V,U,3))
W !,"Protein:Creatinine ratio (UPCR)",?53,$$C($P(V,U,4)),?65,$$P($P(BDMCUML(10),U,2),$P(V,U,4))
W !,"Other quantitative urine protein test",?53,$$C($P(V,U,5)),?65,$$P($P(BDMCUML(10),U,2),$P(V,U,5))
W !,"Urine protein testing not done/unknown" S Z=$P(BDMCUML(10),U,2)-(PTOT) W ?53,$$C(Z),?65,$$P($P(BDMCUML(10),U,2),Z)
;W !!?7,"Of the ",$$C($P(V,U,5))," without proteinuria:"
W !!?7,"Of the ",$$C($P(V,U,3))," pts tested with a UACR:"
W !?9,"Albumin level within normal limits",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,3),$P(V,U,6))
W !?9,"Microalbuminuria present",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,3),$P(V,U,7))
W !?9,"Overt Proteinuria present",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,3),$P(V,U,8))
;W !?9,"Microalbuminuria not tested",?53,$$C($P(V,U,9)),?65,$$P($P(V,U,5),$P(V,U,9))
CREAT ;
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(170)) S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,6)
W !!,"Creatinine obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
W !?7,"Creatinine >= 2.0 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"Creatinine < 2.0 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"Unable to determine result",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
W !?7,"Creatinine not tested/unknown",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
;
GFR ;cmi/maw 12/26/2007 DM2008
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(175)) S T=$P(V,U,5)
W !!,"Estimated GFR documented during audit period",?53,$$C(T),?65,$$P($P(BDMCUML(10),U,2),T)
;
TOTAL ;
I $Y>(BDMIOSL-9) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(180))
S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,7)
W !!,"Total Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
W !?7,"Desirable (<200 mg/dl)",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"Borderline (200-239 mg/dl)",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"High (240 mg/dl or more)",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
W !?7,"Unable to determine result",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
W !?7,"Not tested",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
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)+$P(V,U,8)
W !!,"LDL Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
W !?7,"LDL <100 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"LDL 100-129 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"LDL 130-160 mg/dl",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
W !?7,"LDL >160",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
W !?7,"Unable to determine result",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
W !?7,"Not tested",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
HDL ;
I $Y>(BDMIOSL-9) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(195))
S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)+$P(V,U,8)
W !!,"HDL Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
W !?7,"HDL <35 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"HDL 35-45 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"HDL 46-55 mg/dl",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
W !?7,"HDL >55",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
W !?7,"Unable to determine result",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
W !?7,"Not tested",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
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)+$P(V,U,8)
W !!,"Triglycerides obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
W !?7,"TG <150 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"TG 150-199 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"TG 200-400 mg/dl",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
W !?7,"TG >400 mg/dl",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
W !?7,"Unable to determine result",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
W !?7,"Not tested",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
;
EKG ;
I $Y>(BDMIOSL-7) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(150)) W !!,$P(V,U)
W !?7,"Performed in past 3 years",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"Performed in past 5 years",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"Ever performed",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
TBC ;
I $Y>(BDMIOSL-11) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(70)) W !!,$P(V,U)
W !?7,"PPD +,INH treatment complete",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?7,"PPD +, untreated/incomplete or tx unknown",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?7,"PPD -, placed since DM dx",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
W !?7,"PPD -, placed before DM dx",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
;W !?7,"Date of DM DX Unknown",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
W !?7,"PPD status unknown",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
W !?7,"PPD -, date of Dx or PPD date unknown",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
W !?7,"PPD Refused",?53,$$C($P(V,U,9)),?65,$$P($P(V,U,2),$P(V,U,9))
EDUC ;
I $Y>(BDMIOSL-8) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(130)) W !!,$P(V,U),?69,"(% refused)"
W !?7,"Diet Instruction by any provider",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3)),?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?7,"Diet Instruction by RD",?53,$$C($P(V,U,10)),?65,$$P($P(V,U,2),$P(V,U,10)),?71,"( ",$$P($P(V,U,2),$P(V,U,7))," )"
W !?7,"Exercise Instruction",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4)),?71,"( ",$$P($P(V,U,2),$P(V,U,8))," )"
W !?7,"Other Diabetes Education",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5)),?71,"( ",$$P($P(V,U,2),$P(V,U,9))," )"
W !?7,"Any of the above topics",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
SELF ;
;I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
;S V=$G(BDMCUML(210)) W !!,$P(V,U)
;W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
;W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
;W !?7,"Refused",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
DEP ;
I $Y>(BDMIOSL-6) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(300)) W !!,"DEPRESSION identified as an active dx"
W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
S Z=$P(V,U,2)-$P(V,U,3)
W !?7,"No",?53,$$C(Z),?65,$$P($P(V,U,2),Z)
;screening
I $Y>(BDMIOSL-13) D HEADER Q:BDMQUIT
S V=$G(BDMCUML(301))
W !!?7,"Of the ",Z," pts without an active dx"
W !?7,"of depression, proportion screened"
W !?7,"for depression in past year:"
W !?13,"Screened",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
W !?13,"Not Screened",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
W !?13,"Refused Screening",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
SDM ;
;Q ;not in 2008 audit
;I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
;S V=$G(BDMCUML(220)) W !!,$P(V,U)
;W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
;W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
;W !?7,"Undetermined",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
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
G:'BDMPG HEADER1
K DIR 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 S BDMPG=BDMPG+1
I $G(BDMGUI) W !,"ZZZZZZZ"
W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BDMPG,!
W !,$$CTR("*** HEALTH STATUS OF DIABETIC PATIENTS ***",80),!
W $$CTR($P(^DIC(4,DUZ(2),0),U)),!
S X="Reporting Period: "_$$FMTE^XLFDT(BDMBDAT)_" to "_$$FMTE^XLFDT(BDMADAT) W $$CTR(X,80),!
W !,$TR($J("",80)," ","-")
W !!,$P(BDMCUML(10),U,2)," patients were reviewed"
W ?55," n",?63,"Percent"
Q
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")
;----------
BDMD81A ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ;
+1 ;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
+2 ;
+3 ;
ASPIRIN ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(100))
WRITE !!,$PIECE(V,U)
+3 WRITE !?7,"Aspirin/Antiplatelet Rx",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 ;W !?7,"Other Antiplatelet Rx",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
+5 ;W !?7,"Both ASA & Other Rx",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
+6 WRITE !?7,"None",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+7 WRITE !?7,"Refused or Adverse Rxn",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,7))
ACE ;
+1 IF $Y>(BDMIOSL-6)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(110))
WRITE !!,$PIECE(V,U)
+3 WRITE !?7,"Use in pts with overt proteinuria",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,3),$PIECE(V,U,4))
+4 WRITE !?7,"Use in pts with known hypertension",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,5),$PIECE(V,U,6))
LIPID ;
+1 IF $Y>(BDMIOSL-11)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(115))
WRITE !!,$PIECE(V,U)
+3 WRITE !?7,"Use in pts with total chol >=240",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,3),$PIECE(V,U,4))
+4 WRITE !?7,"Use in pts with LDL chol > 100",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,5),$PIECE(V,U,6))
+5 WRITE !!?7,"Of the ",$PIECE(V,U,7)," pts taking a lipid agent:"
+6 WRITE !?9,"Statin drug prescribed:",?53,$$C($PIECE(V,U,8)),?65,$$P($PIECE(V,U,7),$PIECE(V,U,8))
+7 WRITE !?9,"Non-statin drug prescribed:",?53,$$C($PIECE(V,U,9)),?65,$$P($PIECE(V,U,7),$PIECE(V,U,9))
+8 WRITE !?9,"Statin AND non-statin prescribed:",?53,$$C($PIECE(V,U,10)),?65,$$P($PIECE(V,U,7),$PIECE(V,U,10))
+9 WRITE !!?7,"Refused or Adverse Reaction: ",?53,$$C($PIECE(V,U,11))
EXAMS ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(120))
WRITE !!,$PIECE(V,U),?69,"(% refused)"
+3 WRITE !?7,"Foot Exam - Neuro & Vasc",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,6))," )"
+4 WRITE !?7,"Eye Exam - Dilated",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,7))," )"
+5 WRITE !?7,"Dental Exam",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,8))," )"
+6 ;W !?7,"Pap Smear (Females Only)",?53,$$C($P(V,U,10)),?65,$$P($P(V,U,9),$P(V,U,10)),?71,"( ",$$P($P(V,U,9),$P(V,U,11))," )"
IMM ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(140))
WRITE !!,$PIECE(V,U),?69,"(% refused)"
+3 WRITE !?7,"Flu Vaccine - yearly",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,6))," )"
+4 WRITE !?7,"Pneumovax - once",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,7))," )"
+5 WRITE !?7,"Tetanus/Diptheria (q 10 yrs)",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,8))," )"
URIN ;
+1 IF $Y>(BDMIOSL-14)
DO HEADER
IF BDMQUIT
QUIT
+2 WRITE !!,"LABORATORY EXAMS",!
+3 SET V=$GET(BDMCUML(145))
+4 KILL PTOT
+5 SET PTOT=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,5)
+6 WRITE !,"Quantitative urine protein in the past 12 months",?53,$$C(PTOT),?65,$$P($PIECE(BDMCUML(10),U,2),PTOT)
+7 ;TODO cmi/maw 12/26/2007 DM2008 how do we want UPCR and other quantitative to look
+8 WRITE !!,"Albumin:Creatinine ratio (UACR)",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(BDMCUML(10),U,2),$PIECE(V,U,3))
+9 WRITE !,"Protein:Creatinine ratio (UPCR)",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(BDMCUML(10),U,2),$PIECE(V,U,4))
+10 WRITE !,"Other quantitative urine protein test",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(BDMCUML(10),U,2),$PIECE(V,U,5))
+11 WRITE !,"Urine protein testing not done/unknown"
SET Z=$PIECE(BDMCUML(10),U,2)-(PTOT)
WRITE ?53,$$C(Z),?65,$$P($PIECE(BDMCUML(10),U,2),Z)
+12 ;W !!?7,"Of the ",$$C($P(V,U,5))," without proteinuria:"
+13 WRITE !!?7,"Of the ",$$C($PIECE(V,U,3))," pts tested with a UACR:"
+14 WRITE !?9,"Albumin level within normal limits",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,3),$PIECE(V,U,6))
+15 WRITE !?9,"Microalbuminuria present",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,3),$PIECE(V,U,7))
+16 WRITE !?9,"Overt Proteinuria present",?53,$$C($PIECE(V,U,8)),?65,$$P($PIECE(V,U,3),$PIECE(V,U,8))
+17 ;W !?9,"Microalbuminuria not tested",?53,$$C($P(V,U,9)),?65,$$P($P(V,U,5),$P(V,U,9))
CREAT ;
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(170))
SET T=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,6)
+3 WRITE !!,"Creatinine obtained in the past 12 months",?53,$$C(T),?65,$$P($PIECE(V,U,2),T)
+4 WRITE !?7,"Creatinine >= 2.0 mg/dl",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+5 WRITE !?7,"Creatinine < 2.0 mg/dl",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+6 WRITE !?7,"Unable to determine result",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+7 WRITE !?7,"Creatinine not tested/unknown",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 ;
GFR ;cmi/maw 12/26/2007 DM2008
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(175))
SET T=$PIECE(V,U,5)
+3 WRITE !!,"Estimated GFR documented during audit period",?53,$$C(T),?65,$$P($PIECE(BDMCUML(10),U,2),T)
+4 ;
TOTAL ;
+1 IF $Y>(BDMIOSL-9)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(180))
+3 SET T=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,5)+$PIECE(V,U,7)
+4 WRITE !!,"Total Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($PIECE(V,U,2),T)
+5 WRITE !?7,"Desirable (<200 mg/dl)",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?7,"Borderline (200-239 mg/dl)",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?7,"High (240 mg/dl or more)",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?7,"Unable to determine result",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,7))
+9 WRITE !?7,"Not tested",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
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)+$PIECE(V,U,8)
+4 WRITE !!,"LDL Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($PIECE(V,U,2),T)
+5 WRITE !?7,"LDL <100 mg/dl",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?7,"LDL 100-129 mg/dl",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?7,"LDL 130-160 mg/dl",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?7,"LDL >160",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+9 WRITE !?7,"Unable to determine result",?53,$$C($PIECE(V,U,8)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,8))
+10 WRITE !?7,"Not tested",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,7))
HDL ;
+1 IF $Y>(BDMIOSL-9)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(195))
+3 SET T=$PIECE(V,U,3)+$PIECE(V,U,4)+$PIECE(V,U,5)+$PIECE(V,U,6)+$PIECE(V,U,8)
+4 WRITE !!,"HDL Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($PIECE(V,U,2),T)
+5 WRITE !?7,"HDL <35 mg/dl",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?7,"HDL 35-45 mg/dl",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?7,"HDL 46-55 mg/dl",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?7,"HDL >55",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+9 WRITE !?7,"Unable to determine result",?53,$$C($PIECE(V,U,8)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,8))
+10 WRITE !?7,"Not tested",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,7))
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)+$PIECE(V,U,8)
+4 WRITE !!,"Triglycerides obtained in the past 12 months",?53,$$C(T),?65,$$P($PIECE(V,U,2),T)
+5 WRITE !?7,"TG <150 mg/dl",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+6 WRITE !?7,"TG 150-199 mg/dl",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+7 WRITE !?7,"TG 200-400 mg/dl",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+8 WRITE !?7,"TG >400 mg/dl",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+9 WRITE !?7,"Unable to determine result",?53,$$C($PIECE(V,U,8)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,8))
+10 WRITE !?7,"Not tested",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,7))
+11 ;
EKG ;
+1 IF $Y>(BDMIOSL-7)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(150))
WRITE !!,$PIECE(V,U)
+3 WRITE !?7,"Performed in past 3 years",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 WRITE !?7,"Performed in past 5 years",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+5 WRITE !?7,"Ever performed",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
TBC ;
+1 IF $Y>(BDMIOSL-11)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(70))
WRITE !!,$PIECE(V,U)
+3 WRITE !?7,"PPD +,INH treatment complete",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 WRITE !?7,"PPD +, untreated/incomplete or tx unknown",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+5 WRITE !?7,"PPD -, placed since DM dx",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
+6 WRITE !?7,"PPD -, placed before DM dx",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
+7 ;W !?7,"Date of DM DX Unknown",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
+8 WRITE !?7,"PPD status unknown",?53,$$C($PIECE(V,U,7)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,7))
+9 WRITE !?7,"PPD -, date of Dx or PPD date unknown",?53,$$C($PIECE(V,U,8)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,8))
+10 WRITE !?7,"PPD Refused",?53,$$C($PIECE(V,U,9)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,9))
EDUC ;
+1 IF $Y>(BDMIOSL-8)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(130))
WRITE !!,$PIECE(V,U),?69,"(% refused)"
+3 WRITE !?7,"Diet Instruction by any provider",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,7))," )"
+4 WRITE !?7,"Diet Instruction by RD",?53,$$C($PIECE(V,U,10)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,10)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,7))," )"
+5 WRITE !?7,"Exercise Instruction",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,8))," )"
+6 WRITE !?7,"Other Diabetes Education",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5)),?71,"( ",$$P($PIECE(V,U,2),$PIECE(V,U,9))," )"
+7 WRITE !?7,"Any of the above topics",?53,$$C($PIECE(V,U,6)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,6))
SELF ;
+1 ;I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
+2 ;S V=$G(BDMCUML(210)) W !!,$P(V,U)
+3 ;W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
+4 ;W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
+5 ;W !?7,"Refused",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
DEP ;
+1 IF $Y>(BDMIOSL-6)
DO HEADER
IF BDMQUIT
QUIT
+2 SET V=$GET(BDMCUML(300))
WRITE !!,"DEPRESSION identified as an active dx"
+3 WRITE !?7,"Yes",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+4 SET Z=$PIECE(V,U,2)-$PIECE(V,U,3)
+5 WRITE !?7,"No",?53,$$C(Z),?65,$$P($PIECE(V,U,2),Z)
+6 ;screening
+7 IF $Y>(BDMIOSL-13)
DO HEADER
IF BDMQUIT
QUIT
+8 SET V=$GET(BDMCUML(301))
+9 WRITE !!?7,"Of the ",Z," pts without an active dx"
+10 WRITE !?7,"of depression, proportion screened"
+11 WRITE !?7,"for depression in past year:"
+12 WRITE !?13,"Screened",?53,$$C($PIECE(V,U,3)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,3))
+13 WRITE !?13,"Not Screened",?53,$$C($PIECE(V,U,4)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,4))
+14 WRITE !?13,"Refused Screening",?53,$$C($PIECE(V,U,5)),?65,$$P($PIECE(V,U,2),$PIECE(V,U,5))
SDM ;
+1 ;Q ;not in 2008 audit
+2 ;I $Y>(BDMIOSL-5) D HEADER Q:BDMQUIT
+3 ;S V=$G(BDMCUML(220)) W !!,$P(V,U)
+4 ;W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
+5 ;W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
+6 ;W !?7,"Undetermined",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
+7 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 IF 'BDMPG
GOTO HEADER1
+2 KILL DIR
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
+1 IF $DATA(IOF)
WRITE @IOF
SET BDMPG=BDMPG+1
+2 IF $GET(BDMGUI)
WRITE !,"ZZZZZZZ"
+3 WRITE !?3,$PIECE(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",BDMPG,!
+4 WRITE !,$$CTR("*** HEALTH STATUS OF DIABETIC PATIENTS ***",80),!
+5 WRITE $$CTR($PIECE(^DIC(4,DUZ(2),0),U)),!
+6 SET X="Reporting Period: "_$$FMTE^XLFDT(BDMBDAT)_" to "_$$FMTE^XLFDT(BDMADAT)
WRITE $$CTR(X,80),!
+7 WRITE !,$TRANSLATE($JUSTIFY("",80)," ","-")
+8 WRITE !!,$PIECE(BDMCUML(10),U,2)," patients were reviewed"
+9 WRITE ?55," n",?63,"Percent"
+10 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 ;----------
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 ;----------