FHIR Chat · Sub Extension as a List · implementers

Stream: implementers

Topic: Sub Extension as a List


view this post on Zulip Michal (Sep 27 2016 at 16:07):

I have problem to which I can't find solution in FHIR structures.
Description:
I have a patient that is linked to multiple Organizations, and I need to show all those Organizations on GET /Patient/123

The solution that I'm thinking of is to use Extensions like

{
"resourceType": "Patient",
//all mandatory fields\\,
"extension": [
{
"url": "http://mycompeny.com/VIP",
"valueBoolean": true
},
{
"url": "http://mycompany.com/company",
"extension": [
{
"url":"/company-1",
"valueReference": {
"reference": "Organization/1"
}
},
{
"url":"/company-2",
"valueReference": {
"reference": "Organization/2"
}
}
]
}
]

The first extension (VIP one), is not relevant here, I've just added it to who that I have single extensions but also trying to build a list of "grouped" extensions.

Is there any different way of doing such things ?
Is it a valid FHIR structure ? (my understanding of the specification it that it is a correct way).

view this post on Zulip Lloyd McKenzie (Sep 28 2016 at 03:21):

Why do you need a grouping? If an extension has multiple repetitions, you just include it multiple times

view this post on Zulip Michal (Sep 28 2016 at 09:17):

I grouped them to make structure more readable, also the number of companies varies per patient.
But seeing what you wrote I'm thinking that I'm trying to overcomplicate the problem.

When it just comes to the structure, is it a valid one, is it allowed to next extensions in a such way ?

view this post on Zulip Lloyd McKenzie (Sep 28 2016 at 20:29):

Extensions can contain nested extensions - but if this happens, they can't have a value. But this is generally done for complex extensions where you want to capture multiple properties, not just to group multiple repetitions.


Last updated: Apr 12 2022 at 19:14 UTC