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, ICoding
Direct Known Subclasses:
Age, Count, Distance, Duration, MoneyQuantity, SimpleQuantity

public class Quantity extends Type implements org.hl7.fhir.instance.model.api.ICompositeType, ICoding
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:
  • Field Details

    • value

      protected DecimalType value
      The value of the measured amount. The value includes an implicit precision in the presentation of the 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 "invalid input: '<'" , then the real value is invalid input: '<' stated value.
    • unit

      protected StringType unit
      A human-readable form of the unit.
    • 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.
  • Constructor Details

  • Method Details

    • 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
    • hasValueElement

      public boolean hasValueElement()
    • hasValue

      public boolean hasValue()
    • setValueElement

      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

      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 "invalid input: '<'" , then the real value is invalid input: '<' stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value
    • hasComparatorElement

      public boolean hasComparatorElement()
    • hasComparator

      public boolean hasComparator()
    • setComparatorElement

      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 "invalid input: '<'" , then the real value is invalid input: '<' stated value.). This is the underlying object with id, value and extensions. The accessor "getComparator" gives direct access to the value
    • 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 "invalid input: '<'" , then the real value is invalid input: '<' stated value.
    • setComparator

      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 "invalid input: '<'" , then the real value is invalid input: '<' stated value.
    • 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
    • hasUnitElement

      public boolean hasUnitElement()
    • hasUnit

      public boolean hasUnit()
    • setUnitElement

      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

      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
    • hasSystemElement

      public boolean hasSystemElement()
    • hasSystem

      public boolean hasSystem()
      Specified by:
      hasSystem in interface ICoding
    • setSystemElement

      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()
      Specified by:
      getSystem in interface ICoding
      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

      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
    • hasCodeElement

      public boolean hasCodeElement()
    • hasCode

      public boolean hasCode()
      Specified by:
      hasCode in interface ICoding
    • setCodeElement

      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()
      Specified by:
      getCode in interface ICoding
      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.
    • listChildren

      protected void listChildren(List<Property> children)
      Overrides:
      listChildren in class Element
    • getNamedProperty

      public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      getNamedProperty in class Element
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • 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
    • setProperty

      public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      setProperty in class Element
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • setProperty

      public Base setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      setProperty in class Element
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • removeChild

      public void removeChild(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      removeChild in class Element
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • makeProperty

      public Base makeProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      makeProperty in class Element
      Throws:
      org.hl7.fhir.exceptions.FHIRException
    • getTypesForProperty

      public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      getTypesForProperty 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
    • copy

      public Quantity copy()
      Overrides:
      copy in class Type
    • copyValues

      public void copyValues(Quantity dst)
    • typedCopy

      protected Quantity typedCopy()
      Specified by:
      typedCopy in class Type
    • equalsDeep

      public boolean equalsDeep(Base other_)
      Overrides:
      equalsDeep in class Element
    • equalsShallow

      public boolean equalsShallow(Base other_)
      Overrides:
      equalsShallow in class Element
    • isEmpty

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

      public String getVersion()
      Specified by:
      getVersion in interface ICoding
    • hasVersion

      public boolean hasVersion()
      Specified by:
      hasVersion in interface ICoding
    • supportsVersion

      public boolean supportsVersion()
      Specified by:
      supportsVersion in interface ICoding
    • getDisplay

      public String getDisplay()
      Specified by:
      getDisplay in interface ICoding
    • hasDisplay

      public boolean hasDisplay()
      Specified by:
      hasDisplay in interface ICoding
    • supportsDisplay

      public boolean supportsDisplay()
      Specified by:
      supportsDisplay in interface ICoding
    • fromUcum

      public static Quantity fromUcum(String v, String code)