Class QuantityDt

java.lang.Object
ca.uhn.fhir.model.api.BaseElement
ca.uhn.fhir.model.api.BaseIdentifiableElement
ca.uhn.fhir.model.base.composite.BaseQuantityDt
ca.uhn.fhir.model.dstu3.composite.QuantityDt
All Implemented Interfaces:
ca.uhn.fhir.model.api.ICompositeDatatype, ca.uhn.fhir.model.api.ICompositeElement, ca.uhn.fhir.model.api.IDatatype, ca.uhn.fhir.model.api.IElement, ca.uhn.fhir.model.api.IIdentifiableElement, ca.uhn.fhir.model.api.IQueryParameterType, ca.uhn.fhir.model.api.ISupportsUndeclaredExtensions, Serializable, org.hl7.fhir.instance.model.api.IBase, org.hl7.fhir.instance.model.api.IBaseDatatype, org.hl7.fhir.instance.model.api.ICompositeType
Direct Known Subclasses:
AgeDt, CountDt, DistanceDt, DurationDt, MoneyDt, SimpleQuantityDt

public class QuantityDt extends ca.uhn.fhir.model.base.composite.BaseQuantityDt implements ca.uhn.fhir.model.api.ICompositeDatatype
HAPI/FHIR QuantityDt Datatype ()

Definition: 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

Requirements: Need to able to capture all sorts of measured values, even if the measured value are not precisely quantified. Values include exact measures such as 3.51g, customary units such as 3 tablets, and currencies such as $100.32USD

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
    QuantityDt(double theValue)
    Constructor
    QuantityDt(long theValue)
    Constructor
    QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, double theValue, String theUnits)
    Constructor
    QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, double theValue, String theSystem, String theUnits)
    Constructor
    QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, long theValue, String theUnits)
    Constructor
    QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, long theValue, String theSystem, String theUnits)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    <T extends ca.uhn.fhir.model.api.IElement>
    List<T>
     
    Gets the value(s) for code ().
    ca.uhn.fhir.model.primitive.CodeDt
    Gets the value(s) for code ().
    Gets the value(s) for comparator ().
    ca.uhn.fhir.model.primitive.BoundCodeDt<ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum>
    Gets the value(s) for comparator ().
    Gets the value(s) for system ().
    ca.uhn.fhir.model.primitive.UriDt
    Gets the value(s) for system ().
    Gets the value(s) for unit ().
    ca.uhn.fhir.model.primitive.StringDt
    Gets the value(s) for unit ().
    ca.uhn.fhir.model.primitive.StringDt
    Deprecated.
    Use getUnitElement() - Quantity.units was renamed to Quantity.unit in DSTU2
    Gets the value(s) for value ().
    ca.uhn.fhir.model.primitive.DecimalDt
    Gets the value(s) for value ().
    boolean
     
    setCode(ca.uhn.fhir.model.primitive.CodeDt theValue)
    Sets the value(s) for code ()
    setCode(String theCode)
    Sets the value for code ()
    setComparator(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theValue)
    Sets the value(s) for comparator ()
    setComparator(ca.uhn.fhir.model.primitive.BoundCodeDt<ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum> theValue)
    Sets the value(s) for comparator ()
    setSystem(ca.uhn.fhir.model.primitive.UriDt theValue)
    Sets the value(s) for system ()
    setSystem(String theUri)
    Sets the value for system ()
    setUnit(ca.uhn.fhir.model.primitive.StringDt theValue)
    Sets the value(s) for unit ()
    setUnit(String theString)
    Sets the value for unit ()
    ca.uhn.fhir.model.base.composite.BaseQuantityDt
    setUnits(String theString)
    Deprecated.
    Use setUnit(String) instead - Quantity.units was renamed to Quantity.unit in DSTU2
    setValue(double theValue)
    Sets the value for value ()
    setValue(long theValue)
    Sets the value for value ()
    setValue(ca.uhn.fhir.model.primitive.DecimalDt theValue)
    Sets the value(s) for value ()
    setValue(BigDecimal theValue)
    Sets the value for value ()

    Methods inherited from class ca.uhn.fhir.model.base.composite.BaseQuantityDt

    getMissing, getQueryParameterQualifier, getValueAsQueryToken, setMissing, setValueAsQueryToken

    Methods inherited from class ca.uhn.fhir.model.api.BaseIdentifiableElement

    getElementSpecificId, getId, setElementSpecificId, setId, setId

    Methods inherited from class ca.uhn.fhir.model.api.BaseElement

    addUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, getUserData, hasFormatComment, isBaseEmpty, setUserData

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.hl7.fhir.instance.model.api.IBase

    fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
  • Constructor Details

    • QuantityDt

      public QuantityDt()
      Constructor
    • QuantityDt

      public QuantityDt(double theValue)
      Constructor
    • QuantityDt

      public QuantityDt(long theValue)
      Constructor
    • QuantityDt

      public QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, double theValue, String theUnits)
      Constructor
    • QuantityDt

      public QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, long theValue, String theUnits)
      Constructor
    • QuantityDt

      public QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, double theValue, String theSystem, String theUnits)
      Constructor
    • QuantityDt

      public QuantityDt(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theComparator, long theValue, String theSystem, String theUnits)
      Constructor
  • Method Details

    • setUnits

      @Deprecated public ca.uhn.fhir.model.base.composite.BaseQuantityDt setUnits(String theString)
      Deprecated.
      Use setUnit(String) instead - Quantity.units was renamed to Quantity.unit in DSTU2
      Specified by:
      setUnits in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getUnitsElement

      @Deprecated public ca.uhn.fhir.model.primitive.StringDt getUnitsElement()
      Deprecated.
      Use getUnitElement() - Quantity.units was renamed to Quantity.unit in DSTU2
      Specified by:
      getUnitsElement in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface org.hl7.fhir.instance.model.api.IBase
    • getAllPopulatedChildElementsOfType

      public <T extends ca.uhn.fhir.model.api.IElement> List<T> getAllPopulatedChildElementsOfType(Class<T> theType)
      Specified by:
      getAllPopulatedChildElementsOfType in interface ca.uhn.fhir.model.api.ICompositeElement
    • getValueElement

      public ca.uhn.fhir.model.primitive.DecimalDt getValueElement()
      Gets the value(s) for value (). creating it if it does not exist. Will not return null.

      Definition: The value of the measured amount. The value includes an implicit precision in the presentation of the value

      Specified by:
      getValueElement in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getValue

      public BigDecimal getValue()
      Gets the value(s) for value (). creating it if it does not exist. Will not return null.

      Definition: The value of the measured amount. The value includes an implicit precision in the presentation of the value

    • setValue

      public QuantityDt setValue(ca.uhn.fhir.model.primitive.DecimalDt theValue)
      Sets the value(s) for value ()

      Definition: The value of the measured amount. The value includes an implicit precision in the presentation of the value

    • setValue

      public QuantityDt setValue(long theValue)
      Sets the value for value ()

      Definition: The value of the measured amount. The value includes an implicit precision in the presentation of the value

    • setValue

      public QuantityDt setValue(double theValue)
      Sets the value for value ()

      Definition: The value of the measured amount. The value includes an implicit precision in the presentation of the value

    • setValue

      public QuantityDt setValue(BigDecimal theValue)
      Sets the value for value ()

      Definition: The value of the measured amount. The value includes an implicit precision in the presentation of the value

      Specified by:
      setValue in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getComparatorElement

      public ca.uhn.fhir.model.primitive.BoundCodeDt<ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum> getComparatorElement()
      Gets the value(s) for comparator (). creating it if it does not exist. Will not return null.

      Definition: 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

      Specified by:
      getComparatorElement in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getComparator

      public String getComparator()
      Gets the value(s) for comparator (). creating it if it does not exist. Will not return null.

      Definition: 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 QuantityDt setComparator(ca.uhn.fhir.model.primitive.BoundCodeDt<ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum> theValue)
      Sets the value(s) for comparator ()

      Definition: 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 QuantityDt setComparator(ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum theValue)
      Sets the value(s) for comparator ()

      Definition: 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 ca.uhn.fhir.model.primitive.StringDt getUnitElement()
      Gets the value(s) for unit (). creating it if it does not exist. Will not return null.

      Definition: A human-readable form of the unit

    • getUnit

      public String getUnit()
      Gets the value(s) for unit (). creating it if it does not exist. Will not return null.

      Definition: A human-readable form of the unit

    • setUnit

      public QuantityDt setUnit(ca.uhn.fhir.model.primitive.StringDt theValue)
      Sets the value(s) for unit ()

      Definition: A human-readable form of the unit

    • setUnit

      public QuantityDt setUnit(String theString)
      Sets the value for unit ()

      Definition: A human-readable form of the unit

    • getSystemElement

      public ca.uhn.fhir.model.primitive.UriDt getSystemElement()
      Gets the value(s) for system (). creating it if it does not exist. Will not return null.

      Definition: The identification of the system that provides the coded form of the unit

      Specified by:
      getSystemElement in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getSystem

      public String getSystem()
      Gets the value(s) for system (). creating it if it does not exist. Will not return null.

      Definition: The identification of the system that provides the coded form of the unit

    • setSystem

      public QuantityDt setSystem(ca.uhn.fhir.model.primitive.UriDt theValue)
      Sets the value(s) for system ()

      Definition: The identification of the system that provides the coded form of the unit

    • setSystem

      public QuantityDt setSystem(String theUri)
      Sets the value for system ()

      Definition: The identification of the system that provides the coded form of the unit

      Specified by:
      setSystem in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getCodeElement

      public ca.uhn.fhir.model.primitive.CodeDt getCodeElement()
      Gets the value(s) for code (). creating it if it does not exist. Will not return null.

      Definition: A computer processable form of the unit in some unit representation system

      Specified by:
      getCodeElement in class ca.uhn.fhir.model.base.composite.BaseQuantityDt
    • getCode

      public String getCode()
      Gets the value(s) for code (). creating it if it does not exist. Will not return null.

      Definition: A computer processable form of the unit in some unit representation system

    • setCode

      public QuantityDt setCode(ca.uhn.fhir.model.primitive.CodeDt theValue)
      Sets the value(s) for code ()

      Definition: A computer processable form of the unit in some unit representation system

    • setCode

      public QuantityDt setCode(String theCode)
      Sets the value for code ()

      Definition: A computer processable form of the unit in some unit representation system

      Specified by:
      setCode in class ca.uhn.fhir.model.base.composite.BaseQuantityDt