Class ChMed16ABaseConverter<M extends ChMed16AMedicament,E extends ChMed16AEMediplan<M>>
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.service.converter.emediplan.ChMed16ABaseConverter<M,E>
- All Implemented Interfaces:
EMediplanConverter
- Direct Known Subclasses:
ChMed16AConverter,EPrescriptionConverter
public abstract non-sealed class ChMed16ABaseConverter<M extends ChMed16AMedicament,E extends ChMed16AEMediplan<M>>
extends Object
implements EMediplanConverter
Utility class to convert CH EMED EPR documents to an eMediplan object equivalent according to the
CHMED16A specifications.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendToApplicationInstructions(ChMed16AMedicament med, String extraContent) protected ChMed16ATakingTimegetEMediplanTakingTimeFromChEmedEprDose(Dose chEmedEprDose, TimingEventAmbu timingEvent, boolean inReserve, @Nullable AmountQuantity maxDosePerAdministration) Converts a CH EMED EPRDoseto the appropriateChMed16ATakingTimeobject.protected abstract Eprotected abstract Mprotected EsetPrescriptionAuthor(E emediplan, Author lastMedicalAuthor) Converts the received PMLC document to an eMediplan object according to the CHMED16A specifications.Converts the received PRE document to an eMediplan object.protected MtoMedicament(ChEmedEprMedication medication, ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, @Nullable String treatmentReason, Author medicalAuthor, SubstanceAdministrationSubstitutionCode substitutionCode, @Nullable org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent dispenseRequest, EMediplanType mediplanType) toMedicament(ChEmedEprMedicationStatementPmlc statement) Converts a CH EMED EPR PMLC medication statement to a CHMED16A medicament object.protected Mprotected ChMed16APosologytoPlanPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, ChMed16AMedicament medicament) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to aChMed16APosologyobject assumed to belong to a medication plan document.@Nullable ChMed16APosologytoPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, ChMed16AMedicament medicament, EMediplanType mediplanType) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to anChMed16APosologyobject.protected @Nullable ChMed16APosologytoPrescriptionPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, ChMed16AMedicament medicament) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to aChMed16APosologyobject assumed to belong to a prescription document.Methods 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.service.converter.emediplan.EMediplanConverter
medicalAuthorToPrescriber
-
Constructor Details
-
ChMed16ABaseConverter
public ChMed16ABaseConverter()
-
-
Method Details
-
toEMediplan
Converts the received PMLC document to an eMediplan object according to the CHMED16A specifications.- Specified by:
toEMediplanin interfaceEMediplanConverter- Parameters:
pmlc- The PMLC document to be converted.- Returns:
- A best-effort equivalent eMediplan object.
-
toEMediplan
Description copied from interface:EMediplanConverterConverts the received PRE document to an eMediplan object.- Specified by:
toEMediplanin interfaceEMediplanConverter- Parameters:
pre- The PRE document to be converted.- Returns:
- A best-effort equivalent eMediplan object.
-
setPrescriptionAuthor
-
toMedicament
Converts a CH EMED EPR PMLC medication statement to a CHMED16A medicament object.- Parameters:
statement- The original CH EMED EPR PMLC medication statement to be converted.- Returns:
- The converted CHMED16A medicament object.
-
toMedicament
-
toMedicament
@ExpectsValidResource protected M toMedicament(ChEmedEprMedication medication, ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, @Nullable String treatmentReason, Author medicalAuthor, SubstanceAdministrationSubstitutionCode substitutionCode, @Nullable org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent dispenseRequest, EMediplanType mediplanType) -
toPosology
public @Nullable ChMed16APosology toPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, ChMed16AMedicament medicament, EMediplanType mediplanType) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to anChMed16APosologyobject.- 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.medicament- The medication for which this dosage is being added. The medication object might be changed: this method might have to set or alter the application instructions if the CH EMED EPR dosage is expressed as free text or if it cannot be converted to the CHMED16A structure.mediplanType- The type of eMediplan document.- Returns:
- The equivalent eMediplan posology object.
-
toPlanPosology
protected ChMed16APosology toPlanPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, ChMed16AMedicament medicament) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to aChMed16APosologyobject assumed to belong to a medication plan document.- 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.medicament- The medication for which this dosage is being added. The medication object might be changed: this method might have to set or alter the application instructions if the CH EMED EPR dosage is expressed as free text or if it cannot be converted to the CHMED16A structure.- Returns:
- The equivalent eMediplan posology object.
-
toPrescriptionPosology
protected @Nullable ChMed16APosology toPrescriptionPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, ChMed16AMedicament medicament) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to aChMed16APosologyobject assumed to belong to a prescription document.- 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.medicament- The medication for which this dosage is being added. The medication object might be changed: this method might have to set or alter the application instructions if the CH EMED EPR dosage is expressed as free text or if it cannot be converted to the CHMED16A structure.- Returns:
- The equivalent eMediplan posology object.
-
getEMediplanTakingTimeFromChEmedEprDose
protected ChMed16ATakingTime getEMediplanTakingTimeFromChEmedEprDose(Dose chEmedEprDose, TimingEventAmbu timingEvent, boolean inReserve, @Nullable AmountQuantity maxDosePerAdministration) Converts a CH EMED EPRDoseto the appropriateChMed16ATakingTimeobject.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
ChMed16ATakingTimeobject.
-
appendToApplicationInstructions
-
getNewMedicamentInstance
-
getNewEmediplanInstance
-