OCXOZ04 ;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
;
CHK25 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK23+15^OCXOZ03.
;
Q:$G(OCXOERR)
;
; Local CHK25 Variables
; OCXDF(25) ---> Data Field: PATIENT MOVEMENT TYPE CURRENT (FREE TEXT)
; OCXDF(26) ---> Data Field: PATIENT MOVEMENT DATE CURRENT (DATE/TIME)
; OCXDF(97) ---> Data Field: NEW PATIENT MOVEMENT (BOOLEAN)
;
; Local Extrinsic Functions
; DT2INT( ----------> CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
; FILE(DFN,56, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: PATIENT DISCHARGE)
;
I (OCXDF(25)="ADMISSION") S OCXDF(97)=('(+$G(DGPMA)=+$G(DGPM0))&'$L(DGPMP)) I $L(OCXDF(97)),(OCXDF(97)) S OCXDF(26)=$$DT2INT($P($G(DGPMA),"^",1)) D CHK30
I (OCXDF(25)="DISCHARGE") S OCXDF(26)=$$DT2INT($P($G(DGPMA),"^",1)),OCXOERR=$$FILE(DFN,56,"26") Q:OCXOERR
Q
;
CHK30 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK25+14.
;
Q:$G(OCXOERR)
;
; Local CHK30 Variables
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(83) ---> Data Field: PATIENT WARD ROOM-BED (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,21, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: PATIENT ADMISSION)
; WARDRMBD( --------> WARD ROOM-BED
;
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXDF(83)=$P($$WARDRMBD(OCXDF(37)),"^",2),OCXOERR=$$FILE(DFN,21,"26,83") Q:OCXOERR
Q
;
CHK34 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK1+30^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK34 Variables
; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(6) ----> Data Field: ABNORMAL FLAG (FREE TEXT)
; OCXDF(23) ---> Data Field: REQUEST STATUS (OBR) (FREE TEXT)
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
;
; Local Extrinsic Functions
; LIST( ------------> IN LIST OPERATOR
;
I $$LIST(OCXDF(6),"H,L") D CHK35
I $$LIST(OCXDF(6),"HH,LL"),$L(OCXDF(23)),$$LIST(OCXDF(23),"F,C"),$L(OCXDF(1)),$$LIST(OCXDF(1),"RE"),$L(OCXDF(2)),($E(OCXDF(2),1,2)="LR"),$L(OCXDF(34)) D CHK323^OCXOZ0B
Q
;
CHK35 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK34+15.
;
Q:$G(OCXOERR)
;
; Local CHK35 Variables
; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
; OCXDF(15) ---> Data Field: RESULT STATUS (OBX) (FREE TEXT)
; OCXDF(23) ---> Data Field: REQUEST STATUS (OBR) (FREE TEXT)
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
;
; Local Extrinsic Functions
; LIST( ------------> IN LIST OPERATOR
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
I $L(OCXDF(23)),$$LIST(OCXDF(23),"F,C"),$L(OCXDF(1)),$$LIST(OCXDF(1),"RE"),$L(OCXDF(2)),($E(OCXDF(2),1,2)="LR"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)) D CHK43
I $L(OCXDF(15)),$$LIST(OCXDF(15),"F,C"),$L(OCXDF(1)),$$LIST(OCXDF(1),"RE"),$L(OCXDF(2)),($E(OCXDF(2),1,2)="LR"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)) D CHK313^OCXOZ0B
Q
;
CHK43 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK35+17.
;
Q:$G(OCXOERR)
;
; Local CHK43 Variables
; OCXDF(113) --> Data Field: LAB TEST ID (NUMERIC)
; OCXDF(114) --> Data Field: LAB TEST PRINT NAME (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,23, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 LAB ORDER RESULTS ABNORMAL)
;
I $L(OCXDF(113)) S OCXDF(114)=$$PRINTNAM^ORQQLR1(OCXDF(113)),OCXOERR=$$FILE(DFN,23,"12,13,96,114") Q:OCXOERR
Q
;
DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
; By taking the Years, Months, Days, Hours and Minutes converting
; Them into Seconds and then adding them all together into one big integer
;
Q:'$L($G(OCXDT)) ""
N OCXDIFF,OCXVAL S (OCXDIFF,OCXVAL)=0
;
I $L(OCXDT),'OCXDT,(OCXDT[" at ") D ; EXTERNAL EXPERT SYSTEM FORMAT 1 TO EXTERNAL FORMAT
.N OCXHR,OCXMIN,OCXTIME
.S OCXTIME=$P($P(OCXDT," at ",2),".",1),OCXHR=$P(OCXTIME,":",1),OCXMIN=$P(OCXTIME,":",2)
.S:(OCXDT["Midnight") OCXHR=00
.S:(OCXDT["PM") OCXHR=OCXHR+12
.S OCXDT=$P(OCXDT," at ")_"@"_$E(OCXHR+100,2,3)_$E(OCXMIN+100,2,3)
;
I $L(OCXDT),(OCXDT?1.2N1"/"1.2N.1" ".2N.1":".2N) D ; EXTERNAL EXPERT SYSTEM FORMAT 2 TO EXTERNAL FORMAT
.N OCXMON
.S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,$P(OCXDT,"/",1))
.I $L($P(OCXDT," ",2)) S OCXDT=OCXMON_" "_$P($P(OCXDT," ",1),"/",2)_"@"_$TR($P(OCXDT," ",2),":","")
.E S OCXDT=OCXMON_" "_$P($P(OCXDT," ",1),"/",2)
;
I $L(OCXDT),(OCXDT?1.2N1"/"1.2N1"/"1.2N.1" ".2N.1":".2N) D ; EXTERNAL EXPERT SYSTEM FORMAT 3 TO EXTERNAL FORMAT
.N OCXMON
.S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,$P(OCXDT,"/",1))
.I $L($P(OCXDT," ",2)) S OCXDT=OCXMON_" "_$P($P(OCXDT," ",1),"/",2)_","_$P($P(OCXDT," ",1),"/",3)_"@"_$TR($P(OCXDT," ",2),":","")
.E S OCXDT=OCXMON_" "_$P($P(OCXDT," ",1),"/",2)_", "_$P($P(OCXDT," ",1),"/",3)
;
I $L(OCXDT),'OCXDT D ; EXTERNAL FORMAT TO INTERNAL FILEMAN FORMAT
.I (OCXDT["@0000") S OCXDT=$P(OCXDT,"@",1),OCXDIFF=1
.N %DT,X,Y S X=OCXDT,%DT="" S:(OCXDT["@")!(OCXDT="N") %DT="T" D ^%DT S OCXDT=+Y
;
I ($L(OCXDT\1)>7) S OCXDT=$$HL7TFM^XLFDT(OCXDT) ; HL7 FORMAT TO INTERNAL FILEMAN FORMAT
;
I ($L(OCXDT\1)=7) S OCXDT=$$FMTH^XLFDT(+OCXDT) ; INTERNAL FILEMAN FORMAT TO $H FORMAT
;
I (OCXDT?5N1","1.5N) S OCXVAL=(OCXDT*86400)+$P(OCXDT,",",2) ; $H FORMAT TO EXPERT SYSTEM INTERNAL FORMAT
;
Q OCXVAL
;
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
;
LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
;
S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
Q (LIST[DATA)
;
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)
;
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[HOCXOZ04 7461 printed Dec 13, 2024@02:25:51 Page 2
OCXOZ04 ;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 ;
CHK25 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK23+15^OCXOZ03.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK25 Variables
+6 ; OCXDF(25) ---> Data Field: PATIENT MOVEMENT TYPE CURRENT (FREE TEXT)
+7 ; OCXDF(26) ---> Data Field: PATIENT MOVEMENT DATE CURRENT (DATE/TIME)
+8 ; OCXDF(97) ---> Data Field: NEW PATIENT MOVEMENT (BOOLEAN)
+9 ;
+10 ; Local Extrinsic Functions
+11 ; DT2INT( ----------> CONVERT DATE FROM FILEMAN FORMAT TO OCX FORMAT
+12 ; FILE(DFN,56, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: PATIENT DISCHARGE)
+13 ;
+14 IF (OCXDF(25)="ADMISSION")
SET OCXDF(97)=('(+$GET(DGPMA)=+$GET(DGPM0))&'$LENGTH(DGPMP))
IF $LENGTH(OCXDF(97))
IF (OCXDF(97))
SET OCXDF(26)=$$DT2INT($PIECE($GET(DGPMA),"^",1))
DO CHK30
+15 IF (OCXDF(25)="DISCHARGE")
SET OCXDF(26)=$$DT2INT($PIECE($GET(DGPMA),"^",1))
SET OCXOERR=$$FILE(DFN,56,"26")
if OCXOERR
QUIT
+16 QUIT
+17 ;
CHK30 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK25+14.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK30 Variables
+6 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+7 ; OCXDF(83) ---> Data Field: PATIENT WARD ROOM-BED (FREE TEXT)
+8 ;
+9 ; Local Extrinsic Functions
+10 ; FILE(DFN,21, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: PATIENT ADMISSION)
+11 ; WARDRMBD( --------> WARD ROOM-BED
+12 ;
+13 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXDF(83)=$PIECE($$WARDRMBD(OCXDF(37)),"^",2)
SET OCXOERR=$$FILE(DFN,21,"26,83")
if OCXOERR
QUIT
+14 QUIT
+15 ;
CHK34 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK1+30^OCXOZ02.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK34 Variables
+6 ; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
+7 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+8 ; OCXDF(6) ----> Data Field: ABNORMAL FLAG (FREE TEXT)
+9 ; OCXDF(23) ---> Data Field: REQUEST STATUS (OBR) (FREE TEXT)
+10 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+11 ;
+12 ; Local Extrinsic Functions
+13 ; LIST( ------------> IN LIST OPERATOR
+14 ;
+15 IF $$LIST(OCXDF(6),"H,L")
DO CHK35
+16 IF $$LIST(OCXDF(6),"HH,LL")
IF $LENGTH(OCXDF(23))
IF $$LIST(OCXDF(23),"F,C")
IF $LENGTH(OCXDF(1))
IF $$LIST(OCXDF(1),"RE")
IF $LENGTH(OCXDF(2))
IF ($EXTRACT(OCXDF(2),1,2)="LR")
IF $LENGTH(OCXDF(34))
DO CHK323^OCXOZ0B
+17 QUIT
+18 ;
CHK35 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK34+15.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK35 Variables
+6 ; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
+7 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+8 ; OCXDF(15) ---> Data Field: RESULT STATUS (OBX) (FREE TEXT)
+9 ; OCXDF(23) ---> Data Field: REQUEST STATUS (OBR) (FREE TEXT)
+10 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+11 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+12 ;
+13 ; Local Extrinsic Functions
+14 ; LIST( ------------> IN LIST OPERATOR
+15 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+16 ;
+17 IF $LENGTH(OCXDF(23))
IF $$LIST(OCXDF(23),"F,C")
IF $LENGTH(OCXDF(1))
IF $$LIST(OCXDF(1),"RE")
IF $LENGTH(OCXDF(2))
IF ($EXTRACT(OCXDF(2),1,2)="LR")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
DO CHK43
+18 IF $LENGTH(OCXDF(15))
IF $$LIST(OCXDF(15),"F,C")
IF $LENGTH(OCXDF(1))
IF $$LIST(OCXDF(1),"RE")
IF $LENGTH(OCXDF(2))
IF ($EXTRACT(OCXDF(2),1,2)="LR")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
DO CHK313^OCXOZ0B
+19 QUIT
+20 ;
CHK43 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK35+17.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK43 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,23, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 LAB ORDER RESULTS ABNORMAL)
+11 ;
+12 IF $LENGTH(OCXDF(113))
SET OCXDF(114)=$$PRINTNAM^ORQQLR1(OCXDF(113))
SET OCXOERR=$$FILE(DFN,23,"12,13,96,114")
if OCXOERR
QUIT
+13 QUIT
+14 ;
DT2INT(OCXDT) ; This Local Extrinsic Function converts a date into an integer
+1 ; By taking the Years, Months, Days, Hours and Minutes converting
+2 ; Them into Seconds and then adding them all together into one big integer
+3 ;
+4 if '$LENGTH($GET(OCXDT))
QUIT ""
+5 NEW OCXDIFF,OCXVAL
SET (OCXDIFF,OCXVAL)=0
+6 ;
+7 ; EXTERNAL EXPERT SYSTEM FORMAT 1 TO EXTERNAL FORMAT
IF $LENGTH(OCXDT)
IF 'OCXDT
IF (OCXDT[" at ")
Begin DoDot:1
+8 NEW OCXHR,OCXMIN,OCXTIME
+9 SET OCXTIME=$PIECE($PIECE(OCXDT," at ",2),".",1)
SET OCXHR=$PIECE(OCXTIME,":",1)
SET OCXMIN=$PIECE(OCXTIME,":",2)
+10 if (OCXDT["Midnight")
SET OCXHR=00
+11 if (OCXDT["PM")
SET OCXHR=OCXHR+12
+12 SET OCXDT=$PIECE(OCXDT," at ")_"@"_$EXTRACT(OCXHR+100,2,3)_$EXTRACT(OCXMIN+100,2,3)
End DoDot:1
+13 ;
+14 ; EXTERNAL EXPERT SYSTEM FORMAT 2 TO EXTERNAL FORMAT
IF $LENGTH(OCXDT)
IF (OCXDT?1.2N1"/"1.2N.1" ".2N.1":".2N)
Begin DoDot:1
+15 NEW OCXMON
+16 SET OCXMON=$PIECE("January^February^March^April^May^June^July^August^September^October^November^December",U,$PIECE(OCXDT,"/",1))
+17 IF $LENGTH($PIECE(OCXDT," ",2))
SET OCXDT=OCXMON_" "_$PIECE($PIECE(OCXDT," ",1),"/",2)_"@"_$TRANSLATE($PIECE(OCXDT," ",2),":","")
+18 IF '$TEST
SET OCXDT=OCXMON_" "_$PIECE($PIECE(OCXDT," ",1),"/",2)
End DoDot:1
+19 ;
+20 ; EXTERNAL EXPERT SYSTEM FORMAT 3 TO EXTERNAL FORMAT
IF $LENGTH(OCXDT)
IF (OCXDT?1.2N1"/"1.2N1"/"1.2N.1" ".2N.1":".2N)
Begin DoDot:1
+21 NEW OCXMON
+22 SET OCXMON=$PIECE("January^February^March^April^May^June^July^August^September^October^November^December",U,$PIECE(OCXDT,"/",1))
+23 IF $LENGTH($PIECE(OCXDT," ",2))
SET OCXDT=OCXMON_" "_$PIECE($PIECE(OCXDT," ",1),"/",2)_","_$PIECE($PIECE(OCXDT," ",1),"/",3)_"@"_$TRANSLATE($PIECE(OCXDT," ",2),":","")
+24 IF '$TEST
SET OCXDT=OCXMON_" "_$PIECE($PIECE(OCXDT," ",1),"/",2)_", "_$PIECE($PIECE(OCXDT," ",1),"/",3)
End DoDot:1
+25 ;
+26 ; EXTERNAL FORMAT TO INTERNAL FILEMAN FORMAT
IF $LENGTH(OCXDT)
IF 'OCXDT
Begin DoDot:1
+27 IF (OCXDT["@0000")
SET OCXDT=$PIECE(OCXDT,"@",1)
SET OCXDIFF=1
+28 NEW %DT,X,Y
SET X=OCXDT
SET %DT=""
if (OCXDT["@")!(OCXDT="N")
SET %DT="T"
DO ^%DT
SET OCXDT=+Y
End DoDot:1
+29 ;
+30 ; HL7 FORMAT TO INTERNAL FILEMAN FORMAT
IF ($LENGTH(OCXDT\1)>7)
SET OCXDT=$$HL7TFM^XLFDT(OCXDT)
+31 ;
+32 ; INTERNAL FILEMAN FORMAT TO $H FORMAT
IF ($LENGTH(OCXDT\1)=7)
SET OCXDT=$$FMTH^XLFDT(+OCXDT)
+33 ;
+34 ; $H FORMAT TO EXPERT SYSTEM INTERNAL FORMAT
IF (OCXDT?5N1","1.5N)
SET OCXVAL=(OCXDT*86400)+$PIECE(OCXDT,",",2)
+35 ;
+36 QUIT OCXVAL
+37 ;
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 ;
LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
+1 ;
+2 if '($EXTRACT(LIST,1)=",")
SET LIST=","_LIST
if '($EXTRACT(LIST,$LENGTH(LIST))=",")
SET LIST=LIST_","
SET DATA=","_DATA_","
+3 QUIT (LIST[DATA)
+4 ;
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 ;
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 ;