/
Mediator: FHIR

Mediator: FHIR

This service is in charge of sending and receiving information from the HAPI FHIR service. Not only that, but it is also in charge of verifying the information received by the users and performing different functions depending on the resources. Thus, if the resource is a Communication or CommunicationRequest, it will be in charge of preparing the appropriate request to send the notification. In the case of communications, there is also a request to search and find the reminders and generate the appropriate communications to send to the communication actors.

It is currently at an early stage, but it is planned to add more functionalities related to FHIR resources.

This service is also a mediator to be part of openHim.

 

Here's why:

  • Since the HAPIFHIR service does not want to add more complexity outside the management of the data in the database, we have created this service as a top layer to manage the information that the service will receive. In addition to this, it allows us to process the data before it is stored in the database if necessary.

  • Creating it as a mediator is a good solution to be able to form a set of services that can work independently and with slight dependencies between them (for example, to carry out the communication this service must communicate with the communication service and this requires a specific payload).

 

How to use that:

You can work doing the same request as you would do with the HAPI FHIR server, exists only two differences:

  • Request payloads: The HAPI FHIR payload is the value of the fhir property:

{ "fhir": { "resourceType": {{resource-type}}, .... // HAPI FHIR payload .... } }
  • PATCH calls: OpenHIM does not process correctly the PATCH requests, so, to solve that, we need to specify the reqMethod property and indicate it is a PATCH request. When you send this request, try to do it as a PUT request. In the future, we will try to fix that in OpenHIM to avoid using this property. This is an example of the payload:

{ "reqMethod": "PATCH", "fhir": [ { "op": "replace", "path": "/active", "value": true } ] }

 

You can find all kinds of examples here: POSTMAN

The repository is here: GITHUB

 

Related content