OCXOZ09 ;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
;
CHK188 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK58+19^OCXOZ05.
;
Q:$G(OCXOERR)
;
; Local CHK188 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(40) ---> Data Field: ORDER MODE (FREE TEXT)
; OCXDF(47) ---> Data Field: OI LOCAL TEXT (FREE TEXT)
;
; Local Extrinsic Functions
; CLIST( -----------> STRING CONTAINS ONE OF A LIST OF VALUES
; EQTERM( ----------> EQUALS TERM OPERATOR
;
I $$EQTERM(OCXDF(47),"ANGIOGRAM (PERIPHERAL)") S OCXDF(40)=$G(OCXPSM) I $L(OCXDF(40)),(OCXDF(40)="SESSION") D CHK192
I $$CLIST(OCXDF(47),"GLUCOPHAGE,METFORMIN") S OCXDF(40)=$G(OCXPSM) I $L(OCXDF(40)),(OCXDF(40)="SELECT") S OCXDF(2)=$P($G(OCXPSD),"|",2) I $L(OCXDF(2)) D CHK280^OCXOZ0B
Q
;
CHK192 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK188+14.
;
Q:$G(OCXOERR)
;
; Local CHK192 Variables
; OCXDF(68) ---> Data Field: MISSING ANGIOGRAM, CATH PERIF LAB TESTS (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,65, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SESSION ORDER FOR ANGIOGRAM)
; MTSTF( -----------> MISSING TESTS DURING SESSION
;
S OCXDF(68)=$$MTSTF("PROTHROMBIN TIME,PARTIAL THROMBOPLASTIN TIME") I $L(OCXDF(68)),($L(OCXDF(68))>0) S OCXOERR=$$FILE(DFN,65,"68") Q:OCXOERR
Q
;
CHK196 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK163+13^OCXOZ08.
;
Q:$G(OCXOERR)
;
; Local CHK196 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
; OCXDF(73) ---> Data Field: ORDERABLE ITEM IEN (NUMERIC)
;
; Local Extrinsic Functions
; CLIST( -----------> STRING CONTAINS ONE OF A LIST OF VALUES
;
S OCXDF(2)=$P($G(OCXPSD),"|",2) I $L(OCXDF(2)) D CHK198
S OCXDF(73)=$P($G(OCXPSD),"|",1) I $L(OCXDF(73)) S OCXDF(67)=$$CM^ORQQRA(OCXDF(73)) I $L(OCXDF(67)),$$CLIST(OCXDF(67),"M,I,N") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) D CHK458^OCXOZ0E
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) D CHK489^OCXOZ0F
Q
;
CHK198 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK196+14.
;
Q:$G(OCXOERR)
;
; Local CHK198 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
;
I (OCXDF(2)="RA") D CHK199
I ($E(OCXDF(2),1,2)="PS") D CHK360^OCXOZ0C
Q
;
CHK199 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK198+8.
;
Q:$G(OCXOERR)
;
; Local CHK199 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(73) ---> Data Field: ORDERABLE ITEM IEN (NUMERIC)
;
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) D CHK201
S OCXDF(73)=$P($G(OCXPSD),"|",1) I $L(OCXDF(73)) D CHK236^OCXOZ0A
Q
;
CHK201 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK199+9.
;
Q:$G(OCXOERR)
;
; Local CHK201 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(65) ---> Data Field: CONTRAST MEDIA ALLERGY FLAG (BOOLEAN)
; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
; OCXDF(69) ---> Data Field: RECENT BARIUM STUDY FLAG (BOOLEAN)
; OCXDF(73) ---> Data Field: ORDERABLE ITEM IEN (NUMERIC)
;
; Local Extrinsic Functions
; RECBAR( ----------> RECENT BARIUM STUDY
;
S OCXDF(65)=$$ORCHK^GMRAOR(OCXDF(37),"CM","") I $L(OCXDF(65)),(OCXDF(65)) S OCXDF(73)=$P($G(OCXPSD),"|",1) I $L(OCXDF(73)) S OCXDF(67)=$$CM^ORQQRA(OCXDF(73)) D CHK207
S OCXDF(69)=$P($$RECBAR(OCXDF(37),48),"^",1) I $L(OCXDF(69)),(OCXDF(69)) S OCXDF(73)=$P($G(OCXPSD),"|",1) I $L(OCXDF(73)) S OCXDF(67)=$$CM^ORQQRA(OCXDF(73)) D CHK217
Q
;
CHK207 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK201+15.
;
Q:$G(OCXOERR)
;
; Local CHK207 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(66) ---> Data Field: CONTRAST MEDIA CODE TRANSLATION (FREE TEXT)
; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
; OCXDF(160) --> Data Field: ALLERGY CONTRAST MEDIA LOCATION (FREE TEXT)
;
; Local Extrinsic Functions
; CLIST( -----------> STRING CONTAINS ONE OF A LIST OF VALUES
; CONTRANS( --------> CONTRAST MEDIA CODE TRANSLATION
;
I $L(OCXDF(67)),$$CLIST(OCXDF(67),"M,I,N,L,C,G,B") S OCXDF(66)=$$CONTRANS(OCXDF(67)),OCXDF(160)=$P($$ORCHK^GMRAOR(OCXDF(37),"CM","",1),"^",2) D CHK211
Q
;
CHK211 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK207+15.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; FILE(DFN,66, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CONTRAST MEDIA ALLERGY)
;
S OCXOERR=$$FILE(DFN,66,"66,160") Q:OCXOERR
Q
;
CHK217 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK201+16.
;
Q:$G(OCXOERR)
;
; Local CHK217 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
; OCXDF(70) ---> Data Field: RECENT BARIUM STUDY TEXT (FREE TEXT)
; OCXDF(121) --> Data Field: RECENT BARIUM STUDY ORDER STATUS (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,67, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: RECENT BARIUM STUDY ORDERED)
; RECBAR( ----------> RECENT BARIUM STUDY
; RECBARST( --------> RECENT BARIUM ORDER STATUS
;
I $L(OCXDF(67)),(OCXDF(67)["B") S OCXDF(70)=$P($$RECBAR(OCXDF(37),48),"^",3),OCXDF(121)=$P($$RECBARST(OCXDF(37),48),"^",2),OCXOERR=$$FILE(DFN,67,"70,121") Q:OCXOERR
Q
;
CLIST(DATA,LIST) ; DOES THE DATA FIELD CONTAIN AN ELEMENT IN THE LIST
;
N PC F PC=1:1:$L(LIST,","),0 I PC,$L($P(LIST,",",PC)),(DATA[$P(LIST,",",PC)) Q
Q ''PC
;
CONTRANS(OCXC) ; Compiler Function: CONTRAST MEDIA CODE TRANSLATION
;
N OCXX
Q:'$L($G(OCXC)) "" S OCXX=$S((OCXC["B"):"Barium",1:"")
I (OCXC["G") S:$L(OCXX) OCXX=OCXX_" and/or " S OCXX=OCXX_"Gastrografin"
I (OCXC["I") S:$L(OCXX) OCXX=OCXX_" and/or " S OCXX=OCXX_"Ionic Iodinated"
I (OCXC["N") S:$L(OCXX) OCXX=OCXX_" and/or " S OCXX=OCXX_"Non-ionic Iodinated"
I (OCXC["L") S:$L(OCXX) OCXX=OCXX_" and/or " S OCXX=OCXX_"Gadolinium"
I (OCXC["C") S:$L(OCXX) OCXX=OCXX_" and/or " S OCXX=OCXX_"Cholecystographic"
I (OCXC["M") S:$L(OCXX) OCXX=OCXX_" and/or " S OCXX=OCXX_"Unspecified contrast media"
Q OCXX
;
EQTERM(DATA,TERM) ; Compiler Function: EQUALS TERM OPERATOR
;
N OCXF,OCXL
;
S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
Q:'OCXF 0
I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
Q 0
;
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
;
MTSTF(OILIST) ; Compiler Function: MISSING TESTS DURING SESSION
;
N OCXPC,OCXOI,OCXOUT S OCXOUT=""
F OCXPC=1:1:$L(OILIST,",") S OCXOI=$P(OILIST,",",OCXPC) I $L(OCXOI) D
.N OCXL,OCXF,OCXD0
.S OCXL="",OCXF=$$TERMLKUP(OCXOI,.OCXL)
.S OCXD0=0 F S OCXD0=$O(OCXL(OCXD0)) Q:'OCXD0 Q:$$OISESS^ORKCHK2(+OCXD0)
.Q:OCXD0
.S:$L(OCXOUT) OCXOUT=OCXOUT_", " S OCXOUT=OCXOUT_OCXOI
Q OCXOUT
;
RECBAR(DFN,HOURS) ; Compiler Function: RECENT BARIUM STUDY
;
Q:'$G(DFN) 0 Q:'$G(HOURS) 0 N OUT S OUT=$$RECENTBA^ORKRA(DFN,HOURS) Q:'$L(OUT) 0 Q 1_U_OUT
;
;
RECBARST(DFN,HOURS) ; Compiler Function: RECENT BARIUM ORDER STATUS
;
Q:'$G(DFN) 0 Q:'$G(HOURS) 0
N ORDER S ORDER=$P($$RECENTBA^ORKRA(DFN,HOURS),U) Q:'$L(ORDER) 0
N STATUS S STATUS=$P($$STATUS^ORQOR2(ORDER),U,2) Q:'$L(STATUS) 0
Q 1_U_STATUS
;
TERMLKUP(OCXTERM,OCXLIST) ;
Q $$TERM^OCXOZ01(OCXTERM,.OCXLIST)
;
OCXOZ09 ;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 ;
CHK188 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK58+19^OCXOZ05.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK188 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ; OCXDF(40) ---> Data Field: ORDER MODE (FREE TEXT)
+8 ; OCXDF(47) ---> Data Field: OI LOCAL TEXT (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; CLIST( -----------> STRING CONTAINS ONE OF A LIST OF VALUES
+12 ; EQTERM( ----------> EQUALS TERM OPERATOR
+13 ;
+14 IF $$EQTERM(OCXDF(47),"ANGIOGRAM (PERIPHERAL)")
SET OCXDF(40)=$GET(OCXPSM)
IF $LENGTH(OCXDF(40))
IF (OCXDF(40)="SESSION")
DO CHK192
+15 IF $$CLIST(OCXDF(47),"GLUCOPHAGE,METFORMIN")
SET OCXDF(40)=$GET(OCXPSM)
IF $LENGTH(OCXDF(40))
IF (OCXDF(40)="SELECT")
SET OCXDF(2)=$PIECE($GET(OCXPSD),"|",2)
IF $LENGTH(OCXDF(2))
DO CHK280^OCXOZ0B
+16 QUIT
+17 ;
CHK192 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK188+14.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK192 Variables
+6 ; OCXDF(68) ---> Data Field: MISSING ANGIOGRAM, CATH PERIF LAB TESTS (FREE TEXT)
+7 ;
+8 ; Local Extrinsic Functions
+9 ; FILE(DFN,65, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SESSION ORDER FOR ANGIOGRAM)
+10 ; MTSTF( -----------> MISSING TESTS DURING SESSION
+11 ;
+12 SET OCXDF(68)=$$MTSTF("PROTHROMBIN TIME,PARTIAL THROMBOPLASTIN TIME")
IF $LENGTH(OCXDF(68))
IF ($LENGTH(OCXDF(68))>0)
SET OCXOERR=$$FILE(DFN,65,"68")
IF OCXOERR
QUIT
+13 QUIT
+14 ;
CHK196 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK163+13^OCXOZ08.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK196 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+8 ; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
+9 ; OCXDF(73) ---> Data Field: ORDERABLE ITEM IEN (NUMERIC)
+10 ;
+11 ; Local Extrinsic Functions
+12 ; CLIST( -----------> STRING CONTAINS ONE OF A LIST OF VALUES
+13 ;
+14 SET OCXDF(2)=$PIECE($GET(OCXPSD),"|",2)
IF $LENGTH(OCXDF(2))
DO CHK198
+15 SET OCXDF(73)=$PIECE($GET(OCXPSD),"|",1)
IF $LENGTH(OCXDF(73))
SET OCXDF(67)=$$CM^ORQQRA(OCXDF(73))
IF $LENGTH(OCXDF(67))
IF $$CLIST(OCXDF(67),"M,I,N")
SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
DO CHK458^OCXOZ0E
+16 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
DO CHK489^OCXOZ0F
+17 QUIT
+18 ;
CHK198 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK196+14.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK198 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ;
+8 IF (OCXDF(2)="RA")
DO CHK199
+9 IF ($EXTRACT(OCXDF(2),1,2)="PS")
DO CHK360^OCXOZ0C
+10 QUIT
+11 ;
CHK199 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK198+8.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK199 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(73) ---> Data Field: ORDERABLE ITEM IEN (NUMERIC)
+8 ;
+9 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
DO CHK201
+10 SET OCXDF(73)=$PIECE($GET(OCXPSD),"|",1)
IF $LENGTH(OCXDF(73))
DO CHK236^OCXOZ0A
+11 QUIT
+12 ;
CHK201 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK199+9.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK201 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(65) ---> Data Field: CONTRAST MEDIA ALLERGY FLAG (BOOLEAN)
+8 ; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
+9 ; OCXDF(69) ---> Data Field: RECENT BARIUM STUDY FLAG (BOOLEAN)
+10 ; OCXDF(73) ---> Data Field: ORDERABLE ITEM IEN (NUMERIC)
+11 ;
+12 ; Local Extrinsic Functions
+13 ; RECBAR( ----------> RECENT BARIUM STUDY
+14 ;
+15 SET OCXDF(65)=$$ORCHK^GMRAOR(OCXDF(37),"CM","")
IF $LENGTH(OCXDF(65))
IF (OCXDF(65))
SET OCXDF(73)=$PIECE($GET(OCXPSD),"|",1)
IF $LENGTH(OCXDF(73))
SET OCXDF(67)=$$CM^ORQQRA(OCXDF(73))
DO CHK207
+16 SET OCXDF(69)=$PIECE($$RECBAR(OCXDF(37),48),"^",1)
IF $LENGTH(OCXDF(69))
IF (OCXDF(69))
SET OCXDF(73)=$PIECE($GET(OCXPSD),"|",1)
IF $LENGTH(OCXDF(73))
SET OCXDF(67)=$$CM^ORQQRA(OCXDF(73))
DO CHK217
+17 QUIT
+18 ;
CHK207 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK201+15.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK207 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(66) ---> Data Field: CONTRAST MEDIA CODE TRANSLATION (FREE TEXT)
+8 ; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
+9 ; OCXDF(160) --> Data Field: ALLERGY CONTRAST MEDIA LOCATION (FREE TEXT)
+10 ;
+11 ; Local Extrinsic Functions
+12 ; CLIST( -----------> STRING CONTAINS ONE OF A LIST OF VALUES
+13 ; CONTRANS( --------> CONTRAST MEDIA CODE TRANSLATION
+14 ;
+15 IF $LENGTH(OCXDF(67))
IF $$CLIST(OCXDF(67),"M,I,N,L,C,G,B")
SET OCXDF(66)=$$CONTRANS(OCXDF(67))
SET OCXDF(160)=$PIECE($$ORCHK^GMRAOR(OCXDF(37),"CM","",1),"^",2)
DO CHK211
+16 QUIT
+17 ;
CHK211 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK207+15.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; FILE(DFN,66, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CONTRAST MEDIA ALLERGY)
+7 ;
+8 SET OCXOERR=$$FILE(DFN,66,"66,160")
IF OCXOERR
QUIT
+9 QUIT
+10 ;
CHK217 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK201+16.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK217 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(67) ---> Data Field: CONTRAST MEDIA CODE (FREE TEXT)
+8 ; OCXDF(70) ---> Data Field: RECENT BARIUM STUDY TEXT (FREE TEXT)
+9 ; OCXDF(121) --> Data Field: RECENT BARIUM STUDY ORDER STATUS (FREE TEXT)
+10 ;
+11 ; Local Extrinsic Functions
+12 ; FILE(DFN,67, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: RECENT BARIUM STUDY ORDERED)
+13 ; RECBAR( ----------> RECENT BARIUM STUDY
+14 ; RECBARST( --------> RECENT BARIUM ORDER STATUS
+15 ;
+16 IF $LENGTH(OCXDF(67))
IF (OCXDF(67)["B")
SET OCXDF(70)=$PIECE($$RECBAR(OCXDF(37),48),"^",3)
SET OCXDF(121)=$PIECE($$RECBARST(OCXDF(37),48),"^",2)
SET OCXOERR=$$FILE(DFN,67,"70,121")
IF OCXOERR
QUIT
+17 QUIT
+18 ;
CLIST(DATA,LIST) ; DOES THE DATA FIELD CONTAIN AN ELEMENT IN THE LIST
+1 ;
+2 NEW PC
FOR PC=1:1:$LENGTH(LIST,","),0
IF PC
IF $LENGTH($PIECE(LIST,",",PC))
IF (DATA[$PIECE(LIST,",",PC))
QUIT
+3 QUIT ''PC
+4 ;
CONTRANS(OCXC) ; Compiler Function: CONTRAST MEDIA CODE TRANSLATION
+1 ;
+2 NEW OCXX
+3 IF '$LENGTH($GET(OCXC))
QUIT ""
SET OCXX=$SELECT((OCXC["B"):"Barium",1:"")
+4 IF (OCXC["G")
IF $LENGTH(OCXX)
SET OCXX=OCXX_" and/or "
SET OCXX=OCXX_"Gastrografin"
+5 IF (OCXC["I")
IF $LENGTH(OCXX)
SET OCXX=OCXX_" and/or "
SET OCXX=OCXX_"Ionic Iodinated"
+6 IF (OCXC["N")
IF $LENGTH(OCXX)
SET OCXX=OCXX_" and/or "
SET OCXX=OCXX_"Non-ionic Iodinated"
+7 IF (OCXC["L")
IF $LENGTH(OCXX)
SET OCXX=OCXX_" and/or "
SET OCXX=OCXX_"Gadolinium"
+8 IF (OCXC["C")
IF $LENGTH(OCXX)
SET OCXX=OCXX_" and/or "
SET OCXX=OCXX_"Cholecystographic"
+9 IF (OCXC["M")
IF $LENGTH(OCXX)
SET OCXX=OCXX_" and/or "
SET OCXX=OCXX_"Unspecified contrast media"
+10 QUIT OCXX
+11 ;
EQTERM(DATA,TERM) ; Compiler Function: EQUALS TERM OPERATOR
+1 ;
+2 NEW OCXF,OCXL
+3 ;
+4 SET OCXL=""
SET OCXF=$$TERMLKUP(TERM,.OCXL)
+5 IF 'OCXF
QUIT 0
+6 IF ($DATA(OCXL(DATA))!$DATA(OCXL("B",DATA)))
QUIT 1
+7 QUIT 0
+8 ;
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 ;
MTSTF(OILIST) ; Compiler Function: MISSING TESTS DURING SESSION
+1 ;
+2 NEW OCXPC,OCXOI,OCXOUT
SET OCXOUT=""
+3 FOR OCXPC=1:1:$LENGTH(OILIST,",")
SET OCXOI=$PIECE(OILIST,",",OCXPC)
IF $LENGTH(OCXOI)
Begin DoDot:1
+4 NEW OCXL,OCXF,OCXD0
+5 SET OCXL=""
SET OCXF=$$TERMLKUP(OCXOI,.OCXL)
+6 SET OCXD0=0
FOR
SET OCXD0=$ORDER(OCXL(OCXD0))
IF 'OCXD0
QUIT
IF $$OISESS^ORKCHK2(+OCXD0)
QUIT
+7 IF OCXD0
QUIT
+8 IF $LENGTH(OCXOUT)
SET OCXOUT=OCXOUT_", "
SET OCXOUT=OCXOUT_OCXOI
End DoDot:1
+9 QUIT OCXOUT
+10 ;
RECBAR(DFN,HOURS) ; Compiler Function: RECENT BARIUM STUDY
+1 ;
+2 IF '$GET(DFN)
QUIT 0
IF '$GET(HOURS)
QUIT 0
NEW OUT
SET OUT=$$RECENTBA^ORKRA(DFN,HOURS)
IF '$LENGTH(OUT)
QUIT 0
QUIT 1_U_OUT
+3 ;
+4 ;
RECBARST(DFN,HOURS) ; Compiler Function: RECENT BARIUM ORDER STATUS
+1 ;
+2 IF '$GET(DFN)
QUIT 0
IF '$GET(HOURS)
QUIT 0
+3 NEW ORDER
SET ORDER=$PIECE($$RECENTBA^ORKRA(DFN,HOURS),U)
IF '$LENGTH(ORDER)
QUIT 0
+4 NEW STATUS
SET STATUS=$PIECE($$STATUS^ORQOR2(ORDER),U,2)
IF '$LENGTH(STATUS)
QUIT 0
+5 QUIT 1_U_STATUS
+6 ;
TERMLKUP(OCXTERM,OCXLIST) ;
+1 QUIT $$TERM^OCXOZ01(OCXTERM,.OCXLIST)
+2 ;