0

I am new to HL7.FHIR. I was assigned to implement REST API to send FHIR compliant JSON Messages.

My initial thought is that, we will have to transform our stored data to FHIR compliant data / JSON.

I tried to use given XSD from (http://hl7.org/fhir/) but could not produce classes; it was throwing exceptions.

How should I start transforming our own data to FHIR compliant data?

Pratap Das
  • 504
  • 2
  • 7
  • 20

2 Answers2

2

It's FHIR, not PHIR :> If you're planning to use JSON, the XSDs won't help you much. There's a set of separate schemas on the downloads page that are designed to be used with code generators. However, your best bet is to use one of the reference implementations (links also on the downloads page). Those will support both JSON and XML and produce tighter code than you could get by generating from the schemas anyhow.

Lloyd McKenzie
  • 6,345
  • 1
  • 13
  • 10
  • I checked C# reference implementations. Unfortunately , things are still not clear to me. Example , I have a DB table named 'Patient'. As a response of a GET call, for a particular patient id ( i.e. GET: patient/id) , I will need to provide JSON. To do that, transformation of my data which is present in 'Patient' table, is needed. How can I transform data from my database / class to FHIR compliant data? – Pratap Das Jun 07 '16 at 17:23
  • To transform your data, you'll need to write code that maps from your database to the reference implementation object model. Then you can serialize the object model to JSON or XML using the built-in method. – Lloyd McKenzie Jun 08 '16 at 05:24
0

For inspiration, you can also take a look at our open source .NET FHIR server, Spark: https://github.com/furore-fhir/spark

Ewout Kramer
  • 984
  • 6
  • 9