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:
  • 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.
    • 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()
    • 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()
      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()
    • 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()
      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> childrenList)
      Overrides:
      listChildren in class Element
    • setProperty

      public void setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
      Overrides:
      setProperty 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
    • 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