drgpy is a Python library for assigning a combination of diagnosis and procedure codes to Diagnosis Related Groups (MS-DRG) that is used in Medicare inpatient reimbursement today.
After finding the final DRG using dx_lst and pr_lst, how can I print its description and MDC?
Is there any way to print CC and MCC for ICD codes as well?
I have Dx ICD of O80, Z370, and procedure ICD as 10D07Z3.
It should output DRG as 807 according to MS-DRG software and https://icd10coded.com/ms-drg/mdc-14/807/?view=pcs.
But it is giving 768.
Could someone help to correct the DRG?
The data files format is still the same, but I believe additional changes need to be made in the individual .py files. Can you guide on how to implement? I'd be happy to tackle this.
Hi, may I confirm my understanding that your script does not need information such as sex, age, admission diagnosis, discharge code to create DRGs, and if so whether mapping based only on diagnoses and procedures is sufficient to reproduce the CMA algorithm. Thanks for your thoughts!
Hey thanks for this package - simple, clean API which can chug through DRG grouping very quickly.
I cross referenced the results with already grouped DRGs and came across a few issues:
OR Procedures are DRG-specific: After skimming through your code, it seems like the logic for Appendix E is implemented in a way where it considers procedures as OR or non-OR despite this distinction being DRG-specific. I noticed common misclassification into DRG 819 due to this.
DRG-specific Issues: There are a handful of DRGs which have minor issues in their implementation
a. 795: The claim still qualifies for this DRG if it has multiple secondary diagnoses which are on the list of allowed secondaries. It is not simply a hard cut off with more than one
b. 064 and 065: These DRGs qualify if they have rtPA OR an MCC/CC respectively. Currently claims are only qualifying if they have rtPA
c. 177: The second group of primary diagnoses is not being cross referenced for this grouping
Again - this is an awesome repo man, I've had to parse CMS files too and know it's no easy feat!
Hi Yubin, I hope you are ok! I was running the library and realized that when I'm looking for the ICD N400, the function is returning 000. Do you have any idea what is happening?
Thanks for the great package! We have a large DB of codes and DRGs assigned at a large regional hospital system and we've been looking at cases where this library disagrees with the billed DRGs. One high volume case is patients with a primary DX of U071 COVID-19. The CMS files show that these patients should be assigned DRG 177-179 but drgpy returns DRG 000. This seems to be due to dx_pttrn excluding these codes on line 6 of _mdcsrdr.py. I looked through the history and couldn't figure out why the code was written this way. Obviously this code was written before COVID-19. Is there a reason to exclude 'U' codes from this library? If not, may I submit a pull request to fix this?
This is awesome repo and much easier to implement than generating batch input for the MCE, but I've found a couple issues as compared to the official CMS logic. The most frequent issue we have encountered is inappropriate assignment (or rather lack thereof) to DRGs 981-983 and 987-989. It seems that with the current logic if the grouper finds a diagnosis that matches a DRG and sees that the procedures do not correspond to any DRGs directly related to that diagnosis, it ignores the procedures and returns a DRG just based on diagnosis codes. However, the correct logic would be to check if the unrelated procedure codes qualify for DRGs in the 98X range.
I am looking for something similar that uses ICD-9-CM, as I wish to analyze older claims data.
Is it possible to modify the program to do so? CMS does publish the final rule tables going back to ~2006, which includes MCC/CC lists and exclusion lists. (I don't fully understand how the grouping algorithm works, so maybe this is insufficient.)
If you can point me to another resource, I'd also be very grateful.
I have ICD_Dx_lst = ['T6591XA','F23'] and when I try to find DRG it's showing KeyError: 'No Excl'. When I check the Appendix C, column "PDX Exclusions", "F23" is "NoExcl ".
So it is not writing any DRG.
How to I come out of KeyError: 'No Excl' and get proper DRG?