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