IBXSAH ; GENERATED FROM 'IB SCREEN10H' INPUT TEMPLATE(#1754), 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(^("DEN2")) S %Z=^("DEN2") S %=$P(%Z,U,1) S:%]"" DE(55)=%
I $D(^("M2")) S %Z=^("M2") S %=$P(%Z,U,1) S:%]"" DE(67)=%,DE(75)=% S %=$P(%Z,U,2) S:%]"" DE(71)=% S %=$P(%Z,U,3) S:%]"" DE(81)=% S %=$P(%Z,U,4) S:%]"" DE(85)=%
I $D(^("U")) S %Z=^("U") S %=$P(%Z,U,13) S:%]"" DE(16)=% S %=$P(%Z,U,16) S:%]"" DE(3)=% S %=$P(%Z,U,17) S:%]"" DE(4)=%
I $D(^("U2")) S %Z=^("U2") S %=$P(%Z,U,1) S:%]"" DE(8)=% S %=$P(%Z,U,8) S:%]"" DE(19)=% S %=$P(%Z,U,9) S:%]"" DE(22)=% S %=$P(%Z,U,10) S:%]"" DE(30)=% S %=$P(%Z,U,11) S:%]"" DE(37)=% S %=$P(%Z,U,13) S:%]"" DE(41)=%
I $D(^("U3")) S %Z=^("U3") S %=$P(%Z,U,1) S:%]"" DE(46)=% S %=$P(%Z,U,3) S:%]"" DE(35)=% S %=$P(%Z,U,11) S:%]"" DE(58)=%
I $D(^("UF3")) S %Z=^("UF3") S %=$P(%Z,U,4) S:%]"" DE(10)=% S %=$P(%Z,U,5) S:%]"" DE(12)=% S %=$P(%Z,U,6) S:%]"" DE(14)=%
I $D(^("UF31")) S %Z=^("UF31") S %=$P(%Z,U,3) S:%]"" DE(51)=%
I $D(^("UF32")) S %Z=^("UF32") S %=$P(%Z,U,1) S:%]"" DE(17)=% S %=$P(%Z,U,2) S:%]"" DE(20)=% S %=$P(%Z,U,3) S:%]"" DE(23)=%
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="IBXSAH",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(1754,"AR") S DICRREC="TRIG^DIE17"
S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=1754,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="U;16",DV="D",DU="",DIFLD=166,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X3 S %DT="EX" D ^%DT S X=Y K:Y<1 X
Q
;
4 S DW="U;17",DV="D",DU="",DIFLD=167,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X4 S %DT="EX" D ^%DT S X=Y K:Y<1 X
Q
;
5 S DQ=6 ;@102
6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 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
X6 S:IBDR20'["102" Y="@103"
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:'$$INPAT^IBCEF(DA) Y="@1021"
Q
8 S DW="U2;1",DV="*P80'",DU="",DIFLD=215,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="ICD9("
G RE
X8 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
;
9 S DQ=10 ;@1021
10 S DW="UF3;4",DV="F",DU="",DIFLD=453,DLB="PRIMARY INSURANCE ICN/DCN"
G RE
X10 K:$L(X)>50!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
11 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 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
X11 S:'DIPA("I2") Y="@1025"
Q
12 S DW="UF3;5",DV="F",DU="",DIFLD=454,DLB="SECONDARY INSURANCE ICN/DCN"
G RE
X12 K:$L(X)>50!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X13 S:'DIPA("I3") Y="@1025"
Q
14 S DW="UF3;6",DV="F",DU="",DIFLD=455,DLB="TERTIARY INSURANCE ICN/DCN"
G RE
X14 K:$L(X)>50!($L(X)<3) X
I $D(X),X'?.ANP K X
Q
;
15 S DQ=16 ;@1025
16 S DW="U;13",DV="FJ50",DU="",DIFLD=163,DLB="PRIMARY AUTHORIZATION CODE"
G RE
X16 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
17 S DW="UF32;1",DV="FJ50",DU="",DIFLD=253,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 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X18 S:'DIPA("I2") Y="@1029"
Q
19 S DW="U2;8",DV="FXJ50",DU="",DIFLD=230,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X19 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
20 S DW="UF32;2",DV="FJ50",DU="",DIFLD=254,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X20 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K 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:'DIPA("I3") Y="@1029"
Q
22 S DW="U2;9",DV="FJ50",DU="",DIFLD=231,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X22 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
23 S DW="UF32;3",DV="FJ50",DU="",DIFLD=255,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X23 K:$L(X)>50!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
24 S DQ=25 ;@1029
25 S DQ=26 ;@103
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'["103" Y="@104"
Q
27 S D=0 K DE(1) ;222
S DIFLD=222,DGO="^IBXSAH1",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 M27
S D=$S($D(^DGCR(399,DA,"PRV",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M27 I D>0 S DC=DC_D I $D(^DGCR(399,DA,"PRV",+D,0)) S DE(27)=$P(^(0),U,1)
G RE
R27 D DE
S D=$S($D(^DGCR(399,DA,"PRV",0)):$P(^(0),U,3,4),1:1) G 27+1
;
28 S DQ=29 ;@104
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:IBDR20'["104" Y="@106"
Q
30 S DW="U2;10",DV="*P355.93X",DU="",DIFLD=232,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C30^IBXSAH",DE(DW,"INDEX")=1
S DU="IBA(355.93,"
G RE
C30 G C30S:$D(DE(30))[0 K DB
S X=DE(30),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(30),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(30),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(30),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
C30S S X="" G:DG(DQ)=X C30F1 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)
C30F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
F DIXR=820 S DIEZRXR(399,DIXR)=""
Q
X30 S DIC("S")="I $P(^(0),U,2)=1" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
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 DIPA("NVA_FC")=X S:X="" Y="@1046"
Q
32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 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="^IBXSAH2",DC="^355.93^IBA(355.93," G DIEZ^DIE0
R32 D DE G A
;
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 DIK="^DGCR(399,",DIK(1)="232" D EN1^DIK
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 K DIK
Q
35 D:$D(DG)>9 F^DIE17,DE S DQ=35,DW="U3;3",DV="*P8932.1'",DU="",DIFLD=244,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="USC(8932.1,"
G RE
X35 S DIC("S")="I $P($G(^(90002)),U,2)=""N""" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
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 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,3),"Non-VA Facility")
Q
37 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
X37 Q
38 S DQ=39 ;@1046
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 I $$FT^IBCEF(DA)=7 S Y="@1048"
Q
40 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=40 D X40 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X40 S DIPA("OLDCLIA")=$P($G(^DGCR(399,DA,"U2")),U,13)
Q
41 S DW="U2;13",DV="F",DU="",DIFLD=235,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X41 K:$L(X)>15!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
42 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=42 D X42 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
X42 I X="",$G(DIPA("OLDCLIA"))'="" S IBMDOTCN=1
Q
43 S DQ=44 ;@1047
44 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=44 D X44 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
X44 I '$$XRAY^IBCEP8A(DA) S Y="@1048"
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 MAMMODP^IBCEP8A(DA)
Q
46 S DW="U3;1",DV="F",DU="",DIFLD=242,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X46 K:$L(X)>15!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
47 S DQ=48 ;@1048
48 S DQ=49 ;@106
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 S:IBDR20'["106" 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 I $$FT^IBCEF(IBIFN)=7 S Y="@1061"
Q
51 S DW="UF31;3",DV="F",DU="",DIFLD=459,DLB="CMS-1500 Box 19"
G RE
X51 K:$L(X)>80!($L(X)<1) X
I $D(X),X'?.ANP K X
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 D ASK19^IBCEU3(DA)
Q
53 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=53 D X53 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X53 S Y="@107"
Q
54 S DQ=55 ;@1061
55 S DW="DEN2;1",DV="FJ80",DU="",DIFLD=97,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
G RE
X55 K:$L(X)>80!($L(X)<1) X
I $D(X),X'?.ANP K X
Q
;
56 S DQ=57 ;@107
57 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=57 D X57 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
X57 S:IBDR20'["107" Y="@108"
Q
58 S DW="U3;11",DV="*P8932.1'",DU="",DIFLD=252,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DU="USC(8932.1,"
G RE
X58 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
;
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 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,11),"Billing Provider")
Q
60 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=60 D X60 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X60 I $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
61 S DQ=62 ;@108
62 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=62 D X62 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
X62 S:IBDR20'["108" Y="@109"
Q
63 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=63 D X63 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
X63 I '$G(DIPA("I1")) S Y="@109"
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("I1"),"@1081")
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("OLDALTT1")=$P($G(^DGCR(399,DA,"M2")),U)
Q
67 S DW="M2;1",DV="*P355.98'",DU="",DIFLD=140,DLB="Primary Payer - Alt Prof Prim Payer ID Type"
S DE(DW)="C67^IBXSAH"
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,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
C67S S X="" G:DG(DQ)=X C67F1 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)
C67F1 Q
X67 S DIC("S")="I $$ACIDS^IBCU(DA,1,+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("OLDALTT1"))="" S Y="@1081"
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)="" S Y="@1081"
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("OLDALTI1")=$P($G(^DGCR(399,DA,"M2")),U,2)
Q
71 D:$D(DG)>9 F^DIE17,DE S DQ=71,DW="M2;2",DV="FX",DU="",DIFLD=141,DLB="Primary Payer - Alt Prof 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("OLDALTI1"))="" S Y="@10811"
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="@1081"
Q
74 S DQ=75 ;@10811
75 S DW="M2;1",DV="*P355.98'",DU="",DIFLD=140,DLB=$$LABEL^DIALOGZ(DP,DIFLD)
S DE(DW)="C75^IBXSAH"
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
S X=DE(75),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
C75S S X="" G:DG(DQ)=X C75F1 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)
C75F1 Q
X75 Q
76 S DQ=77 ;@1081
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("I2")) S Y="@109"
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("I2"),"@1082")
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,3)
Q
81 D:$D(DG)>9 F^DIE17,DE S DQ=81,DW="M2;3",DV="*P355.98'",DU="",DIFLD=142,DLB="Secondary Payer - Alt Prof Prim Payer ID Type"
S DE(DW)="C81^IBXSAH"
S DU="IBA(355.98,"
G RE
C81 G C81S:$D(DE(81))[0 K DB
D ^IBXSAH3
C81S S X="" G:DG(DQ)=X C81F1 K DB
D ^IBXSAH4
C81F1 Q
X81 S DIC("S")="I $$ACIDS^IBCU(DA,2,+Y)" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
Q
;
82 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=82 D X82 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
X82 I X="",$G(DIPA("OLDALTT2"))="" S Y="@1082"
Q
83 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=83 D X83 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
X83 I $P($G(^DGCR(399,DA,"M2")),U,3)="" S Y="@1082"
Q
84 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=84 D X84 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
X84 S DIPA("OLDALTI2")=$P($G(^DGCR(399,DA,"M2")),U,4)
Q
85 D:$D(DG)>9 F^DIE17,DE S DQ=85,DW="M2;4",DV="FX",DU="",DIFLD=143,DLB="Secondary Payer - Alt Prof Prim Payer ID"
G RE
X85 K:$L(X)>30!($L(X)<1)!($$UP^XLFSTR(X)["PRNT") X
I $D(X),X'?.ANP K X
Q
;
86 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=86 D X86 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
X86 I X="",$G(DIPA("OLDALTI2"))="" S Y="@10821"
Q
87 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=87 D X87 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
X87 S Y="@1082"
Q
88 S DQ=89 ;@10821
89 D:$D(DG)>9 F^DIE17 G ^IBXSAH5
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBXSAH 20100 printed Dec 13, 2024@02:30:58 Page 2
IBXSAH ; GENERATED FROM 'IB SCREEN10H' INPUT TEMPLATE(#1754), 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(^("DEN2"))
SET %Z=^("DEN2")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(55)=%
+2 IF $DATA(^("M2"))
SET %Z=^("M2")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(67)=%
SET DE(75)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(71)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(81)=%
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(85)=%
+3 IF $DATA(^("U"))
SET %Z=^("U")
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(16)=%
SET %=$PIECE(%Z,U,16)
if %]""
SET DE(3)=%
SET %=$PIECE(%Z,U,17)
if %]""
SET DE(4)=%
+4 IF $DATA(^("U2"))
SET %Z=^("U2")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(8)=%
SET %=$PIECE(%Z,U,8)
if %]""
SET DE(19)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(22)=%
SET %=$PIECE(%Z,U,10)
if %]""
SET DE(30)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(37)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(41)=%
+5 IF $DATA(^("U3"))
SET %Z=^("U3")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(46)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(35)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(58)=%
+6 IF $DATA(^("UF3"))
SET %Z=^("UF3")
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(10)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(12)=%
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(14)=%
+7 IF $DATA(^("UF31"))
SET %Z=^("UF31")
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(51)=%
+8 IF $DATA(^("UF32"))
SET %Z=^("UF32")
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(17)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(20)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(23)=%
+9 KILL %Z
QUIT
+10 ;
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="IBXSAH"
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(1754,"AR")
SET DICRREC="TRIG^DIE17"
+5 if $DATA(DTIME)[0
SET DTIME=300
SET D0=DA
SET DIIENS=DA_","
SET DIEZ=1754
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="U;16"
SET DV="D"
SET DU=""
SET DIFLD=166
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X3 SET %DT="EX"
DO ^%DT
SET X=Y
if Y<1
KILL X
+1 QUIT
+2 ;
4 SET DW="U;17"
SET DV="D"
SET DU=""
SET DIFLD=167
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X4 SET %DT="EX"
DO ^%DT
SET X=Y
if Y<1
KILL X
+1 QUIT
+2 ;
5 ;@102
SET DQ=6
6 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=6
DO X6
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
X6 if IBDR20'["102"
SET Y="@103"
+1 QUIT
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 '$$INPAT^IBCEF(DA)
SET Y="@1021"
+1 QUIT
8 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
X8 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 ;
9 ;@1021
SET DQ=10
10 SET DW="UF3;4"
SET DV="F"
SET DU=""
SET DIFLD=453
SET DLB="PRIMARY INSURANCE ICN/DCN"
+1 GOTO RE
X10 if $LENGTH(X)>50!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
11 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=11
DO X11
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
X11 if 'DIPA("I2")
SET Y="@1025"
+1 QUIT
12 SET DW="UF3;5"
SET DV="F"
SET DU=""
SET DIFLD=454
SET DLB="SECONDARY INSURANCE ICN/DCN"
+1 GOTO RE
X12 if $LENGTH(X)>50!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
13 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=13
DO X13
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X13 if 'DIPA("I3")
SET Y="@1025"
+1 QUIT
14 SET DW="UF3;6"
SET DV="F"
SET DU=""
SET DIFLD=455
SET DLB="TERTIARY INSURANCE ICN/DCN"
+1 GOTO RE
X14 if $LENGTH(X)>50!($LENGTH(X)<3)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
15 ;@1025
SET DQ=16
16 SET DW="U;13"
SET DV="FJ50"
SET DU=""
SET DIFLD=163
SET DLB="PRIMARY AUTHORIZATION CODE"
+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;1"
SET DV="FJ50"
SET DU=""
SET DIFLD=253
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 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=18
DO X18
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X18 if 'DIPA("I2")
SET Y="@1029"
+1 QUIT
19 SET DW="U2;8"
SET DV="FXJ50"
SET DU=""
SET DIFLD=230
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X19 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
20 SET DW="UF32;2"
SET DV="FJ50"
SET DU=""
SET DIFLD=254
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X20 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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 if 'DIPA("I3")
SET Y="@1029"
+1 QUIT
22 SET DW="U2;9"
SET DV="FJ50"
SET DU=""
SET DIFLD=231
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X22 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
23 SET DW="UF32;3"
SET DV="FJ50"
SET DU=""
SET DIFLD=255
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X23 if $LENGTH(X)>50!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
24 ;@1029
SET DQ=25
25 ;@103
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'["103"
SET Y="@104"
+1 QUIT
27 ;222
SET D=0
KILL DE(1)
+1 SET DIFLD=222
SET DGO="^IBXSAH1"
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 M27
+4 SET D=$SELECT($DATA(^DGCR(399,DA,"PRV",0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M27 IF D>0
SET DC=DC_D
IF $DATA(^DGCR(399,DA,"PRV",+D,0))
SET DE(27)=$PIECE(^(0),U,1)
+1 GOTO RE
R27 DO DE
+1 SET D=$SELECT($DATA(^DGCR(399,DA,"PRV",0)):$PIECE(^(0),U,3,4),1:1)
GOTO 27+1
+2 ;
28 ;@104
SET DQ=29
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 IBDR20'["104"
SET Y="@106"
+1 QUIT
30 SET DW="U2;10"
SET DV="*P355.93X"
SET DU=""
SET DIFLD=232
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C30^IBXSAH"
SET DE(DW,"INDEX")=1
+2 SET DU="IBA(355.93,"
+3 GOTO RE
C30 if $DATA(DE(30))[0
GOTO C30S
KILL DB
+1 SET X=DE(30)
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(30)
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(30)
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(30)
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
C30S SET X=""
if DG(DQ)=X
GOTO C30F1
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)
C30F1 SET DIEZRXR(399,DIIENS)=$$OREF^DILF($NAME(@$$CREF^DILF(DIE)))
+1 FOR DIXR=820
SET DIEZRXR(399,DIXR)=""
+2 QUIT
X30 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 ;
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 DIPA("NVA_FC")=X
if X=""
SET Y="@1046"
+1 QUIT
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=32
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="^IBXSAH2"
SET DC="^355.93^IBA(355.93,"
GOTO DIEZ^DIE0
R32 DO DE
GOTO A
+1 ;
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 DIK="^DGCR(399,"
SET DIK(1)="232"
DO EN1^DIK
+1 QUIT
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 KILL DIK
+1 QUIT
35 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=35
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
X35 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 ;
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 DO DISPTAX^IBCEP81($PIECE($GET(^DGCR(399,DA,"U3")),U,3),"Non-VA Facility")
+1 QUIT
37 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
X37 QUIT
38 ;@1046
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 IF $$FT^IBCEF(DA)=7
SET Y="@1048"
+1 QUIT
40 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=40
DO X40
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X40 SET DIPA("OLDCLIA")=$PIECE($GET(^DGCR(399,DA,"U2")),U,13)
+1 QUIT
41 SET DW="U2;13"
SET DV="F"
SET DU=""
SET DIFLD=235
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X41 if $LENGTH(X)>15!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
42 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=42
DO X42
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
X42 IF X=""
IF $GET(DIPA("OLDCLIA"))'=""
SET IBMDOTCN=1
+1 QUIT
43 ;@1047
SET DQ=44
44 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=44
DO X44
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
X44 IF '$$XRAY^IBCEP8A(DA)
SET Y="@1048"
+1 QUIT
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 MAMMODP^IBCEP8A(DA)
+1 QUIT
46 SET DW="U3;1"
SET DV="F"
SET DU=""
SET DIFLD=242
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X46 if $LENGTH(X)>15!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
47 ;@1048
SET DQ=48
48 ;@106
SET DQ=49
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 IBDR20'["106"
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 IF $$FT^IBCEF(IBIFN)=7
SET Y="@1061"
+1 QUIT
51 SET DW="UF31;3"
SET DV="F"
SET DU=""
SET DIFLD=459
SET DLB="CMS-1500 Box 19"
+1 GOTO RE
X51 if $LENGTH(X)>80!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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 DO ASK19^IBCEU3(DA)
+1 QUIT
53 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=53
DO X53
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X53 SET Y="@107"
+1 QUIT
54 ;@1061
SET DQ=55
55 SET DW="DEN2;1"
SET DV="FJ80"
SET DU=""
SET DIFLD=97
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 GOTO RE
X55 if $LENGTH(X)>80!($LENGTH(X)<1)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
56 ;@107
SET DQ=57
57 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=57
DO X57
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
X57 if IBDR20'["107"
SET Y="@108"
+1 QUIT
58 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
X58 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 ;
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 DO DISPTAX^IBCEP81($PIECE($GET(^DGCR(399,DA,"U3")),U,11),"Billing Provider")
+1 QUIT
60 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=60
DO X60
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X60 IF $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
61 ;@108
SET DQ=62
62 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=62
DO X62
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
X62 if IBDR20'["108"
SET Y="@109"
+1 QUIT
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("I1"))
SET Y="@109"
+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("I1"),"@1081")
+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("OLDALTT1")=$PIECE($GET(^DGCR(399,DA,"M2")),U)
+1 QUIT
67 SET DW="M2;1"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=140
SET DLB="Primary Payer - Alt Prof Prim Payer ID Type"
+1 SET DE(DW)="C67^IBXSAH"
+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,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
C67S SET X=""
if DG(DQ)=X
GOTO C67F1
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)
C67F1 QUIT
X67 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 ;
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("OLDALTT1"))=""
SET Y="@1081"
+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)=""
SET Y="@1081"
+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("OLDALTI1")=$PIECE($GET(^DGCR(399,DA,"M2")),U,2)
+1 QUIT
71 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=71
SET DW="M2;2"
SET DV="FX"
SET DU=""
SET DIFLD=141
SET DLB="Primary Payer - Alt Prof 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("OLDALTI1"))=""
SET Y="@10811"
+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="@1081"
+1 QUIT
74 ;@10811
SET DQ=75
75 SET DW="M2;1"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=140
SET DLB=$$LABEL^DIALOGZ(DP,DIFLD)
+1 SET DE(DW)="C75^IBXSAH"
+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 SET X=DE(75)
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
C75S SET X=""
if DG(DQ)=X
GOTO C75F1
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)
C75F1 QUIT
X75 QUIT
76 ;@1081
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("I2"))
SET Y="@109"
+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("I2"),"@1082")
+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,3)
+1 QUIT
81 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=81
SET DW="M2;3"
SET DV="*P355.98'"
SET DU=""
SET DIFLD=142
SET DLB="Secondary Payer - Alt Prof Prim Payer ID Type"
+1 SET DE(DW)="C81^IBXSAH"
+2 SET DU="IBA(355.98,"
+3 GOTO RE
C81 if $DATA(DE(81))[0
GOTO C81S
KILL DB
+1 DO ^IBXSAH3
C81S SET X=""
if DG(DQ)=X
GOTO C81F1
KILL DB
+1 DO ^IBXSAH4
C81F1 QUIT
X81 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 ;
82 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=82
DO X82
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
X82 IF X=""
IF $GET(DIPA("OLDALTT2"))=""
SET Y="@1082"
+1 QUIT
83 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=83
DO X83
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
X83 IF $PIECE($GET(^DGCR(399,DA,"M2")),U,3)=""
SET Y="@1082"
+1 QUIT
84 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=84
DO X84
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
X84 SET DIPA("OLDALTI2")=$PIECE($GET(^DGCR(399,DA,"M2")),U,4)
+1 QUIT
85 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=85
SET DW="M2;4"
SET DV="FX"
SET DU=""
SET DIFLD=143
SET DLB="Secondary Payer - Alt Prof Prim Payer ID"
+1 GOTO RE
X85 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 ;
86 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=86
DO X86
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
X86 IF X=""
IF $GET(DIPA("OLDALTI2"))=""
SET Y="@10821"
+1 QUIT
87 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=87
DO X87
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
X87 SET Y="@1082"
+1 QUIT
88 ;@10821
SET DQ=89
89 if $DATA(DG)>9
DO F^DIE17
GOTO ^IBXSAH5