BQITD16 ;GDIT/HS/ALA-CKD Stage 4 ; 27 Jan 2015 3:06 PM
;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
;
;
POP(BQARY,TGLOB) ; EP -- By population
;
;Description
; Finds all patients who meet the criteria for Chronic Kidney Disease Stage 4
;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
I $D(@BQARY) D
. D POP^BQITDGN(BQARY,TGLOB)
;
; Finish with all the logic and have a list of patients to file
; If already ESRD or Stage 5, then cannot be at Stage 4
NEW TDFN,TDXNCN
S TDFN=""
F S TDFN=$O(@TGLOB@(TDFN)) Q:'TDFN D
. ; if the person has already been identified as ESRD or Stage 5
. NEW I,TEXT
. F I=1:1 S TEXT=$T(TAG+I) Q:TEXT=" Q" D
.. S TDXNCN=$P(TEXT,";;",2) D
... I $$ATAG^BQITDUTL(TDFN,TDXNCN) K @TGLOB@(TDFN)
Q
;
PAT(DEF,BTGLOB,BDFN) ; EP -- By patient
NEW DXOK,BQDXN,BQREF
S DXOK=0
S BQDXN=$$GDXN^BQITUTL(DEF)
;
S BQREF="BQIRY"
D GDF^BQITUTL(BQDXN,BQREF)
S DXOK=$$PAT^BQITDGN(BQREF,BTGLOB,BDFN)
;
; if the person has already been identified as ESRD or Stage 5
NEW I,TEXT
F I=1:1 S TEXT=$T(TAG+I) Q:TEXT=" Q" D
. S TDXNCN=$P(TEXT,";;",2) D
.. I $$ATAG^BQITDUTL(BDFN,TDXNCN) S DXOK=0
Q DXOK
;
TAG ;EP
;;End Stage Renal Disease
;;Chronic Kidney Dis Stg 5
Q
BQITD16 ;GDIT/HS/ALA-CKD Stage 4 ; 27 Jan 2015 3:06 PM
+1 ;;2.6;ICARE MANAGEMENT SYSTEM;;Jul 07, 2017;Build 72
+2 ;
+3 ;
POP(BQARY,TGLOB) ; EP -- By population
+1 ;
+2 ;Description
+3 ; Finds all patients who meet the criteria for Chronic Kidney Disease Stage 4
+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 IF $DATA(@BQARY)
Begin DoDot:1
+11 DO POP^BQITDGN(BQARY,TGLOB)
End DoDot:1
+12 ;
+13 ; Finish with all the logic and have a list of patients to file
+14 ; If already ESRD or Stage 5, then cannot be at Stage 4
+15 NEW TDFN,TDXNCN
+16 SET TDFN=""
+17 FOR
SET TDFN=$ORDER(@TGLOB@(TDFN))
IF 'TDFN
QUIT
Begin DoDot:1
+18 ; if the person has already been identified as ESRD or Stage 5
+19 NEW I,TEXT
+20 FOR I=1:1
SET TEXT=$TEXT(TAG+I)
IF TEXT=" Q"
QUIT
Begin DoDot:2
+21 SET TDXNCN=$PIECE(TEXT,";;",2)
Begin DoDot:3
+22 IF $$ATAG^BQITDUTL(TDFN,TDXNCN)
KILL @TGLOB@(TDFN)
End DoDot:3
End DoDot:2
End DoDot:1
+23 QUIT
+24 ;
PAT(DEF,BTGLOB,BDFN) ; EP -- By patient
+1 NEW DXOK,BQDXN,BQREF
+2 SET DXOK=0
+3 SET BQDXN=$$GDXN^BQITUTL(DEF)
+4 ;
+5 SET BQREF="BQIRY"
+6 DO GDF^BQITUTL(BQDXN,BQREF)
+7 SET DXOK=$$PAT^BQITDGN(BQREF,BTGLOB,BDFN)
+8 ;
+9 ; if the person has already been identified as ESRD or Stage 5
+10 NEW I,TEXT
+11 FOR I=1:1
SET TEXT=$TEXT(TAG+I)
IF TEXT=" Q"
QUIT
Begin DoDot:1
+12 SET TDXNCN=$PIECE(TEXT,";;",2)
Begin DoDot:2
+13 IF $$ATAG^BQITDUTL(BDFN,TDXNCN)
SET DXOK=0
End DoDot:2
End DoDot:1
+14 QUIT DXOK
+15 ;
TAG ;EP
+1 ;;End Stage Renal Disease
+2 ;;Chronic Kidney Dis Stg 5
+3 QUIT