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

DGX61.m

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