Class EMediplanPatientMedicalData<E extends EMediplanObject>

java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanPatientMedicalData<E>
All Implemented Interfaces:
EMediplanExtendable<E>, EMediplanObject
Direct Known Subclasses:
ChMed16APatientMedicalData, ChMed23APatientMedicalData

public abstract class EMediplanPatientMedicalData<E extends EMediplanObject> extends Object implements EMediplanExtendable<E>
  • Field Details

    • TIME_OF_GESTATION_PATTERN

      public static final Pattern TIME_OF_GESTATION_PATTERN
  • Constructor Details

    • EMediplanPatientMedicalData

      public EMediplanPatientMedicalData()
  • Method Details

    • getLastMenstruation

      public abstract @Nullable LocalDate getLastMenstruation()
    • getTimeOfGestation

      public abstract @Nullable String getTimeOfGestation()
    • getRisks

      public abstract List<@NonNull EMediplanRiskList> getRisks()
    • isPrematureBaby

      public abstract @Nullable Boolean isPrematureBaby()
      Whether the patient is a premature baby or not. Take into account that calling this method makes sense only when the age of the patient is lesser or equal than 18 months, but this method does not perform any such checks and will return the result solely based on the content of the underlying property.
      Returns:
      • true if the eMediplan document explicitly declares the baby to be premature
      • false if the eMediplan document explicitly declares the baby not to be premature
      • null otherwise
      • invalid input: '<'/ul
    • getPrematureBabyFieldName

      protected abstract String getPrematureBabyFieldName()
    • getTimeOfGestationFieldName

      protected abstract String getTimeOfGestationFieldName()
    • getLastMenstruationFieldName

      protected abstract String getLastMenstruationFieldName()
    • 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 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.
    • validate

      public ValidationResult validate(@Nullable String basePath, @Nullable Period age)
      Performs context-aware validation of the object, including the base context-unaware validation.
      Parameters:
      basePath - The object's JSON path.
      age - The age of the patient at the time of the document creation.
      Returns:
      The validation result.
    • trim

      public void trim()
      Description copied from interface: EMediplanObject
      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.
      Specified by:
      trim in interface EMediplanExtendable<E extends EMediplanObject>
      Specified by:
      trim in interface EMediplanObject
    • addRisk

      @ExpectsValidResource public void addRisk(EMediplanRisk risk)
      Convenience method to add a risk to a medical data object. It will search for the appropriate list per category to which to append the new risk and, if the category does not exist in the list, it creates it.
      Parameters:
      risk - The risk to be added to the lists of risks.