tommy hl7 API v1
Captures the HL7 v2 messages your integration sends instead of handing them to a hospital system, parsing each one with the separators it declared for itself rather than the ones everybody assumes. The HL7 tab shows a message as a segment tree - every field at its own position, every repetition kept apart - next to the bytes exactly as they arrived. The MLLP listener that feeds it comes with the mllp provider.
These routes read back what tommy captured, in the shape this content type
wants: filters that only mean something here, and the parts that are bytes
rather than JSON. They read from the same store as the events API, so a
client that sends and immediately fetches sees its own write, and every
entry carries the id of the event behind it.
The events API - /api/v1/events, described in its own document - is the
generic view of the same captures, and is the one to use when what you are
asserting does not depend on the content type. The fake vendor endpoints are
described nowhere here: they are the vendors' specifications, not tommy's.
This document is generated from the server's route table. It cannot describe
a route that does not exist, and CI fails if the checked-in copy stops
matching the code.
Server
/api/v1/hl7 — This tommy's hl7 API.
Operations
GET
/messages
Every captured HL7 message, newest first.
Parameters
| Name | In | Type | Description |
provider |
query |
string |
Only entries captured by this provider, such as mailjet. |
type |
query |
string |
Only entries of this event type, such as mail.message. |
search |
query |
string |
Case-insensitive substring over the summary and type. |
since |
query |
string |
RFC3339 timestamp, a duration such as 5m, or unix milliseconds. |
limit |
query |
integer |
Maximum number of entries to return. |
offset |
query |
integer |
How many entries to skip. |
message_type |
query |
string |
The whole type (ADT^A01), just the code (ADT) or just the trigger event (A01). |
control_id |
query |
string |
MSH-10, the message control id. |
sending_application |
query |
string |
MSH-3, the sending application. |
receiving_application |
query |
string |
MSH-5, the receiving application. |
segment |
query |
string |
Only messages carrying this segment, such as PID. |
Responses
| Status | Body | Description |
200 |
application/json · array of hl7.MessageEnvelope
|
Success. |
400 |
application/json · api.Error
|
A query parameter could not be parsed - a malformed since, a negative limit. |
DELETE
/messages
Clear every captured HL7 message.
Responses
| Status | Body | Description |
204 |
no body |
Done. No body. |
GET
/messages/{id}
One message: the parsed header and the segment tree.
Parameters
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
200 |
application/json · hl7.MessageEnvelope
|
Success. |
404 |
application/json · api.Error
|
No such resource, or it belongs to another plugin. |
DELETE
/messages/{id}
Delete one captured message.
Parameters
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
204 |
no body |
Done. No body. |
404 |
application/json · api.Error
|
No such resource, or it belongs to another plugin. |
GET
/messages/{id}/raw
The bytes exactly as they arrived, served inert as text/plain.
Parameters
| Name | In | Type | Description |
id required |
path |
string |
The event id, as returned by any listing. |
Responses
| Status | Body | Description |
200 |
text/plain
|
Success. |
404 |
application/json · api.Error
|
No such resource, or it belongs to another plugin. |
Schemas
api.Error
| Property | Type |
error required | string |
hl7.Component
| Property | Type |
subcomponents | array of string |
value required | string |
hl7.Field
| Property | Type |
position required | integer |
repetitions | array of hl7.Repetition |
value required | string |
hl7.Issue
| Property | Type |
code required | string |
detail required | string |
hl7.MessageEnvelope
| Property | Type |
id required | string |
message required | hl7.Message |
meta | object of any |
preview | string |
provider required | string |
raw_url required | string |
received_at required | string (date-time) |
title required | string |
type required | string |
url | string |
hl7.Repetition
| Property | Type |
components | array of hl7.Component |
value required | string |
hl7.Segment
| Property | Type |
fields | array of hl7.Field |
id required | string |
index required | integer |
occurrence required | integer |
hl7.Separators
| Property | Type |
component | string |
escape | string |
field required | string |
repetition | string |
subcomponent | string |