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