BQITD06 ;PRXM/HC/ALA-CVD At Risk ; 10 Apr 2006 6:50 PM
;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
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 DXNN,TDFN,DA,DIK,AGE,DFN,FLAG,SEX,TXDXCN,TXDXCT,VSDTM,RGIEN,QFL
S TDFN=0
F S TDFN=$O(^AUPNPAT(TDFN)) Q:'TDFN D
. S SEX=$$GET1^DIQ(2,TDFN,.02,"I")
. S AGE=$$AGE^BQIAGE(TDFN)
. ; Factor for CVD At Risk is AGE - as per IHS
. I SEX="M"!(SEX="U"),AGE'<45 S @TGLOB@(TDFN)="",@TGLOB@(TDFN,"CRITERIA","Age: "_AGE)=""
. I SEX="F",AGE'<55 S @TGLOB@(TDFN)="",@TGLOB@(TDFN,"CRITERIA","Age: "_AGE)=""
. ;
. S QFL=0 F TXDXCT="CVD Known","CVD Highest Risk","CVD Significant Risk" D Q:QFL
.. I $$ATAG^BQITDUTL(TDFN,TXDXCT) K @TGLOB@(TDFN) S QFL=1
Q
;
PAT(DEF,TGLOB,BDFN) ; EP -- By Patient
;Description
; Checks if a patient meets the criteria for CVD At Risk
;Input
; TGLOB - Temporary global
; BDFN - patient internal entry number
;
S FLAG=0
S QFL=0 F TXDXCT="CVD Known","CVD Highest Risk","CVD Significant Risk" D Q:QFL
. I $$ATAG^BQITDUTL(BDFN,TXDXCT) S QFL=1 Q
I QFL Q FLAG
;
S SEX=$$GET1^DIQ(2,BDFN,.02,"I")
S AGE=$$AGE^BQIAGE(BDFN)
S FLAG=0
I SEX="M"!(SEX="U"),AGE'<45 D
. S FLAG=1
. ; Factor for CVD At Risk is AGE - as per IHS
. S @TGLOB@(BDFN,"CRITERIA","Age: "_AGE)=""
;
I SEX="F",AGE'<55 D
. S FLAG=1
. ; Factor for CVD At Risk is AGE - as per IHS
. S @TGLOB@(BDFN,"CRITERIA","Age: "_AGE)=""
Q FLAG
BQITD06 ;PRXM/HC/ALA-CVD At Risk ; 10 Apr 2006 6:50 PM
+1 ;;2.3;ICARE MANAGEMENT SYSTEM;**3,4**;Apr 18, 2012;Build 66
+2 QUIT
+3 ;
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 DXNN,TDFN,DA,DIK,AGE,DFN,FLAG,SEX,TXDXCN,TXDXCT,VSDTM,RGIEN,QFL
+21 SET TDFN=0
+22 FOR
SET TDFN=$ORDER(^AUPNPAT(TDFN))
IF 'TDFN
QUIT
Begin DoDot:1
+23 SET SEX=$$GET1^DIQ(2,TDFN,.02,"I")
+24 SET AGE=$$AGE^BQIAGE(TDFN)
+25 ; Factor for CVD At Risk is AGE - as per IHS
+26 IF SEX="M"!(SEX="U")
IF AGE'<45
SET @TGLOB@(TDFN)=""
SET @TGLOB@(TDFN,"CRITERIA","Age: "_AGE)=""
+27 IF SEX="F"
IF AGE'<55
SET @TGLOB@(TDFN)=""
SET @TGLOB@(TDFN,"CRITERIA","Age: "_AGE)=""
+28 ;
+29 SET QFL=0
FOR TXDXCT="CVD Known","CVD Highest Risk","CVD Significant Risk"
Begin DoDot:2
+30 IF $$ATAG^BQITDUTL(TDFN,TXDXCT)
KILL @TGLOB@(TDFN)
SET QFL=1
End DoDot:2
IF QFL
QUIT
End DoDot:1
+31 QUIT
+32 ;
PAT(DEF,TGLOB,BDFN) ; EP -- By Patient
+1 ;Description
+2 ; Checks if a patient meets the criteria for CVD 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="CVD Known","CVD Highest Risk","CVD Significant Risk"
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 SEX=$$GET1^DIQ(2,BDFN,.02,"I")
+13 SET AGE=$$AGE^BQIAGE(BDFN)
+14 SET FLAG=0
+15 IF SEX="M"!(SEX="U")
IF AGE'<45
Begin DoDot:1
+16 SET FLAG=1
+17 ; Factor for CVD At Risk is AGE - as per IHS
+18 SET @TGLOB@(BDFN,"CRITERIA","Age: "_AGE)=""
End DoDot:1
+19 ;
+20 IF SEX="F"
IF AGE'<55
Begin DoDot:1
+21 SET FLAG=1
+22 ; Factor for CVD At Risk is AGE - as per IHS
+23 SET @TGLOB@(BDFN,"CRITERIA","Age: "_AGE)=""
End DoDot:1
+24 QUIT FLAG