ORY12706 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*127) ;SEP 17,2002 at 13:48
;;3.0;ORDER ENTRY/RESULTS REPORTING;**127**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
;
D DOT^ORY127ES
;
;
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 ^ORY12707
;
Q
;
DATA ;
;
;;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)
;;R^"860.8:",100,61
;;D^T-; ..D SETAP(OCXGR2_")","860.71223P",.OCXDATA,OCXDFI)
;;R^"860.8:",100,62
;;D^ ; ;
;;R^"860.8:",100,63
;;D^ ; Q 1
;;R^"860.8:",100,64
;;D^ ; ;
;;R^"860.8:",100,65
;;D^T+;SETAP(ROOT,DD,ITEM,ITEMNAME,DATA,DA) ; Set Rule Event data
;;R^"860.8:",100,66
;;D^T-;SETAP(ROOT,DD,DATA,DA) ; Set Rule Event data
;;R^"860.8:",100,67
;;D^ ; M @ROOT=DATA
;;R^"860.8:",100,68
;;D^ ; I +$G(DD) S @ROOT@(0)="^"_($G(DD))_"^"_($P($G(@ROOT@(0)),U,3)+1)_"^"_$G(DA)
;;R^"860.8:",100,69
;;D^ ; I '$G(DD) S $P(@ROOT@(0),U,3,4)=($P($G(@ROOT@(0)),U,3)+1)_"^"_$G(DA)
;;R^"860.8:",100,70
;;D^T+; W:$G(OCXTRACE) !,"File Active Data ",$G(ITEM),": ",$G(ITEMNAME)
;;R^"860.8:",100,71
;;D^ ; ;
;;R^"860.8:",100,72
;;D^ ; Q
;;R^"860.8:",100,73
;;D^ ; ;
;;R^"860.8:",100,74
;;D^ ; ;
;;EOR^
;;KEY^860.8:^OPIOID MEDICATIONS
;;R^"860.8:",.01,"E"
;;D^OPIOID MEDICATIONS
;;R^"860.8:",.02,"E"
;;D^OPIOID
;;R^"860.8:",1,1
;;D^If the patient is currently receiving "active" medications in the opioid
;;R^"860.8:",1,2
;;D^VA drug classes CN101 or CN102, this function returns a "1" and list of
;;R^"860.8:",1,3
;;D^the opioid medications in the following format:
;;R^"860.8:",1,4
;;D^
;;R^"860.8:",1,5
;;D^ 1^drug order text 1, drug order text 2, drug order text 3, ...
;;R^"860.8:",1,6
;;D^
;;R^"860.8:",1,7
;;D^[Note: The drug order text is truncated to the first 25 characters.]
;;R^"860.8:",1,8
;;D^
;;R^"860.8:",1,9
;;D^If the patient is not currently receiving opioid medications, a zero (0)
;;R^"860.8:",1,10
;;D^is returned.
;;R^"860.8:",100,1
;;D^ ;OPIOID(ORPT) ;determine if pat is receiving opioid med
;;R^"860.8:",100,2
;;D^ ; ; rtn 1^opioid drug 1, opioid drug 2, opioid drug3, ...
;;R^"860.8:",100,3
;;D^ ; N ORDG,ORTN,ORNUM,ORDI,ORDCLAS,ORDERS,ORTEXT,DUP,DUPI,DUPJ,DUPLEN
;;R^"860.8:",100,4
;;D^ ; S ORDG=0,ORTN=0,DUPI=0,DUPLEN=20
;;R^"860.8:",100,5
;;D^ ; K ^TMP("ORR",$J)
;;R^"860.8:",100,6
;;D^ ; S ORDG=$O(^ORD(100.98,"B","RX",ORDG))
;;R^"860.8:",100,7
;;D^ ; D EN^ORQ1(ORPT_";DPT(",ORDG,2,"","","",0,0)
;;R^"860.8:",100,8
;;D^ ; N J,HOR,SEQ,X S J=1,HOR=0,SEQ=0
;;R^"860.8:",100,9
;;D^ ; S HOR=$O(^TMP("ORR",$J,HOR)) Q:+HOR<1 ORTN
;;R^"860.8:",100,10
;;D^ ; F S SEQ=$O(^TMP("ORR",$J,HOR,SEQ)) Q:+SEQ<1 D
;;R^"860.8:",100,11
;;D^ ; .S X=^TMP("ORR",$J,HOR,SEQ)
;;R^"860.8:",100,12
;;D^ ; .S ORNUM=+$P(X,";")
;;R^"860.8:",100,13
;;D^ ; .Q:ORNUM=+$G(ORIFN) ;quit if dup med order # = current order #
;;R^"860.8:",100,14
;;D^ ; .S ORDI=$$VALUE^ORCSAVE2(ORNUM,"DRUG")
;;R^"860.8:",100,15
;;D^ ; .I +$G(ORDI)>0 D
;;R^"860.8:",100,16
;;D^ ; ..S ORDCLAS=$P(^PSDRUG(ORDI,0),U,2) ;va drug class
;;R^"860.8:",100,17
;;D^ ; ..I ($G(ORDCLAS)="CN101")!($G(ORDCLAS)="CN102") D ;opioid classes
;;R^"860.8:",100,18
;;D^ ; ...S ORTEXT=$$FULLTEXT^ORQOR1(ORNUM)
;;R^"860.8:",100,19
;;D^ ; ...S ORTEXT=$P(ORTEXT,U)_" ["_$P(ORTEXT,U,2)_"]"
;;R^"860.8:",100,20
;;D^ ; ...S DUPI=DUPI+1,DUP(DUPI)=" ["_DUPI_"] "_ORTEXT
;;R^"860.8:",100,21
;;D^ ; ...S ORTN=1
;;R^"860.8:",100,22
;;D^ ; I DUPI>0 D
;;R^"860.8:",100,23
;;D^ ; .S DUPLEN=$P(215/DUPI,".")
;;R^"860.8:",100,24
;;D^ ; .F DUPJ=1:1:DUPI D
;;R^"860.8:",100,25
;;D^ ; ..I DUPJ=1 S ORDERS=$E(DUP(DUPJ),1,DUPLEN)
;;R^"860.8:",100,26
;;D^ ; ..E S ORDERS=ORDERS_", "_$E(DUP(DUPJ),1,DUPLEN)
;;R^"860.8:",100,27
;;D^ ; K ^TMP("ORR",$J)
;;R^"860.8:",100,28
;;D^ ; Q ORTN_U_$G(ORDERS)
;;R^"860.8:",100,29
;;D^ ; ;
;;EOR^
;;KEY^860.8:^RETURN POINTED TO VALUE
;;R^"860.8:",.01,"E"
;;D^RETURN POINTED TO VALUE
;;R^"860.8:",.02,"E"
;;D^POINTER
;;R^"860.8:",1,1
;;D^ ;POINTER(OCXFILE,D0) ; This Local Extrinsic Function gets the value of the name field
;;R^"860.8:",1,2
;;D^ ; ; of record D0 in file OCXFILE
;;R^"860.8:",100,1
;;D^ ;POINTER(OCXFILE,D0) ; This Local Extrinsic Function gets the value of the name field
;;R^"860.8:",100,2
;;D^ ; ; of record D0 in file OCXFILE
;;R^"860.8:",100,3
;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," FILE: ",$G(OCXFILE)," D0: ",$G(D0)
;;R^"860.8:",100,4
;;D^ ; Q:'$G(D0) "" Q:'$L($G(OCXFILE)) ""
;;R^"860.8:",100,5
;;D^ ; N GLREF
;;R^"860.8:",100,6
;;D^ ; I '(OCXFILE=(+OCXFILE)) S GLREF=U_OCXFILE
;;R^"860.8:",100,7
;;D^ ; E S GLREF=$$FILE^OCXBDTD(+OCXFILE,"GLOBAL NAME") Q:'$L(GLREF) ""
;;R^"860.8:",100,8
;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," GLREF: ",GLREF," RESOLVES TO: ",$P($G(@(GLREF_(+D0)_",0)")),U,1)
;;R^"860.8:",100,9
;;D^ ; Q $P($G(@(GLREF_(+D0)_",0)")),U,1)
;;R^"860.8:",100,10
;;D^ ; ;
;;EOR^
;;KEY^860.8:^STRING CONTAINS ONE OF A LIST OF VALUES
;;R^"860.8:",.01,"E"
;1;
;
ORY12706 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*127) ;SEP 17,2002 at 13:48
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**127**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ;
+2 DO DOT^ORY127ES
+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 ^ORY12707
+10 ;
+11 QUIT
+12 ;
DATA ;
+1 ;
+2 ;;R^"860.8:",100,29
+3 ;;D^ ; S OCXGR=OCXGR_","_OCXDFN_",1"
+4 ;;R^"860.8:",100,30
+5 ;;D^T+; D SETAP(OCXGR_")","860.71P","Rule",$P($G(^OCXS(860.2,OCXRUL,0)),U,1),.OCXDATA,OCXRUL)
+6 ;;R^"860.8:",100,31
+7 ;;D^T-; D SETAP(OCXGR_")","860.71P",.OCXDATA,OCXRUL)
+8 ;;R^"860.8:",100,32
+9 ;;D^ ; ;
+10 ;;R^"860.8:",100,33
+11 ;;D^ ; K OCXDATA
+12 ;;R^"860.8:",100,34
+13 ;;D^ ; S OCXDATA(OCXREL,0)=OCXREL
+14 ;;R^"860.8:",100,35
+15 ;;D^ ; S OCXDATA("B",OCXREL,OCXREL)=""
+16 ;;R^"860.8:",100,36
+17 ;;D^ ; S OCXGR=OCXGR_","_OCXRUL_",1"
+18 ;;R^"860.8:",100,37
+19 ;;D^T+; D SETAP(OCXGR_")","860.712","Relation",OCXREL,.OCXDATA,OCXREL)
+20 ;;R^"860.8:",100,38
+21 ;;D^T-; D SETAP(OCXGR_")","860.712",.OCXDATA,OCXREL)
+22 ;;R^"860.8:",100,39
+23 ;;D^ ; ;
+24 ;;R^"860.8:",100,40
+25 ;;D^ ; S OCXELE=0 F S OCXELE=$O(^OCXS(860.2,OCXRUL,"C","C",OCXELE)) Q:'OCXELE D
+26 ;;R^"860.8:",100,41
+27 ;;D^ ; .;
+28 ;;R^"860.8:",100,42
+29 ;;D^ ; .N OCXGR1
+30 ;;R^"860.8:",100,43
+31 ;;D^ ; .S OCXGR1=OCXGR_","_OCXREL_",1"
+32 ;;R^"860.8:",100,44
+33 ;;D^ ; .K OCXDATA
+34 ;;R^"860.8:",100,45
+35 ;;D^ ; .S OCXDATA(OCXELE,0)=OCXELE
+36 ;;R^"860.8:",100,46
+37 ;;D^ ; .S OCXDATA(OCXELE,"TIME")=OCXTIME
+38 ;;R^"860.8:",100,47
+39 ;;D^ ; .S OCXDATA(OCXELE,"LOG")=$G(OCXOLOG)
+40 ;;R^"860.8:",100,48
+41 ;;D^ ; .S OCXDATA("B",OCXELE,OCXELE)=""
+42 ;;R^"860.8:",100,49
+43 ;;D^ ; .K ^OCXD(860.7,OCXDFN,1,OCXRUL,1,OCXREL,1,OCXELE)
+44 ;;R^"860.8:",100,50
+45 ;;D^T+; .D SETAP(OCXGR1_")","860.7122P","Element",$P($G(^OCXS(860.3,OCXELE,0)),U,1),.OCXDATA,OCXELE)
+46 ;;R^"860.8:",100,51
+47 ;;D^T-; .D SETAP(OCXGR1_")","860.7122P",.OCXDATA,OCXELE)
+48 ;;R^"860.8:",100,52
+49 ;;D^ ; .;
+50 ;;R^"860.8:",100,53
+51 ;;D^ ; .S OCXDFI=0 F S OCXDFI=$O(^TMP("OCXCHK",$J,OCXDFN,OCXELE,OCXDFI)) Q:'OCXDFI D
+52 ;;R^"860.8:",100,54
+53 ;;D^ ; ..N OCXGR2
+54 ;;R^"860.8:",100,55
+55 ;;D^ ; ..S OCXGR2=OCXGR1_","_OCXELE_",1"
+56 ;;R^"860.8:",100,56
+57 ;;D^ ; ..K OCXDATA
+58 ;;R^"860.8:",100,57
+59 ;;D^ ; ..S OCXDATA(OCXDFI,0)=OCXDFI
+60 ;;R^"860.8:",100,58
+61 ;;D^ ; ..S OCXDATA(OCXDFI,"VAL")=^TMP("OCXCHK",$J,OCXDFN,OCXELE,OCXDFI)
+62 ;;R^"860.8:",100,59
+63 ;;D^ ; ..S OCXDATA("B",OCXDFI,OCXDFI)=""
+64 ;;R^"860.8:",100,60
+65 ;;D^T+; ..D SETAP(OCXGR2_")","860.71223P","Data Field",$P($G(^OCXS(860.4,OCXDFI,0)),U,1),.OCXDATA,OCXDFI)
+66 ;;R^"860.8:",100,61
+67 ;;D^T-; ..D SETAP(OCXGR2_")","860.71223P",.OCXDATA,OCXDFI)
+68 ;;R^"860.8:",100,62
+69 ;;D^ ; ;
+70 ;;R^"860.8:",100,63
+71 ;;D^ ; Q 1
+72 ;;R^"860.8:",100,64
+73 ;;D^ ; ;
+74 ;;R^"860.8:",100,65
+75 ;;D^T+;SETAP(ROOT,DD,ITEM,ITEMNAME,DATA,DA) ; Set Rule Event data
+76 ;;R^"860.8:",100,66
+77 ;;D^T-;SETAP(ROOT,DD,DATA,DA) ; Set Rule Event data
+78 ;;R^"860.8:",100,67
+79 ;;D^ ; M @ROOT=DATA
+80 ;;R^"860.8:",100,68
+81 ;;D^ ; I +$G(DD) S @ROOT@(0)="^"_($G(DD))_"^"_($P($G(@ROOT@(0)),U,3)+1)_"^"_$G(DA)
+82 ;;R^"860.8:",100,69
+83 ;;D^ ; I '$G(DD) S $P(@ROOT@(0),U,3,4)=($P($G(@ROOT@(0)),U,3)+1)_"^"_$G(DA)
+84 ;;R^"860.8:",100,70
+85 ;;D^T+; W:$G(OCXTRACE) !,"File Active Data ",$G(ITEM),": ",$G(ITEMNAME)
+86 ;;R^"860.8:",100,71
+87 ;;D^ ; ;
+88 ;;R^"860.8:",100,72
+89 ;;D^ ; Q
+90 ;;R^"860.8:",100,73
+91 ;;D^ ; ;
+92 ;;R^"860.8:",100,74
+93 ;;D^ ; ;
+94 ;;EOR^
+95 ;;KEY^860.8:^OPIOID MEDICATIONS
+96 ;;R^"860.8:",.01,"E"
+97 ;;D^OPIOID MEDICATIONS
+98 ;;R^"860.8:",.02,"E"
+99 ;;D^OPIOID
+100 ;;R^"860.8:",1,1
+101 ;;D^If the patient is currently receiving "active" medications in the opioid
+102 ;;R^"860.8:",1,2
+103 ;;D^VA drug classes CN101 or CN102, this function returns a "1" and list of
+104 ;;R^"860.8:",1,3
+105 ;;D^the opioid medications in the following format:
+106 ;;R^"860.8:",1,4
+107 ;;D^
+108 ;;R^"860.8:",1,5
+109 ;;D^ 1^drug order text 1, drug order text 2, drug order text 3, ...
+110 ;;R^"860.8:",1,6
+111 ;;D^
+112 ;;R^"860.8:",1,7
+113 ;;D^[Note: The drug order text is truncated to the first 25 characters.]
+114 ;;R^"860.8:",1,8
+115 ;;D^
+116 ;;R^"860.8:",1,9
+117 ;;D^If the patient is not currently receiving opioid medications, a zero (0)
+118 ;;R^"860.8:",1,10
+119 ;;D^is returned.
+120 ;;R^"860.8:",100,1
+121 ;;D^ ;OPIOID(ORPT) ;determine if pat is receiving opioid med
+122 ;;R^"860.8:",100,2
+123 ;;D^ ; ; rtn 1^opioid drug 1, opioid drug 2, opioid drug3, ...
+124 ;;R^"860.8:",100,3
+125 ;;D^ ; N ORDG,ORTN,ORNUM,ORDI,ORDCLAS,ORDERS,ORTEXT,DUP,DUPI,DUPJ,DUPLEN
+126 ;;R^"860.8:",100,4
+127 ;;D^ ; S ORDG=0,ORTN=0,DUPI=0,DUPLEN=20
+128 ;;R^"860.8:",100,5
+129 ;;D^ ; K ^TMP("ORR",$J)
+130 ;;R^"860.8:",100,6
+131 ;;D^ ; S ORDG=$O(^ORD(100.98,"B","RX",ORDG))
+132 ;;R^"860.8:",100,7
+133 ;;D^ ; D EN^ORQ1(ORPT_";DPT(",ORDG,2,"","","",0,0)
+134 ;;R^"860.8:",100,8
+135 ;;D^ ; N J,HOR,SEQ,X S J=1,HOR=0,SEQ=0
+136 ;;R^"860.8:",100,9
+137 ;;D^ ; S HOR=$O(^TMP("ORR",$J,HOR)) Q:+HOR<1 ORTN
+138 ;;R^"860.8:",100,10
+139 ;;D^ ; F S SEQ=$O(^TMP("ORR",$J,HOR,SEQ)) Q:+SEQ<1 D
+140 ;;R^"860.8:",100,11
+141 ;;D^ ; .S X=^TMP("ORR",$J,HOR,SEQ)
+142 ;;R^"860.8:",100,12
+143 ;;D^ ; .S ORNUM=+$P(X,";")
+144 ;;R^"860.8:",100,13
+145 ;;D^ ; .Q:ORNUM=+$G(ORIFN) ;quit if dup med order # = current order #
+146 ;;R^"860.8:",100,14
+147 ;;D^ ; .S ORDI=$$VALUE^ORCSAVE2(ORNUM,"DRUG")
+148 ;;R^"860.8:",100,15
+149 ;;D^ ; .I +$G(ORDI)>0 D
+150 ;;R^"860.8:",100,16
+151 ;;D^ ; ..S ORDCLAS=$P(^PSDRUG(ORDI,0),U,2) ;va drug class
+152 ;;R^"860.8:",100,17
+153 ;;D^ ; ..I ($G(ORDCLAS)="CN101")!($G(ORDCLAS)="CN102") D ;opioid classes
+154 ;;R^"860.8:",100,18
+155 ;;D^ ; ...S ORTEXT=$$FULLTEXT^ORQOR1(ORNUM)
+156 ;;R^"860.8:",100,19
+157 ;;D^ ; ...S ORTEXT=$P(ORTEXT,U)_" ["_$P(ORTEXT,U,2)_"]"
+158 ;;R^"860.8:",100,20
+159 ;;D^ ; ...S DUPI=DUPI+1,DUP(DUPI)=" ["_DUPI_"] "_ORTEXT
+160 ;;R^"860.8:",100,21
+161 ;;D^ ; ...S ORTN=1
+162 ;;R^"860.8:",100,22
+163 ;;D^ ; I DUPI>0 D
+164 ;;R^"860.8:",100,23
+165 ;;D^ ; .S DUPLEN=$P(215/DUPI,".")
+166 ;;R^"860.8:",100,24
+167 ;;D^ ; .F DUPJ=1:1:DUPI D
+168 ;;R^"860.8:",100,25
+169 ;;D^ ; ..I DUPJ=1 S ORDERS=$E(DUP(DUPJ),1,DUPLEN)
+170 ;;R^"860.8:",100,26
+171 ;;D^ ; ..E S ORDERS=ORDERS_", "_$E(DUP(DUPJ),1,DUPLEN)
+172 ;;R^"860.8:",100,27
+173 ;;D^ ; K ^TMP("ORR",$J)
+174 ;;R^"860.8:",100,28
+175 ;;D^ ; Q ORTN_U_$G(ORDERS)
+176 ;;R^"860.8:",100,29
+177 ;;D^ ; ;
+178 ;;EOR^
+179 ;;KEY^860.8:^RETURN POINTED TO VALUE
+180 ;;R^"860.8:",.01,"E"
+181 ;;D^RETURN POINTED TO VALUE
+182 ;;R^"860.8:",.02,"E"
+183 ;;D^POINTER
+184 ;;R^"860.8:",1,1
+185 ;;D^ ;POINTER(OCXFILE,D0) ; This Local Extrinsic Function gets the value of the name field
+186 ;;R^"860.8:",1,2
+187 ;;D^ ; ; of record D0 in file OCXFILE
+188 ;;R^"860.8:",100,1
+189 ;;D^ ;POINTER(OCXFILE,D0) ; This Local Extrinsic Function gets the value of the name field
+190 ;;R^"860.8:",100,2
+191 ;;D^ ; ; of record D0 in file OCXFILE
+192 ;;R^"860.8:",100,3
+193 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," FILE: ",$G(OCXFILE)," D0: ",$G(D0)
+194 ;;R^"860.8:",100,4
+195 ;;D^ ; Q:'$G(D0) "" Q:'$L($G(OCXFILE)) ""
+196 ;;R^"860.8:",100,5
+197 ;;D^ ; N GLREF
+198 ;;R^"860.8:",100,6
+199 ;;D^ ; I '(OCXFILE=(+OCXFILE)) S GLREF=U_OCXFILE
+200 ;;R^"860.8:",100,7
+201 ;;D^ ; E S GLREF=$$FILE^OCXBDTD(+OCXFILE,"GLOBAL NAME") Q:'$L(GLREF) ""
+202 ;;R^"860.8:",100,8
+203 ;;D^T+; I $G(OCXTRACE) W !,"%%%%",?20," GLREF: ",GLREF," RESOLVES TO: ",$P($G(@(GLREF_(+D0)_",0)")),U,1)
+204 ;;R^"860.8:",100,9
+205 ;;D^ ; Q $P($G(@(GLREF_(+D0)_",0)")),U,1)
+206 ;;R^"860.8:",100,10
+207 ;;D^ ; ;
+208 ;;EOR^
+209 ;;KEY^860.8:^STRING CONTAINS ONE OF A LIST OF VALUES
+210 ;;R^"860.8:",.01,"E"
+211 ;1;
+212 ;