Connection
Authentication
| Credential | Type | Required | Description |
|---|---|---|---|
| Network Access | IP | Yes | Authorised network access. |
Message format
The message must be framed using the MLLP protocol. The receiver also accepts messages with missing start or end blocks.| Component | Required | Description |
|---|---|---|
| Start Block | No | MLLP start-of-message marker. Recommended for standard compliance. |
| HL7 Content | Yes | A valid HL7 v2.4 message with pipe-delimited segments. |
| End Block | No | MLLP end-of-message marker. Recommended for standard compliance. |
Message segments
The receiver processes the following HL7 segments from each inbound message.| Segment | Description |
|---|---|
| Message Header | Identifies sending and receiving applications, message type, and version. |
| Event | Describes the event (e.g. admission, discharge). |
| Patient Identity | Patient demographics: name, DOB, gender, address. |
| Patient Visit | Visit details: location, attending doctor, admission/discharge times. |
| Visit Additional | Supplementary visit information (e.g. expected discharge date). |
| Next of Kin | Emergency contacts and relationship to patient. |
| Insurance | Insurance plan and policy information. |
Response
The receiver returns an HL7 acknowledgment (ACK) over the same TCP connection. The ACK always indicates acceptance to avoid retry loops from the sending system.The receiver always returns an accept acknowledgment. Processing failures are tracked internally and do not produce a negative ACK to the sender.
Error handling
| Condition | Acknowledgment Sent | Internal Status |
|---|---|---|
| Message processed successfully | Accept | Processed |
| Invalid or missing clinic service | Accept | Clinic Rejected |
| Invalid patient identifier format | Accept | Partial |
| Malformed or unparseable message | Accept | Failed |
| Message decode failure | Accept | Failed |
| Empty or zero-length message | Accept | Health Check |
For authentication credentials and access setup, contact the medWrite team.
Next steps
HL7 Phases
ADT event types: A01, A02, A03, A04, A08, A11–A13.
Get Approved Outputs
Retrieve approved letters via API.
