Is your feature request related to a problem? Please describe.
If a compartment inclusion criteria search parameter is specified in the fhirServer/resources/<resourceType>/searchParameterCombinations list to limit search scope (i.e. patient or performer), then that parameter must be specified on a compartment search even though the compartment search already scopes the query to that search parameter. In addition, the search parameter will be specified twice in the generated SQL.
Example:
fhir-server-config.json specifies the patient search parameter in its fhirServer/resources/<resourceType>/searchParameterCombinations list for the Procedure resource type:
It will fail because the patient search parameter was not specified, even though the compartment search already scopes the search to a single Patient.
The following compartment search is performed:
Patient/17575/Procedure?patient=Patient/17575
It will correctly return the Patient's Procedure resources, but the patient search parameter has to be unnecessarily specified, and the generated SQL will contain functionally duplicate WHERE clauses to scope the results to a single Patient.
Describe the solution you'd like
Provide a way for the user to configure valid search parameter combinations for compartment searches in the fhirServer/resources/<resourceType>/searchParameterCombinations config property using a custom format. One suggested format is the following:
For example, if a user wanted to allow Procedure searches on the Patient compartment where the code and status search parameters were valid for the Procedure search, they could specify the following in the fhir-server-config.json file:
Describe alternatives you've considered
See issue #1707 for possible alternatives considered.
Acceptance Criteria
At least one acceptance criteria is included.
GIVEN a compartment search parameter combination is configured for a particular compartment
WHEN a compartment search is executed with that parameter combination
THEN all valid resources are returned
GIVEN no compartment search parameter combination is configured for a particular compartment
WHEN a compartment search is executed for that compartment
THEN the search request fails
GIVEN a compartment search parameter combination is configured for a particular compartment
WHEN a compartment search is executed for that compartment, but with the wrong parameter combination
THEN the search request fails
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe. If a compartment inclusion criteria search parameter is specified in the
fhirServer/resources/<resourceType>/searchParameterCombinations
list to limit search scope (i.e.patient
orperformer
), then that parameter must be specified on a compartment search even though the compartment search already scopes the query to that search parameter. In addition, the search parameter will be specified twice in the generated SQL.Example:
fhir-server-config.json specifies the patient search parameter in its
fhirServer/resources/<resourceType>/searchParameterCombinations
list for the Procedure resource type:The following compartment search is performed:
It will fail because the patient search parameter was not specified, even though the compartment search already scopes the search to a single Patient.
The following compartment search is performed:
It will correctly return the Patient's Procedure resources, but the patient search parameter has to be unnecessarily specified, and the generated SQL will contain functionally duplicate WHERE clauses to scope the results to a single Patient.
Describe the solution you'd like Provide a way for the user to configure valid search parameter combinations for compartment searches in the
fhirServer/resources/<resourceType>/searchParameterCombinations
config property using a custom format. One suggested format is the following:For example, if a user wanted to allow Procedure searches on the Patient compartment where the
code
andstatus
search parameters were valid for the Procedure search, they could specify the following in the fhir-server-config.json file:This would allow the following search request:
Describe alternatives you've considered See issue #1707 for possible alternatives considered.
Acceptance Criteria At least one acceptance criteria is included.
GIVEN a compartment search parameter combination is configured for a particular compartment WHEN a compartment search is executed with that parameter combination THEN all valid resources are returned
GIVEN no compartment search parameter combination is configured for a particular compartment WHEN a compartment search is executed for that compartment THEN the search request fails
GIVEN a compartment search parameter combination is configured for a particular compartment WHEN a compartment search is executed for that compartment, but with the wrong parameter combination THEN the search request fails
Additional context Add any other context or screenshots about the feature request here.