Site icon Hay on FHIR

FHIR enabling an immunization registry

In New Zealand (and other places as well I expect) we’ve had a national registry for immunizations for a number of years – the National Immunization Register or NIR

It’s currently fed by HL7 version 2 messages and there’s a User Interface for authorized users, but there was always a plan to introduce a FHIR interface to some point – something that has been accelerated by the current COVID pandemic of course.

So what would a FHIR API look like? Well, let’s have a look at the use cases that we might want the registry to support. To keep the blog simple, we will constrain our discussion a bit:

So with those constraints – what are the use cases we want to support?

  1. We want to be able to record that an immunization was given – what it was, who it was given to, who gave it, when and where it was given and so forth
  2. We want to be able find out what immunizations a specific individual has received. This will just be a list of the vaccines – not any kind of measure of the ‘protection against disease’ that an individual has (though that would be nice).
  3. It would be really nice for the registry to have a service that could generate recommended immunizations for an individual – what they are due to receive (This would be especially useful for parents I suspect)
  4. We should be able to supply the standard protocol in some computable format – not everyone would want to use the service we provide

Before getting too far into the API design, let’s think about the ‘data model’ that we’re going to need – at the FHIR resource level. This might change a bit as we delve into the details of the data elements, but we should be able to create a ‘first cut’ that we can use for review.

As you know, FHIR has the concept of ‘Resources’ – individual ‘chunks’ of data that represent specific components of healthcare data that are joined together in graphs of interconnected pieces to represent a particular set of data – much as Lego blocks are connected together to form a larger model. Our data model becomes a ‘resource model’ – showing these interconnections.

Here’s the list of candidate resources. 

That’ll do for now. The list may be refined as the analysis proceeds, but we’ve enough to get started.

And here’s how they are connected together to record a single administration. I used the clinFHIR Graph Builder to generate this picture. It’s a great way to visualize these inter-connections – and we can also generate sample data which is useful to validate that we have a ‘place’ for all the data items we need.

Note that there isn’t a direct reference to the protocol resources (PlanDefinition / ActivityDefinition) from the immunization (which is why there’s no line to them). If we do want to make this explicit then we’ll need to create an extension.

Now that we have that, we can start to think about what the API might look like. For now, we’ll assume a direct REST interface – though there are other possibilities.

We’ll start by thinking about the first use case – how to record an administration

This seems reasonably straightforward – we need to create an Immunization resource and POST it to the registry (thus creating a new administration record) – ie:

POST [host]/Immunization 

with the Immunization resource as the payload

But there are a few fish hooks when we start to think about how we represent all the references we need (Patient, Practitioner, Location etc)

There are a few options.

There are other possibilities, but one thing does seem clear: for every method other than the first one (requiring the client to look up all the resources in advance) the registry is going to have to do a significant amount of work – it can’t just take an incoming Immunization resource and save it. And we’ll need to allow for failure – missing / incorrect identifiers for example.

Right now, we can’t say which one of these (or some other) we’re going to use – there’s more design work to do. If I had to choose, then the message based approach is attractive as it mirrors what we’re already doing using v2 messaging so the back end services should substantially be in place – and it’s less of a change to the client. But there’s much design work to do before a decision is made, and we also need to involve the implementer community in the decision.

Once all these issues are all resolved, the second use case – looking up what immunizations a patient has received – is almost trivial, it’s a simple query against the registry immunization endpoint using the Patients NHI() identifier in a chained() query:

GET [host]/Immunization?patient.identifier = {nhi}

Almost anticlimactic!

Well, that’s enough for now. We’ll consider the other 2 use cases – what immunizations a person should receive, and representing the immunization protocol in the next post.

Exit mobile version