Record Class Dose
java.lang.Object
java.lang.Record
org.projecthusky.fhir.emed.ch.epr.model.common.Dose
public record Dose(@Nullable AmountQuantity quantity, @Nullable AmountQuantity low, @Nullable AmountQuantity high)
extends Record
A medication dose, either as an amount or as a range. The range may only contain a low or high value.
- Author:
- Quentin Ligier
-
Constructor Summary
ConstructorsConstructorDescriptionDose(@Nullable AmountQuantity quantity, @Nullable AmountQuantity low, @Nullable AmountQuantity high) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static DosefromDosageDoseAndRateComponent(org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent doseAndRate) final inthashCode()Returns a hash code value for this object.@Nullable AmountQuantityhigh()Returns the value of thehighrecord component.booleanbooleanisRange()@Nullable AmountQuantitylow()Returns the value of thelowrecord component.@Nullable AmountQuantityquantity()Returns the value of thequantityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Dose
public Dose(@Nullable AmountQuantity quantity, @Nullable AmountQuantity low, @Nullable AmountQuantity high) Constructor.- Parameters:
quantity- The amount quantity ornullif using a range.low- The low amount quantity ornull.high- The high amount quantity ornull.
-
-
Method Details
-
isRange
public boolean isRange() -
isQuantity
public boolean isQuantity() -
fromDosageDoseAndRateComponent
public static Dose fromDosageDoseAndRateComponent(org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent doseAndRate) -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
quantity
Returns the value of thequantityrecord component.- Returns:
- the value of the
quantityrecord component
-
low
Returns the value of thelowrecord component.- Returns:
- the value of the
lowrecord component
-
high
Returns the value of thehighrecord component.- Returns:
- the value of the
highrecord component
-