Stream: shorthand
Topic: InstanceOf a logical model?
David Pyke (Oct 01 2021 at 12:55):
I'm trying to use sushi to create an instance of a logical model of StructureDefinition but no matter what I do, it can't seem get sushi to find the logical model's structure def to build it. Am I trying to do something sushi doesn't support?
John Moehrke (Oct 01 2021 at 14:52):
@Jose Costa Teixeira ?
Jean Duteau (Oct 01 2021 at 15:03):
Yes, SUSHI currently doesn't support creating an instance of a logical model. The line from the specification is a little unclear: quote The value of InstanceOf MAY be the name, id, or url for any profile, resource, or complex datatype defined internally or externally.
But logical models aren't profiles, resources, or complex datatypes so Instances can't be done with those.
Jose Costa Teixeira (Oct 01 2021 at 15:15):
Correct. Here's an example of a logical model instance: https://build.fhir.org/ig/FHIR/sample-ig/Binary-logical-example.html FWIW
Jose Costa Teixeira (Oct 01 2021 at 15:17):
so unless Sushi wants to create arbitraty json structures and xml files, I don't see how that would happen
Nick Freiter (Oct 01 2021 at 15:20):
Yeah this is something we decided against doing when implementing logical models. But our decision was largely based on an assumed lack of need to make instances of logical models. But it seems like we may have been incorrect in our assumption, and there is actually more interest in creating instances of logical models than we think.
We haven't fully looked into the hurdles of arbitrary JSON like @Jose Costa Teixeira mentioned, so I'm not totally sure if it would pretty much be a non-starter. My first instinct though is that it might not actually be too bad given that logical models are just StructureDefinitions, and we know how to make instances of what StructureDefinitions define.
I've made an issue here for us to dig a little deeper into this, and either support instances of logical models, or at least be more explicit in our error message saying that we don't support it
Chris Moesel (Oct 01 2021 at 15:32):
Right. And up until one month ago, the IG Publisher did not support it at all. If you look at this thread, however, you can see that there is some complexity to it. For example, authors would have to mark up their logical models w/ all the info needed to describe how serialization of each element should work (which, at that point, makes it a physical model I guess?). TBH I'm not even sure if FHIR defines where you put the type of a logical model in a JSON instance (e.g., do you still use a resourceType
property?) -- so we might have to make that up.
David Pyke (Oct 01 2021 at 15:48):
We're effectively creating custom resources (like the CDA IG) and then assigning values to the elements. It's a fair amount of work for IG devs, but if you're getting to the level of creating a custom resource, then I expect the extra work would be not a huge hurdle for the IG dev.
John Moehrke (Oct 01 2021 at 15:55):
im still struggling with the concept of an Instance of a logical model... this just makes no sense to me. If one can create an instance, then one does not have a logical model, one has a concrete model.
David Pyke (Oct 01 2021 at 15:55):
Any way you slice it, I don't have the ability to create an Instance of it
John Moehrke (Oct 01 2021 at 15:56):
yes you do... you create it outside of sushi, and base64 encode it into a Binary.
David Pyke (Oct 01 2021 at 15:57):
Sorry, I don't have a way in Sushi to do it
John Moehrke (Oct 01 2021 at 16:00):
I think you are looking for a tool called "Caviar", not "Sushi"..... it is friday, right?
Chris Moesel (Nov 12 2021 at 20:55):
SUSHI 2.2.0 now has the necessary support to allow authors to use the mechanism Grahame described for including examples of logical models. You can't write the example in FSH (you must provide JSON/XML), but it's a step in the right direction.
Last updated: Apr 12 2022 at 19:14 UTC