-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support User Provided Examples of Logical Models #941
Conversation
…s that already have a corresponding Binary entry in the config
… adding to IG resource
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! Could you add a test case showing what happens when there is an example of a logical model that is not properly declared in the configuration's resource list?
Co-authored-by: Mint Thompson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a little confused when thinking of that test case to add, since what I said is just a fancy way of saying "what if the regular thing happens." So, this looks ready to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Just needs a merge from master and this should be ready to merge 👍🏽
This PR makes a couple minor changes in order to support user provided instances of logical models. Right now, SUSHI does not do any additional processing of these examples and we don't yet support authoring examples of logical models in FSH, but SUSHI will no longer crash if the examples are provided and it properly builds an IG resource with the examples.
In order to provide an example of a logical model, you can author a logical model in FSH like usual, and you can provide either a JSON or XML version of an example of that logical model in either the
input/resources
orinput/examples
folder with the nameBinary-{id}.json
. You also need to provide additional configuration for that resource in theresources
property ofsushi-config.yaml
. You need to specifyname
for the resource so the IG renders the name when it renders the link to the example, theexampleCanonical
should reference the Logical Model that the example is an instance of so the IG publisher knows how to link it, and you need to add anextension
to specify the format of the resource. The config entry I've been using to test looks like this:I've also been testing with a very simple Logical Model and very simple example:
and
If you run SUSHI and the publisher, you should see an Examples tab on the Logical Model page, which should link to the
my-id
example. The example's page should should the JSON or XML representation on the Narrative Content tab and should show a Binary with base64 encoding on the JSON/XML tabs.You should also be able to replace the Binary-my-id.json with the XML version of this file, change the
valueCode
fromapplication/fhir+json
toapplication/xml
and everything should work the same. Most of these steps were from this Zulip thread, and the sample-ig has an example here.