DGX61 ; ;02/01/23
D DE G BEGIN
DE S DIE="^DGPT(D0,""P"",",DIC=DIE,DP=45.05,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^DGPT(D0,"P",DA,""))=""
I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(5)=% S %=$P(%Z,U,2) S:%]"" DE(8)=% S %=$P(%Z,U,5) S:%]"" DE(17)=% S %=$P(%Z,U,6) S:%]"" DE(22)=% S %=$P(%Z,U,7) S:%]"" DE(27)=% S %=$P(%Z,U,8) S:%]"" DE(32)=% S %=$P(%Z,U,9) S:%]"" DE(37)=%
I S %=$P(%Z,U,10) S:%]"" DE(42)=% S %=$P(%Z,U,11) S:%]"" DE(47)=% S %=$P(%Z,U,12) S:%]"" DE(52)=% S %=$P(%Z,U,13) S:%]"" DE(57)=% S %=$P(%Z,U,14) S:%]"" DE(62)=% S %=$P(%Z,U,15) S:%]"" DE(67)=% S %=$P(%Z,U,16) S:%]"" DE(72)=%
I S %=$P(%Z,U,17) S:%]"" DE(77)=%
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="DGX61",DQ=1
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:'$D(DGADD) DGADD=0
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 S:DGADD Y="@25"
Q
3 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 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
X3 S:DGJUMP'[1 Y="@2"
Q
4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X4 S DGNFLD="@10"
Q
5 S DW="0;1",DV="MDX",DU="",DIFLD=.01,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C5^DGX61",DE(DW,"INDEX")=1
G RE
C5 G C5S:$D(DE(5))[0 K DB
C5S S X="" G:DG(DQ)=X C5F1 K DB
C5F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1200,1201,1202,1203,1204,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1692 S DIEZRXR(45.05,DIXR)=""
Q
X5 S %DT="ET" D ^%DT S X=+Y K:+Y<1 X I $D(X) X $S($$BADDT^DGPTFM6(X):"K X",1:"S X=X")
Q
;
6 S DQ=7 ;@10
7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X7 S DGNFLD="@15"
Q
8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW="0;2",DV="*P42.4'",DU="",DIFLD=1,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="DIC(42.4,"
D BS^DGPTFM6 S X=DGMOVM K DGMOVM
S Y=X
S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD
X8 S DIC("S")="I $$ACTIVE^DGACT(42.4,Y,$P(^DGPT(DA(1),""P"",DA,0),U))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
9 S DQ=10 ;@15
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:DGJUMP'[2 Y=""
Q
11 S DQ=12 ;@2
12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X12 S DGNFLD="@25"
Q
13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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
X13 S Y="@899"
Q
14 S DQ=15 ;@25
15 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 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
X15 I DGADD,$P(DGHOLD,U,5)]"" S Y="@40"
Q
16 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X16 S DGNFLD="@40"
Q
17 S DW="0;5",DV="*P80.1'X",DU="",DIFLD=4,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C17^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C17 G C17S:$D(DE(17))[0 K DB
S X=DE(17),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C17S S X="" G:DG(DQ)=X C17F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C17F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1200,1692 S DIEZRXR(45.05,DIXR)=""
Q
X17 N DGIT S DGIT=5 D GETAPI^DGICDGT("DG PTF","PROC",$G(DA(1)),"EN1")
Q
;
18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X18 I X K DGPTIT S DGNFLD="@40",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
19 S DQ=20 ;@40
20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X20 I DGADD,$P(DGHOLD,U,6)]"" S Y="@50"
Q
21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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
X21 S DGNFLD="@50"
Q
22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW="0;6",DV="*P80.1'X",DU="",DIFLD=5,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C22^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C22 G C22S:$D(DE(22))[0 K DB
S X=DE(22),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C22S S X="" G:DG(DQ)=X C22F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C22F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1201,1692 S DIEZRXR(45.05,DIXR)=""
Q
X22 N DGIT S DGIT=5 D GETAPI^DGICDGT("DG PTF","PROC",$G(DA(1)),"EN1")
Q
;
23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X23 I X K DGPTIT S DGNFLD="@50",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
24 S DQ=25 ;@50
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 I DGADD,$P(DGHOLD,U,7)]"" S Y="@60"
Q
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 DGNFLD="@60"
Q
27 D:$D(DG)>9 F^DIE17,DE S DQ=27,DW="0;7",DV="*P80.1'X",DU="",DIFLD=6,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C27^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C27 G C27S:$D(DE(27))[0 K DB
S X=DE(27),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C27S S X="" G:DG(DQ)=X C27F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C27F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1202,1692 S DIEZRXR(45.05,DIXR)=""
Q
X27 N DGIT S DGIT=5 D GETAPI^DGICDGT("DG PTF","PROC",$G(DA(1)),"EN1")
Q
;
28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X28 I X K DGPTIT S DGNFLD="@60",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
29 S DQ=30 ;@60
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 DGADD,$P(DGHOLD,U,8)]"" S Y="@70"
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 S DGNFLD="@70"
Q
32 D:$D(DG)>9 F^DIE17,DE S DQ=32,DW="0;8",DV="*P80.1'X",DU="",DIFLD=7,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C32^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C32 G C32S:$D(DE(32))[0 K DB
S X=DE(32),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C32S S X="" G:DG(DQ)=X C32F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C32F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1203,1692 S DIEZRXR(45.05,DIXR)=""
Q
X32 N DGIT S DGIT=5 D GETAPI^DGICDGT("DG PTF","PROC",$G(DA(1)),"EN1")
Q
;
33 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=33 D X33 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
X33 I X K DGPTIT S DGNFLD="@70",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
34 S DQ=35 ;@70
35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X35 I DGADD,$P(DGHOLD,U,9)]"" S Y="@80"
Q
36 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=36 D X36 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X36 S DGNFLD="@80"
Q
37 D:$D(DG)>9 F^DIE17,DE S DQ=37,DW="0;9",DV="*P80.1'X",DU="",DIFLD=8,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C37^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C37 G C37S:$D(DE(37))[0 K DB
S X=DE(37),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C37S S X="" G:DG(DQ)=X C37F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C37F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1204,1692 S DIEZRXR(45.05,DIXR)=""
Q
X37 N DGIT S DGIT=5 D GETAPI^DGICDGT("DG PTF","PROC",$G(DA(1)),"EN1")
Q
;
38 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=38 D X38 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X38 I X K DGPTIT S DGNFLD="@80",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
39 S DQ=40 ;@80
40 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=40 D X40 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
X40 I DGADD,$P(DGHOLD,U,10)]"" S Y="@90"
Q
41 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=41 D X41 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X41 S DGNFLD="@90"
Q
42 D:$D(DG)>9 F^DIE17,DE S DQ=42,DW="0;10",DV="*P80.1'X",DU="",DIFLD=9,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C42^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C42 G C42S:$D(DE(42))[0 K DB
S X=DE(42),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C42S S X="" G:DG(DQ)=X C42F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C42F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1266,1692 S DIEZRXR(45.05,DIXR)=""
Q
X42 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
43 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=43 D X43 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X43 I X K DGPTIT S DGNFLD="@90",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
44 S DQ=45 ;@90
45 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=45 D X45 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X45 I DGADD,$P(DGHOLD,U,11)]"" S Y="@100"
Q
46 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=46 D X46 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
X46 S DGNFLD="@100"
Q
47 D:$D(DG)>9 F^DIE17,DE S DQ=47,DW="0;11",DV="*P80.1'X",DU="",DIFLD=10,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C47^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C47 G C47S:$D(DE(47))[0 K DB
S X=DE(47),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C47S S X="" G:DG(DQ)=X C47F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C47F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1267,1692 S DIEZRXR(45.05,DIXR)=""
Q
X47 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
48 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=48 D X48 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
X48 I X K DGPTIT S DGNFLD="@100",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
49 S DQ=50 ;@100
50 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=50 D X50 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X50 I DGADD,$P(DGHOLD,U,12)]"" S Y="@110"
Q
51 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=51 D X51 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X51 S DGNFLD="@110"
Q
52 D:$D(DG)>9 F^DIE17,DE S DQ=52,DW="0;12",DV="*P80.1'X",DU="",DIFLD=11,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C52^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C52 G C52S:$D(DE(52))[0 K DB
S X=DE(52),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C52S S X="" G:DG(DQ)=X C52F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C52F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1268,1692 S DIEZRXR(45.05,DIXR)=""
Q
X52 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
53 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=53 D X53 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X53 I X K DGPTIT S DGNFLD="@110",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
54 S DQ=55 ;@110
55 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=55 D X55 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X55 I DGADD,$P(DGHOLD,U,13)]"" S Y="@120"
Q
56 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=56 D X56 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X56 S DGNFLD="@120"
Q
57 D:$D(DG)>9 F^DIE17,DE S DQ=57,DW="0;13",DV="*P80.1'X",DU="",DIFLD=12,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C57^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C57 G C57S:$D(DE(57))[0 K DB
S X=DE(57),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C57S S X="" G:DG(DQ)=X C57F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C57F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1269,1692 S DIEZRXR(45.05,DIXR)=""
Q
X57 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
58 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=58 D X58 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
X58 I X K DGPTIT S DGNFLD="@120",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
59 S DQ=60 ;@120
60 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=60 D X60 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
X60 I DGADD,$P(DGHOLD,U,14)]"" S Y="@130"
Q
61 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=61 D X61 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X61 S DGNFLD="@130"
Q
62 D:$D(DG)>9 F^DIE17,DE S DQ=62,DW="0;14",DV="*P80.1'X",DU="",DIFLD=13,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C62^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C62 G C62S:$D(DE(62))[0 K DB
S X=DE(62),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C62S S X="" G:DG(DQ)=X C62F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C62F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1250,1692 S DIEZRXR(45.05,DIXR)=""
Q
X62 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
63 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=63 D X63 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X63 I X K DGPTIT S DGNFLD="@130",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
64 S DQ=65 ;@130
65 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=65 D X65 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X65 I DGADD,$P(DGHOLD,U,15)]"" S Y="@140"
Q
66 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=66 D X66 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
X66 S DGNFLD="@140"
Q
67 D:$D(DG)>9 F^DIE17,DE S DQ=67,DW="0;15",DV="*P80.1'X",DU="",DIFLD=14,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C67^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C67 G C67S:$D(DE(67))[0 K DB
S X=DE(67),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C67S S X="" G:DG(DQ)=X C67F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C67F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1251,1692 S DIEZRXR(45.05,DIXR)=""
Q
X67 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
68 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=68 D X68 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
X68 I X K DGPTIT S DGNFLD="@140",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
69 S DQ=70 ;@140
70 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=70 D X70 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X70 I DGADD,$P(DGHOLD,U,16)]"" S Y="@150"
Q
71 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=71 D X71 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
X71 S DGNFLD="150"
Q
72 D:$D(DG)>9 F^DIE17,DE S DQ=72,DW="0;16",DV="*P80.1'X",DU="",DIFLD=15,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C72^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C72 G C72S:$D(DE(72))[0 K DB
S X=DE(72),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C72S S X="" G:DG(DQ)=X C72F1 K DB
S X=DG(DQ),DIC=DIE
S ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)=""
C72F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1252,1692 S DIEZRXR(45.05,DIXR)=""
Q
X72 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
73 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=73 D X73 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
X73 I X K DGPTIT S DGNFLD="@150",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
74 S DQ=75 ;@150
75 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=75 D X75 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X75 I DGADD,$P(DGHOLD,U,17)]"" S Y="@160"
Q
76 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=76 D X76 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
X76 S DGNFLD="@160"
Q
77 D:$D(DG)>9 F^DIE17,DE S DQ=77,DW="0;17",DV="*P80.1'X",DU="",DIFLD=16,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C77^DGX61",DE(DW,"INDEX")=1
S DU="ICD0("
G RE
C77 G C77S:$D(DE(77))[0 K DB
S X=DE(77),DIC=DIE
K ^DGPT(DA(1),"P","AP6",$E(X,1,30),DA)
C77S S X="" G:DG(DQ)=X C77F1 K DB
D ^DGX62
C77F1 S DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=1253,1692 S DIEZRXR(45.05,DIXR)=""
Q
X77 N DGIT S DGIT=5 D GETAPI^DGICDGT("DGPTF","PROC",$G(DA(1)),"EN1")
Q
;
78 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=78 D X78 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
X78 I X K DGPTIT S DGNFLD="@160",Y="@800",DGPTIT(X_$C(59)_"ICD0(")=""
Q
79 S DQ=80 ;@160
80 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=80 D X80 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
X80 I DGADD,$P(DGHOLD,U,18)]"" S Y="@170"
Q
81 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=81 D X81 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
X81 S DGNFLD="@170"
Q
82 D:$D(DG)>9 F^DIE17 G ^DGX63
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGX61 19822 printed Nov 22, 2024@18:09:50 Page 2
DGX61 ; ;02/01/23
+1 DO DE
GOTO BEGIN
DE SET DIE="^DGPT(D0,""P"","
SET DIC=DIE
SET DP=45.05
SET DL=2
SET DIEL=1
SET DU=""
KILL DG,DE,DB
if $ORDER(^DGPT(D0,"P",DA,""))=""
QUIT
+1 IF $DATA(^(0))
SET %Z=^(0)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(5)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(8)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(17)=%
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(22)=%
SET %=$PIECE(%Z,U,7)
if %]""
SET DE(27)=%
SET %=$PIECE(%Z,U,8)
if %]""
SET DE(32)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(37)=%
+2 IF $TEST
SET %=$PIECE(%Z,U,10)
if %]""
SET DE(42)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(47)=%
SET %=$PIECE(%Z,U,12)
if %]""
SET DE(52)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(57)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(62)=%
SET %=$PIECE(%Z,U,15)
if %]""
SET DE(67)=%
SET %=$PIECE(%Z,U,16)
if %]""
SET DE(72)=%
+3 IF $TEST
SET %=$PIECE(%Z,U,17)
if %]""
SET DE(77)=%
+4 KILL %Z
QUIT
+5 ;
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="DGX61"
SET DQ=1
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 if '$DATA(DGADD)
SET DGADD=0
+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 if DGADD
SET Y="@25"
+1 QUIT
3 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=3
DO X3
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
X3 if DGJUMP'[1
SET Y="@2"
+1 QUIT
4 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=4
DO X4
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X4 SET DGNFLD="@10"
+1 QUIT
5 SET DW="0;1"
SET DV="MDX"
SET DU=""
SET DIFLD=.01
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C5^DGX61"
SET DE(DW,"INDEX")=1
+2 GOTO RE
C5 if $DATA(DE(5))[0
GOTO C5S
KILL DB
C5S SET X=""
if DG(DQ)=X
GOTO C5F1
KILL DB
C5F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1200,1201,1202,1203,1204,1250,1251,1252,1253,1254,1255,1256,1257,1258,1259,1260,1261,1262,1263,1264,1265,1266,1267,1268,1269,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X5 SET %DT="ET"
DO ^%DT
SET X=+Y
if +Y<1
KILL X
IF $DATA(X)
XECUTE $SELECT($$BADDT^DGPTFM6(X):"K X",1:"S X=X")
+1 QUIT
+2 ;
6 ;@10
SET DQ=7
7 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=7
DO X7
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X7 SET DGNFLD="@15"
+1 QUIT
8 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=8
SET DW="0;2"
SET DV="*P42.4'"
SET DU=""
SET DIFLD=1
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="DIC(42.4,"
+2 DO BS^DGPTFM6
SET X=DGMOVM
KILL DGMOVM
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
if X=""
if DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
if '$DATA(X)
GOTO A
+5 GOTO RD
X8 SET DIC("S")="I $$ACTIVE^DGACT(42.4,Y,$P(^DGPT(DA(1),""P"",DA,0),U))"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
9 ;@15
SET DQ=10
10 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=10
DO X10
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X10 if DGJUMP'[2
SET Y=""
+1 QUIT
11 ;@2
SET DQ=12
12 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=12
DO X12
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X12 SET DGNFLD="@25"
+1 QUIT
13 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=13
DO X13
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
X13 SET Y="@899"
+1 QUIT
14 ;@25
SET DQ=15
15 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=15
DO X15
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
X15 IF DGADD
IF $PIECE(DGHOLD,U,5)]""
SET Y="@40"
+1 QUIT
16 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=16
DO X16
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X16 SET DGNFLD="@40"
+1 QUIT
17 SET DW="0;5"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=4
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C17^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C17 if $DATA(DE(17))[0
GOTO C17S
KILL DB
+1 SET X=DE(17)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C17S SET X=""
if DG(DQ)=X
GOTO C17F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C17F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1200,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X17 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DG PTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
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 X
KILL DGPTIT
SET DGNFLD="@40"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
19 ;@40
SET DQ=20
20 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=20
DO X20
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X20 IF DGADD
IF $PIECE(DGHOLD,U,6)]""
SET Y="@50"
+1 QUIT
21 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=21
DO X21
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
X21 SET DGNFLD="@50"
+1 QUIT
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=22
SET DW="0;6"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=5
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C22^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C22 if $DATA(DE(22))[0
GOTO C22S
KILL DB
+1 SET X=DE(22)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C22S SET X=""
if DG(DQ)=X
GOTO C22F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C22F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1201,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X22 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DG PTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
23 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=23
DO X23
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X23 IF X
KILL DGPTIT
SET DGNFLD="@50"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
24 ;@50
SET DQ=25
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 IF DGADD
IF $PIECE(DGHOLD,U,7)]""
SET Y="@60"
+1 QUIT
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 DGNFLD="@60"
+1 QUIT
27 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=27
SET DW="0;7"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=6
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C27^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C27 if $DATA(DE(27))[0
GOTO C27S
KILL DB
+1 SET X=DE(27)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C27S SET X=""
if DG(DQ)=X
GOTO C27F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C27F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1202,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X27 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DG PTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
28 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=28
DO X28
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X28 IF X
KILL DGPTIT
SET DGNFLD="@60"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
29 ;@60
SET DQ=30
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 DGADD
IF $PIECE(DGHOLD,U,8)]""
SET Y="@70"
+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 SET DGNFLD="@70"
+1 QUIT
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=32
SET DW="0;8"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=7
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C32^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C32 if $DATA(DE(32))[0
GOTO C32S
KILL DB
+1 SET X=DE(32)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C32S SET X=""
if DG(DQ)=X
GOTO C32F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C32F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1203,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X32 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DG PTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
33 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=33
DO X33
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
X33 IF X
KILL DGPTIT
SET DGNFLD="@70"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
34 ;@70
SET DQ=35
35 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=35
DO X35
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X35 IF DGADD
IF $PIECE(DGHOLD,U,9)]""
SET Y="@80"
+1 QUIT
36 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=36
DO X36
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X36 SET DGNFLD="@80"
+1 QUIT
37 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=37
SET DW="0;9"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=8
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C37^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C37 if $DATA(DE(37))[0
GOTO C37S
KILL DB
+1 SET X=DE(37)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C37S SET X=""
if DG(DQ)=X
GOTO C37F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C37F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1204,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X37 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DG PTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
38 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=38
DO X38
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X38 IF X
KILL DGPTIT
SET DGNFLD="@80"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
39 ;@80
SET DQ=40
40 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=40
DO X40
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
X40 IF DGADD
IF $PIECE(DGHOLD,U,10)]""
SET Y="@90"
+1 QUIT
41 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=41
DO X41
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X41 SET DGNFLD="@90"
+1 QUIT
42 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=42
SET DW="0;10"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=9
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C42^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C42 if $DATA(DE(42))[0
GOTO C42S
KILL DB
+1 SET X=DE(42)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C42S SET X=""
if DG(DQ)=X
GOTO C42F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C42F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1266,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X42 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
43 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=43
DO X43
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X43 IF X
KILL DGPTIT
SET DGNFLD="@90"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
44 ;@90
SET DQ=45
45 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=45
DO X45
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X45 IF DGADD
IF $PIECE(DGHOLD,U,11)]""
SET Y="@100"
+1 QUIT
46 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=46
DO X46
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
X46 SET DGNFLD="@100"
+1 QUIT
47 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=47
SET DW="0;11"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=10
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C47^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C47 if $DATA(DE(47))[0
GOTO C47S
KILL DB
+1 SET X=DE(47)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C47S SET X=""
if DG(DQ)=X
GOTO C47F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C47F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1267,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X47 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
48 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=48
DO X48
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
X48 IF X
KILL DGPTIT
SET DGNFLD="@100"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
49 ;@100
SET DQ=50
50 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=50
DO X50
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X50 IF DGADD
IF $PIECE(DGHOLD,U,12)]""
SET Y="@110"
+1 QUIT
51 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=51
DO X51
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X51 SET DGNFLD="@110"
+1 QUIT
52 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=52
SET DW="0;12"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=11
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C52^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C52 if $DATA(DE(52))[0
GOTO C52S
KILL DB
+1 SET X=DE(52)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C52S SET X=""
if DG(DQ)=X
GOTO C52F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C52F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1268,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X52 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
53 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=53
DO X53
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X53 IF X
KILL DGPTIT
SET DGNFLD="@110"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
54 ;@110
SET DQ=55
55 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=55
DO X55
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X55 IF DGADD
IF $PIECE(DGHOLD,U,13)]""
SET Y="@120"
+1 QUIT
56 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=56
DO X56
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X56 SET DGNFLD="@120"
+1 QUIT
57 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=57
SET DW="0;13"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=12
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C57^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C57 if $DATA(DE(57))[0
GOTO C57S
KILL DB
+1 SET X=DE(57)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C57S SET X=""
if DG(DQ)=X
GOTO C57F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C57F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1269,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X57 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
58 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=58
DO X58
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
X58 IF X
KILL DGPTIT
SET DGNFLD="@120"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
59 ;@120
SET DQ=60
60 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=60
DO X60
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
X60 IF DGADD
IF $PIECE(DGHOLD,U,14)]""
SET Y="@130"
+1 QUIT
61 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=61
DO X61
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X61 SET DGNFLD="@130"
+1 QUIT
62 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=62
SET DW="0;14"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=13
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C62^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C62 if $DATA(DE(62))[0
GOTO C62S
KILL DB
+1 SET X=DE(62)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C62S SET X=""
if DG(DQ)=X
GOTO C62F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C62F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1250,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X62 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
63 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=63
DO X63
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X63 IF X
KILL DGPTIT
SET DGNFLD="@130"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
64 ;@130
SET DQ=65
65 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=65
DO X65
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X65 IF DGADD
IF $PIECE(DGHOLD,U,15)]""
SET Y="@140"
+1 QUIT
66 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=66
DO X66
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
X66 SET DGNFLD="@140"
+1 QUIT
67 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=67
SET DW="0;15"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=14
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C67^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C67 if $DATA(DE(67))[0
GOTO C67S
KILL DB
+1 SET X=DE(67)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C67S SET X=""
if DG(DQ)=X
GOTO C67F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C67F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1251,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X67 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
68 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=68
DO X68
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
X68 IF X
KILL DGPTIT
SET DGNFLD="@140"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
69 ;@140
SET DQ=70
70 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=70
DO X70
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X70 IF DGADD
IF $PIECE(DGHOLD,U,16)]""
SET Y="@150"
+1 QUIT
71 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=71
DO X71
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
X71 SET DGNFLD="150"
+1 QUIT
72 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=72
SET DW="0;16"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=15
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C72^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C72 if $DATA(DE(72))[0
GOTO C72S
KILL DB
+1 SET X=DE(72)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C72S SET X=""
if DG(DQ)=X
GOTO C72F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)=""
C72F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1252,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X72 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
73 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=73
DO X73
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
X73 IF X
KILL DGPTIT
SET DGNFLD="@150"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
74 ;@150
SET DQ=75
75 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=75
DO X75
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X75 IF DGADD
IF $PIECE(DGHOLD,U,17)]""
SET Y="@160"
+1 QUIT
76 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=76
DO X76
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
X76 SET DGNFLD="@160"
+1 QUIT
77 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=77
SET DW="0;17"
SET DV="*P80.1'X"
SET DU=""
SET DIFLD=16
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C77^DGX61"
SET DE(DW,"INDEX")=1
+2 SET DU="ICD0("
+3 GOTO RE
C77 if $DATA(DE(77))[0
GOTO C77S
KILL DB
+1 SET X=DE(77)
SET DIC=DIE
+2 KILL ^DGPT(DA(1),"P","AP6",$EXTRACT(X,1,30),DA)
C77S SET X=""
if DG(DQ)=X
GOTO C77F1
KILL DB
+1 DO ^DGX62
C77F1 SET DIEZRXR(45.05,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=1253,1692
SET DIEZRXR(45.05,DIXR)=""
+2 QUIT
X77 NEW DGIT
SET DGIT=5
DO GETAPI^DGICDGT("DGPTF","PROC",$GET(DA(1)),"EN1")
+1 QUIT
+2 ;
78 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=78
DO X78
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
X78 IF X
KILL DGPTIT
SET DGNFLD="@160"
SET Y="@800"
SET DGPTIT(X_$CHAR(59)_"ICD0(")=""
+1 QUIT
79 ;@160
SET DQ=80
80 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=80
DO X80
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
X80 IF DGADD
IF $PIECE(DGHOLD,U,18)]""
SET Y="@170"
+1 QUIT
81 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=81
DO X81
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
X81 SET DGNFLD="@170"
+1 QUIT
82 if $DATA(DG)>9
DO F^DIE17
GOTO ^DGX63