Class Quantity

  • All Implemented Interfaces:
    ca.uhn.fhir.model.api.IElement, Serializable, org.hl7.fhir.instance.model.api.IBase, org.hl7.fhir.instance.model.api.IBaseDatatype, org.hl7.fhir.instance.model.api.IBaseElement, org.hl7.fhir.instance.model.api.IBaseHasExtensions, org.hl7.fhir.instance.model.api.ICompositeType
    Direct Known Subclasses:
    Age, Count, Distance, Duration, Money, SimpleQuantity

    public class Quantity
    extends Type
    implements org.hl7.fhir.instance.model.api.ICompositeType
    A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are not precisely quantified, including amounts involving arbitrary units and floating currencies.
    See Also:
    Serialized Form
    • Field Detail

      • value

        protected DecimalType value
        The value of the measured amount. The value includes an implicit precision in the presentation of the value.
      • comparator

        protected Enumeration<Quantity.QuantityComparator> comparator
        How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
      • system

        protected UriType system
        The identification of the system that provides the coded form of the unit.
      • code

        protected CodeType code
        A computer processable form of the unit in some unit representation system.
    • Method Detail

      • getValueElement

        public DecimalType getValueElement()
        Returns:
        value (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
      • setValueElement

        public Quantity setValueElement​(DecimalType value)
        Parameters:
        value - value (The value of the measured amount. The value includes an implicit precision in the presentation of the value.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
      • getValue

        public BigDecimal getValue()
        Returns:
        The value of the measured amount. The value includes an implicit precision in the presentation of the value.
      • setValue

        public Quantity setValue​(BigDecimal value)
        Parameters:
        value - The value of the measured amount. The value includes an implicit precision in the presentation of the value.
      • setValue

        public Quantity setValue​(long value)
        Parameters:
        value - The value of the measured amount. The value includes an implicit precision in the presentation of the value.
      • setValue

        public Quantity setValue​(double value)
        Parameters:
        value - The value of the measured amount. The value includes an implicit precision in the presentation of the value.
      • getComparatorElement

        public Enumeration<Quantity.QuantityComparatorgetComparatorElement()
        Returns:
        comparator (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value
      • setComparatorElement

        public Quantity setComparatorElement​(Enumeration<Quantity.QuantityComparator> value)
        Parameters:
        value - comparator (How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value
      • getComparator

        public Quantity.QuantityComparator getComparator()
        Returns:
        How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
      • setComparator

        public Quantity setComparator​(Quantity.QuantityComparator value)
        Parameters:
        value - How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value.
      • getUnitElement

        public StringType getUnitElement()
        Returns:
        unit (A human-readable form of the unit.). This is the underlying object with id, value and extensions. The accessor "getUnit" gives direct access to the value
      • hasUnit

        public boolean hasUnit()
      • setUnitElement

        public Quantity setUnitElement​(StringType value)
        Parameters:
        value - unit (A human-readable form of the unit.). This is the underlying object with id, value and extensions. The accessor "getUnit" gives direct access to the value
      • getUnit

        public String getUnit()
        Returns:
        A human-readable form of the unit.
      • setUnit

        public Quantity setUnit​(String value)
        Parameters:
        value - A human-readable form of the unit.
      • getSystemElement

        public UriType getSystemElement()
        Returns:
        system (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
      • setSystemElement

        public Quantity setSystemElement​(UriType value)
        Parameters:
        value - system (The identification of the system that provides the coded form of the unit.). This is the underlying object with id, value and extensions. The accessor "getSystem" gives direct access to the value
      • getSystem

        public String getSystem()
        Returns:
        The identification of the system that provides the coded form of the unit.
      • setSystem

        public Quantity setSystem​(String value)
        Parameters:
        value - The identification of the system that provides the coded form of the unit.
      • getCodeElement

        public CodeType getCodeElement()
        Returns:
        code (A computer processable form of the unit in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
      • hasCode

        public boolean hasCode()
      • setCodeElement

        public Quantity setCodeElement​(CodeType value)
        Parameters:
        value - code (A computer processable form of the unit in some unit representation system.). This is the underlying object with id, value and extensions. The accessor "getCode" gives direct access to the value
      • getCode

        public String getCode()
        Returns:
        A computer processable form of the unit in some unit representation system.
      • setCode

        public Quantity setCode​(String value)
        Parameters:
        value - A computer processable form of the unit in some unit representation system.
      • getProperty

        public Base[] getProperty​(int hash,
                                  String name,
                                  boolean checkValid)
                           throws org.hl7.fhir.exceptions.FHIRException
        Overrides:
        getProperty in class Element
        Throws:
        org.hl7.fhir.exceptions.FHIRException
      • addChild

        public Base addChild​(String name)
                      throws org.hl7.fhir.exceptions.FHIRException
        Overrides:
        addChild in class Element
        Throws:
        org.hl7.fhir.exceptions.FHIRException
      • fhirType

        public String fhirType()
        Specified by:
        fhirType in interface org.hl7.fhir.instance.model.api.IBase
        Overrides:
        fhirType in class Element
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface org.hl7.fhir.instance.model.api.IBase
        Overrides:
        isEmpty in class Element