Site icon Hay on FHIR

FHIR Messages – part 2

In the previous post, we talked about how we could map a relatively simple HL7 v2 message into a FHIR message. We focused on the actual mapping between the two message types, and there were a number of aspects that we didn’t consider – especially workflow & architecture.

In this post, let’s take a closer look at these considerations – perhaps in the form of a ‘checklist’ of things to consider when planning a deployment. We’ll keep the context to the simple one of a radiology result to keep the scope under control.

There’s also a whole section in the spec which talks about messaging as well. In particular there is a discussion on basic messaging assumptions and Message Exchange Patterns that we won’t repeat here – but should be reviewed before any implementation is planned.

Here’s the logical architecture (excluding Auditing & UI components):

 

So the “Message Processor”  is the application that is taking the incoming HL7 v2 message from the Sending System and generating a FHIR message that is submitted to the Server ‘Mailbox’ endpoint that will process it, return a reply which the Message Processor will convert into a v2 response message and return to the Sending System. In this particular architecture, the communication with the Sending system is asynchronous, but with the mailbox is synchronous.

The “Server Mailbox” is the server that will store the Observation resource. It exposes a ‘mailbox’ endpoint behind which is the message processing (based on the MessageHeader.event code) which defines the type of FHIR message.

Note that although the Patient and Provider stores are shown as external to the server mailbox, they may not be – as discussed below.

Let’s summarize the overall message flow, assuming a synchronous HTTP connection from Message Processor to the mailbox.

  1. The sending system (perhaps a Radiology System) creates the v2 message and sends it to the Message Processor. Likely this is an Integration Engine that receives external messages for the enterprise.
  2. The Message Processor generates the FHIR message bundle as described in the previous post, and forwards it to the server mailbox. This processing may involve interactions with the Patient and Provider stores. Both bundle and MessageHeader are assigned identifiers – the MessageHeader.identifier representing this ‘business level’ message identifier (and came from the sending system), and the bundle ID representing this particular ‘instance’ (See Message Exchange Patterns in the spec for further details).
  3. The server mailbox recognises this type of message (using the MessageHeader.event code) and performs the required processing (which is discussed further below, but basically saves the Observation resource).
  4. When processing is complete, the mailbox creates another bundle (with a unique bundle ID) that contains a new MessageHeader and returns that to the Message Processor. The contents of the MessageHeader will reflect the characteristcs of the endpoint and will have its own unique identifier, but in particular it contains a response element that indicates that this message is a response message (equivalent to the ACK message in v2). The response element has:
    1. an identifier – which is the MessageHeader.identifier of the original message, and serves to link response to request unambiguously. This is not really needed in a synchronous paradigm, but certainly needed for asynchronous operation.
    2. a code which has a fixed set of values that indicates the outcome of the processing.
    3.  a details element which is an OperationOutcome resource containing the details of errors or anything else the sender needs to know about.
  5. The Message Processor receives the response message, and constructs an HL7 v2 ACK message containing the appropriate segments (eg MSA and/or ERR segments depending on the code value, and contents of the response.details resource).
  6. The ACK message is returned to the original sender.

The HTTP status code will reflect the outcome of processing. Refer to the spec for details.

Architectural considerations

Server  Mailbox Assumptions

This is referring to the server that will process the FHIR message that the Message Processor creates – receiving it via the mailbox endpoint as described above. It may – or may not – also host the Patient and Provider resources that we need.

Policy questions

Message transformation questions

Well that’s a brief examination of how the workflow might operate and some things to think about. I’ll update this post as we work further in this space.

 

Exit mobile version