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

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

revised back to 6/30/08 version

File size: 7.7 KB
Line 
1IBXSC6 ; GENERATED FROM 'IB SCREEN6' INPUT TEMPLATE(#512), FILE 399;12/27/07
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,""))=""
4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,22) S:%]"" DE(17)=% S %=$P(%Z,U,24) S:%]"" DE(5)=% S %=$P(%Z,U,25) S:%]"" DE(7)=% S %=$P(%Z,U,26) S:%]"" DE(11)=% S %=$P(%Z,U,27) S:%]"" DE(20)=%
5 I $D(^("U2")) S %Z=^("U2") S %=$P(%Z,U,2) S:%]"" DE(12)=% S %=$P(%Z,U,3) S:%]"" DE(13)=% S %=$P(%Z,U,7) S:%]"" DE(15)=%
6 I $D(^("U3")) S %Z=^("U3") S %=$P(%Z,U,2) S:%]"" DE(18)=%
7 K %Z Q
8 ;
9W W !?DL+DL-2,DLB_": "
10 Q
11O 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
14TR R X:DTIME E S (DTOUT,X)=U W $C(7)
15 Q
16A K DQ(DQ) S DQ=DQ+1
17B G @DQ
18RE G PR:$D(DE(DQ)) D W,TR
19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
20RD 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
23T 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
25P 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
28V D @("X"_DQ) K YS
29Z 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
30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
31 S X="?BAD"
32QS S DZ=X D D,QQ^DIEQ G B
33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
36R 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=%
39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
40I I DV'["I",DV'["#" G RD
41 D E^DIE0 G RD:$D(X),PR
42 Q
43SET 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
47SAVEVALS 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
51NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
53BEGIN S DNM="IBXSC6",DQ=1
54 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
55 M DIEZAR=^DIE(512,"AR") S DICRREC="TRIG^DIE17"
56 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=512,U="^"
571 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
58X1 S:IBDR20'["61" Y="@62"
59 Q
602 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
61X2 S:$P($G(^DGCR(399,DA,0)),U,19)'=3 Y="@612"
62 Q
633 S DQ=4 ;@611
644 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 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
65X4 S DIE("NO^")=""
66 Q
675 S DW="0;24",DV="RS",DU="",DLB="LOCATION OF CARE",DIFLD=.24
68 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;"
69 G RE
70X5 Q
716 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
72X6 S:'$D(DIE("NO^")) DIE("NO^")=""
73 Q
747 S DW="0;25",DV="R*P399.1'",DU="",DLB="BILL CLASSIFICATION",DIFLD=.25
75 S DE(DW)="C7^IBXSC6"
76 S DU="DGCR(399.1,"
77 G RE
78C7 G C7S:$D(DE(7))[0 K DB
79 S X=DE(7),DIC=DIE
80 D ALLID^IBCEP3(DA,.25,2)
81C7S S X="" G:DG(DQ)=X C7F1 K DB
82 S X=DG(DQ),DIC=DIE
83 D ALLID^IBCEP3(DA,.25,1)
84C7F1 Q
85X7 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
86 Q
87 ;
888 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
89X8 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="@611"
90 Q
919 S DQ=10 ;@612
9210 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
93X10 K DIE("NO^")
94 Q
9511 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="0;26",DV="RS",DU="",DLB="TIMEFRAME OF BILL",DIFLD=.26
96 S DE(DW)="C11^IBXSC6"
97 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;"
98 G RE
99C11 G C11S:$D(DE(11))[0 K DB
100 S X=DE(11),DIC=DIE
101 ;
102C11S S X="" G:DG(DQ)=X C11F1 K DB
103 S X=DG(DQ),DIC=DIE
104 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
105C11F1 Q
106X11 Q
10712 D:$D(DG)>9 F^DIE17,DE S DQ=12,DW="U2;2",DV="NJ3,0",DU="",DLB="COVERED DAYS",DIFLD=216
108 G RE
109X12 K:+X'=X!(X>999)!(X<0)!(X?.E1"."1.N) X
110 Q
111 ;
11213 S DW="U2;3",DV="NJ4,0",DU="",DLB="NON-COVERED DAYS",DIFLD=217
113 G RE
114X13 K:+X'=X!(X>9999)!(X<0)!(X?.E1"."1N.N) X
115 Q
116 ;
11714 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
118X14 I '$$INPAT^IBCEF(DA)!($$FT^IBCEF(DA)'=3) S Y="@6121"
119 Q
12015 S DW="U2;7",DV="NJ3,0",DU="",DLB="CO-INSURANCE DAYS",DIFLD=221
121 G RE
122X15 K:+X'=X!(X>999)!(X<0)!(X?.E1"."1.N) X
123 Q
124 ;
12516 S DQ=17 ;@6121
12617 S DW="0;22",DV="P40.8'",DU="",DLB="DEFAULT DIVISION",DIFLD=.22
127 S DE(DW)="C17^IBXSC6"
128 S DU="DG(40.8,"
129 G RE
130C17 G C17S:$D(DE(17))[0 K DB
131 S X=DE(17),DIC=DIE
132 ;
133 S X=DE(17),DIC=DIE
134 ;
135 S X=DE(17),DIC=DIE
136 ;
137 S X=DE(17),DIC=DIE
138 ;
139 S X=DE(17),DIC=DIE
140 ;
141 S X=DE(17),DIC=DIE
142 ;
143 S X=DE(17),DIC=DIE
144 ;
145 S X=DE(17),DIC=DIE
146 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
147C17S S X="" G:DG(DQ)=X C17F1 K DB
148 D ^IBXSC61
149C17F1 Q
150X17 Q
15118 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="U3;2",DV="*P8932.1'",DU="",DLB="DEFAULT DIVISION TAXONOMY",DIFLD=243
152 S DU="USC(8932.1,"
153 G RE
154X18 S DIC("S")="I $P($G(^(90002)),U,2)=""N""" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
155 Q
156 ;
15719 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
158X19 D DISPTAX^IBCEP81($P($G(^DGCR(399,DA,"U3")),U,2),"Default Division")
159 Q
16020 S DW="0;27",DV="S",DU="",DLB="BILL CHARGE TYPE",DIFLD=.27
161 S DE(DW)="C20^IBXSC6"
162 S DU="1:INSTITUTIONAL;2:PROFESSIONAL;"
163 G RE
164C20 G C20S:$D(DE(20))[0 K DB
165 S X=DE(20),DIC=DIE
166 ;
167C20S S X="" G:DG(DQ)=X C20F1 K DB
168 S X=DG(DQ),DIC=DIE
169 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)
170C20F1 Q
171X20 Q
17221 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
173X21 S DGRVRCAL=1
174 Q
17522 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
176X22 S DIPA("FT1")=$P($G(^DGCR(399,DA,0)),U,19)
177 Q
17823 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
179X23 D CKFT^IBCIUT1(IBIFN)
180 Q
18124 S DQ=25 ;@614
18225 D:$D(DG)>9 F^DIE17 G ^IBXSC62
Note: See TracBrowser for help on using the repository browser.