ORY22108 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*221) ;AUG 30,2005 at 11:41
;;3.0;ORDER ENTRY/RESULTS REPORTING;**221**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^ORY221ES
;
;
K REMOTE,LOCAL,OPCODE,REF
F LINE=1:1:500 S TEXT=$P($T(DATA+LINE),";",2,999) Q:TEXT I $L(TEXT) D Q:QUIT
.S ^TMP("OCXRULE",$J,$O(^TMP("OCXRULE",$J,"A"),-1)+1)=TEXT
;
G ^ORY22109
;
Q
;
DATA ;
;
;;R^"860.8:",100,4
;;D^ ; N OCXF,OCXL
;;R^"860.8:",100,5
;;D^ ; ;
;;R^"860.8:",100,6
;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
;;R^"860.8:",100,7
;;D^T-; Q:'OCXF 0
;;R^"860.8:",100,8
;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
;;R^"860.8:",100,9
;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
;;R^"860.8:",100,10
;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
;;R^"860.8:",100,11
;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
;;R^"860.8:",100,12
;;D^T-; Q 0
;;R^"860.8:",100,13
;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
;;R^"860.8:",100,14
;;D^ ; ;
;;EOR^
;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
;;R^"860.8:",.01,"E"
;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
;;R^"860.8:",.02,"E"
;;D^FILE
;;R^"860.8:",1,1
;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
;;R^"860.8:",1,2
;;D^ ; ; in the Order Check Patient Data File
;;R^"860.8:",1,3
;;D^ ; ;
;;R^"860.8:",100,1
;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
;;R^"860.8:",100,4
;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
;;R^"860.8:",100,5
;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
;;R^"860.8:",100,6
;;D^ ; ;
;;R^"860.8:",100,7
;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
;;R^"860.8:",100,8
;;D^ ; ;
;;R^"860.8:",100,9
;;D^ ; S OCXDATA(DFN,OCXELE)=1
;;R^"860.8:",100,10
;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
;;R^"860.8:",100,11
;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
;;R^"860.8:",100,12
;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
;;R^"860.8:",100,13
;;D^ ; ;
;;R^"860.8:",100,14
;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
;;R^"860.8:",100,15
;;D^ ; ;
;;R^"860.8:",100,16
;;D^ ; Q 0
;;R^"860.8:",100,17
;;D^ ; ;
;;EOR^
;;KEY^860.8:^FORMATTED LAB RESULTS
;;R^"860.8:",.01,"E"
;;D^FORMATTED LAB RESULTS
;;R^"860.8:",.02,"E"
;;D^FLAB
;;R^"860.8:",100,1
;;D^ ;FLAB(DFN,OCXLIST,OCXSPEC) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; Q:'$G(DFN) "<Patient Not Specified>"
;;R^"860.8:",100,4
;;D^ ; Q:'$L($G(OCXLIST)) "<Lab Tests Not Specified>"
;;R^"860.8:",100,5
;;D^ ; N OCXLAB,OCXOUT,OCXPC,OCXSL,SPEC S OCXOUT="",SPEC=""
;;R^"860.8:",100,6
;;D^ ; I $L($G(OCXSPEC)) S OCXSL=$$TERMLKUP(OCXSPEC,.OCXSL)
;;R^"860.8:",100,7
;;D^ ; F OCXPC=1:1:$L(OCXLIST,U) S OCXLAB=$P(OCXLIST,U,OCXPC) I $L(OCXLAB) D
;;R^"860.8:",100,8
;;D^ ; .N OCXX,OCXY,X,Y,DIC,TEST,SPEC,OCXTL,OCXA,OCXR
;;R^"860.8:",100,9
;;D^ ; .S OCXTL="" Q:'$$TERMLKUP(OCXLAB,.OCXTL)
;;R^"860.8:",100,10
;;D^ ; .S OCXX="",TEST=0 F S TEST=$O(OCXTL(TEST)) Q:'TEST D
;;R^"860.8:",100,11
;;D^ ; ..I $L($G(OCXSL)) D
;;R^"860.8:",100,12
;;D^ ; ...S SPEC=0 F S SPEC=$O(OCXSL(SPEC)) Q:'SPEC D
;;R^"860.8:",100,13
;;D^ ; ....S OCXX=$$LOCL^ORQQLR1(DFN,TEST,SPEC) I $L(OCXX) D
;;R^"860.8:",100,14
;;D^ ; .....S OCXA($P(OCXX,U,7))=OCXX
;;R^"860.8:",100,15
;;D^ ; ..I '$L($G(OCXSL)) S OCXX=$$LOCL^ORQQLR1(DFN,TEST,"")
;;R^"860.8:",100,16
;;D^ ; ..Q:'$L(OCXX)
;;R^"860.8:",100,17
;;D^ ; .I $D(OCXA) S OCXR="",OCXR=$O(OCXA(OCXR),-1),OCXX=OCXA(OCXR)
;;R^"860.8:",100,18
;;D^ ; .I $L(OCXX) D
;;R^"860.8:",100,19
;;D^ ; ..S OCXY=$P(OCXX,U,2)_": "_$P(OCXX,U,3)_" "_$P(OCXX,U,4)
;;R^"860.8:",100,20
;;D^ ; ..S OCXY=OCXY_" "_$S($L($P(OCXX,U,5)):"["_$P(OCXX,U,5)_"]",1:"")
;;R^"860.8:",100,21
;;D^ ; ..I $L($P(OCXX,U,7)) S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXX,U,7),"2P")
;;R^"860.8:",100,22
;;D^ ; .S:$L(OCXOUT) OCXOUT=OCXOUT_" " S OCXOUT=OCXOUT_$G(OCXY)
;;R^"860.8:",100,23
;;D^ ; Q:'$L(OCXOUT) "<Results Not Found>" Q OCXOUT
;;R^"860.8:",100,24
;;D^ ; ;
;;EOR^
;;KEY^860.8:^GENERATE STRING CHECKSUM
;;R^"860.8:",.01,"E"
;;D^GENERATE STRING CHECKSUM
;;R^"860.8:",.02,"E"
;;D^CKSUM
;;R^"860.8:",100,1
;;D^ ;CKSUM(STR) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
;;R^"860.8:",100,4
;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
;;R^"860.8:",100,5
;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
;;R^"860.8:",100,6
;;D^ ; Q +CKSUM
;;R^"860.8:",100,7
;;D^ ; ;
;;EOR^
;;KEY^860.8:^GET DATA FROM THE ACTIVE DATA FILE
;;R^"860.8:",.01,"E"
;;D^GET DATA FROM THE ACTIVE DATA FILE
;;R^"860.8:",.02,"E"
;;D^GETDATA
;;R^"860.8:",100,1
;;D^ ;GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; N OCXE,VAL,PC S VAL=""
;;R^"860.8:",100,4
;;D^ ; F PC=1:1:$L(OCXL,U) S OCXE=$P(OCXL,U,PC) I OCXE S VAL=$G(^TMP("OCXCHK",$J,DFN,OCXE,OCXDFI)) Q:$L(VAL)
;;R^"860.8:",100,5
;;D^ ; Q VAL
;;R^"860.8:",100,6
;;D^ ; ;
;;EOR^
;;KEY^860.8:^IN LIST OPERATOR
;;R^"860.8:",.01,"E"
;;D^IN LIST OPERATOR
;;R^"860.8:",.02,"E"
;;D^LIST
;;R^"860.8:",100,1
;;D^ ;LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," $$LIST(""",DATA,""",""",LIST,""")"
;;R^"860.8:",100,4
;;D^ ; S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
;;R^"860.8:",100,5
;;D^ ; Q (LIST[DATA)
;;R^"860.8:",100,6
;;D^ ; ;
;;EOR^
;;KEY^860.8:^LOCAL TERM LOOKUP
;;R^"860.8:",.01,"E"
;;D^LOCAL TERM LOOKUP
;;R^"860.8:",.02,"E"
;;D^TERMLKUP
;;R^"860.8:",1,1
;;D^
;;R^"860.8:",1,2
;;D^ This function allows a local site to define to Order Checking
;;R^"860.8:",1,3
;;D^ a term specific to that site. (ie. Lab Test Name, Radiology
;;R^"860.8:",1,4
;;D^ procedure name, etc.)
;;R^"860.8:",1,5
;;D^
;;R^"860.8:",100,1
;;D^ ;TERMLKUP(OCXTERM,OCXFILE) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; Q
;;R^"860.8:",100,4
;;D^ ; ;
;;EOR^
;;KEY^860.8:^NEW RULE MESSAGE
;;R^"860.8:",.01,"E"
;;D^NEW RULE MESSAGE
;;R^"860.8:",.02,"E"
;;D^NEWRULE
;;R^"860.8:",100,1
;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
;;R^"860.8:",100,4
;;D^ ; ;
;;R^"860.8:",100,5
;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
;;R^"860.8:",100,6
;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
;1;
;
ORY22108 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*221) ;AUG 30,2005 at 11:41
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**221**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^ORY221ES
+3 ;
+4 ;
+5 KILL REMOTE,LOCAL,OPCODE,REF
+6 FOR LINE=1:1:500
SET TEXT=$PIECE($TEXT(DATA+LINE),";",2,999)
IF TEXT
QUIT
IF $LENGTH(TEXT)
Begin DoDot:1
+7 SET ^TMP("OCXRULE",$JOB,$ORDER(^TMP("OCXRULE",$JOB,"A"),-1)+1)=TEXT
End DoDot:1
IF QUIT
QUIT
+8 ;
+9 GOTO ^ORY22109
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;R^"860.8:",100,4
+3 ;;D^ ; N OCXF,OCXL
+4 ;;R^"860.8:",100,5
+5 ;;D^ ; ;
+6 ;;R^"860.8:",100,6
+7 ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
+8 ;;R^"860.8:",100,7
+9 ;;D^T-; Q:'OCXF 0
+10 ;;R^"860.8:",100,8
+11 ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
+12 ;;R^"860.8:",100,9
+13 ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
+14 ;;R^"860.8:",100,10
+15 ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
+16 ;;R^"860.8:",100,11
+17 ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
+18 ;;R^"860.8:",100,12
+19 ;;D^T-; Q 0
+20 ;;R^"860.8:",100,13
+21 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
+22 ;;R^"860.8:",100,14
+23 ;;D^ ; ;
+24 ;;EOR^
+25 ;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
+26 ;;R^"860.8:",.01,"E"
+27 ;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
+28 ;;R^"860.8:",.02,"E"
+29 ;;D^FILE
+30 ;;R^"860.8:",1,1
+31 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
+32 ;;R^"860.8:",1,2
+33 ;;D^ ; ; in the Order Check Patient Data File
+34 ;;R^"860.8:",1,3
+35 ;;D^ ; ;
+36 ;;R^"860.8:",100,1
+37 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
+38 ;;R^"860.8:",100,2
+39 ;;D^ ; ;
+40 ;;R^"860.8:",100,3
+41 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
+42 ;;R^"860.8:",100,4
+43 ;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
+44 ;;R^"860.8:",100,5
+45 ;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
+46 ;;R^"860.8:",100,6
+47 ;;D^ ; ;
+48 ;;R^"860.8:",100,7
+49 ;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
+50 ;;R^"860.8:",100,8
+51 ;;D^ ; ;
+52 ;;R^"860.8:",100,9
+53 ;;D^ ; S OCXDATA(DFN,OCXELE)=1
+54 ;;R^"860.8:",100,10
+55 ;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
+56 ;;R^"860.8:",100,11
+57 ;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
+58 ;;R^"860.8:",100,12
+59 ;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
+60 ;;R^"860.8:",100,13
+61 ;;D^ ; ;
+62 ;;R^"860.8:",100,14
+63 ;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
+64 ;;R^"860.8:",100,15
+65 ;;D^ ; ;
+66 ;;R^"860.8:",100,16
+67 ;;D^ ; Q 0
+68 ;;R^"860.8:",100,17
+69 ;;D^ ; ;
+70 ;;EOR^
+71 ;;KEY^860.8:^FORMATTED LAB RESULTS
+72 ;;R^"860.8:",.01,"E"
+73 ;;D^FORMATTED LAB RESULTS
+74 ;;R^"860.8:",.02,"E"
+75 ;;D^FLAB
+76 ;;R^"860.8:",100,1
+77 ;;D^ ;FLAB(DFN,OCXLIST,OCXSPEC) ;
+78 ;;R^"860.8:",100,2
+79 ;;D^ ; ;
+80 ;;R^"860.8:",100,3
+81 ;;D^ ; Q:'$G(DFN) "<Patient Not Specified>"
+82 ;;R^"860.8:",100,4
+83 ;;D^ ; Q:'$L($G(OCXLIST)) "<Lab Tests Not Specified>"
+84 ;;R^"860.8:",100,5
+85 ;;D^ ; N OCXLAB,OCXOUT,OCXPC,OCXSL,SPEC S OCXOUT="",SPEC=""
+86 ;;R^"860.8:",100,6
+87 ;;D^ ; I $L($G(OCXSPEC)) S OCXSL=$$TERMLKUP(OCXSPEC,.OCXSL)
+88 ;;R^"860.8:",100,7
+89 ;;D^ ; F OCXPC=1:1:$L(OCXLIST,U) S OCXLAB=$P(OCXLIST,U,OCXPC) I $L(OCXLAB) D
+90 ;;R^"860.8:",100,8
+91 ;;D^ ; .N OCXX,OCXY,X,Y,DIC,TEST,SPEC,OCXTL,OCXA,OCXR
+92 ;;R^"860.8:",100,9
+93 ;;D^ ; .S OCXTL="" Q:'$$TERMLKUP(OCXLAB,.OCXTL)
+94 ;;R^"860.8:",100,10
+95 ;;D^ ; .S OCXX="",TEST=0 F S TEST=$O(OCXTL(TEST)) Q:'TEST D
+96 ;;R^"860.8:",100,11
+97 ;;D^ ; ..I $L($G(OCXSL)) D
+98 ;;R^"860.8:",100,12
+99 ;;D^ ; ...S SPEC=0 F S SPEC=$O(OCXSL(SPEC)) Q:'SPEC D
+100 ;;R^"860.8:",100,13
+101 ;;D^ ; ....S OCXX=$$LOCL^ORQQLR1(DFN,TEST,SPEC) I $L(OCXX) D
+102 ;;R^"860.8:",100,14
+103 ;;D^ ; .....S OCXA($P(OCXX,U,7))=OCXX
+104 ;;R^"860.8:",100,15
+105 ;;D^ ; ..I '$L($G(OCXSL)) S OCXX=$$LOCL^ORQQLR1(DFN,TEST,"")
+106 ;;R^"860.8:",100,16
+107 ;;D^ ; ..Q:'$L(OCXX)
+108 ;;R^"860.8:",100,17
+109 ;;D^ ; .I $D(OCXA) S OCXR="",OCXR=$O(OCXA(OCXR),-1),OCXX=OCXA(OCXR)
+110 ;;R^"860.8:",100,18
+111 ;;D^ ; .I $L(OCXX) D
+112 ;;R^"860.8:",100,19
+113 ;;D^ ; ..S OCXY=$P(OCXX,U,2)_": "_$P(OCXX,U,3)_" "_$P(OCXX,U,4)
+114 ;;R^"860.8:",100,20
+115 ;;D^ ; ..S OCXY=OCXY_" "_$S($L($P(OCXX,U,5)):"["_$P(OCXX,U,5)_"]",1:"")
+116 ;;R^"860.8:",100,21
+117 ;;D^ ; ..I $L($P(OCXX,U,7)) S OCXY=OCXY_" "_$$FMTE^XLFDT($P(OCXX,U,7),"2P")
+118 ;;R^"860.8:",100,22
+119 ;;D^ ; .S:$L(OCXOUT) OCXOUT=OCXOUT_" " S OCXOUT=OCXOUT_$G(OCXY)
+120 ;;R^"860.8:",100,23
+121 ;;D^ ; Q:'$L(OCXOUT) "<Results Not Found>" Q OCXOUT
+122 ;;R^"860.8:",100,24
+123 ;;D^ ; ;
+124 ;;EOR^
+125 ;;KEY^860.8:^GENERATE STRING CHECKSUM
+126 ;;R^"860.8:",.01,"E"
+127 ;;D^GENERATE STRING CHECKSUM
+128 ;;R^"860.8:",.02,"E"
+129 ;;D^CKSUM
+130 ;;R^"860.8:",100,1
+131 ;;D^ ;CKSUM(STR) ;
+132 ;;R^"860.8:",100,2
+133 ;;D^ ; ;
+134 ;;R^"860.8:",100,3
+135 ;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
+136 ;;R^"860.8:",100,4
+137 ;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+138 ;;R^"860.8:",100,5
+139 ;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
+140 ;;R^"860.8:",100,6
+141 ;;D^ ; Q +CKSUM
+142 ;;R^"860.8:",100,7
+143 ;;D^ ; ;
+144 ;;EOR^
+145 ;;KEY^860.8:^GET DATA FROM THE ACTIVE DATA FILE
+146 ;;R^"860.8:",.01,"E"
+147 ;;D^GET DATA FROM THE ACTIVE DATA FILE
+148 ;;R^"860.8:",.02,"E"
+149 ;;D^GETDATA
+150 ;;R^"860.8:",100,1
+151 ;;D^ ;GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
+152 ;;R^"860.8:",100,2
+153 ;;D^ ; ;
+154 ;;R^"860.8:",100,3
+155 ;;D^ ; N OCXE,VAL,PC S VAL=""
+156 ;;R^"860.8:",100,4
+157 ;;D^ ; F PC=1:1:$L(OCXL,U) S OCXE=$P(OCXL,U,PC) I OCXE S VAL=$G(^TMP("OCXCHK",$J,DFN,OCXE,OCXDFI)) Q:$L(VAL)
+158 ;;R^"860.8:",100,5
+159 ;;D^ ; Q VAL
+160 ;;R^"860.8:",100,6
+161 ;;D^ ; ;
+162 ;;EOR^
+163 ;;KEY^860.8:^IN LIST OPERATOR
+164 ;;R^"860.8:",.01,"E"
+165 ;;D^IN LIST OPERATOR
+166 ;;R^"860.8:",.02,"E"
+167 ;;D^LIST
+168 ;;R^"860.8:",100,1
+169 ;;D^ ;LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
+170 ;;R^"860.8:",100,2
+171 ;;D^ ; ;
+172 ;;R^"860.8:",100,3
+173 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," $$LIST(""",DATA,""",""",LIST,""")"
+174 ;;R^"860.8:",100,4
+175 ;;D^ ; S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
+176 ;;R^"860.8:",100,5
+177 ;;D^ ; Q (LIST[DATA)
+178 ;;R^"860.8:",100,6
+179 ;;D^ ; ;
+180 ;;EOR^
+181 ;;KEY^860.8:^LOCAL TERM LOOKUP
+182 ;;R^"860.8:",.01,"E"
+183 ;;D^LOCAL TERM LOOKUP
+184 ;;R^"860.8:",.02,"E"
+185 ;;D^TERMLKUP
+186 ;;R^"860.8:",1,1
+187 ;;D^
+188 ;;R^"860.8:",1,2
+189 ;;D^ This function allows a local site to define to Order Checking
+190 ;;R^"860.8:",1,3
+191 ;;D^ a term specific to that site. (ie. Lab Test Name, Radiology
+192 ;;R^"860.8:",1,4
+193 ;;D^ procedure name, etc.)
+194 ;;R^"860.8:",1,5
+195 ;;D^
+196 ;;R^"860.8:",100,1
+197 ;;D^ ;TERMLKUP(OCXTERM,OCXFILE) ;
+198 ;;R^"860.8:",100,2
+199 ;;D^ ; ;
+200 ;;R^"860.8:",100,3
+201 ;;D^ ; Q
+202 ;;R^"860.8:",100,4
+203 ;;D^ ; ;
+204 ;;EOR^
+205 ;;KEY^860.8:^NEW RULE MESSAGE
+206 ;;R^"860.8:",.01,"E"
+207 ;;D^NEW RULE MESSAGE
+208 ;;R^"860.8:",.02,"E"
+209 ;;D^NEWRULE
+210 ;;R^"860.8:",100,1
+211 ;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
+212 ;;R^"860.8:",100,2
+213 ;;D^ ; ;
+214 ;;R^"860.8:",100,3
+215 ;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
+216 ;;R^"860.8:",100,4
+217 ;;D^ ; ;
+218 ;;R^"860.8:",100,5
+219 ;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
+220 ;;R^"860.8:",100,6
+221 ;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
+222 ;1;
+223 ;