OCXOZ0B ;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
;
CHK253 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK157+18^OCXOZ07.
;
Q:$G(OCXOERR)
;
; Local CHK253 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,110, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: STAT CONSULT RESULT)
; FILE(DFN,75, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: STAT IMAGING RESULT)
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
I (OCXDF(2)="RA"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,75,"24,96") Q:OCXOERR
I (OCXDF(2)="GMRC"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,110,"24,96") Q:OCXOERR
Q
;
CHK264 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK151+18^OCXOZ07.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; FILE(DFN,76, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: STAT LAB RESULT)
;
S OCXOERR=$$FILE(DFN,76,"24,96") Q:OCXOERR
Q
;
CHK270 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK12+34^OCXOZ03.
;
Q:$G(OCXOERR)
;
; Local CHK270 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(84) ---> Data Field: INPATIENT (BOOLEAN)
; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,84, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: INPATIENT FOOD-DRUG REACTION)
; PATLOC( ----------> PATIENT LOCATION
; WARDRMBD( --------> WARD ROOM-BED
;
S OCXDF(84)=$P($$WARDRMBD(OCXDF(37)),"^",1) I $L(OCXDF(84)),(OCXDF(84)) S OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,84,"82,147") Q:OCXOERR
Q
;
CHK280 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK188+15^OCXOZ09.
;
Q:$G(OCXOERR)
;
; Local CHK280 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(125) --> Data Field: RECENT GLUCOPHAGE CREATININE TEXT (FREE TEXT)
; OCXDF(127) --> Data Field: RECENT GLUCOPHAGE CREATININE DAYS (NUMERIC)
;
; Local Extrinsic Functions
;
I ($E(OCXDF(2),1,2)="PS") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(125)=$P($$GLCREAT^ORKPS(OCXDF(37)),"^",2),OCXDF(127)=$P($$GCDAYS^ORKPS(OCXDF(37)),"^",1) D CHK285
Q
;
CHK285 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK280+13.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; FILE(DFN,86, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: GLUCOPHAGE ORDER)
;
S OCXOERR=$$FILE(DFN,86,"125,127") Q:OCXOERR
Q
;
CHK293 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK113+20^OCXOZ07.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; FILE(DFN,100, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CANCELED BY NON-ORIG ORDERING PROVIDER)
;
S OCXOERR=$$FILE(DFN,100,"105") Q:OCXOERR
Q
;
CHK302 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK6+19^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK302 Variables
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(55) ---> Data Field: SITE FLAGGED RESULT (BOOLEAN)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,102, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL IMAGING RESULT)
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
; PATLOC( ----------> PATIENT LOCATION
;
I $L(OCXDF(55)),(OCXDF(55)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,102,"9,96,147") Q:OCXOERR
Q
;
CHK314 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK35+18^OCXOZ04.
;
Q:$G(OCXOERR)
;
; Local CHK314 Variables
; OCXDF(113) --> Data Field: LAB TEST ID (NUMERIC)
; OCXDF(114) --> Data Field: LAB TEST PRINT NAME (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,103, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 LAB TEST RESULTS ABNORMAL)
;
I $L(OCXDF(113)) S OCXDF(114)=$$PRINTNAM^ORQQLR1(OCXDF(113)),OCXOERR=$$FILE(DFN,103,"12,13,96,114") Q:OCXOERR
Q
;
CHK324 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK34+16^OCXOZ04.
;
Q:$G(OCXOERR)
;
; Local CHK324 Variables
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
; OCXDF(113) --> Data Field: LAB TEST ID (NUMERIC)
; OCXDF(114) --> Data Field: LAB TEST PRINT NAME (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,105, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 LAB ORDER RESULTS CRITICAL)
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
S OCXDF(96)=$$ORDITEM(OCXDF(34)) I $L(OCXDF(113)) S OCXDF(114)=$$PRINTNAM^ORQQLR1(OCXDF(113)),OCXOERR=$$FILE(DFN,105,"12,13,96,114") Q:OCXOERR
Q
;
CHK336 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK6+20^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK336 Variables
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(55) ---> Data Field: SITE FLAGGED RESULT (BOOLEAN)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,109, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL CONSULT RESULT)
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
; PATLOC( ----------> PATIENT LOCATION
;
I $L(OCXDF(55)),(OCXDF(55)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,109,"9,96,147") Q:OCXOERR
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
;
ORDITEM(OIEN) ; Compiler Function: GET ORDERABLE ITEM FROM ORDER NUMBER
Q:'$G(OIEN) ""
;
N OITXT,X S OITXT=$$OI^ORQOR2(OIEN) Q:'OITXT "No orderable item found."
S X=$G(^ORD(101.43,+OITXT,0)) Q:'$L(X) "No orderable item found."
Q $P(X,U,1)
;
PATLOC(DFN) ; Compiler Function: PATIENT LOCATION
;
N OCXP1,OCXP2
S OCXP1=$G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",2))
S OCXP2=$P($G(^TMP("OCXSWAP",$J,"OCXODATA","PV1",3)),"^",1)
I OCXP2 D
.S OCXP2=$P($G(^SC(+OCXP2,0)),"^",1,2)
.I $L($P(OCXP2,"^",2)) S OCXP2=$P(OCXP2,"^",2)
.E S OCXP2=$P(OCXP2,"^",1)
.S:'$L(OCXP2) OCXP2="NO LOC"
I $L(OCXP1),$L(OCXP2) Q OCXP1_"^"_OCXP2
;
S OCXP2=$G(^DPT(+$G(DFN),.1))
I $L(OCXP2) Q "I^"_OCXP2
Q "O^OUTPT"
;
WARDRMBD(DFN) ; Compiler Function: WARD ROOM-BED
;
Q:'$G(DFN) 0
N OUT S OUT=$G(^DPT(DFN,.1)) Q:'$L(OUT) 0
S OUT=1_"^"_OUT_" "_$G(^DPT(DFN,.101)) Q OUT
;
OCXOZ0B ;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 ;
CHK253 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK157+18^OCXOZ07.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK253 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+8 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; FILE(DFN,110, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: STAT CONSULT RESULT)
+12 ; FILE(DFN,75, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: STAT IMAGING RESULT)
+13 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+14 ;
+15 IF (OCXDF(2)="RA")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,75,"24,96")
IF OCXOERR
QUIT
+16 IF (OCXDF(2)="GMRC")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,110,"24,96")
IF OCXOERR
QUIT
+17 QUIT
+18 ;
CHK264 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK151+18^OCXOZ07.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; FILE(DFN,76, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: STAT LAB RESULT)
+7 ;
+8 SET OCXOERR=$$FILE(DFN,76,"24,96")
IF OCXOERR
QUIT
+9 QUIT
+10 ;
CHK270 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK12+34^OCXOZ03.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK270 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(84) ---> Data Field: INPATIENT (BOOLEAN)
+8 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; FILE(DFN,84, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: INPATIENT FOOD-DRUG REACTION)
+12 ; PATLOC( ----------> PATIENT LOCATION
+13 ; WARDRMBD( --------> WARD ROOM-BED
+14 ;
+15 SET OCXDF(84)=$PIECE($$WARDRMBD(OCXDF(37)),"^",1)
IF $LENGTH(OCXDF(84))
IF (OCXDF(84))
SET OCXDF(147)=$PIECE($$PATLOC(OCXDF(37)),"^",2)
SET OCXOERR=$$FILE(DFN,84,"82,147")
IF OCXOERR
QUIT
+16 QUIT
+17 ;
CHK280 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK188+15^OCXOZ09.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK280 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+8 ; OCXDF(125) --> Data Field: RECENT GLUCOPHAGE CREATININE TEXT (FREE TEXT)
+9 ; OCXDF(127) --> Data Field: RECENT GLUCOPHAGE CREATININE DAYS (NUMERIC)
+10 ;
+11 ; Local Extrinsic Functions
+12 ;
+13 IF ($EXTRACT(OCXDF(2),1,2)="PS")
SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXDF(125)=$PIECE($$GLCREAT^ORKPS(OCXDF(37)),"^",2)
SET OCXDF(127)=$PIECE($$GCDAYS^ORKPS(OCXDF(37)),"^",1)
DO CHK285
+14 QUIT
+15 ;
CHK285 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK280+13.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; FILE(DFN,86, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: GLUCOPHAGE ORDER)
+7 ;
+8 SET OCXOERR=$$FILE(DFN,86,"125,127")
IF OCXOERR
QUIT
+9 QUIT
+10 ;
CHK293 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK113+20^OCXOZ07.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; FILE(DFN,100, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CANCELED BY NON-ORIG ORDERING PROVIDER)
+7 ;
+8 SET OCXOERR=$$FILE(DFN,100,"105")
IF OCXOERR
QUIT
+9 QUIT
+10 ;
CHK302 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK6+19^OCXOZ02.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK302 Variables
+6 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+7 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+8 ; OCXDF(55) ---> Data Field: SITE FLAGGED RESULT (BOOLEAN)
+9 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+10 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
+11 ;
+12 ; Local Extrinsic Functions
+13 ; FILE(DFN,102, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL IMAGING RESULT)
+14 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+15 ; PATLOC( ----------> PATIENT LOCATION
+16 ;
+17 IF $LENGTH(OCXDF(55))
IF (OCXDF(55))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXDF(147)=$PIECE($$PATLOC(OCXDF(37)),"^",2)
SET OCXOERR=$$FILE(DFN,102,"9,96,147")
IF OCXOERR
QUIT
+18 QUIT
+19 ;
CHK314 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK35+18^OCXOZ04.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK314 Variables
+6 ; OCXDF(113) --> Data Field: LAB TEST ID (NUMERIC)
+7 ; OCXDF(114) --> Data Field: LAB TEST PRINT NAME (FREE TEXT)
+8 ;
+9 ; Local Extrinsic Functions
+10 ; FILE(DFN,103, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 LAB TEST RESULTS ABNORMAL)
+11 ;
+12 IF $LENGTH(OCXDF(113))
SET OCXDF(114)=$$PRINTNAM^ORQQLR1(OCXDF(113))
SET OCXOERR=$$FILE(DFN,103,"12,13,96,114")
IF OCXOERR
QUIT
+13 QUIT
+14 ;
CHK324 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK34+16^OCXOZ04.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK324 Variables
+6 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+7 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+8 ; OCXDF(113) --> Data Field: LAB TEST ID (NUMERIC)
+9 ; OCXDF(114) --> Data Field: LAB TEST PRINT NAME (FREE TEXT)
+10 ;
+11 ; Local Extrinsic Functions
+12 ; FILE(DFN,105, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 LAB ORDER RESULTS CRITICAL)
+13 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+14 ;
+15 SET OCXDF(96)=$$ORDITEM(OCXDF(34))
IF $LENGTH(OCXDF(113))
SET OCXDF(114)=$$PRINTNAM^ORQQLR1(OCXDF(113))
SET OCXOERR=$$FILE(DFN,105,"12,13,96,114")
IF OCXOERR
QUIT
+16 QUIT
+17 ;
CHK336 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK6+20^OCXOZ02.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK336 Variables
+6 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+7 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+8 ; OCXDF(55) ---> Data Field: SITE FLAGGED RESULT (BOOLEAN)
+9 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+10 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
+11 ;
+12 ; Local Extrinsic Functions
+13 ; FILE(DFN,109, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL CONSULT RESULT)
+14 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+15 ; PATLOC( ----------> PATIENT LOCATION
+16 ;
+17 IF $LENGTH(OCXDF(55))
IF (OCXDF(55))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXDF(147)=$PIECE($$PATLOC(OCXDF(37)),"^",2)
SET OCXOERR=$$FILE(DFN,109,"9,96,147")
IF OCXOERR
QUIT
+18 QUIT
+19 ;
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 ;
ORDITEM(OIEN) ; Compiler Function: GET ORDERABLE ITEM FROM ORDER NUMBER
+1 IF '$GET(OIEN)
QUIT ""
+2 ;
+3 NEW OITXT,X
SET OITXT=$$OI^ORQOR2(OIEN)
IF 'OITXT
QUIT "No orderable item found."
+4 SET X=$GET(^ORD(101.43,+OITXT,0))
IF '$LENGTH(X)
QUIT "No orderable item found."
+5 QUIT $PIECE(X,U,1)
+6 ;
PATLOC(DFN) ; Compiler Function: PATIENT LOCATION
+1 ;
+2 NEW OCXP1,OCXP2
+3 SET OCXP1=$GET(^TMP("OCXSWAP",$JOB,"OCXODATA","PV1",2))
+4 SET OCXP2=$PIECE($GET(^TMP("OCXSWAP",$JOB,"OCXODATA","PV1",3)),"^",1)
+5 IF OCXP2
Begin DoDot:1
+6 SET OCXP2=$PIECE($GET(^SC(+OCXP2,0)),"^",1,2)
+7 IF $LENGTH($PIECE(OCXP2,"^",2))
SET OCXP2=$PIECE(OCXP2,"^",2)
+8 IF '$TEST
SET OCXP2=$PIECE(OCXP2,"^",1)
+9 IF '$LENGTH(OCXP2)
SET OCXP2="NO LOC"
End DoDot:1
+10 IF $LENGTH(OCXP1)
IF $LENGTH(OCXP2)
QUIT OCXP1_"^"_OCXP2
+11 ;
+12 SET OCXP2=$GET(^DPT(+$GET(DFN),.1))
+13 IF $LENGTH(OCXP2)
QUIT "I^"_OCXP2
+14 QUIT "O^OUTPT"
+15 ;
WARDRMBD(DFN) ; Compiler Function: WARD ROOM-BED
+1 ;
+2 IF '$GET(DFN)
QUIT 0
+3 NEW OUT
SET OUT=$GET(^DPT(DFN,.1))
IF '$LENGTH(OUT)
QUIT 0
+4 SET OUT=1_"^"_OUT_" "_$GET(^DPT(DFN,.101))
QUIT OUT
+5 ;