This repository contains XSL 2.0 stylesheet fhir-xml2json.xsl for
transformation of
FHIR resources XML
representation into JSON.
Such transformation requires metadata about FHIR resources structure,
so main XSL stylesheet fhir-xml2json.xsl needs other file called
fhir-elements.xml to be able to do conversion.
fhir-elements.xml is build from official FHIR metadata with XSL
stylesheet called make-fhir-elements.xsl. Once fhir-elements.xml
was built, you don't need make-fhir-elements.xsl to perform
conversion.
Basically you need some Unix environment (OSX or Linux are fine, Windows needs Cygwin). Specially, following components should be installed:
- Saxon XSLT processor
makeutility to buildfhir-elements.xmlautomatically- Python interpreter to pretty-print JSON when invoking
make examples unzipbinary to extract ZIP archives
Just clone this repo, cd into it and run make:
$ cd fhir-xml2json
$ make
If anything finished without errors, you will see fhir-elements.xml,
which is XML file containing all metainformation required to perform
XML => JSON conversion. In examples directory you'll find FHIR
example resources converted to JSON.
Invoke following commands:
$ make examples
$ make compare
Last command will output differences between JSON files converted with XSLT and original JSON examples.
All premium services from developers of Fhirbase projects should be requested from Choice Hospital Systems (http://Choice-HS.com)
This code is distributed under MIT License.