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

Quantity search does not consider the quantity comparator field #493

Closed
prb112 opened this issue Dec 9, 2019 · 3 comments
Closed

Quantity search does not consider the quantity comparator field #493

prb112 opened this issue Dec 9, 2019 · 3 comments
Assignees
Labels
reindex Resolution of issue will require a $reindex during upgrade search

Comments

@prb112
Copy link
Contributor

prb112 commented Dec 9, 2019

The FHIR Quantity datatype can contain a comparator field which modifies the meaning of the value of the quantity. However, this comparator is not written into the FHIR search tables and is never considered during search.

For example, we currently have 3 values in the quantity parameters table: Number, LowNumber, and HighNumber. To support implicit precision, LowNumber and HighNumber would always need to be filled out (where the LowNumber is inclusive and the HighNumber is exclusive).

To support comparators, we would need to null either the low or the high as appropriate. Additionally, we would need some kind of indicator to denote whether the high and low are inclusive or exclusive.

How do the comparators relate to the implicit precision range? For example, if a value is 3 with a > comparator, does that mean we should really handle that like >2.5?
No. Based on my reading of https://build.fhir.org/search.html#prefix, quantities with comparators should be handled with bounds which match the explicit value with infinite precision...there is implicit range in these cases.

#245

@prb112 prb112 added the search label Dec 9, 2019
@lmsurpre
Copy link
Member

lmsurpre commented Dec 9, 2019

Impl tips:

  • on extraction, update JDBCParameterBuildingVisitor to either store the comparator or to infer the proper range values (visitQuantity AND visitRange)
  • on search, update JDBCNormalizedQueryBuilder to query the quantity value as either a Value or a Range
  • look at the tests in AbstractSearchQuantityTest

@michaelwschroeder michaelwschroeder self-assigned this May 5, 2021
@michaelwschroeder michaelwschroeder added the reindex Resolution of issue will require a $reindex during upgrade label May 13, 2021
@prb112 prb112 added this to the Sprint 2021-07 milestone May 14, 2021
michaelwschroeder added a commit that referenced this issue May 21, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
@michaelwschroeder
Copy link
Contributor

issue493Design.docx

michaelwschroeder added a commit that referenced this issue May 21, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Jun 1, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Jun 1, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Jun 1, 2021
Signed-off-by: Mike Schroeder <mschroed@us.ibm.com>
michaelwschroeder added a commit that referenced this issue Jun 7, 2021
Issue #493 - consider comparators for Quantity data types
@kmbarton423
Copy link
Contributor

Tested new functionality with ResearchDefinition element "useContext" and search parm "context-quantity".
Confirmed search behavior using all prefixes for resources configured with each type of comparator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reindex Resolution of issue will require a $reindex during upgrade search
Projects
None yet
Development

No branches or pull requests

4 participants