-
Notifications
You must be signed in to change notification settings - Fork 156
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
issue #1777 - extract compartment inclusion params even when filtered #3376
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre
commented
Feb 22, 2022
...rsistence-jdbc/src/main/java/com/ibm/fhir/persistence/jdbc/impl/FHIRPersistenceJDBCImpl.java
Show resolved
Hide resolved
lmsurpre
commented
Feb 22, 2022
...rsistence-jdbc/src/main/java/com/ibm/fhir/persistence/jdbc/impl/FHIRPersistenceJDBCImpl.java
Outdated
Show resolved
Hide resolved
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>
tbieste
reviewed
Feb 22, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to add some testcases in some fashion for this.
...rsistence-jdbc/src/main/java/com/ibm/fhir/persistence/jdbc/impl/FHIRPersistenceJDBCImpl.java
Show resolved
Hide resolved
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>
I just added a couple unit tests and an e2e test under SearchTest. See if you think thats adequate or if I should be adding some more. |
Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
lmsurpre
force-pushed
the
issue-1777
branch
5 times, most recently
from
February 23, 2022 15:07
d57c123
to
f585684
Compare
tbieste
reviewed
Feb 23, 2022
fhir-search/src/test/java/com/ibm/fhir/search/parameters/ParametersUtilTest.java
Show resolved
Hide resolved
Currently, if a tenant gets added / fixed it requires a server restart to take effect. With these changes, we'll log a warning and then attempt to compute the missing tenant search parameter config. Its still computed only once, but this should enable better support for dynamically adding new tenants. Additionally, ParametersSearchUtilTest and MultiTenantSearchParameterTest now use an 'extended' tenant to test search-parameter-extensions (instead of 'default') so-as to avoid conflicts with other tests. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
tbieste
approved these changes
Feb 23, 2022
…t wrapper Thankfully I was mistaken in what I was seeing... I was thinking that the initialValue wasn't associated with the current thread (which made no sense) but in reality I was observing sloppy handling of the FHIRRequestContext Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
punktilious
reviewed
Feb 25, 2022
...rsistence-jdbc/src/main/java/com/ibm/fhir/persistence/jdbc/impl/FHIRPersistenceJDBCImpl.java
Outdated
Show resolved
Hide resolved
punktilious
reviewed
Feb 25, 2022
...rsistence-jdbc/src/main/java/com/ibm/fhir/persistence/jdbc/impl/FHIRPersistenceJDBCImpl.java
Show resolved
Hide resolved
punktilious
reviewed
Feb 25, 2022
fhir-search/src/main/java/com/ibm/fhir/search/parameters/ParametersMap.java
Show resolved
Hide resolved
punktilious
reviewed
Feb 25, 2022
fhir-search/src/main/java/com/ibm/fhir/search/parameters/ParametersMap.java
Show resolved
Hide resolved
1. added javadoc for the new ParametersMap methods and removed some of the other unused methods 2. use LinkedList instead of ArrayList in FHIRPersistenceJDBCImpl.extractSearchParameters 3. update warning message in FHIRPersistenceJDBCImpl.extractSearchParameters Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When building our ParametersMaps (e.g. on server start), use CompartmentUtil to get the list of compartment inclusion criteria params (e.g.
patient
for the Observation resourceType on the Patient compartment) and add them to a new Map within ParametersMap (separate from the other search parameters).When extracting search parameter values in SearchUtil, use CompartmentUtil to get the list of compartment inclusion criteria params. For those that aren't configured as external search parameters, add the inclusion parameter from this special map in ParametersMap and add a special DO_NOT_STORE extension to differentiate them from the external search parameters.
When processing the search parameters in FHIRPersistenceJDBCImpl, propagate the DO_NOT_STORE extension into the ExtractedParameterValues via a new "isForStoring" member variable. Then, use CompartmentUtil to get the list of compartment inclusion criteria params one last time and process the corresponding extracted parameter values.
ibm-internal-[x]-compartment
param and add it to the listibm-internal-[x]-compartment
in-place and set isForStoring to trueAdded a quickfix for Clean up use of FHIRRequestContext in unit tests #3283 and also updated corresponding fhir-search tests to debug some failing tests and, eventually, work around a design limitation I found in ParametersUtil (and opened ParametersUtil should be more test-friendly #3385 for that)