I am trying to get my head around Fast Healthcare Interoperability Resources (FHIR) specification, but I can’t understand what Messages are used for.
The exact mechanism of transfer is irrelevant to this specification, but may include file transfer, http based transfer, MLLP (HL7 minimal lower layer protocol), MQ series messaging or anything else.
http://hl7.org/fhir/messaging.html
Isn’t it the whole point of FHIR that it uses REST? And that:
Events mostly correspond to things that happen in the real world.
http://hl7.org/fhir/messaging.html
Is this a way of saying it is for real-time systems?
This is probably easy question, but I do not have any background in HL7. What are these messages and what are they used for?
A message in this case is a stream of data that is sent from one system to the other. If you make a request to a REST service you would pass in a stream of data (for example, a JSON object) so that the service can perform an action. In FHIR, this data is called a message.
There is no requirement for FHIR to use REST, it is simply one of the ways it can be implemented. You could write a FHIR-conforming application using file shares by writing a message to a file from the sending application and have the receiving application read the files from the share. But the basic architecture of FHIR also defines a RESTful API, so you could implement communication between the applications using a REST API and have them call each other directly.
It is not for real-time systems per se, but it can be. In HL7, messages mostly respond to real-life events. For example, there is a ‘MedicationAdministration-Complete’-event that changes the status of a medication administration to complete. When a user in an application checks off the administration of medication, this event will be raised. Events in HL7 are mostly the result of a physical action in the real world.
Short Answer: It is an exchange of information. The messaging is on of the mechanisms of delivery.
Sample is provided below for the clarification.
Based on the version of FHIR it may have slightly different representation.
For example, the HL7 FHIR (R4 version) defines messaging as a resource called Bundle
.
In FHIR messaging, a “request message” is sent from a source application to a destination application when an event happens. Events mostly correspond to things that happen in the real world. The request message consists of a Bundle identified by the type “message”, with the first resource in the bundle being a MessageHeader resource. The MessageHeader resource has a code – the message event – that identifies the nature of the request message, and it also carries additional request metadata. The other resources in the bundle depend on the type of the request.
Request Message example:
A request to link two patients (id = “10bb101f-a121-4264-a920-67be9cb82c74”)
Response Message sample: A response to a request to link two patients (id = “3a0707d3-549e-4467-b8b8-5a2ab3800efe”)