FHIR - xerocrypt/Misc GitHub Wiki
Fast Healthcare Interoperability Resources (FHIR)
Is related to HL7, but seems an extension of it to cover how the messaging should be implemented (basically REST, serialisation, message validation, etc.). The official documentation is very dry and unstructured, in fact I've had a difficult time trying to parse the incoherent word salad into something like a useful description of FHIR. I recommend either reading Ewout Kramer's presentation material on SlideShare and researching the APIs. Here I'll try and pick out a description of whatFHIR is from the word salad they call 'reference documentation'.
As the name indicates, FHIR is supposedly fast and enables interoperability between systems that process the clinical documents, and the aim is to make use of existing Web-related technologies. In other words, messages are communicated over HTTP, either in XML or JSON format, though it's not obvious how this would be faster than older HL7 messaging.
Communication of CDAs
While HL7 gives us a standardised messaging format, the standard doesn't say anything about how multiple applications and services get that data from A to B. For example, are the messages communicated over an HTTP session or over a terminal connection?
It appears that FHIR specifies that HTTP be used as the transport method for FHIR messages as XML or JSON, with REST being used to intiate actions. Therefore we have four layers to this:
- REST
- Documents
- Messages
- Services
And it means we use CRUD operations for querying and updating the data.
The URI structure is:
http://[endpoint]/[resource type]/[identifier]
e.g.
http://medserver.uk/Patient/3341
Sending a URI like this should cause the endpoint to return the resource in JSON or XML format.
Message Structures
Note: the FHIR documentation refers almost always to version 3 HL7 messages, and not the older segmented version. In HL7, we see data objects communicated as documents. With FHIR, data objects are accessed as services - this makes it more appropriate for REST, with each object being requested having its own URI.
Taking the form of an XML document, a 'resource' has three sections:
- Extension
- Narrative
- Structured Data
The 'narrative' is a human-readable summary of the data, usually near the top of the document. The 'structured data' is the actual content of the message.
The Foundation module is what everything implementing FHIR uses, and it's what everything is built on. The foundation is the general specification.
Extensions are the less commonly-used elements that don't belong to the set of standard composite types, and they might be specific to the clinical systems themselves. A 'resource' in FHIR is the smallest discreet data object that could be communicated. It's described as the 'smallest unit of transaction', which means it would be an HL7 message. It is the quantum of FHIR. In fact, a resource is basically an XML file containing the information about a subject, which could be a patient, a report, etc. We already know this particular item would be in Within a resource are components - a component has no meaning or context outside the resource. Unlike resources, components cannot be accessed directly.
Within a resource there are also fields, which are referred to as 'composite datatypes', and they're so-called because they might contain multiple sub-items of different types, for example, 'identifier' might be a composite type based on 'varchar' or 'int', and 'Address' might be a composite of 'houseNumber(int)' and 'streetName(varchar)'. Each of these sub-items is referred to as a 'primitive'.
The FHIR API
The API has the following components:
- Model
- Parsing and Serialisation
- REST (FhirClient)
- Validation
The following NuGet packages are available within Visual Studio:
Installing these will give the assembly references, plus specifications.zip and validation.zip archives in the project directory. The specifications contain the schema files for each message type. In that folder, the fhir-all.xsd file contains pointers to all the message type schema files.
FHIR Test Data
Servers:
http://stu3.test.pyrohealth.net/fhir
http://hapi.fhir.org/baseDstu3
Test Patient IDs:
2362616
2457291