source: WorldVistAEHR/trunk/r/DRG_GROUPER-ICD--ICPT/ICDTLB5A.m@ 1005

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1ICDTLB5A ;ALB/EG/ADL - GROUPER UTILITY FUNCTIONS FY 2005; 10/23/00 11:49am ; 8/23/04 11:31am
2 ;;18.0;DRG Grouper;**14**;Oct 20, 2000;Build 1
3 ;;ADL;UPDATE FOR CSV PROJECT;Mar 12, 2003
4DRG334 S ICDRG=$S(ICDCC:334,1:335) Q
5DRG335 S ICDRG=$S(ICDCC:334,1:335) Q
6DRG336 S ICDRG=$S(ICDCC:336,1:337) Q
7DRG337 S ICDRG=$S(ICDCC:336,1:337) Q
8DRG338 I SEX="M" D Q
9 .S ICDRG=$S(ICDPD["M":338,AGE="":470,AGE>17:339,SEX="":470,1:340),ICDRTC=$S(ICDRG=470:3,SEX="":4,1:ICDRTC) Q
10 I SEX="F" D Q
11 .I ICDOR["O" D DRG354 Q
12 .I ICDOR["Ogz" D DRG363 Q
13 .I ICDOR=""!(ICDOR["N") D DRG366
14 Q
15DRG339 D DRG338 Q
16DRG340 D DRG338 Q
17DRG342 S ICDRG=$S(AGE>17:342,1:343) I AGE="" S ICDRG=470,ICDRTC=3
18 Q
19DRG343 S ICDRG=$S(AGE>17:342,1:343) I AGE="" S ICDRG=470,ICDRTC=3
20 Q
21DRG344 S ICDRG=$S(ICDPD["M":344,1:345) Q
22DRG345 S ICDRG=$S(ICDPD["M":344,1:345) Q
23DRG346 S ICDRG=$S(ICDCC:346,1:347) I ICDMDC=13 S ICDRG=$S(ICDRG=346:366,1:367)
24 Q
25DRG347 S ICDRG=$S(ICDCC:346,1:347) I ICDMDC=13 S ICDRG=$S(ICDRG=346:366,1:367)
26 Q
27DRG348 S ICDRG=$S(ICDCC:348,1:349) Q
28DRG349 S ICDRG=$S(ICDCC:348,1:349) Q
29DRG350 S ICDRG=$S(SEX="M":350,1:368) I SEX="" S ICDRG=470,ICDRTC=4
30 Q
31DRG351 S ICDRG=$S('$D(ICDODRG)&(ICDORNR>0):468,SEX="":470,SEX="F":369,1:351),ICDRTC=$S(ICDRG=470:4,1:ICDRTC) Q
32DRG352 S ICDRG=$S(SEX="M":352,ICDPD["P":368,1:369) I SEX="" S ICDRG=470,ICDRTC=4
33 Q
34DRG354 S ICDRG=$S(ICDPD["M":$S(ICDPD["o":357,ICDCC:354,1:355),ICDCC:358,1:359) Q
35DRG355 D DRG354 Q
36DRG357 S ICDRG=$S(ICDPD["M":$S(ICDPD["o":357,ICDCC:354,1:355),ICDCC:358,1:359) D:'ICDOPCT DRG368 Q
37DRG358 D DRG357 Q
38DRG359 D DRG357 Q
39DRG363 S ICDRG=$S(ICDPD["M":363,1:364) Q
40DRG364 S ICDRG=$S(ICDPD["M":363,1:364) Q
41DRG366 S ICDRG=$S(ICDCC:366,1:367) Q
42DRG367 S ICDRG=$S(ICDCC:366,1:367) Q
43DRG368 S ICDRG=$S(SEX="F":368,1:470) I SEX="" S ICDRG=470,ICDRTC=4
44 Q
45DRG369 S ICDRG=$S(SEX="F":369,1:470) I SEX="" S ICDRTC=4 Q
46DRG370 S ICDRG=$S(ICDOR["c"&(ICDCC):370,ICDOR["c":371,ICDOR'["s"&(ICDOR'["g")&(ICDSD["v"!(ICDPD["v")):372,ICDOR'["s"&(ICDOR'["g"):373,ICDOR["s":374,ICDOR["g":375,1:470) Q
47DRG371 S ICDRG=$S(ICDPD["D"&(ICDCC):370,ICDPD["D":371,1:469) I $D(ICDOR)<11!(ICDOR["n") D DRG372
48 Q
49DRG372 S ICDRG=$S(ICDPD["v"!(ICDSD["v"):372,ICDOR["s":374,ICDOR["g":375,1:373) Q
50DRG373 S ICDRG=$S(ICDPD["D"&(ICDPD["v"!(ICDPD["D"&(ICDSD["v"))):372,1:373) Q
51DRG374 S ICDRG=$S($D(ICDPDRG(374)):374,1:"") Q
52DRG375 S ICDRG=$S(ICDPD["D"!(ICDSD["D"):375,1:"") Q
53DRG376 S ICDRG=$S(ICDOR["O":377,1:376) Q
54DRG377 S ICDRG=$S(ICDOR["O":377,1:376) Q
55DRG380 S ICDRG=$S(ICDOR["d":381,1:380) Q
56DRG381 S ICDRG=$S('$D(ICDPDRG(381)):"",ICDOR["d":381,1:380) Q
57DRG383 S ICDRG=$S(ICDPD["F"&(ICDSD["u"):383,ICDSD["u"!(ICDPD["v"):383,ICDPD["u":383,1:384) Q
58DRG384 D DRG383 Q
59DRG387 ;
60 S ICDRG=$S(ICDPD["E":386,ICDSD["E":386,ICDPD["Hp"&(ICDSD["J"):387,ICDPD["J"&(ICDSD["Hp"):387,ICDPD["p"!(ICDSD["p")&((ICDPD'["J")!(ICDSD'["J")):388,1:"") D:ICDRG="" DRG389 Q
61DRG388 D DRG387 Q
62DRG389 S ICDRG=$S(ICDPD["HR"&(ICDSD["J"):389,ICDPD["J"&(ICDSD["HR"):389,ICDSD["J":389,ICDPD["J":389,'$D(ICDODRG)&('$D(ICDSDRG)):391,1:390) D:ICDRG=391 DRG391 Q
63DRG390 D DRG389 Q
64DRG391 S ICDRG=$S(ICDPD["E"!(ICDSD["E"):386,ICDPD["J"&(ICDPD["p"):387,ICDSD["J"&(ICDSD["p"):387,ICDPD["p"&(ICDPD'["J"):388,ICDSD["p"&(ICDSD'["J"):388,ICDPD["J"!(ICDSD["J"):389,1:"") I ICDRG'="" Q
65 I ICDPD["R" D Q:ICDRG=391
66 .I '$D(ICDDX(2)) S ICDRG=391 Q
67 .;ALL SECONDARIES CONTAIN "R", DRG=>391
68 .N I
69 .F I=1:1 Q:'$D(ICDDX(I)) S ICDRG=$S($P($$ICDDX^ICDCODE(ICDDX(1),ICDDATE),"^",3)["R":391,1:390) Q:ICDRG=390
70 I ICDSD["R"&('$D(ICDDX(3))) S ICDRG=391 Q
71 S ICDRG=390
72 Q
73DRG392 S ICDRG=$S(AGE>17:392,1:393) I AGE="" S ICDRG=470,ICDRTC=3
74 Q
75DRG393 S ICDRG=$S(AGE>17:392,1:393) I AGE="" S ICDRG=470,ICDRTC=3
76 Q
77DRG395 S ICDRG=$S(AGE>17:395,1:396) I AGE="" S ICDRG=470,ICDRTC=3
78 Q
79DRG396 S ICDRG=$S(AGE>17:395,1:396) I AGE="" S ICDRG=470,ICDRTC=3
80 Q
81DRG398 S ICDRG=$S(ICDCC:398,1:399) Q
82DRG399 S ICDRG=$S(ICDCC:398,1:399) Q
83DRG400 I ICDPD["L"&(ICDMAJ'[3) D DRG401 Q:"401^402^403^404^405^470^473"[ICDRG
84 S ICDRG=$S(ICDPD["L":400,ICDCC:406,1:407) Q
85DRG401 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)
86 Q
87DRG402 D DRG401
88 Q
Note: See TracBrowser for help on using the repository browser.