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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRisk(EMediplanRisk risk) Convenience method to add a risk to a medical data object.abstract @Nullable LocalDateprotected abstract Stringprotected abstract Stringabstract List<@NonNull EMediplanRiskList> getRisks()abstract @Nullable Stringprotected abstract Stringabstract @Nullable BooleanWhether the patient is a premature baby or not.voidtrim()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 JSON path and its own content, against the eMediplan specs.Performs context-aware validation of the object, including the base context-unaware validation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanExtendable
addExtension, getExtensions, getExtensionsFieldName, validateExtensionsMethods inherited from interface org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanObject
getFieldValidationPath, getFieldValidationPath, getIgnoredFieldValidationIssue, getRequiredFieldValidationIssue, getValidationIssue, hasExtensions, validate
-
Field Details
-
TIME_OF_GESTATION_PATTERN
-
-
Constructor Details
-
EMediplanPatientMedicalData
public EMediplanPatientMedicalData()
-
-
Method Details
-
getLastMenstruation
-
getTimeOfGestation
-
getRisks
-
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:
trueif the eMediplan document explicitly declares the baby to be prematurefalseif the eMediplan document explicitly declares the baby not to be prematurenullotherwise
invalid input: '<'/ul
-
getPrematureBabyFieldName
-
getTimeOfGestationFieldName
-
getLastMenstruationFieldName
-
validate
Description copied from interface:EMediplanObjectValidates the eMediplan object, without any further context than its JSON path and its own content, against the eMediplan specs.- Specified by:
validatein interfaceEMediplanObject- Parameters:
basePath- The JSON path of this object. Ifnull, 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
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:EMediplanObjectTrims 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:
trimin interfaceEMediplanExtendable<E extends EMediplanObject>- Specified by:
trimin interfaceEMediplanObject
-
addRisk
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.
-