OCXOZ07 ;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
;
CHK113 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK1+30^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK113 Variables
; OCXDF(32) ---> Data Field: ORDER FLAGGED FOR RESULTS (BOOLEAN)
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
; OCXDF(105) --> Data Field: ORDER TEXT (51 CHARS) (FREE TEXT)
; OCXDF(112) --> Data Field: ORDERED BY (FREE TEXT)
; OCXDF(149) --> Data Field: ORDER CANCELED BY (FREE TEXT)
;
; Local Extrinsic Functions
; CANCELER( --------> ORDER CANCELING PROVIDER
; FILE(DFN,49, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: ORDER FLAGGED FOR RESULTS)
; ORDERER( ---------> ORDERING PROVIDER
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
S OCXDF(32)=$$RSLTFLG^ORQOR2(OCXDF(34)) I $L(OCXDF(32)),(OCXDF(32)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,49,"96") Q:OCXOERR
S OCXDF(112)=$$ORDERER(OCXDF(34)),OCXDF(149)=$$CANCELER(OCXDF(34)) I '(OCXDF(112)=OCXDF(149)) S OCXDF(105)=$P($$TEXT^ORKOR(OCXDF(34),51),"^",2) D CHK293^OCXOZ0B
Q
;
CHK121 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK2+14^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK121 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,101, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 FINAL IMAGING RESULT)
; FILE(DFN,55, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CONSULT FINAL RESULTS)
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
I (OCXDF(2)="GMRC"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,55,"96") Q:OCXOERR
I (OCXDF(2)="RA"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,101,"96") Q:OCXOERR
Q
;
CHK131 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK12+33^OCXOZ03.
;
Q:$G(OCXOERR)
;
; Local CHK131 Variables
; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
; OCXDF(54) ---> Data Field: SITE FLAGGED ORDER (BOOLEAN)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
; OCXDF(146) --> Data Field: INPT/OUTPT (FREE TEXT)
; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
;
; Local Extrinsic Functions
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
; PATLOC( ----------> PATIENT LOCATION
;
S OCXDF(54)=$$SITEORD^ORB3F1(OCXDF(34),OCXDF(146)) I $L(OCXDF(54)),(OCXDF(54)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2) D CHK136
Q
;
CHK136 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK131+17.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; FILE(DFN,58, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW SITE FLAGGED ORDER)
;
S OCXOERR=$$FILE(DFN,58,"9,96,147") Q:OCXOERR
Q
;
CHK144 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK47+20^OCXOZ05.
;
Q:$G(OCXOERR)
;
; Local CHK144 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(146) --> Data Field: INPT/OUTPT (FREE TEXT)
; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
;
; Local Extrinsic Functions
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
; PATLOC( ----------> PATIENT LOCATION
;
S OCXDF(55)=$$SITERES^ORB3F1(OCXDF(34),OCXDF(146)) I $L(OCXDF(55)),(OCXDF(55)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXDF(147)=$P($$PATLOC(OCXDF(37)),"^",2) D CHK149
Q
;
CHK149 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK144+17.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; FILE(DFN,59, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL LAB RESULT)
;
S OCXOERR=$$FILE(DFN,59,"9,96,147") Q:OCXOERR
Q
;
CHK151 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK1+31^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK151 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(34) ---> Data Field: ORDER NUMBER (NUMERIC)
; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
;
; Local Extrinsic Functions
; FILE(DFN,60, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW OBR STAT ORDER)
; LIST( ------------> IN LIST OPERATOR
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
I $L(OCXDF(1)),$$LIST(OCXDF(1),"NW,SN"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,60,"96") Q:OCXOERR
I $L(OCXDF(15)),(OCXDF(15)="F"),$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 CHK264^OCXOZ0B
Q
;
CHK157 ; Look through the current environment for valid Event/Elements for this patient.
; Called from CHK1+32^OCXOZ02.
;
Q:$G(OCXOERR)
;
; Local CHK157 Variables
; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
; OCXDF(2) ----> Data Field: FILLER (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
; FILE(DFN,61, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW ORC STAT ORDER)
; LIST( ------------> IN LIST OPERATOR
; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
;
I $L(OCXDF(1)),$$LIST(OCXDF(1),"NW,SN"),$L(OCXDF(34)) S OCXDF(96)=$$ORDITEM(OCXDF(34)),OCXOERR=$$FILE(DFN,61,"96") Q:OCXOERR
I $L(OCXDF(23)),(OCXDF(23)="F"),$L(OCXDF(1)),$$LIST(OCXDF(1),"RE"),$L(OCXDF(2)) D CHK253^OCXOZ0B
Q
;
CANCELER(ORNUM) ; Compiler Function: ORDER CANCELING PROVIDER
;
Q:'$G(ORNUM) ""
S ORNUM=+$G(ORNUM)
N ORQDUZ
Q:'$D(^OR(100,ORNUM,6)) ""
S ORQDUZ=$P(^OR(100,ORNUM,6),U,2)
Q ORQDUZ
;
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)
;
ORDERER(ORNUM) ; Compiler Function: ORDERING PROVIDER
;
Q:'$G(ORNUM) ""
S ORNUM=+$G(ORNUM)
N ORQDUZ,ORQI S ORQDUZ=""
I $L($G(^OR(100,ORNUM,8,0))) D
.S ORQI=0,ORQI=$O(^OR(100,ORNUM,8,"C","NW",ORQI))
Q:+$G(ORQI)<1 ""
S ORQDUZ=$P(^OR(100,ORNUM,8,ORQI,0),U,3)
Q ORQDUZ
;
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"
;
OCXOZ07 ;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 ;
CHK113 ; 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 CHK113 Variables
+6 ; OCXDF(32) ---> Data Field: ORDER FLAGGED FOR RESULTS (BOOLEAN)
+7 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+8 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+9 ; OCXDF(105) --> Data Field: ORDER TEXT (51 CHARS) (FREE TEXT)
+10 ; OCXDF(112) --> Data Field: ORDERED BY (FREE TEXT)
+11 ; OCXDF(149) --> Data Field: ORDER CANCELED BY (FREE TEXT)
+12 ;
+13 ; Local Extrinsic Functions
+14 ; CANCELER( --------> ORDER CANCELING PROVIDER
+15 ; FILE(DFN,49, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: ORDER FLAGGED FOR RESULTS)
+16 ; ORDERER( ---------> ORDERING PROVIDER
+17 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+18 ;
+19 SET OCXDF(32)=$$RSLTFLG^ORQOR2(OCXDF(34))
IF $LENGTH(OCXDF(32))
IF (OCXDF(32))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,49,"96")
IF OCXOERR
QUIT
+20 SET OCXDF(112)=$$ORDERER(OCXDF(34))
SET OCXDF(149)=$$CANCELER(OCXDF(34))
IF '(OCXDF(112)=OCXDF(149))
SET OCXDF(105)=$PIECE($$TEXT^ORKOR(OCXDF(34),51),"^",2)
DO CHK293^OCXOZ0B
+21 QUIT
+22 ;
CHK121 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK2+14^OCXOZ02.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK121 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,101, ----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: HL7 FINAL IMAGING RESULT)
+12 ; FILE(DFN,55, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: CONSULT FINAL RESULTS)
+13 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+14 ;
+15 IF (OCXDF(2)="GMRC")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,55,"96")
IF OCXOERR
QUIT
+16 IF (OCXDF(2)="RA")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,101,"96")
IF OCXOERR
QUIT
+17 QUIT
+18 ;
CHK131 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK12+33^OCXOZ03.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK131 Variables
+6 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+7 ; OCXDF(37) ---> Data Field: PATIENT IEN (NUMERIC)
+8 ; OCXDF(54) ---> Data Field: SITE FLAGGED ORDER (BOOLEAN)
+9 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+10 ; OCXDF(146) --> Data Field: INPT/OUTPT (FREE TEXT)
+11 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
+12 ;
+13 ; Local Extrinsic Functions
+14 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+15 ; PATLOC( ----------> PATIENT LOCATION
+16 ;
+17 SET OCXDF(54)=$$SITEORD^ORB3F1(OCXDF(34),OCXDF(146))
IF $LENGTH(OCXDF(54))
IF (OCXDF(54))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXDF(147)=$PIECE($$PATLOC(OCXDF(37)),"^",2)
DO CHK136
+18 QUIT
+19 ;
CHK136 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK131+17.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; FILE(DFN,58, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW SITE FLAGGED ORDER)
+7 ;
+8 SET OCXOERR=$$FILE(DFN,58,"9,96,147")
IF OCXOERR
QUIT
+9 QUIT
+10 ;
CHK144 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK47+20^OCXOZ05.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK144 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(146) --> Data Field: INPT/OUTPT (FREE TEXT)
+11 ; OCXDF(147) --> Data Field: PATIENT LOCATION (FREE TEXT)
+12 ;
+13 ; Local Extrinsic Functions
+14 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+15 ; PATLOC( ----------> PATIENT LOCATION
+16 ;
+17 SET OCXDF(55)=$$SITERES^ORB3F1(OCXDF(34),OCXDF(146))
IF $LENGTH(OCXDF(55))
IF (OCXDF(55))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXDF(147)=$PIECE($$PATLOC(OCXDF(37)),"^",2)
DO CHK149
+18 QUIT
+19 ;
CHK149 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK144+17.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; FILE(DFN,59, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: SITE FLAGGED FINAL LAB RESULT)
+7 ;
+8 SET OCXOERR=$$FILE(DFN,59,"9,96,147")
IF OCXOERR
QUIT
+9 QUIT
+10 ;
CHK151 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK1+31^OCXOZ02.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK151 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(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+10 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+11 ;
+12 ; Local Extrinsic Functions
+13 ; FILE(DFN,60, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW OBR STAT ORDER)
+14 ; LIST( ------------> IN LIST OPERATOR
+15 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+16 ;
+17 IF $LENGTH(OCXDF(1))
IF $$LIST(OCXDF(1),"NW,SN")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,60,"96")
IF OCXOERR
QUIT
+18 IF $LENGTH(OCXDF(15))
IF (OCXDF(15)="F")
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 CHK264^OCXOZ0B
+19 QUIT
+20 ;
CHK157 ; Look through the current environment for valid Event/Elements for this patient.
+1 ; Called from CHK1+32^OCXOZ02.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local CHK157 Variables
+6 ; OCXDF(1) ----> Data Field: CONTROL CODE (FREE TEXT)
+7 ; OCXDF(2) ----> Data Field: FILLER (FREE TEXT)
+8 ; OCXDF(23) ---> Data Field: REQUEST STATUS (OBR) (FREE TEXT)
+9 ; OCXDF(34) ---> Data Field: ORDER NUMBER (NUMERIC)
+10 ; OCXDF(96) ---> Data Field: ORDERABLE ITEM NAME (FREE TEXT)
+11 ;
+12 ; Local Extrinsic Functions
+13 ; FILE(DFN,61, -----> FILE DATA IN PATIENT ACTIVE DATA FILE (Event/Element: NEW ORC STAT ORDER)
+14 ; LIST( ------------> IN LIST OPERATOR
+15 ; ORDITEM( ---------> GET ORDERABLE ITEM FROM ORDER NUMBER
+16 ;
+17 IF $LENGTH(OCXDF(1))
IF $$LIST(OCXDF(1),"NW,SN")
IF $LENGTH(OCXDF(34))
SET OCXDF(96)=$$ORDITEM(OCXDF(34))
SET OCXOERR=$$FILE(DFN,61,"96")
IF OCXOERR
QUIT
+18 IF $LENGTH(OCXDF(23))
IF (OCXDF(23)="F")
IF $LENGTH(OCXDF(1))
IF $$LIST(OCXDF(1),"RE")
IF $LENGTH(OCXDF(2))
DO CHK253^OCXOZ0B
+19 QUIT
+20 ;
CANCELER(ORNUM) ; Compiler Function: ORDER CANCELING PROVIDER
+1 ;
+2 IF '$GET(ORNUM)
QUIT ""
+3 SET ORNUM=+$GET(ORNUM)
+4 NEW ORQDUZ
+5 IF '$DATA(^OR(100,ORNUM,6))
QUIT ""
+6 SET ORQDUZ=$PIECE(^OR(100,ORNUM,6),U,2)
+7 QUIT ORQDUZ
+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 ;
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 ;
ORDERER(ORNUM) ; Compiler Function: ORDERING PROVIDER
+1 ;
+2 IF '$GET(ORNUM)
QUIT ""
+3 SET ORNUM=+$GET(ORNUM)
+4 NEW ORQDUZ,ORQI
SET ORQDUZ=""
+5 IF $LENGTH($GET(^OR(100,ORNUM,8,0)))
Begin DoDot:1
+6 SET ORQI=0
SET ORQI=$ORDER(^OR(100,ORNUM,8,"C","NW",ORQI))
End DoDot:1
+7 IF +$GET(ORQI)<1
QUIT ""
+8 SET ORQDUZ=$PIECE(^OR(100,ORNUM,8,ORQI,0),U,3)
+9 QUIT ORQDUZ
+10 ;
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 ;