1 | ICDTLB6B ;ALB/EG/MRY - GROUPER UTILITY FUNCTIONS FY 2006; 9/29/03 2:47pm ; 6/28/05 4:06pm
|
---|
2 | ;;18.0;DRG Grouper;**20,22**;Oct 20, 2000;Build 1
|
---|
3 | DRG403 S ICDRG=$S(ICDPD["l":$S(AGE="":470,AGE<18:405,1:473),ICDOR["O"!(ICDORNI["O"):$S(ICDCC:401,1:402),ICDCC:403,1:404),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
4 | DRG404 S ICDRG=$S(ICDPD["l":$S(AGE="":470,AGE<18:405,1:473),ICDOR["O"!(ICDORNI["O"):$S(ICDCC:401,1:402),ICDCC:403,1:404),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
5 | DRG405 D DRG404 Q
|
---|
6 | DRG406 ;
|
---|
7 | I ICDORNI["K" D
|
---|
8 | .S ICDRG=$S((ICDPD["L")&(ICDCC):539,ICDPD["L":540,ICDCC:406,1:407)
|
---|
9 | I ICDORNI'["K" D DRG408
|
---|
10 | Q
|
---|
11 | DRG407 D DRG406 Q
|
---|
12 | DRG408 I $D(ICDDX(1))&(ICDOPCT=0) D Q:ICDRG=409
|
---|
13 | .I ICDDX(1)=$O(^ICD9("AB","V58.0 ",0)) S ICDRG=409 Q
|
---|
14 | .I ICDDX(1)=$O(^ICD9("AB","V67.1 ",0)) S ICDRG=409 Q
|
---|
15 | .Q
|
---|
16 | I $D(ICDDX(1))&(ICDOPCT=0) D Q:"410^492"[ICDRG
|
---|
17 | .I ICDDX(1)=$O(^ICD9("AB","V58.11 ",0)) S ICDRG=$S(ICDSD["2":492,1:410) Q
|
---|
18 | .I ICDDX(1)=$O(^ICD9("AB","V58.12 ",0)) S ICDRG=$S(ICDSD["2":492,1:410) Q
|
---|
19 | .I ICDDX(1)=$O(^ICD9("AB","V67.2 ",0)) S ICDRG=$S(ICDSD["2":492,1:410) Q
|
---|
20 | I ICDOPCT>0 S ICDRG=$S(ICDPD'["L":408,ICDCC:401,1:402) Q
|
---|
21 | I ICDOPCT=0 D DRG412
|
---|
22 | Q
|
---|
23 | DRG411 S ICDRG=$S(ICDOR["O"!(ICDORNI["O"):408,ICDOR["N":412,1:411) Q
|
---|
24 | DRG412 ;S ICDRG=$S(ICDOR["O"!(ICDORNI["O"):408,ICDOR["N"&($D(ICDPDRG(412))):412,$D(ICDPDRG(411)):411,ICDCC:413,1:414)
|
---|
25 | I ICDOPCT>0 D DRG408 Q
|
---|
26 | D DRG412^ICDTLB61
|
---|
27 | Q
|
---|
28 | DRG413 S ICDRG=$S(ICDCC:413,1:414) Q
|
---|
29 | DRG414 S ICDRG=$S(ICDCC:413,1:414) Q
|
---|
30 | DRG416 S ICDRG=$S(ICDOR["O":415,AGE="":470,AGE>17:416,1:417),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
31 | DRG417 S ICDRG=$S(ICDOR["O":415,AGE="":470,AGE>17:416,1:417),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
32 | DRG418 S ICDRG=$S(ICDOR["O":415,1:418) Q
|
---|
33 | DRG419 S ICDRG=$S(ICDOR["O":415,AGE="":470,AGE<18:422,ICDCC:419,1:420),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
34 | DRG420 S ICDRG=$S(ICDOR["O":415,AGE="":470,AGE<18:422,ICDCC:419,1:420),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
35 | DRG421 S ICDRG=$S(ICDOR["O":415,AGE="":470,AGE>17:421,1:422),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
36 | DRG422 S ICDRG=$S(ICDOR["O":415,AGE="":470,AGE>17:421,1:422),ICDRTC=$S(ICDRG=470:3,1:ICDRTC) Q
|
---|
37 | DRG423 S ICDRG=$S(ICDOR["O":415,1:423) Q
|
---|
38 | DRG424 S ICDRG=$S(ICDOR["O":424,1:425) Q
|
---|
39 | DRG425 S ICDRG=$S(ICDOR["O":424,1:425) Q
|
---|
40 | DRG426 S ICDRG=$S(ICDOR["O":424,1:426) Q
|
---|
41 | DRG427 S ICDRG=$S(ICDOR["O":424,1:427) Q
|
---|
42 | DRG428 S ICDRG=$S(ICDOR["O":424,1:428) Q
|
---|
43 | DRG429 S ICDRG=$S(ICDOR["O":424,1:429) Q
|
---|
44 | DRG430 S ICDRG=$S(ICDOR["O":424,1:430) Q
|
---|
45 | DRG431 S ICDRG=$S(ICDOR["O":424,1:431) Q
|
---|
46 | DRG432 S ICDRG=$S(ICDOR["O":424,1:432) Q
|
---|
47 | DRG434 S ICDRG=$S(ICDPD["t"!(ICDSD["t"):$S(ICDOR["D":437,ICDOR["R":436,ICDCC:434,1:435),ICDCC:434,1:435) Q
|
---|
48 | DRG435 S ICDRG=$S(ICDPD["t"!(ICDSD["t"):$S(ICDOR["D":437,ICDOR["R":436,ICDCC:434,1:435),ICDCC:434,1:435) Q
|
---|
49 | DRG436 S ICDRG=$S(ICDPD["t"!(ICDSD["t"):$S(ICDOR["D":437,ICDOR["R":436,ICDCC:434,1:435),ICDCC:434,1:435) Q
|
---|
50 | DRG437 S ICDRG=$S(ICDPD["t"!(ICDSD["t"):$S(ICDOR["D":437,ICDOR["R":436,ICDCC:434,1:435),ICDCC:434,1:435) Q
|
---|
51 | DRG439 S ICDRG=$S($D(ICDODRG(440)):440,1:439) Q
|
---|
52 | DRG442 S ICDRG=$S(ICDCC:442,1:443) Q
|
---|
53 | DRG443 D EN1^ICDDRG5 S ICDRG=$S(ICDCC3:$S(ICDCC:442,1:443),1:"") Q
|
---|
54 | DRG444 S ICDRG=$S(AGE<18:446,ICDCC:444,1:445) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
55 | Q
|
---|
56 | DRG445 S ICDRG=$S(AGE<18:446,ICDCC:444,1:445) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
57 | Q
|
---|
58 | DRG446 S ICDRG=$S(AGE<18:446,ICDCC:444,1:445) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
59 | Q
|
---|
60 | DRG447 S ICDRG=$S(AGE>17:447,1:448) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
61 | Q
|
---|
62 | DRG448 S ICDRG=$S(AGE>17:447,1:448) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
63 | Q
|
---|
64 | DRG449 S ICDRG=$S(AGE<18:451,ICDCC:449,1:450) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
65 | Q
|
---|
66 | DRG450 S ICDRG=$S(AGE<18:451,ICDCC:449,1:450) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
67 | Q
|
---|
68 | DRG451 S ICDRG=$S(AGE<18:451,ICDCC:449,1:450) I AGE="" S ICDRG=470,ICDRTC=3
|
---|
69 | Q
|
---|
70 | DRG452 S ICDRG=$S(ICDCC:452,1:453) Q
|
---|
71 | DRG453 S ICDRG=$S(ICDCC:452,1:453) Q
|
---|
72 | DRG454 S ICDRG=$S(ICDCC:454,1:455) Q
|
---|
73 | DRG455 S ICDRG=$S(ICDCC:454,1:455) Q
|
---|
74 | DRG462 S ICDRG=$S(ICDOR["O":461,1:462) Q
|
---|
75 | DRG463 S ICDRG=$S(ICDOR["O":461,ICDCC:463,1:464) Q
|
---|
76 | DRG464 S ICDRG=$S(ICDOR["O":461,ICDCC:463,1:464) Q
|
---|
77 | DRG465 S ICDRG=$S(ICDOR["O":461,ICDSD["m":465,1:466) Q
|
---|
78 | DRG466 S ICDRG=$S(ICDOR["O":461,ICDSD["m":465,1:466) Q
|
---|
79 | DRG467 S ICDRG=$S(ICDOR["O":461,1:467) Q
|
---|
80 | DRG471 S ICDRG=$S($F($P(ICDOR,"M",2,99),"M"):471,1:"") Q
|
---|
81 | DRG475 S ICDRG=$S(ICDOR["V":475,1:$S($D(ICDPDRG):$O(ICDPDRG(0)),1:468)) I ICDRG<468 D DODRG^ICDDRG0
|
---|
82 | Q
|
---|
83 | DRG478 S ICDRG=$S(ICDOR["O"&ICDCC:478,1:479)
|
---|
84 | I ICDRG=478 D DRG553^ICDTLB6B
|
---|
85 | Q
|
---|
86 | DRG479 G DRG478
|
---|
87 | DRG493 ;I (ICDI-1)=1,'ICDCC S ICDCC=$S($D(^ICD9("ACC",ICDDX(1),ICDDX(1))):1,1:0)
|
---|
88 | S ICDRG=$S(ICDCC:493,1:494) Q
|
---|
89 | DRG494 ;I (ICD-1),'ICDCC S ICDCC=$S($D(^ICD9("ACC",ICDDX(1),ICDDX(1))):1,1:0)
|
---|
90 | S ICDRG=$S(ICDCC:493,1:494) Q
|
---|
91 | DRG495 Q
|
---|
92 | DRG496 S ICDRG=$S(ICDOR["F":496,ICDCC:497,1:498)
|
---|
93 | I ICDRG=497!(ICDRG=498) I ICDPD["6" S ICDRG=546 Q
|
---|
94 | I ICDRG=497!(ICDRG=498) I $D(ICDDXT("737.40"))!($D(ICDDXT("737.41")))!($D(ICDDXT("737.42")))!($D(ICDDXT("737.43"))) S ICDRG=546
|
---|
95 | Q
|
---|
96 | DRG497 G DRG496 ;S ICDRG=$S(ICDOR["F":496,ICDCC:497,1:498) Q
|
---|
97 | DRG498 G DRG496 ;S ICDRG=$S(ICDOR["F":496,ICDCC:497,1:498) Q
|
---|
98 | DRG499 S ICDRG=$S(ICDCC:499,1:500) Q
|
---|
99 | DRG500 S ICDRG=$S(ICDCC:499,1:500) Q
|
---|
100 | DRG501 D
|
---|
101 | . I (ICDPD["k") D
|
---|
102 | .. I ICDCC S ICDRG=501
|
---|
103 | .. I 'ICDCC S ICDRG=502
|
---|
104 | . E S ICDRG=503
|
---|
105 | Q
|
---|
106 | DRG502 D DRG501 Q
|
---|
107 | DRG503 D DRG501 Q
|
---|
108 | DRG514 ; Replaced with DRG535
|
---|
109 | N ICDE1,ICDE2
|
---|
110 | S ICDE1=$S($D(ICDOP(" 37.95"))&($D(ICDOP(" 37.96"))):1,1:0)
|
---|
111 | S ICDE2=$S($D(ICDOP(" 37.97"))&($D(ICDOP(" 37.98"))):1,1:0)
|
---|
112 | S ICDRG=470
|
---|
113 | I $D(ICDOP(" 37.94")) I ICDE1+ICDE2=0 S ICDRG=515
|
---|
114 | I '$D(ICDOP(" 37.94")) I ICDE1!ICDE2 S ICDRG=515
|
---|
115 | ; "HN" in ICDOR represents OR proc 37.21-.23, 37.26, 88.52-.58
|
---|
116 | I ICDRG=515 I ICDOR["HN" S ICDRG=514
|
---|
117 | Q
|
---|
118 | DRG515 D DRG535 Q
|
---|
119 | DRG516 ; DRG 516,517,526 and 527 replaced by DRG 555-558 respectively
|
---|
120 | S ICDRG=518
|
---|
121 | D DRG555
|
---|
122 | I $D(ICDOP(" 36.06"))!$D(ICDOP(" 92.27")) D DRG556
|
---|
123 | I $D(ICDOP(" 36.07")) D DRG557
|
---|
124 | Q
|
---|
125 | DRG517 D DRG516 Q
|
---|
126 | DRG518 D DRG516 Q
|
---|
127 | DRG519 S ICDRG=$S(ICDOR["F":496,ICDCC:519,1:520) Q
|
---|
128 | DRG520 D DRG519 Q
|
---|
129 | DRG521 S ICDRG=$S(ICDCC:521,ICDOR["D"!(ICDOR["R"):522,1:523) Q
|
---|
130 | DRG522 D DRG521 Q
|
---|
131 | DRG523 D DRG521 Q
|
---|
132 | DRG526 D DRG516 Q
|
---|
133 | DRG527 D DRG516 Q
|
---|
134 | DRG531 S ICDRG=$S(ICDCC:531,1:532) Q
|
---|
135 | DRG532 D DRG531 Q
|
---|
136 | DRG533 S ICDRG=$S(ICDCC:533,1:534) Q
|
---|
137 | DRG534 D DRG533 Q
|
---|
138 | DRG535 N ICDE1,ICDE2,ICDE3
|
---|
139 | S ICDE1=$S($D(ICDOP(" 37.95"))&(($D(ICDOP(" 37.96")))!($D(ICDOP(" 00.54")))):1,1:0)
|
---|
140 | S ICDE2=$S($D(ICDOP(" 37.97"))&(($D(ICDOP(" 37.98")))!($D(ICDOP(" 00.54")))):1,1:0)
|
---|
141 | S ICDE3=$S($D(ICDOP(" 00.52"))&($D(ICDOP(" 00.54"))):1,1:0)
|
---|
142 | ;S ICDE4=$S($D(ICDOP(" 00.54"))&($D(ICDOP(" 37.95"))):1,1:0)
|
---|
143 | S ICDRG=470
|
---|
144 | I $D(ICDOP(" 37.94"))!$D(ICDOP(" 00.51")) I ICDE1+ICDE2+ICDE3=0 S ICDRG=515
|
---|
145 | I '$D(ICDOP(" 37.94"))&('$D(ICDOP(" 00.51"))) I ICDE1!ICDE2!ICDE3 S ICDRG=515
|
---|
146 | ; "HN" in ICDOR represents OR proc 37.21-.23, 37.26, 88.52-.58
|
---|
147 | I ICDRG=515 I ICDOR["HN" I '$D(ICDOP(" 37.26")) S ICDRG=$S(ICDPD["A":535,1:536)
|
---|
148 | I ICDRG=470 D DRG115^ICDTLB2B
|
---|
149 | Q
|
---|
150 | DRG536 D DRG535 Q
|
---|
151 | DRG537 S ICDRG=$S(ICDCC:537,1:538) Q
|
---|
152 | DRG538 D DRG537 Q
|
---|
153 | DRG539 I ICDPD["L"&(ICDMAJ'[3) D DRG401^ICDTLB5B Q:"401^402^403^404^405^470^473"[ICDRG
|
---|
154 | S ICDRG=$S((ICDPD["L")&(ICDCC):539,ICDPD["L":540,ICDCC:406,1:407) Q
|
---|
155 | DRG540 D DRG539 Q
|
---|
156 | DRG543 S ICDRG=$S((ICDPD["Q")&(ICDOR["Q"):543,ICDOR["Q"&$D(ICDOP(" 00.10")):543,1:ICDRG) Q
|
---|
157 | DRG544 Q
|
---|
158 | DRG545 Q
|
---|
159 | DRG546 Q
|
---|
160 | DRG547 ; called from DRG106^ICDTLB2B
|
---|
161 | D MCV
|
---|
162 | S ICDRG=$S(ICDMCV:547,ICDMCV1:547,1:548) Q
|
---|
163 | DRG548 G DRG547
|
---|
164 | DRG549 ; called from DRG106^ICDTLB2B
|
---|
165 | D MCV
|
---|
166 | S ICDRG=$S(ICDMCV:549,ICDMCV1:549,1:550) Q
|
---|
167 | DRG550 G DRG549
|
---|
168 | DRG551 ; called from DRG115^ICDTLB2B
|
---|
169 | D MCV
|
---|
170 | I ICDMCV!(ICDMCV2) S ICDRG=551
|
---|
171 | Q
|
---|
172 | DRG552 Q
|
---|
173 | DRG553 ; called from DRG478
|
---|
174 | D MCV
|
---|
175 | S ICDRG=$S(ICDMCV:553,ICDMCV1:553,1:554) Q
|
---|
176 | DRG554 G DRG553
|
---|
177 | DRG555 ; called from DRG516
|
---|
178 | D MCV
|
---|
179 | I ICDMCV!(ICDMCV1) S ICDRG=555
|
---|
180 | Q
|
---|
181 | DRG556 ; called from DRG516
|
---|
182 | D MCV
|
---|
183 | I 'ICDMCV&('ICDMCV1) S ICDRG=556
|
---|
184 | Q
|
---|
185 | DRG557 ; called from DRG516
|
---|
186 | D MCV
|
---|
187 | I ICDMCV!ICDMCV1 S ICDRG=557
|
---|
188 | E S ICDRG=558
|
---|
189 | Q
|
---|
190 | DRG558 G DRG516
|
---|
191 | DRG559 ;I DGDX(1)["433.01"!(DGDX(1)["433.11")!(DGDX(1)["433.21")!(DGDX(1)["433.31")!(DGDX(1)["433.81")!(DGDX(1)["433.91")!(DGDX(1)["434.01")!(DGDX(1)["434.11")!(DGDX(1)["434.91") S ICDRG=559
|
---|
192 | I $G(ICDDX(1))=12856!($G(ICDDX(1))=12858)!($G(ICDDX(1))=12860)!($G(ICDDX(1))=12862)!($G(ICDDX(1))=12864)!($G(ICDDX(1))=12866)!($G(ICDDX(1))=12868)!($G(ICDDX(1))=12870)!($G(ICDDX(1))=12872) S ICDRG=559
|
---|
193 | Q
|
---|
194 | MCV ; checks to see if case qualifies as an MCV (major cardiovascular complications or complex conditions)
|
---|
195 | S (ICDMCV,ICDMCV1,ICDMCV2)=0
|
---|
196 | ; ICDPD=identifier for prime dx ICDSD=identifier for any secondary dx
|
---|
197 | ; DGDX(1)=prime dx ICDDX(1)=ien of prime dx ICDDXT=any secondary dx
|
---|
198 | I ICDPD["c"!(ICDSD["c") S ICDMCV=1
|
---|
199 | I ICDSD["s" S ICDMCV=1
|
---|
200 | ;I DGDX(1)["426.0"!(DGDX(1)["426.53")!(DGDX(1)["426.54") S ICDMCV1=1
|
---|
201 | I $G(ICDDX(1))=9056!($G(ICDDX(1))=2548)!($G(ICDDX(1))=2549) S ICDMCV1=1
|
---|
202 | I $D(ICDDXT("426.0"))!($D(ICDDXT("426.53")))!($D(ICDDXT("426.54"))) S ICDMCV1=1
|
---|
203 | ;I DGDX(1)["411.1"!(DGDX(1)["411.81") S ICDMCV2=1
|
---|
204 | I $G(ICDDX(1))=2500!($G(ICDDX(1))=12477) S ICDMCV2=1
|
---|
205 | I $D(ICDDXT("411.1"))!($D(ICDDXT("411.81"))) S ICDMCV2=1
|
---|
206 | Q
|
---|