-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract compartment search parameters regardless of search parameter configuration #1777
Comments
When we do this one, we should deprecate the |
Investigation: what is the current behavior? |
I confirmed that we do not extract the ibm-internal-Patient-compartment parameter if the corresponding |
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In the previous commit, we started extracting all compartment inclusion criteria search parameters, even in cases where they are filtered out via config. Although the filtered out parameters would not be searchable, we were still storing these non-searchable parameter values in the db (once with the inclusion criteria name and once with the corresponding ibm-internal-x-compartment search parameter name). This commit updates the search extraction implementation to avoid storing these intermediate inclusion criteria parameters to the db. To accomplish this, we now: 1. Add a DO_NOT_STORE extension on the intermediate search parameters that are used to extract compartment membership information prior to collecting those values for the ibm-internal-x-compartment search params 2. Propagate that information to the ExtractedParameterValues 3. Filter out parameter values that are not for storage before computing the extract search parameters hash and returning ExtractedSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In the previous commit, we started extracting all compartment inclusion criteria search parameters, even in cases where they are filtered out via config. Although the filtered out parameters would not be searchable, we were still storing these non-searchable parameter values in the db (once with the inclusion criteria name and once with the corresponding ibm-internal-x-compartment search parameter name). This commit updates the search extraction implementation to avoid storing these intermediate inclusion criteria parameters to the db. To accomplish this, we now: 1. Add a DO_NOT_STORE extension on the intermediate search parameters that are used to extract compartment membership information prior to collecting those values for the ibm-internal-x-compartment search params 2. Propagate that information to the ExtractedParameterValues 3. Filter out parameter values that are not for storage before computing the extract search parameters hash and returning ExtractedSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In the previous commit, we started extracting all compartment inclusion criteria search parameters, even in cases where they are filtered out via config. Although the filtered out parameters would not be searchable, we were still storing these non-searchable parameter values in the db (once with the inclusion criteria name and once with the corresponding ibm-internal-x-compartment search parameter name). This commit updates the search extraction implementation to avoid storing these intermediate inclusion criteria parameters to the db. To accomplish this, we now: 1. Add a DO_NOT_STORE extension on the intermediate search parameters that are used to extract compartment membership information prior to collecting those values for the ibm-internal-x-compartment search params 2. Propagate that information to the ExtractedParameterValues 3. Filter out parameter values that are not for storage before computing the extract search parameters hash and returning ExtractedSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In the previous commit, we started extracting all compartment inclusion criteria search parameters, even in cases where they are filtered out via config. Although the filtered out parameters would not be searchable, we were still storing these non-searchable parameter values in the db (once with the inclusion criteria name and once with the corresponding ibm-internal-x-compartment search parameter name). This commit updates the search extraction implementation to avoid storing these intermediate inclusion criteria parameters to the db. To accomplish this, we now: 1. Add a DO_NOT_STORE extension on the intermediate search parameters that are used to extract compartment membership information prior to collecting those values for the ibm-internal-x-compartment search params 2. Propagate that information to the ExtractedParameterValues 3. Filter out parameter values that are not for storage before computing the extract search parameters hash and returning ExtractedSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In the previous commit, we started extracting all compartment inclusion criteria search parameters, even in cases where they are filtered out via config. Although the filtered out parameters would not be searchable, we were still storing these non-searchable parameter values in the db (once with the inclusion criteria name and once with the corresponding ibm-internal-x-compartment search parameter name). This commit updates the search extraction implementation to avoid storing these intermediate inclusion criteria parameters to the db. To accomplish this, we now: 1. Add a DO_NOT_STORE extension on the intermediate search parameters that are used to extract compartment membership information prior to collecting those values for the ibm-internal-x-compartment search params 2. Propagate that information to the ExtractedParameterValues 3. Filter out parameter values that are not for storage before computing the extract search parameters hash and returning ExtractedSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
In the previous commit, we started extracting all compartment inclusion criteria search parameters, even in cases where they are filtered out via config. Although the filtered out parameters would not be searchable, we were still storing these non-searchable parameter values in the db (once with the inclusion criteria name and once with the corresponding ibm-internal-x-compartment search parameter name). This commit updates the search extraction implementation to avoid storing these intermediate inclusion criteria parameters to the db. To accomplish this, we now: 1. Add a DO_NOT_STORE extension on the intermediate search parameters that are used to extract compartment membership information prior to collecting those values for the ibm-internal-x-compartment search params 2. Propagate that information to the ExtractedParameterValues 3. Filter out parameter values that are not for storage before computing the extract search parameters hash and returning ExtractedSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
1. added simple unit tests for the new ParametersMap behavior 2. added single e2e test to SearchTest to cover the case where the compartment inclusion criteria parameter is filtered out in the config Also, we now add the DO_NOT_STORE extension from SearchUtil instead of as the parameters are added to the ParametersMap Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
issue #1777 - extract compartment inclusion params even when filtered
Verified issue with 2 different compartments. closing issue |
Is your feature request related to a problem? Please describe.
If compartment inclusion criteria search parameters are not specified in the
fhirServer/resources/<resourceType>/searchParameters
list for a given resource type, then the new generated compartment search token (if thefhirServer/search/useStoredCompartmentParam
value is set to true - see issue #1708) or the tokens for the inclusion criteria search parameters, are not created/stored at resource create/update time, and thus that resource will not get returned on a compartment search as it should.Example:
fhir-server-config.json only specifies _id and _lastUpdated as valid search parameters for the Procedure resource type, not the patient and performer inclusion criteria search parameters:
A Procedure resource is created which contains the following Patient reference, meaning it should be associated with that Patient compartment:
However, the Patient compartment inclusion criteria search parameters for the Procedure resource type,
patient
andperformer
, are not in thefhirServer/resources/<resourceType>/searchParameters
list, so are not considered valid search parameters. This means the generated compartment search token (if enabled) or the inclusion criteria search tokens will not be created and indexed when the Procedure resource is stored.The following compartment search is performed:
The Procedure created in step 2 will not be returned in the search results because the necessary compartment search token(s), which are what's used in the compartment search SQL, were not created and indexed.
Describe the solution you'd like
When extracting compartment inclusion criteria search parameters for a resource when persisting the resource, we should assume the search parameters are valid rather than checking them against the configured search parameters for the tenant, which might not have included the compartment inclusion criteria search parameters. Then when validating search parameters on a compartment search request, again, we should not validate the compartment inclusion criteria search parameters against the configured search parameters for the tenant, but instead assume they are valid.
Describe alternatives you've considered
See issue #1707 for alternatives considered.
Acceptance Criteria
At least one acceptance criteria is included.
1.
GIVEN the compartment inclusion criteria search parameters for a resource type are not configured as valid search parameters
WHEN a compartment search against the resource type is executed
THEN all valid resources are returned
2.
GIVEN the compartment inclusion criteria search parameters for a resource type are not configured as valid search parameters
WHEN a standard search against the resource type is executed which contains one of the inclusion criteria search parameters
THEN an error will be returned indicating the search parameter is not valid for the given resource type
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: