-
Notifications
You must be signed in to change notification settings - Fork 42
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 logical model examples without resourceType or id #1418
Conversation
e5867e5
to
4dc35e6
Compare
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 think a case can be made for having that error be an error or warning (and in fact, you made both cases). I think perhaps warning is fine for our needs -- and also is more flexible if other use cases turn up in the future that allow for resources without id or resourceType.
I've made one suggestion for optimizing/simplifying some of the new code. Feel free to push back if you think it is unnecessary.
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 and works well. I tested it using the provide project (thanks!) and confirmed that SUSHI build the IG JSON correctly and then the IG Publisher successfully processes it as well. I also confirmed that a warning is logged if there is no corresponding resource entry in the sushi-config.yaml. Thanks, Julia!
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.
Implementation and tests all look good. Thank you!
Fixes #1406
This PR supports including logical model examples that do not have a
resourceType
and/or anid
. If the correct extension is added to the resource in thesushi-config.yaml
file, then SUSHI will detect that and not log any warnings. This was based off the suggested approach from Zulip here. I confirmed that this approach works with the IG Publisher, and it will properly process the resource.One thing to note is that we document including logical models here and indicate that the extension
http://hl7.org/fhir/StructureDefinition/implementationguide-resource-format
should be used. However, that Zulip thread indicated the extensionhttp://hl7.org/fhir/tools/StructureDefinition/implementationguide-resource-format
should be used. I tested this with the publisher, and both extension URLs work the same within the publisher, so I think it is valid for SUSHI to support both as well. If we hear back that one URL is preferred over the other, we can make sure that the Tips and Tricks page in FSH School reflects the best practice.I also updated the error that was logged when a
resourceType
orid
was missing to be a warning. If an example without anid
orresourceType
is included but configured correctly with the extension, this will not be logged. If the resource isn't configured correctly, the IG Publisher will crash, so we could keep it as an error, so I'm open to feedback here. My reasoning was that it seemed like the error should say something about configuring the resource type to resolve the error since it could be valid thatresourceType
orid
was missing. Instead of including IGPublisher specific configuration in a SUSHI error message, I chose to just soften it to a warning. But again, I'm open to switching it back.There's an example in the tests that shows this feature, but I've included a sample project here: LogicalExamplesWithoutResourceTypeId.zip
There is also a FSH School PR here that updates the Tips and Tricks to include how to configure an example without a
resourceType
andid
.