Stream: shorthand
Topic: extensions on repeating elements
David Hay (Jun 24 2020 at 21:33):
so I have this sushi fragment (on an instance):
* generalPractitioner[0] = Reference(drwelby) //the GP
* generalPractitioner[0].display = "Dr Marcus Welby"
* generalPractitioner[1] = Reference(gp-org1) //the GP Practice
* generalPractitioner[1].display = "Good Health Medcial Centre"
* generalPractitioner[1].extension[edi-address].valueString = "hl-001"
* generalPractitioner[1].extension[gp-practice-enrollment-date].valueDate = "2020-01-01"
which generates this instance
"generalPractitioner": [
{
"extension": [
{
"url": "http://hl7.org.nz/fhir/StructureDefinition/edi-address"
},
{
"url": "http://hl7.org.nz/fhir/nhi/StructureDefinition/gp-practice-enrollment-date"
}
],
"reference": "Practitioner/drwelby",
"display": "Dr Marcus Welby"
},
{
"extension": [
{
"url": "http://hl7.org.nz/fhir/StructureDefinition/edi-address",
"valueString": "hl-001"
},
{
"url": "http://hl7.org.nz/fhir/nhi/StructureDefinition/gp-practice-enrollment-date",
"valueDate": "2020-01-01"
}
],
"reference": "Organization/gp-org1",
"display": "Good Health Medcial Centre"
}
],
The first entry should not have the extension - right?
Jean Duteau (Jun 24 2020 at 21:35):
it shouldn't, but it depends on your profile definition, if you had one.
David Hay (Jun 24 2020 at 21:46):
Well - here's the profile segment:
* generalPractitioner only Reference(HaPractitioner | HaOrganization)
* generalPractitioner.extension contains
$edi-address named edi-address 0..1 and
$gp-enrollmentDate named gp-practice-enrollment-date 0..1
The issue is that only one of the references in the instance had the extension defined. I could try explicitly removing it from the instance - hold on...
Jean Duteau (Jun 24 2020 at 21:47):
hmm, yeah, that seems like it should only include the extension if it was defined (0..1) on both
David Hay (Jun 24 2020 at 21:47):
Actually, of course, i can't 'remove' the extension from an instance of course...
Jean Duteau (Jun 24 2020 at 21:50):
no, but if you don't define it in either repetition, do you still get the extension 'stub'?
Chris Moesel (Jun 24 2020 at 21:55):
This looks like a bug in SUSHI to me. You probably shouldn't be getting those extension 'stub's in the generalPractitioner[0]
entry. I don't have time to investigate right now, but we can try to look into that tomorrow!
David Hay (Jun 24 2020 at 21:59):
No worries - I'll work around it...
Nick Freiter (Jun 25 2020 at 13:03):
I was able to reproduce this and can confirm it is definitely a bug. I made an issue to track the bug here: https://github.com/FHIR/sushi/issues/502.
Last updated: Apr 12 2022 at 19:14 UTC