Skip to content

Adding category SearchParameter breaks similar SearchParameters until restart #3487

Open
@nielsrustenburg

Description

Describe the bug
Adding a SearchParameter for the 'category' on a resource type for which this is not supported by default breaks support of the 'category' SearchParameter for other resource types.

We are adding a SearchParameter for MedicationDispense & MedicationAdministration, which works fine, but after doing so, the SearchParameter of 'category' no longer works for Observation, Consent, Procedure, MedicationRequest, MedicationStatement, and likely others.

After many successful(ly failing) reproductions on my local machine the problem was gone after I restarted my laptop, it appears that restarting the fhir-server also fixes the problem.

FHIR Version?
Stu3

Data provider?
SQL Server

To Reproduce

  1. Start fresh fhir-server connected to an empty database
  2. Add 2 Observations and 2 MedicationDispenses, all with different categories example-resources-sparam-category-bug.txt
  3. Make following GET Request to prove Observation category SearchParameter is initially working, you should get 1 resource back
    {{fhirServerUrl}}/Patient/example/Observation?code=http%3A%2F%2Fsnomed.info%2Fsct%7C49581000146104
  4. Make following GET Request to prove MedicationDispense category SearchParameter is not supported, you should get 2 resources and an operationoutcome indicating the SearchParameter is not supported.
    {{fhirServerUrl}}/Patient/example/MedicationDispense?category=http%3A%2F%2Fsnomed.info%2Fsct%7C373784005
  5. Add new SearchParameter for MedicationDispense-category SearchParameter-Medications-category.txt
  6. Reindex & wait for reindexing to be done
  7. Repeat the request from step 4 to prove the MedicationDispense category SearchParameter is now supported, you should get 1 resource back
  8. Repeat the request from step 3, an OperationOutcome will be returned indicating "The search parameter 'category' is not supported for resource type 'Observation'."

Extra step: Restarting the fhir-server and repeat the requests, now both search parameters are supported

Expected behavior
Adding a category SearchParameter to one ResourceType does not affect existing/default SearchParameters for other ResourceTypes

Actual behavior
After adding a category SearchParameter for MedicationDispense, the default category SearchParameters for other ResourceTypes like Observation/Consent etc. are no longer supported until fhir-server is restarted.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions