FHIR Chat · Inheritance and Cardinality Changes · conformance

Stream: conformance

Topic: Inheritance and Cardinality Changes


view this post on Zulip Gino Canessa (Jun 10 2020 at 21:40):

I've been looking through Zulip and haven't found anything: are Resources allowed to change cardinality on inherited fields?

Currently in R5, ConceptMap inherits from CanonicalResource. But CanonicalResource.identifier is 0..* and ConceptMap.identifier is 0..1.

Updating some tooling and it's throwing up because one should be coded as an array and the other should not.

Is this legal? If not, I can file a Jira. (If it is, I may file one anyway, but that's a different issue).
Thanks!

view this post on Zulip Lloyd McKenzie (Jun 10 2020 at 21:41):

CanonicalResource is a pattern. It's not strict inheritance

view this post on Zulip Lloyd McKenzie (Jun 10 2020 at 21:41):

From a class perspective, you can say that ConceptMap implements the CanonicalResource interface

view this post on Zulip Gino Canessa (Jun 10 2020 at 21:41):

So fields (e.g., id, meta, etc.) should not be inherited?

view this post on Zulip Lloyd McKenzie (Jun 10 2020 at 21:41):

(Though if you pass it more than one identifier, it'll yell)

view this post on Zulip Lloyd McKenzie (Jun 10 2020 at 21:42):

It has proper inheritance from DomainResource

view this post on Zulip Gino Canessa (Jun 10 2020 at 21:42):

Where? In R5 it's listed as Type: CanonicalResource

view this post on Zulip Lloyd McKenzie (Jun 10 2020 at 21:42):

@Grahame Grieve, we probably need to clearly distinguish the difference between 'is a' and 'implements'

view this post on Zulip Gino Canessa (Jun 10 2020 at 21:44):

Ahh, the base type is listed as deriving from CanonicalResource, but then fields are defined as parented by DomainResource. Ugh.

view this post on Zulip Gino Canessa (Jun 10 2020 at 21:44):

Thanks though

view this post on Zulip Gino Canessa (Jun 10 2020 at 21:48):

Hmm.. there's no way for me to know that difference consuming the StructureDef is there? It has "baseDefinition": "http://hl7.org/fhir/StructureDefinition/CanonicalResource",, but just doesn't inherit any fields from it. Do we always just filter that off for CanonicalResource?

view this post on Zulip Grahame Grieve (Jun 13 2020 at 21:14):

the only way to tell in the StructureDefinitions is that the definition for CanonicalResource has extension http://hl7.org/fhir/StructureDefinition/structuredefinition-interface = true

view this post on Zulip Gino Canessa (Jun 17 2020 at 19:04):

Created FHIR#27839

view this post on Zulip Lloyd McKenzie (Mar 27 2022 at 04:21):

I was supposed to write up an algorithm for how code generation to support an interface might work. Please see it here: https://docs.google.com/document/d/1YrdzZoChWCBCClynZ_5jLTXXl0_l0MdL2BdUnSWumh4

view this post on Zulip Grahame Grieve (Mar 28 2022 at 21:49):

I don't understand how this actually addresses the problem, honestly.

view this post on Zulip Grahame Grieve (Mar 28 2022 at 21:50):

perhaps you could add some actual code


Last updated: Apr 12 2022 at 19:14 UTC