Uploaded image for project: 'FHIR Specification Feedback'
  1. FHIR Specification Feedback
  2. FHIR-32882

Support for IndexOf and LastIndexOf operators

XMLWordPrintableJSON

    • Icon: Change Request Change Request
    • Resolution: Persuasive
    • Icon: Medium Medium
    • FHIRPath (FHIR)
    • 1.0 [deprecated]
    • Implementable Technology Specifications
    • documentation
    • Hide

      Add .indexOf operation as documented in CQL:

      https://cql.hl7.org/09-b-cqlreference.html#indexof

      With the addition of an optional "from" parameter that indicates the starting index in the list for the search (0 is the same as not providing the parameter). (NOTE: Also add this parameter to CQL)

      Add .lastIndexOf operation to support searching from the reverse (and includes the optional parameter "from", (ending index (count - 1) is the same as not providing the parameter)). (NOTE: Also add this function to CQL)

      Show
      Add .indexOf operation as documented in CQL: https://cql.hl7.org/09-b-cqlreference.html#indexof With the addition of an optional "from" parameter that indicates the starting index in the list for the search (0 is the same as not providing the parameter). (NOTE: Also add this parameter to CQL) Add .lastIndexOf operation to support searching from the reverse (and includes the optional parameter "from", (ending index (count - 1) is the same as not providing the parameter)). (NOTE: Also add this function to CQL)
    • Paul Knapp/Jeff Brown: 3-0-0
    • Enhancement
    • Compatible, substantive

      The specification does not define indexOf() or lastIndexOf() functions.

      There is a workaround:

       

      Practitioner.telecom.select(iff(value='5551212', $index, { }))

      {{}}

      See the Zulip chat here for discussion: https://chat.fhir.org/#narrow/stream/179266-fhirpath/topic/Finding.20index.20of.20element.20using.20FP.3F{{}}

            brian.postlethwaite Brian Postlethwaite
            bryn.rhodes Bryn Rhodes
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: