tommy

Rendered from docs/openapi-hl7.json in the repository.

On this page

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

NameInTypeDescription
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

StatusBodyDescription
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

StatusBodyDescription
204 no body Done. No body.
GET /messages/{id} One message: the parsed header and the segment tree.

Parameters

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
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

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
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

NameInTypeDescription
id required path string The event id, as returned by any listing.

Responses

StatusBodyDescription
200 text/plain
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.

Schemas

api.Error

PropertyType
error requiredstring

hl7.Component

PropertyType
subcomponentsarray of string
value requiredstring

hl7.Field

PropertyType
position requiredinteger
repetitionsarray of hl7.Repetition
value requiredstring

hl7.Header

PropertyType
codestring
control_idstring
processing_idstring
receiving_applicationstring
receiving_facilitystring
sending_applicationstring
sending_facilitystring
structurestring
timestampstring
trigger_eventstring
versionstring

hl7.Issue

PropertyType
code requiredstring
detail requiredstring

hl7.Message

PropertyType
header requiredhl7.Header
issuesarray of hl7.Issue
segmentsarray of hl7.Segment
separators requiredhl7.Separators

hl7.MessageEnvelope

PropertyType
id requiredstring
message requiredhl7.Message
metaobject of any
previewstring
provider requiredstring
raw_url requiredstring
received_at requiredstring (date-time)
title requiredstring
type requiredstring
urlstring

hl7.Repetition

PropertyType
componentsarray of hl7.Component
value requiredstring

hl7.Segment

PropertyType
fieldsarray of hl7.Field
id requiredstring
index requiredinteger
occurrence requiredinteger

hl7.Separators

PropertyType
componentstring
escapestring
field requiredstring
repetitionstring
subcomponentstring