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

Clarify tuple equality when tuples have values for different elements

    XMLWordPrintableJSON

Details

    • Icon: Change Request Change Request
    • Resolution: Persuasive with Modification
    • Icon: Medium Medium
    • Clinical Quality Language (FHIR)
    • 1.5 [deprecated]
    • Clinical Decision Support
    • Authors Guide
      Logical Specification
      Appendix B - Reference
    • Hide

      Based on implementation feedback, we should clarify that the intent is that tuple equality is a defined as conjunction of equality comparison of elements, so:

      { Id: 1, Name: null }

      =

      { Id: 2, Name: null }

      // false

      { Id: null, Name: 'John' }

      =

      { Id: null, Name: 'Joe' }

      // false

      { Id: null, Name: 'John' }

      =

      { Id: 1, Name: 'Joe' }

      // false

      { Id: 2, Name: 'John' }

      =

      { Id: 1, Name: null }

      // false

      { Id: 1, Name: 'John' }

      =

      { Id: 1, Name: null }

      // null

      { Id: 1, Name: 'John' }

      =

      { Id: null, Name 'John' }

      // null

      Show
      Based on implementation feedback, we should clarify that the intent is that tuple equality is a defined as conjunction of equality comparison of elements, so: { Id: 1, Name: null } = { Id: 2, Name: null } // false { Id: null, Name: 'John' } = { Id: null, Name: 'Joe' } // false { Id: null, Name: 'John' } = { Id: 1, Name: 'Joe' } // false { Id: 2, Name: 'John' } = { Id: 1, Name: null } // false { Id: 1, Name: 'John' } = { Id: 1, Name: null } // null { Id: 1, Name: 'John' } = { Id: null, Name 'John' } // null
    • Clarification
    • Non-substantive

    Description

      Current language for tuple type equality states:

      For tuple types, this means that equality returns true if and only if the tuples are of the same type, and the values for all elements that have values, by name, are equal.

      The intent of the phrase "that have values" is to ensure that comparison isn't impacted by elements where both sides do not have a value, but also that if one side has a value and the other doesn't, the result is null.

      The last aspect may not be clear to all readers, so we should clarify that by adding the sentence "If one tuple has a value for an element is not present in the other tuple, the result is null"

      That sentence needs to be added to the Equal discussion in the reference, the author's guide, and the logical specification, as well as the actual ELM schema.

      In addition, in the Author's Guide, add an example illustrating the case:

      { X: 1, Y: 1 }

      =

      { X: 1, Y: null }

      // Returns false

      And this example expression should be added to the examples in the Reference and Logical specification.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bryn.rhodes Bryn Rhodes
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: