Stream: hapi
Topic: Upload SearchParameter
Abel Stolz (Dec 01 2021 at 15:31):
I try to upload a SearchParameter (and use it) to a standard HAPI (latest docker image).
So I post my SearchParameter resource to the <base url>/SearchParameter endpoint. The server log reads:
2021-12-01 15:24:28.656 [hapi-fhir-jpa-scheduler-local-2] INFO c.u.f.j.s.r.SearchParamRegistryImpl [SearchParamRegistryImpl.java:272] Adding 1 search parameters to SearchParamRegistry
2021-12-01 15:24:28.656 [hapi-fhir-jpa-scheduler-local-2] INFO c.u.f.j.s.r.SearchParamRegistryImpl [SearchParamRegistryImpl.java:278] Deleting 0 search parameters from SearchParamRegistry
2021-12-01 15:24:28.656 [hapi-fhir-jpa-scheduler-local-2] INFO c.u.f.j.s.r.SearchParamRegistryImpl [SearchParamRegistryImpl.java:119] Rebuilding SearchParamRegistry
2021-12-01 15:24:28.677 [hapi-fhir-jpa-scheduler-local-2] INFO ca.uhn.fhir.context.FhirContext [FhirContext.java:200] Creating new FHIR context for FHIR version [R4]
2021-12-01 15:24:28.719 [hapi-fhir-jpa-scheduler-local-2] INFO c.u.f.j.s.r.JpaSearchParamCache [JpaSearchParamCache.java:154] Have 0 unique search params
2021-12-01 15:24:31.746 [hapi-fhir-jpa-scheduler-clustered-3] INFO c.u.f.j.s.r.ResourceReindexingSvcImpl [ResourceReindexingSvcImpl.java:309] Running 1 reindex jobs: [ResourceReindexJobEntity[id=1,resourceType=Encounter,thresholdLow=<null>,thresholdHigh=2021-12-01 15:29:21.941]]
2021-12-01 15:24:31.751 [hapi-fhir-jpa-scheduler-clustered-3] INFO c.u.f.j.s.r.ResourceReindexingSvcImpl [ResourceReindexingSvcImpl.java:359] Performing reindex pass for JOB[1]
2021-12-01 15:24:31.760 [hapi-fhir-jpa-scheduler-clustered-3] INFO c.u.f.j.s.r.ResourceReindexingSvcImpl [ResourceReindexingSvcImpl.java:389] Loaded 0 resources for reindexing in 4ms
2021-12-01 15:24:31.760 [hapi-fhir-jpa-scheduler-clustered-3] INFO c.u.f.j.s.r.ResourceReindexingSvcImpl [ResourceReindexingSvcImpl.java:340] Marking reindexing job ID[1] as deleted
For me this looks as if the search parameter is registered and the Encounter resource is indexed.
When I try using the search parameter, I get the following error message:
"diagnostics": "Unknown search parameter \"start\" for resource type \"Encounter\". Valid search parameters for this search are: [_id, _language, _lastUpdated, account, appointment, based-on, class, date, diagnosis, episode-of-care, identifier, length, location, location-period, part-of, participant, participant-type, patient, practitioner, reason-code, reason-reference, service-provider, special-arrangement, status, subject, type]"
What am I doing wrong?
Noemi Deppenwiese (Dec 01 2021 at 15:33):
Is the SearchParameter.status draft? I had a similar Problem and solved it by setting status to active.
Abel Stolz (Dec 01 2021 at 15:39):
The status is "draft", but changing it to "active" didn't change anything. Setting SearchParameter.experimental to "false" also didn't change anything...
Abel Stolz (Dec 01 2021 at 15:46):
I recall my latest statement. Setting status to "active" indeed did work! I had to eliminate another error for it to take effect. Thank you very much!
Last updated: Apr 12 2022 at 19:14 UTC