OCXOZ0C ;SLC/RJS,CLA - Order Check Scan ;JAN 28,2014 at 03:37
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221,243**;Dec 17,1997;Build 242
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
; ***************************************************************
; ** Warning: This routine is automatically generated by the **
; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine **
; ** will be lost the next time the rule compiler executes. **
; ***************************************************************
;
Q
;
CHK347 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK58+20^OCXOZ05.
;
Q:$G(OCXOERR)
;
; Local CHK347 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
; OCXDF(136) --> Data Field: CLOZAPINE ANC W/IN 7 FLAG (BOOLEAN)
; OCXDF(137) --> Data Field: CLOZAPINE ANC W/IN 7 RESULT (NUMERIC)
; OCXDF(139) --> Data Field: CLOZAPINE WBC W/IN 7 FLAG (BOOLEAN)
; OCXDF(140) --> Data Field: CLOZAPINE WBC W/IN 7 RESULT (NUMERIC)
;
; Local Extrinsic Functions
;
S OCXDF(137)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",2) I $L(OCXDF(137)) D CHK349
S OCXDF(136)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1) I $L(OCXDF(136)),'(OCXDF(136)) D CHK371
S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),'(OCXDF(139)) D CHK375
S OCXDF(140)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",2) I $L(OCXDF(140)) D CHK378
Q
;
CHK349 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK347+15.
;
Q:$G(OCXOERR)
;
; Local CHK349 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
; OCXDF(136) --> Data Field: CLOZAPINE ANC W/IN 7 FLAG (BOOLEAN)
; OCXDF(137) --> Data Field: CLOZAPINE ANC W/IN 7 RESULT (NUMERIC)
;
; Local Extrinsic Functions
;
I (OCXDF(137)<1.5) S OCXDF(136)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1) I $L(OCXDF(136)),(OCXDF(136)) D CHK353
I (OCXDF(137)>1.499) D CHK355
Q
;
CHK353 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK349+13.
;
Q:$G(OCXOERR)
;
; Local CHK353 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,114, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE ANC < 1.5)
;
S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,114,"130") Q:OCXOERR
Q
;
CHK355 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK349+14.
;
Q:$G(OCXOERR)
;
; Local CHK355 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
; OCXDF(136) --> Data Field: CLOZAPINE ANC W/IN 7 FLAG (BOOLEAN)
; OCXDF(137) --> Data Field: CLOZAPINE ANC W/IN 7 RESULT (NUMERIC)
;
; Local Extrinsic Functions
;
S OCXDF(136)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1) I $L(OCXDF(136)),(OCXDF(136)) D CHK358
I (OCXDF(137)<"2.0") S OCXDF(136)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1) I $L(OCXDF(136)),(OCXDF(136)) D CHK508^OCXOZ0F
Q
;
CHK358 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK355+13.
;
Q:$G(OCXOERR)
;
; Local CHK358 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,115, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE ANC >= 1.5)
;
S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,115,"130") Q:OCXOERR
Q
;
CHK360 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK198+9^OCXOZ09.
;
Q:$G(OCXOERR)
;
; Local CHK360 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(43) ---> Data Field: OI NATIONAL ID (FREE TEXT)
; OCXDF(74) ---> Data Field: VA DRUG CLASS (FREE TEXT)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
; OCXDF(132) --> Data Field: CLOZAPINE MED (BOOLEAN)
;
; Local Extrinsic Functions
;
S OCXDF(131)=$P($P($G(OCXPSD),"|",3),"^",4) I $L(OCXDF(131)) S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(132)=$P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",1) D CHK365
S OCXDF(43)=$P($P($G(OCXPSD),"|",3),"^",1) I $L(OCXDF(43)) S OCXDF(74)=$P($$ENVAC^PSJORUT2(OCXDF(43)),"^",2) I $L(OCXDF(74)) D CHK497^OCXOZ0F
Q
;
CHK365 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK360+14.
;
Q:$G(OCXOERR)
;
; Local CHK365 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
; OCXDF(132) --> Data Field: CLOZAPINE MED (BOOLEAN)
;
; Local Extrinsic Functions
; FILE(DFN,116, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE DRUG SELECTED)
;
I $L(OCXDF(132)),(OCXDF(132)) S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,116,"130") Q:OCXOERR
Q
;
CHK371 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK347+16.
;
Q:$G(OCXOERR)
;
; Local CHK371 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,117, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE NO ANC W/IN 7 DAYS)
;
S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,117,"130") Q:OCXOERR
Q
;
CHK375 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK347+17.
;
Q:$G(OCXOERR)
;
; Local CHK375 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,118, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE NO WBC W/IN 7 DAYS)
;
S OCXDF(130)=$P($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4),OCXOERR=$$FILE(DFN,118,"130") Q:OCXOERR
Q
;
CHK378 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK347+18.
;
Q:$G(OCXOERR)
;
; Local CHK378 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
; OCXDF(139) --> Data Field: CLOZAPINE WBC W/IN 7 FLAG (BOOLEAN)
; OCXDF(140) --> Data Field: CLOZAPINE WBC W/IN 7 RESULT (NUMERIC)
;
; Local Extrinsic Functions
;
I (OCXDF(140)<"3.0") S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),(OCXDF(139)) D CHK382^OCXOZ0D
I (OCXDF(140)>2.999),(OCXDF(140)<3.5) S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),(OCXDF(139)) D CHK388^OCXOZ0D
I (OCXDF(140)>3.499) S OCXDF(139)=$P($P($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1) I $L(OCXDF(139)),(OCXDF(139)) D CHK393^OCXOZ0D
Q
;
FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
;
N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
;
Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
;
S OCXDATA(DFN,OCXELE)=1
F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
.S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
;
M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
;
Q 0
;
OCXOZ0C ;SLC/RJS,CLA - Order Check Scan ;JAN 28,2014 at 03:37
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221,243**;Dec 17,1997;Build 242
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
+4 ; ***************************************************************
+5 ; ** Warning: This routine is automatically generated by the **
+6 ; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine **
+7 ; ** will be lost the next time the rule compiler executes. **
+8 ; ***************************************************************
+9 ;
+10 QUIT
+11 ;
CHK347 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK58+20^OCXOZ05.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK347 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+8 ; OCXDF(136) --> Data Field: CLOZAPINE ANC W/IN 7 FLAG (BOOLEAN)
+9 ; OCXDF(137) --> Data Field: CLOZAPINE ANC W/IN 7 RESULT (NUMERIC)
+10 ; OCXDF(139) --> Data Field: CLOZAPINE WBC W/IN 7 FLAG (BOOLEAN)
+11 ; OCXDF(140) --> Data Field: CLOZAPINE WBC W/IN 7 RESULT (NUMERIC)
+12 ;
+13 ; Local Extrinsic Functions
+14 ;
+15 SET OCXDF(137)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",2)
IF $LENGTH(OCXDF(137))
DO CHK349
+16 SET OCXDF(136)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1)
IF $LENGTH(OCXDF(136))
IF '(OCXDF(136))
DO CHK371
+17 SET OCXDF(139)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1)
IF $LENGTH(OCXDF(139))
IF '(OCXDF(139))
DO CHK375
+18 SET OCXDF(140)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",2)
IF $LENGTH(OCXDF(140))
DO CHK378
+19 QUIT
+20 ;
CHK349 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK347+15.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK349 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+8 ; OCXDF(136) --> Data Field: CLOZAPINE ANC W/IN 7 FLAG (BOOLEAN)
+9 ; OCXDF(137) --> Data Field: CLOZAPINE ANC W/IN 7 RESULT (NUMERIC)
+10 ;
+11 ; Local Extrinsic Functions
+12 ;
+13 IF (OCXDF(137)<1.5)
SET OCXDF(136)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1)
IF $LENGTH(OCXDF(136))
IF (OCXDF(136))
DO CHK353
+14 IF (OCXDF(137)>1.499)
DO CHK355
+15 QUIT
+16 ;
CHK353 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK349+13.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK353 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
+8 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; FILE(DFN,114, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE ANC < 1.5)
+12 ;
+13 SET OCXDF(130)=$PIECE($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4)
SET OCXOERR=$$FILE(DFN,114,"130")
IF OCXOERR
QUIT
+14 QUIT
+15 ;
CHK355 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK349+14.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK355 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+8 ; OCXDF(136) --> Data Field: CLOZAPINE ANC W/IN 7 FLAG (BOOLEAN)
+9 ; OCXDF(137) --> Data Field: CLOZAPINE ANC W/IN 7 RESULT (NUMERIC)
+10 ;
+11 ; Local Extrinsic Functions
+12 ;
+13 SET OCXDF(136)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1)
IF $LENGTH(OCXDF(136))
IF (OCXDF(136))
DO CHK358
+14 IF (OCXDF(137)<"2.0")
SET OCXDF(136)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",3),";",1)
IF $LENGTH(OCXDF(136))
IF (OCXDF(136))
DO CHK508^OCXOZ0F
+15 QUIT
+16 ;
CHK358 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK355+13.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK358 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
+8 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; FILE(DFN,115, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE ANC >= 1.5)
+12 ;
+13 SET OCXDF(130)=$PIECE($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4)
SET OCXOERR=$$FILE(DFN,115,"130")
IF OCXOERR
QUIT
+14 QUIT
+15 ;
CHK360 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK198+9^OCXOZ09.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK360 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(43) ---> Data Field: OI NATIONAL ID (FREE TEXT)
+8 ; OCXDF(74) ---> Data Field: VA DRUG CLASS (FREE TEXT)
+9 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+10 ; OCXDF(132) --> Data Field: CLOZAPINE MED (BOOLEAN)
+11 ;
+12 ; Local Extrinsic Functions
+13 ;
+14 SET OCXDF(131)=$PIECE($PIECE($GET(OCXPSD),"|",3),"^",4)
IF $LENGTH(OCXDF(131))
SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXDF(132)=$PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",1)
DO CHK365
+15 SET OCXDF(43)=$PIECE($PIECE($GET(OCXPSD),"|",3),"^",1)
IF $LENGTH(OCXDF(43))
SET OCXDF(74)=$PIECE($$ENVAC^PSJORUT2(OCXDF(43)),"^",2)
IF $LENGTH(OCXDF(74))
DO CHK497^OCXOZ0F
+16 QUIT
+17 ;
CHK365 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK360+14.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK365 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
+8 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+9 ; OCXDF(132) --> Data Field: CLOZAPINE MED (BOOLEAN)
+10 ;
+11 ; Local Extrinsic Functions
+12 ; FILE(DFN,116, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE DRUG SELECTED)
+13 ;
+14 IF $LENGTH(OCXDF(132))
IF (OCXDF(132))
SET OCXDF(130)=$PIECE($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4)
SET OCXOERR=$$FILE(DFN,116,"130")
IF OCXOERR
QUIT
+15 QUIT
+16 ;
CHK371 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK347+16.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK371 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
+8 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; FILE(DFN,117, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE NO ANC W/IN 7 DAYS)
+12 ;
+13 SET OCXDF(130)=$PIECE($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4)
SET OCXOERR=$$FILE(DFN,117,"130")
IF OCXOERR
QUIT
+14 QUIT
+15 ;
CHK375 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK347+17.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK375 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(130) --> Data Field: CLOZAPINE LAB RESULTS (FREE TEXT)
+8 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; FILE(DFN,118, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CLOZAPINE NO WBC W/IN 7 DAYS)
+12 ;
+13 SET OCXDF(130)=$PIECE($$CLOZLABS^ORKLR(OCXDF(37),"",OCXDF(131)),"^",4)
SET OCXOERR=$$FILE(DFN,118,"130")
IF OCXOERR
QUIT
+14 QUIT
+15 ;
CHK378 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK347+18.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK378 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(131) --> Data Field: PHARMACY LOCAL ID (FREE TEXT)
+8 ; OCXDF(139) --> Data Field: CLOZAPINE WBC W/IN 7 FLAG (BOOLEAN)
+9 ; OCXDF(140) --> Data Field: CLOZAPINE WBC W/IN 7 RESULT (NUMERIC)
+10 ;
+11 ; Local Extrinsic Functions
+12 ;
+13 IF (OCXDF(140)<"3.0")
SET OCXDF(139)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1)
IF $LENGTH(OCXDF(139))
IF (OCXDF(139))
DO CHK382^OCXOZ0D
+14 IF (OCXDF(140)>2.999)
IF (OCXDF(140)<3.5)
SET OCXDF(139)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1)
IF $LENGTH(OCXDF(139))
IF (OCXDF(139))
DO CHK388^OCXOZ0D
+15 IF (OCXDF(140)>3.499)
SET OCXDF(139)=$PIECE($PIECE($$CLOZLABS^ORKLR(OCXDF(37),7,OCXDF(131)),"^",2),";",1)
IF $LENGTH(OCXDF(139))
IF (OCXDF(139))
DO CHK393^OCXOZ0D
+16 QUIT
+17 ;
FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
+1 ;
+2 NEW OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
+3 SET DFN=+$GET(DFN)
SET OCXELE=+$GET(OCXELE)
+4 ;
+5 IF 'DFN
QUIT 1
IF 'OCXELE
QUIT 1
KILL OCXDATA
+6 ;
+7 SET OCXDATA(DFN,OCXELE)=1
+8 FOR OCXPC=1:1:$LENGTH(OCXDFL,",")
SET OCXDFI=$PIECE(OCXDFL,",",OCXPC)
IF OCXDFI
Begin DoDot:1
+9 SET OCXVAL=$GET(OCXDF(+OCXDFI))
SET OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
End DoDot:1
+10 ;
+11 MERGE ^TMP("OCXCHK",$JOB,DFN)=OCXDATA(DFN)
+12 ;
+13 QUIT 0
+14 ;