source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBXSC7.m@ 1582

Last change on this file since 1582 was 623, checked in by George Lilly, 15 years ago

revised back to 6/30/08 version

File size: 8.4 KB
RevLine 
[623]1IBXSC7 ; GENERATED FROM 'IB SCREEN7' INPUT TEMPLATE(#513), FILE 399;12/27/07
[613]2 D DE G BEGIN
3DE S DIE="^DGCR(399,",DIC=DIE,DP=399,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^DGCR(399,DA,""))=""
[623]4 I $D(^(0)) S %Z=^(0) 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)=%
[613]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 ;
10W W !?DL+DL-2,DLB_": "
11 Q
12O 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
15TR R X:DTIME E S (DTOUT,X)=U W $C(7)
16 Q
17A K DQ(DQ) S DQ=DQ+1
18B G @DQ
19RE G PR:$D(DE(DQ)) D W,TR
20N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
21RD 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
24T 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
26P 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
29V D @("X"_DQ) K YS
30Z 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
31X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
32 S X="?BAD"
33QS S DZ=X D D,QQ^DIEQ G B
34D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
35Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
36PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
37R 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=%
40RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
41I I DV'["I",DV'["#" G RD
42 D E^DIE0 G RD:$D(X),PR
43 Q
44SET 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
48SAVEVALS 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
52NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
53KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
54BEGIN 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="^"
581 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
59X1 S:IBDR20'["74" Y="@71"
60 Q
612 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
62X2 S:$D(IBOUT) Y="@999"
63 Q
643 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)
68M3 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
70R3 D DE
71 S D=$S($D(^DGCR(399,DA,"OP",0)):$P(^(0),U,3,4),1:1) G 3+1
72 ;
734 S DQ=5 ;@999
745 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
75X5 K IBOUT
76 Q
776 S DQ=7 ;@71
787 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
79X7 S:IBDR20'["71" Y="@72"
80 Q
818 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
82X8 S:$P($G(^DGCR(399,DA,0)),U,19)'=3 Y="@712"
83 Q
849 S DQ=10 ;@711
8510 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
86X10 S DIE("NO^")=""
87 Q
8811 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
91X11 Q
9212 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
93X12 S:'$D(DIE("NO^")) DIE("NO^")=""
94 Q
9513 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
99C13 G C13S:$D(DE(13))[0 K DB
100 S X=DE(13),DIC=DIE
101 D ALLID^IBCEP3(DA,.25,2)
102C13S S X="" G:DG(DQ)=X C13F1 K DB
103 S X=DG(DQ),DIC=DIE
104 D ALLID^IBCEP3(DA,.25,1)
105C13F1 Q
106X13 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 ;
10914 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
110X14 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
11215 S DQ=16 ;@712
11316 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
114X16 K DIE("NO^")
115 Q
11617 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
120C17 G C17S:$D(DE(17))[0 K DB
121 S X=DE(17),DIC=DIE
122 ;
123C17S 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
126C17F1 Q
127X17 Q
12818 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
130X18 K:+X'=X!(X>999)!(X<0)!(X?.E1"."1.N) X
131 Q
132 ;
13319 S DW="U2;3",DV="NJ4,0",DU="",DLB="NON-COVERED DAYS",DIFLD=217
134 G RE
135X19 K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
136 Q
137 ;
13820 S DW="U;12",DV="*P399.1'",DU="",DLB="DISCHARGE STATUS",DIFLD=162
139 S DU="DGCR(399.1,"
140 G RE
141X20 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 ;
14421 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
148C21 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
165C21S S X="" G:DG(DQ)=X C21F1 K DB
166 D ^IBXSC72
167C21F1 Q
168X21 Q
16922 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
172X22 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 ;
17523 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
176X23 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,2),"Default Division")
177 Q
17824 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
182C24 G C24S:$D(DE(24))[0 K DB
[623]183 D ^IBXSC73
[613]184C24S S X="" G:DG(DQ)=X C24F1 K DB
[623]185 D ^IBXSC74
[613]186C24F1 Q
187X24 Q
18825 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
189X25 S DGRVRCAL=1
190 Q
19126 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
192X26 S DIPA("FT1")=$P($G(^DGCR(399,DA,0)),U,19)
193 Q
19427 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
195X27 D CKFT^IBCIUT1(IBIFN)
196 Q
19728 S DQ=29 ;@714
[623]19829 D:$D(DG)>9 F^DIE17 G ^IBXSC75
Note: See TracBrowser for help on using the repository browser.