Search in extensions added to the FHIR data model

22 views
Skip to first unread message

Payal Dhadge

unread,
Mar 20, 2024, 11:38:24 PM3/20/24
to GCP Healthcare Discuss
Hello,

I am running into an issue while searching resources based on search parameter.
For my use case, I need to add an extra field in my Patient resource which will contain a patient-id that is assigned internally and I need to search for Patients based on this custom patient-id. 
On reading docs & StackOverflow, I ended up adding it through an extension

```
{
"name": [
{
"use": "official",
"family": "Jones",
"given": [
"Indiana"
]
}
],
"gender": "male",
"birthDate": "1967-05-01",
"resourceType": "Patient",
"extension": [
{
"valueString": "c0f544bd-6022-4d89-b02c-0237db8b64c1"
}
]
} ```

As per the docs-  https://cloud.google.com/healthcare-api/docs/how-tos/fhir-custom-search?hl=en#create_a_searchparameter_resource_in_the_fhir_store

1. I created a SearchParameter 

```
{
"resourceType": "SearchParameter",
"url": "http://example.com/abc/fhir/SearchParameter/my-patient-id",
"base": ["Patient"],
"code": "my-patient-id",
"name": "my-patient-id",
"type": "string",
"expression": "Patient.extension('http://example.com/abc/fhir/extensions/my-patient-id').value.as(String)",
"status": "active",
"description": "search based on internal patient-id"
} ``` But when I make a call to enable the custom search parameter, I am running into 404
URL : https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID:configureSearch
Error : 404 <<URL>>:configureSearch was not found on this server.
```
{"canonicalUrls": ["http://example.com/abc/fhir/SearchParameter/my-patient-id"] } ```
Note: All these requests are being made to https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID
& my datastore is using R4 version. What am I missing or doing wrong? Can someone please help me? Thank You

Paul Church

unread,
Mar 20, 2024, 11:42:06 PM3/20/24
to Payal Dhadge, GCP Healthcare Discuss
configureSearch is a preview feature, you'll need to use the "v1beta1" API version instead of "v1". (You can use different API versions interchangeably on the same store, so this should work immediately on the example you've already created.)

--
You received this message because you are subscribed to the Google Groups "GCP Healthcare Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gcp-healthcare-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gcp-healthcare-discuss/29dfcd4a-7165-4d45-9b53-8f958bd99e39n%40googlegroups.com.

Payal Dhadge

unread,
Mar 31, 2024, 8:23:43 PM3/31/24
to Paul Church, GCP Healthcare Discuss
Hi Paul,

I tried switching the versions and it worked. Thank you so much for your help


Reply all
Reply to author
Forward
0 new messages