Class EMediplanMedicament<E extends EMediplanObject>
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanMedicament<E>
- Type Parameters:
E- The type of extension object.
- All Implemented Interfaces:
EMediplanExtendable<E>,EMediplanObject
- Direct Known Subclasses:
ChMed16AMedicament,ChMed23AMedicament
public abstract class EMediplanMedicament<E extends EMediplanObject>
extends Object
implements EMediplanExtendable<E>
A base class for an eMediplan medicament object.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidforbidSubstitution(@Nullable Boolean selfMedication) abstract StringgetId()protected abstract Stringabstract MedicamentIdTypeprotected abstract Stringabstract @Nullable Doubleabstract @Nullable Stringabstract @Nullable Stringabstract booleanabstract booleanResolves the actual number of packages, taking into account that the default is 1 if the actual number is not specified.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.validate(@Nullable String basePath, EMediplanType mediplanType) Context-aware validation, that takes into account whether the eMediplan document is a treatment plan or a prescription.protected ValidationResultvalidateBase(@Nullable String basePath, boolean contextAwareCaller) 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
-
DEFAULT_NUMBER_OF_PACKAGES
-
-
Constructor Details
-
EMediplanMedicament
public EMediplanMedicament()
-
-
Method Details
-
getId
-
getIdType
-
getReason
-
getPrescriber
-
getNumberOfPackages
-
getIdFieldName
-
getIdTypeFieldName
-
isSelfMedication
-
isSubstitutionForbidden
public abstract boolean isSubstitutionForbidden() -
forbidSubstitution
-
resolveNumberOfPackages
Resolves the actual number of packages, taking into account that the default is 1 if the actual number is not specified.Note that it makes no sense to call this method in the context of a medication plan, since this is purely a prescription and dispense matter. A call to this method in the context of a medication plan will still yield a number (by default, 1), because this method is not context-aware.
- Returns:
- The number of packages to be delivered when redeeming the prescription.
-
validateBase
- Parameters:
basePath- The object's JSON path.contextAwareCaller- Whether the method was called from a basic object validation (i.e.validate(String)) or with context (i.e.validate(String, EMediplanType)). This allows avoiding redundant checks, if the context-aware caller will also invoke children validation that are context-aware, thus the basic validator will skip those.- Returns:
- The validation result.
-
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
Context-aware validation, that takes into account whether the eMediplan document is a treatment plan or a prescription.- Parameters:
basePath- The object's JSON path.mediplanType- The eMediplan document type.- 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
-