Stream: implementers
Topic: How to PATCH an extension?
Alexander Zautke (May 02 2021 at 17:52):
I'm currently trying to figure out how to interpret the section on the PATCH operation about Anonymous Types. I'm looking for a solution on how to add an extension using a single PATCH operation to a resource. For me the part regarding "a set of parts that are values are provided" is not totally clear. I'm unsure how it's supposed to look like. I didn't find any example in the test case downloads either which would provide more than one value as a part.
Say I've defined an "Add" operation with the path "Patient" and name "extension", would the following part be correct to add an extension?
{
"name": "value",
"part": [
{
"name": "url",
"valueUri": "https://example.org/fhir/StructureDefinition/MyPatchExtension"
},
{
"name": "value",
"valueString": "test"
}
]
}
Or should the "value" part be repeating with a single part in it?
Alexander Zautke (May 02 2021 at 18:03):
Extending this to complex extensions ("This pattern repeats as deep as necessary")
My initial guess would be the following:
{
"name": "value",
"part": [
{
"name": "url",
"valueUri": "https://example.org/fhir/StructureDefinition/MyPatchExtension"
},
{
"name": "extension",
"part": [
{
"name": "url",
"valueUrl": "MyComplexExtensionElement"
},
{
"name": "value",
"valueString": "test"
}]
}]
}
Anyone already experimented with this before?
Lloyd McKenzie (May 02 2021 at 18:07):
@Grahame Grieve @James Agnew
Grahame Grieve (May 04 2021 at 04:39):
have you looked at the test cases? https://github.com/FHIR/fhir-test-cases/blob/master/r5/patch/fhir-path-tests.xml
Alexander Zautke (May 04 2021 at 08:19):
Yes, I only see two examples which are related to the anonymous type section ("Add Anonymous Type" and "Delete Anonymous Type"). Do you have a different case in mind which would cover the scenario mentioned above?
Grahame Grieve (May 04 2021 at 10:18):
no I hoped there was one already
Grahame Grieve (May 05 2021 at 03:46):
ok. so i think that your examples above are correct
Last updated: Apr 12 2022 at 19:14 UTC