DVBHCE5 ; ;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(^(.11)) S %Z=^(.11) S %=$P(%Z,U,1) S:%]"" DE(29)=% S %=$P(%Z,U,2) S:%]"" DE(30)=% S %=$P(%Z,U,3) S:%]"" DE(31)=% S %=$P(%Z,U,4) S:%]"" DE(32)=% S %=$P(%Z,U,5) S:%]"" DE(33)=% S %=$P(%Z,U,12) S:%]"" DE(34)=%
I $D(^(.3)) S %Z=^(.3) S %=$P(%Z,U,1) S:%]"" DE(13)=% S %=$P(%Z,U,6) S:%]"" DE(6)=% S %=$P(%Z,U,11) S:%]"" DE(23)=%
I $D(^(.36)) S %Z=^(.36) S %=$P(%Z,U,1) S:%]"" DE(16)=%
I $D(^(.361)) S %Z=^(.361) S %=$P(%Z,U,1) S:%]"" DE(1)=% S %=$P(%Z,U,2) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=%
I $D(^(.362)) S %Z=^(.362) S %=$P(%Z,U,12) S:%]"" DE(20)=% S %=$P(%Z,U,13) S:%]"" DE(21)=% S %=$P(%Z,U,14) S:%]"" DE(22)=% S %=$P(%Z,U,20) S:%]"" DE(24)=%
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="DVBHCE5",DQ=1
1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW=".361;1",DV="SX",DU="",DIFLD=.3611,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C1^DVBHCE5"
S DU="P:PENDING VERIFICATION;R:PENDING RE-VERIFICATION;V:VERIFIED;"
G RE
C1 G C1S:$D(DE(1))[0 K DB
S X=DE(1),DIC=DIE
;
S X=DE(1),DIC=DIE
;
S X=DE(1),DIC=DIE
D EVENT^IVMPLOG(DA)
C1S S X="" G:DG(DQ)=X C1F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y X ^DD(2,.3611,1,1,1.1) X ^DD(2,.3611,1,1,1.4)
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC X ^DD(2,.3611,1,2,1.4)
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
C1F1 Q
X1 D EK^DGLOCK Q:'$D(X)
Q
;
2 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 G A
3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW=".361;2",DV="DX",DU="",DIFLD=.3612,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C3^DVBHCE5"
S X="TODAY"
S Y=X
G Y
C3 G C3S:$D(DE(3))[0 K DB
S X=DE(3),DIC=DIE
;
S X=DE(3),DIC=DIE
D EVENT^IVMPLOG(DA)
C3S S X="" G:DG(DQ)=X C3F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.361)):^(.361),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=$S(($D(DUZ)#2):DUZ,1:"") X ^DD(2,.3612,1,1,1.4)
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
C3F1 Q
X3 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK
Q
;
4 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW=".361;5",DV="FX",DU="",DIFLD=.3615,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C4^DVBHCE5"
S X="HINQ"
S Y=X
G Y
C4 G C4S:$D(DE(4))[0 K DB
S X=DE(4),DIC=DIE
D EVENT^IVMPLOG(DA)
C4S S X="" G:DG(DQ)=X C4F1 K DB
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
C4F1 Q
X4 K:$L(X)>50!($L(X)<2) X I $D(X) D EK^DGLOCK
I $D(X),X'?.ANP K X
Q
;
5 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 G A
6 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW=".3;6",DV="DX",DU="",DIFLD=.306,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S X="TODAY"
S Y=X
G Y
X6 S %DT="E",%DT(0)=-DT D ^%DT K %DT S X=Y K:Y<1 X I $D(X) D EK^DGLOCK
Q
;
7 S D=0 K DE(1) ;361
S DIFLD=361,DGO="^DVBHCE6",DC="3^2.0361IP^E^",DV="2.0361M*P8'X",DW="0;1",DOW=$$LABEL^DIALOGZ(DP,DIFLD),DLB=$P($$EZBLD^DIALOG(8042,DOW),": ") S:D DC=DC_D
S DU="DIC(8,"
G RE:D I $D(DSC(2.0361))#2,$P(DSC(2.0361),"I $D(^UTILITY(",1)="" X DSC(2.0361) S D=$O(^(0)) S:D="" D=-1 G M7
S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M7 I D>0 S DC=DC_D I $D(^DPT(DA,"E",+D,0)) S DE(7)=$P(^(0),U,1)
G RE
R7 D DE
S D=$S($D(^DPT(DA,"E",0)):$P(^(0),U,3,4),1:1) G 7+1
;
8 S DQ=9 ;@205
9 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X9 I Z2'[2 S Y="@206"
Q
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 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1
Q
11 S DW="TYPE;1",DV="RP391'a",DU="",DIFLD=391,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C11^DVBHCE5",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^DVBHCE5"
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=".3;1",DV="RSXa",DU="",DIFLD=.301,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C13^DVBHCE5"
S DU="Y:YES;N:NO;"
G RE
C13 G C13S:$D(DE(13))[0 K DB
S X=DE(13),DIC=DIE
;
S X=DE(13),DIC=DIE
;
S X=DE(13),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(13),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".301;" D AVAFC^VAFCDD01(DA)
S X=DE(13),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(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 ^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(13))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C13F1 Q
X13 S DFN=DA D EV^DGLOCK I $D(X),X="Y" D VET^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 I X="N" S Y="@2063"
Q
15 S DQ=16 ;@2063
16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW=".36;1",DV="*P8'Xa",DU="",DIFLD=.361,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C16^DVBHCE5",DE(DW,"INDEX")=1
S DU="DIC(8,"
G RE
C16 G C16S:$D(DE(16))[0 K DB
S X=DE(16),DIC=DIE
;
S X=DE(16),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(16),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(16),DIC=DIE
K ^DPT("AEL",DA,+X) I X=$$FIND1^DIC(8,"","B","COLLATERAL OF VET") D ARCHALL^DGRP1152U(DA)
S X=DE(16),DIC=DIE
D AUTOUPD^DGENA2(DA)
S X=DE(16),DIIX=2_U_DIFLD D AUDIT^DIET
C16S S X="" G:DG(DQ)=X C16F1 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(16))'[0!($G(^DD(DP,DIFLD,"AUDIT"))["y") S X=DG(DQ),DIIX=3_U_DIFLD D AUDIT^DIET
C16F1 N X,X1,X2 S DIXR=815 D C16X1(U) K X2 M X2=X D C16X1("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 C16F2
C16X1(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
C16F2 Q
X16 S DFN=DA D EV^DGLOCK I $D(X) D ECD^DGLOCK1
Q
;
17 S DQ=18 ;@206
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 Z2'[3 S Y="@104"
Q
19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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
X19 S DVBSCR=1 D ^DVBHS5 S DVBJ2=1
Q
20 D:$D(DG)>9 F^DIE17,DE S DQ=20,DW=".362;12",DV="SX",DU="",DIFLD=.36205,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C20^DVBHCE5"
S DU="Y:YES;N:NO;U:UNKNOWN;"
G RE
C20 G C20S:$D(DE(20))[0 K DB
S X=DE(20),DIC=DIE
X ^DD(2,.36205,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,1),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,1,2.4)
S X=DE(20),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DE(20),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,3,2.4)
S X=DE(20),DIC=DIE
D AUTOUPD^DGENA2(DA)
C20S S X="" G:DG(DQ)=X C20F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(2,.36205,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,1),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,1,1.4)
S X=DG(DQ),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36205,1,3,1.4)
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
C20F1 Q
X20 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK
Q
;
21 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW=".362;13",DV="SX",DU="",DIFLD=.36215,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C21^DVBHCE5"
S DU="Y:YES;N:NO;U:UNKNOWN;"
G RE
C21 G C21S:$D(DE(21))[0 K DB
S X=DE(21),DIC=DIE
X ^DD(2,.36215,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,2),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,1,2.4)
S X=DE(21),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DE(21),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,3,2.4)
S X=DE(21),DIC=DIE
D AUTOUPD^DGENA2(DA)
C21S S X="" G:DG(DQ)=X C21F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(2,.36215,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,2),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,1,1.4)
S X=DG(DQ),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36215,1,3,1.4)
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
C21F1 Q
X21 S DFN=DA D MV^DGLOCK I $D(X) S DFN=DA D EV^DGLOCK
Q
;
22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW=".362;14",DV="SX",DU="",DIFLD=.36235,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C22^DVBHCE5"
S DU="Y:YES;N:NO;U:UNKNOWN;"
G RE
C22 G C22S:$D(DE(22))[0 K DB
S X=DE(22),DIC=DIE
X ^DD(2,.36235,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,4),X=X S DIU=X K Y S X="" S DIH=$G(^DPT(DIV(0),.362)),DIV=X S $P(^(.362),U,4)=DIV,DIH=2,DIG=.3624 D ^DICR
S X=DE(22),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DE(22),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,3,2.4)
S X=DE(22),DIC=DIE
D AUTOUPD^DGENA2(DA)
C22S S X="" G:DG(DQ)=X C22F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S Y(1)=$C(59)_$P($G(^DD(2,.36235,0)),U,3) S X=$P($P(Y(1),$C(59)_Y(0)_":",2),$C(59))="NO" I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,1,1.4)
S X=DG(DQ),DIC=DIE
S DFN=DA D EN^DGMTCOR K DGMTCOR
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.36235,1,3,1.4)
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
C22F1 Q
X22 S DFN=DA D MV^DGLOCK
Q
;
23 D:$D(DG)>9 F^DIE17,DE S DQ=23,DW=".3;11",DV="SX",DU="",DIFLD=.3025,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C23^DVBHCE5"
S DU="Y:YES;N:NO;U:UNKNOWN;"
G RE
C23 G C23S:$D(DE(23))[0 K DB
S X=DE(23),DIC=DIE
X ^DD(2,.3025,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.3)):^(.3),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,1,2.4)
S X=DE(23),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,2,2.4)
S X=DE(23),DIC=DIE
D EVENT^IVMPLOG(DA)
C23S S X="" G:DG(DQ)=X C23F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(2,.3025,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,3),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,1,1.4)
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X='$$TOTCHK^DGLOCK2(DA) I X S X=DIV S Y(1)=$S($D(^DPT(D0,.362)):^(.362),1:"") S X=$P(Y(1),U,20),X=X S DIU=X K Y S X="" X ^DD(2,.3025,1,2,1.4)
S X=DG(DQ),DIC=DIE
D EVENT^IVMPLOG(DA)
C23F1 Q
X23 S DFN=DA D MV^DGLOCK I $D(X),X="Y" D EC^DGLOCK1
Q
;
24 D:$D(DG)>9 F^DIE17,DE S DQ=24,DW=".362;20",DV="NJ8,2X",DU="",DIFLD=.36295,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C24^DVBHCE5"
G RE
C24 G C24S:$D(DE(24))[0 K DB
S X=DE(24),DIC=DIE
X "S DFN=DA D EN^DGMTR K DGREQF"
S X=DE(24),DIC=DIE
D AUTOUPD^DGENA2(DA)
C24S S X="" G:DG(DQ)=X C24F1 K DB
S X=DG(DQ),DIC=DIE
X "S DFN=DA D EN^DGMTR K DGREQF"
S X=DG(DQ),DIC=DIE
D AUTOUPD^DGENA2(DA)
C24F1 Q
X24 D DOL^DGLOCK2 K:+X'=X&(X'?.N1"."2N)!(X>99999)!(X<0) X I $D(X) S DFN=DA D MV^DGLOCK I $D(X),('$$TOTCHK^DGLOCK2(DFN)) D TOTCKMSG^DGLOCK2 K X
Q
;
25 S DQ=26 ;@2062
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 Y="@104"
Q
27 S DQ=28 ;@11
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 S DVBJ2=1
Q
29 D:$D(DG)>9 F^DIE17,DE S DQ=29,DW=".11;1",DV="FaXJ35",DU="",DIFLD=.111,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C29^DVBHCE5",DE(DW,"INDEX")=1
G RE
C29 G C29S:$D(DE(29))[0 K DB
S X=DE(29),DIC=DIE
X "S DGXRF=.111 D ^DGDDC Q"
S X=DE(29),DIC=DIE
S A1B2TAG="PAT" D ^A1B2XFR
S X=DE(29),DIC=DIE
D EVENT^IVMPLOG(DA)
S X=DE(29),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DPT(D0,.11)):^(.11),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$NOW^XLFDT() S DIH=$G(^DPT(DIV(0),.11)),DIV=X S $P(^(.11),U,13)=DIV,DIH=2,DIG=.118 D ^DICR
S X=DE(29),DIC=DIE
S IVMX=X,X="IVMPXFR" X ^%ZOSF("TEST") D:$T DPT^IVMPXFR S X=IVMX K IVMX
S X=DE(29),DIC=DIE
I ($T(AVAFC^VAFCDD01)'="") S VAFCF=".111;" D AVAFC^VAFCDD01(DA)
S X=DE(29),DIC=DIE
D:($T(ADGRU^DGRUDD01)'="") ADGRU^DGRUDD01(DA)
S X=DE(29),DIIX=2_U_DIFLD D AUDIT^DIET
C29S S X="" G:DG(DQ)=X C29F1 K DB
D ^DVBHCE7
C29F1 N X,X1,X2 S DIXR=230 D C29X1(U) K X2 M X2=X D C29X1("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 C29F2
C29X1(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
C29F2 Q
X29 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
;
30 D:$D(DG)>9 F^DIE17,DE S DQ=30,DW=".11;2",DV="Fa",DU="",DIFLD=.112,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C30^DVBHCE5",DE(DW,"INDEX")=1
G RE
C30 G C30S:$D(DE(30))[0 K DB
D ^DVBHCE8
C30S S X="" G:DG(DQ)=X C30F1 K DB
D ^DVBHCE9
C30F1 N X,X1,X2 S DIXR=232 D C30X1(U) K X2 M X2=X D C30X1("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 C30F2
C30X1(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
C30F2 Q
X30 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
;
31 D:$D(DG)>9 F^DIE17,DE S DQ=31,DW=".11;3",DV="FaXJ30",DU="",DIFLD=.113,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C31^DVBHCE5",DE(DW,"INDEX")=1
G RE
C31 G C31S:$D(DE(31))[0 K DB
D ^DVBHCE10
C31S S X="" G:DG(DQ)=X C31F1 K DB
D ^DVBHCE11
C31F1 N X,X1,X2 S DIXR=233 D C31X1(U) K X2 M X2=X D C31X1("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 C31F2
C31X1(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
C31F2 Q
X31 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
;
32 D:$D(DG)>9 F^DIE17,DE S DQ=32,DW=".11;4",DV="FaXJ15",DU="",DIFLD=.114,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C32^DVBHCE5",DE(DW,"INDEX")=1
G RE
C32 G C32S:$D(DE(32))[0 K DB
D ^DVBHCE12
C32S S X="" G:DG(DQ)=X C32F1 K DB
D ^DVBHCE13
C32F1 N X,X1,X2 S DIXR=234 D C32X1(U) K X2 M X2=X D C32X1("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 C32F2
C32X1(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
C32F2 Q
X32 K:$L(X)>15!($L(X)<2) X D:$D(X) UP^DGHELP
I $D(X),X'?.ANP K X
Q
;
33 D:$D(DG)>9 F^DIE17,DE S DQ=33,DW=".11;5",DV="*P5'a",DU="",DIFLD=.115,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C33^DVBHCE5",DE(DW,"INDEX")=1
S DU="DIC(5,"
G RE
C33 G C33S:$D(DE(33))[0 K DB
D ^DVBHCE14
C33S S X="" G:DG(DQ)=X C33F1 K DB
D ^DVBHCE15
C33F1 N X,X1,X2 S DIXR=235 D C33X1(U) K X2 M X2=X D C33X1("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 C33F2
C33X1(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
C33F2 Q
X33 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
;
34 D:$D(DG)>9 F^DIE17,DE S DQ=34,DW=".11;12",DV="FXOa",DU="",DIFLD=.1112,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(34,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
S DE(DW)="C34^DVBHCE5",DE(DW,"INDEX")=1
G RE
C34 G C34S:$D(DE(34))[0 K DB
D ^DVBHCE16
C34S S X="" G:DG(DQ)=X C34F1 K DB
D ^DVBHCE17
C34F1 N X,X1,X2 S DIXR=185 D C34X1(U) K X2 M X2=X D C34X1("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 C34F2
C34X1(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
C34F2 S DIXR=231 D C34X2(U) K X2 M X2=X D C34X2("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 C34F3
C34X2(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
C34F3 Q
X34 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
;
35 D:$D(DG)>9 F^DIE17 G ^DVBHCE18
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDVBHCE5 23193 printed Dec 13, 2024@01:58:12 Page 2
DVBHCE5 ; ;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(^(.11))
SET %Z=^(.11)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(29)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(30)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(31)=%
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(32)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(33)=%
SET %=$PIECE(%Z,U,12)
if %]""
SET DE(34)=%
+2 IF $DATA(^(.3))
SET %Z=^(.3)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(13)=%
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(6)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(23)=%
+3 IF $DATA(^(.36))
SET %Z=^(.36)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(16)=%
+4 IF $DATA(^(.361))
SET %Z=^(.361)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(1)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(3)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(4)=%
+5 IF $DATA(^(.362))
SET %Z=^(.362)
SET %=$PIECE(%Z,U,12)
if %]""
SET DE(20)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(21)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(22)=%
SET %=$PIECE(%Z,U,20)
if %]""
SET DE(24)=%
+6 IF $DATA(^("TYPE"))
SET %Z=^("TYPE")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(11)=%
+7 IF $DATA(^("VET"))
SET %Z=^("VET")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(12)=%
+8 KILL %Z
QUIT
+9 ;
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="DVBHCE5"
SET DQ=1
1 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=1
SET DW=".361;1"
SET DV="SX"
SET DU=""
SET DIFLD=.3611
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C1^DVBHCE5"
+2 SET DU="P:PENDING VERIFICATION;R:PENDING RE-VERIFICATION;V:VERIFIED;"
+3 GOTO RE
C1 if $DATA(DE(1))[0
GOTO C1S
KILL DB
+1 SET X=DE(1)
SET DIC=DIE
+2 ;
+3 SET X=DE(1)
SET DIC=DIE
+4 ;
+5 SET X=DE(1)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
C1S SET X=""
if DG(DQ)=X
GOTO C1F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DPT(D0,.361)):^(.361),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
XECUTE ^DD(2,.3611,1,1,1.1)
XECUTE ^DD(2,.3611,1,1,1.4)
+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,.361)):^(.361),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
NEW %I,%H,%
DO NOW^%DTC
XECUTE ^DD(2,.3611,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
C1F1 QUIT
X1 DO EK^DGLOCK
if '$DATA(X)
QUIT
+1 QUIT
+2 ;
2 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=2
GOTO A
3 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=3
SET DW=".361;2"
SET DV="DX"
SET DU=""
SET DIFLD=.3612
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C3^DVBHCE5"
+2 SET X="TODAY"
+3 SET Y=X
+4 GOTO Y
C3 if $DATA(DE(3))[0
GOTO C3S
KILL DB
+1 SET X=DE(3)
SET DIC=DIE
+2 ;
+3 SET X=DE(3)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
C3S SET X=""
if DG(DQ)=X
GOTO C3F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DPT(D0,.361)):^(.361),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$SELECT(($DATA(DUZ)#2):DUZ,1:"")
XECUTE ^DD(2,.3612,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO EVENT^IVMPLOG(DA)
C3F1 QUIT
X3 SET %DT="E"
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 ;
4 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=4
SET DW=".361;5"
SET DV="FX"
SET DU=""
SET DIFLD=.3615
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C4^DVBHCE5"
+2 SET X="HINQ"
+3 SET Y=X
+4 GOTO Y
C4 if $DATA(DE(4))[0
GOTO C4S
KILL DB
+1 SET X=DE(4)
SET DIC=DIE
+2 DO EVENT^IVMPLOG(DA)
C4S SET X=""
if DG(DQ)=X
GOTO C4F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 DO EVENT^IVMPLOG(DA)
C4F1 QUIT
X4 if $LENGTH(X)>50!($LENGTH(X)<2)
KILL X
IF $DATA(X)
DO EK^DGLOCK
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=5
GOTO A
6 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=6
SET DW=".3;6"
SET DV="DX"
SET DU=""
SET DIFLD=.306
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET X="TODAY"
+2 SET Y=X
+3 GOTO Y
X6 SET %DT="E"
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 ;
7 ;361
SET D=0
KILL DE(1)
+1 SET DIFLD=361
SET DGO="^DVBHCE6"
SET DC="3^2.0361IP^E^"
SET DV="2.0361M*P8'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(8,"
+3 if D
GOTO RE
IF $DATA(DSC(2.0361))#2
IF $PIECE(DSC(2.0361),"I $D(^UTILITY(",1)=""
XECUTE DSC(2.0361)
SET D=$ORDER(^(0))
if D=""
SET D=-1
GOTO M7
+4 SET D=$SELECT($DATA(^DPT(DA,"E",0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M7 IF D>0
SET DC=DC_D
IF $DATA(^DPT(DA,"E",+D,0))
SET DE(7)=$PIECE(^(0),U,1)
+1 GOTO RE
R7 DO DE
+1 SET D=$SELECT($DATA(^DPT(DA,"E",0)):$PIECE(^(0),U,3,4),1:1)
GOTO 7+1
+2 ;
8 ;@205
SET DQ=9
9 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=9
DO X9
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
X9 IF Z2'[2
SET Y="@206"
+1 QUIT
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 SET DVBSCR=1
DO ^DVBHS5
SET DVBJ2=1
+1 QUIT
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^DVBHCE5"
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^DVBHCE5"
+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=".3;1"
SET DV="RSXa"
SET DU=""
SET DIFLD=.301
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C13^DVBHCE5"
+2 SET DU="Y:YES;N:NO;"
+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 ;
+5 SET X=DE(13)
SET DIC=DIE
+6 DO AUTOUPD^DGENA2(DA)
+7 SET X=DE(13)
SET DIC=DIE
+8 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".301;"
DO AVAFC^VAFCDD01(DA)
+9 SET X=DE(13)
SET DIC=DIE
+10 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(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 ^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(13))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C13F1 QUIT
X13 SET DFN=DA
DO EV^DGLOCK
IF $DATA(X)
IF X="Y"
DO VET^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 IF X="N"
SET Y="@2063"
+1 QUIT
15 ;@2063
SET DQ=16
16 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=16
SET DW=".36;1"
SET DV="*P8'Xa"
SET DU=""
SET DIFLD=.361
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C16^DVBHCE5"
SET DE(DW,"INDEX")=1
+2 SET DU="DIC(8,"
+3 GOTO RE
C16 if $DATA(DE(16))[0
GOTO C16S
KILL DB
+1 SET X=DE(16)
SET DIC=DIE
+2 ;
+3 SET X=DE(16)
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(16)
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(16)
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(16)
SET DIC=DIE
+10 DO AUTOUPD^DGENA2(DA)
+11 SET X=DE(16)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C16S SET X=""
if DG(DQ)=X
GOTO C16F1
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(16))'[0!($GET(^DD(DP,DIFLD,"AUDIT"))["y")
SET X=DG(DQ)
SET DIIX=3_U_DIFLD
DO AUDIT^DIET
C16F1 NEW X,X1,X2
SET DIXR=815
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,.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 C16F2
C16X1(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
C16F2 QUIT
X16 SET DFN=DA
DO EV^DGLOCK
IF $DATA(X)
DO ECD^DGLOCK1
+1 QUIT
+2 ;
17 ;@206
SET DQ=18
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 Z2'[3
SET Y="@104"
+1 QUIT
19 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=19
DO X19
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
X19 SET DVBSCR=1
DO ^DVBHS5
SET DVBJ2=1
+1 QUIT
20 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=20
SET DW=".362;12"
SET DV="SX"
SET DU=""
SET DIFLD=.36205
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C20^DVBHCE5"
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 GOTO RE
C20 if $DATA(DE(20))[0
GOTO C20S
KILL DB
+1 SET X=DE(20)
SET DIC=DIE
+2 XECUTE ^DD(2,.36205,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,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36205,1,1,2.4)
+3 SET X=DE(20)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+5 SET X=DE(20)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36205,1,3,2.4)
+7 SET X=DE(20)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
C20S SET X=""
if DG(DQ)=X
GOTO C20F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(2,.36205,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,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36205,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+5 SET X=DG(DQ)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36205,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
C20F1 QUIT
X20 SET DFN=DA
DO MV^DGLOCK
IF $DATA(X)
SET DFN=DA
DO EV^DGLOCK
+1 QUIT
+2 ;
21 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=21
SET DW=".362;13"
SET DV="SX"
SET DU=""
SET DIFLD=.36215
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C21^DVBHCE5"
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 GOTO RE
C21 if $DATA(DE(21))[0
GOTO C21S
KILL DB
+1 SET X=DE(21)
SET DIC=DIE
+2 XECUTE ^DD(2,.36215,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,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36215,1,1,2.4)
+3 SET X=DE(21)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+5 SET X=DE(21)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36215,1,3,2.4)
+7 SET X=DE(21)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
C21S SET X=""
if DG(DQ)=X
GOTO C21F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(2,.36215,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,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36215,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+5 SET X=DG(DQ)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36215,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
C21F1 QUIT
X21 SET DFN=DA
DO MV^DGLOCK
IF $DATA(X)
SET DFN=DA
DO EV^DGLOCK
+1 QUIT
+2 ;
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=22
SET DW=".362;14"
SET DV="SX"
SET DU=""
SET DIFLD=.36235
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C22^DVBHCE5"
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 GOTO RE
C22 if $DATA(DE(22))[0
GOTO C22S
KILL DB
+1 SET X=DE(22)
SET DIC=DIE
+2 XECUTE ^DD(2,.36235,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,4)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DPT(DIV(0),.362))
SET DIV=X
SET $PIECE(^(.362),U,4)=DIV
SET DIH=2
SET DIG=.3624
DO ^DICR
+3 SET X=DE(22)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+5 SET X=DE(22)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36235,1,3,2.4)
+7 SET X=DE(22)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
C22S SET X=""
if DG(DQ)=X
GOTO C22F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET Y(1)=$CHAR(59)_$PIECE($GET(^DD(2,.36235,0)),U,3)
SET X=$PIECE($PIECE(Y(1),$CHAR(59)_Y(0)_":",2),$CHAR(59))="NO"
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,4)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36235,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DFN=DA
DO EN^DGMTCOR
KILL DGMTCOR
+5 SET X=DG(DQ)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.36235,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 DO AUTOUPD^DGENA2(DA)
C22F1 QUIT
X22 SET DFN=DA
DO MV^DGLOCK
+1 QUIT
+2 ;
23 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=23
SET DW=".3;11"
SET DV="SX"
SET DU=""
SET DIFLD=.3025
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C23^DVBHCE5"
+2 SET DU="Y:YES;N:NO;U:UNKNOWN;"
+3 GOTO RE
C23 if $DATA(DE(23))[0
GOTO C23S
KILL DB
+1 SET X=DE(23)
SET DIC=DIE
+2 XECUTE ^DD(2,.3025,1,1,2.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.3)):^(.3),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.3025,1,1,2.4)
+3 SET X=DE(23)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.3025,1,2,2.4)
+5 SET X=DE(23)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
C23S SET X=""
if DG(DQ)=X
GOTO C23F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(2,.3025,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,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.3025,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X='$$TOTCHK^DGLOCK2(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DPT(D0,.362)):^(.362),1:"")
SET X=$PIECE(Y(1),U,20)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(2,.3025,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
C23F1 QUIT
X23 SET DFN=DA
DO MV^DGLOCK
IF $DATA(X)
IF X="Y"
DO EC^DGLOCK1
+1 QUIT
+2 ;
24 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=24
SET DW=".362;20"
SET DV="NJ8,2X"
SET DU=""
SET DIFLD=.36295
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C24^DVBHCE5"
+2 GOTO RE
C24 if $DATA(DE(24))[0
GOTO C24S
KILL DB
+1 SET X=DE(24)
SET DIC=DIE
+2 XECUTE "S DFN=DA D EN^DGMTR K DGREQF"
+3 SET X=DE(24)
SET DIC=DIE
+4 DO AUTOUPD^DGENA2(DA)
C24S SET X=""
if DG(DQ)=X
GOTO C24F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE "S DFN=DA D EN^DGMTR K DGREQF"
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO AUTOUPD^DGENA2(DA)
C24F1 QUIT
X24 DO DOL^DGLOCK2
if +X'=X&(X'?.N1"."2N)!(X>99999)!(X<0)
KILL X
IF $DATA(X)
SET DFN=DA
DO MV^DGLOCK
IF $DATA(X)
IF ('$$TOTCHK^DGLOCK2(DFN))
DO TOTCKMSG^DGLOCK2
KILL X
+1 QUIT
+2 ;
25 ;@2062
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 Y="@104"
+1 QUIT
27 ;@11
SET DQ=28
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 SET DVBJ2=1
+1 QUIT
29 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=29
SET DW=".11;1"
SET DV="FaXJ35"
SET DU=""
SET DIFLD=.111
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C29^DVBHCE5"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C29 if $DATA(DE(29))[0
GOTO C29S
KILL DB
+1 SET X=DE(29)
SET DIC=DIE
+2 XECUTE "S DGXRF=.111 D ^DGDDC Q"
+3 SET X=DE(29)
SET DIC=DIE
+4 SET A1B2TAG="PAT"
DO ^A1B2XFR
+5 SET X=DE(29)
SET DIC=DIE
+6 DO EVENT^IVMPLOG(DA)
+7 SET X=DE(29)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DPT(D0,.11)):^(.11),1:"")
SET X=$PIECE(Y(1),U,13)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$NOW^XLFDT()
SET DIH=$GET(^DPT(DIV(0),.11))
SET DIV=X
SET $PIECE(^(.11),U,13)=DIV
SET DIH=2
SET DIG=.118
DO ^DICR
+9 SET X=DE(29)
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(29)
SET DIC=DIE
+12 IF ($TEXT(AVAFC^VAFCDD01)'="")
SET VAFCF=".111;"
DO AVAFC^VAFCDD01(DA)
+13 SET X=DE(29)
SET DIC=DIE
+14 if ($TEXT(ADGRU^DGRUDD01)'="")
DO ADGRU^DGRUDD01(DA)
+15 SET X=DE(29)
SET DIIX=2_U_DIFLD
DO AUDIT^DIET
C29S SET X=""
if DG(DQ)=X
GOTO C29F1
KILL DB
+1 DO ^DVBHCE7
C29F1 NEW X,X1,X2
SET DIXR=230
DO C29X1(U)
KILL X2
MERGE X2=X
DO C29X1("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 C29F2
C29X1(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
C29F2 QUIT
X29 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 ;
30 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=30
SET DW=".11;2"
SET DV="Fa"
SET DU=""
SET DIFLD=.112
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C30^DVBHCE5"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C30 if $DATA(DE(30))[0
GOTO C30S
KILL DB
+1 DO ^DVBHCE8
C30S SET X=""
if DG(DQ)=X
GOTO C30F1
KILL DB
+1 DO ^DVBHCE9
C30F1 NEW X,X1,X2
SET DIXR=232
DO C30X1(U)
KILL X2
MERGE X2=X
DO C30X1("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 C30F2
C30X1(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
C30F2 QUIT
X30 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 ;
31 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=31
SET DW=".11;3"
SET DV="FaXJ30"
SET DU=""
SET DIFLD=.113
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C31^DVBHCE5"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C31 if $DATA(DE(31))[0
GOTO C31S
KILL DB
+1 DO ^DVBHCE10
C31S SET X=""
if DG(DQ)=X
GOTO C31F1
KILL DB
+1 DO ^DVBHCE11
C31F1 NEW X,X1,X2
SET DIXR=233
DO C31X1(U)
KILL X2
MERGE X2=X
DO C31X1("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 C31F2
C31X1(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
C31F2 QUIT
X31 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 ;
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=32
SET DW=".11;4"
SET DV="FaXJ15"
SET DU=""
SET DIFLD=.114
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C32^DVBHCE5"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C32 if $DATA(DE(32))[0
GOTO C32S
KILL DB
+1 DO ^DVBHCE12
C32S SET X=""
if DG(DQ)=X
GOTO C32F1
KILL DB
+1 DO ^DVBHCE13
C32F1 NEW X,X1,X2
SET DIXR=234
DO C32X1(U)
KILL X2
MERGE X2=X
DO C32X1("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 C32F2
C32X1(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
C32F2 QUIT
X32 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 ;
33 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=33
SET DW=".11;5"
SET DV="*P5'a"
SET DU=""
SET DIFLD=.115
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C33^DVBHCE5"
SET DE(DW,"INDEX")=1
+2 SET DU="DIC(5,"
+3 GOTO RE
C33 if $DATA(DE(33))[0
GOTO C33S
KILL DB
+1 DO ^DVBHCE14
C33S SET X=""
if DG(DQ)=X
GOTO C33F1
KILL DB
+1 DO ^DVBHCE15
C33F1 NEW X,X1,X2
SET DIXR=235
DO C33X1(U)
KILL X2
MERGE X2=X
DO C33X1("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 C33F2
C33X1(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
C33F2 QUIT
X33 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 ;
34 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=34
SET DW=".11;12"
SET DV="FXOa"
SET DU=""
SET DIFLD=.1112
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(34,2)="S Y(0)=Y D ZIPOUT^VAFADDR"
+2 SET DE(DW)="C34^DVBHCE5"
SET DE(DW,"INDEX")=1
+3 GOTO RE
C34 if $DATA(DE(34))[0
GOTO C34S
KILL DB
+1 DO ^DVBHCE16
C34S SET X=""
if DG(DQ)=X
GOTO C34F1
KILL DB
+1 DO ^DVBHCE17
C34F1 NEW X,X1,X2
SET DIXR=185
DO C34X1(U)
KILL X2
MERGE X2=X
DO C34X1("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 C34F2
C34X1(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
C34F2 SET DIXR=231
DO C34X2(U)
KILL X2
MERGE X2=X
DO C34X2("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 C34F3
C34X2(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
C34F3 QUIT
X34 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 ;
35 if $DATA(DG)>9
DO F^DIE17
GOTO ^DVBHCE18