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

public class EMediplan extends Object implements EMediplanExtendable, EMediplanObject
This is the main eMediplan object, called Medication in ChMed23A specification. It contains exactly one patient and a list of medications (named medicament in ChMed23A).

Based on the CHMed23A specs doc version 2.1 and the CHMed23A posology specs doc version 2.1.

  • Field Details

    • EMEDIPLAN_VERSION

      public static final String EMEDIPLAN_VERSION
      See Also:
    • EMEDIPLAN_TIMEZONE

      public static final String EMEDIPLAN_TIMEZONE
      See Also:
    • patient

      protected EMediplanPatient patient
      The patient.
    • hcPerson

      protected @Nullable EMediplanHealthcarePerson hcPerson
      The healthcare person author of the document, required if the document author type is an HCP.
    • hcOrg

      protected @Nullable EMediplanHealthcareOrganization hcOrg
      The healthcare organization in which the HealthcarePerson works. Required if the document author type is an HCP.
    • medicaments

      protected List<@NonNull EMediplanMedicament> medicaments
      List of medications.
    • extensions

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

      protected @Nullable EMediplanType type
      The type of Medication object, see EMediplanType. It is allowed to be missing if the author is a person, in which case it is assumed that it is a EMediplanType.MEDICATION_PLAN.
    • id

      protected @Nullable String id
      The id of the Medication object. The eMediplan document creator is responsible for assigning the id.
    • author

      protected EMediplanAuthor author
      The type of author of the document.
    • recipient

      protected @Nullable String recipient
      The recipient (GLN) of the electronic prescription. To be used if the electronic prescription is to be transmitted electronically to a healthcare professional.
    • timestamp

      protected Instant timestamp
      The date of creation. Format: yyyy-mm-ddThh:mm:ss+02:00 (ISO 86012 Combined date and time in UTC) (e.g. 2016-06-16T16:26:15+02:00)
    • remark

      protected @Nullable String remark
      Remark. Any information or advice the author would like to share independently of a specific medicament.
  • Constructor Details

    • EMediplan

      public EMediplan()
  • Method Details

    • getMedicaments

      public List<@NonNull EMediplanMedicament> getMedicaments()
    • addMedicament

      public void addMedicament(@NonNull EMediplanMedicament medicament)
    • 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.
    • resolveType

      @ExpectsValidResource public EMediplanType resolveType()
      Resolves the eMediplan type, which can be missing for eMediplan objects authored by a patient, because a Medication Plan is assumed (since they are not allowed to author prescriptions).
      Returns:
      The resolved EMediplanType.
    • 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.
    • 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
    • toChTransmissionFormat

      @ExpectsValidResource public String toChTransmissionFormat() throws IOException
      Converts the eMediplan format to the ChTransmissionFormat specified by ChMed23A. This is useful for data transmission as well as used for the QR code to be embedded in the eMediplan paper/PDF format.
      Returns:
      The ChTransmissionFormat string with the eMediplan object information.
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException - The eMediplan object could not be serialized to JSON.
      IOException - The eMediplan object could not be serialized and compressed to ChTransmissionFormat.