Skip to content

OR conditions not supported with comparator #815

Open
@hansenms

Description

@hansenms

Describe the bug

It is not possible to search for dates with comparators, e.g. to exclude a date range.

To Reproduce
Steps to reproduce the behavior:

  1. Spin up FHIR server, load synthea data
  2. Search /Patient?birthdate=ge1980-01-01,lt1970-01-01, i.e. not the 70s.
  3. Returns:
    {
    "resourceType": "OperationOutcome",
    "id": "88972a44-e8f0-4773-97b4-b6780c2f5bff",
    "issue": [
        {
            "severity": "error",
            "code": "forbidden",
            "diagnostics": "Comparator is not supported when multiple values are specified using OR search parameter."
        }
    ]
    }
    

Expected behavior

Should return all patients not born in the 70s.

Actual behavior

Rejects search.

Additional information

HAPI does not support this:

GET http://hapi.fhir.org/baseR4/Patient?birthdate=ge1980-01-01,lt1970-01-01

returns:

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>DateRange parameter does not suppport OR queries</pre></td>\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "DateRange parameter does not suppport OR queries"
    }
  ]
}

Vonk supports this search:

GET https://vonk.fire.ly/Patient?birthdate=ge1980-01-01,lt1970-01-01

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-SearchArea related to search.Up for grabsThe issue require minimal context and is well-suited for new contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions