Opening up clinFHIR – An example generator

I’d always intended that clinFHIR would be an open source project.

It all started when we were planning the ‘Clinician Connectathons’ – now ‘Clinicians on FHIR’ a year or so back, and realized that we needed some sort of tooling to support the events – tooling that would allow a user to create resources – and view the references between those resources – in a way that made sense to a clinician rather than a techie, and didn’t require them to understand the ‘on the wire’ formats of a resource (unless they wanted to).

After a few false starts, the current version was developed that seems to meet the need of the events. In fact, there are a number of different tools under the clinFHIR umbrella:

  • The Resource Builder is the main one. It takes the actual definition of a resource (a StructureDefinition resource) – and uses that to build a User Interface that allows a user to enter information compliant with that definition and to build a sample resource instance.
  • A Resource Browser that lets you explore the references between resources for a patient
  • The Profile Builder allows a user to build a simple profile. While the forge tool from furore is the official profile builder tool, this builder is intended as an on-line tool to allow a clinical user to perform basic profile building – removing elements, adding extensions and the like – again with an educational focus.
  • The Extension Browser adds a user friendly face to querying a FHIR registry for extensions and creating simple ones.

Focusing on the Resource Builder, I hadn’t really intended that it would be capable of working against any profile (at the time we had pretty specific needs) but as it turns out there is a need in the community for something like this – generating example instances of a profile (whether created by the internal tool or the official forge tool) as well as presenting a UI for users to help them evaluate profiles as they are being built are two of the potential uses I’ve come across.

Trouble is, this stuff is hard to do – and there is only so far that a single part-time developer can go with this kind of work, so I’m at a point where I could use some help.

The original code base is (to be kind) a bit ‘krufty’ – it started with DSTU-1 and also reflected my learning of both FHIR and the Angular JS toolset that I used and it is really not in any state for other developers to understand (as a few brave colleagues have already found out!).

So what I’ve done is to pull the Resource Builder stuff out into a separate repository, and made it part of a stand-alone SPA (Single Page Application) that calls a FHIR server directly – i.e. it doesn’t use Node.js as a back end server.

The Resource Builder is part of a small application that creates sample patients and data – you can create a patient with a set of resources (Condition, Observation, Encounter), and then use the Builder to add any other resource you want. I’ve also pulled across the Resource Browser so you can explore relationships between resources, and added a ‘Vitals’ Table (Observations that are considered vitals – like height, weight, blood pressure etc.).

The intention is that it will act as a ‘container’ to allow the builder component (implemented as an Angular directive) to be enhanced and debugged, so it can be re-used by others as well as the main clinFHIR application.

The source is available on github at

Just download it (clone or zip) and then set it up behind an HTTP server to serve the various files and then navigate to sampleCreator.html in a browser. If you’re using a mac, then there’s a file in the root directory – that will start the simple python browser that comes with the mac.

There’s a certain amount of documentation in the app (there are a number of Markdown pages and code comments) – and I’ll continue to add to it over the next few weeks – I’ll also continue to enhance the UI to allow more control over the sample resources created .

As mentioned above, the app is a Single Page Application developed in AngularJS. It calls a FHIR server directly, which means that the server must support CORS – currently it works against Grahames server, the HAPI server or a local server on port 8080 (I use the excellent HAPI CLI server myself), but I’ll enable the ability to add different servers shortly.

So, if you’re interested, then download the app and have a look around. If you would like to contribute to the project then drop me a line at my email – david.hay25 at and we’ll work out the best way to move forward (This will be my first proper Open Source project so any advice from more experienced developers will be much appreciated!)

There’s an on-line instance of the app here – I’ll do another post describing how it works shortly.



About David Hay
I'm an independent contractor working with a number of Organizations in the health IT space. I'm an HL7 Fellow, Chair Emeritus of HL7 New Zealand and a co-chair of the FHIR Management Group. I have a keen interest in health IT, especially health interoperability with HL7 and the FHIR standard. I'm the author of a FHIR training and design tool - clinFHIR - which is sponsored by InterSystems Ltd.

2 Responses to Opening up clinFHIR – An example generator

  1. Jinhu says:

    May i ask if this project is still an open source project?

Leave a Reply