emsdocs

This document is commercial-in-confidence. The recipient of this document agrees to hold all information presented within as confidential and agree not to use or disclose, or allow to use or disclosure of the said information to unauthorized parties, directly or indirectly, irrespective of the acceptance or rejection of the presentation or at any time before, during or after an agreement has been reached, without prior written consent.

1. EMS Query Response Demographics

1.1. Document History

Version Date Who Comments
v0.1 - Draft 30th Oct 2025 Lee Dyson First draft
v1.0 - Release 30th Oct 2025 Robert McNaught Release to customer

1.2. Introduction

This document describes the MEDILOGIK EMS Patient Demographics Query / Response interface, it’s functionality, configuration and operations.

The interface is based on standard HL7 QRY^A19 and ADR^A19 messaging formats.

The EMS Q/R interface allows a customer’s instance of EMS to search their local EPR for up to date patient demographic details.

The interface implements simple MRN or NHS number ONLY queries.

1.2.1. Transport

As this interface operates across a WAN connection (HSCN or Internet), it employs an HTTPS transport, rather than the MLLP / TCP connections more typically employed on LAN interfaces.

The use of HTTPs transport ensures that messages are encrypted in transport and are also easier to route through firewalls, load-balancers and other network infrastructure.

1.2.2. Customer-Side Requirements

The customer must implement the server portion of this interface in an appropriate HTTPs endpoint. That is the customer’s TIE (or EPR directly) will accept an incoming connection from the EMS servers.

Each query message from EMS is carried in a single HTTP(s) request and the interface expects a timely synchronous response from the customer’s endpoint.

Queries originate from the EMS servers and multiple queries may be issued concurrently. It’s important therefore the customer endpoint is able to handle multiple concurrent connections and multiple concurrent queries.

1.2.3. Security Considerations

As this interface operates over a HTTPS connection, the customer’s server process must present a valid TLS server certificate.

1.3. Message Flow

1.4. Messages Supported

Message Type Default Action
QRY^A19 Request demographics
ADR^A19 Query response

1.5. Message Structure

[] - Optional

{} - Repeating

1.5.1. QRY

MSH
QRD

1.5.1.1. Sample

MSH|^~\&|EMS|EMS|||202510171402||QRY^A19|202510171402004|D|2.4
QRD|202510171402|R|I|202510171402004|||1^RD|1297999|DEM|||T

1.5.2. ADR

The EMS Q/R interface expects a response from the customer’s endpoint like the sample message below

MSH
MSA
QRD
PID
PD1

1.5.2.1. Sample

MSH|^~\&|TIE|RRK|EMS|RRK|20251027122026||ADR^A19|65fda5f2-6226-4689-918c-8c43e426808b|T|2.4
MSA|AA|202510171402004 
QRD|20251027122026|R|I||||1^RD||DEM|||T 
PID|1||1297999^^^RRK^MR~9990275335^^^NHS^NH||Pas-Support^Lillie^^^Lady^^||19960505|I|||Regus, Princes Exchange^2 Princes Square^Leeds^^LS1 4HY^^||02920344617^PRN^PH~07966015885^PRN^CP~cwrwboy+80013@gmail.com^NET^X.400|||||||||||||||||N
PD1|||^^X99999|G9999998||

1.6. HL7 Segment Definitions

The following segment definitions apply to messages inbound and outbound. If a field is not documented, then it is not considered mandatory or processed by EMS on inbound messages.

1.6.1. MSH

Please Refer to EMS Standard Segment Definitions

1.6.2. MSA

Please Refer to EMS Standard Segment Definitions

1.6.3. QRD

Field Name Required Example Notes
8 Who Subject filter Y 1297999  

Note:

1.6.4. PID

Please Refer to EMS Standard Segment Definitions

Note:

1.6.5. PD1

Please Refer to EMS Standard Segment Definitions