OCXOZ09 ;SLC/RJS,CLA - Order Check Scan ;OCT 30,2024 at 12:49
;;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
;
CHK187 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK58+19^OCXOZ05.
;
Q:$G(OCXOERR)
;
; Local CHK187 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 CHK191
I $$CLIST($$UP^XLFSTR(OCXDF(47)),$$UP^XLFSTR("GLUCOPHAGE,METFORMIN")) S OCXDF(40)=$G(OCXPSM) I $L(OCXDF(40)),(OCXDF(40)="SELECT") S OCXDF(2)=$P($G(OCXPSD),"|",2) D CHK278^OCXOZ0B
Q
;
CHK191 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK187+14.
;
Q:$G(OCXOERR)
;
; Local CHK191 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
;
CHK195 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK162+19^OCXOZ07.
;
Q:$G(OCXOERR)
;
; Local CHK195 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 CHK197
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 CHK428^OCXOZ0E
Q
;
CHK197 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK195+14.
;
Q:$G(OCXOERR)
;
; Local CHK197 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
;
I (OCXDF(2)="RA") D CHK198
I ($E(OCXDF(2),1,2)="PS") D CHK343^OCXOZ0C
Q
;
CHK198 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK197+8.
;
Q:$G(OCXOERR)
;
; Local CHK198 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 CHK200
S OCXDF(73)=$P($G(OCXPSD),"|",1) I $L(OCXDF(73)) D CHK235^OCXOZ0A
Q
;
CHK200 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK198+9.
;
Q:$G(OCXOERR)
;
; Local CHK200 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)=$$ORCHK2^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 CHK206
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 CHK216
Q
;
CHK206 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK200+15.
;
Q:$G(OCXOERR)
;
; Local CHK206 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(159) --> 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(159)=$P($$ORCHK2^GMRAOR(OCXDF(37),"CM","",1),"^",2) D CHK210
Q
;
CHK210 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK206+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,159") Q:OCXOERR
Q
;
CHK216 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK200+16.
;
Q:$G(OCXOERR)
;
; Local CHK216 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)
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXOZ09 8673 printed Dec 13, 2024@02:25:55 Page 2
OCXOZ09 ;SLC/RJS,CLA - Order Check Scan ;OCT 30,2024 at 12:49
+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 ;
CHK187 ; 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 CHK187 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 CHK191
+15 IF $$CLIST($$UP^XLFSTR(OCXDF(47)),$$UP^XLFSTR("GLUCOPHAGE,METFORMIN"))
SET OCXDF(40)=$GET(OCXPSM)
IF $LENGTH(OCXDF(40))
IF (OCXDF(40)="SELECT")
SET OCXDF(2)=$PIECE($GET(OCXPSD),"|",2)
DO CHK278^OCXOZ0B
+16 QUIT
+17 ;
CHK191 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK187+14.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK191 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 ;
CHK195 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK162+19^OCXOZ07.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK195 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 CHK197
+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 CHK428^OCXOZ0E
+16 QUIT
+17 ;
CHK197 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK195+14.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK197 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ;
+8 IF (OCXDF(2)="RA")
DO CHK198
+9 IF ($EXTRACT(OCXDF(2),1,2)="PS")
DO CHK343^OCXOZ0C
+10 QUIT
+11 ;
CHK198 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK197+8.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK198 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 CHK200
+10 SET OCXDF(73)=$PIECE($GET(OCXPSD),"|",1)
IF $LENGTH(OCXDF(73))
DO CHK235^OCXOZ0A
+11 QUIT
+12 ;
CHK200 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK198+9.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK200 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)=$$ORCHK2^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 CHK206
+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 CHK216
+17 QUIT
+18 ;
CHK206 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK200+15.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK206 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(159) --> 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(159)=$PIECE($$ORCHK2^GMRAOR(OCXDF(37),"CM","",1),"^",2)
DO CHK210
+16 QUIT
+17 ;
CHK210 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK206+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,159")
if OCXOERR
QUIT
+9 QUIT
+10 ;
CHK216 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK200+16.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK216 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 ;