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

BDMDE1J.m

Go to the documentation of this file.
BDMDE1J ; IHS/CMI/LAB -IHS -CUMULATIVE REPORT 10 Oct 2014 9:50 AM ; 
 ;;2.0;DIABETES MANAGEMENT SYSTEM;**10,11**;JUN 14, 2007;Build 30
 ;
CUML ;EP
 ;
COMORBID ;USE 400
 S:'$D(BDMCUML(400)) BDMCUML(400)="Comorbidities"
 S $P(BDMCUML(400),U,2)=$P(BDMCUML(400),U,2)+1  ;TOTAL # of patients
 ;active depression piece 3
 S V=$G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,200))
 I $E(V)="1" S $P(BDMCUML(400),U,3)=$P(BDMCUML(400),U,3)+1,BDMCOMOR=BDMCOMOR+1
 ;tobacco use piece 4
 S V=$G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,27))
 I +V=1 S $P(BDMCUML(400),U,4)=$P(BDMCUML(400),U,4)+1,BDMCOMOR=BDMCOMOR+1
 ;SEVERELY OBESE PIECE 5
 I BDMSEVOB S $P(BDMCUML(400),U,5)=$P(BDMCUML(400),U,5)+1,BDMCOMOR=BDMCOMOR+1
 ;HYPERTENSION DIAGNOSED PIECE 6
 S H=$E($G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,34)))
 I $E(H)=1 S $P(BDMCUML(400),U,6)=$P(BDMCUML(400),U,6)+1,BDMCOMOR=BDMCOMOR+1
 ;HTN AND MEAN BP <140/<90 PIECE 7
 I $E(H)=1,BDMBP140 S $P(BDMCUML(400),U,7)=$P(BDMCUML(400),U,7)+1
 ;cvd piece 8
 S V=$G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,116))
 I $E(V)=1 S $P(BDMCUML(400),U,8)=$P(BDMCUML(400),U,8)+1,BDMCOMOR=BDMCOMOR+1
 ;
 ;CVD & BP <140/<90 PIECE 9
 I $E(V)=1,BDMBP140 S $P(BDMCUML(400),U,9)=$P(BDMCUML(400),U,9)+1
 ;CVD AND NOT A TOBACCO USER PIECE 10
 S T=$G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,27))
 I $E(T)=2,$E(V)=1 S $P(BDMCUML(400),U,10)=$P(BDMCUML(400),U,10)+1
 ;CVD AND STATIN PRESCRIBED PIECE 11
 S T=+$G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,300))
 I $E(V)=1,T=1 S $P(BDMCUML(400),U,11)=$P(BDMCUML(400),U,11)+1
 I $E(V)=1,T'=3 S $P(BDMCUML(400),U,34)=$P(BDMCUML(400),U,34)+1 ;DENOM W/O ALLERGY
 ;CVD AND ASPIRIN PIECE 12
 S T=$G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,62))
 I $E(V)=1,$E(T)=1 S $P(BDMCUML(400),U,12)=$P(BDMCUML(400),U,12)+1
 ;
 ;CKD PIECE 13 & 14
 ;CKD IS EGFR <60 OR UACR >=30
 I $$AGE^AUPNPAT(BDMPD,BDMADAT)<18 G N
 S $P(BDMCUML(400),U,13)=$P(BDMCUML(400),U,13)+1  ;over 18 denom
 I BDMCKD S $P(BDMCUML(400),U,14)=$P(BDMCUML(400),U,14)+1,BDMCOMOR=BDMCOMOR+1  ;HAS CKD
 ;CKD AND BP <140/<90 PIECE 15
 I BDMCKD,BDMBP140 S $P(BDMCUML(400),U,15)=$P(BDMCUML(400),U,15)+1
 ;CKD AND ACE PIECE 16
 S A=$E($G(^XTMP("BDMDM17",BDMJOB,BDMBTH,"AUDIT",BDMPD,60)))
 I A=1,BDMCKD S $P(BDMCUML(400),U,16)=$P(BDMCUML(400),U,16)+1
 ;EGFR AND UACR DONE PIECE 17
 S G=0
 I BDMEGFRU S $P(BDMCUML(400),U,17)=$P(BDMCUML(400),U,17)+1 D  I G G N
 .;NORMAL PIECE 18
 .I BDMEGFRV>59,BDMUACRV="<30" S $P(BDMCUML(400),U,18)=$P(BDMCUML(400),U,18)+1 S G=1
 .;STAGE 1/2 EGFR =>60, UACR =>30
 .I BDMEGFRV>59,BDMUACRV=">30" S $P(BDMCUML(400),U,19)=$P(BDMCUML(400),U,19)+1 S G=1
 ;STAGE 3 EGFR 30-59
 I BDMEGFRV]"",BDMEGFRV'<30,BDMEGFRV<60 S $P(BDMCUML(400),U,20)=$P(BDMCUML(400),U,20)+1 G N
 ;STAGE 4 EGFR 15-20 PIECE 21
 I BDMEGFRV]"",BDMEGFRV'<15,BDMEGFRV'>29 S $P(BDMCUML(400),U,21)=$P(BDMCUML(400),U,21)+1 G N
 ;STAGE 5 EGFR <15
 I BDMEGFRV]"",BDMEGFRV<15 S $P(BDMCUML(400),U,22)=$P(BDMCUML(400),U,22)+1 G N
 ;UACR AND EGFR NOT DONE
 S $P(BDMCUML(400),U,23)=$P(BDMCUML(400),U,23)+1
N ;NONE PIECE 25
 I BDMCOMOR=0 S $P(BDMCUML(400),U,25)=$P(BDMCUML(400),U,25)+1
 I BDMCOMOR=1 S $P(BDMCUML(400),U,26)=$P(BDMCUML(400),U,26)+1
 I BDMCOMOR=2 S $P(BDMCUML(400),U,27)=$P(BDMCUML(400),U,27)+1
 I BDMCOMOR=3 S $P(BDMCUML(400),U,28)=$P(BDMCUML(400),U,28)+1
 I BDMCOMOR=4 S $P(BDMCUML(400),U,29)=$P(BDMCUML(400),U,29)+1
 I BDMCOMOR=5 S $P(BDMCUML(400),U,30)=$P(BDMCUML(400),U,30)+1
 I BDMCOMOR=6 S $P(BDMCUML(400),U,31)=$P(BDMCUML(400),U,31)+1
 Q