source: WorldVistAEHR/trunk/r/DRG_GROUPER-ICD--ICPT/ICDTLB2C.m@ 1667

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

initial load of WorldVistAEHR

File size: 5.2 KB
Line 
1ICDTLB2C ;ALB/EG - GROUPER UTILITY FUNCTIONS FY 2007; 9/19/03 1:09pm ; 6/28/05 4:02pm
2 ;;18.0;DRG Grouper;**24**;Oct 20, 2000;Build 5
3DRG95 S ICDRG=$S(ICDCC:94,1:95) Q
4DRG96 S ICDRG=$S(AGE<18:98,ICDCC:96,1:97) I AGE="" S ICDRG=470,ICDRTC=3
5 Q
6DRG97 S ICDRG=$S(AGE<18:98,ICDCC:96,1:97) I AGE="" S ICDRG=470,ICDRTC=3
7 Q
8DRG98 S ICDRG=$S(AGE<18:98,ICDCC:96,1:97) I AGE="" S ICDRG=470,ICDRTC=3
9 Q
10DRG99 S ICDRG=$S(ICDCC!($D(ICDSDRG(99))):99,1:100) Q
11DRG100 S ICDRG=$S(ICDCC:99,1:100) Q
12DRG101 S ICDRG=$S(ICDCC:101,1:102) Q
13DRG102 S ICDRG=$S(ICDCC:101,1:102) Q
14DRG104 ;valve procedure
15 N ICDE1,ICDE2
16 S ICDE1=$S($D(ICDOP(" 37.95"))&($D(ICDOP(" 37.96"))):1,1:0),ICDE2=$S($D(ICDOP(" 37.97"))&($D(ICDOP(" 37.98"))):1,1:0)
17 ;I ICDOR'["P",'ICDE1&'ICDE2&($D(ICDOP(" 37.95"))!$D(ICDOP(" 37.96"))!$D(ICDOP(" 37.97"))!$D(ICDOP(" 37.98"))) S ICDRG=116 Q
18 S:ICDOR["H" ICDRG=$S(ICDOR["N"&ICDE1:104,ICDOR["N"&ICDE2:104,ICDOR["O":104,1:ICDRG)
19 S:ICDOR'["H" ICDRG=$S(ICDOR["N"&ICDE1:105,ICDOR["N"&ICDE2:105,ICDOR["O":105,1:ICDRG)
20 I ICDOR["P"&(ICDE1+ICDE2=0) S ICDRG=$S(ICDOR["H":104,1:105)
21 Q
22DRG105 D DRG104 Q
23 ; NOIS ANN-0801-41869 ignore 37.26 which has "HN1" for identifier
24DRG106 ;S ICDRG=$S(ICDOR["b"&(ICDOR["6")&(ICDOR["1"):106,ICDOR["6"&(ICDOR'["1")&(ICDOR["H"):107,ICDOR["6"&(ICDOR'["1")&(ICDOR'["H"):109,1:470) I "106^107^109"'[ICDRG D
25 S ICDRG=470
26 I ICDOR["b" D DRG549^ICDTLB6C
27 I ICDOR["b" I $D(ICDOP(" 35.96"))!($D(ICDOP(" 00.66"))) S ICDRG=106 Q
28 I ICDOR["b" I $D(ICDOP(" 37.21"))!($D(ICDOP(" 37.22")))!($D(ICDOP(" 37.23"))) D DRG547^ICDTLB6C Q
29 I ICDOR["b" I $D(ICDOP(" 88.52"))!($D(ICDOP(" 88.53")))!($D(ICDOP(" 88.54")))!($D(ICDOP(" 88.55")))!($D(ICDOP(" 88.56")))!($D(ICDOP(" 88.57")))!($D(ICDOP(" 88.58"))) D DRG547^ICDTLB6C Q
30 I ICDRG'=106&(ICDRG'=547)&(ICDRG'=548)&(ICDRG'=549)&(ICDRG'=550) S ICDRG=470 D
31 .;I ICDCC D DRG110 Q
32 .;I ICDOR'["b" D DRG112 I +ICDRG>0&(+ICDRG<470) Q
33 .;I ICDOR'["b" D DRG516^ICDTLB6A I +ICDRG>0 Q
34 .I ICDCC D DRG110 Q
35 .D DRG111
36 Q
37DRG107 D DRG106 Q
38DRG108 S ICDRG=$S(ICDOR["Oo":108,$D(ICDOP(" 38.44"))&$D(ICDOP(" 38.45")):108,ICDCC:110,1:111) Q
39DRG109 D DRG106 Q
40DRG110 D DRG111 Q
41DRG111 S ICDRG=$S(ICDOR["Oo":108,ICDCC&(ICDOR[7):110,ICDOR[7:111,1:ICDRG)
42 I "108^110^111"[ICDRG Q
43 I $D(ICDJJ(478))&('$D(ICDJJ(110))&'($D(ICDJJ(111)))) D DRG478^ICDTLB6C
44 D DRG113 I ICDRG=113 Q
45 I ICDOR["p" D DRG117
46 I ICDOR["1" D DRG516^ICDTLB6C
47 Q
48DRG112 S ICDRG=$S(ICDOR["Oo":108,(ICDOR["1")&($D(ICDOP(" 36.06"))):116,ICDOR["1":112,1:470) I ICDRG=470 D
49 .I ICDPD["A" D DRG115 Q
50 .I ICDOR["p" D DRG117 Q
51 .D DRG111
52 Q
53DRG113 S ICDRG=$S($D(ICDJJ(113)):113,1:ICDRG) Q
54DRG115 D EN1^ICDDRG5
55 I ICDPD'["I"&(ICDCC2=0)&(ICDCC3=0) S ICDRG=127 Q
56 I ICDCC2=1!(ICDCC3=1) D DRG551^ICDTLB6C
57 I ICDRG=551 Q
58 ; ICDCC2 identifies AICD LEAD OR GNRTR
59 I ICDCC2=1&(ICDCC3=0) S ICDRG=551 Q
60 I ICDCC3=1 S ICDRG=552
61 Q
62DRG116 D DRG115 Q
63DRG117 D DRG115 I ICDRG=551!(ICDRG=552) Q
64 I ICDOR["p" S ICDRG=117
65 Q
66DRG118 D DRG115 I ICDRG=551!(ICDRG=552) Q
67 S ICDRG=118 I $D(ICDOP(" 00.56")) S ICDRG=120
68 Q
69DRG120 ;dx combo's for DRG120
70 N ICDE1,ICDE2
71 S ICDE1=$S($D(ICDOP(" 37.95"))&($D(ICDOP(" 37.96"))):1,1:0),ICDE2=$S($D(ICDOP(" 37.97"))&($D(ICDOP(" 37.98"))):1,1:0)
72 S ICDRG=$S((ICDE1&(ICDOR["H")):104,(ICDE1&(ICDOR'["H")):105,(ICDE2&(ICDOR["H")):104,(ICDE2&(ICDOR'["H")):105,1:120)
73 Q
74DRG121 S ICDRG=$S(ICDSD["CV":121,ICDEXP=0:122,ICDEXP=1:123,1:470) I ICDRG=470 S ICDRTC=5
75 Q
76DRG122 S ICDRG=$S(ICDSD["CV":121,ICDEXP=0:122,ICDEXP=1:123,1:470) I ICDRG=470 S ICDRTC=5
77 Q
78DRG123 S ICDRG=$S(ICDSD["CV":121,ICDEXP=0:122,ICDEXP=1:123,1:470) I ICDRG=470 S ICDRTC=5
79 Q
80DRG124 S ICDRG=$S(ICDPD["X"!(ICDSD["X"):124,1:125) Q
81DRG125 S ICDRG=$S(ICDPD["X"!(ICDSD["X"):124,1:125) Q
82DRG130 S ICDRG=$S(ICDCC:130,1:131) Q
83DRG131 S ICDRG=$S(ICDCC!($D(ICDSDRG(130))):130,1:131) Q
84DRG132 S ICDRG=$S(ICDCC:132,1:133) Q
85DRG133 S ICDRG=$S(ICDCC:132,1:133) Q
86DRG135 S ICDRG=$S(AGE<18:137,ICDCC:135,1:136) I AGE="" S ICDRG=470,ICDRTC=3
87 Q
88DRG136 S ICDRG=$S(AGE<18:137,ICDCC:135,1:136) I AGE="" S ICDRG=470,ICDRTC=3
89 Q
90DRG137 S ICDRG=$S(AGE<18:137,ICDCC:135,1:136) I AGE="" S ICDRG=470,ICDRTC=3
91 Q
92DRG138 S ICDRG=$S(ICDCC:138,1:139) Q
93DRG139 S ICDRG=$S(ICDCC:138,1:139) Q
94DRG140 S ICDRG=$S(ICDOR["H":124,ICDNOR["H":124,1:140) Q
95DRG141 S ICDRG=$S(ICDCC:141,1:142) Q
96DRG142 S ICDRG=$S(ICDCC:141,1:142) Q
97DRG144 S ICDRG=$S(ICDCC:144,1:145) Q
98DRG145 S ICDRG=$S(ICDCC:144,1:145) Q
99DRG146 S ICDRG=$S(ICDCC:146,1:147) Q
100DRG147 S ICDRG=$S(ICDCC:146,1:147) Q
101DRG148 S ICDRG=$S('ICDCC:149,(ICDPD["g"!(ICDSD["g")):569,1:570) Q
102DRG149 G DRG148 ;;S ICDRG=$S(ICDCC:148,1:149) Q
103DRG150 S ICDRG=$S(ICDCC:150,1:151) Q
104DRG151 S ICDRG=$S(ICDCC:150,1:151) Q
105DRG152 S ICDRG=$S(ICDCC:152,1:153) Q
106DRG153 S ICDRG=$S(ICDCC:152,1:153) Q
107DRG154 S ICDRG=$S(AGE<18:156,'ICDCC:155,(ICDPD["g"!(ICDSD["g")):567,1:568) I AGE="" S ICDRG=470,ICDRTC=3
108 Q
109DRG155 G DRG154 ;;S ICDRG=$S(AGE<18:156,ICDCC:154,1:155) I AGE="" S ICDRG=470,ICDRTC=3
110 Q
111DRG156 G DRG154 ;;S ICDRG=$S(AGE<18:156,ICDCC:154,1:155) I AGE="" S ICDRG=470,ICDRTC=3
112 Q
113DRG157 S ICDRG=$S(ICDCC:157,1:158) Q
114DRG158 S ICDRG=$S(ICDCC:157,1:158) Q
115DRG159 S ICDRG=$S(AGE<18:163,ICDCC:159,1:160) I AGE="" S ICDRG=470,ICDRTC=3
116 Q
117DRG160 S ICDRG=$S(AGE<18:163,ICDCC:159,1:160) I AGE="" S ICDRG=470,ICDRTC=3
118 Q
119DRG161 S ICDRG=$S(AGE<18:163,ICDCC:161,ICDSD["J":161,1:162) I AGE="" S ICDRG=470,ICDRTC=3
120 Q
121DRG162 S ICDRG=$S(AGE<18:163,ICDCC:161,1:162) I AGE="" S ICDRG=470,ICDRTC=3
122 Q
Note: See TracBrowser for help on using the repository browser.