Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: DVBAXA

DVBAXA.m

Go to the documentation of this file.
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