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