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