Check for Merged or Test patients. New parameter CCRTEST=0 if not testing

This commit is contained in:
george 2008-09-05 17:18:56 +00:00
parent 65aacbe1f2
commit 4c3fba6fcd
1 changed files with 21 additions and 0 deletions

View File

@ -32,3 +32,24 @@ SYSNAME() ;Get EHR System Name; PUBLIC; Extrinsic
SYSVER() ;Get EHR System Version; PUBLIC; Extrinsic
Q "1.0"
;
PTST(DFN) ;TEST TO SEE IF PATIENT MERGED OR A TEST PATIENT
; DFN = IEN of the Patient to be tested
; 1 = Merged or Test Patient
; 0 = Non-test Patient
;
I $D(^DPT(DFN,-9)) Q 1 ;This patient has been merged
I $G(^DPT(DFN,0))="" Q 1 ;Missing zeroth node <---add
;
I '$D(CCRTEST) S CCRTEST=1 ; DEFAULT IS THAT WE ARE TESTING
I 'CCRTEST D ; IF WE ARE NOT TESTING, SKIP TEST PATIENTS
. N DIERR,DATA
. S DATA=+$$GET1^DIQ(2,DFN_",",.6,"I") ;Test Patient Indicator
. ; 1 = Test Patient
. ; 0 = Non-test Patient
. I DATA Q DATA
. S DATA=$$GET1^DIQ(2,DFN_",",.09,"I") ;SSN test
. D CLEAN^DILF
. I $E(DATA,1,3)="000" Q 1
. I $E(DATA,1,3)="666" Q 1
Q 0
;