IBXSA2 ; GENERATED FROM 'IB SCREEN102' INPUT TEMPLATE(#1753), 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,16) S:%]"" DE(40)=%
I $D(^("M2")) S %Z=^("M2") S %=$P(%Z,U,1) S:%]"" DE(53)=%,DE(61)=% S %=$P(%Z,U,2) S:%]"" DE(57)=% S %=$P(%Z,U,3) S:%]"" DE(67)=%,DE(75)=% S %=$P(%Z,U,4) S:%]"" DE(71)=%
I $D(^("U")) S %Z=^("U") S %=$P(%Z,U,9) S:%]"" DE(24)=% S %=$P(%Z,U,13) S:%]"" DE(10)=%
I $D(^("U1")) S %Z=^("U1") S %=$P(%Z,U,15) S:%]"" DE(22)=%
I $D(^("U2")) S %Z=^("U2") S %=$P(%Z,U,1) S:%]"" DE(20)=% S %=$P(%Z,U,8) S:%]"" DE(13)=% S %=$P(%Z,U,9) S:%]"" DE(16)=% S %=$P(%Z,U,10) S:%]"" DE(32)=% S %=$P(%Z,U,11) S:%]"" DE(39)=%
I $D(^("U3")) S %Z=^("U3") S %=$P(%Z,U,3) S:%]"" DE(37)=% S %=$P(%Z,U,11) S:%]"" DE(44)=%
I $D(^("UF2")) S %Z=^("UF2") S %=$P(%Z,U,3) S:%]"" DE(3)=%
I $D(^("UF3")) S %Z=^("UF3") S %=$P(%Z,U,4) S:%]"" DE(4)=% S %=$P(%Z,U,5) S:%]"" DE(6)=% S %=$P(%Z,U,6) S:%]"" DE(8)=%
I $D(^("UF32")) S %Z=^("UF32") S %=$P(%Z,U,1) S:%]"" DE(11)=% S %=$P(%Z,U,2) S:%]"" DE(14)=% S %=$P(%Z,U,3) S:%]"" DE(17)=%
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="IBXSA2",DQ=1
S DR(99,1,9.2)="N DIC S DIC=X N X S X=DIC,DIC=""^IBA(355.93,"",DIC(0)=""MF"" D ^DIC"
S DR(99,1,9.3)="S I(1,0)=$G(D1),I(0,0)=$G(D0),Y(1)=$S($D(^DGCR(399,D0,""PRV"",D1,0)):^(0),1:"""") S X=$$EXTERNAL^DIDU(399.0222,.02,"""",$P(Y(1),U,2)) X DR(99,1,9.2) S (D,D0,D(0))=+Y"
N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
M DIEZAR=^DIE(1753,"AR") S DICRREC="TRIG^DIE17"
S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=1753,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 K DIPA S DIPA("I1")=$G(^DGCR(399,DA,"I1")),DIPA("I2")=$G(^("I2")),DIPA("I3")=$G(^("I3"))
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'["101" Y="@102"
Q
3 S DW="UF2;3",DV="F",DU="",DIFLD=402,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X3 K:$L(X)>80!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
4 S DW="UF3;4",DV="F",DU="",DIFLD=453,DLB="PRIMARY INSURANCE ICN/DCN"
G RE
X4 K:$L(X)>50!($L(X)<3) X
I $D(X),X'?.ANP K X
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("I2") Y="@10111"
Q
6 S DW="UF3;5",DV="F",DU="",DIFLD=454,DLB="SECONDARY INSURANCE ICN/DCN"
G RE
X6 K:$L(X)>50!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
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:'DIPA("I3") Y="@10111"
Q
8 S DW="UF3;6",DV="F",DU="",DIFLD=455,DLB="TERTIARY INSURANCE ICN/DCN"
G RE
X8 K:$L(X)>50!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
9 S DQ=10 ;@10111
10 S DW="U;13",DV="FJ50",DU="",DIFLD=163,DLB="PRIMARY AUTHORIZATION CODE"
G RE
X10 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
11 S DW="UF32;1",DV="FJ50",DU="",DIFLD=253,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X11 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K 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:'DIPA("I2") Y="@1011"
Q
13 S DW="U2;8",DV="FXJ50",DU="",DIFLD=230,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X13 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
14 S DW="UF32;2",DV="FJ50",DU="",DIFLD=254,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X14 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
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 S:'DIPA("I3") Y="@1011"
Q
16 S DW="U2;9",DV="FJ50",DU="",DIFLD=231,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X16 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
17 S DW="UF32;3",DV="FJ50",DU="",DIFLD=255,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X17 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
18 S DQ=19 ;@1011
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 I '$$INPAT^IBCEF(DA) S Y="@1012"
Q
20 S DW="U2;1",DV="*P80'",DU="",DIFLD=215,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="ICD9("
G RE
X20 S ICDVDT=$$BDATE^IBACSV(+$G(DA)),DIC("S")="I $$ICD9ACT^IBACSV(+Y,ICDVDT)",DIC("W")="D EN^DDIOL("" ""_$P($$ICD9^IBACSV(+Y,ICDVDT),U,3),,""?0"")" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
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 ICDVDT=$$BDATE^IBACSV(DA)
Q
22 S DW="U1;15",DV="P80.2'",DU="",DIFLD=170,DLB="Prospective Payment System Code (DRG)"
S DU="ICD("
G RE
X22 Q
23 S DQ=24 ;@1012
24 S DW="U;9",DV="S",DU="",DIFLD=159,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="1:PHYSICIAN REFERRAL;2:CLINIC REFERRAL;3:HMO REFERRAL;4:TRANSFER FROM HOSPITAL;5:TRANSFER FROM SKILLED NURSING FAC.;6:TRANSFER FROM OTHER HEALTH CARE FAC.;7:EMERGENCY ROOM;8:COURT/LAW ENFORCEMENT;9:INFO NOT AVAILABLE;"
G RE
X24 Q
25 S DQ=26 ;@102
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:IBDR20'["102" Y="@103"
Q
27 S DQ=28 ;@103
28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X28 S:IBDR20'["103" Y="@104"
Q
29 S D=0 K DE(1) ;222
S DIFLD=222,DGO="^IBXSA21",DC="18^399.0222ISA^PRV^",DV="399.0222MR*SX",DW="0;1",DOW=$$LABEL^DIALOGZ(DP,DIFLD),DLB=$P($$EZBLD^DIALOG(8042,DOW),": ") S:D DC=DC_D
S DU="1:REFERRING;2:OPERATING;3:RENDERING;4:ATTENDING;5:SUPERVISING;9:OTHER OPERATING;6:ASSISTANT SURGEON;"
G RE:D I $D(DSC(399.0222))#2,$P(DSC(399.0222),"I $D(^UTILITY(",1)="" X DSC(399.0222) S D=$O(^(0)) S:D="" D=-1 G M29
S D=$S($D(^DGCR(399,DA,"PRV",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M29 I D>0 S DC=DC_D I $D(^DGCR(399,DA,"PRV",+D,0)) S DE(29)=$P(^(0),U,1)
G RE
R29 D DE
S D=$S($D(^DGCR(399,DA,"PRV",0)):$P(^(0),U,3,4),1:1) G 29+1
;
30 S DQ=31 ;@104
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:IBDR20'["104" Y="@105"
Q
32 S DW="U2;10",DV="*P355.93X",DU="",DIFLD=232,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C32^IBXSA2",DE(DW,"INDEX")=1
S DU="IBA(355.93,"
G RE
C32 G C32S:$D(DE(32))[0 K DB
S X=DE(32),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,12),X=X S DIU=X K Y S X="" X ^DD(399,232,1,1,2.4)
S X=DE(32),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,11),X=X S DIU=X K Y S X="" X ^DD(399,232,1,2,2.4)
S X=DE(32),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X=$$CLIAREQ^IBCEP8A(DA) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"U2")):^("U2"),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$CLIA^IBCEP8A(DA) X ^DD(399,232,1,3,2.4)
S X=DE(32),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"U3")):^("U3"),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"U3")),DIV=X S $P(^("U3"),U,3)=DIV,DIH=399,DIG=244 D ^DICR
C32S S X="" G:DG(DQ)=X C32F1 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,"U2")):^("U2"),1:"") S X=$P(Y(1),U,12),X=X S DIU=X K Y X ^DD(399,232,1,1,1.1) X ^DD(399,232,1,1,1.4)
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X=$$CLIAREQ^IBCEP8A(DA) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"U2")):^("U2"),1:"") S X=$P(Y(1),U,13),X=X S DIU=X K Y S X=DIV S X=$$CLIA^IBCEP8A(DA) X ^DD(399,232,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,"U3")):^("U3"),1:"") S X=$P(Y(1),U,3),X=X S DIU=X K Y S X=DIV S X=$P($$TAXGET^IBCEP81(X),U,2) X ^DD(399,232,1,4,1.4)
C32F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=820 S DIEZRXR(399,DIXR)=""
Q
X32 S DIC("S")="I $P(^(0),U,2)=1" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
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 S DIPA("NVA_FC")=X S:DIPA("NVA_FC")="" Y="@1046"
Q
34 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=34 S I(0,0)=D0 S Y(1)=$S($D(^DGCR(399,D0,"U2")):^("U2"),1:"") S X=$P(Y(1),U,10),X=X S D(0)=+X S X=$S(D(0)>0:D(0),1:"")
S DGO="^IBXSA22",DC="^355.93^IBA(355.93," G DIEZ^DIE0
R34 D DE G A
;
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 DIK="^DGCR(399,",DIK(1)="232" D EN1^DIK
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 K DIK
Q
37 D:$D(DG)>9 F^DIE17,DE S DQ=37,DW="U3;3",DV="*P8932.1'",DU="",DIFLD=244,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="USC(8932.1,"
G RE
X37 S DIC("S")="I $P($G(^(90002)),U,2)=""N""" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
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 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,3),"Non-VA Facility")
Q
39 S DW="U2;11",DV="S",DU="",DIFLD=233,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="1:FEE BASIS, NON-LAB;2:FEE BASIS, LAB;3:NON-FEE BASIS, NON-LAB;4:NON-FEE BASIS, LAB;"
G RE
X39 Q
40 S DW="0;16",DV="D",DU="",DIFLD=.16,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X40 S %DT="EX" D ^%DT S X=Y K:Y<1 X
Q
;
41 S DQ=42 ;@1046
42 S DQ=43 ;@105
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 S:IBDR20'["105" Y="@106"
Q
44 S DW="U3;11",DV="*P8932.1'",DU="",DIFLD=252,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="USC(8932.1,"
G RE
X44 S DIC("S")="I $P($G(^(90002)),U,2)=""N""" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
Q
;
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 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,11),"Billing Provider")
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 I $P($G(^DGCR(399,DA,"U3")),U,11) N X,Y,DIR S DIR(0)="EA",DIR("A")="Press Return to continue" D ^DIR K DIR
Q
47 S DQ=48 ;@106
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 S:IBDR20'["106" Y="@107"
Q
49 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=49 D X49 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
X49 I '$G(DIPA("I1")) S Y="@107"
Q
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 K DIPA("BRANCH") S DIPA("BRANCH")=$$ACINTEL^IBCSC10(DIPA("I1"),"@1061")
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:DIPA("BRANCH")]"" Y=DIPA("BRANCH") K DIPA("BRANCH")
Q
52 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=52 D X52 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
X52 S DIPA("OLDALTT1")=$P($G(^DGCR(399,DA,"M2")),U)
Q
53 S DW="M2;1",DV="*P355.98'",DU="",DIFLD=140,DLB="Primary Payer - Alt Inst Prim Payer ID Type"
S DE(DW)="C53^IBXSA2"
S DU="IBA(355.98,"
G RE
C53 G C53S:$D(DE(53))[0 K DB
S X=DE(53),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
C53S S X="" G:DG(DQ)=X C53F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399,140,1,1,1.3) I X S X=DIV 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=DIV S X=$$ACIDD^IBCU(DA,1,X) X ^DD(399,140,1,1,1.4)
C53F1 Q
X53 S DIC("S")="I $$ACIDS^IBCU(DA,1,+Y)" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
Q
;
54 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=54 D X54 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
X54 I X="",$G(DIPA("OLDALTT1"))="" S Y="@1061"
Q
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 $P($G(^DGCR(399,DA,"M2")),U)="" S Y="@1061"
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 DIPA("OLDALTI1")=$P($G(^DGCR(399,DA,"M2")),U,2)
Q
57 D:$D(DG)>9 F^DIE17,DE S DQ=57,DW="M2;2",DV="FX",DU="",DIFLD=141,DLB="Primary Payer - Alt Inst Prim Payer ID"
G RE
X57 K:$L(X)>30!($L(X)<1)!($$UP^XLFSTR(X)["PRNT") X
I $D(X),X'?.ANP K X
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="",$G(DIPA("OLDALTI1"))="" S Y="@10611"
Q
59 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=59 D X59 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
X59 S Y="@1061"
Q
60 S DQ=61 ;@10611
61 S DW="M2;1",DV="*P355.98'",DU="",DIFLD=140,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C61^IBXSA2"
S DU="IBA(355.98,"
S Y="@"
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C61 G C61S:$D(DE(61))[0 K DB
S X=DE(61),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
C61S S X="" G:DG(DQ)=X C61F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399,140,1,1,1.3) I X S X=DIV 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=DIV S X=$$ACIDD^IBCU(DA,1,X) X ^DD(399,140,1,1,1.4)
C61F1 Q
X61 Q
62 S DQ=63 ;@1061
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 '$G(DIPA("I2")) S Y="@107"
Q
64 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=64 D X64 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
X64 K DIPA("BRANCH") S DIPA("BRANCH")=$$ACINTEL^IBCSC10(DIPA("I2"),"@1062")
Q
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 S:DIPA("BRANCH")]"" Y=DIPA("BRANCH") K DIPA("BRANCH")
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 DIPA("OLDALTT2")=$P($G(^DGCR(399,DA,"M2")),U,3)
Q
67 D:$D(DG)>9 F^DIE17,DE S DQ=67,DW="M2;3",DV="*P355.98'",DU="",DIFLD=142,DLB="Secondary Payer - Alt Inst Prim Payer ID Type"
S DE(DW)="C67^IBXSA2"
S DU="IBA(355.98,"
G RE
C67 G C67S:$D(DE(67))[0 K DB
S X=DE(67),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
C67S S X="" G:DG(DQ)=X C67F1 K DB
S X=DG(DQ),DIC=DIE
X ^DD(399,142,1,1,1.3) I X S X=DIV 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=DIV S X=$$ACIDD^IBCU(DA,2,X) X ^DD(399,142,1,1,1.4)
C67F1 Q
X67 S DIC("S")="I $$ACIDS^IBCU(DA,2,+Y)" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
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="",$G(DIPA("OLDALTT2"))="" S Y="@1062"
Q
69 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=69 D X69 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
X69 I $P($G(^DGCR(399,DA,"M2")),U,3)="" S Y="@1062"
Q
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 S DIPA("OLDALTI2")=$P($G(^DGCR(399,DA,"M2")),U,4)
Q
71 D:$D(DG)>9 F^DIE17,DE S DQ=71,DW="M2;4",DV="FX",DU="",DIFLD=143,DLB="Secondary Payer - Alt Inst Prim Payer ID"
G RE
X71 K:$L(X)>30!($L(X)<1)!($$UP^XLFSTR(X)["PRNT") X
I $D(X),X'?.ANP K X
Q
;
72 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=72 D X72 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
X72 I X="",$G(DIPA("OLDALTI2"))="" S Y="@10621"
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 S Y="@1062"
Q
74 S DQ=75 ;@10621
75 S DW="M2;3",DV="*P355.98'",DU="",DIFLD=142,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C75^IBXSA2"
S DU="IBA(355.98,"
S Y="@"
S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
G RD:X="@",Z
C75 G C75S:$D(DE(75))[0 K DB
D ^IBXSA23
C75S S X="" G:DG(DQ)=X C75F1 K DB
D ^IBXSA24
C75F1 Q
X75 Q
76 S DQ=77 ;@1062
77 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=77 D X77 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
X77 I '$G(DIPA("I3")) S Y="@107"
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 K DIPA("BRANCH") S DIPA("BRANCH")=$$ACINTEL^IBCSC10(DIPA("I3"),"@107")
Q
79 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=79 D X79 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
X79 S:DIPA("BRANCH")]"" Y=DIPA("BRANCH") K DIPA("BRANCH")
Q
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 S DIPA("OLDALTT2")=$P($G(^DGCR(399,DA,"M2")),U,5)
Q
81 D:$D(DG)>9 F^DIE17 G ^IBXSA25
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBXSA2 20095 printed Nov 22, 2024@17:40:51 Page 2
IBXSA2 ; GENERATED FROM 'IB SCREEN102' INPUT TEMPLATE(#1753), 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,16)
if %]""
SET DE(40)=%
+2 IF $DATA(^("M2"))
SET %Z=^("M2")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(53)=%
SET DE(61)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(57)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(67)=%
SET DE(75)=%
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(71)=%
+3 IF $DATA(^("U"))
SET %Z=^("U")
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(24)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(10)=%
+4 IF $DATA(^("U1"))
SET %Z=^("U1")
SET %=$PIECE(%Z,U,15)
if %]""
SET DE(22)=%
+5 IF $DATA(^("U2"))
SET %Z=^("U2")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(20)=%
SET %=$PIECE(%Z,U,8)
if %]""
SET DE(13)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(16)=%
SET %=$PIECE(%Z,U,10)
if %]""
SET DE(32)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(39)=%
+6 IF $DATA(^("U3"))
SET %Z=^("U3")
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(37)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(44)=%
+7 IF $DATA(^("UF2"))
SET %Z=^("UF2")
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(3)=%
+8 IF $DATA(^("UF3"))
SET %Z=^("UF3")
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(4)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(6)=%
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(8)=%
+9 IF $DATA(^("UF32"))
SET %Z=^("UF32")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(11)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(14)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(17)=%
+10 KILL %Z
QUIT
+11 ;
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="IBXSA2"
SET DQ=1
+1 SET DR(99,1,9.2)="N DIC S DIC=X N X S X=DIC,DIC=""^IBA(355.93,"",DIC(0)=""MF"" D ^DIC"
+2 SET DR(99,1,9.3)="S I(1,0)=$G(D1),I(0,0)=$G(D0),Y(1)=$S($D(^DGCR(399,D0,""PRV"",D1,0)):^(0),1:"""") S X=$$EXTERNAL^DIDU(399.0222,.02,"""",$P(Y(1),U,2)) X DR(99,1,9.2) S (D,D0,D(0))=+Y"
+3 NEW DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR
KILL DIEFIRE,DIEBADK
SET DIEZTMP=$$GETTMP^DIKC1("DIEZ")
+4 MERGE DIEZAR=^DIE(1753,"AR")
SET DICRREC="TRIG^DIE17"
+5 if $DATA(DTIME)[0
SET DTIME=300
SET D0=DA
SET DIIENS=DA_","
SET DIEZ=1753
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 KILL DIPA
SET DIPA("I1")=$GET(^DGCR(399,DA,"I1"))
SET DIPA("I2")=$GET(^("I2"))
SET DIPA("I3")=$GET(^("I3"))
+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'["101"
SET Y="@102"
+1 QUIT
3 SET DW="UF2;3"
SET DV="F"
SET DU=""
SET DIFLD=402
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X3 if $LENGTH(X)>80!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
4 SET DW="UF3;4"
SET DV="F"
SET DU=""
SET DIFLD=453
SET DLB="PRIMARY INSURANCE ICN/DCN"
+1 GOTO RE
X4 if $LENGTH(X)>50!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=5
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 if 'DIPA("I2")
SET Y="@10111"
+1 QUIT
6 SET DW="UF3;5"
SET DV="F"
SET DU=""
SET DIFLD=454
SET DLB="SECONDARY INSURANCE ICN/DCN"
+1 GOTO RE
X6 if $LENGTH(X)>50!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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 if 'DIPA("I3")
SET Y="@10111"
+1 QUIT
8 SET DW="UF3;6"
SET DV="F"
SET DU=""
SET DIFLD=455
SET DLB="TERTIARY INSURANCE ICN/DCN"
+1 GOTO RE
X8 if $LENGTH(X)>50!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
9 ;@10111
SET DQ=10
10 SET DW="U;13"
SET DV="FJ50"
SET DU=""
SET DIFLD=163
SET DLB="PRIMARY AUTHORIZATION CODE"
+1 GOTO RE
X10 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
11 SET DW="UF32;1"
SET DV="FJ50"
SET DU=""
SET DIFLD=253
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X11 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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 if 'DIPA("I2")
SET Y="@1011"
+1 QUIT
13 SET DW="U2;8"
SET DV="FXJ50"
SET DU=""
SET DIFLD=230
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X13 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
14 SET DW="UF32;2"
SET DV="FJ50"
SET DU=""
SET DIFLD=254
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X14 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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 'DIPA("I3")
SET Y="@1011"
+1 QUIT
16 SET DW="U2;9"
SET DV="FJ50"
SET DU=""
SET DIFLD=231
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X16 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
17 SET DW="UF32;3"
SET DV="FJ50"
SET DU=""
SET DIFLD=255
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X17 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
18 ;@1011
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 IF '$$INPAT^IBCEF(DA)
SET Y="@1012"
+1 QUIT
20 SET DW="U2;1"
SET DV="*P80'"
SET DU=""
SET DIFLD=215
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="ICD9("
+2 GOTO RE
X20 SET ICDVDT=$$BDATE^IBACSV(+$GET(DA))
SET DIC("S")="I $$ICD9ACT^IBACSV(+Y,ICDVDT)"
SET DIC("W")="D EN^DDIOL("" ""_$P($$ICD9^IBACSV(+Y,ICDVDT),U,3),,""?0"")"
DO ^DIC
KILL DIC
SET DIC=$GET(DIE)
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
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 ICDVDT=$$BDATE^IBACSV(DA)
+1 QUIT
22 SET DW="U1;15"
SET DV="P80.2'"
SET DU=""
SET DIFLD=170
SET DLB="Prospective Payment System Code (DRG)"
+1 SET DU="ICD("
+2 GOTO RE
X22 QUIT
23 ;@1012
SET DQ=24
24 SET DW="U;9"
SET DV="S"
SET DU=""
SET DIFLD=159
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="1:PHYSICIAN REFERRAL;2:CLINIC REFERRAL;3:HMO REFERRAL;4:TRANSFER FROM HOSPITAL;5:TRANSFER FROM SKILLED NURSING FAC.;6:TRANSFER FROM OTHER HEALTH CARE FAC.;7:EMERGENCY ROOM;8:COURT/LAW ENFORCEMENT;9:INFO NOT AVAILABLE;"
+2 GOTO RE
X24 QUIT
25 ;@102
SET DQ=26
26 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=26
DO X26
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X26 if IBDR20'["102"
SET Y="@103"
+1 QUIT
27 ;@103
SET DQ=28
28 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=28
DO X28
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X28 if IBDR20'["103"
SET Y="@104"
+1 QUIT
29 ;222
SET D=0
KILL DE(1)
+1 SET DIFLD=222
SET DGO="^IBXSA21"
SET DC="18^399.0222ISA^PRV^"
SET DV="399.0222MR*SX"
SET DW="0;1"
SET DOW=$$LABEL^DIALOGZ(DP,DIFLD)
SET DLB=$PIECE($$EZBLD^DIALOG(8042,DOW),": ")
if D
SET DC=DC_D
+2 SET DU="1:REFERRING;2:OPERATING;3:RENDERING;4:ATTENDING;5:SUPERVISING;9:OTHER OPERATING;6:ASSISTANT SURGEON;"
+3 if D
GOTO RE
IF $DATA(DSC(399.0222))#2
IF $PIECE(DSC(399.0222),"I $D(^UTILITY(",1)=""
XECUTE DSC(399.0222)
SET D=$ORDER(^(0))
if D=""
SET D=-1
GOTO M29
+4 SET D=$SELECT($DATA(^DGCR(399,DA,"PRV",0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M29 IF D>0
SET DC=DC_D
IF $DATA(^DGCR(399,DA,"PRV",+D,0))
SET DE(29)=$PIECE(^(0),U,1)
+1 GOTO RE
R29 DO DE
+1 SET D=$SELECT($DATA(^DGCR(399,DA,"PRV",0)):$PIECE(^(0),U,3,4),1:1)
GOTO 29+1
+2 ;
30 ;@104
SET DQ=31
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 if IBDR20'["104"
SET Y="@105"
+1 QUIT
32 SET DW="U2;10"
SET DV="*P355.93X"
SET DU=""
SET DIFLD=232
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C32^IBXSA2"
SET DE(DW,"INDEX")=1
+2 SET DU="IBA(355.93,"
+3 GOTO RE
C32 if $DATA(DE(32))[0
GOTO C32S
KILL DB
+1 SET X=DE(32)
SET DIC=DIE
+2 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,12)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399,232,1,1,2.4)
+3 SET X=DE(32)
SET DIC=DIE
+4 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,11)
SET X=X
SET DIU=X
KILL Y
SET X=""
XECUTE ^DD(399,232,1,2,2.4)
+5 SET X=DE(32)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X=$$CLIAREQ^IBCEP8A(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U2")):^("U2"),1:"")
SET X=$PIECE(Y(1),U,13)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$CLIA^IBCEP8A(DA)
XECUTE ^DD(399,232,1,3,2.4)
+7 SET X=DE(32)
SET DIC=DIE
+8 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U3")):^("U3"),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),"U3"))
SET DIV=X
SET $PIECE(^("U3"),U,3)=DIV
SET DIH=399
SET DIG=244
DO ^DICR
C32S SET X=""
if DG(DQ)=X
GOTO C32F1
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,"U2")):^("U2"),1:"")
SET X=$PIECE(Y(1),U,12)
SET X=X
SET DIU=X
KILL Y
XECUTE ^DD(399,232,1,1,1.1)
XECUTE ^DD(399,232,1,1,1.4)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 ;
+5 SET X=DG(DQ)
SET DIC=DIE
+6 KILL DIV
SET DIV=X
SET D0=DA
SET DIV(0)=D0
SET Y(0)=X
SET X=$$CLIAREQ^IBCEP8A(DA)
IF X
SET X=DIV
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U2")):^("U2"),1:"")
SET X=$PIECE(Y(1),U,13)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$$CLIA^IBCEP8A(DA)
XECUTE ^DD(399,232,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,"U3")):^("U3"),1:"")
SET X=$PIECE(Y(1),U,3)
SET X=X
SET DIU=X
KILL Y
SET X=DIV
SET X=$PIECE($$TAXGET^IBCEP81(X),U,2)
XECUTE ^DD(399,232,1,4,1.4)
C32F1 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=820
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X32 SET DIC("S")="I $P(^(0),U,2)=1"
DO ^DIC
KILL DIC
SET DIC=$GET(DIE)
SET X=+Y
if Y<0
KILL X
+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 SET DIPA("NVA_FC")=X
if DIPA("NVA_FC")=""
SET Y="@1046"
+1 QUIT
34 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=34
SET I(0,0)=D0
SET Y(1)=$SELECT($DATA(^DGCR(399,D0,"U2")):^("U2"),1:"")
SET X=$PIECE(Y(1),U,10)
SET X=X
SET D(0)=+X
SET X=$SELECT(D(0)>0:D(0),1:"")
+1 SET DGO="^IBXSA22"
SET DC="^355.93^IBA(355.93,"
GOTO DIEZ^DIE0
R34 DO DE
GOTO A
+1 ;
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 DIK="^DGCR(399,"
SET DIK(1)="232"
DO EN1^DIK
+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 KILL DIK
+1 QUIT
37 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=37
SET DW="U3;3"
SET DV="*P8932.1'"
SET DU=""
SET DIFLD=244
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="USC(8932.1,"
+2 GOTO RE
X37 SET DIC("S")="I $P($G(^(90002)),U,2)=""N"""
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+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 DO DISPTAX^IBCEP81($PIECE($GET(^DGCR(399,DA,"U3")),U,3),"Non-VA Facility")
+1 QUIT
39 SET DW="U2;11"
SET DV="S"
SET DU=""
SET DIFLD=233
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="1:FEE BASIS, NON-LAB;2:FEE BASIS, LAB;3:NON-FEE BASIS, NON-LAB;4:NON-FEE BASIS, LAB;"
+2 GOTO RE
X39 QUIT
40 SET DW="0;16"
SET DV="D"
SET DU=""
SET DIFLD=.16
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X40 SET %DT="EX"
DO ^%DT
SET X=Y
if Y<1
KILL X
+1 QUIT
+2 ;
41 ;@1046
SET DQ=42
42 ;@105
SET DQ=43
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 IBDR20'["105"
SET Y="@106"
+1 QUIT
44 SET DW="U3;11"
SET DV="*P8932.1'"
SET DU=""
SET DIFLD=252
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DU="USC(8932.1,"
+2 GOTO RE
X44 SET DIC("S")="I $P($G(^(90002)),U,2)=""N"""
DO ^DIC
KILL DIC
SET DIC=$GET(DIE)
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
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 DO DISPTAX^IBCEP81($PIECE($GET(^DGCR(399,DA,"U3")),U,11),"Billing Provider")
+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 IF $PIECE($GET(^DGCR(399,DA,"U3")),U,11)
NEW X,Y,DIR
SET DIR(0)="EA"
SET DIR("A")="Press Return to continue"
DO ^DIR
KILL DIR
+1 QUIT
47 ;@106
SET DQ=48
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 IBDR20'["106"
SET Y="@107"
+1 QUIT
49 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=49
DO X49
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
X49 IF '$GET(DIPA("I1"))
SET Y="@107"
+1 QUIT
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 KILL DIPA("BRANCH")
SET DIPA("BRANCH")=$$ACINTEL^IBCSC10(DIPA("I1"),"@1061")
+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 if DIPA("BRANCH")]""
SET Y=DIPA("BRANCH")
KILL DIPA("BRANCH")
+1 QUIT
52 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=52
DO X52
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
X52 SET DIPA("OLDALTT1")=$PIECE($GET(^DGCR(399,DA,"M2")),U)
+1 QUIT
53 SET DW="M2;1"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=140
SET DLB="Primary Payer - Alt Inst Prim Payer ID Type"
+1 SET DE(DW)="C53^IBXSA2"
+2 SET DU="IBA(355.98,"
+3 GOTO RE
C53 if $DATA(DE(53))[0
GOTO C53S
KILL DB
+1 SET X=DE(53)
SET DIC=DIE
+2 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
C53S SET X=""
if DG(DQ)=X
GOTO C53F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399,140,1,1,1.3)
IF X
SET X=DIV
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=DIV
SET X=$$ACIDD^IBCU(DA,1,X)
XECUTE ^DD(399,140,1,1,1.4)
C53F1 QUIT
X53 SET DIC("S")="I $$ACIDS^IBCU(DA,1,+Y)"
DO ^DIC
KILL DIC
SET DIC=$GET(DIE)
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
54 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=54
DO X54
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
X54 IF X=""
IF $GET(DIPA("OLDALTT1"))=""
SET Y="@1061"
+1 QUIT
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 $PIECE($GET(^DGCR(399,DA,"M2")),U)=""
SET Y="@1061"
+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 DIPA("OLDALTI1")=$PIECE($GET(^DGCR(399,DA,"M2")),U,2)
+1 QUIT
57 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=57
SET DW="M2;2"
SET DV="FX"
SET DU=""
SET DIFLD=141
SET DLB="Primary Payer - Alt Inst Prim Payer ID"
+1 GOTO RE
X57 if $LENGTH(X)>30!($LENGTH(X)<1)!($$UP^XLFSTR(X)["PRNT")
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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=""
IF $GET(DIPA("OLDALTI1"))=""
SET Y="@10611"
+1 QUIT
59 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=59
DO X59
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
X59 SET Y="@1061"
+1 QUIT
60 ;@10611
SET DQ=61
61 SET DW="M2;1"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=140
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C61^IBXSA2"
+2 SET DU="IBA(355.98,"
+3 SET Y="@"
+4 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
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 if X="@"
GOTO RD
GOTO Z
C61 if $DATA(DE(61))[0
GOTO C61S
KILL DB
+1 SET X=DE(61)
SET DIC=DIE
+2 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
C61S SET X=""
if DG(DQ)=X
GOTO C61F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399,140,1,1,1.3)
IF X
SET X=DIV
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=DIV
SET X=$$ACIDD^IBCU(DA,1,X)
XECUTE ^DD(399,140,1,1,1.4)
C61F1 QUIT
X61 QUIT
62 ;@1061
SET DQ=63
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 '$GET(DIPA("I2"))
SET Y="@107"
+1 QUIT
64 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=64
DO X64
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
X64 KILL DIPA("BRANCH")
SET DIPA("BRANCH")=$$ACINTEL^IBCSC10(DIPA("I2"),"@1062")
+1 QUIT
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 DIPA("BRANCH")]""
SET Y=DIPA("BRANCH")
KILL DIPA("BRANCH")
+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 DIPA("OLDALTT2")=$PIECE($GET(^DGCR(399,DA,"M2")),U,3)
+1 QUIT
67 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=67
SET DW="M2;3"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=142
SET DLB="Secondary Payer - Alt Inst Prim Payer ID Type"
+1 SET DE(DW)="C67^IBXSA2"
+2 SET DU="IBA(355.98,"
+3 GOTO RE
C67 if $DATA(DE(67))[0
GOTO C67S
KILL DB
+1 SET X=DE(67)
SET DIC=DIE
+2 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
C67S SET X=""
if DG(DQ)=X
GOTO C67F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE ^DD(399,142,1,1,1.3)
IF X
SET X=DIV
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=DIV
SET X=$$ACIDD^IBCU(DA,2,X)
XECUTE ^DD(399,142,1,1,1.4)
C67F1 QUIT
X67 SET DIC("S")="I $$ACIDS^IBCU(DA,2,+Y)"
DO ^DIC
KILL DIC
SET DIC=$GET(DIE)
SET X=+Y
if Y<0
KILL X
+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=""
IF $GET(DIPA("OLDALTT2"))=""
SET Y="@1062"
+1 QUIT
69 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=69
DO X69
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
X69 IF $PIECE($GET(^DGCR(399,DA,"M2")),U,3)=""
SET Y="@1062"
+1 QUIT
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 SET DIPA("OLDALTI2")=$PIECE($GET(^DGCR(399,DA,"M2")),U,4)
+1 QUIT
71 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=71
SET DW="M2;4"
SET DV="FX"
SET DU=""
SET DIFLD=143
SET DLB="Secondary Payer - Alt Inst Prim Payer ID"
+1 GOTO RE
X71 if $LENGTH(X)>30!($LENGTH(X)<1)!($$UP^XLFSTR(X)["PRNT")
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
72 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=72
DO X72
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
X72 IF X=""
IF $GET(DIPA("OLDALTI2"))=""
SET Y="@10621"
+1 QUIT
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 SET Y="@1062"
+1 QUIT
74 ;@10621
SET DQ=75
75 SET DW="M2;3"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=142
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C75^IBXSA2"
+2 SET DU="IBA(355.98,"
+3 SET Y="@"
+4 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
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 if X="@"
GOTO RD
GOTO Z
C75 if $DATA(DE(75))[0
GOTO C75S
KILL DB
+1 DO ^IBXSA23
C75S SET X=""
if DG(DQ)=X
GOTO C75F1
KILL DB
+1 DO ^IBXSA24
C75F1 QUIT
X75 QUIT
76 ;@1062
SET DQ=77
77 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=77
DO X77
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
X77 IF '$GET(DIPA("I3"))
SET Y="@107"
+1 QUIT
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 KILL DIPA("BRANCH")
SET DIPA("BRANCH")=$$ACINTEL^IBCSC10(DIPA("I3"),"@107")
+1 QUIT
79 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=79
DO X79
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
X79 if DIPA("BRANCH")]""
SET Y=DIPA("BRANCH")
KILL DIPA("BRANCH")
+1 QUIT
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 SET DIPA("OLDALTT2")=$PIECE($GET(^DGCR(399,DA,"M2")),U,5)
+1 QUIT
81 if $DATA(DG)>9
DO F^DIE17
GOTO ^IBXSA25