NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #2367 most downloaded on Packagist
HL7 parser, generator and sender.
Latest stable
4.0.5
Last release 1 months ago
27 Sep 2026
Release timing varies
gaps range from 8 days to 6 months
Some releases are documented
notes for 27 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
69 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Fix MSH setField to reject non-string values for fields 1 and 2 by @senaranya in https://github.com/senaranya/HL7/pull/149
Full Changelog: https://github.com/senaranya/HL7/compare/4.0.4...4.0.5
docs: added AI agent guidelines and skills context by @senaranya in https://github.com/senaranya/HL7/pull/147
Full Changelog: https://github.com/senaranya/HL7/compare/4.0.3...4.0.4
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Removed PHPCs as composer dependency. This makes it leaner and less vulnerable to supply-chain security-holes
Full Changelog: https://github.com/senaranya/HL7/compare/4.0.2...4.0.3
Added @template annotations to getSegmentsByClass() and getFirstSegmentInstanceByClass(). PHPStan/Psalm/IDEs can now recognize the exact Segment subcl
Added @template annotations to getSegmentsByClass() and getFirstSegmentInstanceByClass(). PHPStan/Psalm/IDEs can now recognize the exact Segment subclass returned, eliminating the need for manual type casting or @var annotations.
Full Changelog: https://github.com/senaranya/HL7/compare/4.0.1...4.0.2
Previously, toString() supported only a single-component version ID in MSH.12, but not subcomponents in it (as per docs).
Previously, toString() supported only a single-component version ID in MSH.12, but not subcomponents in it (as per docs).
MSH|^~\\&||||||||||2.7 - toSring() worked
MSH|^~\\&||||||||||2.7^NZL&1.0 - toString() failed.
This bug is fixed in this release. So, MSH.12 containing subcomponents, is going to successfully show up in toString() call.
Version 4.0 introduces several breaking changes and now requires PHP 8.2 or newer.
Version 4.0 introduces several breaking changes and now requires PHP 8.2 or newer.
If you are upgrading from 3.x, please review the upgrade guide before updating:
➡️ https://github.com/senaranya/HL7/blob/master/UPGRADE.md
Message object must be MSHinsertSegment() method, only MSH can be inserted now in the 0th indexInvalidArgumentException has been replaced with HL7ExceptionwithSegmentSeparator() only accepts CRLF (\r\n) as a multi-character separatorMessage is deprecated. Use the HL7 factory instead, e.g. $message = HL7::build()->create()setSegment() is deprecated in favor of insertSegment()SEGMENT_ENDING_BAR is deprecated (use WITH_SEGMENT_ENDING_FIELD_SEPARATOR)insertSegment() now has an optional replace parameterreplaceSegment() methodHL7::create() added as an alias of createMessage()Update via Composer: composer require aranyasen/hl7:^4.0
Then follow the instructions in UPGRADE.md.
If you encounter issues or have suggestions:
Nothing published for this version
Nothing published for this version
If segments are removed from the middle of a message, it creates gaps in the keys of $msg->getSegments() array. The newly added rekeySegmentsInArray c
If segments are removed from the middle of a message, it creates gaps in the keys of $msg->getSegments() array. The newly added rekeySegmentsInArray can be used to re-key it.
Nothing published for this version
Also deprecated SEGMENT_ENDING_BAR in favor of WITH_SEGMENT_ENDING_FIELD_SEPARATOR
Also deprecated SEGMENT_ENDING_BAR in favor of WITH_SEGMENT_ENDING_FIELD_SEPARATOR
Nothing published for this version
This is to avoid deprecation warnings while running tests on PHP 8.4 environment (Doc)
This is to avoid deprecation warnings while running tests on PHP 8.4 environment (Doc)
Nothing published for this version
Allow array on setPatientIdentifierList field (PID.3)
Allow array on setPatientIdentifierList field (PID.3)
Added segment-classes for PD1, RX4 & RXR
This change is required to support HL7 v2.7 onwards
This change is required to support HL7 v2.7 onwards
Nothing published for this version
HL7 factory class provides a more fluent, object-oriented interface for parsing or composing a message, allowing you to chain multiple methods togethe
Nothing published for this version
Added data-types for method arguments, method returns and properties
Declare strict. More type checking to be followed in coming releases
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
General maintenance release with code refactors and linting error fixes.
General maintenance release with code refactors and linting error fixes.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
In release 2.0.3, repetition character behavior was corrected - it now generates sub-arrays from repeating segments by default.
In release 2.0.3, repetition character behavior was corrected - it now generates sub-arrays from repeating segments by default.
While this is the correct behavior, it led to some existing code/tests to fail. As a temporary workaround, a 6th argument is added in new Message() call, that creates a single array as opposed to sub-arrays, retaining previous behavior.
Since this is a non-default behavior, it may be removed in future.
Refer to readme for an example.
Minimum PHP version required: 7.3
Nothing published for this version
Nothing published for this version
Allow 0 and '0' as field values
Added support for all sex values in PID.8 as per standard
Added a method getSocket() in Connection class to return the socket created for sending message. This is useful while testing
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Option to skip index auto-incrementing while creating message object from string
Option to skip index auto-incrementing while creating message object from string
Nothing published for this version
Nothing published for this version
Added hasSegment() method to conveniently check for presence of a segment in a Message object
Added hasSegment() method to conveniently check for presence of a segment in a Message object
Nothing published for this version
Use 'true' as 4th argument while creating a new Message object, or call resetSegmentIndices() to reset segment indices to 1
Use 'true' as 4th argument while creating a new Message object, or call resetSegmentIndices() to reset segment indices to 1
Nothing published for this version
Nothing published for this version
For example, following code will timeout at 20 seconds with this fix: `php (new Connection($ip, $port, 20))->send($message); `
For example, following code will timeout at 20 seconds with this fix:
(new Connection($ip, $port, 20))->send($message);
Nothing published for this version
Nothing published for this version
Nothing published for this version
Ability to omit line-ending | char when constructing messages
Check readme for details
To upgrade: If you're defining destructor in classes inherited from the segments classes of this package (e.g., PID, OBX etc.), call ` parent::__destr
To upgrade: If you're defining destructor in classes inherited from the segments classes of this package (e.g., PID, OBX etc.), call parent::__destruct() in the child class.
Nothing published for this version
Nothing published for this version
One column per quarter.