source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXBDT6.m@ 1450

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

initial load of WorldVistAEHR

File size: 6.8 KB
Line 
1OCXBDT6 ;SLC/RJS,CLA - BUILD OCX PACKAGE DIAGNOSTIC ROUTINES (Build Runtime Library Routine OCXDI2) ;8/04/98 13:21
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5EN() ;
6 ;
7 N R,LINE,TEXT,NOW,RUCI,XCM
8 S NOW=$$NOW^OCXBDT3,RUCI=$$CUCI^OCXBDT
9 F LINE=1:1:999 S TEXT=$P($T(TEXT+LINE),";",2,999) Q:TEXT S TEXT=$P(TEXT,";",2,999) S R(LINE,0)=$$CONV^OCXBDT3(TEXT)
10 ;
11 M ^TMP("OCXBDT",$J,"RTN")=R
12 ;
13 S DIE="^TMP(""OCXBDT"","_$J_",""RTN"",",XCN=0,X="OCXDI2"
14 W !,X X ^%ZOSF("SAVE") W " ... ",XCM," Lines filed" K ^TMP("OCXBDT",$J,"RTN")
15 ;
16 Q XCM
17 ;
18TEXT ;
19 ;;OCXDI2 ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC UTILITY ROUTINE ;|NOW|
20 ;;|OCXLIN2|
21 ;;|OCXLIN3|
22 ;; ;
23 ;;S ;
24 ;; ; Record Utilities
25 ;; Q
26 ;; ;
27 ;;ADDREC(OCXCREF) ;
28 ;; ;
29 ;; ;
30 ;; N QUIT,OCXDD,OCXDA,OCXGREF,OCXNAME
31 ;; S OCXDD=$O(@OCXCREF@("")) Q:'OCXDD 0
32 ;; Q:'OCXFLGC 0
33 ;; I (OCXFLGA) S QUIT=$$READ("Y"," Do you want to add a local '"_$$FILENAME^OCXBDTD(+OCXDD)_"' record ?","YES") Q:'QUIT (QUIT[U)
34 ;; ;
35 ;; S OCXDA=0 D CREATE(OCXCREF,OCXDD,.OCXDA,0)
36 ;; S OCXNAME=$G(@OCXCREF@(OCXDD,.01,"E")) S:$L(OCXNAME) ^TMP("OCXDIAG",$J,"A",+OCXDD,OCXNAME)=""
37 ;; ;
38 ;; Q 0
39 ;; ;
40 ;;DELREC(OCXFILE,OCXDA) ;
41 ;; ;
42 ;; ;
43 ;; N QUIT
44 ;; Q:'OCXFLGC 0 Q:$G(OCXAUTO) 0
45 ;; I (OCXFLGA) S QUIT=$$READ("Y"," Do you want to delete the local '"_$$FILENAME^OCXBDTD(+OCXFILE)_"' record ?","YES") Q:'QUIT (QUIT[U)
46 ;; ;
47 ;; W !,OCXFILE," ",OCXDA
48 ;; D DIE(OCXFILE,$$FILE^OCXBDTD(OCXFILE,"GLOBAL NAME"),.01,"@",OCXDA,0)
49 ;; W !!," deleted..."
50 ;; ;
51 ;; Q 0
52 ;; ;
53 ;;DELDUP(OCXFILE,OCXNAME) ;
54 ;; ;
55 ;; ;
56 ;; N OCXQUIT,OCXCGL,OCXOGL,OCXD0,RESP,OCXKEY,KEYLEN,OCXKEEP
57 ;; ;
58 ;; I (OCXFLGR) W !," There are duplicate copies of the '"_$$FILENAME^OCXBDTD(+OCXFILE)_":"_OCXNAME_"' record."
59 ;; I '$G(OCXAUTO),'OCXFLGC Q 0
60 ;; I (OCXFLGA) S RESP=$$READ("Y"," Do you want to purge duplicate copies of the '"_$$FILENAME^OCXBDTD(+OCXFILE)_":"_OCXNAME_"' record ?","YES") Q:'RESP 0 Q:(RESP[U) -10
61 ;; ;
62 ;; S OCXOGL=$$FILE^OCXBDTD(OCXFILE,"GLOBAL NAME")
63 ;; S OCXCGL=$$CREF^DILF(OCXOGL)
64 ;; F KEYLEN=$L(OCXNAME):-1:1 S OCXKEY=$E(OCXNAME,1,KEYLEN) Q:$D(@OCXCGL@("B",OCXKEY))
65 ;; S OCXD0=0 F S OCXD0=$O(@OCXCGL@("B",OCXKEY,OCXD0)) Q:'OCXD0 Q:($P($G(@OCXCGL@(OCXD0,0)),U,1)=OCXNAME)
66 ;; W:OCXFLGR !,"Keep: ",OCXFILE," ",OCXNAME," ",OCXD0
67 ;; S OCXKEEP=OCXD0 F S OCXD0=$O(@OCXCGL@("B",OCXKEY,OCXD0)) Q:'OCXD0 I ($P($G(@OCXCGL@(OCXD0,0)),U,1)=OCXNAME) D
68 ;; .W:OCXFLGR !!,"Delete: ",OCXFILE," ",OCXNAME," ",OCXD0
69 ;; .D DIE(OCXFILE,OCXOGL,.01,"@",OCXD0,0)
70 ;; .W:OCXFLGR " deleted..."
71 ;; ;
72 ;; I ($P($G(@OCXCGL@(OCXKEEP,0)),U,1)=OCXNAME) S ^TMP("OCXDIAG",$J,"A",FILE,OCXNAME)=""
73 ;; ;
74 ;; Q OCXKEEP
75 ;; ;
76 ;;CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
77 ;; ;
78 ;; N OCXFLD,OCXGREF,OCXKEY
79 ;; ;
80 ;; S OCXKEY=@OCXCREF@(OCXDD,.01,"E")
81 ;; S OCXGREF=$$GETREF(+OCXDD,.OCXDA,OCXLVL) Q:'$L(OCXGREF)
82 ;; I 'OCXDA D
83 ;; .S OCXDA=$O(^TMP("OCXDIAG",$J,"B",+OCXDD,OCXKEY,0)) Q:OCXDA
84 ;; .S OCXDA=$O(@(OCXGREF_""" "")"),-1)+1
85 ;; .F OCXDA=OCXDA:1 Q:'$D(@(OCXGREF_OCXDA_",0)"))
86 ;; .I $D(@(OCXGREF_OCXDA_",0)")) S OCXDA=0
87 ;; ;
88 ;; I 'OCXDA W !!,"Error adding record..." Q
89 ;; ;
90 ;; I '$D(@(OCXGREF_"0)")) S @(OCXGREF_"0)")=U_$$FILEHDR^OCXBDTD(+OCXDD)_U_U
91 ;; ;
92 ;; S OCXFLD=0 F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'OCXFLD Q:(OCXFLD[":") I '$$EXFLD^OCXDI1(+OCXDD,OCXFLD) D
93 ;; .I $L($G(@OCXCREF@(OCXDD,OCXFLD,"E"))) D DIE(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
94 ;; .I $O(@OCXCREF@(OCXDD,OCXFLD,0)) D WORD(OCXDD,OCXGREF,OCXFLD,.OCXDA,OCXCREF)
95 ;; ;
96 ;; D PUSH(.OCXDA)
97 ;; S OCXFLD="" F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'$L(OCXFLD) I (OCXFLD[":") D
98 ;; .S OCXDA=$P(OCXFLD,":",2) W:OCXFLGR ! D CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
99 ;; D POP(.OCXDA)
100 ;; Q
101 ;; ;
102 ;;LOADWORD(RREF,OCXDD,OCXFLD,OCXSUB) ;
103 ;; ;
104 ;; N QUIT,DDPATH,INDEX,OCXDA,OCXGREF
105 ;; S DDPATH=$P($P($$APPEND(RREF,OCXDD),"(",2),")",1)
106 ;; F INDEX=1:1:$L(DDPATH,",") S OCXDA($L(DDPATH,",")-INDEX)=+$P($P(DDPATH,",",INDEX),":",2)
107 ;; S OCXDA=$G(OCXDA(0)) K OCXDA(0)
108 ;; Q:'OCXFLGC 0 I OCXFLGA S QUIT=$$READ("Y"," Do you want to reload the local '"_$$FIELD^OCXBDTD(+OCXDD,+OCXFLD,"LABEL")_"' field ?","YES") Q:'QUIT (QUIT[U)
109 ;; S OCXGREF=$$GETREF(+OCXDD,.OCXDA,$L(DDPATH,",")-1) Q:'$L(OCXGREF)
110 ;; D WORD(OCXDD,OCXGREF,OCXFLD,.OCXDA,RREF)
111 ;; Q 0
112 ;; ;
113 ;;GETREF(OCXDD,OCXDA,OCXLVL) ;
114 ;; ;
115 ;; Q:'OCXDD ""
116 ;; ;
117 ;; N OCXIENS,OCXERR,OCXX
118 ;; S OCXIENS=$$IENS^DILF(.OCXDA),OCXERR=""
119 ;; S OCXX=$$ROOT^DILFD(OCXDD,OCXIENS,0,OCXERR)
120 ;; Q OCXX
121 ;; ;
122 ;;WORD(DD,GREF,FLD,DA,RREF) ;
123 ;; ;
124 ;; N SUB,GLROOT,LINE
125 ;; S SUB=$P($$FIELD^OCXBDTD(+DD,FLD,"GLOBAL SUBSCRIPT LOCATION"),";",1) S:'(SUB=+SUB) SUB=""""_SUB_""""
126 ;; S GLROOT=GREF_DA_","_SUB_")" K @GLROOT
127 ;; S LINE=0 F S LINE=$O(@RREF@(DD,FLD,LINE)) Q:'LINE D
128 ;; .S @GLROOT@($O(@GLROOT@(""),-1)+1,0)=@RREF@(DD,FLD,LINE)
129 ;; S LINE=$O(@GLROOT@(""),-1),@GLROOT@(0)=U_U_LINE_U_LINE_U_$$DATE("T")_U
130 ;; ;
131 ;; Q
132 ;; ;
133 ;;DATE(X) N %DT,Y S %DT="" D ^%DT Q +Y
134 ;; ;
135 ;;DIE(OCXDD,OCXDIC,OCXFLD,OCXVAL,OCXDA,OCXLVL) ;
136 ;; ;
137 ;; N DIC,DIE,X,Y,DR,DA,OCXDVAL,OCXPTR,OCXGREF,D0
138 ;; S (D0,DA)=OCXDA,(DIC,DIE)=OCXDIC,DR=""
139 ;; S:OCXLVL D0=OCXDA(1),DR="S DA(1)="_(+D0)_",D0="_(+D0)_";"
140 ;; S:OCXVAL="?" OCXVAL="? "
141 ;; ;
142 ;; I '(OCXVAL="@"),OCXFLGR W !,?(OCXLVL*5),$$FIELD^OCXBDTD(+OCXDD,OCXFLD,"LABEL"),": ",OCXVAL
143 ;; ;
144 ;; I '(OCXVAL="@") D
145 ;; .N OCXIEN,SHORT
146 ;; .S OCXPTR=+$P($$FIELD^OCXBDTD(+OCXDD,OCXFLD,"SPECIFIER"),"P",2)
147 ;; .I 'OCXPTR S DR=DR_OCXFLD_"///^S X=OCXVAL" Q
148 ;; .S OCXGREF="^"_$$FIELD^OCXBDTD(+OCXDD,OCXFLD,"POINTER")
149 ;; .I '($E(OCXGREF,1,4)="^OCX"),'(OCXGREF="^ORD(100.9,"),'(OCXGREF="^ORD(100.8,") Q
150 ;; .S OCXIEN=$$DIC(OCXGREF,OCXVAL,0)
151 ;; .S:'OCXIEN OCXIEN=$$DIC(OCXGREF,OCXVAL,1),^TMP("OCXDIAG",$J,"B",OCXPTR,OCXVAL,OCXIEN)=""
152 ;; .S DR=DR_OCXFLD_"///`"_(+OCXIEN)
153 ;; ;
154 ;; I (OCXVAL="@") S DR=DR_OCXFLD_"///^S X=OCXVAL"
155 ;; S OCXSCR=1
156 ;; D ^DIE
157 ;; ;
158 ;; ; I $D(Y) -> DIE FILER ERROR
159 ;; ;
160 ;; Q
161 ;; ;
162 ;;DIC(DIC,X,OCXADD) S DIC(0)="MX",OCXSCR=1 S:OCXADD DIC(0)="MXL" D ^DIC Q:(+Y>0) +Y Q 0
163 ;; ;
164 ;;PUSH(OCXDA) ;
165 ;; N OCXSUB S OCXSUB="" F S OCXSUB=$O(OCXDA(OCXSUB),-1) Q:'OCXSUB S OCXDA(OCXSUB+1)=OCXDA(OCXSUB)
166 ;; S OCXDA(1)=OCXDA,OCXDA=0
167 ;; Q
168 ;; ;
169 ;;POP(OCXDA) ;
170 ;; N OCXSUB S OCXSUB="" F S OCXSUB=$O(OCXDA(OCXSUB)) Q:'OCXSUB S OCXDA(OCXSUB)=$G(OCXDA(OCXSUB+1))
171 ;; S OCXDA=OCXDA(1) K OCXDA($O(OCXDA(""),-1))
172 ;; Q
173 ;; ;
174 ;;APPEND(ARRAY,OCXSUB) ;
175 ;; S:'(OCXSUB=+OCXSUB) OCXSUB=""""_OCXSUB_""""
176 ;; Q:'(ARRAY["(") ARRAY_"("_OCXSUB_")"
177 ;; Q $E(ARRAY,1,$L(ARRAY)-1)_","_OCXSUB_")"
178 ;; ;
179 ;;READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
180 ;; N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
181 ;; Q:'$L($G(OCXZ0)) U
182 ;; S DIR(0)=OCXZ0
183 ;; S:$L($G(OCXZA)) DIR("A")=OCXZA
184 ;; S:$L($G(OCXZB)) DIR("B")=OCXZB
185 ;; F OCXLINE=1:1:($G(OCXZL)-1) W !
186 ;; D ^DIR
187 ;; I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
188 ;; Q Y
189 ;; ;
190 ;;PAUSE() Q:'OCXFLGC 0 W " Press Enter " R X:DTIME W ! Q (X[U)
191 ;; ;
192 ;;$
193 ;1;
194 ;
Note: See TracBrowser for help on using the repository browser.