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 boolean
Indicates whether some other object is "equal to" this one.static Dose
fromDosageDoseAndRateComponent
(org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent doseAndRate) final int
hashCode()
Returns a hash code value for this object.@Nullable AmountQuantity
high()
Returns the value of thehigh
record component.boolean
boolean
isRange()
@Nullable AmountQuantity
low()
Returns the value of thelow
record component.@Nullable AmountQuantity
quantity()
Returns the value of thequantity
record component.final String
toString()
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 ornull
if 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 thequantity
record component.- Returns:
- the value of the
quantity
record component
-
low
Returns the value of thelow
record component.- Returns:
- the value of the
low
record component
-
high
Returns the value of thehigh
record component.- Returns:
- the value of the
high
record component
-