FHIR Chat · Custom Search Parameter always returns 0 results · hapi

Stream: hapi

Topic: Custom Search Parameter always returns 0 results


view this post on Zulip Neeraj Kumar (Feb 19 2021 at 13:04):

Hi,
I am using Hapi-Fhir version 5.3.0-SNAPSHOT. I have implemented the 'CustomResource' and It's successfully getting created and search by '_id' is also working. The URL and JSON structure for 'CustomResource' are,
URL: http://localhost:8080/fhir/PARTITION-10/CustomResource
JSON:
{
"resourceType": "CustomResource",
"dogs": "Himalayan Sheepdog",
"customDataType": {
"date": "2020-02-01",
"kittens": "Juvenile cat"
}
}

I have created a custom search parameter for the string field 'dogs'. The URL and JSON structure for 'SearchParameter' are,
URL: http://localhost:8080/fhir/DEFAULT/SearchParameter
JSON:
{
"resourceType": "SearchParameter",
"id": "cr-dogs",
"title": "Custom Resource Dogs",
"base": [
"CustomResource"
],
"status": "active",
"name": "dogs",
"code": "dogs",
"type": "string",
"expression": "CustomResource.dogs"
}

URL: http://localhost:8080/fhir/PARTITION-10/CustomResource?dogs=Himalayan Sheepdog

But when I hit this search URL It always returns 0 results. Any idea what's wrong I am doing here.


Last updated: Apr 12 2022 at 19:14 UTC