Package org.hl7.fhir.r4.model
Class Quantity
- java.lang.Object
-
- org.hl7.fhir.r4.model.Base
-
- org.hl7.fhir.r4.model.Element
-
- org.hl7.fhir.r4.model.Type
-
- org.hl7.fhir.r4.model.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classQuantity.QuantityComparatorstatic classQuantity.QuantityComparatorEnumFactory
-
Field Summary
Fields Modifier and Type Field Description protected CodeTypecodeA computer processable form of the unit in some unit representation system.protected Enumeration<Quantity.QuantityComparator>comparatorHow 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.protected UriTypesystemThe identification of the system that provides the coded form of the unit.protected StringTypeunitA human-readable form of the unit.protected DecimalTypevalueThe value of the measured amount.
-
Constructor Summary
Constructors Constructor Description Quantity()ConstructorQuantity(double theValue)Convenience constructorQuantity(long theValue)Convenience constructorQuantity(Quantity.QuantityComparator theComparator, double theValue, String theSystem, String theCode, String theUnit)Convenience constructorQuantity(Quantity.QuantityComparator theComparator, long theValue, String theSystem, String theCode, String theUnit)Convenience constructor
-
Method Summary
-
Methods inherited from class org.hl7.fhir.r4.model.Element
addExtension, addExtension, addExtension, copyValues, getExtension, getExtensionByUrl, getExtensionFirstRep, getExtensionsByUrl, getExtensionString, getId, getIdBase, getIdElement, hasExtension, hasExtension, hasId, hasIdElement, isDisallowExtensions, noExtensions, removeExtension, setDisallowExtensions, setExtension, setId, setIdBase, setIdElement
-
Methods inherited from class org.hl7.fhir.r4.model.Base
castToAddress, castToAnnotation, castToAttachment, castToBase64Binary, castToBoolean, castToCanonical, castToCode, castToCodeableConcept, castToCoding, castToContactDetail, castToContactPoint, castToContributor, castToDataRequirement, castToDate, castToDateTime, castToDecimal, castToDosage, castToDuration, castToElementDefinition, castToExpression, castToExtension, castToHumanName, castToId, castToIdentifier, castToInstant, castToInteger, castToMarkdown, castToMarketingStatus, castToMeta, castToMoney, castToNarrative, castToOid, castToParameterDefinition, castToPeriod, castToPopulation, castToPositiveInt, castToProdCharacteristic, castToProductShelfLife, castToQuantity, castToRange, castToRatio, castToReference, castToRelatedArtifact, castToResource, castToSampledData, castToSignature, castToSimpleQuantity, castToString, castToSubstanceAmount, castToTime, castToTiming, castToTriggerDefinition, castToType, castToUnsignedInt, castToUri, castToUrl, castToUsageContext, castToXhtml, castToXhtmlString, children, clearUserData, compareDeep, compareDeep, compareDeep, compareDeep, compareValues, compareValues, dateTimeValue, equals, getChildByName, getFormatCommentsPost, getFormatCommentsPre, getNamedProperty, getUserData, getUserInt, getUserString, hasFormatComment, hasPrimitiveValue, hasType, hasUserData, isBooleanPrimitive, isDateTime, isMetadataBased, isPrimitive, isResource, listChildrenByName, listChildrenByName, primitiveValue, setUserData, setUserDataINN
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
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.
-
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.
-
-
Constructor Detail
-
Quantity
public Quantity()
Constructor
-
Quantity
public Quantity(Quantity.QuantityComparator theComparator, double theValue, String theSystem, String theCode, String theUnit)
Convenience constructor- Parameters:
theComparator- ThecomparatortheValue- ThevaluetheSystem- ThesetSystem(String)(the code system for the units}theCode- ThesetCode(String)(the code for the units}theUnit- ThesetUnit(String)(the human readable display name for the units}
-
Quantity
public Quantity(Quantity.QuantityComparator theComparator, long theValue, String theSystem, String theCode, String theUnit)
Convenience constructor- Parameters:
theComparator- ThecomparatortheValue- ThevaluetheSystem- ThesetSystem(String)(the code system for the units}theCode- ThesetCode(String)(the code for the units}theUnit- ThesetUnit(String)(the human readable display name for the units}
-
-
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
-
hasValueElement
public boolean hasValueElement()
-
hasValue
public boolean hasValue()
-
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.QuantityComparator> 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 "<" , 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
-
hasComparatorElement
public boolean hasComparatorElement()
-
hasComparator
public boolean hasComparator()
-
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
-
hasUnitElement
public boolean hasUnitElement()
-
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
-
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
-
hasSystemElement
public boolean hasSystemElement()
-
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
-
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
-
hasCodeElement
public boolean hasCodeElement()
-
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
-
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:
listChildrenin classElement
-
getNamedProperty
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getNamedPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getProperty
public Base[] getProperty(int hash, String name, boolean checkValid) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
setProperty
public Base setProperty(int hash, String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
setProperty
public Base setProperty(String name, Base value) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
setPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
makeProperty
public Base makeProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
makePropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getTypesForProperty
public String[] getTypesForProperty(int hash, String name) throws org.hl7.fhir.exceptions.FHIRException
- Overrides:
getTypesForPropertyin classElement- Throws:
org.hl7.fhir.exceptions.FHIRException
-
copyValues
public void copyValues(Quantity dst)
-
equalsDeep
public boolean equalsDeep(Base other_)
- Overrides:
equalsDeepin classElement
-
equalsShallow
public boolean equalsShallow(Base other_)
- Overrides:
equalsShallowin classElement
-
isEmpty
public boolean isEmpty()
-
getVersion
public String getVersion()
- Specified by:
getVersionin interfaceICoding
-
hasVersion
public boolean hasVersion()
- Specified by:
hasVersionin interfaceICoding
-
supportsVersion
public boolean supportsVersion()
- Specified by:
supportsVersionin interfaceICoding
-
getDisplay
public String getDisplay()
- Specified by:
getDisplayin interfaceICoding
-
hasDisplay
public boolean hasDisplay()
- Specified by:
hasDisplayin interfaceICoding
-
supportsDisplay
public boolean supportsDisplay()
- Specified by:
supportsDisplayin interfaceICoding
-
-