Skip to content

Support for coalesce function #68

@ruscoder

Description

@ruscoder

Implement coalesce function according to the specification

Spec: https://build.fhir.org/ig/HL7/FHIRPath/#coalescevalue--collection-value--collection---collection

It should support variadic number of params

Testing

NOTE: can be put into DSL tests tests/cases/5.2.8_coalesce.yaml

resourceType: Patient
  identifier:
    - system: required-system
      value: required-value
coalesce(Patient.identifier.where(system='required-system').value.first(), 'unknown')

should return {'required-value'}.

coalesce(Patient.identifier.where(system='other-system').value.first(), 'unknown')

should return {'unknown'}.

  1. coalesce({}, (1 | 2), (3 | 4)) should return {1, 2}

  2. coalesce({}, 1) should return {1}

  3. coalesce({}) should return {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions