use of org.hl7.v3.RCMRMT030101UK04PertinentInformation in project nia-patient-switching-standard-adaptor by NHSDigital.
the class MedicationMapperUtils method buildDosage.
public static Dosage buildDosage(List<RCMRMT030101UK04PertinentInformation> pertinentInformationList) {
Dosage dosage = new Dosage();
var pertinentInformationDosage = pertinentInformationList.stream().filter(RCMRMT030101UK04PertinentInformation::hasPertinentMedicationDosage).map(RCMRMT030101UK04PertinentInformation::getPertinentMedicationDosage).filter(RCMRMT030101UK04MedicationDosage::hasText).map(RCMRMT030101UK04MedicationDosage::getText).findFirst();
pertinentInformationDosage.ifPresentOrElse(dosage::setText, () -> dosage.setText(NO_INFORMATION_AVAILABLE));
return dosage;
}
Aggregations