Schedule a demo
Segment

File trailer

Marks the end of an HL7 file-level transmission, carrying a count of the batches contained in the file. It is always paired with a preceding FHS and allows receiving systems to validate the completeness of the file. It is used in the same batch-file transmission scenarios as FHS, such as reference lab file exchanges and bulk data loads.

2fields
0required
v2.9HL7 version
fts.py
from zato.hl7v2.v2_9 import FTS

fts = FTS()
fts.file_batch_count = '12'
fts.file_trailer_comment = 'Wellness file complete'

Build FTS segments in Python

How to construct and work with real-world FTS segments.

1

Wellness screening file closed

Batch count and friendly comment closing a preventive screening export

from zato.hl7v2.v2_9 import FTS

fts = FTS()
fts.file_batch_count = '24'
fts.file_trailer_comment = 'Wellness screening file complete'
2

Fitness batch summary

Count and short comment for a fitness batch summary

from zato.hl7v2.v2_9 import FTS

fts = FTS()
fts.file_batch_count = '6'
fts.file_trailer_comment = 'Fitness batch summary closed'
3

Nutrition export without comment

Count only when the trailer comment is omitted

from zato.hl7v2.v2_9 import FTS

fts = FTS()
fts.file_batch_count = '3'

Learn by building

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

Frequently asked questions

It is a numeric string (NM) partners use to report how many batches or logical groups appeared in the file between FHS and FTS. Align the meaning with your file profile for wellness or fitness traffic.

No. It is optional; send an empty field after the count when you only need the numeric total.

Use file_trailer_comment together with file_control_id and reference_file_control_id from FHS in operations logs so support teams can match an opened file header with its trailer row.

FTS closes the whole file after FHS, while BTS closes an inner batch after BHS. Counts in FTS usually summarize outer file structure; BTS counts often refer to messages inside a batch.

Both fields are optional in usage; leave file_batch_count empty when your profile carries totals only in the comment or elsewhere.

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.

FTS field reference

Complete list of fields in the FTS segment, HL7 v2.9.

#Python nameDatatypeUsageRepeatableTable
1file_batch_countNMOptionalNo-
2file_trailer_commentSTOptionalNo-

Ready to build integrations?

Get started with Zato and connect your systems in minutes.

Open source In Python