Stream: shorthand
Topic: sushi: problem with external profiles containing profiles
Patrick Werner (Apr 06 2021 at 16:14):
I stumbled over a weird issue. If i have:
- a profile on Identifier
- a profile2 using this IdentifierProfile
- creating an Instance of this profile2
everything works just fine: https://fshschool.org/FSHOnline/#/share/3uofq3N
Patrick Werner (Apr 06 2021 at 16:15):
if i remove the Identifier Profile from the fsh file, replacing it with an external Extension, contained in /resources
everything still works fine.
Patrick Werner (Apr 06 2021 at 16:16):
If i only build the instance, refering to an external profile, which references the Identifier Profile i get: error The element or path you referenced does not exist: performer.actor.identifier.value
Patrick Werner (Apr 06 2021 at 16:22):
I created a minimal test set:
https://github.com/patrick-werner/reproduce-fsh-issue
(please ignore the extension error, i didn't include these to have a minimal test-case)
Chris Moesel (Apr 06 2021 at 18:41):
Hi @Patrick Werner. This is an interesting issue. I believe I've found what the problem is, but I'm not sure exactly what the right solution is... I think the problem is that in TestProfile2
, performer.actor.identifier.value
is defined as being a choice of two profiles:
"type": [
{
"code": "Identifier",
"profile": [
"http://fhir.de/StructureDefinition/identifier-iknr",
"http://fhir.abda.de/eRezeptAbgabedaten/StructureDefinition/DAV-PR-ERP-DAVHerstellerSchluessel"
]
}
],
When you try to use that path in an instance, SUSHI doesn't know which profile to use as the definition for the Identifier
type that the instance should be built against. For example, if each profile fixed the Identifier.system
to a different value, SUSHI wouldn't know which to apply. So in this case, it seems like SUSHI is just giving up and not using either (and instead returning a confusing error message). I noticed that if I removed the second profile (so there was only one profile in the array) then the error went away. You didn't see this w/ your FSH-defined profile because in that one you restrict the Identifier
to a single profile (not two profiles).
I don't think what SUSHI is doing now is the best approach. At a minimum, we should return a better error message. I think the best short-term solution is for SUSHI to use the base resource type (Identifier
) and issue a warning message that since there were two profiles, SUSHI used only the base definition. Long term, I think it would be nice for the author to be able to target the profile they want using a path syntax like performer.actor.identifier[http://fhir.de/StructureDefinition/identifier-iknr].value
(but I don't know if that's exactly the right syntax since it could be confused for slice syntax). What do you think?
Patrick Werner (Apr 07 2021 at 08:01):
Hi @Chris Moesel
using the base resource type in this case sounds like a good short term solution. Long term i could see sushi just trying the profiles until the first fits for the element. Or leave it at the base resource definition. Errors will be catched by the IG publisher downstream
Chris Moesel (Apr 08 2021 at 12:22):
Last updated: Apr 12 2022 at 19:14 UTC