BQITD061 ;GDHD/HS/ALA-ASCVD At Risk ; 04 May 2016 6:46 AM
;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
;
Q
;
POP(BQARY,TGLOB) ; EP -- By population
;
;Description
; Finds all patients who meet the criteria for CVD at Risk
;Input
; BQARY - Array of taxonomies and other information
; TGLOB - Global where data is to be stored and passed back
; to calling routine
; Structure:
; TGLOB(DFN,"CRITERIA",criteria or taxonomy,visit or problem ien)=date/time
;Variables
; TAX - Taxonomy name
; NIT - Number of iterations
; TMFRAME - Time frame of check
; FREF - File Number reference
; PLFLG - Problem File flag
; GREF - Global reference
; TREF - Taxonomy temp reference
;
; Clean up all current entries
NEW TDFN,AGE,MX
;
S TDFN=0
F S TDFN=$O(^AUPNPAT(TDFN)) Q:'TDFN D
. S AGE=$$AGE^BQIAGE(TDFN)
. I AGE<21 Q
. S MX=$$MEAS^BQIDCUTL(TDFN,"ACC")
. I $P(MX,"^",3)>7.49 D
.. S @TGLOB@(TDFN)="",VISIT=$P(MX,"^",4),IEN=$P(MX,"^",5)
.. S @TGLOB@(TDFN,"CRITERIA","ACC 10 Year ASCVD Risk & Age","V",VISIT,IEN)=$P($G(^AUPNVSIT(VISIT,0)),U,1)_U_U_IEN_U_9000010.01
. F TXDXCT="ASCVD Known" I $$ATAG^BQITDUTL(TDFN,TXDXCT) K @TGLOB@(TDFN)
Q
;
PAT(DEF,TGLOB,BDFN) ; EP -- By Patient
;Description
; Checks if a patient meets the criteria for ASCVD At Risk
;Input
; TGLOB - Temporary global
; BDFN - patient internal entry number
;
S FLAG=0
S QFL=0 F TXDXCT="ASCVD Known" D Q:QFL
. I $$ATAG^BQITDUTL(BDFN,TXDXCT) S QFL=1 Q
I QFL Q FLAG
;
S AGE=$$AGE^BQIAGE(BDFN)
S FLAG=0
D
. I AGE<21 Q
. S MX=$$MEAS^BQIDCUTL(BDFN,"ACC")
. I $P(MX,"^",3)>7.49 D
.. S VISIT=$P(MX,"^",4),IEN=$P(MX,"^",5),FLAG=1
.. S @TGLOB@(BDFN,"CRITERIA","ACC 10 Year ASCVD Risk & Age","V",VISIT,IEN)=$P($G(^AUPNVSIT(VISIT,0)),U,1)_U_U_IEN_U_9000010.01
Q FLAG
BQITD061 ;GDHD/HS/ALA-ASCVD At Risk ; 04 May 2016 6:46 AM
+1 ;;2.5;ICARE MANAGEMENT SYSTEM;**1**;May 24, 2016;Build 17
+2 ;
+3 QUIT
+4 ;
POP(BQARY,TGLOB) ; EP -- By population
+1 ;
+2 ;Description
+3 ; Finds all patients who meet the criteria for CVD at Risk
+4 ;Input
+5 ; BQARY - Array of taxonomies and other information
+6 ; TGLOB - Global where data is to be stored and passed back
+7 ; to calling routine
+8 ; Structure:
+9 ; TGLOB(DFN,"CRITERIA",criteria or taxonomy,visit or problem ien)=date/time
+10 ;Variables
+11 ; TAX - Taxonomy name
+12 ; NIT - Number of iterations
+13 ; TMFRAME - Time frame of check
+14 ; FREF - File Number reference
+15 ; PLFLG - Problem File flag
+16 ; GREF - Global reference
+17 ; TREF - Taxonomy temp reference
+18 ;
+19 ; Clean up all current entries
+20 NEW TDFN,AGE,MX
+21 ;
+22 SET TDFN=0
+23 FOR
SET TDFN=$ORDER(^AUPNPAT(TDFN))
IF 'TDFN
QUIT
Begin DoDot:1
+24 SET AGE=$$AGE^BQIAGE(TDFN)
+25 IF AGE<21
QUIT
+26 SET MX=$$MEAS^BQIDCUTL(TDFN,"ACC")
+27 IF $PIECE(MX,"^",3)>7.49
Begin DoDot:2
+28 SET @TGLOB@(TDFN)=""
SET VISIT=$PIECE(MX,"^",4)
SET IEN=$PIECE(MX,"^",5)
+29 SET @TGLOB@(TDFN,"CRITERIA","ACC 10 Year ASCVD Risk & Age","V",VISIT,IEN)=$PIECE($GET(^AUPNVSIT(VISIT,0)),U,1)_U_U_IEN_U_9000010.01
End DoDot:2
+30 FOR TXDXCT="ASCVD Known"
IF $$ATAG^BQITDUTL(TDFN,TXDXCT)
KILL @TGLOB@(TDFN)
End DoDot:1
+31 QUIT
+32 ;
PAT(DEF,TGLOB,BDFN) ; EP -- By Patient
+1 ;Description
+2 ; Checks if a patient meets the criteria for ASCVD At Risk
+3 ;Input
+4 ; TGLOB - Temporary global
+5 ; BDFN - patient internal entry number
+6 ;
+7 SET FLAG=0
+8 SET QFL=0
FOR TXDXCT="ASCVD Known"
Begin DoDot:1
+9 IF $$ATAG^BQITDUTL(BDFN,TXDXCT)
SET QFL=1
QUIT
End DoDot:1
IF QFL
QUIT
+10 IF QFL
QUIT FLAG
+11 ;
+12 SET AGE=$$AGE^BQIAGE(BDFN)
+13 SET FLAG=0
+14 Begin DoDot:1
+15 IF AGE<21
QUIT
+16 SET MX=$$MEAS^BQIDCUTL(BDFN,"ACC")
+17 IF $PIECE(MX,"^",3)>7.49
Begin DoDot:2
+18 SET VISIT=$PIECE(MX,"^",4)
SET IEN=$PIECE(MX,"^",5)
SET FLAG=1
+19 SET @TGLOB@(BDFN,"CRITERIA","ACC 10 Year ASCVD Risk & Age","V",VISIT,IEN)=$PIECE($GET(^AUPNVSIT(VISIT,0)),U,1)_U_U_IEN_U_9000010.01
End DoDot:2
End DoDot:1
+20 QUIT FLAG