OCXOZ0B ;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
;
CHK252 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK156+18^OCXOZ07.
;
Q:$G(OCXOERR)
;
; Local CHK252 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
;
CHK263 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK150+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
;
CHK269 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK12+35^OCXOZ03.
;
Q:$G(OCXOERR)
;
; Local CHK269 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
;
CHK278 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK187+15^OCXOZ09.
;
Q:$G(OCXOERR)
;
; Local CHK278 Variables
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(162) --> Data Field: RECENT METFORMIN EGFR DAYS (NUMERIC)
;
; Local Extrinsic Functions
;
I $L(OCXDF(2)),($E(OCXDF(2),1,2)="PS") S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(162)=$P($$GEDAYS^ORKPS(OCXDF(37)),"^",1) D CHK283
Q
;
CHK283 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK278+12.
;
Q:$G(OCXOERR)
;
; Local CHK283 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(165) --> Data Field: RECENT METFORMIN EGFR TEXT (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,86, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: METFORMIN ORDER)
;
S OCXDF(165)=$P($$GLEGFR^ORKPS(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,86,"162,165") Q:OCXOERR
Q
;
CHK292 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK113+20^OCXOZ06.
;
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
;
CHK301 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK6+19^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK301 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
;
CHK313 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK35+18^OCXOZ04.
;
Q:$G(OCXOERR)
;
; Local CHK313 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
;
CHK323 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK34+16^OCXOZ04.
;
Q:$G(OCXOERR)
;
; Local CHK323 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
;
CHK335 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK6+20^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK335 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
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXOZ0B 8437 printed Dec 13, 2024@02:25:57 Page 2
OCXOZ0B ;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 ;
CHK252 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK156+18^OCXOZ07.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK252 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 ;
CHK263 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK150+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 ;
CHK269 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK12+35^OCXOZ03.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK269 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 ;
CHK278 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK187+15^OCXOZ09.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK278 Variables
+6 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+7 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+8 ; OCXDF(162) --> Data Field: RECENT METFORMIN EGFR DAYS (NUMERIC)
+9 ;
+10 ; Local Extrinsic Functions
+11 ;
+12 IF $LENGTH(OCXDF(2))
IF ($EXTRACT(OCXDF(2),1,2)="PS")
SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXDF(162)=$PIECE($$GEDAYS^ORKPS(OCXDF(37)),"^",1)
DO CHK283
+13 QUIT
+14 ;
CHK283 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK278+12.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK283 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(165) --> Data Field: RECENT METFORMIN EGFR TEXT (FREE TEXT)
+8 ;
+9 ; Local Extrinsic Functions
+10 ; FILE(DFN,86, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: METFORMIN ORDER)
+11 ;
+12 SET OCXDF(165)=$PIECE($$GLEGFR^ORKPS(OCXDF(37)),"^",2)
SET OCXOERR=$$FILE(DFN,86,"162,165")
if OCXOERR
QUIT
+13 QUIT
+14 ;
CHK292 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK113+20^OCXOZ06.
+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 ;
CHK301 ; 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 CHK301 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 ;
CHK313 ; 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 CHK313 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 ;
CHK323 ; 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 CHK323 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 ;
CHK335 ; 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 CHK335 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 ;