source: WorldVistAEHR/trunk/r/HINQ-DVB--DVBA--DVBE--DVBC/DVBHCE.m@ 862

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

revised back to 6/30/08 version

File size: 8.5 KB
Line 
1DVBHCE ; GENERATED FROM 'DVBHINQ UPDATE' INPUT TEMPLATE(#960), FILE 2;12/27/07
2 D DE G BEGIN
3DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
4 I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,4) S:%]"" DE(23)=% S %=$P(%Z,U,5) S:%]"" DE(21)=% S %=$P(%Z,U,6) S:%]"" DE(19)=% S %=$P(%Z,U,7) S:%]"" DE(20)=% S %=$P(%Z,U,8) S:%]"" DE(24)=%
5 K %Z Q
6 ;
7W W !?DL+DL-2,DLB_": "
8 Q
9O D W W Y W:$X>45 !?9
10 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
11 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
12TR R X:DTIME E S (DTOUT,X)=U W $C(7)
13 Q
14A K DQ(DQ) S DQ=DQ+1
15B G @DQ
16RE G PR:$D(DE(DQ)) D W,TR
17N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
18RD G QS:X?."?" I X["^" D D G ^DIE17
19 I X="@" D D G Z^DIE2
20 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
21T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
22 K DDER G X
23P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
24 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
25 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
26V D @("X"_DQ) K YS
27Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
28X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
29 S X="?BAD"
30QS S DZ=X D D,QQ^DIEQ G B
31D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
32Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
33PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
34R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
35 I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
36 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
37RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
38I I DV'["I",DV'["#" G RD
39 D E^DIE0 G RD:$D(X),PR
40 Q
41SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
42 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
43 D ^DIR I 'DDER S %=Y(0),X=Y
44 Q
45SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
47 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
48 Q
49NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
50KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
51BEGIN S DNM="DVBHCE",DQ=1
52 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
53 M DIEZAR=^DIE(960,"AR") S DICRREC="TRIG^DIE17"
54 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=960,U="^"
551 S DQ=2 ;@101
562 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
57X2 W @$S('$D(IOF):"#",IOF="":"#",1:IOF),! K ^UTILITY($J) D ^DVBHSVER
58 Q
593 S DQ=4 ;@7
604 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
61X4 D Q^DVBHUTIL
62 Q
635 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
64X5 S DIE("NO^")=""
65 Q
666 S DQ=7 ;@1001
677 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
68X7 D ^DVBHS1 S Y="@5"
69 Q
708 S DQ=9 ;@1
719 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
72X9 D ^DVBHS2 S Y="@5" W !
73 Q
7410 S DQ=11 ;@2
7511 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
76X11 D ^DVBHS3 S Y="@5"
77 Q
7812 S DQ=13 ;@3
7913 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
80X13 D ^DVBHS4 S Y="@5"
81 Q
8214 S DQ=15 ;@1006
8315 S DQ=16 ;@30
8416 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
85X16 I Z2'[1 S Y="@32"
86 Q
8717 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
88X17 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[LAST]",DVBOFF X DVBLIT1
89 Q
9018 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
91X18 S DVBJC=$S('$D(^DPT(DFN,.32)):"",1:$P(^(0),U,5))
92 Q
9319 S DW=".32;6",DV="RDX",DU="",DLB="L-EOD",DIFLD=.326
94 S DE(DW)="C19^DVBHCE",DE(DW,"INDEX")=1
95 G RE
96C19 G C19S:$D(DE(19))[0 K DB
97 S X=DE(19),DIC=DIE
98 ;
99 S X=DE(19),DIC=DIE
100 D EVENT^IVMPLOG(DA)
101 S X=DE(19),DIC=DIE
102 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
103C19S S X="" G:DG(DQ)=X C19F1 K DB
104 S X=DG(DQ),DIC=DIE
105 ;
106 S X=DG(DQ),DIC=DIE
107 D EVENT^IVMPLOG(DA)
108 S X=DG(DQ),DIC=DIE
109 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
110C19F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
111 F DIXR=648 S DIEZRXR(2,DIXR)=""
112 Q
113X19 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SV^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,0,"MSL") X I $D(X) S DGFRDT=X I $D(^DG(43,1)) S SD1=1 D POS^DGINP
114 Q
115 ;
11620 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".32;7",DV="RDX",DU="",DLB="L-RAD",DIFLD=.327
117 S DE(DW)="C20^DVBHCE",DE(DW,"INDEX")=1
118 G RE
119C20 G C20S:$D(DE(20))[0 K DB
120 S X=DE(20),DIC=DIE
121 D EVENT^IVMPLOG(DA)
122 S X=DE(20),DIC=DIE
123 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
124C20S S X="" G:DG(DQ)=X C20F1 K DB
125 S X=DG(DQ),DIC=DIE
126 D EVENT^IVMPLOG(DA)
127 S X=DG(DQ),DIC=DIE
128 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
129C20F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
130 F DIXR=303,648 S DIEZRXR(2,DIXR)=""
131 Q
132X20 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) S DFN=DA D SV^DGLOCK I $D(X) K:'$$VALMSE^DGRPMS(DFN,X,1,"MSL") X I $D(X),$D(^DG(43,1)) S SD1=1 D PS^DGINP
133 Q
134 ;
13521 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW=".32;5",DV="P23'X",DU="",DLB="L-Bran.. Ser.",DIFLD=.325
136 S DE(DW)="C21^DVBHCE",DE(DW,"INDEX")=1
137 S DU="DIC(23,"
138 G RE
139C21 G C21S:$D(DE(21))[0 K DB
140 S X=DE(21),DIC=DIE
141 S A1B2TAG="PAT" D ^A1B2XFR
142 S X=DE(21),DIC=DIE
143 I $P($G(^DPT(DA,.321)),U,14)]"" D FVP^DGRPMS
144 S X=DE(21),DIC=DIE
145 D EVENT^IVMPLOG(DA)
146 S X=DE(21),DIC=DIE
147 X "S DGXRF=.325 D ^DGDDC Q"
148C21S S X="" G:DG(DQ)=X C21F1 K DB
149 S X=DG(DQ),DIC=DIE
150 S A1B2TAG="PAT" D ^A1B2XFR
151 S X=DG(DQ),DIC=DIE
152 ;
153 S X=DG(DQ),DIC=DIE
154 D EVENT^IVMPLOG(DA)
155 S X=DG(DQ),DIC=DIE
156 ;
157C21F1 N X,X1,X2 S DIXR=408 D C21X1(U) K X2 M X2=X D C21X1("O") K X1 M X1=X
158 D
159 . N DIEXARR M DIEXARR=X S DIEZCOND=1
160 . S X=X2(1)=""
161 . S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
162 . D DELMSE^DGRPMS(DA,1)
163 G C21F2
164C21X1(DION) K X
165 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.325,DION),$P($G(^DPT(DA,.32)),U,5))
166 S X=$G(X(1))
167 Q
168C21F2 Q
169X21 S DFN=DA K:X=$O(^DIC(23,"B","B.E.C.","")) X I $D(X) D SV^DGLOCK S DGCOMBR=$G(Y) Q
170 Q
171 ;
17222 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
173X22 I X'=DVBJC S DVBJ2=1
174 Q
17523 D:$D(DG)>9 F^DIE17,DE S DQ=23,DW=".32;4",DV="RP25'X",DU="",DLB="L-Char. Ser.",DIFLD=.324
176 S DE(DW)="C23^DVBHCE"
177 S DU="DIC(25,"
178 G RE
179C23 G C23S:$D(DE(23))[0 K DB
180 S X=DE(23),DIC=DIE
181 D EVENT^IVMPLOG(DA)
182C23S S X="" G:DG(DQ)=X C23F1 K DB
183 S X=DG(DQ),DIC=DIE
184 D EVENT^IVMPLOG(DA)
185C23F1 Q
186X23 S DFN=DA I $D(X) D SV^DGLOCK Q
187 Q
188 ;
18924 D:$D(DG)>9 F^DIE17,DE S DQ=24,DW=".32;8",DV="FX",DU="",DLB="L-Ser. Num.",DIFLD=.328
190 S DE(DW)="C24^DVBHCE"
191 G RE
192C24 G C24S:$D(DE(24))[0 K DB
193 D ^DVBHCE1
194C24S S X="" G:DG(DQ)=X C24F1 K DB
195 D ^DVBHCE2
196C24F1 Q
197X24 S DFN=DA D SV^DGLOCK I $D(X) S:X?1"SS".E L=$S($D(^DPT(DA,0)):$P(^(0),U,9),1:X) W:X?1"SS".E " ",L S:X?1"SS".E X=L K:$L(X)>15!($L(X)<1)!'(X?.N) X
198 I $D(X),X'?.ANP K X
199 Q
200 ;
20125 S DQ=26 ;@32
20226 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
203X26 I Z2'[2 S Y="@31"
204 Q
20527 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
206X27 I '$D(^DPT(D0,.32)) W !!,*7,?17,DVBON,"No Last episode can't edit NTLast <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S Y="@33"
207 Q
20828 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
209X28 I $P(^DPT(D0,.32),U,6)="" W !!,*7,?17,DVBON,"No last episode can't edit NTLast <RET>",DVBOFF X DVBLIT1 R DVBZ:DTIME K DVBZ S Y="@33"
210 Q
21129 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
212X29 S DVBSCR=1 D ^DVBHS4 W !,?34,DVBON,"[NTLAST]",DVBOFF X DVBLIT1
213 Q
21430 D:$D(DG)>9 F^DIE17 G ^DVBHCE3
Note: See TracBrowser for help on using the repository browser.