drgDetail

Query to specify data request for all Diagnosis Related Group (DRG) parameters for additional context and categories.

What is a Diagnosis Related Group (DRG)?

A patient classification scheme that groups patients into categories based on their principal diagnosis, secondary diagnoses, surgical procedures, age, sex, and discharge status. DRGs are used to determine hospital reimbursement rates under Medicare's Prospective Payment System (PPS).

Bespoke nature of DRG creation can be messy

The creation of DRGs is a deeply human process. Individual judgement and relationship dynamics play an outsized role in the creation and determination of DRG codes and the corresponding financial values - and many of these nuances are not recorded in a reliable fashion.

  • 🏥 DRGs are assigned to patients based on information reported by the hospital on the Medicare Inpatient Hospital Discharge Data (MS-DRG) abstract.
  • 🕓 These abstracts contain information about the patient's primary diagnosis, up to 24 additional diagnoses, and up to 25 procedures performed during the stay.
  • ☔ DRGs are used by Medicare and other payors to make payments to hospitals for inpatient stays.
  • 💸 Transparency of both clinical logic going into DRG code determinations (and the price coming out) are frequently obfuscated by

All in all, CareQuery® leverages the comprehensive longitudinal record of patients to articulately arrive at a reliable DRG determination for inpatient visits, helping users to comprehensively look through the DRG lens, despite the DRG's traditional data lineage shortcomings.

Get Started with drgDetail

If you have already setup CareQuery, run the below code to get started with your first drgDetail query.

Example:

🔍

Query the details around all Ischemic Stroke and Eye DRGs

# import package
from care_query.care_query import CareQuery

# instantiate and connect
cq = CareQuery(email = "your-email", 
               token = "your-api-token")

# construct query
query = cq.drgDetail(drg_code = ["061","062","063"],
                     drg_category = "eye")

# execute query to return results
data = query.execute() 

Query Parameters

The following a parameters are available within the diagDetail query, including details on the parameter values.

parameterdescriptionoptions
drg_codeDiagnosis related group (DRG) code. This code is based on your primary and secondary diagnoses, other conditions (co-morbidities), age, sex, and necessary medical procedures.values available
drg_categoryMedical Diagnostic Category MDC of the DRGvalues available
limitNumber of rows returned in the data requestInteger or False
showBinary indicator as to whether you'd like query to be printed
for review upon query creation
True or False

Query Return Data

The drgDetail query returns the DRG_TABLE for all diagnosis codes that meet the criterion specified within the query.

The DRG_TABLE offers diagnosis descriptions, categorial mappings and additional detail relevant for analytic uses.

featuredescriptionexample
drg_codeDiagnosis related group (DRG) code. This code is based on your primary and secondary diagnoses, other conditions (comorbidities), age, sex, and necessary medical procedures099
drg_nameDescriptive name of the DRG codenon-bacterial infection of nervous system except viral meningitis without cc/mcc
drg_categoryMedical Diagnostic Category MDC of the DRGnervous system
drg_typeThe type of diagnosis related group (DRG)medical
drg_post_acuteBinary indicator of whether a DRG is post acute or notFalse
drg_specialBinary indicator of whether a DRG is a special condition - particularly complex or expensive conditions that may require specialized care, longer hospital stays, and/or more expensive medications and proceduresFalse
drg_weightRepresents the relative resources required to care for patients in that particular DRG. This CMS computed figure highlights a DRG's relative to the average resources used to treat cases in all other DRGs1.3985
los_gmeanThe geometric mean length of stay corresponding to a DRG3.7
los_meanThe arithmetic mean length of stay corresponding to a DRG4.6

Advanced Query Logic & Recipes

drgDetail gives users categorical groupings for ease of use, as well as SQL-like capabilities to tactfully specify AND and OR logic, right within the CareQuery API!

🚧

drgDetail does not allow for nested lists within the query parameters

Please reference the following resources to better understand how to create rockstar queries!