IBXS3 ; GENERATED FROM 'IB SCREEN3' INPUT TEMPLATE(#574), FILE 399;11/02/18
D DE G BEGIN
DE S DIE="^DGCR(399,",DIC=DIE,DP=399,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DGCR(399,DA,""))=""
I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,7) S:%]"" DE(3)=% S %=$P(%Z,U,19) S:%]"" DE(7)=%,DE(11)=%
I $D(^("M")) S %Z=^("M") S %=$P(%Z,U,12) S:%]"" DE(22)=% S %=$P(%Z,U,13) S:%]"" DE(28)=% S %=$P(%Z,U,14) S:%]"" DE(33)=%
I $D(^("M1")) S %Z=^("M1") S %=$P(%Z,U,13) S:%]"" DE(27)=% S %=$P(%Z,U,14) S:%]"" DE(32)=% S %=$P(%Z,U,15) S:%]"" DE(37)=%
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",P:DV'["S" I X?.ANP D SET^DIED I 'DDER G V
K DDER G X
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
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="IBXS3",DQ=1
N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
M DIEZAR=^DIE(574,"AR") S DICRREC="TRIG^DIE17"
S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=574,U="^"
1 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X1 S:$G(IBCNRTN) Y="@313" K IBCNRTN
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:IBDR20'["31" Y="@31"
Q
3 S DW="0;7",DV="R*P399.3'",DU="",DIFLD=.07,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C3^IBXS3"
S DU="DGCR(399.3,"
G RE
C3 G C3S:$D(DE(3))[0 K DB
S X=DE(3),DIC=DIE
X ^DD(399,.07,1,1,2.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"U")):^("U"),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=0 X ^DD(399,.07,1,1,2.4)
S X=DE(3),DIC=DIE
;
S X=DE(3),DIC=DIE
K ^DGCR(399,"AD",$E(X,1,30),DA)
C3S S X="" G:DG(DQ)=X C3F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399,.07,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"U")):^("U"),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=1 X ^DD(399,.07,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(^DGCR(399,D0,0)):^(0),1:"") S X=$P(Y(1),U,11),X=X S DIU=X K Y S X=DIV S X=$P(^DGCR(399.3,$P(^DGCR(399,DA,0),U,7),0),U,7) X ^DD(399,.07,1,2,1.4)
S X=DG(DQ),DIC=DIE
S ^DGCR(399,"AD",$E(X,1,30),DA)=""
C3F1 Q
X3 S DIC("S")="I '$P(^(0),U,3)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
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:'+$P(^IBE(350.9,1,1),U,22) Y="@314"
Q
5 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 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
X5 S DIPA("FT1")=$P($G(^DGCR(399,DA,0)),U,19)
Q
6 S DQ=7 ;@5
7 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW="0;19",DV="R*P353'",DU="",DIFLD=.19,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C7^IBXS3",DE(DW,"INDEX")=1
S DU="IBE(353,"
G RE
C7 G C7S:$D(DE(7))[0 K DB
S X=DE(7),DIC=DIE
;
S X=DE(7),DIC=DIE
S DGRVRCAL=2
S X=DE(7),DIC=DIE
D ALLID^IBCEP3(DA,.19,2)
S X=DE(7),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,1)=DIV,DIH=399,DIG=140 D ^DICR
S X=DE(7),DIC=DIE
D ATTREND^IBCU1(DA,"","")
S X=DE(7),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,2)=DIV,DIH=399,DIG=141 D ^DICR
S X=DE(7),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,3)=DIV,DIH=399,DIG=142 D ^DICR
S X=DE(7),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,4)=DIV,DIH=399,DIG=143 D ^DICR
S X=DE(7),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,5)=DIV,DIH=399,DIG=144 D ^DICR
S X=DE(7),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,6)=DIV,DIH=399,DIG=145 D ^DICR
C7S S X="" G:DG(DQ)=X C7F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399,.19,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,0)):^(0),1:"") S X=$P(Y(1),U,9),X=X S DIU=X K Y S X=DIV S X=5 S DIH=$G(^DGCR(399,DIV(0),0)),DIV=X S $P(^(0),U,9)=DIV,DIH=399,DIG=.09 D ^DICR
S X=DG(DQ),DIC=DIE
S DGRVRCAL=1
S X=DG(DQ),DIC=DIE
D ALLID^IBCEP3(DA,.19,1)
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA,"","")
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
C7F1 N X,X1,X2 S DIXR=984 D C7X1(U) K X2 M X2=X D C7X1("O") K X1 M X1=X
K X M X=X2 D
. N IBLNPRV I $$LNPRVFT^IBCEU7(X,.IBLNPRV) D FILE^DIE("E","IBLNPRV") Q
G C7F2
C7X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",399,DIIENS,.19,DION),$P($G(^DGCR(399,DA,0)),U,19))
S X=$G(X(1))
Q
C7F2 S DIXR=985 D C7X2(U) K X2 M X2=X D C7X2("O") K X1 M X1=X
K X M X=X2 D
. N DIEXARR M DIEXARR=X S DIEZCOND=1
. S X=X(1)=3
. S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
. D REMOVE^IBCEU7(DA,X(1))
G C7F3
C7X2(DION) K X
S X(1)=$G(@DIEZTMP@("V",399,DIIENS,.19,DION),$P($G(^DGCR(399,DA,0)),U,19))
S X=$G(X(1))
Q
C7F3 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=820 S DIEZRXR(399,DIXR)=""
Q
X7 S DIC("S")="I $$FTINPUT^IBCU9(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 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
X8 S DIPA("FT")=$P($G(^DGCR(399,DA,0)),U,19)
Q
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 $P($G(^IBE(353,+DIPA("FT"),2)),U,2)="P",$P($G(^(2)),U,4) S DIPA("FT1")=DIPA("FT") D CKFT^IBCIUT1(IBIFN) S Y="@10"
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 W !,*7,"Must be a printable national form type"
Q
11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="0;19",DV="R*P353'",DU="",DIFLD=.19,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C11^IBXS3",DE(DW,"INDEX")=1
S DU="IBE(353,"
S X=$G(DIPA("FT1"))
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
C11 G C11S:$D(DE(11))[0 K DB
S X=DE(11),DIC=DIE
;
S X=DE(11),DIC=DIE
S DGRVRCAL=2
S X=DE(11),DIC=DIE
D ALLID^IBCEP3(DA,.19,2)
S X=DE(11),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,1)=DIV,DIH=399,DIG=140 D ^DICR
S X=DE(11),DIC=DIE
D ATTREND^IBCU1(DA,"","")
S X=DE(11),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,2)=DIV,DIH=399,DIG=141 D ^DICR
S X=DE(11),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,3)=DIV,DIH=399,DIG=142 D ^DICR
S X=DE(11),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,4)=DIV,DIH=399,DIG=143 D ^DICR
S X=DE(11),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,5)=DIV,DIH=399,DIG=144 D ^DICR
S X=DE(11),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M2")):^("M2"),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"M2")),DIV=X S $P(^("M2"),U,6)=DIV,DIH=399,DIG=145 D ^DICR
C11S S X="" G:DG(DQ)=X C11F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399,.19,1,1,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,0)):^(0),1:"") S X=$P(Y(1),U,9),X=X S DIU=X K Y S X=DIV S X=5 S DIH=$G(^DGCR(399,DIV(0),0)),DIV=X S $P(^(0),U,9)=DIV,DIH=399,DIG=.09 D ^DICR
S X=DG(DQ),DIC=DIE
S DGRVRCAL=1
S X=DG(DQ),DIC=DIE
D ALLID^IBCEP3(DA,.19,1)
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
D ATTREND^IBCU1(DA,"","")
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
;
C11F1 N X,X1,X2 S DIXR=984 D C11X1(U) K X2 M X2=X D C11X1("O") K X1 M X1=X
K X M X=X2 D
. N IBLNPRV I $$LNPRVFT^IBCEU7(X,.IBLNPRV) D FILE^DIE("E","IBLNPRV") Q
G C11F2
C11X1(DION) K X
S X(1)=$G(@DIEZTMP@("V",399,DIIENS,.19,DION),$P($G(^DGCR(399,DA,0)),U,19))
S X=$G(X(1))
Q
C11F2 S DIXR=985 D C11X2(U) K X2 M X2=X D C11X2("O") K X1 M X1=X
K X M X=X2 D
. N DIEXARR M DIEXARR=X S DIEZCOND=1
. S X=X(1)=3
. S DIEZCOND=$G(X) K X M X=DIEXARR Q:'DIEZCOND
. D REMOVE^IBCEU7(DA,X(1))
G C11F3
C11X2(DION) K X
S X(1)=$G(@DIEZTMP@("V",399,DIIENS,.19,DION),$P($G(^DGCR(399,DA,0)),U,19))
S X=$G(X(1))
Q
C11F3 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=820 S DIEZRXR(399,DIXR)=""
Q
X11 S DIC("S")="I $$FTINPUT^IBCU9(Y)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
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 Y="@5"
Q
13 S DQ=14 ;@10
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 D FTPRV^IBCEU5(DA)
Q
15 S DQ=16 ;@314
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 X=$P(^DGCR(399,DA,0),U,11)
Q
17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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
X17 S Y="@"_$S(X']"":31,X="p":31,X="o":311,1:310)
Q
18 S DQ=19 ;@310
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 D 1^IBCSCH1 S Y="@"_$S(IBADI=-1:31,'IBADI:312,1:33)
Q
20 S DQ=21 ;@313
21 S DQ=22 ;@312
22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW="M;12",DV="FXO",DU="",DIFLD=112,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(22,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
S DE(DW)="C22^IBXS3",DE(DW,"INDEX")=1
G RE
C22 G C22S:$D(DE(22))[0 K DB
S X=DE(22),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M")):^("M"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" X ^DD(399,112,1,1,2.4)
S X=DE(22),DIC=DIE
D KIX^IBCNS2(DA,"I1")
S X=DE(22),DIC=DIE
X ^DD(399,112,1,3,2.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"MP")):^("MP"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(399,112,1,3,2.4)
S X=DE(22),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"U")):^("U"),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"U")),DIV=X S $P(^("U"),U,13)=DIV,DIH=399,DIG=163 D ^DICR
S X=DE(22),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"UF32")):^("UF32"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"UF32")),DIV=X S $P(^("UF32"),U,1)=DIV,DIH=399,DIG=253 D ^DICR
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(1)=$S($D(^DGCR(399,D0,"M")):^("M"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y X ^DD(399,112,1,1,1.1) X ^DD(399,112,1,1,1.4)
S X=DG(DQ),DIC=DIE
D IX^IBCNS2(DA,"I1")
S X=DG(DQ),DIC=DIE
X ^DD(399,112,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"MP")):^("MP"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV S X=$$BPP^IBCNS2(DA,1) X ^DD(399,112,1,3,1.4)
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"U")):^("U"),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$AUTH^IBCNS4(D0,X) S DIH=$G(^DGCR(399,DIV(0),"U")),DIV=X S $P(^("U"),U,13)=DIV,DIH=399,DIG=163 D ^DICR
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"UF32")):^("UF32"),1:"") S X=$P(Y(1),U,1),X=X S DIU=X K Y S X=DIV S X=$$REF^IBCNS4(D0,X) X ^DD(399,112,1,5,1.4)
C22F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=139 S DIEZRXR(399,DIXR)=""
Q
X22 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<1) X D:$D(X) DD^IBCNS2(X,DA,1)
I $D(X),X'?.ANP K X
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'="" S:$E(IBVV,9) IBVV=$E(IBVV,1,8)_"0"
Q
24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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
X24 S:X="" Y="@998"
Q
25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X25 S IBINS=$P($G(^DPT(DFN,.312,X,0)),U)
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 IBHPID=$$HPD^IBCNHUT1(IBINS)
Q
27 D:$D(DG)>9 F^DIE17,DE S DQ=27,DW="M1;13",DV="NJ10,0X",DU="",DIFLD=471,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C27^IBXS3"
S X=IBHPID
S Y=X
G Y
C27 G C27S:$D(DE(27))[0 K DB
S X=DE(27),DIC=DIE
;
S X=DE(27),DIC=DIE
;
C27S S X="" G:DG(DQ)=X C27F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"MP")):^("MP"),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X=DIV N %I,%H,% D NOW^%DTC S X=% X ^DD(399,471,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(^DGCR(399,D0,"MP")):^("MP"),1:"") S X=$P(Y(1),U,4),X=X S DIU=X K Y S X=DIV S X=$S(($D(DUZ)#2):DUZ,1:"") X ^DD(399,471,1,2,1.4)
C27F1 Q
X27 K:+X'=X!(X>9999999999)!(X<1000000000)!(X?.E1"."1N.N)!$$HOD^IBCNHUT1(X) X
Q
;
28 D:$D(DG)>9 F^DIE17,DE S DQ=28,DW="M;13",DV="FOX",DU="",DIFLD=113,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(28,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
S DE(DW)="C28^IBXS3",DE(DW,"INDEX")=1
G RE
C28 G C28S:$D(DE(28))[0 K DB
S X=DE(28),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M")):^("M"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(399,113,1,1,2.4)
S X=DE(28),DIC=DIE
D KIX^IBCNS2(DA,"I2")
S X=DE(28),DIC=DIE
X ^DD(399,113,1,3,2.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"MP")):^("MP"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" X ^DD(399,113,1,3,2.4)
S X=DE(28),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"U2")):^("U2"),1:"") S X=$P(Y(1),U,8),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"U2")),DIV=X S $P(^("U2"),U,8)=DIV,DIH=399,DIG=230 D ^DICR
S X=DE(28),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"UF32")):^("UF32"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"UF32")),DIV=X S $P(^("UF32"),U,2)=DIV,DIH=399,DIG=254 D ^DICR
C28S S X="" G:DG(DQ)=X C28F1 K DB
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"M")):^("M"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y X ^DD(399,113,1,1,1.1) X ^DD(399,113,1,1,1.4)
S X=DG(DQ),DIC=DIE
D IX^IBCNS2(DA,"I2")
S X=DG(DQ),DIC=DIE
X ^DD(399,113,1,3,1.3) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"MP")):^("MP"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV S X=$$BPP^IBCNS2(DA,1) X ^DD(399,113,1,3,1.4)
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"U2")):^("U2"),1:"") S X=$P(Y(1),U,8),X=X S DIU=X K Y S X=DIV S X=$$AUTH^IBCNS4(D0,X) S DIH=$G(^DGCR(399,DIV(0),"U2")),DIV=X S $P(^("U2"),U,8)=DIV,DIH=399,DIG=230 D ^DICR
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"UF32")):^("UF32"),1:"") S X=$P(Y(1),U,2),X=X S DIU=X K Y S X=DIV S X=$$REF^IBCNS4(D0,X) X ^DD(399,113,1,5,1.4)
C28F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=139 S DIEZRXR(399,DIXR)=""
Q
X28 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<1) X D:$D(X) DD^IBCNS2(X,DA,2)
I $D(X),X'?.ANP K X
Q
;
29 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X29 S:X="" Y="@998"
Q
30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X30 S IBINS=$P($G(^DPT(DFN,.312,X,0)),U)
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 IBHPID=$$HPD^IBCNHUT1(IBINS)
Q
32 D:$D(DG)>9 F^DIE17,DE S DQ=32,DW="M1;14",DV="NJ10,0X",DU="",DIFLD=472,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C32^IBXS3"
S X=IBHPID
S Y=X
G Y
C32 G C32S:$D(DE(32))[0 K DB
S X=DE(32),DIC=DIE
;
S X=DE(32),DIC=DIE
;
C32S S X="" G:DG(DQ)=X C32F1 K DB
D ^IBXS31
C32F1 Q
X32 K:+X'=X!(X>9999999999)!(X<1000000000)!(X?.E1"."1N.N)!$$HOD^IBCNHUT1(X) X
Q
;
33 D:$D(DG)>9 F^DIE17,DE S DQ=33,DW="M;14",DV="FOX",DU="",DIFLD=114,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DQ(33,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
S DE(DW)="C33^IBXS3",DE(DW,"INDEX")=1
G RE
C33 G C33S:$D(DE(33))[0 K DB
D ^IBXS32
C33S S X="" G:DG(DQ)=X C33F1 K DB
D ^IBXS33
C33F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=139 S DIEZRXR(399,DIXR)=""
Q
X33 K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>20!($L(X)<1) X D:$D(X) DD^IBCNS2(X,DA,3)
I $D(X),X'?.ANP K X
Q
;
34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 D X34 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
X34 S:X="" Y="@998"
Q
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 S IBINS=$P($G(^DPT(DFN,.312,X,0)),U)
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 IBHPID=$$HPD^IBCNHUT1(IBINS)
Q
37 D:$D(DG)>9 F^DIE17,DE S DQ=37,DW="M1;15",DV="NJ10,0X",DU="",DIFLD=473,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C37^IBXS3"
S X=IBHPID
S Y=X
G Y
C37 G C37S:$D(DE(37))[0 K DB
D ^IBXS34
C37S S X="" G:DG(DQ)=X C37F1 K DB
D ^IBXS35
C37F1 Q
X37 K:+X'=X!(X>9999999999)!(X<1000000000)!(X?.E1"."1N.N)!$$HOD^IBCNHUT1(X) X
Q
;
38 S DQ=39 ;@998
39 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=39 D X39 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
X39 S Y="@31"
Q
40 S DQ=41 ;@311
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 D INST^IBCU
Q
42 D:$D(DG)>9 F^DIE17 G ^IBXS36
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBXS3 20797 printed Dec 13, 2024@02:30:09 Page 2
IBXS3 ; GENERATED FROM 'IB SCREEN3' INPUT TEMPLATE(#574), FILE 399;11/02/18
+1 DO DE
GOTO BEGIN
DE SET DIE="^DGCR(399,"
SET DIC=DIE
SET DP=399
SET DL=1
SET DIEL=0
SET DU=""
KILL DG,DE,DB
if $ORDER(^DGCR(399,DA,""))=""
QUIT
+1 IF $DATA(^(0))
SET %Z=^(0)
SET %=$PIECE(%Z,U,7)
if %]""
SET DE(3)=%
SET %=$PIECE(%Z,U,19)
if %]""
SET DE(7)=%
SET DE(11)=%
+2 IF $DATA(^("M"))
SET %Z=^("M")
SET %=$PIECE(%Z,U,12)
if %]""
SET DE(22)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(28)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(33)=%
+3 IF $DATA(^("M1"))
SET %Z=^("M1")
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(27)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(32)=%
SET %=$PIECE(%Z,U,15)
if %]""
SET DE(37)=%
+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 DV'["S"
GOTO P
IF X?.ANP
DO SET^DIED
IF 'DDER
GOTO V
+1 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
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="IBXS3"
SET DQ=1
+1 NEW DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR
KILL DIEFIRE,DIEBADK
SET DIEZTMP=$$GETTMP^DIKC1("DIEZ")
+2 MERGE DIEZAR=^DIE(574,"AR")
SET DICRREC="TRIG^DIE17"
+3 if $DATA(DTIME)[0
SET DTIME=300
SET D0=DA
SET DIIENS=DA_","
SET DIEZ=574
SET U="^"
1 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=1
DO X1
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X1 if $GET(IBCNRTN)
SET Y="@313"
KILL IBCNRTN
+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 IBDR20'["31"
SET Y="@31"
+1 QUIT
3 SET DW="0;7"
SET DV="R*P399.3'"
SET DU=""
SET DIFLD=.07
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C3^IBXS3"
+2 SET DU="DGCR(399.3,"
+3 GOTO RE
C3 if $DATA(DE(3))[0
GOTO C3S
KILL DB
+1 SET X=DE(3)
SET DIC=DIE
+2 XECUTE ^DD(399,.07,1,1,2.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U")):^("U"),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=0
XECUTE ^DD(399,.07,1,1,2.4)
+3 SET X=DE(3)
SET DIC=DIE
+4 ;
+5 SET X=DE(3)
SET DIC=DIE
+6 KILL ^DGCR(399,"AD",$EXTRACT(X,1,30),DA)
C3S SET X=""
if DG(DQ)=X
GOTO C3F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399,.07,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U")):^("U"),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=1
XECUTE ^DD(399,.07,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(^DGCR(399,D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,11)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$PIECE(^DGCR(399.3,$PIECE(^DGCR(399,DA,0),U,7),0),U,7)
XECUTE ^DD(399,.07,1,2,1.4)
+5 SET X=DG(DQ)
SET DIC=DIE
+6 SET ^DGCR(399,"AD",$EXTRACT(X,1,30),DA)=""
C3F1 QUIT
X3 SET DIC("S")="I '$P(^(0),U,3)"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
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 if '+$PIECE(^IBE(350.9,1,1),U,22)
SET Y="@314"
+1 QUIT
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=5
DO X5
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
X5 SET DIPA("FT1")=$PIECE($GET(^DGCR(399,DA,0)),U,19)
+1 QUIT
6 ;@5
SET DQ=7
7 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=7
SET DW="0;19"
SET DV="R*P353'"
SET DU=""
SET DIFLD=.19
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C7^IBXS3"
SET DE(DW,"INDEX")=1
+2 SET DU="IBE(353,"
+3 GOTO RE
C7 if $DATA(DE(7))[0
GOTO C7S
KILL DB
+1 SET X=DE(7)
SET DIC=DIE
+2 ;
+3 SET X=DE(7)
SET DIC=DIE
+4 SET DGRVRCAL=2
+5 SET X=DE(7)
SET DIC=DIE
+6 DO ALLID^IBCEP3(DA,.19,2)
+7 SET X=DE(7)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,1)=DIV
SET DIH=399
SET DIG=140
DO ^DICR
+9 SET X=DE(7)
SET DIC=DIE
+10 DO ATTREND^IBCU1(DA,"","")
+11 SET X=DE(7)
SET DIC=DIE
+12 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,2)=DIV
SET DIH=399
SET DIG=141
DO ^DICR
+13 SET X=DE(7)
SET DIC=DIE
+14 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,3)=DIV
SET DIH=399
SET DIG=142
DO ^DICR
+15 SET X=DE(7)
SET DIC=DIE
+16 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,4)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,4)=DIV
SET DIH=399
SET DIG=143
DO ^DICR
+17 SET X=DE(7)
SET DIC=DIE
+18 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,5)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,5)=DIV
SET DIH=399
SET DIG=144
DO ^DICR
+19 SET X=DE(7)
SET DIC=DIE
+20 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,6)=DIV
SET DIH=399
SET DIG=145
DO ^DICR
C7S SET X=""
if DG(DQ)=X
GOTO C7F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399,.19,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,9)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=5
SET DIH=$GET(^DGCR(399,DIV(0),0))
SET DIV=X
SET $PIECE(^(0),U,9)=DIV
SET DIH=399
SET DIG=.09
DO ^DICR
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DGRVRCAL=1
+5 SET X=DG(DQ)
SET DIC=DIE
+6 DO ALLID^IBCEP3(DA,.19,1)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 ;
+9 SET X=DG(DQ)
SET DIC=DIE
+10 DO ATTREND^IBCU1(DA,"","")
+11 SET X=DG(DQ)
SET DIC=DIE
+12 ;
+13 SET X=DG(DQ)
SET DIC=DIE
+14 ;
+15 SET X=DG(DQ)
SET DIC=DIE
+16 ;
+17 SET X=DG(DQ)
SET DIC=DIE
+18 ;
+19 SET X=DG(DQ)
SET DIC=DIE
+20 ;
C7F1 NEW X,X1,X2
SET DIXR=984
DO C7X1(U)
KILL X2
MERGE X2=X
DO C7X1("O")
KILL X1
MERGE X1=X
+1 KILL X
MERGE X=X2
Begin DoDot:1
+2 NEW IBLNPRV
IF $$LNPRVFT^IBCEU7(X,.IBLNPRV)
DO FILE^DIE("E","IBLNPRV")
QUIT
End DoDot:1
+3 GOTO C7F2
C7X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",399,DIIENS,.19,DION),$PIECE($GET(^DGCR(399,DA,0)),U,19))
+2 SET X=$GET(X(1))
+3 QUIT
C7F2 SET DIXR=985
DO C7X2(U)
KILL X2
MERGE X2=X
DO C7X2("O")
KILL X1
MERGE X1=X
+1 KILL X
MERGE X=X2
Begin DoDot:1
+2 NEW DIEXARR
MERGE DIEXARR=X
SET DIEZCOND=1
+3 SET X=X(1)=3
+4 SET DIEZCOND=$GET(X)
KILL X
MERGE X=DIEXARR
if 'DIEZCOND
QUIT
+5 DO REMOVE^IBCEU7(DA,X(1))
End DoDot:1
+6 GOTO C7F3
C7X2(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",399,DIIENS,.19,DION),$PIECE($GET(^DGCR(399,DA,0)),U,19))
+2 SET X=$GET(X(1))
+3 QUIT
C7F3 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=820
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X7 SET DIC("S")="I $$FTINPUT^IBCU9(Y)"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
8 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=8
DO X8
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
X8 SET DIPA("FT")=$PIECE($GET(^DGCR(399,DA,0)),U,19)
+1 QUIT
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 $PIECE($GET(^IBE(353,+DIPA("FT"),2)),U,2)="P"
IF $PIECE($GET(^(2)),U,4)
SET DIPA("FT1")=DIPA("FT")
DO CKFT^IBCIUT1(IBIFN)
SET Y="@10"
+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 WRITE !,*7,"Must be a printable national form type"
+1 QUIT
11 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=11
SET DW="0;19"
SET DV="R*P353'"
SET DU=""
SET DIFLD=.19
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C11^IBXS3"
SET DE(DW,"INDEX")=1
+2 SET DU="IBE(353,"
+3 SET X=$GET(DIPA("FT1"))
+4 SET Y=X
+5 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
+6 GOTO RD
C11 if $DATA(DE(11))[0
GOTO C11S
KILL DB
+1 SET X=DE(11)
SET DIC=DIE
+2 ;
+3 SET X=DE(11)
SET DIC=DIE
+4 SET DGRVRCAL=2
+5 SET X=DE(11)
SET DIC=DIE
+6 DO ALLID^IBCEP3(DA,.19,2)
+7 SET X=DE(11)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,1)=DIV
SET DIH=399
SET DIG=140
DO ^DICR
+9 SET X=DE(11)
SET DIC=DIE
+10 DO ATTREND^IBCU1(DA,"","")
+11 SET X=DE(11)
SET DIC=DIE
+12 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,2)=DIV
SET DIH=399
SET DIG=141
DO ^DICR
+13 SET X=DE(11)
SET DIC=DIE
+14 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,3)=DIV
SET DIH=399
SET DIG=142
DO ^DICR
+15 SET X=DE(11)
SET DIC=DIE
+16 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,4)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,4)=DIV
SET DIH=399
SET DIG=143
DO ^DICR
+17 SET X=DE(11)
SET DIC=DIE
+18 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,5)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,5)=DIV
SET DIH=399
SET DIG=144
DO ^DICR
+19 SET X=DE(11)
SET DIC=DIE
+20 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M2")):^("M2"),1:"")
SET X=$PIECE(Y(1),U,6)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"M2"))
SET DIV=X
SET $PIECE(^("M2"),U,6)=DIV
SET DIH=399
SET DIG=145
DO ^DICR
C11S SET X=""
if DG(DQ)=X
GOTO C11F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399,.19,1,1,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,0)):^(0),1:"")
SET X=$PIECE(Y(1),U,9)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=5
SET DIH=$GET(^DGCR(399,DIV(0),0))
SET DIV=X
SET $PIECE(^(0),U,9)=DIV
SET DIH=399
SET DIG=.09
DO ^DICR
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET DGRVRCAL=1
+5 SET X=DG(DQ)
SET DIC=DIE
+6 DO ALLID^IBCEP3(DA,.19,1)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 ;
+9 SET X=DG(DQ)
SET DIC=DIE
+10 DO ATTREND^IBCU1(DA,"","")
+11 SET X=DG(DQ)
SET DIC=DIE
+12 ;
+13 SET X=DG(DQ)
SET DIC=DIE
+14 ;
+15 SET X=DG(DQ)
SET DIC=DIE
+16 ;
+17 SET X=DG(DQ)
SET DIC=DIE
+18 ;
+19 SET X=DG(DQ)
SET DIC=DIE
+20 ;
C11F1 NEW X,X1,X2
SET DIXR=984
DO C11X1(U)
KILL X2
MERGE X2=X
DO C11X1("O")
KILL X1
MERGE X1=X
+1 KILL X
MERGE X=X2
Begin DoDot:1
+2 NEW IBLNPRV
IF $$LNPRVFT^IBCEU7(X,.IBLNPRV)
DO FILE^DIE("E","IBLNPRV")
QUIT
End DoDot:1
+3 GOTO C11F2
C11X1(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",399,DIIENS,.19,DION),$PIECE($GET(^DGCR(399,DA,0)),U,19))
+2 SET X=$GET(X(1))
+3 QUIT
C11F2 SET DIXR=985
DO C11X2(U)
KILL X2
MERGE X2=X
DO C11X2("O")
KILL X1
MERGE X1=X
+1 KILL X
MERGE X=X2
Begin DoDot:1
+2 NEW DIEXARR
MERGE DIEXARR=X
SET DIEZCOND=1
+3 SET X=X(1)=3
+4 SET DIEZCOND=$GET(X)
KILL X
MERGE X=DIEXARR
if 'DIEZCOND
QUIT
+5 DO REMOVE^IBCEU7(DA,X(1))
End DoDot:1
+6 GOTO C11F3
C11X2(DION) KILL X
+1 SET X(1)=$GET(@DIEZTMP@("V",399,DIIENS,.19,DION),$PIECE($GET(^DGCR(399,DA,0)),U,19))
+2 SET X=$GET(X(1))
+3 QUIT
C11F3 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=820
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X11 SET DIC("S")="I $$FTINPUT^IBCU9(Y)"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
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 Y="@5"
+1 QUIT
13 ;@10
SET DQ=14
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 DO FTPRV^IBCEU5(DA)
+1 QUIT
15 ;@314
SET DQ=16
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 X=$PIECE(^DGCR(399,DA,0),U,11)
+1 QUIT
17 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=17
DO X17
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
X17 SET Y="@"_$SELECT(X']"":31,X="p":31,X="o":311,1:310)
+1 QUIT
18 ;@310
SET DQ=19
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 DO 1^IBCSCH1
SET Y="@"_$SELECT(IBADI=-1:31,'IBADI:312,1:33)
+1 QUIT
20 ;@313
SET DQ=21
21 ;@312
SET DQ=22
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=22
SET DW="M;12"
SET DV="FXO"
SET DU=""
SET DIFLD=112
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(22,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
+2 SET DE(DW)="C22^IBXS3"
SET DE(DW,"INDEX")=1
+3 GOTO RE
C22 if $DATA(DE(22))[0
GOTO C22S
KILL DB
+1 SET X=DE(22)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M")):^("M"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399,112,1,1,2.4)
+3 SET X=DE(22)
SET DIC=DIE
+4 DO KIX^IBCNS2(DA,"I1")
+5 SET X=DE(22)
SET DIC=DIE
+6 XECUTE ^DD(399,112,1,3,2.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"MP")):^("MP"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399,112,1,3,2.4)
+7 SET X=DE(22)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U")):^("U"),1:"")
SET X=$PIECE(Y(1),U,13)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"U"))
SET DIV=X
SET $PIECE(^("U"),U,13)=DIV
SET DIH=399
SET DIG=163
DO ^DICR
+9 SET X=DE(22)
SET DIC=DIE
+10 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"UF32")):^("UF32"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"UF32"))
SET DIV=X
SET $PIECE(^("UF32"),U,1)=DIV
SET DIH=399
SET DIG=253
DO ^DICR
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(1)=$SELECT($DATA(^DGCR(399,D0,"M")):^("M"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
XECUTE ^DD(399,112,1,1,1.1)
XECUTE ^DD(399,112,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO IX^IBCNS2(DA,"I1")
+5 SET X=DG(DQ)
SET DIC=DIE
+6 XECUTE ^DD(399,112,1,3,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"MP")):^("MP"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$BPP^IBCNS2(DA,1)
XECUTE ^DD(399,112,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U")):^("U"),1:"")
SET X=$PIECE(Y(1),U,13)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$AUTH^IBCNS4(D0,X)
SET DIH=$GET(^DGCR(399,DIV(0),"U"))
SET DIV=X
SET $PIECE(^("U"),U,13)=DIV
SET DIH=399
SET DIG=163
DO ^DICR
+9 SET X=DG(DQ)
SET DIC=DIE
+10 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"UF32")):^("UF32"),1:"")
SET X=$PIECE(Y(1),U,1)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$REF^IBCNS4(D0,X)
XECUTE ^DD(399,112,1,5,1.4)
C22F1 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=139
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X22 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>20!($LENGTH(X)<1)
KILL X
if $DATA(X)
DO DD^IBCNS2(X,DA,1)
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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'=""
if $EXTRACT(IBVV,9)
SET IBVV=$EXTRACT(IBVV,1,8)_"0"
+1 QUIT
24 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=24
DO X24
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
X24 if X=""
SET Y="@998"
+1 QUIT
25 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=25
DO X25
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X25 SET IBINS=$PIECE($GET(^DPT(DFN,.312,X,0)),U)
+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 IBHPID=$$HPD^IBCNHUT1(IBINS)
+1 QUIT
27 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=27
SET DW="M1;13"
SET DV="NJ10,0X"
SET DU=""
SET DIFLD=471
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C27^IBXS3"
+2 SET X=IBHPID
+3 SET Y=X
+4 GOTO Y
C27 if $DATA(DE(27))[0
GOTO C27S
KILL DB
+1 SET X=DE(27)
SET DIC=DIE
+2 ;
+3 SET X=DE(27)
SET DIC=DIE
+4 ;
C27S SET X=""
if DG(DQ)=X
GOTO C27F1
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(^DGCR(399,D0,"MP")):^("MP"),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
NEW %I,%H,%
DO NOW^%DTC
SET X=%
XECUTE ^DD(399,471,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(^DGCR(399,D0,"MP")):^("MP"),1:"")
SET X=$PIECE(Y(1),U,4)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$SELECT(($DATA(DUZ)#2):DUZ,1:"")
XECUTE ^DD(399,471,1,2,1.4)
C27F1 QUIT
X27 if +X'=X!(X>9999999999)!(X<1000000000)!(X?.E1"."1N.N)!$$HOD^IBCNHUT1(X)
KILL X
+1 QUIT
+2 ;
28 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=28
SET DW="M;13"
SET DV="FOX"
SET DU=""
SET DIFLD=113
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(28,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
+2 SET DE(DW)="C28^IBXS3"
SET DE(DW,"INDEX")=1
+3 GOTO RE
C28 if $DATA(DE(28))[0
GOTO C28S
KILL DB
+1 SET X=DE(28)
SET DIC=DIE
+2 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"M")):^("M"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399,113,1,1,2.4)
+3 SET X=DE(28)
SET DIC=DIE
+4 DO KIX^IBCNS2(DA,"I2")
+5 SET X=DE(28)
SET DIC=DIE
+6 XECUTE ^DD(399,113,1,3,2.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"MP")):^("MP"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399,113,1,3,2.4)
+7 SET X=DE(28)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U2")):^("U2"),1:"")
SET X=$PIECE(Y(1),U,8)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"U2"))
SET DIV=X
SET $PIECE(^("U2"),U,8)=DIV
SET DIH=399
SET DIG=230
DO ^DICR
+9 SET X=DE(28)
SET DIC=DIE
+10 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"UF32")):^("UF32"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=""
SET DIH=$GET(^DGCR(399,DIV(0),"UF32"))
SET DIV=X
SET $PIECE(^("UF32"),U,2)=DIV
SET DIH=399
SET DIG=254
DO ^DICR
C28S SET X=""
if DG(DQ)=X
GOTO C28F1
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(^DGCR(399,D0,"M")):^("M"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
XECUTE ^DD(399,113,1,1,1.1)
XECUTE ^DD(399,113,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 DO IX^IBCNS2(DA,"I2")
+5 SET X=DG(DQ)
SET DIC=DIE
+6 XECUTE ^DD(399,113,1,3,1.3)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"MP")):^("MP"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$BPP^IBCNS2(DA,1)
XECUTE ^DD(399,113,1,3,1.4)
+7 SET X=DG(DQ)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U2")):^("U2"),1:"")
SET X=$PIECE(Y(1),U,8)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$AUTH^IBCNS4(D0,X)
SET DIH=$GET(^DGCR(399,DIV(0),"U2"))
SET DIV=X
SET $PIECE(^("U2"),U,8)=DIV
SET DIH=399
SET DIG=230
DO ^DICR
+9 SET X=DG(DQ)
SET DIC=DIE
+10 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"UF32")):^("UF32"),1:"")
SET X=$PIECE(Y(1),U,2)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$REF^IBCNS4(D0,X)
XECUTE ^DD(399,113,1,5,1.4)
C28F1 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=139
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X28 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>20!($LENGTH(X)<1)
KILL X
if $DATA(X)
DO DD^IBCNS2(X,DA,2)
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
29 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=29
DO X29
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X29 if X=""
SET Y="@998"
+1 QUIT
30 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=30
DO X30
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X30 SET IBINS=$PIECE($GET(^DPT(DFN,.312,X,0)),U)
+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 IBHPID=$$HPD^IBCNHUT1(IBINS)
+1 QUIT
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=32
SET DW="M1;14"
SET DV="NJ10,0X"
SET DU=""
SET DIFLD=472
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C32^IBXS3"
+2 SET X=IBHPID
+3 SET Y=X
+4 GOTO Y
C32 if $DATA(DE(32))[0
GOTO C32S
KILL DB
+1 SET X=DE(32)
SET DIC=DIE
+2 ;
+3 SET X=DE(32)
SET DIC=DIE
+4 ;
C32S SET X=""
if DG(DQ)=X
GOTO C32F1
KILL DB
+1 DO ^IBXS31
C32F1 QUIT
X32 if +X'=X!(X>9999999999)!(X<1000000000)!(X?.E1"."1N.N)!$$HOD^IBCNHUT1(X)
KILL X
+1 QUIT
+2 ;
33 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=33
SET DW="M;14"
SET DV="FOX"
SET DU=""
SET DIFLD=114
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DQ(33,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
+2 SET DE(DW)="C33^IBXS3"
SET DE(DW,"INDEX")=1
+3 GOTO RE
C33 if $DATA(DE(33))[0
GOTO C33S
KILL DB
+1 DO ^IBXS32
C33S SET X=""
if DG(DQ)=X
GOTO C33F1
KILL DB
+1 DO ^IBXS33
C33F1 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=139
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X33 if X[""""!($ASCII(X)=45)
KILL X
IF $DATA(X)
if $LENGTH(X)>20!($LENGTH(X)<1)
KILL X
if $DATA(X)
DO DD^IBCNS2(X,DA,3)
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
34 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=34
DO X34
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
X34 if X=""
SET Y="@998"
+1 QUIT
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 SET IBINS=$PIECE($GET(^DPT(DFN,.312,X,0)),U)
+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 IBHPID=$$HPD^IBCNHUT1(IBINS)
+1 QUIT
37 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=37
SET DW="M1;15"
SET DV="NJ10,0X"
SET DU=""
SET DIFLD=473
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C37^IBXS3"
+2 SET X=IBHPID
+3 SET Y=X
+4 GOTO Y
C37 if $DATA(DE(37))[0
GOTO C37S
KILL DB
+1 DO ^IBXS34
C37S SET X=""
if DG(DQ)=X
GOTO C37F1
KILL DB
+1 DO ^IBXS35
C37F1 QUIT
X37 if +X'=X!(X>9999999999)!(X<1000000000)!(X?.E1"."1N.N)!$$HOD^IBCNHUT1(X)
KILL X
+1 QUIT
+2 ;
38 ;@998
SET DQ=39
39 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=39
DO X39
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
X39 SET Y="@31"
+1 QUIT
40 ;@311
SET DQ=41
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 DO INST^IBCU
+1 QUIT
42 if $DATA(DG)>9
DO F^DIE17
GOTO ^IBXS36