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

toString()'s return value for non-primitive type does not align with function signature

    XMLWordPrintableJSON

Details

    • Icon: Technical Correction Technical Correction
    • Resolution: Persuasive
    • Icon: Medium Medium
    • FHIRPath (FHIR)
    • 1.0
    • Imaging Integration
    • fluentpath
    • 5.5.15
    • Hide

      Agreed, the highlighted text should use quotes on false to indicate the result is the string representation of false.

      Show
      Agreed, the highlighted text should use quotes on false to indicate the result is the string representation of false.
    • Correction
    • Non-substantive

    Description

      The FHIRPath spec states that toString() returns a String. However, the specification states that in certain circumstances the function may return false. I've copied the documentation from http://hl7.org/fhirpath/2018Sep/index.html#tostring-string and colored the portion in red that concerns me. Please clarify the behavior of toString().

       

      5.5.15. toString() : String

      If the input collection contains a single item, this function will return a single String if:

      • the item in the input collection is a String
      • the item in the input collection is an Integer, Decimal, Date, Time, DateTime, or Quantity the output will contain its String representation
      • the item is a Boolean, where true results in 'true' and false in 'false'.
        If the item is not one of the above types, the result is false.
        The String representation uses the following formats:
        Type Representation
        Boolean true or false
        Integer (\\+|-)?\d+
        Decimal (\\+|-)?\d+(.\d+)?
        Quantity (\\+|-)?\d+(.\d+)? '<unit>'
        Date YYYY-MM-DD
        DateTime YYYY-MM-DDThh:mm:ss.fff(+/-)hh:mm
        Time Thh:mm:ss.fff(+/-)hh:mm

        Note that for partial dates and times, the result will only be specified to the level of precision in the value being converted.
        If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
        In all other cases, the function will return an empty collection.

      Attachments

        Activity

          People

            Unassigned Unassigned
            anash Aaron Nash (Inactive)
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: