FHIR Chat · OperationDefinition in Sushi · shorthand

Stream: shorthand

Topic: OperationDefinition in Sushi


view this post on Zulip John Moehrke (May 04 2020 at 18:11):

What is the timeline for native support of OperationDefinition in Sushi, similar to how Sushi has made StructureDefinition more easy?

view this post on Zulip Mark Kramer (May 04 2020 at 18:56):

Hi John, right now we don't have a timeline for anything beyond approaching OperationDefinition as a instance. I know we batted around some fancier approaches a few months ago, but I don't have a clear idea what approach would look like, exactly. What would be your recommendation to make it easier?

view this post on Zulip Keith Boone (May 05 2020 at 20:21):

I'll definitely have some thoughts when I get further along in SANER, as I know of at least two operations that need further definition.

view this post on Zulip John Moehrke (May 06 2020 at 15:11):

Using the Instance method in FSH is not adding any value. I will leave my OperationDefinitions in XML... OH, right... I have to convert them to JSON for sushi to be able to copy the folder to the IG build... Why does sushi require json, when all it is doing is copying them to the IG build directory?

view this post on Zulip Chris Moesel (May 06 2020 at 15:45):

John Moehrke said:

Why does sushi require json, when all it is doing is copying them to the IG build directory?

This is because, in some cases, SUSHI requires JSON because it's actually doing more than just copying the files. If you bring your own profile (as XML) and you want to reference it from FSH (as a parent for example), then SUSHI needs to be able to process that parent profile in its entirety (understanding its resource types, constraints, etc). Since SUSHI only understands JSON, it needs the profile to be in JSON in order to understand it. Similarly, for instances, if you want to reference an instance that is in XML, then SUSHI can't process the instance to validate (a) that it exists at all (by it's type and id), and (b) that it is a valid type for where it is being used. Last, when SUSHI is building up the ImplementationGuide, it needs to look into the user-provided files to get metadata to properly populate the ImplementationGuide resources.

All that being said, I agree that it is an unfortunate limitation and that we should try to address it. We basically need to find or implement a FHIR XML->JSON converter in JavaScript. @Keith Boone has pointed me to some (non-JavaScript) code he wrote for this and we have also made a note to look at the VS Code fhir plugin source to see if it already has code for it. So... it's on the list of things to do. In the mean time, you could use one of the available tools or plugins to convert your XML to JSON.


Last updated: Apr 12 2022 at 19:14 UTC