BQITRCLB ;GDHD/HCD/ALA-CVD Labs ; 13 Jun 2016 9:56 AM
;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
;
NLDL(BQDFN) ;EP
; No LDL ever
NEW MEET,DESC,X,TAX,TREF
S MEET=0,DESC=""
S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
S TAX="BGP LDL LOINC CODES" D BLD^BQITUTL(TAX,TREF)
S TAX="DM AUDIT LDL CHOLESTEROL TAX" D BLD^BQITUTL(TAX,TREF,"L")
S X=$$LAB^BQITRUTL("",1,BQDFN,"",0,">","","",.TREF)
I $P(X,U,2)'="" S $P(X,U,2)=$$DATE^BQIUL1($P(X,U,2))
I $P(X,U,1)=1 S MEET=0,DESC="Last LDL was "_$$FMTMDY^BQIUL1($P(X,U,2))_" ("_$P(X,U,3)_")"_U_$P(X,U,2,5)
I $P(X,U,1)=0 S MEET=1,DESC="No LDL ever"
K @TREF
Q MEET_U_DESC
;
HLDL(BQDFN,TMFRAME) ;EP
; If most recent LDL in past year >190
NEW X,MEET,DESC,TAX,TREF,X1
S MEET=0,DESC=""
S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
S TAX="BGP LDL LOINC CODES" D BLD^BQITUTL(TAX,TREF)
S TAX="DM AUDIT LDL CHOLESTEROL TAX" D BLD^BQITUTL(TAX,TREF,"L")
S X=$$LAB^BQITRUTL(TMFRAME,1,BQDFN,"",190,">","","",.TREF)
I $P(X,U,2)'="" S $P(X,U,2)=$$DATE^BQIUL1($P(X,U,2))
I $P(X,U,1)=0 S MEET=0,DESC="Most recent LDL not greater than 190 ("_$$FMTMDY^BQIUL1($P(X,U,2))_" "_$P(X,U,3)_")"
I $P(X,U,1)=1 S MEET=1,DESC="Most recent LDL greater than 190 ("_$$FMTMDY^BQIUL1($P(X,U,2))_" "_$P(X,U,3)_")"_U_$$FMTMDY^BQIUL1($P(X,U,2))_U_$P(X,U,3,6),X1=X
Q MEET_U_DESC
;
HTG(BQDFN,TMFRAME) ;EP
; Most recent TG in past year >500
NEW MEET,DESC,X,TAX,TREF
S MEET=0,DESC=""
S TMFRAME=$G(TMFRAME,"")
S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
S TAX="DM AUDIT TRIGLYCERIDE TAX" D BLD^BQITUTL(TAX,TREF,"L")
S TAX="BGP TRIGLYCERIDE LOINC CODES" D BLD^BQITUTL(TAX,TREF)
S X=$$LAB^BQITRUTL(TMFRAME,1,BQDFN,"",500,">","","",.TREF)
I $P(X,U,2)'="" S $P(X,U,2)=$$DATE^BQIUL1($P(X,U,2))
I $P(X,U,1)=1 S MEET=1,DESC="Most recent Triglyceride greater than 500 ("_$$FMTMDY^BQIUL1($P(X,U,2))_" "_$P(X,U,3)_")"_U_$P(X,U,2,5)
I $P(X,U,1)=0 S MEET=0,DESC="Most recent Triglyceride is not greater than 500"
K @TREF
Q MEET_U_DESC
BQITRCLB ;GDHD/HCD/ALA-CVD Labs ; 13 Jun 2016 9:56 AM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
+2 ;
NLDL(BQDFN) ;EP
+1 ; No LDL ever
+2 NEW MEET,DESC,X,TAX,TREF
+3 SET MEET=0
SET DESC=""
+4 SET TREF=$NAME(^TMP("BQITAX",UID))
KILL @TREF
+5 SET TAX="BGP LDL LOINC CODES"
DO BLD^BQITUTL(TAX,TREF)
+6 SET TAX="DM AUDIT LDL CHOLESTEROL TAX"
DO BLD^BQITUTL(TAX,TREF,"L")
+7 SET X=$$LAB^BQITRUTL("",1,BQDFN,"",0,">","","",.TREF)
+8 IF $PIECE(X,U,2)'=""
SET $PIECE(X,U,2)=$$DATE^BQIUL1($PIECE(X,U,2))
+9 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC="Last LDL was "_$$FMTMDY^BQIUL1($PIECE(X,U,2))_" ("_$PIECE(X,U,3)_")"_U_$PIECE(X,U,2,5)
+10 IF $PIECE(X,U,1)=0
SET MEET=1
SET DESC="No LDL ever"
+11 KILL @TREF
+12 QUIT MEET_U_DESC
+13 ;
HLDL(BQDFN,TMFRAME) ;EP
+1 ; If most recent LDL in past year >190
+2 NEW X,MEET,DESC,TAX,TREF,X1
+3 SET MEET=0
SET DESC=""
+4 SET TREF=$NAME(^TMP("BQITAX",UID))
KILL @TREF
+5 SET TAX="BGP LDL LOINC CODES"
DO BLD^BQITUTL(TAX,TREF)
+6 SET TAX="DM AUDIT LDL CHOLESTEROL TAX"
DO BLD^BQITUTL(TAX,TREF,"L")
+7 SET X=$$LAB^BQITRUTL(TMFRAME,1,BQDFN,"",190,">","","",.TREF)
+8 IF $PIECE(X,U,2)'=""
SET $PIECE(X,U,2)=$$DATE^BQIUL1($PIECE(X,U,2))
+9 IF $PIECE(X,U,1)=0
SET MEET=0
SET DESC="Most recent LDL not greater than 190 ("_$$FMTMDY^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_")"
+10 IF $PIECE(X,U,1)=1
SET MEET=1
SET DESC="Most recent LDL greater than 190 ("_$$FMTMDY^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_")"_U_$$FMTMDY^BQIUL1($PIECE(X,U,2))_U_$PIECE(X,U,3,6)
SET X1=X
+11 QUIT MEET_U_DESC
+12 ;
HTG(BQDFN,TMFRAME) ;EP
+1 ; Most recent TG in past year >500
+2 NEW MEET,DESC,X,TAX,TREF
+3 SET MEET=0
SET DESC=""
+4 SET TMFRAME=$GET(TMFRAME,"")
+5 SET TREF=$NAME(^TMP("BQITAX",UID))
KILL @TREF
+6 SET TAX="DM AUDIT TRIGLYCERIDE TAX"
DO BLD^BQITUTL(TAX,TREF,"L")
+7 SET TAX="BGP TRIGLYCERIDE LOINC CODES"
DO BLD^BQITUTL(TAX,TREF)
+8 SET X=$$LAB^BQITRUTL(TMFRAME,1,BQDFN,"",500,">","","",.TREF)
+9 IF $PIECE(X,U,2)'=""
SET $PIECE(X,U,2)=$$DATE^BQIUL1($PIECE(X,U,2))
+10 IF $PIECE(X,U,1)=1
SET MEET=1
SET DESC="Most recent Triglyceride greater than 500 ("_$$FMTMDY^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_")"_U_$PIECE(X,U,2,5)
+11 IF $PIECE(X,U,1)=0
SET MEET=0
SET DESC="Most recent Triglyceride is not greater than 500"
+12 KILL @TREF
+13 QUIT MEET_U_DESC