FHIR Chat · Using SearchParameter and updating a resource · implementers

Stream: implementers

Topic: Using SearchParameter and updating a resource


view this post on Zulip Joe Atterberry (Feb 03 2022 at 16:01):

I'm using the following SearchParameter to eliminate duplicate Identifiers for a Patient resource. It works fine until I try to update that resource using the identifier as part of the PUT command with URL http://localhost:3111/myfhir/Patient?identifier=urn:uuid:555|26828F0386673. An error is returned

Can not create resource of type Patient as it would create a duplicate unique index matching query: Patient?identifier=urn%3Auuid%3A555%7C26828F0386673 (existing index belongs to Patient/391494aa-0cba-4e88-85c8-7539a5e9506f, new unique index created by SearchParameter/11d73d9c-b13a-4f70-9e7d-a7a916d80765)

If I use the id for the patient directly the update of the resource works fine. http://localhost:3111/myfhir/Patient/391494aa-0cba-4e88-85c8-7539a5e9506f.

Once I use a SearchParameter does that mean I can't use the identifier for the update? What am I missing?

It's worth noting that in the HFJ_IDX_CMP_STRING_UNIQ table the IDX_STRING column always has an entry like Patient?identifier=urn%3Auuid%3A555%7C26828F0386673 no matter if the SearchParameter expression is Patient.identifier or Patient.identifer.value

Thanks.

The SearchParameter looks like:
{
"resourceType": "SearchParameter",
"meta": {
"lastUpdated": "2021-05-02T10:43:02.162-04:00",
"tag": [ {
"system": "https://my.health.com/x/Onc1C",
"code": "34a800fa-bba9-4cb9-77ed-0aa4d0eecef2",
"display": "FHIR Implementation Team"
} ]
},
"extension": [
{
"url": "http://hapifhir.io/fhir/StructureDefinition/sp-unique",
"valueBoolean": true
}
],
"url": "http://health.com/fhir/SearchParameter/uniq-patient-identifier",
"name": "unique-patient-identifier",
"status": "active",
"description": "A unique patient identifier",
"code": "unique-patient-identifier",
"base": [
"Patient"
],
"type": "token",
"expression": "Patient",
"component": [
{
"definition": "http://hl7.org/fhir/SearchParameter/patient-identifier",
"expression": "Patient.identifier"
}
]
}

view this post on Zulip Lloyd McKenzie (Feb 03 2022 at 16:40):

This sounds like a server-specific question. Are you using HAPI, .NET, something else?

view this post on Zulip Joe Atterberry (Feb 03 2022 at 20:45):

Using HAPI FHIR Java on version 5.4.0

view this post on Zulip Grahame Grieve (Feb 03 2022 at 20:46):

sounds like a question for #hapi

view this post on Zulip Joe Atterberry (Feb 03 2022 at 20:46):

ok. I'll post there


Last updated: Apr 12 2022 at 19:14 UTC