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