DVBAXA ; GENERATED FROM 'DVBA C ADD 2507 PAT' INPUT TEMPLATE(#965), FILE 2;10/30/24
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(^(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)=%
I $D(^(.11)) S %Z=^(.11) S %=$P(%Z,U,1) S:%]"" DE(16)=% S %=$P(%Z,U,2) S:%]"" DE(17)=% S %=$P(%Z,U,3) S:%]"" DE(18)=% S %=$P(%Z,U,4) S:%]"" DE(19)=% S %=$P(%Z,U,5) S:%]"" DE(20)=% S %=$P(%Z,U,7) S:%]"" DE(22)=% S %=$P(%Z,U,12) S:%]"" DE(21)=%
I $D(^(.13)) S %Z=^(.13) S %=$P(%Z,U,1) S:%]"" DE(23)=% S %=$P(%Z,U,2) S:%]"" DE(24)=%
I $D(^(.3)) S %Z=^(.3) S %=$P(%Z,U,1) S:%]"" DE(9)=% S %=$P(%Z,U,2) S:%]"" DE(10)=%
I $D(^(.31)) S %Z=^(.31) S %=$P(%Z,U,3) S:%]"" DE(7)=% S %=$P(%Z,U,4) S:%]"" DE(8)=%
I $D(^(.32)) S %Z=^(.32) S %=$P(%Z,U,3) S:%]"" DE(15)=% S %=$P(%Z,U,6) S:%]"" DE(26)=% S %=$P(%Z,U,7) S:%]"" DE(27)=%
I $D(^(.36)) S %Z=^(.36) S %=$P(%Z,U,1) S:%]"" DE(13)=%
I $D(^(.52)) S %Z=^(.52) S %=$P(%Z,U,5) S:%]"" DE(14)=%
I $D(^("TYPE")) S %Z=^("TYPE") S %=$P(%Z,U,1) S:%]"" DE(11)=%
I $D(^("VET")) S %Z=^("VET") S %=$P(%Z,U,1) S:%]"" DE(12)=%
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="DVBAXA",DQ=1
N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
M DIEZAR=^DIE(965,"AR") S DICRREC="TRIG^DIE17"
S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=965,U="^"
1 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
X1 S DVBACPLT=0 I '$D(IOF) S IOP="HOME" D ^%ZIS K IOP
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 @IOF,!,"Please review previous information entered as well as",!,"entering additional REQUIRED information:",!!!
Q
3 S DQ=4 ;@1
4 S DW="0;1",DV="RFXa",DU="",DIFLD=.01,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C4^DVBAXA",DE(DW,"INDEX")=1
G RE
C4 G C4S:$D(DE(4))[0 K DB
S X=DE(4),DIC=DIE
K ^DPT("B",$E(X,1,30),DA)
S X=DE(4),DIC=DIE
X "Q:$P(^DPT(DA,0),U,9)']"""" K ^DPT(""BS5"",$E(X,1)_$E($P(^(0),U,9),6,9),DA)"
S X=DE(4),DIC=DIE
S A1B2TAG="PAT" D ^A1B2XFR
S X=DE(4),DIC=DIE
X "S DFN=DA D ^DGPATN K DGNEWVAL Q"
S X=DE(4),DIC=DIE
S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
S X=DE(4),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".01;" D AVAFC^VAFCDD01(DA)
S X=DE(4),DIC=DIE
I $T(KILL^VAFCMIS)'=""&('$D(VAFCNO)) D KILL^VAFCMIS(DA)
S X=DE(4),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(4),DIIX=2_U_DIFLD D AUDIT^DIET
C4S S X="" G:DG(DQ)=X C4F1 K DB
S X=DG(DQ),DIC=DIE
S ^DPT("B",$E(X,1,30),DA)=""
S X=DG(DQ),DIC=DIE
X "Q:$P(^DPT(DA,0),U,9)']"""" S ^DPT(""BS5"",$E(X,1)_$E($P(^(0),U,9),6,9),DA)="""""
S X=DG(DQ),DIC=DIE
S A1B2TAG="PAT" D ^A1B2XFR
S X=DG(DQ),DIC=DIE
X "K DGNEWVAL Q"
S X=DG(DQ),DIC=DIE
S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
S X=DG(DQ),DIC=DIE
I '$D(DFN),($T(AVAFC^VAFCDD01)'="") S VAFCF=".01;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
I $T(SET^VAFCMIS)'=""&('$D(VAFCNO)) D SET^VAFCMIS(DA)
S X=DG(DQ),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
I $D(DE(4))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C4F1 N X,X1,X2 S DIXR=177 D C4X1(U) K X2 M X2=X D C4X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.01,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.01,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C4F2
C4X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.01,DION),$P($G(^DPT(DA,0)),U,1))
S X=$G(X(1))
Q
C4F2 S DIXR=588 D C4X2(U) K X2 M X2=X D C4X2("O") K X1 M X1=X
I $G(X(1))]"" D
. K ^DPT("NOP",$E(X,1,30),DA)
K X M X=X2 I $G(X(1))]"" D
. S ^DPT("NOP",$E(X,1,30),DA)=""
G C4F3
C4X2(DION) K X
S X=$G(@DIEZTMP@("V",2,DIIENS,.01,DION),$P($G(^DPT(DA,0)),U,1))
I $D(X)#2 S X=$$NOP^XLFNAME7(X)
S:$D(X)#2 X(1)=X
S X=$G(X(1))
Q
C4F3 S DIXR=589 D C4X3(U) K X2 M X2=X D C4X3("O") K X1 M X1=X
I $G(X(1))]"" D
. I '$G(XUNOTRIG) N XUNOTRIG S XUNOTRIG=1 D DELCOMP^XLFNAME2(2,.DA,.01,1.01) Q
K X M X=X2 I $G(X(1))]"" D
. I '$G(XUNOTRIG) N XUNOTRIG S XUNOTRIG=1,DG20NAME=X D NARY^XLFNAME7(.DG20NAME),UPDCOMP^XLFNAME2(2,.DA,.01,.DG20NAME,1.01,+$P($G(^DPT(DA,"NAME")),U),"CL30") K DG20NAME Q
G C4F4
C4X3(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.01,DION),$P($G(^DPT(DA,0)),U,1))
S X=$G(X(1))
Q
C4F4 Q
X4 K:$L(X)>30!($L(X)<3) X I $D(X) S DG20NAME=X,(X,DG20NAME)=$$FORMAT^XLFNAME7(.DG20NAME,3,30) K:'$L(X) X,DG20NAME S:$D(X) DGNEWVAL=X
I $D(X),X'?.ANP K X
Q
;
5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="0;2",DV="RSaR",DU="",DIFLD=.02,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C5^DVBAXA",DE(DW,"INDEX")=1
S DU="M:MALE;F:FEMALE;"
G RE
C5 G C5S:$D(DE(5))[0 K DB
S X=DE(5),DIC=DIE
K ^DPT("ASX",$E(X,1,30),DA)
S X=DE(5),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DE(5),DIC=DIE
S IVMX=X,IVMKILL=2,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX,IVMKILL
S X=DE(5),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".02;" D AVAFC^VAFCDD01(DA)
S X=DE(5),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(5),DIIX=2_U_DIFLD D AUDIT^DIET
C5S S X="" G:DG(DQ)=X C5F1 K DB
S X=DG(DQ),DIC=DIE
S ^DPT("ASX",$E(X,1,30),DA)=""
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DG(DQ),DIC=DIE
S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".02;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
I $D(DE(5))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C5F1 N X,X1,X2 S DIXR=811 D C5X1(U) K X2 M X2=X D C5X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.02,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.02,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C5F2
C5X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.02,DION),$P($G(^DPT(DA,0)),U,2))
S X=$G(X(1))
Q
C5F2 Q
X5 Q
6 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW="0;9",DV="RFXaR",DU="",DIFLD=.09,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C6^DVBAXA",DE(DW,"INDEX")=1
G RE
C6 G C6S:$D(DE(6))[0 K DB
S X=DE(6),DIC=DIE
K:$E(X,6,9)'="" ^DPT("BS",$E(X,6,9),DA)
S X=DE(6),DIC=DIE
;
S X=DE(6),DIC=DIE
K ^DPT("BS5",$E(^DPT(DA,0),1)_$E(X,6,9),DA)
S X=DE(6),DIC=DIE
S A1B2TAG="PAT" D ^A1B2XFR
S X=DE(6),DIC=DIE
D KILL^DGREGDD1(DA,.6,0,21,0)
S X=DE(6),DIC=DIE
K ^DPT("SSN",$E(X,1,30),DA)
S X=DE(6),DIC=DIE
S VADFN=DA D KILL^VADPT6 K VADFN
S X=DE(6),DIC=DIE
S PPP=X,X="PPPFMX" X ^%ZOSF("TEST") D:$T KNSSN^PPPFMX S X=PPP K PPP
S X=DE(6),DIC=DIE
;
S X=DE(6),DIC=DIE
S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
S X=DE(6),DIC=DIE
S PX=X,X="PXXDPT" X ^%ZOSF("TEST") D:$T KILLSSN^PXXDPT S X=PX K PX
S X=DE(6),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".09;" D AVAFC^VAFCDD01(DA)
S X=DE(6),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(6),DIIX=2_U_DIFLD D AUDIT^DIET
C6S S X="" G:DG(DQ)=X C6F1 K DB
S X=DG(DQ),DIC=DIE
S ^DPT("BS",$E(X,6,9),DA)=""
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,0)):^(0),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X=DIV S X="1" X ^DD(2,.09,1,2,1.4)
S X=DG(DQ),DIC=DIE
S ^DPT("BS5",$E(^DPT(DA,0),1)_$E(X,6,9),DA)=""
S X=DG(DQ),DIC=DIE
S A1B2TAG="PAT" D ^A1B2XFR
S X=DG(DQ),DIC=DIE
I $E(X,1,5)="00000" D SET^DGREGDD1(DA,.6,0,21,1)
S X=DG(DQ),DIC=DIE
S ^DPT("SSN",$E(X,1,30),DA)=""
S X=DG(DQ),DIC=DIE
S VADFN=DA D SET^VADPT6 K VADFN
S X=DG(DQ),DIC=DIE
S PPP=X,X="PPPFMX" X ^%ZOSF("TEST") D:$T SNSSN^PPPFMX S X=PPP K PPP
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X=Y(0)'["P" I X S X=DIV S Y(1)=$S($D(^DPT(D0,"SSN")):^("SSN"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" X ^DD(2,.09,1,10,1.4)
S X=DG(DQ),DIC=DIE
S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
S X=DG(DQ),DIC=DIE
S PX=X,X="PXXDPT" X ^%ZOSF("TEST") D:$T SETSSN^PXXDPT S X=PX K PX
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".09;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
I $D(DE(6))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C6F1 N X,X1,X2 S DIXR=179 D C6X1(U) K X2 M X2=X D C6X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.09,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.09,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C6F2
C6X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.09,DION),$P($G(^DPT(DA,0)),U,9))
S X=$G(X(1))
Q
C6F2 Q
X6 K:X[""""!($A(X)=45) X I $D(X) S:'$D(DPTX) DFN=DA D SSN^DGINP Q I $L(X)>10
I $D(X),X'?.ANP K X
Q
;
7 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW=".31;3",DV="FXOaR",DU="",DIFLD=.313,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(7,2)="S Y(0)=Y S Y=$E(Y,1,10)"
S DE(DW)="C7^DVBAXA"
G RE
C7 G C7S:$D(DE(7))[0 K DB
S X=DE(7),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".313;" D AVAFC^VAFCDD01(DA)
S X=DE(7),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DE(7),DIIX=2_U_DIFLD D AUDIT^DIET
C7S S X="" G:DG(DQ)=X C7F1 K DB
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".313;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
I $D(DE(7))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C7F1 Q
X7 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 K:$L(X)>9 X Q:'$D(X) I X'=L K:$L(X)>8!($L(X)<7)!'(X?.N) X
I $D(X),X'?.ANP K X
Q
;
8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW=".31;4",DV="*P4'XR",DU="",DIFLD=.314,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C8^DVBAXA"
S DU="DIC(4,"
G RE
C8 G C8S:$D(DE(8))[0 K DB
S X=DE(8),DIC=DIE
D KILL^DGREGDD(DA)
C8S S X="" G:DG(DQ)=X C8F1 K DB
S X=DG(DQ),DIC=DIE
D SET^DGREGDD(DA,X)
C8F1 Q
X8 S DIC("S")="I $$CFLTF^DGREGDD(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
9 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW=".3;1",DV="RSXa",DU="",DIFLD=.301,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C9^DVBAXA"
S DU="Y:YES;N:NO;"
G RE
C9 G C9S:$D(DE(9))[0 K DB
S X=DE(9),DIC=DIE
;
S X=DE(9),DIC=DIE
;
S X=DE(9),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(9),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA)
S X=DE(9),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(9),DIIX=2_U_DIFLD D AUDIT^DIET
C9S S X="" G:DG(DQ)=X C9F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(2,.301,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(2,.301,1,1,1.4)
S X=DG(DQ),DIC=DIE
X ^DD(2,.301,1,2,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,12),X=X S DIU=X K Y S X="" X ^DD(2,.301,1,2,1.4)
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
I $D(DE(9))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C9F1 Q
X9 S DFN=DA D EV^DGLOCK I $D(X),X="Y" D VET^DGLOCK
Q
;
10 D:$D(DG)>9 F^DIE17,DE S DQ=10,DW=".3;2",DV="NJ3,0Xa",DU="",DIFLD=.302,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C10^DVBAXA"
G RE
C10 G C10S:$D(DE(10))[0 K DB
S X=DE(10),DIC=DIE
;
S X=DE(10),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(10),DIC=DIE
;
S X=DE(10),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".302;" D AVAFC^VAFCDD01(DA)
S X=DE(10),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(10),DIIX=2_U_DIFLD D AUDIT^DIET
C10S S X="" G:DG(DQ)=X C10F1 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(10))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C10F1 Q
X10 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
;
11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="TYPE;1",DV="RP391'a",DU="",DIFLD=391,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C11^DVBAXA",DE(DW,"INDEX")=1
S DU="DG(391,"
G RE
C11 G C11S:$D(DE(11))[0 K DB
S X=DE(11),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF="391;" D AVAFC^VAFCDD01(DA)
S X=DE(11),DIIX=2_U_DIFLD D AUDIT^DIET
C11S S X="" G:DG(DQ)=X C11F1 K DB
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF="391;" D AVAFC^VAFCDD01(DA)
I $D(DE(11))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C11F1 N X,X1,X2 S DIXR=643 D C11X1(U) K X2 M X2=X D C11X1("O") K X1 M X1=X
I $G(X(1))]"" D
. K ^DPT("APTYPE",X,DA)
K X M X=X2 I $G(X(1))]"" D
. S ^DPT("APTYPE",X,DA)=""
G C11F2
C11X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,391,DION),$P($G(^DPT(DA,"TYPE")),U,1))
S X=$G(X(1))
Q
C11F2 Q
X11 Q
12 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW="VET;1",DV="RSXa",DU="",DIFLD=1901,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C12^DVBAXA"
S DU="Y:YES;N:NO;"
G RE
C12 G C12S:$D(DE(12))[0 K DB
S X=DE(12),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DE(12),DIC=DIE
S DFN=DA D EN^DGRP7CC
S X=DE(12),DIC=DIE
;
S X=DE(12),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(12),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF="1901;" D AVAFC^VAFCDD01(DA)
S X=DE(12),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(12),DIIX=2_U_DIFLD D AUDIT^DIET
C12S S X="" G:DG(DQ)=X C12F1 K DB
S X=DG(DQ),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DG(DQ),DIC=DIE
S DFN=DA D EN^DGRP7CC
S X=DG(DQ),DIC=DIE
X ^DD(2,1901,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X=DIV S X="N" X ^DD(2,1901,1,3,1.4)
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DG(DQ),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF="1901;" D AVAFC^VAFCDD01(DA)
S X=DG(DQ),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
I $D(DE(12))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C12F1 Q
X12 I $D(X) S:'$D(DPTX) DFN=DA D:'$D(^XUSEC("DG ELIGIBILITY",DUZ)) VAGE^DGLOCK:X="Y" I $D(X) D:$D(DFN) EV^DGLOCK
Q
;
13 D:$D(DG)>9 F^DIE17,DE S DQ=13,DW=".36;1",DV="*P8'XaR",DU="",DIFLD=.361,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C13^DVBAXA",DE(DW,"INDEX")=1
S DU="DIC(8,"
G RE
C13 G C13S:$D(DE(13))[0 K DB
S X=DE(13),DIC=DIE
;
S X=DE(13),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 X ^DD(2,.361,1,2,2.2) I DIV(1)>0 S DIK(0)=DA,DIK="^DPT(DIV(0),""E"",",DA(1)=DIV(0),DA=DIV(1) D ^DIK S DA=DIK(0) K DIK
S X=DE(13),DIC=DIE
X "I $S('$D(^DIC(8,+X,0)):0,$P(^(0),""^"",1)[""DOM"":0,'$D(^DPT(DA,.36)):1,'$D(^DIC(8,+^(.36),0)):1,$P(^(0),""^"",1)'[""DOM"":1,1:0) S DGXRF=.361 D ^DGDDC Q"
S X=DE(13),DIC=DIE
K ^DPT("AEL",DA,+X) I X=$$FIND1^DIC(8,"","B","COLLATERAL OF VET") D ARCHALL^DGRP1152U(DA)
S X=DE(13),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(13),DIIX=2_U_DIFLD D AUDIT^DIET
C13S S X="" G:DG(DQ)=X C13F1 K DB
S X=DG(DQ),DIC=DIE
X "S DFN=DA D INACT33^DGOTHEL(DFN),EN^DGMTR K DGREQF"
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 X ^DD(2,.361,1,2,89.4) S Y(102)=$S($D(^DPT(D0,"E",D1,0)):^(0),1:"") S X=$S('$D(^DIC(8,+$P(Y(102),U,1),0)):"",1:$P(^(0),U,1)) S D0=I(0,0) S D1=I(1,0) S DIU=X K Y S X=DIV S X=DIV,X=X X ^DD(2,.361,1,2,1.4)
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
S ^DPT("AEL",DA,+X)="" D RESTORE^DGRP1152U(DA)
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
I $D(DE(13))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C13F1 N X,X1,X2 S DIXR=815 D C13X1(U) K X2 M X2=X D C13X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.361,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.361,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C13F2
C13X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.361,DION),$P($G(^DPT(DA,.36)),U,1))
S X=$G(X(1))
Q
C13F2 Q
X13 S DFN=DA D EV^DGLOCK I $D(X) D ECD^DGLOCK1
Q
;
14 D:$D(DG)>9 F^DIE17,DE S DQ=14,DW=".52;5",DV="RSXR",DU="",DIFLD=.525,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C14^DVBAXA",DE(DW,"INDEX")=1
S DU="Y:YES;N:NO;U:UNKNOWN;"
G RE
C14 G C14S:$D(DE(14))[0 K DB
S X=DE(14),DIC=DIE
;
S X=DE(14),DIC=DIE
;
S X=DE(14),DIC=DIE
;
S X=DE(14),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(14),DIC=DIE
X "S DFN=DA D EN^DGMTR K DGREQF"
S X=DE(14),DIC=DIE
D EVENT^IVMPLOG(DA)
C14S S X="" G:DG(DQ)=X C14F1 K DB
D ^DVBAXA1
C14F1 N X,X1,X2 S DIXR=627 D C14X1(U) K X2 M X2=X D C14X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.525,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.525,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C14F2
C14X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.525,DION),$P($G(^DPT(DA,.52)),U,5))
S X=$G(X(1))
Q
C14F2 Q
X14 S DFN=DA D POWV^DGLOCK I $D(X) D SV^DGLOCK
Q
;
15 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW=".32;3",DV="*P21'XaR",DU="",DIFLD=.323,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C15^DVBAXA"
S DU="DIC(21,"
G RE
C15 G C15S:$D(DE(15))[0 K DB
S X=DE(15),DIC=DIE
K ^DPT("APOS",$E(X,1,30),DA)
S X=DE(15),DIC=DIE
;
S X=DE(15),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".323;" D AVAFC^VAFCDD01(DA)
S X=DE(15),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DE(15),DIIX=2_U_DIFLD D AUDIT^DIET
C15S S X="" G:DG(DQ)=X C15F1 K DB
D ^DVBAXA2
C15F1 Q
X15 S DFN=DA D POS^DGLOCK1
Q
;
16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".11;1",DV="FaXJ35R",DU="",DIFLD=.111,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C16^DVBAXA",DE(DW,"INDEX")=1
G RE
C16 G C16S:$D(DE(16))[0 K DB
D ^DVBAXA3
C16S S X="" G:DG(DQ)=X C16F1 K DB
D ^DVBAXA4
C16F1 N X,X1,X2 S DIXR=230 D C16X1(U) K X2 M X2=X D C16X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.111,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.111,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C16F2
C16X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.111,DION),$P($G(^DPT(DA,.11)),U,1))
S X=$G(X(1))
Q
C16F2 Q
X16 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>35!($L(X)<3) X D:$D(X) UP^DGHELP
I $D(X),X'?.ANP K X
Q
;
17 D:$D(DG)>9 F^DIE17,DE S DQ=17,DW=".11;2",DV="Fa",DU="",DIFLD=.112,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C17^DVBAXA",DE(DW,"INDEX")=1
G RE
C17 G C17S:$D(DE(17))[0 K DB
D ^DVBAXA5
C17S S X="" G:DG(DQ)=X C17F1 K DB
D ^DVBAXA6
C17F1 N X,X1,X2 S DIXR=232 D C17X1(U) K X2 M X2=X D C17X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.112,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.112,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C17F2
C17X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.112,DION),$P($G(^DPT(DA,.11)),U,2))
S X=$G(X(1))
Q
C17F2 Q
X17 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X D:$D(X) UP^DGHELP
I $D(X),X'?.ANP K X
Q
;
18 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW=".11;3",DV="FaXJ30",DU="",DIFLD=.113,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C18^DVBAXA",DE(DW,"INDEX")=1
G RE
C18 G C18S:$D(DE(18))[0 K DB
D ^DVBAXA7
C18S S X="" G:DG(DQ)=X C18F1 K DB
D ^DVBAXA8
C18F1 N X,X1,X2 S DIXR=233 D C18X1(U) K X2 M X2=X D C18X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.113,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.113,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C18F2
C18X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.113,DION),$P($G(^DPT(DA,.11)),U,3))
S X=$G(X(1))
Q
C18F2 Q
X18 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>30!($L(X)<3) X D:$D(X) UP^DGHELP
I $D(X),X'?.ANP K X
Q
;
19 D:$D(DG)>9 F^DIE17,DE S DQ=19,DW=".11;4",DV="FaXJ15R",DU="",DIFLD=.114,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C19^DVBAXA",DE(DW,"INDEX")=1
G RE
C19 G C19S:$D(DE(19))[0 K DB
D ^DVBAXA9
C19S S X="" G:DG(DQ)=X C19F1 K DB
D ^DVBAXA10
C19F1 N X,X1,X2 S DIXR=234 D C19X1(U) K X2 M X2=X D C19X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.114,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.114,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C19F2
C19X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.114,DION),$P($G(^DPT(DA,.11)),U,4))
S X=$G(X(1))
Q
C19F2 Q
X19 K:$L(X)>15!($L(X)<2) X D:$D(X) UP^DGHELP
I $D(X),X'?.ANP K X
Q
;
20 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".11;5",DV="*P5'aR",DU="",DIFLD=.115,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C20^DVBAXA",DE(DW,"INDEX")=1
S DU="DIC(5,"
G RE
C20 G C20S:$D(DE(20))[0 K DB
D ^DVBAXA11
C20S S X="" G:DG(DQ)=X C20F1 K DB
D ^DVBAXA12
C20F1 N X,X1,X2 S DIXR=235 D C20X1(U) K X2 M X2=X D C20X1("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.115,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.115,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C20F2
C20X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.115,DION),$P($G(^DPT(DA,.11)),U,5))
S X=$G(X(1))
Q
C20F2 Q
X20 S DIC("S")="I $P(^DIC(5,Y,0),U,6)=1" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
21 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW=".11;12",DV="FXOaR",DU="",DIFLD=.1112,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(21,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
S DE(DW)="C21^DVBAXA",DE(DW,"INDEX")=1
G RE
C21 G C21S:$D(DE(21))[0 K DB
D ^DVBAXA13
C21S S X="" G:DG(DQ)=X C21F1 K DB
D ^DVBAXA14
C21F1 N X,X1,X2 S DIXR=185 D C21X1(U) K X2 M X2=X D C21X1("O") K X1 M X1=X
D
. N DIEXARR M DIEXARR=X S DIEZCOND=1
. I X1(1)'=X2(1)
. S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
. K EASDO2
G C21F2
C21X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.1112,DION),$P($G(^DPT(DA,.11)),U,12))
S:('$G(EASDO2)&($D(EASZIPLK))) X=$$ZIP^DGREGDD1(DA,X(1))
S:$D(X)#2 X(2)=X
S X=$G(X(1))
Q
C21F2 S DIXR=231 D C21X2(U) K X2 M X2=X D C21X2("O") K X1 M X1=X
D
. D FC^DGFCPROT(.DA,2,.1112,"KILL",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
K X M X=X2 D
. D FC^DGFCPROT(.DA,2,.1112,"SET",$H,$G(DUZ),.X,.X1,.X2,$G(XQY0)) Q
G C21F3
C21X2(DION) K X
S X(1)=$G(@DIEZTMP@("V",2,DIIENS,.1112,DION),$P($G(^DPT(DA,.11)),U,12))
S X=$G(X(1))
Q
C21F3 Q
X21 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<5) X I $D(X) D ZIPIN^VAFADDR
I $D(X),X'?.ANP K X
Q
;
22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW=".11;7",DV="NJ3,0XOaR",DU="",DIFLD=.117,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(22,2)="S Y(0)=Y Q:Y']"""" S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),""^"",5),1:"""") Q:'Z0 S Y=$P($S($D(^DIC(5,Z0,1,Y,0)):^(0),1:""""),""^"",3)"
S DE(DW)="C22^DVBAXA"
G RE
C22 G C22S:$D(DE(22))[0 K DB
D ^DVBAXA15
C22S S X="" G:DG(DQ)=X C22F1 K DB
D ^DVBAXA16
C22F1 Q
X22 S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),"^",5),1:0) K:'Z0 X Q:'Z0!'$D(^DIC(5,Z0,1,0)) S DIC="^DIC(5,Z0,1,",DIC(0)="QEM" D ^DIC S X=+Y K:Y'>0 X K Z0,DIC
Q
;
23 D:$D(DG)>9 F^DIE17,DE S DQ=23,DW=".13;1",DV="Fa",DU="",DIFLD=.131,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C23^DVBAXA"
G RE
C23 G C23S:$D(DE(23))[0 K DB
D ^DVBAXA17
C23S S X="" G:DG(DQ)=X C23F1 K DB
D ^DVBAXA18
C23F1 Q
X23 K:$L(X)>20!($L(X)<4) X
I $D(X),X'?.ANP K X
Q
;
24 D:$D(DG)>9 F^DIE17,DE S DQ=24,DW=".13;2",DV="Fa",DU="",DIFLD=.132,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C24^DVBAXA"
G RE
C24 G C24S:$D(DE(24))[0 K DB
D ^DVBAXA19
C24S S X="" G:DG(DQ)=X C24F1 K DB
D ^DVBAXA20
C24F1 Q
X24 K:$L(X)>20!($L(X)<4) X
I $D(X),X'?.ANP K X
Q
;
25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 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
X25 S DVBACPLT=1
Q
26 D:$D(DG)>9 F^DIE17,DE S DQ=26,DW=".32;6",DV="RDX",DU="",DIFLD=.326,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C26^DVBAXA",DE(DW,"INDEX")=1
G RE
C26 G C26S:$D(DE(26))[0 K DB
S X=DE(26),DIC=DIE
;
S X=DE(26),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DE(26),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
C26S S X="" G:DG(DQ)=X C26F1 K DB
D ^DVBAXA21
C26F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=640 S DIEZRXR(2,DIXR)=""
Q
X26 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
Q
;
27 D:$D(DG)>9 F^DIE17,DE S DQ=27,DW=".32;7",DV="RDX",DU="",DIFLD=.327,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C27^DVBAXA",DE(DW,"INDEX")=1
G RE
C27 G C27S:$D(DE(27))[0 K DB
S X=DE(27),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DE(27),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
C27S S X="" G:DG(DQ)=X C27F1 K DB
D ^DVBAXA22
C27F1 S DIEZRXR(2,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=303,640 S DIEZRXR(2,DIXR)=""
Q
X27 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
Q
;
28 S DQ=29 ;@2
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 *7,!!,"Need to edit the information you've just entered" S %=1 D YN^DICN
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 I $D(%Y) I %Y["?" W !!,"Enter Y to go back and correct any errors or ",!,"you may enter N to proceed." S Y="@2"
Q
31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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
X31 I $D(%),%=1 W @IOF,! S Y="@1"
Q
32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 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
X32 K %,%Y
Q
33 G 0^DIE17
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBAXA 28097 printed Dec 13, 2024@01:42:29 Page 2
DVBAXA ; GENERATED FROM 'DVBA C ADD 2507 PAT' INPUT TEMPLATE(#965), FILE 2;10/30/24
+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(^(0))
SET %Z=^(0)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(4)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(5)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(6)=%
+2 IF $DATA(^(.11))
SET %Z=^(.11)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(16)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(17)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(18)=%
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(19)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(20)=%
SET %=$PIECE(%Z,U,7)
if %]""
SET DE(22)=%
SET %=$PIECE(%Z,U,12)
if %]""
SET DE(21)=%
+3 IF $DATA(^(.13))
SET %Z=^(.13)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(23)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(24)=%
+4 IF $DATA(^(.3))
SET %Z=^(.3)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(9)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(10)=%
+5 IF $DATA(^(.31))
SET %Z=^(.31)
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(7)=%
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(8)=%
+6 IF $DATA(^(.32))
SET %Z=^(.32)
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(15)=%
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(26)=%
SET %=$PIECE(%Z,U,7)
if %]""
SET DE(27)=%
+7 IF $DATA(^(.36))
SET %Z=^(.36)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(13)=%
+8 IF $DATA(^(.52))
SET %Z=^(.52)
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(14)=%
+9 IF $DATA(^("TYPE"))
SET %Z=^("TYPE")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(11)=%
+10 IF $DATA(^("VET"))
SET %Z=^("VET")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(12)=%
+11 KILL %Z
QUIT
+12 ;
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="DVBAXA"
SET DQ=1
+1 NEW DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR
KILL DIEFIRE,DIEBADK
SET DIEZTMP=$$GETTMP^DIKC1("DIEZ")
+2 MERGE DIEZAR=^DIE(965,"AR")
SET DICRREC="TRIG^DIE17"
+3 if $DATA(DTIME)[0
SET DTIME=300
SET D0=DA
SET DIIENS=DA_","
SET DIEZ=965
SET U="^"
1 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=1
DO X1
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
X1 SET DVBACPLT=0
IF '$DATA(IOF)
SET IOP="HOME"
DO ^%ZIS
KILL IOP
+1 QUIT
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 @IOF,!,"Please review previous information entered as well as",!,"entering additional REQUIRED information:",!!!
+1 QUIT
3 ;@1
SET DQ=4
4 SET DW="0;1"
SET DV="RFXa"
SET DU=""
SET DIFLD=.01
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C4^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C4 if $DATA(DE(4))[0
GOTO C4S
KILL DB
+1 SET X=DE(4)
SET DIC=DIE
+2 KILL ^DPT("B",$EXTRACT(X,1,30),DA)
+3 SET X=DE(4)
SET DIC=DIE
+4 XECUTE "Q:$P(^DPT(DA,0),U,9)']"""" K ^DPT(""BS5"",$E(X,1)_$E($P(^(0),U,9),6,9),DA)"
+5 SET X=DE(4)
SET DIC=DIE
+6 SET A1B2TAG="PAT"
DO ^A1B2XFR
+7 SET X=DE(4)
SET DIC=DIE
+8 XECUTE "S DFN=DA D ^DGPATN K DGNEWVAL Q"
+9 SET X=DE(4)
SET DIC=DIE
+10 SET IVMX=X
SET X="IVMPXFR"
XECUTE ^%ZOSF("TEST")
if $TEST
DO DPT^IVMPXFR
SET X=IVMX
KILL IVMX
+11 SET X=DE(4)
SET DIC=DIE
+12 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".01;"
DO AVAFC^VAFCDD01(DA)
+13 SET X=DE(4)
SET DIC=DIE
+14 IF $TEXT(KILL^VAFCMIS)'=""&('$DATA(VAFCNO))
DO KILL^VAFCMIS(DA)
+15 SET X=DE(4)
SET DIC=DIE
+16 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+17 SET X=DE(4)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C4S SET X=""
if DG(DQ)=X
GOTO C4F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DPT("B",$EXTRACT(X,1,30),DA)=""
+3 SET X=DG(DQ)
SET DIC=DIE
+4 XECUTE "Q:$P(^DPT(DA,0),U,9)']"""" S ^DPT(""BS5"",$E(X,1)_$E($P(^(0),U,9),6,9),DA)="""""
+5 SET X=DG(DQ)
SET DIC=DIE
+6 SET A1B2TAG="PAT"
DO ^A1B2XFR
+7 SET X=DG(DQ)
SET DIC=DIE
+8 XECUTE "K DGNEWVAL Q"
+9 SET X=DG(DQ)
SET DIC=DIE
+10 SET IVMX=X
SET X="IVMPXFR"
XECUTE ^%ZOSF("TEST")
if $TEST
DO DPT^IVMPXFR
SET X=IVMX
KILL IVMX
+11 SET X=DG(DQ)
SET DIC=DIE
+12 IF '$DATA(DFN)
IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".01;"
DO AVAFC^VAFCDD01(DA)
+13 SET X=DG(DQ)
SET DIC=DIE
+14 IF $TEXT(SET^VAFCMIS)'=""&('$DATA(VAFCNO))
DO SET^VAFCMIS(DA)
+15 SET X=DG(DQ)
SET DIC=DIE
+16 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+17 IF $DATA(DE(4))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C4F1 NEW X,X1,X2
SET DIXR=177
DO C4X1(U)
KILL X2
MERGE X2=X
DO C4X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.01,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.01,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C4F2
C4X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.01,DION),$PIECE($GET(^DPT(DA,0)),U,1))
+2 SET X=$GET(X(1))
+3 QUIT
C4F2 SET DIXR=588
DO C4X2(U)
KILL X2
MERGE X2=X
DO C4X2("O")
KILL X1
MERGE X1=X
+1 IF $GET(X(1))]""
Begin DoDot:1
+2 KILL ^DPT("NOP",$EXTRACT(X,1,30),DA)
End DoDot:1
+3 KILL X
MERGE X=X2
IF $GET(X(1))]""
Begin DoDot:1
+4 SET ^DPT("NOP",$EXTRACT(X,1,30),DA)=""
End DoDot:1
+5 GOTO C4F3
C4X2(DION) KILL X
+1 SET X=$GET(@DIEZTMP@("V",2,DIIENS,.01,DION),$PIECE($GET(^DPT(DA,0)),U,1))
+2 IF $DATA(X)#2
SET X=$$NOP^XLFNAME7(X)
+3 if $DATA(X)#2
SET X(1)=X
+4 SET X=$GET(X(1))
+5 QUIT
C4F3 SET DIXR=589
DO C4X3(U)
KILL X2
MERGE X2=X
DO C4X3("O")
KILL X1
MERGE X1=X
+1 IF $GET(X(1))]""
Begin DoDot:1
+2 IF '$GET(XUNOTRIG)
NEW XUNOTRIG
SET XUNOTRIG=1
DO DELCOMP^XLFNAME2(2,.DA,.01,1.01)
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
IF $GET(X(1))]""
Begin DoDot:1
+4 IF '$GET(XUNOTRIG)
NEW XUNOTRIG
SET XUNOTRIG=1
SET DG20NAME=X
DO NARY^XLFNAME7(.DG20NAME)
DO UPDCOMP^XLFNAME2(2,.DA,.01,.DG20NAME,1.01,+$PIECE($GET(^DPT(DA,"NAME")),U),"CL30")
KILL DG20NAME
QUIT
End DoDot:1
+5 GOTO C4F4
C4X3(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.01,DION),$PIECE($GET(^DPT(DA,0)),U,1))
+2 SET X=$GET(X(1))
+3 QUIT
C4F4 QUIT
X4 if $LENGTH(X)>30!($LENGTH(X)<3)
KILL X
IF $DATA(X)
SET DG20NAME=X
SET (X,DG20NAME)=$$FORMAT^XLFNAME7(.DG20NAME,3,30)
if '$LENGTH(X)
KILL X,DG20NAME
if $DATA(X)
SET DGNEWVAL=X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=5
SET DW="0;2"
SET DV="RSaR"
SET DU=""
SET DIFLD=.02
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C5^DVBAXA"
SET DE(DW,"INDEX")=1
+2 SET DU="M:MALE;F:FEMALE;"
+3 GOTO RE
C5 if $DATA(DE(5))[0
GOTO C5S
KILL DB
+1 SET X=DE(5)
SET DIC=DIE
+2 KILL ^DPT("ASX",$EXTRACT(X,1,30),DA)
+3 SET X=DE(5)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
+5 SET X=DE(5)
SET DIC=DIE
+6 SET IVMX=X
SET IVMKILL=2
SET X="IVMPXFR"
XECUTE ^%ZOSF("TEST")
if $TEST
DO DPT^IVMPXFR
SET X=IVMX
KILL IVMX,IVMKILL
+7 SET X=DE(5)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".02;"
DO AVAFC^VAFCDD01(DA)
+9 SET X=DE(5)
SET DIC=DIE
+10 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+11 SET X=DE(5)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C5S SET X=""
if DG(DQ)=X
GOTO C5F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DPT("ASX",$EXTRACT(X,1,30),DA)=""
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 SET IVMX=X
SET X="IVMPXFR"
XECUTE ^%ZOSF("TEST")
if $TEST
DO DPT^IVMPXFR
SET X=IVMX
KILL IVMX
+7 SET X=DG(DQ)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".02;"
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(5))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C5F1 NEW X,X1,X2
SET DIXR=811
DO C5X1(U)
KILL X2
MERGE X2=X
DO C5X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.02,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.02,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C5F2
C5X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.02,DION),$PIECE($GET(^DPT(DA,0)),U,2))
+2 SET X=$GET(X(1))
+3 QUIT
C5F2 QUIT
X5 QUIT
6 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=6
SET DW="0;9"
SET DV="RFXaR"
SET DU=""
SET DIFLD=.09
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C6^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C6 if $DATA(DE(6))[0
GOTO C6S
KILL DB
+1 SET X=DE(6)
SET DIC=DIE
+2 if $EXTRACT(X,6,9)'=""
KILL ^DPT("BS",$EXTRACT(X,6,9),DA)
+3 SET X=DE(6)
SET DIC=DIE
+4 ;
+5 SET X=DE(6)
SET DIC=DIE
+6 KILL ^DPT("BS5",$EXTRACT(^DPT(DA,0),1)_$EXTRACT(X,6,9),DA)
+7 SET X=DE(6)
SET DIC=DIE
+8 SET A1B2TAG="PAT"
DO ^A1B2XFR
+9 SET X=DE(6)
SET DIC=DIE
+10 DO KILL^DGREGDD1(DA,.6,0,21,0)
+11 SET X=DE(6)
SET DIC=DIE
+12 KILL ^DPT("SSN",$EXTRACT(X,1,30),DA)
+13 SET X=DE(6)
SET DIC=DIE
+14 SET VADFN=DA
DO KILL^VADPT6
KILL VADFN
+15 SET X=DE(6)
SET DIC=DIE
+16 SET PPP=X
SET X="PPPFMX"
XECUTE ^%ZOSF("TEST")
if $TEST
DO KNSSN^PPPFMX
SET X=PPP
KILL PPP
+17 SET X=DE(6)
SET DIC=DIE
+18 ;
+19 SET X=DE(6)
SET DIC=DIE
+20 SET IVMX=X
SET X="IVMPXFR"
XECUTE ^%ZOSF("TEST")
if $TEST
DO DPT^IVMPXFR
SET X=IVMX
KILL IVMX
+21 SET X=DE(6)
SET DIC=DIE
+22 SET PX=X
SET X="PXXDPT"
XECUTE ^%ZOSF("TEST")
if $TEST
DO KILLSSN^PXXDPT
SET X=PX
KILL PX
+23 SET X=DE(6)
SET DIC=DIE
+24 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".09;"
DO AVAFC^VAFCDD01(DA)
+25 SET X=DE(6)
SET DIC=DIE
+26 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+27 SET X=DE(6)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C6S SET X=""
if DG(DQ)=X
GOTO C6F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DPT("BS",$EXTRACT(X,6,9),DA)=""
+3 SET X=DG(DQ)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DPT(D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X="1"
XECUTE ^DD(2,.09,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 SET ^DPT("BS5",$EXTRACT(^DPT(DA,0),1)_$EXTRACT(X,6,9),DA)=""
+7 SET X=DG(DQ)
SET DIC=DIE
+8 SET A1B2TAG="PAT"
DO ^A1B2XFR
+9 SET X=DG(DQ)
SET DIC=DIE
+10 IF $EXTRACT(X,1,5)="00000"
DO SET^DGREGDD1(DA,.6,0,21,1)
+11 SET X=DG(DQ)
SET DIC=DIE
+12 SET ^DPT("SSN",$EXTRACT(X,1,30),DA)=""
+13 SET X=DG(DQ)
SET DIC=DIE
+14 SET VADFN=DA
DO SET^VADPT6
KILL VADFN
+15 SET X=DG(DQ)
SET DIC=DIE
+16 SET PPP=X
SET X="PPPFMX"
XECUTE ^%ZOSF("TEST")
if $TEST
DO SNSSN^PPPFMX
SET X=PPP
KILL PPP
+17 SET X=DG(DQ)
SET DIC=DIE
+18 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X=Y(0)'["P"
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,"SSN")):^("SSN"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.09,1,10,1.4)
+19 SET X=DG(DQ)
SET DIC=DIE
+20 SET IVMX=X
SET X="IVMPXFR"
XECUTE ^%ZOSF("TEST")
if $TEST
DO DPT^IVMPXFR
SET X=IVMX
KILL IVMX
+21 SET X=DG(DQ)
SET DIC=DIE
+22 SET PX=X
SET X="PXXDPT"
XECUTE ^%ZOSF("TEST")
if $TEST
DO SETSSN^PXXDPT
SET X=PX
KILL PX
+23 SET X=DG(DQ)
SET DIC=DIE
+24 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".09;"
DO AVAFC^VAFCDD01(DA)
+25 SET X=DG(DQ)
SET DIC=DIE
+26 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+27 IF $DATA(DE(6))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C6F1 NEW X,X1,X2
SET DIXR=179
DO C6X1(U)
KILL X2
MERGE X2=X
DO C6X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.09,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.09,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C6F2
C6X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.09,DION),$PIECE($GET(^DPT(DA,0)),U,9))
+2 SET X=$GET(X(1))
+3 QUIT
C6F2 QUIT
X6 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if '$DATA(DPTX)
SET DFN=DA
DO SSN^DGINP
QUIT
IF $LENGTH(X)>10
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
7 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=7
SET DW=".31;3"
SET DV="FXOaR"
SET DU=""
SET DIFLD=.313
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(7,2)="S Y(0)=Y S Y=$E(Y,1,10)"
+2 SET DE(DW)="C7^DVBAXA"
+3 GOTO RE
C7 if $DATA(DE(7))[0
GOTO C7S
KILL DB
+1 SET X=DE(7)
SET DIC=DIE
+2 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".313;"
DO AVAFC^VAFCDD01(DA)
+3 SET X=DE(7)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
+5 SET X=DE(7)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C7S SET X=""
if DG(DQ)=X
GOTO C7F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".313;"
DO AVAFC^VAFCDD01(DA)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
+5 IF $DATA(DE(7))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C7F1 QUIT
X7 SET DFN=DA
DO EV^DGLOCK
IF $DATA(X)
SET L=$SELECT($DATA(^DPT(DA,0)):$PIECE(^(0),U,9),1:X)
if X?1"SS".E
WRITE " ",L
if X?1"SS".E
SET X=L
if $LENGTH(X)>9
KILL X
if '$DATA(X)
QUIT
IF X'=L
if $LENGTH(X)>8!($LENGTH(X)<7)!'(X?.N)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
8 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=8
SET DW=".31;4"
SET DV="*P4'XR"
SET DU=""
SET DIFLD=.314
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C8^DVBAXA"
+2 SET DU="DIC(4,"
+3 GOTO RE
C8 if $DATA(DE(8))[0
GOTO C8S
KILL DB
+1 SET X=DE(8)
SET DIC=DIE
+2 DO KILL^DGREGDD(DA)
C8S SET X=""
if DG(DQ)=X
GOTO C8F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO SET^DGREGDD(DA,X)
C8F1 QUIT
X8 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 ;
9 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=9
SET DW=".3;1"
SET DV="RSXa"
SET DU=""
SET DIFLD=.301
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C9^DVBAXA"
+2 SET DU="Y:YES;N:NO;"
+3 GOTO RE
C9 if $DATA(DE(9))[0
GOTO C9S
KILL DB
+1 SET X=DE(9)
SET DIC=DIE
+2 ;
+3 SET X=DE(9)
SET DIC=DIE
+4 ;
+5 SET X=DE(9)
SET DIC=DIE
+6 DO AUTOUPD^DGENA2(DA)
+7 SET X=DE(9)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".301;"
DO AVAFC^VAFCDD01(DA)
+9 SET X=DE(9)
SET DIC=DIE
+10 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+11 SET X=DE(9)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C9S SET X=""
if DG(DQ)=X
GOTO C9F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(2,.301,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.3)):^(.3),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.301,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 XECUTE ^DD(2,.301,1,2,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.3)):^(.3),1:"")
SET X=$PIECE(Y(1),U,12)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.301,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 DO AUTOUPD^DGENA2(DA)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".301;"
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(9))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C9F1 QUIT
X9 SET DFN=DA
DO EV^DGLOCK
IF $DATA(X)
IF X="Y"
DO VET^DGLOCK
+1 QUIT
+2 ;
10 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=10
SET DW=".3;2"
SET DV="NJ3,0Xa"
SET DU=""
SET DIFLD=.302
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C10^DVBAXA"
+2 GOTO RE
C10 if $DATA(DE(10))[0
GOTO C10S
KILL DB
+1 SET X=DE(10)
SET DIC=DIE
+2 ;
+3 SET X=DE(10)
SET DIC=DIE
+4 DO AUTOUPD^DGENA2(DA)
+5 SET X=DE(10)
SET DIC=DIE
+6 ;
+7 SET X=DE(10)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".302;"
DO AVAFC^VAFCDD01(DA)
+9 SET X=DE(10)
SET DIC=DIE
+10 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+11 SET X=DE(10)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C10S SET X=""
if DG(DQ)=X
GOTO C10F1
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(10))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C10F1 QUIT
X10 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 ;
11 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=11
SET DW="TYPE;1"
SET DV="RP391'a"
SET DU=""
SET DIFLD=391
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C11^DVBAXA"
SET DE(DW,"INDEX")=1
+2 SET DU="DG(391,"
+3 GOTO RE
C11 if $DATA(DE(11))[0
GOTO C11S
KILL DB
+1 SET X=DE(11)
SET DIC=DIE
+2 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF="391;"
DO AVAFC^VAFCDD01(DA)
+3 SET X=DE(11)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C11S SET X=""
if DG(DQ)=X
GOTO C11F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF="391;"
DO AVAFC^VAFCDD01(DA)
+3 IF $DATA(DE(11))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C11F1 NEW X,X1,X2
SET DIXR=643
DO C11X1(U)
KILL X2
MERGE X2=X
DO C11X1("O")
KILL X1
MERGE X1=X
+1 IF $GET(X(1))]""
Begin DoDot:1
+2 KILL ^DPT("APTYPE",X,DA)
End DoDot:1
+3 KILL X
MERGE X=X2
IF $GET(X(1))]""
Begin DoDot:1
+4 SET ^DPT("APTYPE",X,DA)=""
End DoDot:1
+5 GOTO C11F2
C11X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,391,DION),$PIECE($GET(^DPT(DA,"TYPE")),U,1))
+2 SET X=$GET(X(1))
+3 QUIT
C11F2 QUIT
X11 QUIT
12 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=12
SET DW="VET;1"
SET DV="RSXa"
SET DU=""
SET DIFLD=1901
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C12^DVBAXA"
+2 SET DU="Y:YES;N:NO;"
+3 GOTO RE
C12 if $DATA(DE(12))[0
GOTO C12S
KILL DB
+1 SET X=DE(12)
SET DIC=DIE
+2 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+3 SET X=DE(12)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGRP7CC
+5 SET X=DE(12)
SET DIC=DIE
+6 ;
+7 SET X=DE(12)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
+9 SET X=DE(12)
SET DIC=DIE
+10 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF="1901;"
DO AVAFC^VAFCDD01(DA)
+11 SET X=DE(12)
SET DIC=DIE
+12 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+13 SET X=DE(12)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C12S SET X=""
if DG(DQ)=X
GOTO C12F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGRP7CC
+5 SET X=DG(DQ)
SET DIC=DIE
+6 XECUTE ^DD(2,1901,1,3,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.3)):^(.3),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X="N"
XECUTE ^DD(2,1901,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
+9 SET X=DG(DQ)
SET DIC=DIE
+10 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF="1901;"
DO AVAFC^VAFCDD01(DA)
+11 SET X=DG(DQ)
SET DIC=DIE
+12 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+13 IF $DATA(DE(12))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C12F1 QUIT
X12 IF $DATA(X)
if '$DATA(DPTX)
SET DFN=DA
if '$DATA(^XUSEC("DG ELIGIBILITY",DUZ))
if X="Y"
DO VAGE^DGLOCK
IF $DATA(X)
if $DATA(DFN)
DO EV^DGLOCK
+1 QUIT
+2 ;
13 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=13
SET DW=".36;1"
SET DV="*P8'XaR"
SET DU=""
SET DIFLD=.361
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C13^DVBAXA"
SET DE(DW,"INDEX")=1
+2 SET DU="DIC(8,"
+3 GOTO RE
C13 if $DATA(DE(13))[0
GOTO C13S
KILL DB
+1 SET X=DE(13)
SET DIC=DIE
+2 ;
+3 SET X=DE(13)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
XECUTE ^DD(2,.361,1,2,2.2)
IF DIV(1)>0
SET DIK(0)=DA
SET DIK="^DPT(DIV(0),""E"","
SET DA(1)=DIV(0)
SET DA=DIV(1)
DO ^DIK
SET DA=DIK(0)
KILL DIK
+5 SET X=DE(13)
SET DIC=DIE
+6 XECUTE "I $S('$D(^DIC(8,+X,0)):0,$P(^(0),""^"",1)[""DOM"":0,'$D(^DPT(DA,.36)):1,'$D(^DIC(8,+^(.36),0)):1,$P(^(0),""^"",1)'[""DOM"":1,1:0) S DGXRF=.361 D ^DGDDC Q"
+7 SET X=DE(13)
SET DIC=DIE
+8 KILL ^DPT("AEL",DA,+X)
IF X=$$FIND1^DIC(8,"","B","COLLATERAL OF VET")
DO ARCHALL^DGRP1152U(DA)
+9 SET X=DE(13)
SET DIC=DIE
+10 DO AUTOUPD^DGENA2(DA)
+11 SET X=DE(13)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C13S SET X=""
if DG(DQ)=X
GOTO C13F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE "S DFN=DA D INACT33^DGOTHEL(DFN),EN^DGMTR K DGREQF"
+3 SET X=DG(DQ)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
XECUTE ^DD(2,.361,1,2,89.4)
SET Y(102)=$SELECT($DATA(^DPT(D0,"E",D1,0)):^(0),1:"")
SET X=$SELECT('$DATA(^DIC(8,+$PIECE(Y(102),U,1),0)):"",1:$PIECE(^(0),U,1))
SET D0=I(0,0)
SET D1=I(1,0)
SET DIU=X
KILL Y
SET X=DIV
SET X=DIV
SET X=X
XECUTE ^DD(2,.361,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 ;
+7 SET X=DG(DQ)
SET DIC=DIE
+8 SET ^DPT("AEL",DA,+X)=""
DO RESTORE^DGRP1152U(DA)
+9 SET X=DG(DQ)
SET DIC=DIE
+10 DO AUTOUPD^DGENA2(DA)
+11 IF $DATA(DE(13))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C13F1 NEW X,X1,X2
SET DIXR=815
DO C13X1(U)
KILL X2
MERGE X2=X
DO C13X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.361,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.361,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C13F2
C13X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.361,DION),$PIECE($GET(^DPT(DA,.36)),U,1))
+2 SET X=$GET(X(1))
+3 QUIT
C13F2 QUIT
X13 SET DFN=DA
DO EV^DGLOCK
IF $DATA(X)
DO ECD^DGLOCK1
+1 QUIT
+2 ;
14 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=14
SET DW=".52;5"
SET DV="RSXR"
SET DU=""
SET DIFLD=.525
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C14^DVBAXA"
SET DE(DW,"INDEX")=1
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 GOTO RE
C14 if $DATA(DE(14))[0
GOTO C14S
KILL DB
+1 SET X=DE(14)
SET DIC=DIE
+2 ;
+3 SET X=DE(14)
SET DIC=DIE
+4 ;
+5 SET X=DE(14)
SET DIC=DIE
+6 ;
+7 SET X=DE(14)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
+9 SET X=DE(14)
SET DIC=DIE
+10 XECUTE "S DFN=DA D EN^DGMTR K DGREQF"
+11 SET X=DE(14)
SET DIC=DIE
+12 DO EVENT^IVMPLOG(DA)
C14S SET X=""
if DG(DQ)=X
GOTO C14F1
KILL DB
+1 DO ^DVBAXA1
C14F1 NEW X,X1,X2
SET DIXR=627
DO C14X1(U)
KILL X2
MERGE X2=X
DO C14X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.525,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.525,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C14F2
C14X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.525,DION),$PIECE($GET(^DPT(DA,.52)),U,5))
+2 SET X=$GET(X(1))
+3 QUIT
C14F2 QUIT
X14 SET DFN=DA
DO POWV^DGLOCK
IF $DATA(X)
DO SV^DGLOCK
+1 QUIT
+2 ;
15 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=15
SET DW=".32;3"
SET DV="*P21'XaR"
SET DU=""
SET DIFLD=.323
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C15^DVBAXA"
+2 SET DU="DIC(21,"
+3 GOTO RE
C15 if $DATA(DE(15))[0
GOTO C15S
KILL DB
+1 SET X=DE(15)
SET DIC=DIE
+2 KILL ^DPT("APOS",$EXTRACT(X,1,30),DA)
+3 SET X=DE(15)
SET DIC=DIE
+4 ;
+5 SET X=DE(15)
SET DIC=DIE
+6 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".323;"
DO AVAFC^VAFCDD01(DA)
+7 SET X=DE(15)
SET DIC=DIE
+8 DO EVENT^IVMPLOG(DA)
+9 SET X=DE(15)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C15S SET X=""
if DG(DQ)=X
GOTO C15F1
KILL DB
+1 DO ^DVBAXA2
C15F1 QUIT
X15 SET DFN=DA
DO POS^DGLOCK1
+1 QUIT
+2 ;
16 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=16
SET DW=".11;1"
SET DV="FaXJ35R"
SET DU=""
SET DIFLD=.111
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C16^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C16 if $DATA(DE(16))[0
GOTO C16S
KILL DB
+1 DO ^DVBAXA3
C16S SET X=""
if DG(DQ)=X
GOTO C16F1
KILL DB
+1 DO ^DVBAXA4
C16F1 NEW X,X1,X2
SET DIXR=230
DO C16X1(U)
KILL X2
MERGE X2=X
DO C16X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.111,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.111,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C16F2
C16X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.111,DION),$PIECE($GET(^DPT(DA,.11)),U,1))
+2 SET X=$GET(X(1))
+3 QUIT
C16F2 QUIT
X16 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>35!($LENGTH(X)<3)
KILL X
if $DATA(X)
DO UP^DGHELP
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
17 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=17
SET DW=".11;2"
SET DV="Fa"
SET DU=""
SET DIFLD=.112
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C17^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C17 if $DATA(DE(17))[0
GOTO C17S
KILL DB
+1 DO ^DVBAXA5
C17S SET X=""
if DG(DQ)=X
GOTO C17F1
KILL DB
+1 DO ^DVBAXA6
C17F1 NEW X,X1,X2
SET DIXR=232
DO C17X1(U)
KILL X2
MERGE X2=X
DO C17X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.112,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.112,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C17F2
C17X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.112,DION),$PIECE($GET(^DPT(DA,.11)),U,2))
+2 SET X=$GET(X(1))
+3 QUIT
C17F2 QUIT
X17 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>30!($LENGTH(X)<3)
KILL X
if $DATA(X)
DO UP^DGHELP
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
18 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=18
SET DW=".11;3"
SET DV="FaXJ30"
SET DU=""
SET DIFLD=.113
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C18^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C18 if $DATA(DE(18))[0
GOTO C18S
KILL DB
+1 DO ^DVBAXA7
C18S SET X=""
if DG(DQ)=X
GOTO C18F1
KILL DB
+1 DO ^DVBAXA8
C18F1 NEW X,X1,X2
SET DIXR=233
DO C18X1(U)
KILL X2
MERGE X2=X
DO C18X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.113,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.113,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C18F2
C18X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.113,DION),$PIECE($GET(^DPT(DA,.11)),U,3))
+2 SET X=$GET(X(1))
+3 QUIT
C18F2 QUIT
X18 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>30!($LENGTH(X)<3)
KILL X
if $DATA(X)
DO UP^DGHELP
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
19 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=19
SET DW=".11;4"
SET DV="FaXJ15R"
SET DU=""
SET DIFLD=.114
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C19^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C19 if $DATA(DE(19))[0
GOTO C19S
KILL DB
+1 DO ^DVBAXA9
C19S SET X=""
if DG(DQ)=X
GOTO C19F1
KILL DB
+1 DO ^DVBAXA10
C19F1 NEW X,X1,X2
SET DIXR=234
DO C19X1(U)
KILL X2
MERGE X2=X
DO C19X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.114,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.114,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C19F2
C19X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.114,DION),$PIECE($GET(^DPT(DA,.11)),U,4))
+2 SET X=$GET(X(1))
+3 QUIT
C19F2 QUIT
X19 if $LENGTH(X)>15!($LENGTH(X)<2)
KILL X
if $DATA(X)
DO UP^DGHELP
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
20 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=20
SET DW=".11;5"
SET DV="*P5'aR"
SET DU=""
SET DIFLD=.115
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C20^DVBAXA"
SET DE(DW,"INDEX")=1
+2 SET DU="DIC(5,"
+3 GOTO RE
C20 if $DATA(DE(20))[0
GOTO C20S
KILL DB
+1 DO ^DVBAXA11
C20S SET X=""
if DG(DQ)=X
GOTO C20F1
KILL DB
+1 DO ^DVBAXA12
C20F1 NEW X,X1,X2
SET DIXR=235
DO C20X1(U)
KILL X2
MERGE X2=X
DO C20X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.115,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.115,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C20F2
C20X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.115,DION),$PIECE($GET(^DPT(DA,.11)),U,5))
+2 SET X=$GET(X(1))
+3 QUIT
C20F2 QUIT
X20 SET DIC("S")="I $P(^DIC(5,Y,0),U,6)=1"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
21 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=21
SET DW=".11;12"
SET DV="FXOaR"
SET DU=""
SET DIFLD=.1112
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(21,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
+2 SET DE(DW)="C21^DVBAXA"
SET DE(DW,"INDEX")=1
+3 GOTO RE
C21 if $DATA(DE(21))[0
GOTO C21S
KILL DB
+1 DO ^DVBAXA13
C21S SET X=""
if DG(DQ)=X
GOTO C21F1
KILL DB
+1 DO ^DVBAXA14
C21F1 NEW X,X1,X2
SET DIXR=185
DO C21X1(U)
KILL X2
MERGE X2=X
DO C21X1("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 NEW DIEXARR
MERGE DIEXARR=X
SET DIEZCOND=1
+3 IF X1(1)'=X2(1)
+4 SET DIEZCOND=$GET(X)
KILL X
MERGE X=DIEXARR
if 'DIEZCOND
QUIT
+5 KILL EASDO2
End DoDot:1
+6 GOTO C21F2
C21X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.1112,DION),$PIECE($GET(^DPT(DA,.11)),U,12))
+2 if ('$GET(EASDO2)&($DATA(EASZIPLK)))
SET X=$$ZIP^DGREGDD1(DA,X(1))
+3 if $DATA(X)#2
SET X(2)=X
+4 SET X=$GET(X(1))
+5 QUIT
C21F2 SET DIXR=231
DO C21X2(U)
KILL X2
MERGE X2=X
DO C21X2("O")
KILL X1
MERGE X1=X
+1 Begin DoDot:1
+2 DO FC^DGFCPROT(.DA,2,.1112,"KILL",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+3 KILL X
MERGE X=X2
Begin DoDot:1
+4 DO FC^DGFCPROT(.DA,2,.1112,"SET",$HOROLOG,$GET(DUZ),.X,.X1,.X2,$GET(XQY0))
QUIT
End DoDot:1
+5 GOTO C21F3
C21X2(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",2,DIIENS,.1112,DION),$PIECE($GET(^DPT(DA,.11)),U,12))
+2 SET X=$GET(X(1))
+3 QUIT
C21F3 QUIT
X21 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>20!($LENGTH(X)<5)
KILL X
IF $DATA(X)
DO ZIPIN^VAFADDR
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=22
SET DW=".11;7"
SET DV="NJ3,0XOaR"
SET DU=""
SET DIFLD=.117
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(22,2)="S Y(0)=Y Q:Y']"""" S Z0=$S($D(^DPT(D0,.11)):+$P(^(.11),""^"",5),1:"""") Q:'Z0 S Y=$P($S($D(^DIC(5,Z0,1,Y,0)):^(0),1:""""),""^"",3)"
+2 SET DE(DW)="C22^DVBAXA"
+3 GOTO RE
C22 if $DATA(DE(22))[0
GOTO C22S
KILL DB
+1 DO ^DVBAXA15
C22S SET X=""
if DG(DQ)=X
GOTO C22F1
KILL DB
+1 DO ^DVBAXA16
C22F1 QUIT
X22 SET Z0=$SELECT($DATA(^DPT(D0,.11)):+$PIECE(^(.11),"^",5),1:0)
if 'Z0
KILL X
if 'Z0!'$DATA(^DIC(5,Z0,1,0))
QUIT
SET DIC="^DIC(5,Z0,1,"
SET DIC(0)="QEM"
DO ^DIC
SET X=+Y
if Y'>0
KILL X
KILL Z0,DIC
+1 QUIT
+2 ;
23 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=23
SET DW=".13;1"
SET DV="Fa"
SET DU=""
SET DIFLD=.131
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C23^DVBAXA"
+2 GOTO RE
C23 if $DATA(DE(23))[0
GOTO C23S
KILL DB
+1 DO ^DVBAXA17
C23S SET X=""
if DG(DQ)=X
GOTO C23F1
KILL DB
+1 DO ^DVBAXA18
C23F1 QUIT
X23 if $LENGTH(X)>20!($LENGTH(X)<4)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
24 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=24
SET DW=".13;2"
SET DV="Fa"
SET DU=""
SET DIFLD=.132
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C24^DVBAXA"
+2 GOTO RE
C24 if $DATA(DE(24))[0
GOTO C24S
KILL DB
+1 DO ^DVBAXA19
C24S SET X=""
if DG(DQ)=X
GOTO C24F1
KILL DB
+1 DO ^DVBAXA20
C24F1 QUIT
X24 if $LENGTH(X)>20!($LENGTH(X)<4)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
25 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=25
DO X25
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
X25 SET DVBACPLT=1
+1 QUIT
26 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=26
SET DW=".32;6"
SET DV="RDX"
SET DU=""
SET DIFLD=.326
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C26^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C26 if $DATA(DE(26))[0
GOTO C26S
KILL DB
+1 SET X=DE(26)
SET DIC=DIE
+2 ;
+3 SET X=DE(26)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
+5 SET X=DE(26)
SET DIC=DIE
+6 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
C26S SET X=""
if DG(DQ)=X
GOTO C26F1
KILL DB
+1 DO ^DVBAXA21
C26F1 SET DIEZRXR(2,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=640
SET DIEZRXR(2,DIXR)=""
+2 QUIT
X26 SET %DT="E"
SET %DT(0)=-DT
DO ^%DT
KILL %DT
SET X=Y
if Y<1
KILL X
IF $DATA(X)
SET DFN=DA
DO SV^DGLOCK
IF $DATA(X)
if '$$VALMSE^DGRPMS(DFN,X,0,"MSL")
KILL X
IF $DATA(X)
SET DGFRDT=X
IF $DATA(^DG(43,1))
SET SD1=1
DO POS^DGINP
+1 QUIT
+2 ;
27 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=27
SET DW=".32;7"
SET DV="RDX"
SET DU=""
SET DIFLD=.327
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C27^DVBAXA"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C27 if $DATA(DE(27))[0
GOTO C27S
KILL DB
+1 SET X=DE(27)
SET DIC=DIE
+2 DO EVENT^IVMPLOG(DA)
+3 SET X=DE(27)
SET DIC=DIE
+4 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
C27S SET X=""
if DG(DQ)=X
GOTO C27F1
KILL DB
+1 DO ^DVBAXA22
C27F1 SET DIEZRXR(2,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=303,640
SET DIEZRXR(2,DIXR)=""
+2 QUIT
X27 SET %DT="E"
SET %DT(0)=-DT
DO ^%DT
KILL %DT
SET X=Y
if Y<1
KILL X
IF $DATA(X)
SET DFN=DA
DO SV^DGLOCK
IF $DATA(X)
if '$$VALMSE^DGRPMS(DFN,X,1,"MSL")
KILL X
IF $DATA(X)
IF $DATA(^DG(43,1))
SET SD1=1
DO PS^DGINP
+1 QUIT
+2 ;
28 ;@2
SET DQ=29
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 *7,!!,"Need to edit the information you've just entered"
SET %=1
DO YN^DICN
+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 IF $DATA(%Y)
IF %Y["?"
WRITE !!,"Enter Y to go back and correct any errors or ",!,"you may enter N to proceed."
SET Y="@2"
+1 QUIT
31 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=31
DO X31
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
X31 IF $DATA(%)
IF %=1
WRITE @IOF,!
SET Y="@1"
+1 QUIT
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=32
DO X32
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
X32 KILL %,%Y
+1 QUIT
33 GOTO 0^DIE17