DVBHCE19 ; ;07/06/22
D DE G BEGIN
DE S DIE="^DPT(",DIC=DIE,DP=2,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DPT(DA,""))=""
I $D(^(.3)) S %Z=^(.3) S %=$P(%Z,U,2) S:%]"" DE(31)=% S %=$P(%Z,U,5) S:%]"" DE(6)=% S %=$P(%Z,U,14) S:%]"" DE(32)=%
I $D(^(.31)) S %Z=^(.31) S %=$P(%Z,U,4) S:%]"" DE(1)=%
I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,2) S:%]"" DE(13)=%
I $D(^(.321)) S %Z=^(.321) S %=$P(%Z,U,1) S:%]"" DE(19)=%
I $D(^(.362)) S %Z=^(.362) S %=$P(%Z,U,8) S:%]"" DE(58)=% S %=$P(%Z,U,9) S:%]"" DE(64)=% S %=$P(%Z,U,15) S:%]"" DE(46)=% S %=$P(%Z,U,18) S:%]"" DE(52)=%
K %Z Q
;
W W !?DL+DL-2,DLB_": "
Q
O D W W Y W:$X>45 !?9
I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 K X S X("FIELD")=DIFLD,X("FILE")=DP W " ("_$$EZBLD^DIALOG(710,.X)_")" K X S X="" Q ;**
TR Q:DV["K"&(DUZ(0)'="@") R X:DTIME E S (DTOUT,X)=U W $C(7)
Q
A K DQ(DQ) S DQ=DQ+1
B G @DQ
RE G A:DV["K"&(DUZ(0)'["@"),PR:$D(DE(DQ)) D W,TR
N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
RD G QS:X?."?" I X["^" D D G ^DIE17
I X="@" D D G Z^DIE2
I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
T G M^DIE17:DV,^DIE3:DV["V",X:X'?.ANP
I DV["t" D G UNIQ ;EXTENSIBLE DATA TYPES ;p21
.X $S($D(DB(DQ)):$$VALEXTS^DIETLIBF(DP,DIFLD),1:$$VALEXT^DIETLIBF(DP,DIFLD)) K DIPA
I DV["S" D SET^DIED G V:'DDER K DDER G X ;p22
P 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
G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
V D @("X"_DQ) K YS
UNIQ I DV["U",$D(X),DIFLD=.01 K % M %=@(DIE_"""B"",X)") K %(DA) K:$O(%(0)) X
Z 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
X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
S X="?BAD"
QS S DZ=X D D,QQ^DIEQ G B
D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
I DG["t" X $$OUTPUT^DIETLIBF(DP,DIFLD) K DIPA G RP ;p21
R 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
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
X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") I %]"" S Y=$S($G(DUZ("LANG"))'>1:%,'DIFLD:%,1:$$SET^DIQ(DP,DIFLD,Y))
RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
I I DV'["I",DV'["#" G RD
D E^DIE0 G RD:$D(X),PR
Q
SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
Q
NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
BEGIN S DNM="DVBHCE19",DQ=1
1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".31;4",DV="*P4'X",DU="",DIFLD=.314,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C1^DVBHCE19"
S DU="DIC(4,"
S X=+DVBFL
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
C1 G C1S:$D(DE(1))[0 K DB
S X=DE(1),DIC=DIE
D KILL^DGREGDD(DA)
C1S S X="" G:DG(DQ)=X C1F1 K DB
S X=DG(DQ),DIC=DIE
D SET^DGREGDD(DA,X)
C1F1 Q
X1 S DIC("S")="I $$CFLTF^DGREGDD(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
2 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
X2 W "." S JP=JP+1,DVBJ2=1
Q
3 S DQ=4 ;@27
4 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
X4 I $P(Z2,U,JP)'=8 S Y="@50"
Q
5 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
X5 I '$D(DVBEI) S Y="@50",JP=JP+1
Q
6 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW=".3;5",DV="S",DU="",DIFLD=.305,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C6^DVBHCE19"
S DU="Y:YES;N:NO;"
S X=$S(DVBEI="Y":"Y",1:"N")
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
C6 G C6S:$D(DE(6))[0 K DB
S X=DE(6),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(6),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
C6S S X="" G:DG(DQ)=X C6F1 K DB
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DG(DQ),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
C6F1 Q
X6 Q
7 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
X7 W "." S JP=JP+1,DVBJ2=1
Q
8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 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
X8 S Y="@50"
Q
9 S DQ=10 ;@40
10 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 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
X10 I $P(Z2,U,JP)'=1 S Y="@42"
Q
11 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
X11 I '$D(DVBP(6)) S Y="@42",JP=JP+1
Q
12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 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
X12 I $S($P(DVBP(6),U,8)'="Y":1,'$D(^DPT(DFN,.32)):1,+$P(^(0),U,2):1,1:0) S Y="@42",JP=JP+1
Q
13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".32;2",DV="DX",DU="",DIFLD=.322,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S X="T"
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
X13 S %DT="",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK
Q
;
14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 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
X14 W "." S JP=JP+1,DVBJ2=1
Q
15 S DQ=16 ;@42
16 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
X16 I $P(Z2,U,JP)'=2 S Y="@45"
Q
17 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
X17 I '$D(DVBP(6)) S Y="@45",JP=JP+1
Q
18 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
X18 I $P(DVBP(6),U,4)[" " S Y="@45",JP=JP+1
Q
19 S DW=".321;1",DV="RSX",DU="",DIFLD=.32101,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C19^DVBHCE19"
S DU="Y:YES;N:NO;U:UNKNOWN;"
S X=$P(DVBP(6),U,4)
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
C19 G C19S:$D(DE(19))[0 K DB
S X=DE(19),DIC=DIE
;
S X=DE(19),DIC=DIE
;
S X=DE(19),DIC=DIE
D EVENT^IVMPLOG(DA)
C19S S X="" G:DG(DQ)=X C19F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(2,.32101,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,4) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32101,1,1,1.4)
S X=DG(DQ),DIC=DIE
X ^DD(2,.32101,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.321)):^(.321),1:"") S X=$P(Y(1),U,5) S DIU=X K Y S X=DIV S X="" X ^DD(2,.32101,1,2,1.4)
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
C19F1 Q
X19 S DFN=DA D SV^DGLOCK
Q
;
20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 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
X20 W "." S JP=JP+1,DVBJ2=1
Q
21 S DQ=22 ;@45
22 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
X22 I $P(Z2,U,JP)'=3!('$D(DVBDX(1))) S Y="@50"
Q
23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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
X23 S:'$D(DVBFL) DVBFL="UNKNOWN"
Q
24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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
X24 I $D(DVBCAP),DVBCAP["No C&P",$P(DVBBIR,U,5)'="Y" D CHK^DVBHUTIL
Q
25 S DQ=26 ;@47
26 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
X26 S DVB4=$S($D(^DPT(DFN,.3))>0:$P(^(.3),U),1:0),DVB5=$S($D(^DPT(DFN,.36))>0:$P(^(.36),U),1:0),DVB6=$S($D(^DPT(DFN,"VET"))>0:^("VET"),1:0),DVB7=$S($D(^DPT(DFN,"TYPE"))>0:^("TYPE"),1:0)
Q
27 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
X27 S DVB8=$O(^DIC(8,"B","SERVICE CONNECTED 50% to 100%",0)),DVB9=$O(^DIC(8,"B","SC LESS THAN 50%",0))
Q
28 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
X28 I DVBDXNO I ((DVB8'=DVB5&(DVB9'=DVB5))!(DVB4'="Y")!(DVB6'="Y")!(DVB7'=1)) S Y="@70"
Q
29 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
X29 W ! K ^DPT(DFN,.372),JP4,JP6 S ^DPT(DFN,.372,0)="^2.04P^^0",JP=0
Q
30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 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
X30 S $P(^DPT(DFN,.3),U,2)="",$P(^DPT(DFN,.3),U,14)=""
Q
31 D:$D(DG)>9 F^DIE17,DE S DQ=31,DW=".3;2",DV="NJ3,0Xa",DU="",DIFLD=.302,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C31^DVBHCE19"
S X=+$G(DVBDXPCT)
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
C31 G C31S:$D(DE(31))[0 K DB
S X=DE(31),DIC=DIE
;
S X=DE(31),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(31),DIC=DIE
;
S X=DE(31),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA)
S X=DE(31),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(31),DIIX=2_U_DIFLD D AUDIT^DIET
C31S S X="" G:DG(DQ)=X C31F1 K DB
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DG(DQ),DIC=DIE
X "S DFN=DA D EN^DGMTR K DGREQF"
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
I $D(DE(31))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C31F1 Q
X31 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
Q
;
32 D:$D(DG)>9 F^DIE17,DE S DQ=32,DW=".3;14",DV="DX",DU="",DIFLD=.3014,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S X=$G(DVBEFF)
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
X32 S %DT="P" D ^%DT S X=Y K:Y<1!(Y>DT) X
Q
;
33 S DQ=34 ;@46
34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 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
X34 S JP=$O(DVBDX(JP)) I 'JP S Y="@50"
Q
35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 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
X35 S JPP=+$P(DVBDX(JP),U,2) I JPP'>0 S Y="@46"
Q
36 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=36 D X36 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
X36 I '$D(^DIC(31,JPP)) D CHKDIS^DVBHS3 S Y="@46"
Q
37 S D=0 K DE(1) ;.3721
S DIFLD=.3721,DGO="^DVBHCE20",DC="6^2.04P^.372^",DV="2.04MP31'X",DW="0;1",DOW=$$LABEL^DIALOGZ(DP,DIFLD),DLB=$P($$EZBLD^DIALOG(8042,DOW),": ") S:D DC=DC_D
S DU="DIC(31,"
G RE:D I $D(DSC(2.04))#2,$P(DSC(2.04),"I $D(^UTILITY(",1)="" X DSC(2.04) S D=$O(^(0)) S:D="" D=-1 G M37
S D=$S($D(^DPT(DA,.372,0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M37 I D>0 S DC=DC_D I $D(^DPT(DA,.372,+D,0)) S DE(37)=$P(^(0),U,1)
S X="""`"_$P(DVBDX(JP),U,2)_""""
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
R37 D DE
G A
;
38 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=38 D X38 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
X38 W "." S DVBJ2=1
Q
39 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=39 D X39 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
X39 S Y="@46"
Q
40 S DQ=41 ;@61
41 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=41 D X41 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
X41 S Y="@4"
Q
42 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=42 D X42 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
X42 I Z2'[1 S Y="@62"
Q
43 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=43 D X43 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
X43 I '$D(DVBSSA) S Y="@62",JP=JP+1
Q
44 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=44 D X44 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
X44 I DVBSSA S DVBYN="Y",DVBXYN=DVBSSA
Q
45 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=45 D X45 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
X45 I 'DVBSSA S DVBYN="N",DVBXYN=""
Q
46 S DW=".362;15",DV="SX",DU="",DIFLD=.36225,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C46^DVBHCE19"
S DU="Y:YES;N:NO;U:UNKNOWN;"
S X=DVBYN
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
C46 G C46S:$D(DE(46))[0 K DB
S X=DE(46),DIC=DIE
X ^DD(2,.36225,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.36225,1,1,2.4)
C46S S X="" G:DG(DQ)=X C46F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(2,.36225,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.36225,1,1,1.4)
C46F1 Q
X46 S DFN=DA D MV^DGLOCK Q
Q
;
47 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=47 D X47 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
X47 W "." S JP=JP+1,DVBJ2=1 K DVBYN,DVBXYN
Q
48 S DQ=49 ;@62
49 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=49 D X49 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
X49 I Z2'[2 S Y="@63"
Q
50 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=50 D X50 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
X50 I '$D(DVBRETT) S Y="@63",JP=JP+1
Q
51 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=51 D X51 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
X51 I DVBRETT=""!("BMCROX"'[DVBRETT) S Y="@63",JP=JP+1
Q
52 D:$D(DG)>9 F^DIE17,DE S DQ=52,DW=".362;18",DV="SX",DU="",DIFLD=.36285,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="B:BLACK LUNG;M:MILITARY;C:CIVIL;R:RAILROAD;O:OTHER;X:COMBINATIONS OF TYPES;"
S X=DVBRETT
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
X52 S DFN=DA D MV^DGLOCK Q
Q
;
53 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=53 D X53 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
X53 W "." S JP=JP+1,DVBJ2=1
Q
54 S DQ=55 ;@63
55 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=55 D X55 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
X55 I Z2'[3 S Y="@64"
Q
56 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=56 D X56 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
X56 I '$D(DVBRETO) S Y="@64",JP=JP+1
Q
57 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=57 D X57 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
X57 S X=DVBRETO I X=""!(X=0) S X="@"
Q
58 S DW=".362;8",DV="NJ8,2X",DU="",DIFLD=.3628,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S X=X
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
X58 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>99999)!(X<1) X I $D(X) S DFN=DA D MV^DGLOCK
Q
;
59 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=59 D X59 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
X59 W "." S JP=JP+1,DVBJ2=1
Q
60 S DQ=61 ;@64
61 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=61 D X61 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
X61 I Z2'[4 S Y="@1006"
Q
62 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=62 D X62 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
X62 I '$D(DVBOINC) S Y="@1006",JP=JP+1
Q
63 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=63 D X63 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
X63 S X=DVBOINC I X=""!(X=0) S X="@"
Q
64 S DW=".362;9",DV="NJ8,2X",DU="",DIFLD=.3629,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S X=X
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
X64 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>999999)!(X<1) X
Q
;
65 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=65 D X65 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
X65 W "." S JP=JP+1,DVBJ2=1,Y="@1006"
Q
66 S DQ=67 ;@4
67 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=67 D X67 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
X67 S Y=$S(DVBJS=11:"@1",DVBJS=28:"@2",DVBJS=35:"@3",DVBJS=44:"@104",1:"@10")
Q
68 S DQ=69 ;@70
69 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=69 D X69 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
X69 W !!,*7,"HINQ contains SC disabilities, Patient is NSC no updating allowed. Check patient's SERVICE CONNECTION, ELIGIBILITY CODE, VET STATUS, or PATIENT TYPE. Screen 5 contains this."
Q
70 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=70 D X70 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
X70 R !!,?25,"<RET> to continue.",ZZ:DTIME K ZZ,JP3,JP4
Q
71 S DQ=72 ;@50
72 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=72 D X72 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
X72 K DVBJX,JP,JPP S Y=$S(DVBJS=28:"@1",DVBJS=35:"@2",1:"@10")
Q
73 S DQ=74 ;@10
74 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=74 D X74 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
X74 I $G(DVBRADL)]"" D DX^DVBHQEDT(DVBRADL)
Q
75 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=75 D X75 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
X75 K DVBRADL
Q
76 G 0^DIE17
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBHCE19 18056 printed Nov 22, 2024@17:08:15 Page 2
DVBHCE19 ; ;07/06/22
+1 DO DE
GOTO BEGIN
DE SET DIE="^DPT("
SET DIC=DIE
SET DP=2
SET DL=1
SET DIEL=0
SET DU=""
KILL DG,DE,DB
if $ORDER(^DPT(DA,""))=""
QUIT
+1 IF $DATA(^(.3))
SET %Z=^(.3)
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(31)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(6)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(32)=%
+2 IF $DATA(^(.31))
SET %Z=^(.31)
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(1)=%
+3 IF $DATA(^(.32))
SET %Z=^(.32)
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(13)=%
+4 IF $DATA(^(.321))
SET %Z=^(.321)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(19)=%
+5 IF $DATA(^(.362))
SET %Z=^(.362)
SET %=$PIECE(%Z,U,8)
if %]""
SET DE(58)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(64)=%
SET %=$PIECE(%Z,U,15)
if %]""
SET DE(46)=%
SET %=$PIECE(%Z,U,18)
if %]""
SET DE(52)=%
+6 KILL %Z
QUIT
+7 ;
W WRITE !?DL+DL-2,DLB_": "
+1 QUIT
O DO W
WRITE Y
if $X>45
WRITE !?9
+1 IF $LENGTH(Y)>19
IF 'DV
IF DV'["I"
IF (DV["F"!(DV["K"))
GOTO RW^DIR2
+2 ;**
if Y]""
WRITE "// "
IF 'DV
IF DV["I"
IF $DATA(DE(DQ))#2
KILL X
SET X("FIELD")=DIFLD
SET X("FILE")=DP
WRITE " ("_$$EZBLD^DIALOG(710,.X)_")"
KILL X
SET X=""
QUIT
TR if DV["K"&(DUZ(0)'="@")
QUIT
READ X:DTIME
IF '$TEST
SET (DTOUT,X)=U
WRITE $CHAR(7)
+1 QUIT
A KILL DQ(DQ)
SET DQ=DQ+1
B GOTO @DQ
RE if DV["K"&(DUZ(0)'["@")
GOTO A
if $DATA(DE(DQ))
GOTO PR
DO W
DO TR
N IF X=""
if $DATA(^DD("KEY","F",DP,DIFLD))
GOTO NKEY
if DV'["R"
GOTO A
if 'DV
GOTO X
if D'>0
GOTO X
GOTO A
RD if X?."?"
GOTO QS
IF X["^"
DO D
GOTO ^DIE17
+1 IF X="@"
DO D
GOTO Z^DIE2
+2 IF X=" "
IF DV["d"
IF DV'["P"
IF $DATA(^DISV(DUZ,"DIE",DLB))
SET X=^(DLB)
IF DV'["D"
IF DV'["S"
WRITE " "_X
T if DV
GOTO M^DIE17
if DV["V"
GOTO ^DIE3
if X'?.ANP
GOTO X
+1 ;EXTENSIBLE DATA TYPES ;p21
IF DV["t"
Begin DoDot:1
+2 XECUTE $SELECT($DATA(DB(DQ)):$$VALEXTS^DIETLIBF(DP,DIFLD),1:$$VALEXT^DIETLIBF(DP,DIFLD))
KILL DIPA
End DoDot:1
GOTO UNIQ
+3 ;p22
IF DV["S"
DO SET^DIED
if 'DDER
GOTO V
KILL DDER
GOTO X
P IF DV["P"
SET DIC=U_DU
SET DIC(0)=$EXTRACT("EN",$DATA(DB(DQ))+1)_"M"_$EXTRACT("L",DV'["'")
if DIC(0)["L"
SET DLAYGO=+$PIECE(DV,"P",2)
if DV["*"
GOTO AST^DIED
DO NOSCR^DIED
SET X=+Y
SET DIC=DIE
if X<0
GOTO X
+1 if DV'["N"
GOTO V
DO D
IF $LENGTH($PIECE(X,"."))>24
KILL X
GOTO Z
+2 IF $PIECE(DQ(DQ),U,5)'["$"
IF X?.1"-".N.1".".N
IF $PIECE(DQ(DQ),U,5,99)["+X'=X"
SET X=+X
V DO @("X"_DQ)
KILL YS
UNIQ IF DV["U"
IF $DATA(X)
IF DIFLD=.01
KILL %
MERGE %=@(DIE_"""B"",X)")
KILL %(DA)
if $ORDER(%(0))
KILL X
Z KILL DIC("S"),DLAYGO
IF $DATA(X)
IF X'=U
if $GET(DE(DW,"INDEX"))
DO SAVEVALS
if '$$KEYCHK
GOTO UNIQFERR^DIE17
SET DG(DW)=X
if DV["d"
SET ^DISV(DUZ,"DIE",DLB)=X
GOTO A
X if '$DATA(ZTQUEUED)
WRITE $CHAR(7),"??"
IF $DATA(DB(DQ))
GOTO Z^DIE17
+1 SET X="?BAD"
QS SET DZ=X
DO D
DO QQ^DIEQ
GOTO B
D SET D=DIFLD
SET DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$PIECE($TEXT(@("X"_DQ))," ",2,99)
QUIT
Y IF '$DATA(DE(DQ))
DO O
if "@"'[X
GOTO RD
if DV'["R"&(X="@")
GOTO A
if X="@"
GOTO X
SET X=Y
GOTO N
PR SET DG=DV
SET Y=DE(DQ)
SET X=DU
IF $DATA(DQ(DQ,2))
XECUTE DQ(DQ,2)
GOTO RP
+1 ;p21
IF DG["t"
XECUTE $$OUTPUT^DIETLIBF(DP,DIFLD)
KILL DIPA
GOTO RP
R IF DG["P"
IF @("$D(^"_X_"0))")
SET X=+$PIECE(^(0),U,2)
if '$DATA(^(Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
SET X=$PIECE(^DD(X,.01,0),U,3)
SET DG=$PIECE(^(0),U,2)
GOTO R
+1 IF DG["V"
IF +Y
IF $PIECE(Y,";",2)["("
IF $DATA(@(U_$PIECE(Y,";",2)_"0)"))
SET X=+$PIECE(^(0),U,2)
if '$DATA(^(+Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
IF $DATA(^DD(+X,.01,0))
SET DG=$PIECE(^(0),U,2)
SET X=$PIECE(^(0),U,3)
GOTO R
+2 if DG["D"
XECUTE ^DD("DD")
IF DG["S"
SET %=$PIECE($PIECE(";"_X,";"_Y_":",2),";")
IF %]""
SET Y=$SELECT($GET(DUZ("LANG"))'>1:%,'DIFLD:%,1:$$SET^DIQ(DP,DIFLD,Y))
RP DO O
IF X=""
SET X=DE(DQ)
if 'DV
GOTO A
if DC<2
GOTO A
GOTO N^DIE17
I IF DV'["I"
IF DV'["#"
GOTO RD
+1 DO E^DIE0
if $DATA(X)
GOTO RD
GOTO PR
+2 QUIT
SAVEVALS SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$GET(DE(DQ))
if $DATA(^("F"))[0
SET ^("F")=$GET(DE(DQ))
+1 IF $DATA(DE(DW,"4/"))
SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
+2 IF '$TEST
KILL @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
+3 QUIT
NKEY if '$DATA(ZTQUEUED)
WRITE "?? Required key field"
SET X="?BAD"
GOTO QS
KEYCHK() if $GET(DE(DW,"KEY"))=""
QUIT 1
QUIT @DE(DW,"KEY")
BEGIN SET DNM="DVBHCE19"
SET DQ=1
1 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=1
SET DW=".31;4"
SET DV="*P4'X"
SET DU=""
SET DIFLD=.314
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C1^DVBHCE19"
+2 SET DU="DIC(4,"
+3 SET X=+DVBFL
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 GOTO RD
C1 if $DATA(DE(1))[0
GOTO C1S
KILL DB
+1 SET X=DE(1)
SET DIC=DIE
+2 DO KILL^DGREGDD(DA)
C1S SET X=""
if DG(DQ)=X
GOTO C1F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO SET^DGREGDD(DA,X)
C1F1 QUIT
X1 SET DIC("S")="I $$CFLTF^DGREGDD(Y)"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
2 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=2
DO X2
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X2 WRITE "."
SET JP=JP+1
SET DVBJ2=1
+1 QUIT
3 ;@27
SET DQ=4
4 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=4
DO X4
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X4 IF $PIECE(Z2,U,JP)'=8
SET Y="@50"
+1 QUIT
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=5
DO X5
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X5 IF '$DATA(DVBEI)
SET Y="@50"
SET JP=JP+1
+1 QUIT
6 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=6
SET DW=".3;5"
SET DV="S"
SET DU=""
SET DIFLD=.305
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C6^DVBHCE19"
+2 SET DU="Y:YES;N:NO;"
+3 SET X=$SELECT(DVBEI="Y":"Y",1:"N")
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 GOTO RD
C6 if $DATA(DE(6))[0
GOTO C6S
KILL DB
+1 SET X=DE(6)
SET DIC=DIE
+2 DO AUTOUPD^DGENA2(DA)
+3 SET X=DE(6)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
C6S SET X=""
if DG(DQ)=X
GOTO C6F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO AUTOUPD^DGENA2(DA)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
C6F1 QUIT
X6 QUIT
7 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=7
DO X7
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X7 WRITE "."
SET JP=JP+1
SET DVBJ2=1
+1 QUIT
8 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=8
DO X8
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X8 SET Y="@50"
+1 QUIT
9 ;@40
SET DQ=10
10 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=10
DO X10
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X10 IF $PIECE(Z2,U,JP)'=1
SET Y="@42"
+1 QUIT
11 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=11
DO X11
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X11 IF '$DATA(DVBP(6))
SET Y="@42"
SET JP=JP+1
+1 QUIT
12 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=12
DO X12
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X12 IF $SELECT($PIECE(DVBP(6),U,8)'="Y":1,'$DATA(^DPT(DFN,.32)):1,+$PIECE(^(0),U,2):1,1:0)
SET Y="@42"
SET JP=JP+1
+1 QUIT
13 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=13
SET DW=".32;2"
SET DV="DX"
SET DU=""
SET DIFLD=.322
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET X="T"
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+4 GOTO RD
X13 SET %DT=""
SET %DT(0)=-DT
DO ^%DT
KILL %DT
SET X=Y
if Y<1
KILL X
IF $DATA(X)
DO EK^DGLOCK
+1 QUIT
+2 ;
14 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=14
DO X14
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X14 WRITE "."
SET JP=JP+1
SET DVBJ2=1
+1 QUIT
15 ;@42
SET DQ=16
16 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=16
DO X16
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X16 IF $PIECE(Z2,U,JP)'=2
SET Y="@45"
+1 QUIT
17 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=17
DO X17
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X17 IF '$DATA(DVBP(6))
SET Y="@45"
SET JP=JP+1
+1 QUIT
18 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=18
DO X18
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X18 IF $PIECE(DVBP(6),U,4)[" "
SET Y="@45"
SET JP=JP+1
+1 QUIT
19 SET DW=".321;1"
SET DV="RSX"
SET DU=""
SET DIFLD=.32101
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C19^DVBHCE19"
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 SET X=$PIECE(DVBP(6),U,4)
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 GOTO RD
C19 if $DATA(DE(19))[0
GOTO C19S
KILL DB
+1 SET X=DE(19)
SET DIC=DIE
+2 ;
+3 SET X=DE(19)
SET DIC=DIE
+4 ;
+5 SET X=DE(19)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
C19S SET X=""
if DG(DQ)=X
GOTO C19F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(2,.32101,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.321)):^(.321),1:"")
SET X=$PIECE(Y(1),U,4)
SET DIU=X
KILL Y
SET X=DIV
SET X=""
XECUTE ^DD(2,.32101,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 XECUTE ^DD(2,.32101,1,2,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.321)):^(.321),1:"")
SET X=$PIECE(Y(1),U,5)
SET DIU=X
KILL Y
SET X=DIV
SET X=""
XECUTE ^DD(2,.32101,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
C19F1 QUIT
X19 SET DFN=DA
DO SV^DGLOCK
+1 QUIT
+2 ;
20 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=20
DO X20
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X20 WRITE "."
SET JP=JP+1
SET DVBJ2=1
+1 QUIT
21 ;@45
SET DQ=22
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=22
DO X22
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X22 IF $PIECE(Z2,U,JP)'=3!('$DATA(DVBDX(1)))
SET Y="@50"
+1 QUIT
23 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=23
DO X23
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X23 if '$DATA(DVBFL)
SET DVBFL="UNKNOWN"
+1 QUIT
24 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=24
DO X24
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X24 IF $DATA(DVBCAP)
IF DVBCAP["No C&P"
IF $PIECE(DVBBIR,U,5)'="Y"
DO CHK^DVBHUTIL
+1 QUIT
25 ;@47
SET DQ=26
26 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=26
DO X26
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X26 SET DVB4=$SELECT($DATA(^DPT(DFN,.3))>0:$PIECE(^(.3),U),1:0)
SET DVB5=$SELECT($DATA(^DPT(DFN,.36))>0:$PIECE(^(.36),U),1:0)
SET DVB6=$SELECT($DATA(^DPT(DFN,"VET"))>0:^("VET"),1:0)
SET DVB7=$SELECT($DATA(^DPT(DFN,"TYPE"))>0:^("TYPE"),1:0)
+1 QUIT
27 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=27
DO X27
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X27 SET DVB8=$ORDER(^DIC(8,"B","SERVICE CONNECTED 50% to 100%",0))
SET DVB9=$ORDER(^DIC(8,"B","SC LESS THAN 50%",0))
+1 QUIT
28 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=28
DO X28
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X28 IF DVBDXNO
IF ((DVB8'=DVB5&(DVB9'=DVB5))!(DVB4'="Y")!(DVB6'="Y")!(DVB7'=1))
SET Y="@70"
+1 QUIT
29 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=29
DO X29
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X29 WRITE !
KILL ^DPT(DFN,.372),JP4,JP6
SET ^DPT(DFN,.372,0)="^2.04P^^0"
SET JP=0
+1 QUIT
30 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=30
DO X30
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X30 SET $PIECE(^DPT(DFN,.3),U,2)=""
SET $PIECE(^DPT(DFN,.3),U,14)=""
+1 QUIT
31 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=31
SET DW=".3;2"
SET DV="NJ3,0Xa"
SET DU=""
SET DIFLD=.302
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C31^DVBHCE19"
+2 SET X=+$GET(DVBDXPCT)
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 GOTO RD
C31 if $DATA(DE(31))[0
GOTO C31S
KILL DB
+1 SET X=DE(31)
SET DIC=DIE
+2 ;
+3 SET X=DE(31)
SET DIC=DIE
+4 DO AUTOUPD^DGENA2(DA)
+5 SET X=DE(31)
SET DIC=DIE
+6 ;
+7 SET X=DE(31)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".302;"
DO AVAFC^VAFCDD01(DA)
+9 SET X=DE(31)
SET DIC=DIE
+10 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+11 SET X=DE(31)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C31S SET X=""
if DG(DQ)=X
GOTO C31F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 ;
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO AUTOUPD^DGENA2(DA)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 XECUTE "S DFN=DA D EN^DGMTR K DGREQF"
+7 SET X=DG(DQ)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".302;"
DO AVAFC^VAFCDD01(DA)
+9 SET X=DG(DQ)
SET DIC=DIE
+10 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+11 IF $DATA(DE(31))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C31F1 QUIT
X31 SET DFN=DA
DO EV^DGLOCK
if '$DATA(X)
QUIT
if +X'=X!(X>100)!(X<0)!(X?.E1"."1N.N)
KILL X
IF $DATA(X)
IF $DATA(^DPT(DA,.3))
IF $PIECE(^(.3),U,1)'="Y"
WRITE !?4,*7,"Only applies to service-connected applicants."
KILL X
+1 QUIT
+2 ;
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=32
SET DW=".3;14"
SET DV="DX"
SET DU=""
SET DIFLD=.3014
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET X=$GET(DVBEFF)
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+4 GOTO RD
X32 SET %DT="P"
DO ^%DT
SET X=Y
if Y<1!(Y>DT)
KILL X
+1 QUIT
+2 ;
33 ;@46
SET DQ=34
34 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=34
DO X34
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X34 SET JP=$ORDER(DVBDX(JP))
IF 'JP
SET Y="@50"
+1 QUIT
35 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=35
DO X35
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X35 SET JPP=+$PIECE(DVBDX(JP),U,2)
IF JPP'>0
SET Y="@46"
+1 QUIT
36 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=36
DO X36
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X36 IF '$DATA(^DIC(31,JPP))
DO CHKDIS^DVBHS3
SET Y="@46"
+1 QUIT
37 ;.3721
SET D=0
KILL DE(1)
+1 SET DIFLD=.3721
SET DGO="^DVBHCE20"
SET DC="6^2.04P^.372^"
SET DV="2.04MP31'X"
SET DW="0;1"
SET DOW=$$LABEL^DIALOGZ(DP,DIFLD)
SET DLB=$PIECE($$EZBLD^DIALOG(8042,DOW),": ")
if D
SET DC=DC_D
+2 SET DU="DIC(31,"
+3 if D
GOTO RE
IF $DATA(DSC(2.04))#2
IF $PIECE(DSC(2.04),"I $D(^UTILITY(",1)=""
XECUTE DSC(2.04)
SET D=$ORDER(^(0))
if D=""
SET D=-1
GOTO M37
+4 SET D=$SELECT($DATA(^DPT(DA,.372,0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M37 IF D>0
SET DC=DC_D
IF $DATA(^DPT(DA,.372,+D,0))
SET DE(37)=$PIECE(^(0),U,1)
+1 SET X="""`"_$PIECE(DVBDX(JP),U,2)_""""
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+4 GOTO RD
R37 DO DE
+1 GOTO A
+2 ;
38 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=38
DO X38
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X38 WRITE "."
SET DVBJ2=1
+1 QUIT
39 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=39
DO X39
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X39 SET Y="@46"
+1 QUIT
40 ;@61
SET DQ=41
41 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=41
DO X41
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X41 SET Y="@4"
+1 QUIT
42 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=42
DO X42
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X42 IF Z2'[1
SET Y="@62"
+1 QUIT
43 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=43
DO X43
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X43 IF '$DATA(DVBSSA)
SET Y="@62"
SET JP=JP+1
+1 QUIT
44 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=44
DO X44
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X44 IF DVBSSA
SET DVBYN="Y"
SET DVBXYN=DVBSSA
+1 QUIT
45 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=45
DO X45
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X45 IF 'DVBSSA
SET DVBYN="N"
SET DVBXYN=""
+1 QUIT
46 SET DW=".362;15"
SET DV="SX"
SET DU=""
SET DIFLD=.36225
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C46^DVBHCE19"
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 SET X=DVBYN
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+6 GOTO RD
C46 if $DATA(DE(46))[0
GOTO C46S
KILL DB
+1 SET X=DE(46)
SET DIC=DIE
+2 XECUTE ^DD(2,.36225,1,1,2.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36225,1,1,2.4)
C46S SET X=""
if DG(DQ)=X
GOTO C46F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(2,.36225,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36225,1,1,1.4)
C46F1 QUIT
X46 SET DFN=DA
DO MV^DGLOCK
QUIT
+1 QUIT
+2 ;
47 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=47
DO X47
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X47 WRITE "."
SET JP=JP+1
SET DVBJ2=1
KILL DVBYN,DVBXYN
+1 QUIT
48 ;@62
SET DQ=49
49 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=49
DO X49
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X49 IF Z2'[2
SET Y="@63"
+1 QUIT
50 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=50
DO X50
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X50 IF '$DATA(DVBRETT)
SET Y="@63"
SET JP=JP+1
+1 QUIT
51 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=51
DO X51
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X51 IF DVBRETT=""!("BMCROX"'[DVBRETT)
SET Y="@63"
SET JP=JP+1
+1 QUIT
52 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=52
SET DW=".362;18"
SET DV="SX"
SET DU=""
SET DIFLD=.36285
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="B:BLACK LUNG;M:MILITARY;C:CIVIL;R:RAILROAD;O:OTHER;X:COMBINATIONS OF TYPES;"
+2 SET X=DVBRETT
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 GOTO RD
X52 SET DFN=DA
DO MV^DGLOCK
QUIT
+1 QUIT
+2 ;
53 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=53
DO X53
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X53 WRITE "."
SET JP=JP+1
SET DVBJ2=1
+1 QUIT
54 ;@63
SET DQ=55
55 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=55
DO X55
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X55 IF Z2'[3
SET Y="@64"
+1 QUIT
56 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=56
DO X56
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X56 IF '$DATA(DVBRETO)
SET Y="@64"
SET JP=JP+1
+1 QUIT
57 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=57
DO X57
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X57 SET X=DVBRETO
IF X=""!(X=0)
SET X="@"
+1 QUIT
58 SET DW=".362;8"
SET DV="NJ8,2X"
SET DU=""
SET DIFLD=.3628
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET X=X
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+4 GOTO RD
X58 DO DOL^DGLOCK2
if +X'=X&(X'?.N1"."2N)!(X>99999)!(X<1)
KILL X
IF $DATA(X)
SET DFN=DA
DO MV^DGLOCK
+1 QUIT
+2 ;
59 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=59
DO X59
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X59 WRITE "."
SET JP=JP+1
SET DVBJ2=1
+1 QUIT
60 ;@64
SET DQ=61
61 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=61
DO X61
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X61 IF Z2'[4
SET Y="@1006"
+1 QUIT
62 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=62
DO X62
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X62 IF '$DATA(DVBOINC)
SET Y="@1006"
SET JP=JP+1
+1 QUIT
63 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=63
DO X63
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X63 SET X=DVBOINC
IF X=""!(X=0)
SET X="@"
+1 QUIT
64 SET DW=".362;9"
SET DV="NJ8,2X"
SET DU=""
SET DIFLD=.3629
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET X=X
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+4 GOTO RD
X64 DO DOL^DGLOCK2
if +X'=X&(X'?.N1"."2N)!(X>999999)!(X<1)
KILL X
+1 QUIT
+2 ;
65 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=65
DO X65
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X65 WRITE "."
SET JP=JP+1
SET DVBJ2=1
SET Y="@1006"
+1 QUIT
66 ;@4
SET DQ=67
67 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=67
DO X67
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X67 SET Y=$SELECT(DVBJS=11:"@1",DVBJS=28:"@2",DVBJS=35:"@3",DVBJS=44:"@104",1:"@10")
+1 QUIT
68 ;@70
SET DQ=69
69 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=69
DO X69
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X69 WRITE !!,*7,"HINQ contains SC disabilities, Patient is NSC no updating allowed. Check patient's SERVICE CONNECTION, ELIGIBILITY CODE, VET STATUS, or PATIENT TYPE. Screen 5 contains this."
+1 QUIT
70 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=70
DO X70
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X70 READ !!,?25,"<RET> to continue.",ZZ:DTIME
KILL ZZ,JP3,JP4
+1 QUIT
71 ;@50
SET DQ=72
72 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=72
DO X72
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X72 KILL DVBJX,JP,JPP
SET Y=$SELECT(DVBJS=28:"@1",DVBJS=35:"@2",1:"@10")
+1 QUIT
73 ;@10
SET DQ=74
74 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=74
DO X74
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X74 IF $GET(DVBRADL)]""
DO DX^DVBHQEDT(DVBRADL)
+1 QUIT
75 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=75
DO X75
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X75 KILL DVBRADL
+1 QUIT
76 GOTO 0^DIE17