FHIR / sushi

SUSHI (aka "SUSHI Unshortens Short Hand Inputs") is a reference implementation command-line interpreter/compiler for FHIR Shorthand (FSH).
Apache License 2.0
145 stars 44 forks source link

Add support for CanonicalResource as a parent of a Resource #1477

Closed mint-thompson closed 3 months ago

mint-thompson commented 3 months ago

Transferred from internal JIRA issue originally created 2022-05-17.

FHIR R5 adds the CanonicalResource definition, which is an interface. Interfaces provide element definitions, but these definitions are not automatically inherited. There is some ongoing discussion regarding the use of interfaces: see the following links for details

Although the approach to interfaces may change, we should probably support them the way they’re defined now. I think this mainly affects the Resource: capability in FSH. When creating a resource, if the author adds an element that matches an element from CanonicalResource, SUSHI should allow that (since FHIR says you should redeclare elements from interfaces) - but it also should ensure that you don’t violate any constraints on that element in the interface (e.g., try to make a 0..1 into a 0..*). If an author does not explicitly add an element from an interface, then it shouldn’t be in the resource’s snapshot. This likely also has implications for GoFSH.

There’s probably more investigation and understanding needed here. I expect we’ll learn as we go.

cmoesel commented 3 months ago

FHIR R5 changed directions before the official R5 was released -- and CanonicalResource is no longer in the official hierarchy chain. This issue is no longer relevant.