Patch Patient - Error is: body: must be a list of patch operation requests

93 views
Skip to first unread message
Assigned to Fenil....@cerner.com by me

Tim Ammons

unread,
Aug 30, 2022, 4:12:47 PM8/30/22
to Cerner FHIR Developers

I am trying to patch a patient in the following way, but getting an error body: must be a list of patch operation requestsAny idea why?

X-Request-Id: 56b5782d-4f6a-43d2-b903-9c60a490234d+1764_twnP

Code:
static void UpdatePatientName(FhirClient fireClient, string patientID)
{
var pat = fireClient.Read($"/Patient/{patientID}");
var eTag = fireClient.LastResult.Etag;

Parameters patParams = new Parameters(); patParams.AddReplacePatchParameter("name/0/given", new HumanName().WithGiven("Beulah").WithGiven("Z")); fireClient.RequestHeaders.IfMatch.Add(new EntityTagHeaderValue($"\"{eTag}\"", true)); var updatedPat = fireClient.Patch<Patient>($"{patientID}", patParams);

}

This is the body it created, which appears to be a list of patch operation requests:
{"resourceType":"Parameters","parameter":[{"name":"operation","part":[{"name":"type","valueCode":"replace"},{"name":"path","valueString":"name/0/given"},{"name":"value","valueHumanName":{"given":["Beulah","Z"]}}]}]}

Thanks,
Tim

Fenil Desani (Cerner)

unread,
Aug 31, 2022, 8:47:49 AM8/31/22
to Cerner FHIR Developers
Hello Tim,

What is the actual body sent in the POST request?
If it's the one posted above, that does not look correct. Please refer to http://fhir.cerner.com/millennium/r4/base/individuals/patient/#patch

Thanks,
Fenil

Tim Ammons

unread,
Aug 31, 2022, 9:04:37 AM8/31/22
to Cerner FHIR Developers
Fenil,

Yes, the body below is what was sent in the POST request.  I'm using the Firely SDK and the code I showed in my original message is what produced this body.  It sounds like Firely SDK isn't producing a body that meets the Cerner standard in this case.  

{"resourceType":"Parameters","parameter":[{"name":"operation","part":[{"name":"type","valueCode":"replace"},{"name":"path","valueString":"name/0/given"},{"name":"value","valueHumanName":{"given":["Beulah","Z"]}}]}]}
Reply all
Reply to author
Forward
0 new messages