Class EMediplanConverter
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.service.EMediplanConverter
Utility class to convert CH EMED EPR documents to an eMediplan object equivalent.
-
Method Summary
Modifier and TypeMethodDescriptionprotected static EMediplanDose
getEMediplanDoseFromChEmedEpr
(Dose chEmedEprDose) Converts a CH EMED EPRDose
to the appropriateEMediplanDose
object.protected static @Nullable String
medicalAuthorToPrescriber
(Author author) Translates aAuthor
to a prescriber string for eMediplan.static EMediplan
Converts the received PMLC document to an eMediplan object.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 anEMediplanPosology
object.
-
Method Details
-
toEMediplan
Converts the received PMLC document to an eMediplan object.- Parameters:
pmlc
- The PMLC document to be converted.- Returns:
- An equivalent eMediplan object.
-
medicalAuthorToPrescriber
Translates aAuthor
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 anEMediplanPosology
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
Converts a CH EMED EPRDose
to the appropriateEMediplanDose
object.Depending on whether the dose is a simple quantity or a range, the returned object will be an instance of
SimpleDose
orRangeDose
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.
-