Class ChMed23AConverter
java.lang.Object
org.projecthusky.fhir.emed.ch.epr.service.converter.emediplan.ChMed23AConverter
- All Implemented Interfaces:
EMediplanConverter
Utility class to convert CH EMED EPR documents to an eMediplan object equivalent according to the
CHMED23A specifications.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static EMediplanDosegetEMediplanDoseFromChEmedEpr(Dose chEmedEprDose) Converts a CH EMED EPRDoseto the appropriateEMediplanDoseobject.Converts the received PMLC document to an eMediplan object according to the CHMED23A specifications.Converts the received PRE document to an eMediplan object according to the CHMED23A specifications.protected ChMed23AMedicamenttoMedicament(ChEmedEprMedicationStatementPmlc statement) protected ChMed23APosologytoPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, boolean setUnitIfAbsent) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to anChMed23APosologyobject.protected static @Nullable RepetitiontoRepetition(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent dispenseRequest) Gets a repetition object from a FHIR dispense request, if possible.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
-
ChMed23AConverter
public ChMed23AConverter()
-
-
Method Details
-
toEMediplan
Converts the received PMLC document to an eMediplan object according to the CHMED23A specifications.- Specified by:
toEMediplanin interfaceEMediplanConverter- Parameters:
pmlc- The PMLC document to be converted.- Returns:
- A best-effort equivalent eMediplan object.
-
toEMediplan
Converts the received PRE document to an eMediplan object according to the CHMED23A specifications.- Specified by:
toEMediplanin interfaceEMediplanConverter- Parameters:
pre- The PRE document to be converted.- Returns:
- A best-effort equivalent eMediplan object.
-
toMedicament
-
toPosology
protected ChMed23APosology toPosology(ChEmedEprDosage baseDosage, List<@NonNull ChEmedEprDosage> additionalDosages, boolean setUnitIfAbsent) Converts the list of Dosage objects of a CH EMED EPR resource (either medication statement or medication request) to anChMed23APosologyobject.- 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.setUnitIfAbsent- The eMediplan posology object unit will be set to N/A if the CH EMED EPR object has no specified structured unit.- Returns:
- The equivalent eMediplan posology object.
-
getEMediplanDoseFromChEmedEpr
Converts a CH EMED EPRDoseto the appropriateEMediplanDoseobject.Depending on whether the dose is a simple quantity or a range, the returned object will be an instance of
SimpleDoseorRangeDoserespectively.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
EMediplanDoseobject.
-
toRepetition
protected static @Nullable Repetition toRepetition(org.hl7.fhir.r4.model.MedicationRequest.MedicationRequestDispenseRequestComponent dispenseRequest) Gets a repetition object from a FHIR dispense request, if possible.- Parameters:
dispenseRequest- The dispense request form which to create a repetition object.- Returns:
- The resulting repetition object, if it would make sense,
nullotherwise.
-