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

BDMDM4.m

Go to the documentation of this file.
BDMDM4 ; IHS/CMI/LAB -CONTINUATION OF DM AUDIT RETRIEVAL ROUTINE ;
 ;;2.0;DIABETES MANAGEMENT SYSTEM;**2**;JUN 14, 2007
 ;IHS/CMI/LAB - fixed EKG
 ;
 ;
EN ; - EP - from ^BDMDM1
 ;
 F BDMII=1:1 Q:$T(@BDMII)=""  K BDMX S BDMY="BDM(" D @BDMII K BDM
 K BDMII
 Q
1 ;
URINE ;urinalysis done?
 S BDMX=BDMPD_"^LAST LAB [DM AUDIT URINALYSIS TAX"_BDMDATE S BDMER=$$START1^APCLDF(BDMX,BDMY)
 I '$D(BDM(1)) S ^TMP("BDM",$J,23)="NO",^TMP("BDM",$J,24.1)="-" G UPRO
 S ^TMP("BDM",$J,23)="YES"
UPRO ;
 S BDMX=BDMPD_"^LAST LAB [DM AUDIT URINE PROTEIN TAX"_BDMDATE S BDMER=$$START1^APCLDF(BDMX,BDMY)
 I '$D(BDM(1)) S ^TMP("BDM",$J,24.1)="-" G X7
 S %A=$P(BDM(1),U,2) S ^TMP("BDM",$J,24.1)=$S(%A]"":$P(BDM(1),U,2),1:"-")
 I BDMCUML F %=24.1 I ^TMP("BDM",$J,%)["+" S BDMPOS=1 Q
 I BDMCUML S BDMGOT1=$S($G(BDMPOS):1,1:0),BDMSUB=35 D CUML^BDMDM1
 S ^TMP("BDM",$J,31)=$S($G(BDMPOS):"YES",1:"NO")
X7 I BDMCUML S BDMGOT1=$S(^TMP("BDM",$J,23)="YES":1,1:0),BDMSUB=34 D CUML^BDMDM1
 K BDMPOS
 Q
2 ;
CRTININE S BDMX=BDMPD_"^LAST DX V42.0" S BDMER=$$START1^APCLDF(BDMX,BDMY) I $D(BDM(1)) S BDMD1=+BDM(1) K BDM
 S BDMX=BDMPD_"^LAST DX V56.0" S BDMER=$$START1^APCLDF(BDMX,BDMY) I $D(BDM(1)) D  I $D(^TMP("BDM",$J,25)) G CUM
 . I $D(BDMD1) S:BDMD1<+BDM(1) ^TMP("BDM",$J,25)="ON DIALYSIS"
 . I '$D(BDMD1) S ^TMP("BDM",$J,25)="ON DIALYSIS"
 K BDM
 S BDMX=BDMPD_"^LAST LAB [DM AUDIT CREATININE TAX"_BDMDATE S BDMER=$$START1^APCLDF(BDMX,BDMY) D
 . S ^TMP("BDM",$J,25)=$S($D(BDM(1)):"YES - "_$P(BDM(1),U,2),1:"NO") ;***
CUM I BDMCUML S BDMGOT1=$S(^TMP("BDM",$J,25)["YES":1,1:0),BDMSUB=36 D CUML^BDMDM1
 I BDMCUML,BDMGOT1 S BDMGOT1=$S(+($P(^TMP("BDM",$J,25)," ",3))>2:1,1:0),BDMSUB=37 D CUML^BDMDM1
X9 K BDMD1 Q  ;***
3 ;
CHOLES S BDMX=BDMPD_"^LAST LAB [DM AUDIT CHOLESTEROL TAX"_BDMDATE S BDMER=$$START1^APCLDF(BDMX,BDMY)
 S ^TMP("BDM",$J,26)=$S($D(BDM(1)):"YES - "_$P(BDM(1),U,2),1:"NO") ;***
 I BDMCUML S BDMGOT1=$S(^TMP("BDM",$J,26)["YES":1,1:0),BDMSUB=38 D CUML^BDMDM1
 I BDMCUML,BDMGOT1 S BDMGOT1=$S(+($P(^TMP("BDM",$J,26)," ",3))>240:1,1:0),BDMSUB=39 D CUML^BDMDM1
 Q
4 ;
TRIGLYC S BDMX=BDMPD_"^LAST LAB [DM AUDIT TRIGLYCERIDE TAX"_BDMDATE S BDMER=$$START1^APCLDF(BDMX,BDMY)
 S ^TMP("BDM",$J,27)=$S($D(BDM(1)):"YES - "_$P(BDM(1),U,2),1:"NO") ;***
 I BDMCUML S BDMGOT1=$S(^TMP("BDM",$J,27)["YES":1,1:0),BDMSUB=40 D CUML^BDMDM1
 Q
 ;
5 ;
 D PPD^BDMDM8
 Q
6 ;ECG SUMMARY
 S BDMX=BDMPD_"^LAST DIAGNOSTIC ECG SUMMARY" S BDMER=$$START1^APCLDF(BDMX,BDMY) S ^TMP("BDM",$J,39)=$S($D(BDM(1)):"YES",1:"NO") ;IHS/CMI/LAB
 S BDMSUB=55,BDMGOT1=$S($D(BDM(1)):1,1:0) D CUML^BDMDM1
 ;S BDMSUB=55,BDMGOT1=1 D CUML^BDMDM1
 K BDMSUB,BDMX,BDMGOT1
 Q