source: FOIAVistA/trunk/r/AUTOMATED_MED_INFO_EXCHANGE-DVBA-DVBC/DVBAXA.m@ 1354

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

initial load of FOIAVistA 6/30/08 version

File size: 8.5 KB
Line 
1DVBAXA ; GENERATED FROM 'DVBA C ADD 2507 PAT' INPUT TEMPLATE(#965), FILE 2;06/08/01
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(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(4)=% S %=$P(%Z,U,2) S:%]"" DE(5)=% S %=$P(%Z,U,9) S:%]"" DE(6)=%
5 I $D(^(.3)) S %Z=^(.3) S %=$P(%Z,U,1) S:%]"" DE(9)=% S %=$P(%Z,U,2) S:%]"" DE(10)=%
6 I $D(^(.31)) S %Z=^(.31) S %=$P(%Z,U,3) S:%]"" DE(7)=% S %=$P(%Z,U,4) S:%]"" DE(8)=%
7 K %Z Q
8 ;
9W W !?DL+DL-2,DLB_": "
10 Q
11O D W W Y W:$X>45 !?9
12 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
13 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
14TR R X:DTIME E S (DTOUT,X)=U W $C(7)
15 Q
16A K DQ(DQ) S DQ=DQ+1
17B G @DQ
18RE G PR:$D(DE(DQ)) D W,TR
19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
20RD G QS:X?."?" I X["^" D D G ^DIE17
21 I X="@" D D G Z^DIE2
22 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
23T 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
24 K DDER G X
25P 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
26 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
27 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
28V D @("X"_DQ) K YS
29Z 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
30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
31 S X="?BAD"
32QS S DZ=X D D,QQ^DIEQ G B
33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
36R 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
37 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
38 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
40I I DV'["I",DV'["#" G RD
41 D E^DIE0 G RD:$D(X),PR
42 Q
43SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
44 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
45 D ^DIR I 'DDER S %=Y(0),X=Y
46 Q
47SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
48 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
49 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
50 Q
51NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
53BEGIN S DNM="DVBAXA",DQ=1
54 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
55 M DIEZAR=^DIE(965,"AR") S DICRREC="TRIG^DIE17"
56 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=965,U="^"
571 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 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
58X1 S DVBACPLT=0 I '$D(IOF) S IOP="HOME" D ^%ZIS K IOP
59 Q
602 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
61X2 W @IOF,!,"Please review previous information entered as well as",!,"entering additional REQUIRED information:",!!!
62 Q
633 S DQ=4 ;@1
644 S DW="0;1",DV="RFX",DU="",DLB="NAME",DIFLD=.01
65 S DE(DW)="C4^DVBAXA",DE(DW,"INDEX")=1
66 G RE
67C4 G C4S:$D(DE(4))[0 K DB
68 S X=DE(4),DIC=DIE
69 K ^DPT("B",$E(X,1,30),DA)
70 S X=DE(4),DIC=DIE
71 X "Q:$P(^DPT(DA,0),U,9)']"""" K ^DPT(""BS5"",$E(X,1)_$E($P(^(0),U,9),6,9),DA)"
72 S X=DE(4),DIC=DIE
73 D EVENT^IVMPLOG(DA)
74 S X=DE(4),DIC=DIE
75 S A1B2TAG="PAT" D ^A1B2XFR
76 S X=DE(4),DIC=DIE
77 X "S DFN=DA D ^DGPATN K DGNEWVAL Q"
78 S X=DE(4),DIC=DIE
79 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
80 S X=DE(4),DIC=DIE
81 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".01;" D AVAFC^VAFCDD01(DA)
82 S X=DE(4),DIC=DIE
83 I $T(KILL^VAFCMIS)'="" D KILL^VAFCMIS(DA)
84 S X=DE(4),DIC=DIE
85 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
86C4S S X="" Q:DG(DQ)=X K DB
87 S X=DG(DQ),DIC=DIE
88 S ^DPT("B",$E(X,1,30),DA)=""
89 S X=DG(DQ),DIC=DIE
90 X "Q:$P(^DPT(DA,0),U,9)']"""" S ^DPT(""BS5"",$E(X,1)_$E($P(^(0),U,9),6,9),DA)="""""
91 S X=DG(DQ),DIC=DIE
92 D EVENT^IVMPLOG(DA)
93 S X=DG(DQ),DIC=DIE
94 S A1B2TAG="PAT" D ^A1B2XFR
95 S X=DG(DQ),DIC=DIE
96 X "K DGNEWVAL Q"
97 S X=DG(DQ),DIC=DIE
98 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
99 S X=DG(DQ),DIC=DIE
100 I '$D(DFN),($T(AVAFC^VAFCDD01)'="") S VAFCF=".01;" D AVAFC^VAFCDD01(DA)
101 S X=DG(DQ),DIC=DIE
102 I $T(SET^VAFCMIS)'="" D SET^VAFCMIS(DA)
103 S X=DG(DQ),DIC=DIE
104 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
105C4F1 N X,X1,X2 S DIXR=63 D C4X1(U) K X2 M X2=X D C4X1("O") K X1 M X1=X
106 D
107 . I $T(ZZKILL^MPIFDEL)'="",X2(1)="" D ZZKILL^MPIFDEL(DA,X2(1))
108 K X M X=X2 D
109 . I $T(ZZSET^MPIFDEL)'="",$E(X2(1),1,2)="ZZ" D ZZSET^MPIFDEL(DA,X2(1))
110 G C4F2
111C4X1(DION) K X
112 S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.01,DION),$P($G(^DPT(DA,0)),U,1))
113 S X=$G(X(1))
114 Q
115C4F2 Q
116X4 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3)!(X?1P.E)!(X'?1U.ANP)!(X'[",")!(X[":")!(X[";") X I $D(X) D UP^DGHELP S Y=", " S:$D(X)#2 X=$$CLEAN^DPTLK(X) S DGNEWVAL=X
117 I $D(X),X'?.ANP K X
118 Q
119 ;
1205 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="0;2",DV="RSaR",DU="",DLB="SEX",DIFLD=.02
121 S DE(DW)="C5^DVBAXA"
122 S DU="M:MALE;F:FEMALE;"
123 G RE
124C5 G C5S:$D(DE(5))[0 K DB
125 S X=DE(5),DIC=DIE
126 K ^DPT("ASX",$E(X,1,30),DA)
127 S X=DE(5),DIC=DIE
128 D EVENT^IVMPLOG(DA)
129 S X=DE(5),DIC=DIE
130 S IVMX=X,IVMKILL=2,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX,IVMKILL
131 S X=DE(5),DIC=DIE
132 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".02;" D AVAFC^VAFCDD01(DA)
133 S X=DE(5),DIC=DIE
134 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
135 S X=DE(5),DIIX=2_U_DIFLD D AUDIT^DIET
136C5S S X="" Q:DG(DQ)=X K DB
137 S X=DG(DQ),DIC=DIE
138 S ^DPT("ASX",$E(X,1,30),DA)=""
139 S X=DG(DQ),DIC=DIE
140 D EVENT^IVMPLOG(DA)
141 S X=DG(DQ),DIC=DIE
142 S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
143 S X=DG(DQ),DIC=DIE
144 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".02;" D AVAFC^VAFCDD01(DA)
145 S X=DG(DQ),DIC=DIE
146 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
147 I $D(DE(5))'[0!(^DD(DP,DIFLD,"AUDIT")'="e") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
148 Q
149X5 Q
1506 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW="0;9",DV="RFXaR",DU="",DLB="SOCIAL SECURITY NUMBER",DIFLD=.09
151 S DE(DW)="C6^DVBAXA"
152 G RE
153C6 G C6S:$D(DE(6))[0 K DB
154 S X=DE(6),DIC=DIE
155 K ^DPT("BS",$E(X,6,9),DA)
156 S X=DE(6),DIC=DIE
157 ;
158 S X=DE(6),DIC=DIE
159 K ^DPT("BS5",$E(^DPT(DA,0),1)_$E(X,6,9),DA)
160 S X=DE(6),DIC=DIE
161 S A1B2TAG="PAT" D ^A1B2XFR
162 S X=DE(6),DIC=DIE
163 D KILL^DGREGDD1(DA,.6,0,21,0)
164 S X=DE(6),DIC=DIE
165 D EVENT^IVMPLOG(DA)
166 S X=DE(6),DIC=DIE
167 K ^DPT("SSN",$E(X,1,30),DA)
168 S X=DE(6),DIC=DIE
169 S VADFN=DA D KILL^VADPT6 K VADFN
170 S X=DE(6),DIC=DIE
171 S PPP=X,X="PPPFMX" X ^%ZOSF("TEST") D:$T KNSSN^PPPFMX S X=PPP K PPP
172 S X=DE(6),DIC=DIE
173 S IVMX=X,IVMKILL=9,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX,IVMKILL
174 S X=DE(6),DIC=DIE
175 S PX=X,X="PXXDPT" X ^%ZOSF("TEST") D:$T KILLSSN^PXXDPT S X=PX K PX
176 S X=DE(6),DIC=DIE
177 I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".09;" D AVAFC^VAFCDD01(DA)
178 S X=DE(6),DIC=DIE
179 D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
180 S X=DE(6),DIIX=2_U_DIFLD D AUDIT^DIET
181C6S S X="" Q:DG(DQ)=X K DB
182 D ^DVBAXA1
183 Q
184X6 K:X[""""!($A(X)=45) X I $D(X) S:'$D(DPTX) DFN=DA D SSN^DGINP Q I $L(X)>10
185 I $D(X),X'?.ANP K X
186 Q
187 ;
1887 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW=".31;3",DV="FXOR",DU="",DLB="CLAIM NUMBER",DIFLD=.313
189 S DQ(7,2)="S Y(0)=Y S Y=$E(Y,1,10)"
190 G RE
191X7 S DFN=DA D EV^DGLOCK I $D(X) S 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 I X'=L K:$L(X)>8!($L(X)<7)!'(X?.N) X
192 I $D(X),X'?.ANP K X
193 Q
194 ;
1958 S DW=".31;4",DV="P4'R",DU="",DLB="CLAIM FOLDER LOCATION",DIFLD=.314
196 S DE(DW)="C8^DVBAXA"
197 S DU="DIC(4,"
198 G RE
199C8 G C8S:$D(DE(8))[0 K DB
200 S X=DE(8),DIC=DIE
201 N DGX D CFL4^DGREGDD D KILL^DGREGDD1(DA,.312,.31,2,DGX)
202C8S S X="" Q:DG(DQ)=X K DB
203 D ^DVBAXA2
204 Q
205X8 Q
2069 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW=".3;1",DV="RSXa",DU="",DLB="SERVICE CONNECTED?",DIFLD=.301
207 S DE(DW)="C9^DVBAXA"
208 S DU="Y:YES;N:NO;"
209 G RE
210C9 G C9S:$D(DE(9))[0 K DB
211 D ^DVBAXA3
212C9S S X="" Q:DG(DQ)=X K DB
213 D ^DVBAXA4
214 Q
215X9 S DFN=DA D EV^DGLOCK I $D(X),X="Y" D VET^DGLOCK
216 Q
217 ;
21810 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".3;2",DV="NJ3,0Xa",DU="",DLB="SERVICE CONNECTED PERCENTAGE",DIFLD=.302
219 S DE(DW)="C10^DVBAXA"
220 G RE
221C10 G C10S:$D(DE(10))[0 K DB
222 D ^DVBAXA5
223C10S S X="" Q:DG(DQ)=X K DB
224 D ^DVBAXA6
225 Q
226X10 S DFN=DA D EV^DGLOCK Q:'$D(X) K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X I $D(X),$D(^DPT(DA,.3)),$P(^(.3),U,1)'="Y" W !?4,*7,"Only applies to service-connected applicants." K X
227 Q
228 ;
22911 D:$D(DG)>9 F^DIE17 G ^DVBAXA7
Note: See TracBrowser for help on using the repository browser.