1 | IBXSC7 ; GENERATED FROM 'IB SCREEN7' INPUT TEMPLATE(#513), FILE 399;01/03/09
|
---|
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,19) S:%]"" DE(29)=% S %=$P(%Z,U,22) S:%]"" DE(21)=% S %=$P(%Z,U,24) S:%]"" DE(11)=% S %=$P(%Z,U,25) S:%]"" DE(13)=% S %=$P(%Z,U,26) S:%]"" DE(17)=% S %=$P(%Z,U,27) S:%]"" DE(24)=%
|
---|
5 | I $D(^("U")) S %Z=^("U") S %=$P(%Z,U,12) S:%]"" DE(20)=%
|
---|
6 | I $D(^("U2")) S %Z=^("U2") S %=$P(%Z,U,2) S:%]"" DE(18)=% S %=$P(%Z,U,3) S:%]"" DE(19)=%
|
---|
7 | I $D(^("U3")) S %Z=^("U3") S %=$P(%Z,U,2) S:%]"" DE(22)=%
|
---|
8 | K %Z Q
|
---|
9 | ;
|
---|
10 | W W !?DL+DL-2,DLB_": "
|
---|
11 | Q
|
---|
12 | O D W W Y W:$X>45 !?9
|
---|
13 | I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
|
---|
14 | W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
|
---|
15 | TR R X:DTIME E S (DTOUT,X)=U W $C(7)
|
---|
16 | Q
|
---|
17 | A K DQ(DQ) S DQ=DQ+1
|
---|
18 | B G @DQ
|
---|
19 | RE G PR:$D(DE(DQ)) D W,TR
|
---|
20 | N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
|
---|
21 | RD G QS:X?."?" I X["^" D D G ^DIE17
|
---|
22 | I X="@" D D G Z^DIE2
|
---|
23 | I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
|
---|
24 | 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
|
---|
25 | K DDER G X
|
---|
26 | 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
|
---|
27 | G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
|
---|
28 | I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
|
---|
29 | V D @("X"_DQ) K YS
|
---|
30 | 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
|
---|
31 | X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
|
---|
32 | S X="?BAD"
|
---|
33 | QS S DZ=X D D,QQ^DIEQ G B
|
---|
34 | D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
|
---|
35 | Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
|
---|
36 | PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
|
---|
37 | 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
|
---|
38 | 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
|
---|
39 | X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
|
---|
40 | RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
|
---|
41 | I I DV'["I",DV'["#" G RD
|
---|
42 | D E^DIE0 G RD:$D(X),PR
|
---|
43 | Q
|
---|
44 | SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
|
---|
45 | I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
|
---|
46 | D ^DIR I 'DDER S %=Y(0),X=Y
|
---|
47 | Q
|
---|
48 | SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
|
---|
49 | I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
|
---|
50 | E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
|
---|
51 | Q
|
---|
52 | NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
|
---|
53 | KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
|
---|
54 | BEGIN S DNM="IBXSC7",DQ=1
|
---|
55 | N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
|
---|
56 | M DIEZAR=^DIE(513,"AR") S DICRREC="TRIG^DIE17"
|
---|
57 | S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=513,U="^"
|
---|
58 | 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
|
---|
59 | X1 S:IBDR20'["74" Y="@71"
|
---|
60 | Q
|
---|
61 | 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
|
---|
62 | X2 S:$D(IBOUT) Y="@999"
|
---|
63 | Q
|
---|
64 | 3 S D=0 K DE(1) ;43
|
---|
65 | S DIFLD=43,DGO="^IBXSC71",DC="1^399.043DA^OP^",DV="399.043MDX",DW="0;1",DOW="OP VISITS DATE(S)",DLB="Select "_DOW S:D DC=DC_D
|
---|
66 | G RE:D I $D(DSC(399.043))#2,$P(DSC(399.043),"I $D(^UTILITY(",1)="" X DSC(399.043) S D=$O(^(0)) S:D="" D=-1 G M3
|
---|
67 | S D=$S($D(^DGCR(399,DA,"OP",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
|
---|
68 | M3 I D>0 S DC=DC_D I $D(^DGCR(399,DA,"OP",+D,0)) S DE(3)=$P(^(0),U,1)
|
---|
69 | G RE
|
---|
70 | R3 D DE
|
---|
71 | S D=$S($D(^DGCR(399,DA,"OP",0)):$P(^(0),U,3,4),1:1) G 3+1
|
---|
72 | ;
|
---|
73 | 4 S DQ=5 ;@999
|
---|
74 | 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
|
---|
75 | X5 K IBOUT
|
---|
76 | Q
|
---|
77 | 6 S DQ=7 ;@71
|
---|
78 | 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
|
---|
79 | X7 S:IBDR20'["71" Y="@72"
|
---|
80 | Q
|
---|
81 | 8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
82 | X8 S:$P($G(^DGCR(399,DA,0)),U,19)'=3 Y="@712"
|
---|
83 | Q
|
---|
84 | 9 S DQ=10 ;@711
|
---|
85 | 10 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
86 | X10 S DIE("NO^")=""
|
---|
87 | Q
|
---|
88 | 11 S DW="0;24",DV="RS",DU="",DLB="LOCATION OF CARE",DIFLD=.24
|
---|
89 | S DU="1:HOSPITAL - INPT OR OPT (INCLUDES CLINICS);2:SKILLED NURSING (NHCU);3:HOME HEALTH AGENCY;7:CLINIC (ONLY INDEPENDENT/SATELITE);8:SPEC. FACILITY HOSP/AMB SURG CTR;"
|
---|
90 | G RE
|
---|
91 | X11 Q
|
---|
92 | 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
|
---|
93 | X12 S:'$D(DIE("NO^")) DIE("NO^")=""
|
---|
94 | Q
|
---|
95 | 13 S DW="0;25",DV="R*P399.1'",DU="",DLB="BILL CLASSIFICATION",DIFLD=.25
|
---|
96 | S DE(DW)="C13^IBXSC7"
|
---|
97 | S DU="DGCR(399.1,"
|
---|
98 | G RE
|
---|
99 | C13 G C13S:$D(DE(13))[0 K DB
|
---|
100 | S X=DE(13),DIC=DIE
|
---|
101 | D ALLID^IBCEP3(DA,.25,2)
|
---|
102 | C13S S X="" G:DG(DQ)=X C13F1 K DB
|
---|
103 | S X=DG(DQ),DIC=DIE
|
---|
104 | D ALLID^IBCEP3(DA,.25,1)
|
---|
105 | C13F1 Q
|
---|
106 | X13 S DIC("S")="I $P(^(0),U,23),$$TOBIN^IBCU4(Y,D0)" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
|
---|
107 | Q
|
---|
108 | ;
|
---|
109 | 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
|
---|
110 | X14 I '$$TOBIN^IBCU4($P(^DGCR(399,DA,0),U,25),DA) W !!,*7," ** The 'BILL CLASSIFICATION' must be consistent with the 'LOCATION OF CARE.'",! S Y="@711"
|
---|
111 | Q
|
---|
112 | 15 S DQ=16 ;@712
|
---|
113 | 16 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
114 | X16 K DIE("NO^")
|
---|
115 | Q
|
---|
116 | 17 D:$D(DG)>9 F^DIE17,DE S DQ=17,DW="0;26",DV="RS",DU="",DLB="TIMEFRAME OF BILL",DIFLD=.26
|
---|
117 | S DE(DW)="C17^IBXSC7"
|
---|
118 | S DU="1:ADMIT THRU DISCHARGE;2:INTERIM - 1ST CLAIM;3:INTERIM - CONTINUING CLAIM;4:INTERIM - LAST CLAIM;5:LATE CHARGES ONLY;6:ADJUSTMENT CLAIM;7:REPLACEMENT CLAIM;8:VOID/CANCEL PRIOR CLAIM;O:NON-PAY/ZERO CLAIM;"
|
---|
119 | G RE
|
---|
120 | C17 G C17S:$D(DE(17))[0 K DB
|
---|
121 | S X=DE(17),DIC=DIE
|
---|
122 | ;
|
---|
123 | C17S S X="" G:DG(DQ)=X C17F1 K DB
|
---|
124 | S X=DG(DQ),DIC=DIE
|
---|
125 | K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,0)):^(0),1:"") S X=$P(Y(1),U,6),X=X S DIU=X K Y S X=DIV S X=DIV,X=X S DIH=$G(^DGCR(399,DIV(0),0)),DIV=X S $P(^(0),U,6)=DIV,DIH=399,DIG=.06 D ^DICR
|
---|
126 | C17F1 Q
|
---|
127 | X17 Q
|
---|
128 | 18 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="U2;2",DV="NJ3,0",DU="",DLB="COVERED DAYS",DIFLD=216
|
---|
129 | G RE
|
---|
130 | X18 K:+X'=X!(X>999)!(X<0)!(X?.E1"."1.N) X
|
---|
131 | Q
|
---|
132 | ;
|
---|
133 | 19 S DW="U2;3",DV="NJ4,0",DU="",DLB="NON-COVERED DAYS",DIFLD=217
|
---|
134 | G RE
|
---|
135 | X19 K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
|
---|
136 | Q
|
---|
137 | ;
|
---|
138 | 20 S DW="U;12",DV="*P399.1'",DU="",DLB="DISCHARGE STATUS",DIFLD=162
|
---|
139 | S DU="DGCR(399.1,"
|
---|
140 | G RE
|
---|
141 | X20 S DIC("S")="I $P(^DGCR(399.1,+Y,0),""^"",6)=1" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
|
---|
142 | Q
|
---|
143 | ;
|
---|
144 | 21 S DW="0;22",DV="P40.8'",DU="",DLB="DEFAULT DIVISION",DIFLD=.22
|
---|
145 | S DE(DW)="C21^IBXSC7"
|
---|
146 | S DU="DG(40.8,"
|
---|
147 | G RE
|
---|
148 | C21 G C21S:$D(DE(21))[0 K DB
|
---|
149 | S X=DE(21),DIC=DIE
|
---|
150 | ;
|
---|
151 | S X=DE(21),DIC=DIE
|
---|
152 | ;
|
---|
153 | S X=DE(21),DIC=DIE
|
---|
154 | ;
|
---|
155 | S X=DE(21),DIC=DIE
|
---|
156 | ;
|
---|
157 | S X=DE(21),DIC=DIE
|
---|
158 | ;
|
---|
159 | S X=DE(21),DIC=DIE
|
---|
160 | ;
|
---|
161 | S X=DE(21),DIC=DIE
|
---|
162 | ;
|
---|
163 | S X=DE(21),DIC=DIE
|
---|
164 | 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,2),X=X S DIU=X K Y S X="" S DIH=$G(^DGCR(399,DIV(0),"U3")),DIV=X S $P(^("U3"),U,2)=DIV,DIH=399,DIG=243 D ^DICR
|
---|
165 | C21S S X="" G:DG(DQ)=X C21F1 K DB
|
---|
166 | D ^IBXSC72
|
---|
167 | C21F1 Q
|
---|
168 | X21 Q
|
---|
169 | 22 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW="U3;2",DV="*P8932.1'",DU="",DLB="DEFAULT DIVISION TAXONOMY",DIFLD=243
|
---|
170 | S DU="USC(8932.1,"
|
---|
171 | G RE
|
---|
172 | X22 S DIC("S")="I $P($G(^(90002)),U,2)=""N""" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
|
---|
173 | Q
|
---|
174 | ;
|
---|
175 | 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
|
---|
176 | X23 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,2),"Default Division")
|
---|
177 | Q
|
---|
178 | 24 S DW="0;27",DV="S",DU="",DLB="BILL CHARGE TYPE",DIFLD=.27
|
---|
179 | S DE(DW)="C24^IBXSC7"
|
---|
180 | S DU="1:INSTITUTIONAL;2:PROFESSIONAL;"
|
---|
181 | G RE
|
---|
182 | C24 G C24S:$D(DE(24))[0 K DB
|
---|
183 | S X=DE(24),DIC=DIE
|
---|
184 | ;
|
---|
185 | C24S S X="" G:DG(DQ)=X C24F1 K DB
|
---|
186 | S X=DG(DQ),DIC=DIE
|
---|
187 | K DIV S DIV=X,D0=DA,DIV(0)=D0 S Y(1)=$S($D(^DGCR(399,D0,0)):^(0),1:"") S X=$P(Y(1),U,19),X=X S DIU=X K Y S X=DIV S X=$$FT^IBCU3(DA,1) X ^DD(399,.27,1,1,1.4)
|
---|
188 | C24F1 Q
|
---|
189 | X24 Q
|
---|
190 | 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
|
---|
191 | X25 S DGRVRCAL=1
|
---|
192 | Q
|
---|
193 | 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
|
---|
194 | X26 S DIPA("FT1")=$P($G(^DGCR(399,DA,0)),U,19)
|
---|
195 | Q
|
---|
196 | 27 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 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 | X27 D CKFT^IBCIUT1(IBIFN)
|
---|
198 | Q
|
---|
199 | 28 S DQ=29 ;@714
|
---|
200 | 29 D:$D(DG)>9 F^DIE17,DE S DQ=29,DW="0;19",DV="R*P353'",DU="",DLB="FORM TYPE",DIFLD=.19
|
---|
201 | S DE(DW)="C29^IBXSC7"
|
---|
202 | S DU="IBE(353,"
|
---|
203 | G RE
|
---|
204 | C29 G C29S:$D(DE(29))[0 K DB
|
---|
205 | S X=DE(29),DIC=DIE
|
---|
206 | ;
|
---|
207 | S X=DE(29),DIC=DIE
|
---|
208 | S DGRVRCAL=2
|
---|
209 | S X=DE(29),DIC=DIE
|
---|
210 | D ALLID^IBCEP3(DA,.19,2)
|
---|
211 | S X=DE(29),DIC=DIE
|
---|
212 | ;
|
---|
213 | S X=DE(29),DIC=DIE
|
---|
214 | D ATTREND^IBCU1(DA,"","")
|
---|
215 | C29S S X="" G:DG(DQ)=X C29F1 K DB
|
---|
216 | D ^IBXSC73
|
---|
217 | C29F1 Q
|
---|
218 | X29 S DIC("S")="N Z S Z=$G(^IBE(353,Y,2)) I $P(Z,U,2)=""P"",$P(Z,U,4)" D ^DIC K DIC S DIC=$G(DIE),X=+Y K:Y<0 X
|
---|
219 | Q
|
---|
220 | ;
|
---|
221 | 30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
222 | X30 S DIPA("FT")=$P($G(^DGCR(399,DA,0)),U,19)
|
---|
223 | Q
|
---|
224 | 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
|
---|
225 | X31 I $P($G(^IBE(353,+DIPA("FT"),2)),U,2)="P",$P($G(^(2)),U,4) S DIPA("FT1")=DIPA("FT") D CKFT^IBCIUT1(IBIFN) S Y="@715"
|
---|
226 | Q
|
---|
227 | 32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 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
|
---|
228 | X32 W !,*7,"Must be a printable national form type"
|
---|
229 | Q
|
---|
230 | 33 D:$D(DG)>9 F^DIE17 G ^IBXSC74
|
---|