Repository navigation
Breaking changes, improved message handling, requires PHP 8.2+
⚠️ Breaking Release
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
Breaking changes
- Minimum supported PHP version is now 8.2
- The first segment in a
Messageobject must be MSH - In
insertSegment()method, only MSH can be inserted now in the 0th index InvalidArgumentExceptionhas been replaced with HL7ExceptionwithSegmentSeparator()only accepts CRLF (\r\n) as a multi-character separator
Deprecations
- Direct instantiation of
Messageis deprecated. Use theHL7factory instead, e.g.$message = HL7::build()->create() setSegment()is deprecated in favor ofinsertSegment()- Global setting
SEGMENT_ENDING_BARis deprecated (useWITH_SEGMENT_ENDING_FIELD_SEPARATOR)
New features
insertSegment()now has an optionalreplaceparameter- New
replaceSegment()method HL7::create()added as an alias ofcreateMessage()
Other updates
- PHPUnit upgraded to v11
- Dependencies updated
- Documentation and tests improved
- Internal code cleanup and refactoring
Upgrade
Update via Composer: composer require aranyasen/hl7:^4.0
Then follow the instructions in UPGRADE.md.
Feedback
If you encounter issues or have suggestions:
- Issues: github.com/senaranya/HL7/issues
- Pull Requests: github.com/senaranya/HL7/pulls