View raw Markdown
type: datatypedatatype: Quantity

Quantity

Overview

See also Examples, Detailed Descriptions, Mappings, Profiles and Extensions

A measured amount (or an amount that can potentially be measured).

This datatype can be bound to a ValueSet.

[%dt Quantity 4%]

The value contains the numerical value of the quantity, including an implicit precision. If no comparator is specified, the value is a point value (i.e., '='). The comparator element can never be ignored.

The unit element contains a displayable unit that defines what is measured. The unit may additionally be coded in some formal way using the code and the system (see Coding for further information about how to use the system element).

If the unit can be coded in UCUM and a code is provided, it SHOULD be a UCUM code. If a UCUM unit is provided in the code, then a canonical value can be generated for purposes of comparison between quantities. Note that the unit element will often contain text that is a valid UCUM unit, but it cannot be assumed that the unit actually contains a valid UCUM unit.

If there is a need to convey exceptional values such as Not a Number (NaN), 'trace', 'sufficient quantity', etc., this should be done using a coded data type such as CodeableConcept, drawing on codes from code systems such as Data Absent Reason or Null Flavor, and appropriate extensions exist for this purpose (here and here).

Constraints

[%dt.constraints Quantity%]

The context of use may frequently define what kind of measured quantity this is and therefore what kind of unit can be used. The context of use may additionally require a code from a particular system, or a value set - see Using Terminologies for information about binding a Quantity to a value set to constrain the unit codes. The context of use may also restrict the values for the value or comparator.

[%tx Quantity%]

Quantity is used in the following places: [%dtusage Quantity%]

Defined Variations on Quantity

There are several additional datatypes that are specializations of Quantity that only introduce new restrictions on the existing elements defined as part of the Quantity datatype.

Distance

Type NameRulesFormal Definitions
Distance[%dt.constraints Distance%][%tx Distance%]XML, JSON
Usage: [%dtusage Distance%]
[%impl-note%] If the duration value is specified as a whole number (e.g., 1 month), then when the duration is added or subtracted to a given date(time), the outcome should be rounded to the nearest natural calendar division - e.g., Feb. 1 + 1 mo = March 1, not March 2 or 3 (since 1 month in is defined in UCUM as 30 days). [%end-note%]

Distance

Age[%dt.constraints Age%] [%tx Age%]XML, JSON
Note: Age intentionally carries the semantics of a duration of time during which an organism (or a process) has existed.
Usage: [%dtusage Age%]

Count

Count[%dt.constraints Count%]XML, JSON
Usage: [%dtusage Count%]

Duration

Duration[%dt.constraints Duration%] [%tx Duration%]XML, JSON
Note: Duration intentionally carries the semantics of a length of time.
Usage: [%dtusage Duration%]

In addition to the specializations, there is one constraint on Quantity used in several resources:

Simple Quantity

Profile NameRulesFormal Definitions
Simple Quantity[%dt.constraints SimpleQuantity%]XML, JSON
Usage: [%dtusage SimpleQuantity%]

Note that the constraint is different from the other specializations of Quantity because it is not a type, just rules applied where the Quantity type is used. There's another constraint - see Money immediately below.

Elements

Bindings

Modifiers

Requirements

Comments

Order and Missing Meaning

Mappings