FHIR Chat · Translate AU Base XML to FSH? · australia

Stream: australia

Topic: Translate AU Base XML to FSH?


view this post on Zulip Mark Kramer (Jun 03 2021 at 17:22):

Is there any interest in moving the AU Base IG from XML to FSH? I started doing it as a test of GoFSH and it is an interesting test case.

view this post on Zulip Jim Steel (Jun 04 2021 at 01:43):

I wouldn't ordinarily speak for @Brett Esler , but I'm going to suggest that yes, there would be interest

view this post on Zulip Brett Esler (Jun 04 2021 at 04:26):

Yes interested for sure... we have a cohort of contributors that are Forge users so I am interested in non-lossy round tripping with FSH would like to move towards FSH but need to work out what to do with those not there yet....

view this post on Zulip Jim Steel (Jun 04 2021 at 04:30):

Sounds like a case of not only giving them a FSH and letting them eat for a day, but teaching them how to GoFSH, and eating for a lifetime! I'll show myself out...

view this post on Zulip Mark Kramer (Jun 04 2021 at 16:29):

Round tripping is quite possible, but the round trip would no necessarily implement all features in exactly the same way. Moreover, we do not export XML. We have a feature of GoFSH called "FSHing trip" that round-trips from JSON or XML -> FSH -> JSON. But you end up with JSON. Once you see the FHIR profiles and examples in FSH, your team may indeed prefer working that way, keeping the gold sources in FSH.

I am thinking of investing some time in this, partly as a debugging exercise for FSH tools, but only if there is a reasonable chance the results would be picked up.

view this post on Zulip Mark Kramer (Jun 06 2021 at 22:59):

I've done it, so, does anyone want it?

view this post on Zulip Brett Esler (Jun 07 2021 at 04:56):

Cool! @Mark Kramer I would love to check it out!

view this post on Zulip Mark Kramer (Jun 07 2021 at 12:17):

Here is a zip file with the results:

  • JSON files at the top level are the originals taken from https://build.fhir.org/ig/hl7au/au-fhir-base/examples.json.zip
  • The GoFSH directory contains:
    • /input/fsh contains the FSH translations of the original files
    • /fsh-generated directory contains the "reconstituted" JSON results from running SUSHI compiler on the FSH files.
      You can use your favorite comparison software (e.g., BeyondCompare) to compare the originals with the "reconstituted" files to see what has been changed. They won't be exactly the same since I fixed a number or errors and stylistic quirks in the originals.

au-base-package.zip

view this post on Zulip Brett Esler (Jun 07 2021 at 14:10):

Thanks will take a look

view this post on Zulip Mark Kramer (Jun 07 2021 at 16:04):

It wasn't obvious to me how to build your IG, but the gist for the next steps should be:
1) Remove the existing source files that define the profiles, extensions, value sets, etc.
2) Create an /input/fsh directory and put all the .fsh files there.
3) Run SUSHI, which will generate a fsh-generated folder containing what essentially is the replacement for the files removed in (1)
4) Build the IG, pointing at the new files, however you do it, and see if the results are good
Let me know how it goes!


Last updated: Apr 12 2022 at 19:14 UTC