Schedule a demo
Message type

Post detail financial transaction

Posts a detailed financial transaction to the billing system. The PID segment identifies the patient, FT1 carries the financial transaction detail, and PV1 identifies the visit. Charge capture and billing systems consume this.

59segments
19required
9groups
v2.9HL7 version
dft-p03.py
# Zato
from zato.hl7v2 import HL7Message

# An incoming message ..
raw = 'MSH|^~\&|SENDER|FAC|RCV|DEST|20260701||' \
      'DFT^P03^DFT_P03|MSG001|P|2.9\r' \
      'PID|1||MRN-10045||SMITH^JOHN||19850315|M\r' \
      'FT1|1||20260701||CG|99213^Office visit^CPT|1'

# .. parsed into a Python object ..
msg = HL7Message.parse(raw)

# .. whose fields we can now access.
name = msg.pid.patient_name
dob = msg.pid.date_time_of_birth
charge = msg.ft1.transaction_code
charge_date = msg.ft1.transaction_date

Build and parse DFT^P03 messages in Python

How to construct, send, receive, and extract fields from real-world DFT^P03 messages.

1

Parse an incoming DFT^P03 message

Demonstrates receiving and extracting key fields from a post detail financial transaction transaction

# Zato
from zato.hl7v2 import HL7Message

# An incoming message ..
raw = 'MSH|^~\&|SENDER|FAC|RCV|DEST|20260701||' \
      'DFT^P03^DFT_P03|MSG001|P|2.9\r' \
      'PID|1||MRN-10045||SMITH^JOHN||19850315|M\r' \
      'FT1|1||20260701||CG|99213^Office visit^CPT|1'

# .. parsed into a Python object ..
msg = HL7Message.parse(raw)

# .. whose fields we can now access.
name = msg.pid.patient_name
dob = msg.pid.date_time_of_birth
charge = msg.ft1.transaction_code
charge_date = msg.ft1.transaction_date

Learn by building

Step-by-step guides for working with HL7 v2 in Zato.

Frequently asked questions

Use the HL7v2 message parser to extract the typed structure. The parsed message gives you direct access to every segment and field by name.

from zato.hl7v2 import HL7Message

raw = 'MSH|^~\&|SENDER|FACILITY|RECEIVER|DEST|20260401120000||DFT^P03^DFT_P03|MSG00001|P|2.9\rEVN|P03|20260401120000\rPID|1||MRN-10045||JOHNSON^SARAH^M||19880612|F|||100 Oak Lane^^Portland^OR^97201\rPD1|||Family Health Clinic^^12345\rPRT|1||AT^Attending||1234^CHEN^DAVID^L^^^MD\rROL|1|AD|AT^Attending^HL70443|1234^CHEN^DAVID^L^^^MD\rDB1|1||N\rDRG|'
msg = HL7Message.parse(raw)

name = msg.pid.patient_name
dob = msg.pid.date_time_of_birth

Beyond the mandatory MSH header, the required segments are: EVN, PID, ORC, TQ1, OBR, OBX, FT1, PR1. Optional segments provide additional detail when available.

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.

DFT^P03 segment composition

Segments that make up the DFT^P03 message, in order. Groups are shown with their child segments.

#SegmentUsageRepeatsDescriptionGroup
1MSHRequiredNoMessage header-
2ARVOptionalYesAccess restriction-
3SFTOptionalYesSoftware segment-
4UACOptionalNoUser authentication credential-
5EVNRequiredNoEvent type-
6PIDRequiredNoPatient identification-
7PD1OptionalNoPatient additional demographic-
8PRTOptionalYesParticipation information-
9ROLOptionalYesRole-
10PV1OptionalNoPatient visitVISIT
11PV2OptionalNoPatient visit - additional infoVISIT
12PRTOptionalYesParticipation informationVISIT
13ROLOptionalYesRoleVISIT
14DB1OptionalYesDisability-
15ORCRequiredNoCommon orderCOMMON_ORDER
16PRTOptionalYesParticipation informationCOMMON_ORDER
17TQ1RequiredNoTiming / quantityCOMMON_ORDER
18TQ2OptionalYesTiming / quantity relationshipCOMMON_ORDER
19OBRRequiredNoObservation requestCOMMON_ORDER
20PRTOptionalYesParticipation informationCOMMON_ORDER
21NTEOptionalYesNotes and commentsCOMMON_ORDER
22OBXRequiredNoObservation resultCOMMON_ORDER
23PRTOptionalYesParticipation informationCOMMON_ORDER
24NTEOptionalYesNotes and commentsCOMMON_ORDER
25FT1RequiredNoFinancial transactionFINANCIAL
26PRTOptionalYesParticipation informationFINANCIAL
27ROLOptionalYesRoleFINANCIAL
28NTEOptionalYesNotes and commentsFINANCIAL
29PR1RequiredNoProceduresFINANCIAL
30PRTOptionalYesParticipation informationFINANCIAL
31ROLOptionalYesRoleFINANCIAL
32OBXRequiredNoObservation resultFINANCIAL
33PRTOptionalYesParticipation informationFINANCIAL
34NTERequiredYesNotes and commentsFINANCIAL
35OBRRequiredNoObservation requestFINANCIAL
36PRTOptionalYesParticipation informationFINANCIAL
37NTEOptionalYesNotes and commentsFINANCIAL
38OBXRequiredNoObservation resultFINANCIAL_OBSERVATION_2
39PRTOptionalYesParticipation informationFINANCIAL_OBSERVATION_2
40NTEOptionalYesNotes and commentsFINANCIAL_OBSERVATION_2
41ORCRequiredNoCommon orderFINANCIAL
42PRTOptionalYesParticipation informationFINANCIAL
43TQ1RequiredNoTiming / quantityFINANCIAL_TIMING_QUANTITY
44TQ2OptionalYesTiming / quantity relationshipFINANCIAL_TIMING_QUANTITY
45OBRRequiredNoObservation requestFINANCIAL_ORDER
46PRTOptionalYesParticipation informationFINANCIAL_ORDER
47NTEOptionalYesNotes and commentsFINANCIAL_ORDER
48OBXRequiredNoObservation resultFINANCIAL_OBSERVATION
49PRTOptionalYesParticipation informationFINANCIAL_OBSERVATION
50NTEOptionalYesNotes and commentsFINANCIAL_OBSERVATION
51DG1RequiredNoDiagnosisDIAGNOSIS
52DRGOptionalNoDiagnosis related group-
53GT1OptionalYesGuarantor-
54IN1RequiredNoInsuranceINSURANCE
55IN2OptionalNoInsurance additional infoINSURANCE
56IN3OptionalYesInsurance additional info - certificationINSURANCE
57PRTOptionalYesParticipation informationINSURANCE
58ROLOptionalYesRoleINSURANCE
59ACCOptionalNoAccident-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python