Class EMediplanConverter

java.lang.Object
org.projecthusky.fhir.emed.ch.epr.service.EMediplanConverter

public class EMediplanConverter extends Object
Utility class to convert CH EMED EPR documents to an eMediplan object equivalent.
  • Method Details

    • toEMediplan

      @ExpectsValidResource public static EMediplan toEMediplan(ChEmedEprDocumentPmlc pmlc)
      Converts the received PMLC document to an eMediplan object.
      Parameters:
      pmlc - The PMLC document to be converted.
      Returns:
      An equivalent eMediplan object.
    • medicalAuthorToPrescriber

      protected static @Nullable String medicalAuthorToPrescriber(Author author)
      Translates a Author to a prescriber string for eMediplan. The prescriber string, according to the eMediplan specifications, consists of the prescriber's GLN number.
      Parameters:
      author - The CH EMED EPR Author from which to get a prescriber string.
      Returns:
      The GLN of the practitioner author, if a professional author, null otherwise.
    • toPosology

      protected static EMediplanPosology toPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages)
      Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to an EMediplanPosology object.
      Parameters:
      baseDosage - The CH EMED EPR resource base dosage.
      additionalDosages - The CH EMED EPR list of additional dosages (if split dose). It can be empty.
      Returns:
      The equivalent eMediplan posology object.
    • getEMediplanDoseFromChEmedEpr

      protected static EMediplanDose getEMediplanDoseFromChEmedEpr(Dose chEmedEprDose)
      Converts a CH EMED EPR Dose to the appropriate EMediplanDose object.

      Depending on whether the dose is a simple quantity or a range, the returned object will be an instance of SimpleDose or RangeDose respectively.

      Note that the unit of the dose is ignored. The aim of this method is just to convert the quantity part of the dose object, since the unit is specified at a higher level in the eMediplan model.

      Parameters:
      chEmedEprDose - The CH EMED EPR dose to be converted.
      Returns:
      The resulting EMediplanDose object.