[623] | 1 | IBXSC33 ; ;12/27/07
|
---|
[613] | 2 | D DE G BEGIN
|
---|
| 3 | DE S DIE="^DGCR(399,",DIC=DIE,DP=399,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DGCR(399,DA,""))=""
|
---|
| 4 | I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,21) S:%]"" DE(11)=%
|
---|
| 5 | I $D(^("M")) S %Z=^("M") S %=$P(%Z,U,11) S:%]"" DE(8)=% S %=$P(%Z,U,13) S:%]"" DE(1)=% S %=$P(%Z,U,14) S:%]"" DE(3)=%
|
---|
| 6 | I $D(^("M1")) S %Z=^("M1") S %=$P(%Z,U,2) S:%]"" DE(15)=% S %=$P(%Z,U,10) S:%]"" DE(16)=%
|
---|
| 7 | K %Z Q
|
---|
| 8 | ;
|
---|
| 9 | W W !?DL+DL-2,DLB_": "
|
---|
| 10 | Q
|
---|
| 11 | O D W W Y W:$X>45 !?9
|
---|
| 12 | I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
|
---|
| 13 | W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
|
---|
| 14 | TR R X:DTIME E S (DTOUT,X)=U W $C(7)
|
---|
| 15 | Q
|
---|
| 16 | A K DQ(DQ) S DQ=DQ+1
|
---|
| 17 | B G @DQ
|
---|
| 18 | RE G PR:$D(DE(DQ)) D W,TR
|
---|
| 19 | N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
|
---|
| 20 | RD G QS:X?."?" I X["^" D D G ^DIE17
|
---|
| 21 | I X="@" D D G Z^DIE2
|
---|
| 22 | I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
|
---|
| 23 | T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
|
---|
| 24 | K DDER G X
|
---|
| 25 | 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
|
---|
| 26 | G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
|
---|
| 27 | I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
|
---|
| 28 | V D @("X"_DQ) K YS
|
---|
| 29 | 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
|
---|
| 30 | X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
|
---|
| 31 | S X="?BAD"
|
---|
| 32 | QS S DZ=X D D,QQ^DIEQ G B
|
---|
| 33 | D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
|
---|
| 34 | Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
|
---|
| 35 | PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
|
---|
| 36 | 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
|
---|
| 37 | 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
|
---|
| 38 | X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
|
---|
| 39 | RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
|
---|
| 40 | I I DV'["I",DV'["#" G RD
|
---|
| 41 | D E^DIE0 G RD:$D(X),PR
|
---|
| 42 | Q
|
---|
| 43 | SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
|
---|
| 44 | I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
|
---|
| 45 | D ^DIR I 'DDER S %=Y(0),X=Y
|
---|
| 46 | Q
|
---|
| 47 | SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
|
---|
| 48 | I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
|
---|
| 49 | E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
|
---|
| 50 | Q
|
---|
| 51 | NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
|
---|
| 52 | KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
|
---|
| 53 | BEGIN S DNM="IBXSC33",DQ=1
|
---|
| 54 | 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="M;13",DV="FOX",DU="",DLB="SECONDARY INSURANCE POLICY",DIFLD=113
|
---|
| 55 | S DQ(1,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
|
---|
| 56 | S DE(DW)="C1^IBXSC33",DE(DW,"INDEX")=1
|
---|
| 57 | G RE
|
---|
| 58 | C1 G C1S:$D(DE(1))[0 K DB
|
---|
| 59 | S X=DE(1),DIC=DIE
|
---|
| 60 | 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)
|
---|
| 61 | S X=DE(1),DIC=DIE
|
---|
| 62 | D KIX^IBCNS2(DA,"I2")
|
---|
| 63 | S X=DE(1),DIC=DIE
|
---|
| 64 | 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)
|
---|
| 65 | C1S S X="" G:DG(DQ)=X C1F1 K DB
|
---|
| 66 | S X=DG(DQ),DIC=DIE
|
---|
| 67 | 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)
|
---|
| 68 | S X=DG(DQ),DIC=DIE
|
---|
| 69 | D IX^IBCNS2(DA,"I2")
|
---|
| 70 | S X=DG(DQ),DIC=DIE
|
---|
| 71 | 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)
|
---|
| 72 | C1F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
| 73 | F DIXR=139 S DIEZRXR(399,DIXR)=""
|
---|
| 74 | Q
|
---|
| 75 | X1 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)
|
---|
| 76 | I $D(X),X'?.ANP K X
|
---|
| 77 | Q
|
---|
| 78 | ;
|
---|
| 79 | 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
|
---|
| 80 | X2 S:X="" Y="@998"
|
---|
| 81 | Q
|
---|
| 82 | 3 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW="M;14",DV="FOX",DU="",DLB="TERTIARY INSURANCE POLICY",DIFLD=114
|
---|
| 83 | S DQ(3,2)="S Y(0)=Y S Y=$$TRANS^IBCNS2($G(DA,D0),Y)"
|
---|
| 84 | S DE(DW)="C3^IBXSC33",DE(DW,"INDEX")=1
|
---|
| 85 | G RE
|
---|
| 86 | C3 G C3S:$D(DE(3))[0 K DB
|
---|
| 87 | S X=DE(3),DIC=DIE
|
---|
| 88 | 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,3),X=X S DIU=X K Y S X="" X ^DD(399,114,1,1,2.4)
|
---|
| 89 | S X=DE(3),DIC=DIE
|
---|
| 90 | D KIX^IBCNS2(DA,"I3")
|
---|
| 91 | S X=DE(3),DIC=DIE
|
---|
| 92 | X ^DD(399,114,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,114,1,3,2.4)
|
---|
| 93 | C3S S X="" G:DG(DQ)=X C3F1 K DB
|
---|
| 94 | S X=DG(DQ),DIC=DIE
|
---|
| 95 | 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,3),X=X S DIU=X K Y X ^DD(399,114,1,1,1.1) X ^DD(399,114,1,1,1.4)
|
---|
| 96 | S X=DG(DQ),DIC=DIE
|
---|
| 97 | D IX^IBCNS2(DA,"I3")
|
---|
| 98 | S X=DG(DQ),DIC=DIE
|
---|
| 99 | X ^DD(399,114,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) X ^DD(399,114,1,3,1.4)
|
---|
| 100 | C3F1 S DIEZRXR(399,DIIENS)=$$OREF^DILF($NA(@$$CREF^DILF(DIE)))
|
---|
| 101 | F DIXR=139 S DIEZRXR(399,DIXR)=""
|
---|
| 102 | Q
|
---|
| 103 | X3 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)
|
---|
| 104 | I $D(X),X'?.ANP K X
|
---|
| 105 | Q
|
---|
| 106 | ;
|
---|
| 107 | 4 S DQ=5 ;@998
|
---|
| 108 | 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
|
---|
| 109 | X5 S Y="@31"
|
---|
| 110 | Q
|
---|
| 111 | 6 S DQ=7 ;@311
|
---|
| 112 | 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
|
---|
| 113 | X7 D INST^IBCU
|
---|
| 114 | Q
|
---|
| 115 | 8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW="M;11",DV="RP4",DU="",DLB="RESPONSIBLE INSTITUTION",DIFLD=111
|
---|
| 116 | S DE(DW)="C8^IBXSC33"
|
---|
| 117 | S DU="DIC(4,"
|
---|
| 118 | G RE
|
---|
| 119 | C8 G C8S:$D(DE(8))[0 K DB
|
---|
| 120 | S X=DE(8),DIC=DIE
|
---|
| 121 | D DEL^IBCU5
|
---|
| 122 | S X=DE(8),DIC=DIE
|
---|
| 123 | S DGRVRCAL=2
|
---|
| 124 | C8S S X="" G:DG(DQ)=X C8F1 K DB
|
---|
| 125 | S X=DG(DQ),DIC=DIE
|
---|
| 126 | D MAILIN^IBCU5
|
---|
| 127 | S X=DG(DQ),DIC=DIE
|
---|
| 128 | S DGRVRCAL=1
|
---|
| 129 | C8F1 Q
|
---|
| 130 | X8 Q
|
---|
| 131 | 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
|
---|
| 132 | X9 K DIC("DR"),DLAYGO
|
---|
| 133 | Q
|
---|
| 134 | 10 S DQ=11 ;@31
|
---|
| 135 | 11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="0;21",DV="*S",DU="",DLB="CURRENT BILL PAYER SEQUENCE",DIFLD=.21
|
---|
| 136 | S DE(DW)="C11^IBXSC33"
|
---|
| 137 | S DU="P:PRIMARY INSURANCE;S:SECONDARY INSURANCE;T:TERTIARY INSURANCE;A:PATIENT;"
|
---|
| 138 | G RE
|
---|
| 139 | C11 G C11S:$D(DE(11))[0 K DB
|
---|
| 140 | S X=DE(11),DIC=DIE
|
---|
| 141 | 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,2),X=X S DIU=X K Y S X="" X ^DD(399,.21,1,1,2.4)
|
---|
| 142 | S X=DE(11),DIC=DIE
|
---|
| 143 | K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(0)=X S X=('$$REQMRA^IBEFUNC(DA)&$$NEEDMRA^IBEFUNC(DA)) I X S X=DIV S Y(1)=$S($D(^DGCR(399,D0,"TX")):^("TX"),1:"") S X=$P(Y(1),U,5),X=X S DIU=X K Y S X="" X ^DD(399,.21,1,2,2.4)
|
---|
| 144 | S X=DE(11),DIC=DIE
|
---|
| 145 | ;
|
---|
| 146 | C11S S X="" G:DG(DQ)=X C11F1 K DB
|
---|
| 147 | D ^IBXSC34
|
---|
| 148 | C11F1 Q
|
---|
| 149 | X11 Q
|
---|
| 150 | 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
|
---|
| 151 | X12 S:IBDR20'["32" Y="@33"
|
---|
| 152 | Q
|
---|
| 153 | 13 S DQ=14 ;@3211
|
---|
| 154 | 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
|
---|
| 155 | X14 I '$$SUPPPT^IBCEP7B(DA,1) S Y="@3212"
|
---|
| 156 | Q
|
---|
[623] | 157 | 15 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW="M1;2",DV="F",DU="",DLB="PRIMARY PROVIDER #",DIFLD=122
|
---|
[613] | 158 | S DE(DW)="C15^IBXSC33"
|
---|
| 159 | S Y="@"
|
---|
| 160 | 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)
|
---|
| 161 | G RD
|
---|
| 162 | C15 G C15S:$D(DE(15))[0 K DB
|
---|
| 163 | D ^IBXSC35
|
---|
| 164 | C15S S X="" G:DG(DQ)=X C15F1 K DB
|
---|
| 165 | S X=DG(DQ),DIC=DIE
|
---|
| 166 | ;
|
---|
| 167 | C15F1 Q
|
---|
[623] | 168 | X15 K:$L(X)>13!($L(X)<3) X
|
---|
[613] | 169 | I $D(X),X'?.ANP K X
|
---|
| 170 | Q
|
---|
| 171 | ;
|
---|
| 172 | 16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW="M1;10",DV="*P355.97'",DU="",DLB="PRIMARY ID QUALIFIER",DIFLD=128
|
---|
| 173 | S DU="IBE(355.97,"
|
---|
| 174 | S Y="@"
|
---|
| 175 | 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)
|
---|
| 176 | G RD
|
---|
| 177 | X16 S DIC("S")="I $$BPS^IBCEPU(Y)!($$EPT^IBCEPU(Y))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
|
---|
| 178 | Q
|
---|
| 179 | ;
|
---|
| 180 | 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
|
---|
| 181 | X17 W !,"No Billing Prov Secondary IDs will be sent for Primary Ins/Elect Plan Type."
|
---|
| 182 | Q
|
---|
| 183 | 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
|
---|
| 184 | X18 S Y="@3221"
|
---|
| 185 | Q
|
---|
| 186 | 19 S DQ=20 ;@3212
|
---|
| 187 | 20 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 188 | X20 I '$$ATTREND^IBCEP7B(DA,1) S Y="@3213"
|
---|
| 189 | Q
|
---|
| 190 | 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
|
---|
| 191 | X21 I $P($G(^DGCR(399,DA,"M1")),U,2)]"" S Y="@3213"
|
---|
| 192 | Q
|
---|
| 193 | 22 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 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
|
---|
| 194 | X22 W !,"The Att/Rend ID will be sent as the primary ins. Billing Prov Sec ID."
|
---|
| 195 | Q
|
---|
| 196 | 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
|
---|
| 197 | X23 S Y="@3221"
|
---|
| 198 | Q
|
---|
| 199 | 24 S DQ=25 ;@3213
|
---|
| 200 | 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
|
---|
| 201 | X25 S IBPSDAT=$$GETID^IBCEP7B(DA,1),IBPSID=$P(IBPSDAT,U),IBPSQUAL=$P(IBPSDAT,U,2) I IBPSID="" S Y="@321"
|
---|
| 202 | Q
|
---|
| 203 | 26 D:$D(DG)>9 F^DIE17 G ^IBXSC36
|
---|