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

Bad invariant inv-1 in new RatioRange data type

XMLWordPrintableJSON

    • Icon: Change Request Change Request
    • Resolution: Persuasive
    • Icon: Highest Highest
    • FHIR Core (FHIR)
    • R4B
    • Modeling & Methodology
    • Datatypes
    • Hide

      We agree to make the change to Ratio rat-1 and RatioRange inv-1 (NOTE: both changes have already been pre-applied in R4B).

      We further agree to change the names of the invariants inv-1 and inv-2 to ratrng-1 and ratrng-2.  This change will only be done in R5.

      Show
      We agree to make the change to Ratio rat-1 and RatioRange inv-1 (NOTE: both changes have already been pre-applied in R4B). We further agree to change the names of the invariants inv-1 and inv-2 to ratrng-1 and ratrng-2.  This change will only be done in R5.
    • Jean Duteau / Grahame Grieve: 9-0-0
    • Correction
    • Compatible, substantive
    • R5

      inv-1 has a description of

      "One of lowNumerator or highNumerator and denominator SHALL be present, or all are absent. If all are absent, there SHALL be some extension present"

      and an expression of

      "((lowNumerator.empty() and highNumerator.empty()) xor denominator.exists()) and (lowNumerator.exists() or extension.exists())"

       

      Per the discussion at https://chat.fhir.org/#narrow/stream/179166-implementers/topic/potentially.20bad.20invariant.20in.20RatioRange this expression incorrectly prohibits the case where high and denominator are present (without a low).

       

      Proposed resolution:  in addition to fixing the issue, rewrite the expression for this one AND for the corresponding one from Ratio on which its based (rat-1).

      inv-1 for RatioRange would become: ((low.exists or high.exists) and denom.exists) or (low.empty and high.empty and denom.empty and extension.exists)

      rat-1 for Ratio would become like:  (numerator.exists and denominator.exists) or (numerator.empty and denominator.empty and extension.exists)

       

      Finally, I think the RatioRange invariants should be assigned a better id.  inv-1 and inv-2 seem like the might conflict with other invariants in the future.  I would expect ids like "ratrng-1" and "ratrng-2". Let me know if you'd like a separate issue for that one.

            Unassigned Unassigned
            lmsurprenant Lee Surprenant (Inactive)
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: