Class ChMed16APosology
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanPosology
org.projecthusky.fhir.emed.ch.epr.model.emediplan.chmed16a.posology.ChMed16APosology
- All Implemented Interfaces:
EMediplanObject
Describes when and what amount of medication must be taken.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected @Nullable IntegerReserve medication. 1 if in reserve, 0 otherwise.protected @Nullable IntegerThe cycle duration (cycle length) for posology in secondsprotected static final Stringprotected @Nullable ChMed16ADailyDosageSimplified version of taking times.static final intprotected @Nullable InstantTo date (end date of medication treatment), Format: YYYY-MM-DD (ISO 8601 Date).protected @Nullable InstantFrom date (start date of medication treatment), Format: YYYY-MM-DD (ISO 8601 Date) (e.g. 2016-01-16)protected static final Stringprotected static final Stringprotected @Nullable List<@NonNull ChMed16ATakingTime> The list of complex taking times (to be used when the simplified dosing schedule (morning, noon, evening, night) cannot be applied).Fields inherited from class org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanPosology
DEFAULT_AS_NEEDED_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<@NonNull ChMed16ATakingTime> booleanhasExtensions(boolean inDepth) Whether the eMediplan object has any extension or not.protected booleanvoidsetAsNeeded(@Nullable Boolean inReserve) 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) Performs validation of the eMediplan object taking into account whether it belongs to an eMediplan medication plan document or to an eMediplan prescription document.Methods inherited from class org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanPosology
getEnd, getStart, isAsNeededMethods 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.EMediplanObject
getFieldValidationPath, getFieldValidationPath, getIgnoredFieldValidationIssue, getRequiredFieldValidationIssue, getValidationIssue, validate
-
Field Details
-
DEFAULT_CYCLE
public static final int DEFAULT_CYCLE- See Also:
-
TAKING_TIMES_FIELD_NAME
- See Also:
-
CYCLE_DURATION_FIELD_NAME
- See Also:
-
START_FIELD_NAME
- See Also:
-
AS_NEEDED_FIELD_NAME
- See Also:
-
start
From date (start date of medication treatment), Format: YYYY-MM-DD (ISO 8601 Date) (e.g. 2016-01-16) -
end
To date (end date of medication treatment), Format: YYYY-MM-DD (ISO 8601 Date). The DtTo must be considered as inclusive. For example DtTo: 2015-05-01, the patient must apply the medicament also on 2015-05-01. -
cycle
The cycle duration (cycle length) for posology in secondsDefault: 86'400 seconds => one day
Will be ignored if TT is not specified -
asNeeded
Reserve medication. 1 if in reserve, 0 otherwise. Default: 0 -
dailyDoses
Simplified version of taking times. Describes the doses to be applied in the morning, at noon, in the evening and at night. Will be ignored if TT is specified -
takingTimes
The list of complex taking times (to be used when the simplified dosing schedule (morning, noon, evening, night) cannot be applied).
-
-
Constructor Details
-
ChMed16APosology
public ChMed16APosology()
-
-
Method Details
-
getTakingTimes
-
isInReserve
protected boolean isInReserve()- Specified by:
isInReservein classEMediplanPosology- Returns:
- Whether the medication is in reserve or not. That is, whether it is to be taken only when needed (true) or strictly as defined by the posology (false).
-
setAsNeeded
- Specified by:
setAsNeededin classEMediplanPosology
-
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- Overrides:
validatein classEMediplanPosology- 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 validation of the eMediplan object taking into account whether it belongs to an eMediplan medication plan document or to an eMediplan prescription document. This performs the base checks ofvalidate(String)plus extra validation checks tied to the eMediplan document type.- Parameters:
basePath- The base path of the object.mediplanType- The type of eMediplan document.- 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. -
hasExtensions
public boolean hasExtensions(boolean inDepth) Description copied from interface:EMediplanObjectWhether the eMediplan object has any extension or not.- Parameters:
inDepth- Iftrue, the called object, and all its children objects, are subject to the check. Iffalse, only the called object is checked for extensions.- Returns:
trueif the object contains any extensions;falseotherwise.
-