FHIR Chat · Creating a profile - JSON · implementers

Stream: implementers

Topic: Creating a profile - JSON


view this post on Zulip Sadiq Saleh (Dec 14 2016 at 16:11):

Is there a way to create a JSON representation for a profile? As far as I understand the excel sheets provided for FHIR are for making an XML version, and I was wondering if there was a way to save the output from this file as JSON or if there is a recommended way to convert it?

Thanks in advance.

view this post on Zulip Andy Stechishin (Dec 14 2016 at 16:15):

Everything in FHIR has both an XML and a JSON representation. If you look at the StructureDefinition this is actually how Profiles are described and the StructureDefinition (like any other Resource) can be represented in both XML and JSON

view this post on Zulip Sadiq Saleh (Dec 14 2016 at 17:29):

Thanks for your response Andy.

I am not sure if I made my question clear. As far as I understood from your response I can view the JSON representation of existing profiles/resources. My question was about creating a new profile or resource in JSON format. As far as I understand, the excel templates for this will output an xml format, but not in the JSON format. Is there a proper way to do generate a new profile/resource directly into JSON or a good way to convert between xml and JSON?

view this post on Zulip Andy Stechishin (Dec 14 2016 at 17:39):

Ah. My understanding of the build is that there is a transform that takes the Excel spreadsheet in XML form and converts it into a FHIR StructureDefinition in XML format. I have not examined this part of the build, so you would want to verify that my statement is actually true. Theoretically, you could produce a JSON StructureDefintion and submit it to one of the JSON->XML conversion app that are out there to convert your JSON into an XML version.

Also AFAIK the Excel spreadsheet is an input gathering tool. I believe (and this is totally a guess on my part, need to confirm with Furore) Forge deals only with XML/JSON StructureDefinitions and not the initial Excel format at all.

view this post on Zulip Sadiq Saleh (Dec 14 2016 at 17:42):

Thanks again for taking the time to respond.

So just to clarify, your suggestion is that I use the Excel form to generate an XML version and then use a converter to go from XML -> JSON?

If so, are there any tools you could recommend for doing so?

view this post on Zulip Andy Stechishin (Dec 14 2016 at 17:53):

@Sadiq Saleh Sorry, I may not have been clear. The Excel template file is to enable people a way to produce profiles but the recommended tool to use is Forge. The Excel template file does not produce a FHIR StructureDefinition in XML (it produces an Excel 2003 XML file) which would need to be run through a conversion to produce the proper structure definition.

Again the recommended tool for producing profiles is Forge. I believe that once you have defined your profile using Forge, you should be able to get the JSON representation of it (as a StructureDefinition resource)

view this post on Zulip Sadiq Saleh (Dec 14 2016 at 17:54):

Perfect, that clarified things completely! Thanks again Andy.

view this post on Zulip Christiaan Knaap (Dec 14 2016 at 18:14):

If you then let Forge upload your profile to Simplifier.net, you can view it from there in xml, json or rendered as a tree, just as you (or anyone else) sees fit.

view this post on Zulip Sadiq Saleh (Dec 14 2016 at 18:17):

Thanks for the reply Christiaan. I looked at the webpage for Forge and noted that it is configured for the DSTU2 implementation, whereas we are working with DSTU3. Are there any tools available for DSTU3 or should I build in Forge and edit to make the output DSTU3 compliant?

view this post on Zulip Lloyd McKenzie (Dec 15 2016 at 15:57):

@Sadiq Saleh Excel spreadsheets are not converted directly to XML. The FHIR build process parses them directly into memory as part of the build process. The build process then produces XML, JSON and TTL representations. The spreadsheet mechanism will be retired once Forge supports the complete set of functionality needed by all profile builders. (In practice, spreadsheets have limitations too, so some profilers author directly in XML or JSON. The publication tooling will take any of the syntaxes as input and will generate the other representations.

view this post on Zulip Sadiq Saleh (Dec 16 2016 at 13:55):

Thank you all for your responses. They have helped me gain a better understanding of the process, and answered my questions.

view this post on Zulip Michel Rutten (Dec 20 2016 at 10:29):

@Sadiq Saleh (apologies for the slow response...) Forge does not yet support STU3. We will update all our tools for STU3 after final publication. As a workaround, you could convert existing profiles from DSTU2 to STU3, either manually or using a transform.

view this post on Zulip Sadiq Saleh (Dec 20 2016 at 15:40):

Thanks @Michel Rutten
I have been working with the excel templates to try and build it that way. Could you point me in the direction of a resource that could elaborate on transforming from DSTU2 to 3? I have seen mention of a converter in GForge but haven't managed to find it yet.

view this post on Zulip Michel Rutten (Dec 20 2016 at 15:53):

@Sadiq I am not aware of any official tooling that supports DSTU2 <=> STU3 conversion. Maybe the FHIR profiling community can help you out?

view this post on Zulip Sadiq Saleh (Dec 20 2016 at 15:56):

Thanks for the follow up. I will keep searching.

view this post on Zulip Grahame Grieve (Dec 20 2016 at 20:20):

there is java code in org.hl7.fhir.convertors.VersionConvertor_10_20 in the Java Reference implementation. Then there is a project to define StructureMap transforms for all the DSTU2 resources that is just getting underway

view this post on Zulip Sadiq Saleh (Dec 20 2016 at 20:58):

Thanks Grahame. I will take a look at those resources.

view this post on Zulip Bettina Lieske (Sep 05 2019 at 11:51):

@Andy Stechishin sap.comMFHIRZPw2016

view this post on Zulip Andy Stechishin (Sep 05 2019 at 15:40):

??


Last updated: Apr 12 2022 at 19:14 UTC