Download the PHP package orderlyconnect/astm-e1394-91 without Composer
On this page you can find all versions of the php package orderlyconnect/astm-e1394-91. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download orderlyconnect/astm-e1394-91
More information about orderlyconnect/astm-e1394-91
Files in orderlyconnect/astm-e1394-91
Package astm-e1394-91
Short Description Parse, build and transmit ASTM E1394-97 clinical laboratory messages over TCP, serial or files — including full LLP framing, ENQ/ACK handshake, and a fluent message builder.
License MIT
Homepage https://github.com/OrderlyConnect/astm-e1394-91
Informations about the package astm-e1394-91
OrderlyConnect ASTM E1394-97
A complete, production-ready PHP 8.1+ library for parsing, building, and transmitting ASTM E1394-97 messages — the standard used by clinical laboratory instruments (haematology analysers, chemistry analysers, coagulation systems, etc.) to exchange patient results with LIS/HIS systems.
Validated against real Sysmex XN-350 haematology analyser output.
Features
- Parse plain-text and LLP-framed ASTM messages into typed PHP objects
- Build messages with a fluent, type-safe builder API
- Send over TCP, RS-232 serial, or files with full ENQ/ACK/EOT handshake
- Receive inbound instrument connections with a byte-level state machine receiver
- TCP Server — accept multiple instrument connections in a dedicated process
- LLP framing — ASTM E1381-95 checksum, ETX/ETB frame splitting, streaming decoder
- EscapeCodec — encode/decode
&F& &R& &S& &E&sequences (§6.6) - MessageValidator — structural rule checking
- MessageCollection — batch processing with cross-session queries
- MessageDiff — field-by-field comparison for correction workflows
- JSON/array serialisation —
toArray()/toJson() - Zero runtime dependencies
Installation
Requirements: PHP 8.1+.
Serial port support requires stty (Linux/macOS) or mode.com (Windows).
Quick Start
Table of Contents
- Parsing
- Building Messages
- Cloning & Modifying
- Sending
- Receiving
- TCP Server
- Transports
- LLP Protocol
- Utility Classes
- Serialisation
- ASTM Record Reference
- Examples
- Testing
- Extending
- Publishing to Packagist
Parsing
Building Messages
Custom delimiters
Cloning & Modifying
Sending
Receiving
TCP Server
Transports
| Class | Use Case |
|---|---|
TcpTransport |
Connect to an instrument over TCP/IP |
SerialTransport |
RS-232 via /dev/ttyUSBx or COM3 |
FileTransport |
Read / write LLP-framed binary files |
MemoryTransport |
Unit tests and simulation |
StreamTransport |
Wrap any open PHP stream resource |
Implement TransportInterface (6 methods) to add your own.
LLP Protocol
- ETX — ends each ASTM record's last chunk
- ETB — splits records longer than
maxDataBytes(default 240) - Frame numbers cycle 1–7
- Checksum = sum(bytes of frameNum + data + ETX/ETB) mod 256, two uppercase hex digits
Utility Classes
EscapeCodec
| Sequence | Literal |
|---|---|
&F& |
\| field delimiter |
&R& |
\ repeat delimiter |
&S& |
^ component delimiter |
&E& |
& escape character |
MessageValidator
MessageCollection
MessageDiff
DateTimeHelper
Serialisation
ASTM Record Reference
Result flags
| Constant | Value | Meaning |
|---|---|---|
Result::FLAG_NORMAL |
N |
Within range |
Result::FLAG_ABOVE_NORMAL |
H |
High |
Result::FLAG_BELOW_NORMAL |
L |
Low |
Result::FLAG_CRITICAL_H |
HH |
Critically high |
Result::FLAG_CRITICAL_L |
LL |
Critically low |
Result::FLAG_ABNORMAL |
A |
Qualitative abnormal |
Result::FLAG_WARNING |
W |
Instrument warning |
Result statuses
| Constant | Value |
|---|---|
Result::STATUS_FINAL |
F |
Result::STATUS_CORRECTION |
C |
Result::STATUS_PRELIMINARY |
P |
Result::STATUS_INCOMPLETE |
I |
Exception hierarchy
Examples
Testing
167 tests · 371 assertions across 5 test files covering the full stack.
Extending
Custom record type
Custom transport
Implement Astm\Transport\TransportInterface and pass to Sender or Receiver.
Publishing to Packagist
See PACKAGIST.md for step-by-step instructions.
Security
Please report vulnerabilities via the process in SECURITY.md.
Changelog
See CHANGELOG.md.
Contributing
See CONTRIBUTING.md.
Licence
MIT — see LICENSE.