source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXOED12.m@ 1383

Last change on this file since 1383 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1OCXOED12 ;SLC/RJS,CLA - Rule Editor (Data Field Options) ;3/22/01 10:46
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,105**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5 ;
6S ;
7 ;
8 Q
9EN(OCXD0,OCXRD,OCXACT) ;
10 ;
11 ;
12 N OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN
13 ;
14 S OCXTNLN=$C(27,91,48,109),OCXTRLN=$C(27,91,55,109),OCXTULN=$C(27,91,52,109),OCXTHLN=$C(27,91,49,109)
15 ;
16 S OCXOPT=$$GETOPT^OCXOEDT(.OCXACT) Q:(OCXOPT=U) 1 X:$L(OCXOPT) OCXOPT
17 ;
18 Q:'$D(^OCXS(860.4,OCXD0)) 1
19 ;
20 Q 0
21 ;
22 ;
23EDIT(OCXD0) ;
24 N X S X=$$DIE("^OCXS(860.4,",OCXD0,".01;1")
25 Q
26 ;
27EDLINK(OCXD1,OCXSRC) ;
28 ;
29 D EN^OCXOED13(OCXD1,OCXSRC)
30 Q
31 ;
32LOPT(OCXMODE,OCXD0) ;
33 ;
34 N OCXD1,OCXLINK,OCXSRC
35 ;
36 I OCXMODE="ADD" D Q
37 .S:'$D(^OCXS(860.4,OCXD0,"LINK",0)) ^OCXS(860.4,OCXD0,"LINK",0)="^860.41P^^"
38 .S OCXD1=+$$DIC("^OCXS(860.6,","AEMQL","Data Context: ") Q:'OCXD1
39 .S OCXSRC=+$$DIC("^OCXS(860.5,","AEMQL"," Data Source: ") Q:'OCXSRC
40 .S OCXLINK=$G(^OCXS(860.4,OCXD0,"LINK",OCXD1,"DATAPATH"))
41 .S:(OCXLINK[U) OCXLINK=$P(OCXLINK,U,2)
42 .S OCXLINK=$$DIC("^OCXS(863.3,","AEMQL","Link Name: ",OCXLINK) Q:'OCXLINK
43 .S ^OCXS(860.4,OCXD0,"LINK",OCXD1,0)=OCXD1_U_OCXSRC
44 .S ^OCXS(860.4,OCXD0,"LINK",OCXD1,"DATAPATH")=$P(OCXLINK,U,2)
45 .S ^OCXS(860.4,OCXD0,"LINK","B",OCXD1,OCXD1)=""
46 .D EN^OCXOED13($P(OCXLINK,U,2),OCXD1)
47 I OCXMODE="DEL" D Q
48 .S:'$D(^OCXS(860.4,OCXD0,"LINK",0)) ^OCXS(860.4,OCXD0,"LINK",0)="^860.41P^^"
49 .N OCXD1,DA S DA(1)=OCXD0,OCXD1=+$$DIC("^OCXS(860.4,"_(+OCXD0)_",""LINK"",","AEMQ","Select Data Source to delete: ") Q:'OCXD1
50 .Q:'$$READ("Y","Are you sure you want to Delete ?","YES")
51 .Q:'$$DIE("^OCXS(860.4,"_(+OCXD0)_",""LINK"",",OCXD1,"S DA(1)="_(+OCXD0)_";.01///@")
52 .W !!,"Deleted..." H 1
53 Q
54 ;
55ADDLINK(OCXD0,OCXSRC) ;
56 ;
57 N OCXD1,OCXLINK,OCXX,DA
58 ;
59 S ^OCXS(860.4,OCXD0,"LINK",OCXD1,0)=OCXD1
60 S ^OCXS(860.4,OCXD0,"LINK",OCXD1,"DATAPATH")=OCXLINK
61 S ^OCXS(860.4,OCXD0,"LINK","B",OCXD1,OCXD1)=""
62 D EN^OCXOED13(OCXLINK,OCXD1)
63 Q
64 ;
65COMP ;
66 D ^OCXOCMP
67 Q
68 ;
69 ;
70READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
71 N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
72 Q:'$L($G(OCXZ0)) U
73 S DIR(0)=OCXZ0
74 S:$L($G(OCXZA)) DIR("A")=OCXZA
75 S:$L($G(OCXZB)) DIR("B")=OCXZB
76 F OCXLINE=1:1:($G(OCXZL)-1) W !
77 D ^DIR
78 I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
79 Q Y
80 ;
81DIE(DIE,DA,DR) ;
82 ;
83 D RM(IOM) N DUOUT,DTOUT,DIC S DIC=DIE D ^DIE D RM(0) Q:$G(DTOUT) 0 Q:$G(DUOUT) 0 Q 1
84 ;
85RM(X) X ^%ZOSF("RM") Q
86 ;
87DIC(OCXDIC,OCXDIC0,OCXDICA,OCXDICB,OCXX,OCXDICS,OCXDR,DA) ;
88 ;
89 N DIC,X,Y
90 S DIC=$G(OCXDIC) Q:'$L(DIC) -1
91 S DIC(0)=$G(OCXDIC0) S:$L($G(OCXX)) X=OCXX
92 S:$L($G(OCXDICS)) DIC("S")=OCXDICS
93 S:$L($G(OCXDICA)) DIC("A")=OCXDICA
94 S:$L($G(OCXDICB)) DIC("B")=OCXDICB
95 S:$L($G(OCXDR)) DIC("DR")=OCXDR
96 D ^DIC Q:(Y<1) 0 Q Y
97 ;
98SCREEN(TEXT,FLDNAME) ;
99 ;
100 Q:'($G(TEXT)["|") TEXT
101 W !!,$G(FLDNAME)," Embedded Data Field Check..."
102 N DF,DFIEN,PTR,WARN,NODE0,NODE1
103 S WARN=0 F PTR=2:2:$L(TEXT,"|") S DF=$P(TEXT,"|",PTR) S:DF["." DF=$P(DF,".",2) D
104 .S DFIEN=0 F S DFIEN=$O(^OCXS(860.4,"B",$E(DF,1,30),DFIEN)) Q:'DFIEN Q:($P($G(^OCXS(860.4,DFIEN,0)),U,1)=DF)
105 .S:'DFIEN DFIEN=$O(^OCXS(860.4,"C",DF,0))
106 .S NODE0=$G(^OCXS(860.4,+DFIEN,0)),NODE1=$G(^OCXS(860.4,+DFIEN,1))
107 .;
108 .I 'DFIEN!'$L(NODE0) D Q:'DFIEN
109 ..N NEWVAL
110 ..S NEWVAL="",DFIEN=0,WARN=1 W !,$C(7),"Warning: Data Field '",DF,"'",!," is not in Data Field File."
111 ..Q:'$$READ("Y","Do you want to substitute another field ?","YES")
112 ..S DFIEN=+$$DIC("^OCXS(860.4,","AEMQ","Data Field: ") Q:'DFIEN
113 ..S NODE0=$G(^OCXS(860.4,+DFIEN,0)),NODE1=$G(^OCXS(860.4,+DFIEN,1))
114 ..I $L($P(NODE1,U,1)) S NEWVAL=$P(NODE1,U,1)
115 ..I '$L(NEWVAL),$L($P(NODE0,U,1)) S NEWVAL=$P(NODE0,U,1)
116 ..I $L(NEWVAL) S:($P(TEXT,"|",PTR)[".") NEWVAL=$P($P(TEXT,"|",PTR),".",1)_"."_NEWVAL S $P(TEXT,"|",PTR)=NEWVAL
117 .;
118 .W !,$J(DFIEN,5)
119 .W ?10,$E($P(NODE1,U,1),1,20)
120 .W ?31,$E($P(NODE0,U,1),1,40)
121 .W $S(($L($P(NODE0,U,1))>40):"...",1:"")
122 I 'WARN W !!,"Everything OK !!" H 1
123 Q TEXT
124 ;
Note: See TracBrowser for help on using the repository browser.