{
"id" => "12766873",
"meta" => { "versionId" => "12766873", "lastUpdated" => "2020-10-08T23:57:25Z" },
"type" => "allergy",
"category" => ["food"],
"criticality" => "low",
"code" => { "text" => "shellfish" },
"patient" => { "reference" => "Patient/12744859", "display" => "REVSPRING, TWO" },
"encounter" => { "reference" => "Encounter/97955344" },
"recordedDate" => "2020-10-06T20:15:05Z",
"recorder" => { "reference" => "Practitioner/1025924", "display" => "Cerner Test, Physician - Gastroenterology Cerner" },
"resourceType" => "AllergyIntolerance",
}
and I attempt to create (POST /AllergyIntolerance) an allergy by sending:
{
"clinicalStatus" => {
"coding" => [
{ "system" =>
"code" => "active" },
],
},
"code" => {
"coding" => [
{
"code" => "735029006",
},
],
"text" => "Shellfish",
},
"patient" => { "reference" => "Patient/12744859" },
"resourceType" => "AllergyIntolerance",
}
it returns a "409 - Conflict" response.
Is it the responsibility of the consumer (me in this case) to do code and text based comparisons to prevent sending what seems to be duplicated allergies (even if they don't match in code)? How should I handle this issue?
Thanks!