Class EMediplanMedicament

java.lang.Object
org.projecthusky.fhir.emed.ch.epr.model.emediplan.EMediplanMedicament
All Implemented Interfaces:
EMediplanExtendable, EMediplanObject

public class EMediplanMedicament extends Object implements EMediplanExtendable, EMediplanObject
Information about a medication as well as its dosage.
  • Field Details

    • ID_FIELD_NAME

      protected static final String ID_FIELD_NAME
      See Also:
    • ID_TYPE_FIELD_NAME

      protected static final String ID_TYPE_FIELD_NAME
      See Also:
    • POSOLOGY_FIELD_NAME

      protected static final String POSOLOGY_FIELD_NAME
      See Also:
    • SELF_MEDICATION_FIELD_NAME

      protected static final String SELF_MEDICATION_FIELD_NAME
      See Also:
    • PRESCRIBER_FIELD_NAME

      protected static final String PRESCRIBER_FIELD_NAME
      See Also:
    • REPETITION_FIELD_NAME

      protected static final String REPETITION_FIELD_NAME
      See Also:
    • SIC_FIELD_NAME

      protected static final String SIC_FIELD_NAME
      See Also:
    • NUMBER_OF_PACKAGES_FIELD_NAME

      protected static final String NUMBER_OF_PACKAGES_FIELD_NAME
      See Also:
    • EXTENSIONS_FIELD_NAME

      protected static final String EXTENSIONS_FIELD_NAME
      See Also:
    • DEFAULT_NUMBER_OF_PACKAGES

      protected static final Double DEFAULT_NUMBER_OF_PACKAGES
    • DEFAULT_REPETITION

      protected static final Repetition DEFAULT_REPETITION
    • id

      protected String id
      The id defined of the type specified by idType. If idType is NONE, then add a free text description here.
    • idType

      protected MedicamentIdType idType
      The type of id.
    • posology

      protected List<@NonNull EMediplanPosology> posology
      List of posologies (dosage information).
    • reason

      protected @Nullable String reason
      Reason for applying the medication, i.e. reason for treatment.
    • selfMedication

      protected @Nullable Boolean selfMedication
      Whether it is self-medication treatment (true) or not (false).
    • prescriber

      protected @Nullable String prescriber
      Prescribed by: the GLN or designation of the prescriber (e.g. physician, pharmacist...).
    • repetition

      protected @Nullable Repetition repetition
      The repetition object indicates how often a prescription can be repeated or how long the prescription is valid.

      If no repetition object is set, a RepetitionDuration is assumed with value 1, that is: the prescription can be repeated once. This means the prescription would be allow to be dispensed twice: the initial dispense that is always allowed plus the one repetition that is assumed by default.

      If the dispense is not to be allowed to be done more than once, it is required to set a repetition object with value 0 (no repetition).

    • forbidSubstitution

      protected @Nullable Boolean forbidSubstitution
      true if the medication should not be substituted, false otherwise. By default, false is assumed.
    • sic

      protected @Nullable Boolean sic
      Sic era scriptum. This field is intended to avoid misunderstandings between the physician and pharmacist and indicates to the pharmacist that the physician has deliberately chosen the prescription and wishes to prescribe the drug in exactly this way and not otherwise. By default, false is assumed.
    • numberOfPackages

      protected @Nullable Double numberOfPackages
      Number of packages to be delivered. By default, 1 is assumed for prescriptions, for medication plans it is ignored.
    • extensions

      protected @Nullable List<@NonNull EMediplanExtension> extensions
      The list of extensions. Optional if empty.
  • Constructor Details

    • EMediplanMedicament

      public EMediplanMedicament()
  • Method Details

    • getExtensions

      public List<@NonNull EMediplanExtension> getExtensions()
      Description copied from interface: EMediplanExtendable
      Gets the list of this object's extensions.
      Specified by:
      getExtensions in interface EMediplanExtendable
      Returns:
      The list of extensions.
    • isSubstitutionForbidden

      public boolean isSubstitutionForbidden()
    • isSic

      public boolean isSic()
    • resolveNumberOfPackages

      public Double resolveNumberOfPackages()
    • isSelfMedication

      @ExpectsValidResource public boolean isSelfMedication()
    • 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.
    • validateBase

      protected ValidationResult validateBase(@Nullable String basePath, boolean contextAwareCaller)
      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:
    • validate

      public ValidationResult validate(@Nullable String basePath, EMediplanType mediplanType)
      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: 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 EMediplanObject