Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (38 sloc) 2.24 KB

HL7 FHIR to conversion tool

A tool to convert HL7 FHIR StructuredDefinition to the data model

See: for implementation details


  • python3 (ideally >= 3.5, but any 3.x version will do). You can determine whether you have python on your machine and its version by:
    • python -v -- if 3.x you are ready to go, otherwise...
    • python3 -v -- if this works you are also ready to go
  • virtualenv -- if this isn't on your machine, see
  • java -- we need version 1.7 or greater


Set up a python3 virtual environment:

> virtualenv fhirtosdo -p python3
> . fhirtosdo/bin/activate
(fhirtosdo) > pip install fhir-to-sdo

Downloading the FHIR specification

To download the latest copy of the FHIR spec and unzip it:

(fhirtosdo) > download_fhir_spec  --striptext

Note that the above function can take considerable time, as the zipped image of the fhir spec is quite large. Note that the "-u" option can be used to download different fhir builds as needed

Downloading the FHIR metadata specification

Currently it is possible to get a copy of the FHIR 'ontology' from the FHIR svn repository as ./build/publish/fhir.ttl An image of a recent fhir.ttl is also available in ./data/ttl/fhir.ttl in this distribution.

Run the w5tosdo transformation

(fhirtosdo) > w5tosdo -i ../data/ttl/fhir.ttl -o w5.rdfa --loglevel INFO

Run the fhirtosdo transformation

(fhirtosdo) > fhirtosdo -id data/site -o fhir.rdfa --loglevel INFO 

The results of these two transformation

Note that the above transformation may generate a number of error messages of the form "ValueSet access error: (Not Found)". This is because not all of the value sets referenced in the FHIR structure definitions are currently available on the official fhir website.

The outputs (w5.rdfa, fhir.rdfa) can then be transferred to the environment.

You can’t perform that action at this time.