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 Details

    • Dose

      public Dose(@Nullable AmountQuantity quantity, @Nullable AmountQuantity low, @Nullable AmountQuantity high)
      Constructor.
      Parameters:
      quantity - The amount quantity or null if using a range.
      low - The low amount quantity or null.
      high - The high amount quantity or null.
  • Method Details

    • isRange

      public boolean isRange()
    • isQuantity

      public boolean isQuantity()
    • fromDosageDoseAndRateComponent

      public static Dose fromDosageDoseAndRateComponent(org.hl7.fhir.r4.model.Dosage.DosageDoseAndRateComponent doseAndRate)
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • quantity

      public @Nullable AmountQuantity quantity()
      Returns the value of the quantity record component.
      Returns:
      the value of the quantity record component
    • low

      public @Nullable AmountQuantity low()
      Returns the value of the low record component.
      Returns:
      the value of the low record component
    • high

      public @Nullable AmountQuantity high()
      Returns the value of the high record component.
      Returns:
      the value of the high record component