Stream: shorthand
Topic: sushi: warning on override
Patrick Werner (Nov 25 2020 at 20:16):
We ran into a strange problem with sushi today, when overriding "reserved names", like data types strange things are happening.
Patrick Werner (Nov 25 2020 at 20:16):
Extension: RelatedArtifact
Id: RelatedArtifact
Title: "Related Artifact"
Description: "Captures citations, evidence and other supporting documentation for the observation or report."
* ^context[0].type = #element
* value[x] only RelatedArtifact
Patrick Werner (Nov 25 2020 at 20:17):
will create an Extension with itself as its Extension value.
Patrick Werner (Nov 25 2020 at 20:18):
So you can click in circles for days in the ig :smirk:
Patrick Werner (Nov 25 2020 at 20:19):
What do you think about adding a warning into sushi if you use already used dataTypes names as IDs/Names/etc..?
Chris Moesel (Nov 25 2020 at 20:46):
Ah. Yes. I think we have some special logic to handle this in the case of Parent:
, but maybe not in the case of only
rules. That's some good fun right there. Technically speaking, I don't think an Extension
type is even allowed there -- so if SUSHI thinks you are referring to the RelatedArtifact
extension, it really ought to be complaining about that anyway. But apparently it is not.
Chris Moesel (Nov 25 2020 at 20:57):
Whenever there is a clash between a local definition name and an external definition name, the local one is always preferred. In order to force the external one, you need to refer to it by its canonical URL. So in this case, you'd want to change that last line to:
* value[x] only http://hl7.org/fhir/StructureDefinition/RelatedArtifact
(You could also use an alias if you will need to refer to HL7 RelatedArtifact in more than one rule).
Patrick Werner (Nov 25 2020 at 22:19):
ah! i renamed the Extension, but refering by its canonical url is way more elegant.
Last updated: Apr 12 2022 at 19:14 UTC