ORY26705 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*267) ;OCT 23,2006 at 10:42
;;3.0;ORDER ENTRY/RESULTS REPORTING;**267**;Dec 17,1997;Build 6
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^ORY267ES
;
;
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 ^ORY26706
;
Q
;
DATA ;
;
;;D^ ; S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
;;R^"860.8:",100,17
;;D^ ; I OCXF S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
;;R^"860.8:",100,18
;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
;;R^"860.8:",100,19
;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
;;R^"860.8:",100,20
;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
;;R^"860.8:",100,21
;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
;;R^"860.8:",100,22
;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
;;R^"860.8:",100,23
;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
;;R^"860.8:",100,24
;;D^ ; ;
;;EOR^
;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
;;R^"860.8:",.01,"E"
;;D^ELAPSED ORDER CHECK TIME LOGGER
;;R^"860.8:",.02,"E"
;;D^TIMELOG
;;R^"860.8:",100,1
;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^ ; ;
;;R^"860.8:",100,4
;;D^ ; Q 0
;;R^"860.8:",100,5
;;D^ ; ;
;;EOR^
;;KEY^860.8:^EQUALS TERM OPERATOR
;;R^"860.8:",.01,"E"
;;D^EQUALS TERM OPERATOR
;;R^"860.8:",.02,"E"
;;D^EQTERM
;;R^"860.8:",100,1
;;D^ ;EQTERM(DATA,TERM) ;
;;R^"860.8:",100,2
;;D^ ; ;
;;R^"860.8:",100,3
;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
;;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:^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
;;R^"860.8:",100,7
;;D^ ; S OCXORD=+$G(OCXORD),OCXDFN=+OCXDFN
;;R^"860.8:",100,8
;;D^ ; ;
;;R^"860.8:",100,9
;;D^ ; N OCXNDX,OCXDATA,OCXDFI,OCXELE,OCXGR,OCXTIME,OCXCKSUM,OCXTSP,OCXTSPL
;;R^"860.8:",100,10
;;D^ ; ;
;;R^"860.8:",100,11
;;D^ ; S OCXTIME=(+$H)
;;R^"860.8:",100,12
;;D^ ; S OCXCKSUM=$$CKSUM(OCXMESS)
;;R^"860.8:",100,13
;1;
;
ORY26705 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*267) ;OCT 23,2006 at 10:42
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**267**;Dec 17,1997;Build 6
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^ORY267ES
+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 ^ORY26706
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;D^ ; S OCXDAY=OCXDT-$P(OCXCNT,U,OCXMON-1)+1
+3 ;;R^"860.8:",100,17
+4 ;;D^ ; I OCXF S OCXMON=$P("January^February^March^April^May^June^July^August^September^October^November^December",U,OCXMON)
+5 ;;R^"860.8:",100,18
+6 ;;D^ ; E S OCXMON=$E(OCXMON+100,2,3)
+7 ;;R^"860.8:",100,19
+8 ;;D^ ; S OCXAP=$S('OCXHR:"Midnight",(OCXHR=12):"Noon",(OCXHR<12):"AM",1:"PM")
+9 ;;R^"860.8:",100,20
+10 ;;D^ ; I OCXF S OCXHR=OCXHR#12 S:'OCXHR OCXHR=12
+11 ;;R^"860.8:",100,21
+12 ;;D^ ; Q:'OCXF $E(OCXMON+100,2,3)_"/"_$E(OCXDAY+100,2,3)_$S((OCXCYR=OCXYR):" "_OCXHR_":"_OCXMIN,1:"/"_$E(OCXYR,3,4))
+13 ;;R^"860.8:",100,22
+14 ;;D^ ; Q:(OCXHR+OCXMIN+OCXSEC) OCXMON_" "_OCXDAY_","_OCXYR_" at "_OCXHR_":"_OCXMIN_"."_OCXSEC_" "_OCXAP
+15 ;;R^"860.8:",100,23
+16 ;;D^ ; Q OCXMON_" "_OCXDAY_","_OCXYR
+17 ;;R^"860.8:",100,24
+18 ;;D^ ; ;
+19 ;;EOR^
+20 ;;KEY^860.8:^ELAPSED ORDER CHECK TIME LOGGER
+21 ;;R^"860.8:",.01,"E"
+22 ;;D^ELAPSED ORDER CHECK TIME LOGGER
+23 ;;R^"860.8:",.02,"E"
+24 ;;D^TIMELOG
+25 ;;R^"860.8:",100,1
+26 ;;D^ ;TIMELOG(OCXMODE,OCXCALL) ; Log an entry in the Elapsed time log.
+27 ;;R^"860.8:",100,2
+28 ;;D^ ; ;
+29 ;;R^"860.8:",100,3
+30 ;;D^ ; ;
+31 ;;R^"860.8:",100,4
+32 ;;D^ ; Q 0
+33 ;;R^"860.8:",100,5
+34 ;;D^ ; ;
+35 ;;EOR^
+36 ;;KEY^860.8:^EQUALS TERM OPERATOR
+37 ;;R^"860.8:",.01,"E"
+38 ;;D^EQUALS TERM OPERATOR
+39 ;;R^"860.8:",.02,"E"
+40 ;;D^EQTERM
+41 ;;R^"860.8:",100,1
+42 ;;D^ ;EQTERM(DATA,TERM) ;
+43 ;;R^"860.8:",100,2
+44 ;;D^ ; ;
+45 ;;R^"860.8:",100,3
+46 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DATA: ",$G(DATA)," TERM: ",$G(TERM)
+47 ;;R^"860.8:",100,4
+48 ;;D^ ; N OCXF,OCXL
+49 ;;R^"860.8:",100,5
+50 ;;D^ ; ;
+51 ;;R^"860.8:",100,6
+52 ;;D^ ; S OCXL="",OCXF=$$TERMLKUP(TERM,.OCXL)
+53 ;;R^"860.8:",100,7
+54 ;;D^T-; Q:'OCXF 0
+55 ;;R^"860.8:",100,8
+56 ;;D^T+; I 'OCXF W:$G(OCXTRACE) !,"%%%%",?20," Term '",TERM,"' not in Order Check National Term File" Q 0
+57 ;;R^"860.8:",100,9
+58 ;;D^T+; I '$O(OCXL(0)) W:$G(OCXTRACE) !,"%%%%",?20," There are no local terms listed for the National Term '",TERM,"'." Q 0
+59 ;;R^"860.8:",100,10
+60 ;;D^T+; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) W:$G(OCXTRACE) !,"%%%%",?20," Data equals Term" Q 1
+61 ;;R^"860.8:",100,11
+62 ;;D^T-; I ($D(OCXL(DATA))!$D(OCXL("B",DATA))) Q 1
+63 ;;R^"860.8:",100,12
+64 ;;D^T-; Q 0
+65 ;;R^"860.8:",100,13
+66 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," Data does not equal Term" Q 0
+67 ;;R^"860.8:",100,14
+68 ;;D^ ; ;
+69 ;;EOR^
+70 ;;KEY^860.8:^FILE DATA IN PATIENT ACTIVE DATA FILE
+71 ;;R^"860.8:",.01,"E"
+72 ;;D^FILE DATA IN PATIENT ACTIVE DATA FILE
+73 ;;R^"860.8:",.02,"E"
+74 ;;D^FILE
+75 ;;R^"860.8:",1,1
+76 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function files data
+77 ;;R^"860.8:",1,2
+78 ;;D^ ; ; in the Order Check Patient Data File
+79 ;;R^"860.8:",1,3
+80 ;;D^ ; ;
+81 ;;R^"860.8:",100,1
+82 ;;D^ ;FILE(DFN,OCXELE,OCXDFL) ; This Local Extrinsic Function logs a validated event/element.
+83 ;;R^"860.8:",100,2
+84 ;;D^ ; ;
+85 ;;R^"860.8:",100,3
+86 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," Execution trace DFN: ",DFN," OCXELE: ",+$G(OCXELE)," OCXDFL: ",$G(OCXDFL)
+87 ;;R^"860.8:",100,4
+88 ;;D^ ; N OCXTIMN,OCXTIML,OCXTIMT1,OCXTIMT2,OCXDATA,OCXPC,OCXPC,OCXVAL,OCXSUB,OCXDFI
+89 ;;R^"860.8:",100,5
+90 ;;D^ ; S DFN=+$G(DFN),OCXELE=+$G(OCXELE)
+91 ;;R^"860.8:",100,6
+92 ;;D^ ; ;
+93 ;;R^"860.8:",100,7
+94 ;;D^ ; Q:'DFN 1 Q:'OCXELE 1 K OCXDATA
+95 ;;R^"860.8:",100,8
+96 ;;D^ ; ;
+97 ;;R^"860.8:",100,9
+98 ;;D^ ; S OCXDATA(DFN,OCXELE)=1
+99 ;;R^"860.8:",100,10
+100 ;;D^ ; F OCXPC=1:1:$L(OCXDFL,",") S OCXDFI=$P(OCXDFL,",",OCXPC) I OCXDFI D
+101 ;;R^"860.8:",100,11
+102 ;;D^ ; .S OCXVAL=$G(OCXDF(+OCXDFI)),OCXDATA(DFN,OCXELE,+OCXDFI)=OCXVAL
+103 ;;R^"860.8:",100,12
+104 ;;D^T+; .I $G(OCXTRACE) W !,"%%%%",?20," ",$P($G(^OCXS(860.4,+OCXDFI,0)),U,1)," = """,OCXVAL,""""
+105 ;;R^"860.8:",100,13
+106 ;;D^ ; ;
+107 ;;R^"860.8:",100,14
+108 ;;D^ ; M ^TMP("OCXCHK",$J,DFN)=OCXDATA(DFN)
+109 ;;R^"860.8:",100,15
+110 ;;D^ ; ;
+111 ;;R^"860.8:",100,16
+112 ;;D^ ; Q 0
+113 ;;R^"860.8:",100,17
+114 ;;D^ ; ;
+115 ;;EOR^
+116 ;;KEY^860.8:^GENERATE STRING CHECKSUM
+117 ;;R^"860.8:",.01,"E"
+118 ;;D^GENERATE STRING CHECKSUM
+119 ;;R^"860.8:",.02,"E"
+120 ;;D^CKSUM
+121 ;;R^"860.8:",100,1
+122 ;;D^ ;CKSUM(STR) ;
+123 ;;R^"860.8:",100,2
+124 ;;D^ ; ;
+125 ;;R^"860.8:",100,3
+126 ;;D^ ; N CKSUM,PTR,ASC S CKSUM=0
+127 ;;R^"860.8:",100,4
+128 ;;D^ ; S STR=$TR(STR,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
+129 ;;R^"860.8:",100,5
+130 ;;D^ ; F PTR=$L(STR):-1:1 S ASC=$A(STR,PTR)-42 I (ASC>0),(ASC<51) S CKSUM=CKSUM*2+ASC
+131 ;;R^"860.8:",100,6
+132 ;;D^ ; Q +CKSUM
+133 ;;R^"860.8:",100,7
+134 ;;D^ ; ;
+135 ;;EOR^
+136 ;;KEY^860.8:^GET DATA FROM THE ACTIVE DATA FILE
+137 ;;R^"860.8:",.01,"E"
+138 ;;D^GET DATA FROM THE ACTIVE DATA FILE
+139 ;;R^"860.8:",.02,"E"
+140 ;;D^GETDATA
+141 ;;R^"860.8:",100,1
+142 ;;D^ ;GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
+143 ;;R^"860.8:",100,2
+144 ;;D^ ; ;
+145 ;;R^"860.8:",100,3
+146 ;;D^ ; N OCXE,VAL,PC S VAL=""
+147 ;;R^"860.8:",100,4
+148 ;;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)
+149 ;;R^"860.8:",100,5
+150 ;;D^ ; Q VAL
+151 ;;R^"860.8:",100,6
+152 ;;D^ ; ;
+153 ;;EOR^
+154 ;;KEY^860.8:^IN LIST OPERATOR
+155 ;;R^"860.8:",.01,"E"
+156 ;;D^IN LIST OPERATOR
+157 ;;R^"860.8:",.02,"E"
+158 ;;D^LIST
+159 ;;R^"860.8:",100,1
+160 ;;D^ ;LIST(DATA,LIST) ; IS THE DATA FIELD IN THE LIST
+161 ;;R^"860.8:",100,2
+162 ;;D^ ; ;
+163 ;;R^"860.8:",100,3
+164 ;;D^T+; W:$G(OCXTRACE) !,"%%%%",?20," $$LIST(""",DATA,""",""",LIST,""")"
+165 ;;R^"860.8:",100,4
+166 ;;D^ ; S:'($E(LIST,1)=",") LIST=","_LIST S:'($E(LIST,$L(LIST))=",") LIST=LIST_"," S DATA=","_DATA_","
+167 ;;R^"860.8:",100,5
+168 ;;D^ ; Q (LIST[DATA)
+169 ;;R^"860.8:",100,6
+170 ;;D^ ; ;
+171 ;;EOR^
+172 ;;KEY^860.8:^LOCAL TERM LOOKUP
+173 ;;R^"860.8:",.01,"E"
+174 ;;D^LOCAL TERM LOOKUP
+175 ;;R^"860.8:",.02,"E"
+176 ;;D^TERMLKUP
+177 ;;R^"860.8:",1,1
+178 ;;D^
+179 ;;R^"860.8:",1,2
+180 ;;D^ This function allows a local site to define to Order Checking
+181 ;;R^"860.8:",1,3
+182 ;;D^ a term specific to that site. (ie. Lab Test Name, Radiology
+183 ;;R^"860.8:",1,4
+184 ;;D^ procedure name, etc.)
+185 ;;R^"860.8:",1,5
+186 ;;D^
+187 ;;R^"860.8:",100,1
+188 ;;D^ ;TERMLKUP(OCXTERM,OCXFILE) ;
+189 ;;R^"860.8:",100,2
+190 ;;D^ ; ;
+191 ;;R^"860.8:",100,3
+192 ;;D^ ; Q
+193 ;;R^"860.8:",100,4
+194 ;;D^ ; ;
+195 ;;EOR^
+196 ;;KEY^860.8:^NEW RULE MESSAGE
+197 ;;R^"860.8:",.01,"E"
+198 ;;D^NEW RULE MESSAGE
+199 ;;R^"860.8:",.02,"E"
+200 ;;D^NEWRULE
+201 ;;R^"860.8:",100,1
+202 ;;D^ ;NEWRULE(OCXDFN,OCXORD,OCXRUL,OCXREL,OCXNOTF,OCXMESS) ; Has this rule already been triggered for this order number
+203 ;;R^"860.8:",100,2
+204 ;;D^ ; ;
+205 ;;R^"860.8:",100,3
+206 ;;D^L+; S OCXERR=$$TIMELOG("M","NEWRULE("_(+$G(OCXDFN))_","_(+$G(OCXORD))_","_(+$G(OCXRUL))_","_(+$G(OCXREL))_","_(+$G(OCXNOTF))_","_$G(OCXMESS)_")")
+207 ;;R^"860.8:",100,4
+208 ;;D^ ; ;
+209 ;;R^"860.8:",100,5
+210 ;;D^ ; Q:'$G(OCXDFN) 0 Q:'$G(OCXRUL) 0
+211 ;;R^"860.8:",100,6
+212 ;;D^ ; Q:'$G(OCXREL) 0 Q:'$G(OCXNOTF) 0 Q:'$L($G(OCXMESS)) 0
+213 ;;R^"860.8:",100,7
+214 ;;D^ ; S OCXORD=+$G(OCXORD),OCXDFN=+OCXDFN
+215 ;;R^"860.8:",100,8
+216 ;;D^ ; ;
+217 ;;R^"860.8:",100,9
+218 ;;D^ ; N OCXNDX,OCXDATA,OCXDFI,OCXELE,OCXGR,OCXTIME,OCXCKSUM,OCXTSP,OCXTSPL
+219 ;;R^"860.8:",100,10
+220 ;;D^ ; ;
+221 ;;R^"860.8:",100,11
+222 ;;D^ ; S OCXTIME=(+$H)
+223 ;;R^"860.8:",100,12
+224 ;;D^ ; S OCXCKSUM=$$CKSUM(OCXMESS)
+225 ;;R^"860.8:",100,13
+226 ;1;
+227 ;