Stream: shorthand
Topic: Mapping value[x].property
Pétur Valdimarsson (Mar 24 2020 at 14:51):
Hi! I've been playing around with the Mapping feature a bit and have found an issue. Not sure if this is due to incorrect usage from my part, a known limitation or bug, but I thought I'd post here and find out.
I'm trying to put a mapping on a specific type of value[x], in this case in an extension. Have not tried on a native value[x]. The path seems to map incorrectly causing IG-publisher to fail in snapshot generation.
Including a sample fsh-file below that provokes the result.
Profile: IssueProfile Parent: http://hl7.org/fhir/StructureDefinition/Basic Id: issue-report Title: "IssueReport" * extension contains IssueExtension named issue 1..1 MS Extension: IssueExtension Id: issue-extension Title: "IssuePeriod" * ^context.expression = "Basic" * value[x] only Period * valuePeriod 1..1 MS Mapping: IssueMapping Source: IssueProfile Target: "http://something" Title: "..." Id: issue-mapping * extension[issue].valuePeriod.start -> "Should have path Basic.extension:issue.value[x]:valuePeriod.start gets Basic.extension:issue.valuePeriod.start"
Nick Freiter (Mar 24 2020 at 17:06):
Oh good find! This is something we haven't seen before, but I'm not sure it is specific to Mappings alone. I was able to get a similar looking error using the following FSH:
Profile: IssueProfile Parent: http://hl7.org/fhir/StructureDefinition/Basic Id: issue-report Title: "IssueReport" * extension contains IssueExtension named issue 1..1 MS // * extension[issue].valuePeriod MS * extension[issue].valuePeriod.start MS Extension: IssueExtension Id: issue-extension Title: "IssuePeriod" * ^context.expression = "Basic" * value[x] only Period * valuePeriod 1..1
where the offending line is * extension[issue].valuePeriod.start MS
. However, if the line above that, * extension[issue].valuePeriod MS
is uncommented, then the IG Publisher does not give any errors. This seems like it could be an issue with the IG Publisher failing to find the nested element unless the parent of that nested element is also in the differential.
One possible workaround for you is to add a line to the mapping that maps extension[issue].valuePeriod
:
* extension[issue].valuePeriod -> "This should work now"
Another possible solution would be to apply the mapping to the IssueExtension
directly instead of applying via IssueProfile:
Mapping: IssueMapping Source: IssueExtension Target: "http://something" Title: "..." Id: issue-mapping * valuePeriod.start -> "Should have path Basic.extension:issue.value[x]:valuePeriod.start gets Basic.extension:issue.valuePeriod.start"
Nick Freiter (Mar 24 2020 at 17:10):
I submitted an issue for this https://github.com/FHIR/sushi/issues/293, since I still think we need to dive a bit deeper and figure out if this is an issue on our end, the IG Publisher's end, or some mixture of the two.
Chris Moesel (Mar 24 2020 at 17:37):
In theory, the publisher supports sparse differentials -- but I think it does require some gaps to be filled when you're talking about paths w/ slices. It might be a publisher issue, but I'm guessing that maybe we just need to detect this situation in SUSHI and generate the intermediate differential element for extension[issue].valuePeriod
.
Pétur Valdimarsson (Mar 24 2020 at 17:51):
Thanks for the swift reply and workaround! Will continue playing around and I'll let you know if I find other issues.
Chris Moesel (Apr 03 2020 at 12:39):
Oh. That. It's fixed locally. I don't think it made it into a release yet? Maybe today?
Last updated: Apr 12 2022 at 19:14 UTC