java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed23a.repetition.Repetition
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed23a.repetition.RepetitionDuration
All Implemented Interfaces:
DurationBoundRepeatable, EMediplanObject

public class RepetitionDuration extends Repetition implements DurationBoundRepeatable
  • Field Details

  • Constructor Details

    • RepetitionDuration

      public RepetitionDuration()
  • Method Details

    • validate

      public ValidationResult validate(@Nullable String basePath)
      Description copied from interface: EMediplanObject
      Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.
      Specified by:
      validate in interface DurationBoundRepeatable
      Specified by:
      validate in interface EMediplanObject
      Parameters:
      basePath - The JSON path of this object. If null, the object is considered to be root. Any validation issues produced by the validation will use this path as a base for each issue's path.
      Returns:
      The validation result containing all the encountered validation issues, if any.
    • fromFhirPeriod

      public static @Nullable RepetitionDuration fromFhirPeriod(org.hl7.fhir.r4.model.Period period)
      Gets a repetition duration object from a FHIR period, if such a thing would make sense. Note that:
      • Periods shorter than a day will result on a null object.
      • If the period can be rounded to years, without a remainder in months, or to months without a remainder in days, any lesser remainder will be ignored. E.g. if a period is 1 year, 1 month and 2 seconds, it will be rounded to 13 months. If a period is 1 year 0 month and 2 days, it will be rounded to 1 year.
      Parameters:
      period - The FHIR period to be converted to a RepetitionDuration.
      Returns:
      The repetition duration object.