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

APCLDM4.m

Go to the documentation of this file.
APCLDM4 ; IHS/CMI/LAB -CONTINUATION OF DM AUDIT RETRIEVAL ROUTINE ;
 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
 ;IHS/CMI/LAB - fixed EKG
 ;
 ;
EN ; - EP - from ^APCLDM1
 ;
 F APCLII=1:1 Q:$T(@APCLII)=""  K APCLX S APCLY="APCL(" D @APCLII K APCL
 K APCLII
 Q
1 ;
URINE ;urinalysis done?
 S APCLX=APCLPD_"^LAST LAB [DM AUDIT URINALYSIS TAX"_APCLDATE S APCLER=$$START1^APCLDF(APCLX,APCLY)
 I '$D(APCL(1)) S ^TMP("APCL",$J,23)="NO",^TMP("APCL",$J,24.1)="-" G UPRO
 S ^TMP("APCL",$J,23)="YES"
UPRO ;
 S APCLX=APCLPD_"^LAST LAB [DM AUDIT URINE PROTEIN TAX"_APCLDATE S APCLER=$$START1^APCLDF(APCLX,APCLY)
 I '$D(APCL(1)) S ^TMP("APCL",$J,24.1)="-" G X7
 S %A=$P(APCL(1),U,2) S ^TMP("APCL",$J,24.1)=$S(%A]"":$P(APCL(1),U,2),1:"-")
 I APCLCUML F %=24.1 I ^TMP("APCL",$J,%)["+" S APCLPOS=1 Q
 I APCLCUML S APCLGOT1=$S($G(APCLPOS):1,1:0),APCLSUB=35 D CUML^APCLDM1
 S ^TMP("APCL",$J,31)=$S($G(APCLPOS):"YES",1:"NO")
X7 I APCLCUML S APCLGOT1=$S(^TMP("APCL",$J,23)="YES":1,1:0),APCLSUB=34 D CUML^APCLDM1
 K APCLPOS
 Q
2 ;
CRTININE S APCLX=APCLPD_"^LAST DX V42.0" S APCLER=$$START1^APCLDF(APCLX,APCLY) I $D(APCL(1)) S APCLD1=+APCL(1) K APCL
 S APCLX=APCLPD_"^LAST DX V56.0" S APCLER=$$START1^APCLDF(APCLX,APCLY) I $D(APCL(1)) D  I $D(^TMP("APCL",$J,25)) G CUM
 . I $D(APCLD1) S:APCLD1<+APCL(1) ^TMP("APCL",$J,25)="ON DIALYSIS"
 . I '$D(APCLD1) S ^TMP("APCL",$J,25)="ON DIALYSIS"
 K APCL
 S APCLX=APCLPD_"^LAST LAB [DM AUDIT CREATININE TAX"_APCLDATE S APCLER=$$START1^APCLDF(APCLX,APCLY) D
 . S ^TMP("APCL",$J,25)=$S($D(APCL(1)):"YES - "_$P(APCL(1),U,2),1:"NO") ;***
CUM I APCLCUML S APCLGOT1=$S(^TMP("APCL",$J,25)["YES":1,1:0),APCLSUB=36 D CUML^APCLDM1
 I APCLCUML,APCLGOT1 S APCLGOT1=$S(+($P(^TMP("APCL",$J,25)," ",3))>2:1,1:0),APCLSUB=37 D CUML^APCLDM1
X9 K APCLD1 Q  ;***
3 ;
CHOLES S APCLX=APCLPD_"^LAST LAB [DM AUDIT CHOLESTEROL TAX"_APCLDATE S APCLER=$$START1^APCLDF(APCLX,APCLY)
 S ^TMP("APCL",$J,26)=$S($D(APCL(1)):"YES - "_$P(APCL(1),U,2),1:"NO") ;***
 I APCLCUML S APCLGOT1=$S(^TMP("APCL",$J,26)["YES":1,1:0),APCLSUB=38 D CUML^APCLDM1
 I APCLCUML,APCLGOT1 S APCLGOT1=$S(+($P(^TMP("APCL",$J,26)," ",3))>240:1,1:0),APCLSUB=39 D CUML^APCLDM1
 Q
4 ;
TRIGLYC S APCLX=APCLPD_"^LAST LAB [DM AUDIT TRIGLYCERIDE TAX"_APCLDATE S APCLER=$$START1^APCLDF(APCLX,APCLY)
 S ^TMP("APCL",$J,27)=$S($D(APCL(1)):"YES - "_$P(APCL(1),U,2),1:"NO") ;***
 I APCLCUML S APCLGOT1=$S(^TMP("APCL",$J,27)["YES":1,1:0),APCLSUB=40 D CUML^APCLDM1
 Q
 ;
5 ;
 D PPD^APCLDM8
 Q
6 ;ECG SUMMARY
 S APCLX=APCLPD_"^LAST DIAGNOSTIC ECG SUMMARY" S APCLER=$$START1^APCLDF(APCLX,APCLY) S ^TMP("APCL",$J,39)=$S($D(APCL(1)):"YES",1:"NO") ;IHS/CMI/LAB
 S APCLSUB=55,APCLGOT1=$S($D(APCL(1)):1,1:0) D CUML^APCLDM1
 ;S APCLSUB=55,APCLGOT1=1 D CUML^APCLDM1
 K APCLSUB,APCLX,APCLGOT1
 Q