Skip to content
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

Token search with case-insensitive code system failing when common_token_value_id for system+code previously stored with case-sensitive code #2308

Closed
kmbarton423 opened this issue Apr 30, 2021 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@kmbarton423
Copy link
Contributor

In my local Eclipse environment, pulled the latest changes to FHIR main and rebuilt.
Ran FHIR Integration Tests ... 9 of them failed.
All were specific to token search where you specify both system and code and the system is case-insensitive and the code does not match its normalized code value (i.e. code contains uppercase characters)

Expected all tests to pass.

@kmbarton423 kmbarton423 added the bug Something isn't working label Apr 30, 2021
@kmbarton423
Copy link
Contributor Author

failingTests

@d0roppe
Copy link
Collaborator

d0roppe commented May 1, 2021

This only happens if there is already data in the DB, with a new Derby DB this does not reproduce.

@michaelwschroeder michaelwschroeder added this to the Sprint 2021-06 milestone May 3, 2021
@michaelwschroeder michaelwschroeder changed the title subset of token search failing Token search with case-insensitive code system failing when system+code previously cached as case-sensitive May 3, 2021
@michaelwschroeder michaelwschroeder changed the title Token search with case-insensitive code system failing when system+code previously cached as case-sensitive Token search with case-insensitive code system failing when common_token_value_id for system+code previously stored with case-sensitive code May 3, 2021
@michaelwschroeder
Copy link
Contributor

If a token value which specifies a case-insensitive code system and a code which contains uppercase characters has been indexed prior to changes made for issue #1551 and stored in the common_token_values table, then on a subsequent resource creation and search specifying the same system+code after the 1551 changes, the resource will not get returned as a match, even though it should. This is due to a bug in how the common_token_value_id is being retrieved - it should be trying to retrieve based on the normalized code value for a case-insensitive code system, but it is using the code value unmodified. This results in the wrong common_token_value_id being used in the search query, thus no match.

michaelwschroeder added a commit that referenced this issue May 11, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 11, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue May 11, 2021
Issue #2308 - fix retrieval of commonTokenValueId from cache
@kmbarton423
Copy link
Contributor Author

Ran the following to confirm behavior:

  1. create a code system which is caseSensitive=true and contains a code that contains uppercase characters
  2. create resource#1 so system+code combo gets stored in common_token_value_id table
  3. update the code system to caseSensitive=false
  4. create resource#2 using same system+code as resource#1
  5. search for all resources using system+code -> found only resource#2
  6. updated resource#1 to trigger reindex
  7. search for all resources using system+code -> found both resource#1 and resource#2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants