-
Notifications
You must be signed in to change notification settings - Fork 157
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
Provide the ability to retrieve a set of COMMON_TOKEN_VALUE_IDs in one request #2184
Comments
the new QueryBuilder has support for handling an "in list" of common token values, so it will already handle conversion between |
Added * getCommonTokenValueIds to JDBCIdentityCache * resolveCommonTokenValueIds to ICommonTokenValuesCache * readCommonTokenValueIds to ResourceReferenceDAO And updated SearchQueryRenderer to use this mechanism in two cases: Needs testing and perhaps customizations in ResourceReferenceDAO subclasses for specific Dbs. Also includes some code for variations I was playing with...that all needs to get cleaned up now. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* the derby-specific readCommonTokenValueId implementation replaces the `(VALUES (?,value1), (?,value2), ...` construct with a temporary table--following the same pattern used for upsertCommonTokenValues. * removed dead code from getReferenceFilter; we had code to handle query parameters of type reference which had modifiers that we don't actually support for reference parameters * removed commented-out code in from populateCodesSubSegment; I convinced myself that we can use the common_token_values table for both the IN and NOT-IN cases. * removed stale getCommonTokenValueIds code / alternate implementations * reordered field names and select statements to follow the convention of existing methods (value, system, id)--personally I prefer (system,code) to (code,system) but I opted for consistency with the current codebase * added defensive code to return an empty set of CommonTokenValueResult if passed an empty Collection of CommonTokenValue Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* the derby-specific readCommonTokenValueId implementation replaces the `(VALUES (?,value1), (?,value2), ...` construct with a temporary table--following the same pattern used for upsertCommonTokenValues. * removed dead code from getReferenceFilter; we had code to handle query parameters of type reference which had modifiers that we don't actually support for reference parameters * removed commented-out code in from populateCodesSubSegment; I convinced myself that we can use the common_token_values table for both the IN and NOT-IN cases. * removed stale getCommonTokenValueIds code / alternate implementations * reordered field names and select statements to follow the convention of existing methods (value, system, id)--personally I prefer (system,code) to (code,system) but I opted for consistency with the current codebase * added defensive code to return an empty set of CommonTokenValueResult if passed an empty Collection of CommonTokenValue Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
readCommonTokenValueId Because the table is not cleared until the entire transaction is committed/rolled back, we can't be sure that the only values in this table are the ones that we added specifically for the current search. For example, consider transaction bundle cases. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
Added * getCommonTokenValueIds to JDBCIdentityCache * resolveCommonTokenValueIds to ICommonTokenValuesCache * readCommonTokenValueIds to ResourceReferenceDAO And updated SearchQueryRenderer to use this mechanism in two cases: Needs testing and perhaps customizations in ResourceReferenceDAO subclasses for specific Dbs. Also includes some code for variations I was playing with...that all needs to get cleaned up now. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* the derby-specific readCommonTokenValueId implementation replaces the `(VALUES (?,value1), (?,value2), ...` construct with a temporary table--following the same pattern used for upsertCommonTokenValues. * removed dead code from getReferenceFilter; we had code to handle query parameters of type reference which had modifiers that we don't actually support for reference parameters * removed commented-out code in from populateCodesSubSegment; I convinced myself that we can use the common_token_values table for both the IN and NOT-IN cases. * removed stale getCommonTokenValueIds code / alternate implementations * reordered field names and select statements to follow the convention of existing methods (value, system, id)--personally I prefer (system,code) to (code,system) but I opted for consistency with the current codebase * added defensive code to return an empty set of CommonTokenValueResult if passed an empty Collection of CommonTokenValue Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
readCommonTokenValueId Because the table is not cleared until the entire transaction is committed/rolled back, we can't be sure that the only values in this table are the ones that we added specifically for the current search. For example, consider transaction bundle cases. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* the derby-specific readCommonTokenValueId implementation replaces the `(VALUES (?,value1), (?,value2), ...` construct with a temporary table--following the same pattern used for upsertCommonTokenValues. * removed dead code from getReferenceFilter; we had code to handle query parameters of type reference which had modifiers that we don't actually support for reference parameters * removed commented-out code in from populateCodesSubSegment; I convinced myself that we can use the common_token_values table for both the IN and NOT-IN cases. * removed stale getCommonTokenValueIds code / alternate implementations * reordered field names and select statements to follow the convention of existing methods (value, system, id)--personally I prefer (system,code) to (code,system) but I opted for consistency with the current codebase * added defensive code to return an empty set of CommonTokenValueResult if passed an empty Collection of CommonTokenValue Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
readCommonTokenValueId Because the table is not cleared until the entire transaction is committed/rolled back, we can't be sure that the only values in this table are the ones that we added specifically for the current search. For example, consider transaction bundle cases. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* Favor StringBuilder over String with lots of concatenation * Try using NULL instead of -1 for readCommonTokenValueIds * Add javadoc to CommonTokenValue constructor Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* Favor StringBuilder over String with lots of concatenation * Try using NULL instead of -1 for readCommonTokenValueIds * Add javadoc to CommonTokenValue constructor Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* Favor StringBuilder over String with lots of concatenation * Use literals instead of bind variables for common token value ids * Add javadoc to CommonTokenValue constructor I also tried to use NULL instead of -1 for cases where there are no common token values, but our database utils (BaseWhereAdapter) doesn't seem to support that at the moment--it only supports this for bind variables. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* Favor StringBuilder over String with lots of concatenation * Use literals instead of bind variables for common token value ids * Add javadoc to CommonTokenValue constructor I also tried to use NULL instead of -1 for cases where there are no common token values, but our database utils (BaseWhereAdapter) doesn't seem to support that at the moment--it only supports this for bind variables. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
* Favor StringBuilder over String with lots of concatenation * Use literals instead of bind variables for common token value ids * Add javadoc to CommonTokenValue constructor I also tried to use NULL instead of -1 for cases where there are no common token values, but our database utils (BaseWhereAdapter) doesn't seem to support that at the moment--it only supports this for bind variables. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
#2684) * issue #2184 - initial attempt at resolveCommonTokenValueIds Added * getCommonTokenValueIds to JDBCIdentityCache * resolveCommonTokenValueIds to ICommonTokenValuesCache * readCommonTokenValueIds to ResourceReferenceDAO And updated SearchQueryRenderer to use this mechanism in two cases: Needs testing and perhaps customizations in ResourceReferenceDAO subclasses for specific Dbs. Also includes some code for variations I was playing with...that all needs to get cleaned up now. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * issue #2184 - add derby-specific readCommonTokenValueId and do cleanup * the derby-specific readCommonTokenValueId implementation replaces the `(VALUES (?,value1), (?,value2), ...` construct with a temporary table--following the same pattern used for upsertCommonTokenValues. * removed dead code from getReferenceFilter; we had code to handle query parameters of type reference which had modifiers that we don't actually support for reference parameters * removed commented-out code in from populateCodesSubSegment; I convinced myself that we can use the common_token_values table for both the IN and NOT-IN cases. * removed stale getCommonTokenValueIds code / alternate implementations * reordered field names and select statements to follow the convention of existing methods (value, system, id)--personally I prefer (system,code) to (code,system) but I opted for consistency with the current codebase * added defensive code to return an empty set of CommonTokenValueResult if passed an empty Collection of CommonTokenValue Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * issue #2184 - avoid common_token_values_tmp in derby-specific readCommonTokenValueId Because the table is not cleared until the entire transaction is committed/rolled back, we can't be sure that the only values in this table are the ones that we added specifically for the current search. For example, consider transaction bundle cases. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com> * issue #2184 - address PR feedback * Favor StringBuilder over String with lots of concatenation * Use literals instead of bind variables for common token value ids * Add javadoc to CommonTokenValue constructor I also tried to use NULL instead of -1 for cases where there are no common token values, but our database utils (BaseWhereAdapter) doesn't seem to support that at the moment--it only supports this for bind variables. Signed-off-by: Lee Surprenant <lmsurpre@us.ibm.com>
This issue has been verified. I started with a clean schema and performed a search using an :in modifier:
I then ingested resources which caused some of the values in the value set to be indexed and added to the DB and cache. I reran the search:
I then stopped and restarted the server to clear the cache. I reran the search:
|
additionally I ran a big Patient export and confirmed it completed as expected:
|
Is your feature request related to a problem? Please describe.
We have cases when building queries (processing inclusion criteria, processing :in, :not-in, :above, :below modifiers) where we want to attempt to retrieve COMMON_TOKEN_VALUE_IDs for a list of system+code pairs. It could be prohibitive performance-wise to go to the DB one-at-a-time for each cache miss.
Describe the solution you'd like
Provide a way to retrieve the COMMON_TOKEN_VALUE_IDs for a list of system+code pairs in a single request.
Describe alternatives you've considered
Acceptance Criteria
1.
GIVEN [a precondition]
AND [another precondition]
WHEN [test step]
AND [test step]
THEN [verification step]
AND [verification step]
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: