Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Search based on dates not working #129

Closed
PrimKruskal opened this issue Oct 28, 2020 · 4 comments
Closed

Search based on dates not working #129

PrimKruskal opened this issue Oct 28, 2020 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@PrimKruskal
Copy link

Search based on birthDate on patient api is not working and it is returning zero results even though date are available.

{{API_URL}}/Patient?birthdate=1987-02-20 or {{API_URL}}/Patient?birthDate=1987-02-20

image

@rsmayda rsmayda added bug Something isn't working help wanted Extra attention is needed labels Oct 28, 2020
@rsmayda
Copy link
Contributor

rsmayda commented Oct 28, 2020

Confirmed

Reproducible:

  1. post this Patient: https://www.hl7.org/fhir/patient-example.json
  2. search {{API_URL}}/Patient?birthDate=1974-12-25

Some ideas:

  • Perhaps elastic search requires some sort of format for searching on a date type

Next steps:

  • see how to search on it via Kibana

image

@SanketD92
Copy link
Contributor

@PrimKruskal Thanks for bringing up this issue, and @rsmayda for the prompt confirmation.

We're creating a backlog task for this to be prioritized into one of our upcoming sprints.

@lwarren01
Copy link

lwarren01 commented Apr 1, 2021

Any status update you might be able to provide here? We were also able to reproduce the issue. We were wondering if it has to do with the name of the field. The search parameter and the field name stored in ES don't match, "birthdate" vs. "birthDate". Looking at the ES query, we can see that it is providing the name of the search parameter:

GET patient/_search { "query": { "bool": { "must": [ { "query_string": { "query": "1985-08-23", "fields": [ "birthdate.*^1.0" ], "type": "best_fields", "default_operator": "and", "max_determinized_states": 10000, "enable_position_increments": true, "fuzziness": "AUTO", "fuzzy_prefix_length": 0, "fuzzy_max_expansions": 50, "phrase_slop": 0, "lenient": true, "escape": false, "auto_generate_synonyms_phrase_query": true, "fuzzy_transpositions": true, "boost": 1 } } ], "filter": [ { "match": { "documentStatus": { "query": "AVAILABLE", "operator": "OR", "prefix_length": 0, "max_expansions": 50, "fuzzy_transpositions": true, "lenient": false, "zero_terms_query": "NONE", "auto_generate_synonyms_phrase_query": true, "boost": 1 } } } ], "adjust_pure_negative": true, "boost": 1 } } }

@rsmayda
Copy link
Contributor

rsmayda commented Apr 12, 2021

In our most recent release we fixed a lot of date related search issues: https://github.com/awslabs/fhir-works-on-aws-deployment/tree/v2.6.0

Could you ensure you are using the latest versions? If issues persist please reopen this issue 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants