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

APCLD311.m

Go to the documentation of this file.
APCLD311 ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;
 ;
IMM ;
 S:'$D(APCLCUML(140)) APCLCUML(140)="IMMUNIZATIONS"
 S $P(APCLCUML(140),U,2)=$P(APCLCUML(140),U,2)+1
 S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,64))
 I $E(V)="Y" S $P(APCLCUML(140),U,3)=$P(APCLCUML(140),U,3)+1
 I $E(V)="R" S $P(APCLCUML(140),U,6)=$P(APCLCUML(140),U,6)+1
 S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,66))
 I $E(V)="Y" S $P(APCLCUML(140),U,4)=$P(APCLCUML(140),U,4)+1
 I $E(V)="R" S $P(APCLCUML(140),U,7)=$P(APCLCUML(140),U,7)+1
 S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,68))
 I $E(V)="Y" S $P(APCLCUML(140),U,5)=$P(APCLCUML(140),U,5)+1
 I $E(V)="R" S $P(APCLCUML(140),U,8)=$P(APCLCUML(140),U,8)+1
URIN ;
 ;title^total^total with urinalysis^protein present^protein absent^protein not done^micro present^micro absent^micro not done
 ;145
 S:'$D(APCLCUML(145)) APCLCUML(145)="URINALYSIS"
 S $P(APCLCUML(145),U,2)=$P(APCLCUML(145),U,2)+1
 S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,92))
 S A=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,94))
 I $E(V)="Y" S $P(APCLCUML(145),U,3)=$P(APCLCUML(145),U,3)+1
 I $E(A)="Y" S $P(APCLCUML(145),U,4)=$P(APCLCUML(145),U,4)+1
 I A["No result" S $P(APCLCUML(145),U,6)=$P(APCLCUML(145),U,6)+1 G EKG
 I $E(A)="N" S $P(APCLCUML(145),U,5)=$P(APCLCUML(145),U,5)+1 D
 .S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,96))
 .I $E(V,1,3)="Pos" S $P(APCLCUML(145),U,7)=$P(APCLCUML(145),U,7)+1 Q
 .I $E(V,1,3)="Neg" S $P(APCLCUML(145),U,8)=$P(APCLCUML(145),U,8)+1 Q
 .S $P(APCLCUML(145),U,9)=$P(APCLCUML(145),U,9)+1
 .Q
EKG ;need date of last ekg
 S:'$D(APCLCUML(150)) APCLCUML(150)="EKG"
 S $P(APCLCUML(150),U,2)=$P(APCLCUML(150),U,2)+1
 S V=$$EKG^APCLD312(APCLPD,APCLRED,"I")
 I V]"" D
 .S E=$$FMDIFF^XLFDT(APCLADAT,V)
 .I E<(365.25*3) S $P(APCLCUML(150),U,3)=$P(APCLCUML(150),U,3)+1
 .I E<(365.25*5) S $P(APCLCUML(150),U,4)=$P(APCLCUML(150),U,4)+1
 .S $P(APCLCUML(150),U,5)=$P(APCLCUML(150),U,5)+1
CREAT ;
 S:'$D(APCLCUML(170)) APCLCUML(170)="Creatinine obtained in the past 12 months"
 S $P(APCLCUML(170),U,2)=$P(APCLCUML(170),U,2)+1
 S V=$$CREAT^APCLD318(APCLPD,APCLRBD,APCLRED,"I")
 I V="" S $P(APCLCUML(170),U,5)=$P(APCLCUML(170),U,5)+1 G TCHOL
 S V=$P(V,U)
 I $E(V)'=+$E(V),$E(V)'="." S $P(APCLCUML(170),U,6)=$P(APCLCUML(170),U,6)+1 G TCHOL ;unable to determine result, not a number
 I V>1.9 S $P(APCLCUML(170),U,3)=$P(APCLCUML(170),U,3)+1
 I V<2.0 S $P(APCLCUML(170),U,4)=$P(APCLCUML(170),U,4)+1
TCHOL ;
 S:'$D(APCLCUML(180)) APCLCUML(180)="Total Cholesterol obtained in past 12 months"
 S $P(APCLCUML(180),U,2)=$P(APCLCUML(180),U,2)+1
 S V=$$CHOL^APCLD318(APCLPD,APCLRBD,APCLRED,"I")
 I V="" S $P(APCLCUML(180),U,6)=$P(APCLCUML(180),U,6)+1 G LDL
 S V=$P(V,U)
 I $E(V)'=+$E(V) S $P(APCLCUML(180),U,7)=$P(APCLCUML(180),U,7)+1 G LDL ;unable to determine result, not a number or is blank
 I V<200 S $P(APCLCUML(180),U,3)=$P(APCLCUML(180),U,3)+1
 I V<240&(V>199) S $P(APCLCUML(180),U,4)=$P(APCLCUML(180),U,4)+1
 I V>239 S $P(APCLCUML(180),U,5)=$P(APCLCUML(180),U,5)+1
LDL ;
 S:'$D(APCLCUML(190)) APCLCUML(190)="LDL Cholesterol obtained in the past 12 months"
 S $P(APCLCUML(190),U,2)=$P(APCLCUML(190),U,2)+1
 S V=$$LDL^APCLD318(APCLPD,APCLRBD,APCLRED,"I")
 I V="" S $P(APCLCUML(190),U,7)=$P(APCLCUML(190),U,7)+1 G HDL
 S V=$P(V,U)
 I $E(V)'=+$E(V) S $P(APCLCUML(190),U,8)=$P(APCLCUML(190),U,8)+1 G HDL ;unable to determine result, not a number or blank
 I V<100 S $P(APCLCUML(190),U,3)=$P(APCLCUML(190),U,3)+1
 I V<130&(V>99) S $P(APCLCUML(190),U,4)=$P(APCLCUML(190),U,4)+1
 I V>129&(V<161) S $P(APCLCUML(190),U,5)=$P(APCLCUML(190),U,5)+1
 I V>160 S $P(APCLCUML(190),U,6)=$P(APCLCUML(190),U,6)+1
HDL ;
 S:'$D(APCLCUML(195)) APCLCUML(195)="HDL Cholesterol obtained in the past 12 months"
 S $P(APCLCUML(195),U,2)=$P(APCLCUML(195),U,2)+1
 S V=$$HDL^APCLD318(APCLPD,APCLRBD,APCLRED,"I")
 I V="" S $P(APCLCUML(195),U,7)=$P(APCLCUML(195),U,7)+1 G TRIG
 S V=$P(V,U)
 I $E(V)'=+$E(V) S $P(APCLCUML(195),U,8)=$P(APCLCUML(195),U,8)+1 G TRIG ;unable to determine result, not a number
 S V=$P(V,".")
 I V<35 S $P(APCLCUML(195),U,3)=$P(APCLCUML(195),U,3)+1
 I V<46&(V>34) S $P(APCLCUML(195),U,4)=$P(APCLCUML(195),U,4)+1
 I V>45&(V<56) S $P(APCLCUML(195),U,5)=$P(APCLCUML(195),U,5)+1
 I V>55 S $P(APCLCUML(195),U,6)=$P(APCLCUML(195),U,6)+1
TRIG ;
 S:'$D(APCLCUML(200)) APCLCUML(200)="Triglycerides obtained in past 12 months"
 S $P(APCLCUML(200),U,2)=$P(APCLCUML(200),U,2)+1
 S V=$$TRIG^APCLD318(APCLPD,APCLRBD,APCLRED,"I")
 I V="" S $P(APCLCUML(200),U,7)=$P(APCLCUML(200),U,7)+1 G SELF
 S V=$P(V,U)
 I $E(V)'=+$E(V) S $P(APCLCUML(200),U,8)=$P(APCLCUML(200),U,8)+1 G SELF ;unable to determine result, not a number
 I V<150 S $P(APCLCUML(200),U,3)=$P(APCLCUML(200),U,3)+1
 I V<200&(V>149) S $P(APCLCUML(200),U,4)=$P(APCLCUML(200),U,4)+1
 I V>199&(V<401) S $P(APCLCUML(200),U,5)=$P(APCLCUML(200),U,5)+1
 I V>400 S $P(APCLCUML(200),U,6)=$P(APCLCUML(200),U,6)+1
SELF ;
 S:'$D(APCLCUML(210)) APCLCUML(210)="Self monitoring of blood glucose documented"
 S $P(APCLCUML(210),U,2)=$P(APCLCUML(210),U,2)+1
 S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,98))
 S P=$S($E(V)="Y":3,$E(V)="N":4,$E(V)="R":5,1:6)
 S $P(APCLCUML(210),U,P)=$P(APCLCUML(210),U,P)+1
SDM  ;
 Q  ;NOT IN 2003
 S:'$D(APCLCUML(220)) APCLCUML(220)="Participating in SDM"
 S $P(APCLCUML(220),U,2)=$P(APCLCUML(220),U,2)+1
 S V=$G(^XTMP("APCLDM31",APCLJOB,APCLBTH,"AUDIT",APCLPD,100))
 S P=$S($E(V)="Y":3,1:4)
 S $P(APCLCUML(220),U,P)=$P(APCLCUML(220),U,P)+1
 Q
CESS(P,B,D) ;EP - find any cessation hf in 12 months before E
 I '$G(P) Q ""
 NEW APCL,E,X,G,T
 K APCL
 S X=P_"^LAST HEALTH [DM AUDIT CESSATION HLTH FACTOR;DURING "_B_"-"_D S E=$$START1^APCLDF(X,"APCL(")
 I $D(APCL(1)) Q "Yes-"_$$FMTE^XLFDT($P(APCL(1),U))
 S X=P_"^EDUC [DM AUDIT SMOKING CESS EDUC;DURING "_B_"-"_D S E=$$START1^APCLDF(X,"APCL(")
 I $D(APCL(1)) Q "Yes-"_$$FMTE^XLFDT($P(APCL(1),U))
 NEW T S T=$O(^ATXAX("B","DM AUDIT SMOKING CESS EDUC",0))
 I 'T Q "No"
 S (X,G)=0 F  S X=$O(^ATXAX(T,21,X)) Q:X'=+X!(G)  I $$REFUSAL^APCLD317(P,9999999.09,$P(^ATXAX(T,21,X,0),U),B,D) S G=1
 I G Q "Refused"
 Q "No"
 ;