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