Uploaded image for project: 'Specification'
  1. SPEC-237

Correct semantics of Quantity and Date/Time types

    Details

    • Type: Change Request
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 1.0.1
    • Component/s: openehr.rm.data_types
    • Labels:
      None
    • Change Description:
      Hide
      The changes are the following:
        * add the class DV_AMOUNT to model relative amounts (most quantities); include
          the + and - operations
        * add the class DV_ABSOLUTE_QUANTITY to model amounts that a absolute points
          on a line with an origin (date/times, but not Duration); include the operations
          add, subtract and diff
        * collapse DV_MEASURED and DV_QUANTITY into DV_MEASURED
        * remove DV_QUANTITIED.diff_type (this simplifies the implementation of the
          date/time types)
        * remove DV_CUSTOMARY_QUANTITY (this type was originally designed to handle
          customary quantities like stone/lb/oz, yard/foot/inch etc etc; it is still a
          sensible inclusion in the model, except that we have never needed to use it
          for this purpose. We also historically modelled time as a subtype due to
          y/m/d and h/m/s - which are in fact customary unit systems - but as it turns
          out, date/times are not real 'amounts' anyway, and I don't know if modelling
          them as customary quantities is that useful)
        * change the inheritance of DV_DURATION to be from DV_ABSOLUTE_QUANTITY
        * change the inheritance of DV_DATE, DV_TIME and DV_DATE_TME to be from DV_AMOUNT
      Show
      The changes are the following:   * add the class DV_AMOUNT to model relative amounts (most quantities); include     the + and - operations   * add the class DV_ABSOLUTE_QUANTITY to model amounts that a absolute points     on a line with an origin (date/times, but not Duration); include the operations     add, subtract and diff   * collapse DV_MEASURED and DV_QUANTITY into DV_MEASURED   * remove DV_QUANTITIED.diff_type (this simplifies the implementation of the     date/time types)   * remove DV_CUSTOMARY_QUANTITY (this type was originally designed to handle     customary quantities like stone/lb/oz, yard/foot/inch etc etc; it is still a     sensible inclusion in the model, except that we have never needed to use it     for this purpose. We also historically modelled time as a subtype due to     y/m/d and h/m/s - which are in fact customary unit systems - but as it turns     out, date/times are not real 'amounts' anyway, and I don't know if modelling     them as customary quantities is that useful)   * change the inheritance of DV_DURATION to be from DV_ABSOLUTE_QUANTITY   * change the inheritance of DV_DATE, DV_TIME and DV_DATE_TME to be from DV_AMOUNT
    • Approved By:
      PG

      Description

      Currently there are some anomalies in the Quantity package. The current package
      does not properly distinguish between date/time/datetime and other kinds of
      quantities. Date/times are not 'amounts', so the + and - operators should not be
      defined.

      On an 'amount', the + and - operators are defined as in normal maths,
      i.e. stuff + more stuff = stuff and stuff - some stuff = less stuff.
      No matter what you do, you only have one type of stuff - like a lump of clay
      that you pull apart and stick together.

      Date/times on the other hand (but not durations) are 'offsets' from an origin,
      and + and - don't make sense (you can't add two dates, two times, or two
      date/times; you can subtract them, but you don't end up with the same kind,
      you get a duration).

      The general nature of the change needed is therefore to properly distinguish
      'normal' quantities from Date, Time and Date/Time. This will simplify the model
      and software implementations based on it, while losing no semantics.

        Attachments

          Activity

            People

            • Assignee:
              OLDthomasbeale JeffJ
              Reporter:
              OLDthomasbeale JeffJ
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: