Interface EMediplanObject

All Known Subinterfaces:
DurationBoundRepeatable, NumberBoundRepeatable
All Known Implementing Classes:
Application, ApplicationAtTime, ApplicationInSegment, CyclicDosage, DailyDosage, DaySegmentsDosage, DaysOfMonthDosage, DosageSequenceElement, DoseOnlyDosage, EmbeddableTimedDosage, EMediplan, EMediplanDose, EMediplanExtension, EMediplanHealthcareOrganization, EMediplanHealthcarePerson, EMediplanMedicament, EMediplanPatient, EMediplanPatientId, EMediplanPatientMedicalData, EMediplanPosology, EMediplanPostalAddress, EMediplanRisk, EMediplanRiskList, FreeTextDosage, IntervalDosage, IntervalDose, Pause, PosologyDetail, PreciseTimesDosage, RangeDose, Repetition, RepetitionDuration, RepetitionNumber, RepetitionNumberAndDuration, SequenceDosage, SequenceElement, SimpleDose, SingleDosage, TimedDosage, WeekDaysDosage

public interface EMediplanObject
Abstraction of an eMediplan (JSON) object. Declares common methods to all eMediplan objects and provides a default implementation for some of them.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    getFieldValidationPath(@Nullable String basePath, String field)
    Convenience method to get a specific field's validation path, that is, the path to be used to produce a ValidationIssue.
    default String
    getFieldValidationPath(@Nullable String basePath, String field, int index)
    Convenience method to get a specific field's validation path when the field is actually an element of a list/array.
    Convenience method to get a validation issue of severity OperationOutcome.IssueSeverity.WARNING and type OperationOutcome.IssueType.INVALID with the specified issue path and message.
    Convenience method to get a validation issue of severity OperationOutcome.IssueSeverity.ERROR and type OperationOutcome.IssueType.REQUIRED with the specified issue path and message.
    getValidationIssue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String path, String message)
    Convenience method to produce a validation issue by providing only severity, type, path and message.
    default void
    Trims the eMediplan object, that is, removes any redundant info and sets to null values that match the default assumed value by the specs, to shorten the serialized result.
    Validates the eMediplan object, without any further context than its own content, against the eMediplan specs.
    validate(@Nullable String basePath)
    Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.
  • Method Details

    • trim

      default void trim()
      Trims the eMediplan object, that is, removes any redundant info and sets to null values that match the default assumed value by the specs, to shorten the serialized result.
    • validate

      default ValidationResult validate()
      Validates the eMediplan object, without any further context than its own content, against the eMediplan specs.
      Returns:
      The validation result containing all the encountered validation issues, if any.
    • validate

      ValidationResult validate(@Nullable String basePath)
      Validates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.
      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.
    • getRequiredFieldValidationIssue

      default ValidationIssue getRequiredFieldValidationIssue(String path, String message)
      Convenience method to get a validation issue of severity OperationOutcome.IssueSeverity.ERROR and type OperationOutcome.IssueType.REQUIRED with the specified issue path and message. This issue is to be used for eMediplan mandatory fields/objects that are however missing within the object being validated.
      Parameters:
      path - The path of the issue. Where the issue was encountered.
      message - The message describing the issue.
      Returns:
      The produced validation issue.
    • getValidationIssue

      default ValidationIssue getValidationIssue(org.hl7.fhir.r4.model.OperationOutcome.IssueSeverity severity, org.hl7.fhir.r4.model.OperationOutcome.IssueType type, String path, String message)
      Convenience method to produce a validation issue by providing only severity, type, path and message.
      Parameters:
      severity - The severity of the issue.
      type - The type of issue.
      path - The path of the issue. Where the issue was encountered.
      message - The message describing the issue.
      Returns:
      The produced validation issue.
    • getIgnoredFieldValidationIssue

      default ValidationIssue getIgnoredFieldValidationIssue(String path, String message)
      Convenience method to get a validation issue of severity OperationOutcome.IssueSeverity.WARNING and type OperationOutcome.IssueType.INVALID with the specified issue path and message. This issue is to be produced when a field is specified by the eMediplan specification not to be provided and to be ignored if encountered (on the specified conditions).
      Parameters:
      path - The path of the issue. Where the issue was encountered.
      message - The message describing the issue.
      Returns:
      The produced validation issue.
    • getFieldValidationPath

      default String getFieldValidationPath(@Nullable String basePath, String field)
      Convenience method to get a specific field's validation path, that is, the path to be used to produce a ValidationIssue.
      Parameters:
      basePath - The base path of the object being validated and containing the field triggering the validation issue.
      field - The name of the field triggering the validation issue.
      Returns:
      The path for the specified field within the specified object as to be used for a validation issue.
    • getFieldValidationPath

      default String getFieldValidationPath(@Nullable String basePath, String field, int index)
      Convenience method to get a specific field's validation path when the field is actually an element of a list/array. For instance, if the element failing to pass validation is the value 1 within the JSON {"mylist": [1, 2]} ; then this method can be called as getFieldValidationPath(null, "mylist", 0) to get a path for this element to be used to produce a validation issue.
      Parameters:
      basePath - The base path of the object being validated and containing the field triggering the validation issue.
      field - The name of the field triggering the validation issue.
      index - The index of the list/array element that failed to pass validation.
      Returns:
      The resulting field validation path.