BQITRCHR ;VNGT/HS/ALA-CVD Highest Risk Treatment Prompts ; 02 Sep 2008 11:52 AM
;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
;
EKGE(BQDFN) ;EP CVD.TP-23 No EKG Ever
; If no documented EKG ever
NEW MEET,DESC,RETURN
S MEET=0,DESC=""
S RETURN=$$EKG^BQITRUT1(BQDFN,"")
I $P(RETURN,U,1)=1 S MEET=1,DESC="Has not ever had an EKG procedure"
I $P(RETURN,U,1)=0 S MEET=0,DESC="Has had an EKG procedure"
Q MEET_U_DESC
;
EKG2(BQDFN) ;EP CVD.TP-26 No Recent EKG
; If no EKG documented in past 2 years
NEW MEET,DESC,RETURN
S MEET=0,DESC=""
S RETURN=$$EKG^BQITRUT1(BQDFN,"T-24M")
I $P(RETURN,U,1)=0 S MEET=0,DESC="Has had EKG procedure in past 2 years"
I $P(RETURN,U,1)=1 D
. S MEET=1,DESC="Has not had an EKG procedure in past 2 years"
. I $D(^BQIPAT(BQDFN,50,23)) S MEET=0
Q MEET_U_DESC
;
ASA(BQDFN) ;EP CV.TP-15 No ASA/Antiplatelet
; If age >30 AND NOT on ASA or Warfarin or other AntiPlatelet
; Medication or NOT contraindicated
NEW CT,X,VISIT,VSDTM,MEET,DESC,TIEN,T2,PRGM,QFL,RESULT,TREF,GREF,IEN,ENDT,C
NEW BQGPRG,BGPDXBD,BGPDXED,AGE
S MEET=0,DESC=""
S AGE=$$AGE^BQIAGE(BQDFN),DESC="Patient's age is "_AGE_" and "
I AGE'>30 S DESC="Patient's age is "_AGE Q MEET_U_DESC
D
. S X=$$TAX^BQITRUTL("","DM AUDIT ASPIRIN DRUGS",1,BQDFN,9000010.14)
. ; if returns a found medication, check if it is an active medication
. I $P(X,U,1)=1 D
.. I $$ACTMED^BKMQQCR4($P(X,U,5)) Q
.. S $P(X,U,1)=0
. I $P(X,U,1)=1 S MEET=0,DESC=DESC_"On ASA Meds ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$$GET1^DIQ(9000010.14,$P(X,U,5)_",",.01,"E")_")" Q
. I $P(X,U,1)=0 S MEET=1,DESC=DESC_"Not on ASA Meds; "
. S X=$$TAX^BQITRUTL("","BGP CMS WARFARIN MEDS",1,BQDFN,9000010.14)
. ; if returns a found medication, check if it is an active medication
. I $P(X,U,1)=1 D
.. I $$ACTMED^BKMQQCR4($P(X,U,5)) Q
.. S $P(X,U,1)=0
. I $P(X,U,1)=1 S MEET=0,DESC=DESC_"On Warfarin Meds ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$$GET1^DIQ(9000010.14,$P(X,U,5)_",",.01,"E")_")" Q
. I $P(X,U,1)=0 S MEET=1,DESC=DESC_"Not on Warfarin Meds; "
. NEW TAX,TREF
. S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
. F TAX="BGP CMS ANTI-PLATELET CLASS","BGP ANTI-PLATELET DRUGS" D BLD^BQITUTL(TAX,TREF)
. S X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
. ; if returns a found medication, check if it is an active medication
. I $P(X,U,1)=1 D
.. I $$ACTMED^BKMQQCR4($P(X,U,5)) Q
.. S $P(X,U,1)=0
. I $P(X,U,1)=1 S MEET=0,DESC=DESC_"On Anti-Platelet Meds ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$$GET1^DIQ(9000010.14,$P(X,U,5)_",",.01,"E")_")"
. I $P(X,U,1)=0 S MEET=1,DESC=DESC_"Not on Anti-Platelet Meds"
. K @TREF
D
. S X=$$ASA^BQITRCON(BQDFN,$G(BDATE,""),$G(EDATE,""))
. I $P(X,U,1)=1 S MEET=0,DESC="Has a contraindication: "_$P(X,U,2) Q
. I $P(X,U,1)=0 S DESC=DESC_" and not contraindicated"
. S MEET=$S(MEET:0,1:1)
. S X=$$ASA^BQITRALG(BQDFN,$G(BDATE,""),$G(EDATE,""))
. I $P(X,U,1)=1 S MEET=0,DESC="Has an allergy: "_$P(X,U,2) Q
. S MEET=$S(MEET:0,1:1)
Q MEET_U_DESC
;
ACEI(BQDFN) ;EP CVD.TP-17 No ACEI or ARB
; If NOT on ACEI OR ARB, then check the patient for special conditions
NEW CT,X,VISIT,VSDTM,MEET,DESC,TIEN,T2,PRGM,QFL,RESULT,TREF,GREF
NEW IEN,ENDT,C,BQGPRG,BGPDXBD,BGPDXED,TAX,TREF
S MEET=0,DESC=""
S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
F TAX="BGP CMS ACEI MEDS CLASS","BGP HEDIS ACEI MEDS","BGP HEDIS ACEI NDC" D BLD^BQITUTL(TAX,TREF)
S X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
; if returns a found medication, check if it is an active medication
I $P(X,U,1)=1 D
. I $$ACTMED^BKMQQCR4($P(X,U,5)) Q
. S $P(X,U,1)=0
I $P(X,U,1)=1 S MEET=0,DESC=DESC_"On ACEI Meds ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$$GET1^DIQ(9000010.14,$P(X,U,5)_",",.01,"E")_")"
I $P(X,U,1)=0 S MEET=1,DESC=DESC_"Not on ACEI Meds"
;
K @TREF
I MEET D
. S DESC=""
. F TAX="BGP CMS ARB MEDS CLASS","BGP HEDIS ARB MEDS","BGP HEDIS ARB NDC" D BLD^BQITUTL(TAX,TREF)
. S X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
. ; if returns a found medication, check if it is an active medication
. I $P(X,U,1)=1 D
.. I $$ACTMED^BKMQQCR4($P(X,U,5)) Q
.. S $P(X,U,1)=0
. I $P(X,U,1)=1 S MEET=0,DESC=DESC_"On ARB Meds ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$$GET1^DIQ(9000010.14,$P(X,U,5)_",",.01,"E")_")"
. I $P(X,U,1)=0 S MEET=1,DESC=DESC_"Not on ARB Meds"
. K @TREF
I 'MEET Q MEET_U_DESC
D
. S X=$$ACEI^BQITRCON(BQDFN,$G(BDATE,""),$G(EDATE,""))
. I $P(X,U,1)=1 S MEET=0,DESC="Has a contraindication: "_$P(X,U,2) Q
. S MEET=$S(MEET:0,1:1)
. S X=$$ACEI^BQITRALG(BQDFN,$G(BDATE,""),$G(EDATE,""))
. I $P(X,U,1)=1 S MEET=0,DESC="Has an allergy: "_$P(X,U,2) Q
. S MEET=$S(MEET:0,1:1)
I 'MEET Q 0_U_DESC
;
; Check for special conditions
S RETURN=$$ACB^BQITRACB(BQDFN,.BQRM)
;
I $P(RETURN,U,1)=0 S DESC="Not on ACEI or ARB Meds but no conditions",MEET=0
I $P(RETURN,U,1)=1 S DESC=DESC_" with "_$P(RETURN,U,2)
Q MEET_U_DESC
;
HDL(BQDFN,TMFRAME) ;EP CVD.TP-39 and CVD.TP-21 Low HDL
; If most recent HDL <40
NEW MEET,DESC,X,TAX,TREF
S MEET=0,DESC=""
S TMFRAME=$G(TMFRAME,"")
S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
F TAX="DM AUDIT HDL TAX","BGP HDL LOINC CODES" D BLD^BQITUTL(TAX,TREF)
S X=$$LAB^BQITRUTL("",1,BQDFN,"",40,"<","","",.TREF)
I $P(X,U,1)=1 S MEET=1,DESC="Most recent HDL is less than 40 ("_$$FMTE^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 HDL is greater than 40 ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$P(X,U,3)_")"
K @TREF
Q MEET_U_DESC
;
HLNS(BQDFN) ;EP CVD.TP-19 High LDL/No Statin
; If most recent LDL >100 AND NOT on Statin
NEW MEET,DESC,X,TAX,TREF
S MEET=0,DESC=""
S TREF=$NA(^TMP("BQITAX",UID)) K @TREF
F TAX="DM AUDIT LDL CHOLESTEROL TAX","BGP LDL LOINC CODES" D BLD^BQITUTL(TAX,TREF)
S X=$$LAB^BQITRUTL("T-12M",1,BQDFN,"",100,">","","",.TREF)
I $P(X,U,1)=0 S MEET=0,DESC="Most recent LDL not greater than 100 ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$P(X,U,3)_")" Q MEET_U_DESC
I $P(X,U,1)=1 S MEET=1,DESC="Most recent LDL greater than 100 ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$P(X,U,3)_") and "_U_$P(X,U,2,5)
K @TREF
F TAX="BGP HEDIS STATIN MEDS","BGP HEDIS STATIN NDC" D BLD^BQITUTL(TAX,TREF)
S X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
; if returns a found medication, check if it is an active medication
I $P(X,U,1)=1 D
. I $$ACTMED^BKMQQCR4($P(X,U,5)) Q
. S $P(X,U,1)=0
I $P(X,U,1)=1 S MEET=0,$P(DESC,U,1)=$P(DESC,U,1)_"and On Statin Meds ("_$$FMTE^BQIUL1($P(X,U,2))_" "_$$GET1^DIQ(9000010.14,$P(X,U,5)_",",.01,"E")_")"
I $P(X,U,1)=0 S MEET=1,$P(DESC,U,1)=$P(DESC,U,1)_"Not on Statin Meds"
K @TREF
Q MEET_U_DESC
;
HBP(BQDFN) ;EP CVD.TP-16 High BP
; If 2 of last 3 non-ER blood pressures in past 2 years are
; Systolic >130 or Diastolic >80
NEW MEET,DESC,X,TEXT,BQI,QFL
S MEET=0,DESC="",TEXT=""
S X=$$BP^BQITRUTL("T-24M",BQDFN,130,80,">")
I $P(X,U,2)'="" D
. NEW NDATE
. S QFL=0
. F BQI=1:1:3 D Q:QFL
.. I $P($P(X,U,2),";",BQI)="No BPs in timeframe" S TEXT=$P($P(X,U,2),";",BQI),QFL=1 Q
.. S NDATE=$$FMTE^BQIUL1($P($P(X,U,2),";",BQI))_"("_$P($P(X,U,5),";",BQI)_")",TEXT=TEXT_NDATE_";"
I $P(X,U,1)=0 S MEET=0,DESC="2 of last 3 non-ER BP are not valid values ["_TEXT_"]" Q MEET_U_DESC
I $P(X,U,1)=1 S MEET=1,DESC=DESC_$$PBP^BQITRCKN(DESC,X)
Q MEET_U_DESC
BQITRCHR ;VNGT/HS/ALA-CVD Highest Risk Treatment Prompts ; 02 Sep 2008 11:52 AM
+1 ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
+2 ;
EKGE(BQDFN) ;EP CVD.TP-23 No EKG Ever
+1 ; If no documented EKG ever
+2 NEW MEET,DESC,RETURN
+3 SET MEET=0
SET DESC=""
+4 SET RETURN=$$EKG^BQITRUT1(BQDFN,"")
+5 IF $PIECE(RETURN,U,1)=1
SET MEET=1
SET DESC="Has not ever had an EKG procedure"
+6 IF $PIECE(RETURN,U,1)=0
SET MEET=0
SET DESC="Has had an EKG procedure"
+7 QUIT MEET_U_DESC
+8 ;
EKG2(BQDFN) ;EP CVD.TP-26 No Recent EKG
+1 ; If no EKG documented in past 2 years
+2 NEW MEET,DESC,RETURN
+3 SET MEET=0
SET DESC=""
+4 SET RETURN=$$EKG^BQITRUT1(BQDFN,"T-24M")
+5 IF $PIECE(RETURN,U,1)=0
SET MEET=0
SET DESC="Has had EKG procedure in past 2 years"
+6 IF $PIECE(RETURN,U,1)=1
Begin DoDot:1
+7 SET MEET=1
SET DESC="Has not had an EKG procedure in past 2 years"
+8 IF $DATA(^BQIPAT(BQDFN,50,23))
SET MEET=0
End DoDot:1
+9 QUIT MEET_U_DESC
+10 ;
ASA(BQDFN) ;EP CV.TP-15 No ASA/Antiplatelet
+1 ; If age >30 AND NOT on ASA or Warfarin or other AntiPlatelet
+2 ; Medication or NOT contraindicated
+3 NEW CT,X,VISIT,VSDTM,MEET,DESC,TIEN,T2,PRGM,QFL,RESULT,TREF,GREF,IEN,ENDT,C
+4 NEW BQGPRG,BGPDXBD,BGPDXED,AGE
+5 SET MEET=0
SET DESC=""
+6 SET AGE=$$AGE^BQIAGE(BQDFN)
SET DESC="Patient's age is "_AGE_" and "
+7 IF AGE'>30
SET DESC="Patient's age is "_AGE
QUIT MEET_U_DESC
+8 Begin DoDot:1
+9 SET X=$$TAX^BQITRUTL("","DM AUDIT ASPIRIN DRUGS",1,BQDFN,9000010.14)
+10 ; if returns a found medication, check if it is an active medication
+11 IF $PIECE(X,U,1)=1
Begin DoDot:2
+12 IF $$ACTMED^BKMQQCR4($PIECE(X,U,5))
QUIT
+13 SET $PIECE(X,U,1)=0
End DoDot:2
+14 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC=DESC_"On ASA Meds ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$$GET1^DIQ(9000010.14,$PIECE(X,U,5)_",",.01,"E")_")"
QUIT
+15 IF $PIECE(X,U,1)=0
SET MEET=1
SET DESC=DESC_"Not on ASA Meds; "
+16 SET X=$$TAX^BQITRUTL("","BGP CMS WARFARIN MEDS",1,BQDFN,9000010.14)
+17 ; if returns a found medication, check if it is an active medication
+18 IF $PIECE(X,U,1)=1
Begin DoDot:2
+19 IF $$ACTMED^BKMQQCR4($PIECE(X,U,5))
QUIT
+20 SET $PIECE(X,U,1)=0
End DoDot:2
+21 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC=DESC_"On Warfarin Meds ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$$GET1^DIQ(9000010.14,$PIECE(X,U,5)_",",.01,"E")_")"
QUIT
+22 IF $PIECE(X,U,1)=0
SET MEET=1
SET DESC=DESC_"Not on Warfarin Meds; "
+23 NEW TAX,TREF
+24 SET TREF=$NAME(^TMP("BQITAX",UID))
KILL @TREF
+25 FOR TAX="BGP CMS ANTI-PLATELET CLASS","BGP ANTI-PLATELET DRUGS"
DO BLD^BQITUTL(TAX,TREF)
+26 SET X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
+27 ; if returns a found medication, check if it is an active medication
+28 IF $PIECE(X,U,1)=1
Begin DoDot:2
+29 IF $$ACTMED^BKMQQCR4($PIECE(X,U,5))
QUIT
+30 SET $PIECE(X,U,1)=0
End DoDot:2
+31 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC=DESC_"On Anti-Platelet Meds ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$$GET1^DIQ(9000010.14,$PIECE(X,U,5)_",",.01,"E")_")"
+32 IF $PIECE(X,U,1)=0
SET MEET=1
SET DESC=DESC_"Not on Anti-Platelet Meds"
+33 KILL @TREF
End DoDot:1
+34 Begin DoDot:1
+35 SET X=$$ASA^BQITRCON(BQDFN,$GET(BDATE,""),$GET(EDATE,""))
+36 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC="Has a contraindication: "_$PIECE(X,U,2)
QUIT
+37 IF $PIECE(X,U,1)=0
SET DESC=DESC_" and not contraindicated"
+38 SET MEET=$SELECT(MEET:0,1:1)
+39 SET X=$$ASA^BQITRALG(BQDFN,$GET(BDATE,""),$GET(EDATE,""))
+40 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC="Has an allergy: "_$PIECE(X,U,2)
QUIT
+41 SET MEET=$SELECT(MEET:0,1:1)
End DoDot:1
+42 QUIT MEET_U_DESC
+43 ;
ACEI(BQDFN) ;EP CVD.TP-17 No ACEI or ARB
+1 ; If NOT on ACEI OR ARB, then check the patient for special conditions
+2 NEW CT,X,VISIT,VSDTM,MEET,DESC,TIEN,T2,PRGM,QFL,RESULT,TREF,GREF
+3 NEW IEN,ENDT,C,BQGPRG,BGPDXBD,BGPDXED,TAX,TREF
+4 SET MEET=0
SET DESC=""
+5 SET TREF=$NAME(^TMP("BQITAX",UID))
KILL @TREF
+6 FOR TAX="BGP CMS ACEI MEDS CLASS","BGP HEDIS ACEI MEDS","BGP HEDIS ACEI NDC"
DO BLD^BQITUTL(TAX,TREF)
+7 SET X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
+8 ; if returns a found medication, check if it is an active medication
+9 IF $PIECE(X,U,1)=1
Begin DoDot:1
+10 IF $$ACTMED^BKMQQCR4($PIECE(X,U,5))
QUIT
+11 SET $PIECE(X,U,1)=0
End DoDot:1
+12 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC=DESC_"On ACEI Meds ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$$GET1^DIQ(9000010.14,$PIECE(X,U,5)_",",.01,"E")_")"
+13 IF $PIECE(X,U,1)=0
SET MEET=1
SET DESC=DESC_"Not on ACEI Meds"
+14 ;
+15 KILL @TREF
+16 IF MEET
Begin DoDot:1
+17 SET DESC=""
+18 FOR TAX="BGP CMS ARB MEDS CLASS","BGP HEDIS ARB MEDS","BGP HEDIS ARB NDC"
DO BLD^BQITUTL(TAX,TREF)
+19 SET X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
+20 ; if returns a found medication, check if it is an active medication
+21 IF $PIECE(X,U,1)=1
Begin DoDot:2
+22 IF $$ACTMED^BKMQQCR4($PIECE(X,U,5))
QUIT
+23 SET $PIECE(X,U,1)=0
End DoDot:2
+24 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC=DESC_"On ARB Meds ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$$GET1^DIQ(9000010.14,$PIECE(X,U,5)_",",.01,"E")_")"
+25 IF $PIECE(X,U,1)=0
SET MEET=1
SET DESC=DESC_"Not on ARB Meds"
+26 KILL @TREF
End DoDot:1
+27 IF 'MEET
QUIT MEET_U_DESC
+28 Begin DoDot:1
+29 SET X=$$ACEI^BQITRCON(BQDFN,$GET(BDATE,""),$GET(EDATE,""))
+30 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC="Has a contraindication: "_$PIECE(X,U,2)
QUIT
+31 SET MEET=$SELECT(MEET:0,1:1)
+32 SET X=$$ACEI^BQITRALG(BQDFN,$GET(BDATE,""),$GET(EDATE,""))
+33 IF $PIECE(X,U,1)=1
SET MEET=0
SET DESC="Has an allergy: "_$PIECE(X,U,2)
QUIT
+34 SET MEET=$SELECT(MEET:0,1:1)
End DoDot:1
+35 IF 'MEET
QUIT 0_U_DESC
+36 ;
+37 ; Check for special conditions
+38 SET RETURN=$$ACB^BQITRACB(BQDFN,.BQRM)
+39 ;
+40 IF $PIECE(RETURN,U,1)=0
SET DESC="Not on ACEI or ARB Meds but no conditions"
SET MEET=0
+41 IF $PIECE(RETURN,U,1)=1
SET DESC=DESC_" with "_$PIECE(RETURN,U,2)
+42 QUIT MEET_U_DESC
+43 ;
HDL(BQDFN,TMFRAME) ;EP CVD.TP-39 and CVD.TP-21 Low HDL
+1 ; If most recent HDL <40
+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 FOR TAX="DM AUDIT HDL TAX","BGP HDL LOINC CODES"
DO BLD^BQITUTL(TAX,TREF)
+7 SET X=$$LAB^BQITRUTL("",1,BQDFN,"",40,"<","","",.TREF)
+8 IF $PIECE(X,U,1)=1
SET MEET=1
SET DESC="Most recent HDL is less than 40 ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_")"_U_$PIECE(X,U,2,5)
+9 IF $PIECE(X,U,1)=0
SET MEET=0
SET DESC="Most recent HDL is greater than 40 ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_")"
+10 KILL @TREF
+11 QUIT MEET_U_DESC
+12 ;
HLNS(BQDFN) ;EP CVD.TP-19 High LDL/No Statin
+1 ; If most recent LDL >100 AND NOT on Statin
+2 NEW MEET,DESC,X,TAX,TREF
+3 SET MEET=0
SET DESC=""
+4 SET TREF=$NAME(^TMP("BQITAX",UID))
KILL @TREF
+5 FOR TAX="DM AUDIT LDL CHOLESTEROL TAX","BGP LDL LOINC CODES"
DO BLD^BQITUTL(TAX,TREF)
+6 SET X=$$LAB^BQITRUTL("T-12M",1,BQDFN,"",100,">","","",.TREF)
+7 IF $PIECE(X,U,1)=0
SET MEET=0
SET DESC="Most recent LDL not greater than 100 ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_")"
QUIT MEET_U_DESC
+8 IF $PIECE(X,U,1)=1
SET MEET=1
SET DESC="Most recent LDL greater than 100 ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$PIECE(X,U,3)_") and "_U_$PIECE(X,U,2,5)
+9 KILL @TREF
+10 FOR TAX="BGP HEDIS STATIN MEDS","BGP HEDIS STATIN NDC"
DO BLD^BQITUTL(TAX,TREF)
+11 SET X=$$TAX^BQITRUTL("","",1,BQDFN,9000010.14,"","",.TREF)
+12 ; if returns a found medication, check if it is an active medication
+13 IF $PIECE(X,U,1)=1
Begin DoDot:1
+14 IF $$ACTMED^BKMQQCR4($PIECE(X,U,5))
QUIT
+15 SET $PIECE(X,U,1)=0
End DoDot:1
+16 IF $PIECE(X,U,1)=1
SET MEET=0
SET $PIECE(DESC,U,1)=$PIECE(DESC,U,1)_"and On Statin Meds ("_$$FMTE^BQIUL1($PIECE(X,U,2))_" "_$$GET1^DIQ(9000010.14,$PIECE(X,U,5)_",",.01,"E")_")"
+17 IF $PIECE(X,U,1)=0
SET MEET=1
SET $PIECE(DESC,U,1)=$PIECE(DESC,U,1)_"Not on Statin Meds"
+18 KILL @TREF
+19 QUIT MEET_U_DESC
+20 ;
HBP(BQDFN) ;EP CVD.TP-16 High BP
+1 ; If 2 of last 3 non-ER blood pressures in past 2 years are
+2 ; Systolic >130 or Diastolic >80
+3 NEW MEET,DESC,X,TEXT,BQI,QFL
+4 SET MEET=0
SET DESC=""
SET TEXT=""
+5 SET X=$$BP^BQITRUTL("T-24M",BQDFN,130,80,">")
+6 IF $PIECE(X,U,2)'=""
Begin DoDot:1
+7 NEW NDATE
+8 SET QFL=0
+9 FOR BQI=1:1:3
Begin DoDot:2
+10 IF $PIECE($PIECE(X,U,2),";",BQI)="No BPs in timeframe"
SET TEXT=$PIECE($PIECE(X,U,2),";",BQI)
SET QFL=1
QUIT
+11 SET NDATE=$$FMTE^BQIUL1($PIECE($PIECE(X,U,2),";",BQI))_"("_$PIECE($PIECE(X,U,5),";",BQI)_")"
SET TEXT=TEXT_NDATE_";"
End DoDot:2
IF QFL
QUIT
End DoDot:1
+12 IF $PIECE(X,U,1)=0
SET MEET=0
SET DESC="2 of last 3 non-ER BP are not valid values ["_TEXT_"]"
QUIT MEET_U_DESC
+13 IF $PIECE(X,U,1)=1
SET MEET=1
SET DESC=DESC_$$PBP^BQITRCKN(DESC,X)
+14 QUIT MEET_U_DESC