Stream: hapi
Topic: Using SearchParameter and updating a resource
Joe Atterberry (Feb 03 2022 at 20:51):
Also posted in implementers
HAPI FHIR Version 5.4.0 on Mac/Linux
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"
}
]
}
Joe Flack (Feb 03 2022 at 21:23):
I've fixed my FHIR base URL, but I'm still getting "Failed to fetch API definition". This is a fresh HAPI deployment... can anyone help? Screen-Shot-2022-02-03-at-4.22.46-PM.png
Joe Flack (Feb 03 2022 at 21:24):
http://20.119.216.32:8080/fhir/swagger-ui/
Joe Atterberry (Feb 04 2022 at 17:21):
@Joe Flack Not sure what swagger has to with my SearchParameter question
Joe Flack (Feb 06 2022 at 01:46):
Nothing. I'm just not that familiar with Zulip. I didn't mean to reply to your thread.
James Agnew (Feb 06 2022 at 17:40):
FWIW I am not able to reproduce this on hapi.fhir.org, so I'm assuming this is an issue that's already fixed in 5.7.0-SNAPSHOT
Last updated: Apr 12 2022 at 19:14 UTC