Contains reference data for Diagnosis Related Groups used in prospective payment systems. Each instance carries the DRG code, its major diagnostic category, trim point boundaries, average length of stay, and relative weight. It appears in MFN/MFR master file messages and is used by billing, coding, and case-management systems to validate reimbursement parameters and length-of-stay expectations.
from zato.hl7v2 import DMI
dmi = DMI()
dmi.average_length_of_stay = '4.5'
dmi.relative_weight = '1.2345'How to construct and work with real-world DMI segments.
DRG master file record with group code, category, and reimbursement weight
from zato.hl7v2.v2_9 import DMI
from zato.hl7v2.v2_9 import CNE, NR
dmi = DMI()
dmi.diagnostic_related_group = CNE(
identifier='470',
text='Major hip and knee joint replacement',
name_of_coding_system='HL70055'
)
dmi.major_diagnostic_category = CNE(
identifier='8',
text='Musculoskeletal',
name_of_coding_system='HL70118'
)
dmi.lower_and_upper_trim_points = NR(
low_value='2',
high_value='10'
)
dmi.average_length_of_stay = '4.5'
dmi.relative_weight = '1.9406'DRG master entry for a cardiac procedure with trim points and weight
from zato.hl7v2.v2_9 import DMI
from zato.hl7v2.v2_9 import CNE, NR
dmi = DMI()
dmi.diagnostic_related_group = CNE(
identifier='216',
text='Cardiac valve procedure w/o pump',
name_of_coding_system='HL70055'
)
dmi.major_diagnostic_category = CNE(
identifier='5',
text='Circulatory',
name_of_coding_system='HL70118'
)
dmi.lower_and_upper_trim_points = NR(
low_value='3',
high_value='14'
)
dmi.average_length_of_stay = '6.2'
dmi.relative_weight = '2.8712'Low-weight DRG entry for a short-stay respiratory diagnosis
from zato.hl7v2.v2_9 import DMI
from zato.hl7v2.v2_9 import CNE, NR
dmi = DMI()
dmi.diagnostic_related_group = CNE(
identifier='194',
text='Simple pneumonia',
name_of_coding_system='HL70055'
)
dmi.major_diagnostic_category = CNE(
identifier='4',
text='Respiratory',
name_of_coding_system='HL70118'
)
dmi.lower_and_upper_trim_points = NR(
low_value='1',
high_value='7'
)
dmi.average_length_of_stay = '3.1'
dmi.relative_weight = '0.7124'Step-by-step guides for working with HL7 v2 in Zato.
DMI carries Diagnosis Related Group reference data in master file messages. It provides the DRG code, major diagnostic category, length-of-stay trim points, average stay, and relative weight used by billing and case-management systems for reimbursement calculations.
The diagnostic_related_group field uses the CNE datatype with HL7 table 0055:
from zato.hl7v2.v2_9 import DMI, CNE
dmi = DMI()
dmi.diagnostic_related_group = CNE(
identifier='470',
text='Major joint replacement',
name_of_coding_system='HL70055'
)The lower_and_upper_trim_points field uses the NR (numeric range) datatype with low and high values:
from zato.hl7v2.v2_9 import DMI, NR
dmi = DMI()
dmi.lower_and_upper_trim_points = NR(
low_value='2',
high_value='10'
)Use a CNE value referencing HL7 table 0118 for the MDC classification:
from zato.hl7v2.v2_9 import DMI, CNE
dmi = DMI()
dmi.major_diagnostic_category = CNE(
identifier='8',
text='Musculoskeletal',
name_of_coding_system='HL70118'
)Both fields are simple numeric values representing days and the CMS relative weight:
from zato.hl7v2.v2_9 import DMI
dmi = DMI()
dmi.average_length_of_stay = '4.5'
dmi.relative_weight = '1.9406'Zato connects to any system that speaks HL7v2 over MLLP or FHIR over REST. This includes Epic, Cerner, Meditech, Allscripts, and other EHR platforms.
Yes, Zato has built-in MLLP support for sending and receiving HL7v2 messages. MLLP channels handle the framing protocol automatically.
Zato supports HL7 v2.9, which is backward compatible with earlier versions including v2.3, v2.5, and v2.7. Standard segments and datatypes are available as typed Python classes.
Yes. Zato handles both HL7v2 and FHIR natively, so you can parse v2 messages and build FHIR resources with IG-specific extensions in the same service. Typed Python classes are available for both protocols, including extensions from US Core, UK Core, Da Vinci, and other Implementation Guides.
Complete list of fields in the DMI segment, HL7 v2.9.
| # | Python name | Datatype | Usage | Repeatable | Table |
|---|---|---|---|---|---|
| 1 | diagnostic_related_group | CNE | Optional | No | HL70055 |
| 2 | major_diagnostic_category | CNE | Optional | No | HL70118 |
| 3 | lower_and_upper_trim_points | NR | Optional | No | - |
| 4 | average_length_of_stay | NM | Optional | No | - |
| 5 | relative_weight | NM | Optional | No | - |
Get started with Zato and connect your systems in minutes.