Skip to content

Date search on Observation fails: cannot determine FHIR type of Observation.effective #2914

Done

Description

@piotrszul

Observation?date=... fails with InvalidSearchParameterException: Cannot determine FHIR type for expression: Observation.effective, thrown when the column is built, for both date=2020 and date=ge2020-01-01; nothing fails earlier.

The date search parameter's expression includes Observation.effective, a choice element (dateTime, Period, Timing, instant). SearchColumnBuilder.buildExpressionFilter takes one FHIR type from the evaluated collection and fails when there is none, which is the case for an unresolved choice.

Expected. The search evaluates each choice alternative that the parameter type allows (dateTime, instant, Period) and combines them with OR, as it already does for the expressions of a parameter.

Depends on the rule chosen in #2913 (skip or fail on an alternative the parameter type does not allow): evaluating each alternative reaches the same "not valid for search parameter type" check for other alternatives, and for Observation the rejected one is Timing: the date parameter type allows date, dateTime, instant and Period only, although R4 lists Timing as a date-search target, so leaving it out is itself a gap. The string, Age and Range alternatives belong to Procedure.performed[x] and Immunization.occurrence[x].

Scope. Choice elements in search parameter expressions. Other date expressions that are choice elements: DiagnosticReport.effective[x], Immunization.occurrence[x] and Procedure.performed[x]. A test through the default registry.

Also present in v10.0.0. Related: #1986 (Support for FHIR Search API queries).

Activity

  1. added
    bug
    PoF_line
    Bunsen_line
    on Nov 16, 2026
  2. moved this to Planned in Pathlingon Nov 17, 2026
  3. added theissue type on Nov 23, 2026
  4. moved this from Planned to Done in Pathlingon Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bunsen_linePoF_linebug

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions