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