3
votes

I have been working with the HL7 FHIR .NET API reference implementation - utilizing the existing resource models embedded in the library. Now, I am trying to use the Forge tool to modify the resources (contraints/extensions) to suit my requirements. I noticed that the HL7 publishing mechanism does not generate C# models from DSTU 2 onwards and was wondering - what is the best way of converting profiles created using Forge into C# resource classes such that they may be included into the HL7.Fhir.Model assembly that is part of the reference implementation.

1

1 Answers

1
votes

The generation of the models not being part of the official build is correct.

This has now moved to https://github.com/ewoutkramer/fhir-net-api where the rest of the API is maintained more easily. It is done using T4 templates on the output from the official builds.

There is a simple process for updating the models with the new versions of the spec, and we keep it fresh as people need it, and for each connectathon we publish a new build in NuGet and have a branch of the code in GitHub. (Its a powershell script that downloads all the latest build outputs and puts them in the appropriate folders, then you need to run the t4 templates in Visual Studio)

Such as this one for the May Connectathon in Montreal

https://github.com/ewoutkramer/fhir-net-api/tree/ft-connectathon-may2016

This is able to be done yourself with a little assistance.

As for generating code for a profile, we haven't done that as yet, but will theoretically be possible. Don't know that I'd advise this at the moment while the profiles are in so much development and change.