Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APCLD20A

APCLD20A.m

Go to the documentation of this file.
  1. APCLD20A ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ;
  1. ;;2.0;IHS PCC SUITE;;MAY 14, 2009
  1. ;
  1. ;
  1. ASPIRIN ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(100)) W !!,$P(V,U)
  1. W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"Undetermined",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. ACE ;
  1. I $Y>(IOSL-6) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(110)) W !!,$P(V,U)
  1. W !?7,"Use in pts with overt proteinuria",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,3),$P(V,U,4))
  1. W !?7,"Use in pts with known hypertension",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,5),$P(V,U,6))
  1. LIPID ;
  1. I $Y>(IOSL-6) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(115)) W !!,$P(V,U)
  1. 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))
  1. W !?7,"Use in pts with LDL chol > 160",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,5),$P(V,U,6))
  1. EXAMS ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(120)) W !!,$P(V,U),?69,"(% refused)"
  1. 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))," )"
  1. 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))," )"
  1. 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))," )"
  1. 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))," )"
  1. EDUC ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(130)) W !!,$P(V,U),?69,"(% refused)"
  1. W !?7,"Diet Instruction",?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))," )"
  1. 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))," )"
  1. 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))," )"
  1. W !?7,"Any of the above topics",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. IMM ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(140)) W !!,$P(V,U),?69,"(% refused)"
  1. 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))," )"
  1. 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))," )"
  1. 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))," )"
  1. URIN ;
  1. I $Y>(IOSL-13) D HEADER Q:APCLQUIT
  1. W !!,"LABORATORY EXAMS",!
  1. S V=$G(APCLCUML(145))
  1. W !,"Urinalysis in the past 12 months",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !!,"Proteinuria present",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !,"Proteinuria absent",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. W !,"Proteinuria not tested/unknown",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. W !!?7,"Of the ",$$C($P(V,U,5))," without proteinuria:"
  1. W !?9,"Microalbuminuria present",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,5),$P(V,U,7))
  1. W !?9,"Microalbuminuria absent",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,5),$P(V,U,8))
  1. W !?9,"Microalbuminuria not tested",?53,$$C($P(V,U,9)),?65,$$P($P(V,U,5),$P(V,U,9))
  1. CREAT ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(170)) S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,6)
  1. W !!,"Creatinine obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
  1. W !?7,"Creatinine >= 2.0 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"Creatinine < 2.0 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"Unable to determine result",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. W !?7,"Creatinine not tested/unknown",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. TOTAL ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(180))
  1. S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,7)
  1. W !!,"Total Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
  1. W !?7,"Desirable (<200 mg/dl)",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"Borderline (200-239 mg/dl)",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"High (240 mg/dl or more)",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. W !?7,"Unable to determine result",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
  1. W !?7,"Not tested",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. LDL ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(190))
  1. S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)+$P(V,U,8)
  1. W !!,"LDL Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
  1. W !?7,"LDL <100 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"LDL 100-129 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"LDL 130-160 mg/dl",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. W !?7,"LDL >160",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. W !?7,"Unable to determine result",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
  1. W !?7,"Not tested",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
  1. HDL ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(195))
  1. S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)+$P(V,U,8)
  1. W !!,"HDL Cholesterol obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
  1. W !?7,"HDL <35 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"HDL 35-45 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"HDL 46-55 mg/dl",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. W !?7,"HDL >55",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. W !?7,"Unable to determine result",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
  1. W !?7,"Not tested",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
  1. TRIG ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(200))
  1. S T=$P(V,U,3)+$P(V,U,4)+$P(V,U,5)+$P(V,U,6)+$P(V,U,8)
  1. W !!,"Triglycerides obtained in the past 12 months",?53,$$C(T),?65,$$P($P(V,U,2),T)
  1. W !?7,"TG <150 mg/dl",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"TG 150-199 mg/dl",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"TG 200-400 mg/dl",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. W !?7,"TG >400 mg/dl",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. W !?7,"Unable to determine result",?53,$$C($P(V,U,8)),?65,$$P($P(V,U,2),$P(V,U,8))
  1. W !?7,"Not tested",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
  1. ;
  1. EKG ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(150)) W !!,$P(V,U)
  1. W !?7,"Performed in past 3 years",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"Performed in past 5 years",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"Ever performed",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. TBC ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(70)) W !!,$P(V,U)
  1. W !?7,"PPD +,INH treatment complete",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"PPD +, untreated/incomplete or tx unknown",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"PPD -, placed since DM dx",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. W !?7,"PPD -, placed before DM dx or date unknown",?53,$$C($P(V,U,6)),?65,$$P($P(V,U,2),$P(V,U,6))
  1. ;W !?7,"Date of DM DX Unknown",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
  1. W !?7,"PPD status unknown",?53,$$C($P(V,U,7)),?65,$$P($P(V,U,2),$P(V,U,7))
  1. SELF ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(210)) W !!,$P(V,U)
  1. W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"Refused",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. SDM ;
  1. I $Y>(IOSL-5) D HEADER Q:APCLQUIT
  1. S V=$G(APCLCUML(220)) W !!,$P(V,U)
  1. W !?7,"Yes",?53,$$C($P(V,U,3)),?65,$$P($P(V,U,2),$P(V,U,3))
  1. W !?7,"No",?53,$$C($P(V,U,4)),?65,$$P($P(V,U,2),$P(V,U,4))
  1. W !?7,"Undetermined",?53,$$C($P(V,U,5)),?65,$$P($P(V,U,2),$P(V,U,5))
  1. Q
  1. EXIT ;
  1. 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
  1. Q
  1. CALC(N,O) ;ENTRY POINT
  1. ;N is new
  1. ;O is old
  1. NEW Z
  1. I O=0!(N=0) Q "**"
  1. NEW X,X2,X3
  1. S X=N,X2=1,X3=0 D COMMA^%DTC S N=X
  1. S X=O,X2=1,X3=0 D COMMA^%DTC S O=X
  1. S Z=(((N-O)/O)*100),Z=$FN(Z,"+,",1)
  1. Q Z
  1. P(D,N) ;return %
  1. I 'D Q ""
  1. I 'N Q " 0%"
  1. NEW X S X=N/D,X=X*100,X=$J(X,3,0)
  1. Q X_"%"
  1. C(X,X2,X3) ;
  1. I '$G(X2) S X2=0
  1. I '$G(X3) S X3=6
  1. D COMMA^%DTC
  1. Q X
  1. G:'APCLPG HEADER1
  1. 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 APCLQUIT=1 Q
  1. HEADER1 ;
  1. W:$D(IOF) @IOF S APCLPG=APCLPG+1
  1. W !?3,$P(^VA(200,DUZ,0),U,2),?35,$$FMTE^XLFDT(DT),?70,"Page ",APCLPG,!
  1. W !,$$CTR("*** HEALTH STATUS OF DIABETIC PATIENTS ***",80),!
  1. W $$CTR($P(^DIC(4,DUZ(2),0),U)),!
  1. S X="Reporting Period: "_$$FMTE^XLFDT(APCLBDAT)_" to "_$$FMTE^XLFDT(APCLADAT) W $$CTR(X,80),!
  1. W !,$TR($J("",80)," ","-")
  1. W !!,$P(APCLCUML(10),U,2)," patients were reviewed"
  1. W ?55," n",?63,"Percent"
  1. Q
  1. CTR(X,Y) ;EP - Center X in a field Y wide.
  1. Q $J("",$S($D(Y):Y,1:IOM)-$L(X)\2)_X
  1. ;----------
  1. EOP ;EP - End of page.
  1. Q:$E(IOST)'="C"
  1. Q:$D(ZTQUEUED)!'(IOT="TRM")!$D(IO("S"))
  1. NEW DIR
  1. K DIRUT,DFOUT,DLOUT,DTOUT,DUOUT
  1. S DIR(0)="E" D ^DIR
  1. Q
  1. ;----------
  1. USR() ;EP - Return name of current user from ^VA(200.
  1. Q $S($G(DUZ):$S($D(^VA(200,DUZ,0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ UNDEFINED OR 0")
  1. ;----------
  1. LOC() ;EP - Return location name from file 4 based on DUZ(2).
  1. Q $S($G(DUZ(2)):$S($D(^DIC(4,DUZ(2),0)):$P(^(0),U),1:"UNKNOWN"),1:"DUZ(2) UNDEFINED OR 0")
  1. ;----------