FHIR’s Conditional Create

Have you ever used a Conditional Create in FHIR?

It ensures that a new resource is only created when a specific condition is NOT met.

Example: only create a new patient if an existing patient with the same MRN does not exist.

It works like this:

  • A POST request is created for the new Patient resource
  • The “If-None-Exist” header is populated for the request
  • A conditional query is added to the header

Here’s what it looks like for a patient with an MRN of 9136479X.

And here’s a sample use case.

A university hospital’s FHIR server contains full and partial patient data, each with a unique MRN identifier. As part of a clinical trial a large volume of new patient records flows into the server.

The quality of this clinical trial data is suspect and the hospital wants to reduce the possibility of duplicates.

They insist that all POST requests of Patient resources to their FHIR server include the “If-None-Exist” request header and use an MRN Identifier as the conditional element of the request.

There are three possible outcomes from the FHIR server.

1. A patient with the identifier does not exist

  • A new Patient resource is created.
  • A 201 Created status code is returned.

2. A Patient with the identifier exists

  • No resource is created or updated.
  • A 200 OK status code is returned.
  • Depending on the FHIR server, the existing patient resource may be returned.

3. More than one patient exists with the identifier

  • No resource is created or updated.
  • A 412 Precondition Failed code is returned.

Conditional Create is not a complete answer to the duplicate data problem, but it is one of the tools you should be looking at to improve the quality of the data in your FHIR server.

Learn more: https://www.hl7.org/fhir/R4/http.html#ccreate

Discussion

---

Ways to Work With Me

Discover more from Darren Devitt

Subscribe now to keep reading and get access to the full archive.

Continue reading