use of de.symeda.sormas.api.caze.maternalhistory.MaternalHistoryDto in project SORMAS-Project by hzi-braunschweig.
the class SormasToSormasCaseDtoValidator method validate.
@Override
public ValidationErrors validate(SormasToSormasCaseDto sharedData, ValidationDirection direction) {
CaseDataDto caze = sharedData.getEntity();
ValidationErrors validationErrors = new ValidationErrors(buildCaseValidationGroupName(caze));
ValidationErrors personValidationErrors = validatePerson(sharedData.getPerson(), direction);
validationErrors.addAll(personValidationErrors);
final String groupNameTag = Captions.CaseData;
infraValidator.validateResponsibleRegion(caze.getResponsibleRegion(), groupNameTag, validationErrors, caze::setResponsibleRegion, direction);
infraValidator.validateResponsibleDistrict(caze.getResponsibleDistrict(), groupNameTag, validationErrors, caze::setResponsibleDistrict, direction);
infraValidator.validateResponsibleCommunity(caze.getResponsibleCommunity(), groupNameTag, validationErrors, caze::setResponsibleCommunity, direction);
infraValidator.validateRegion(caze.getRegion(), groupNameTag, validationErrors, caze::setRegion, direction);
infraValidator.validateDistrict(caze.getDistrict(), groupNameTag, validationErrors, caze::setDistrict, direction);
infraValidator.validateCommunity(caze.getCommunity(), groupNameTag, validationErrors, caze::setCommunity, direction);
infraValidator.validateFacility(caze.getHealthFacility(), caze.getFacilityType(), caze.getHealthFacilityDetails(), groupNameTag, validationErrors, f -> {
caze.setHealthFacility(f.getEntity());
caze.setHealthFacilityDetails(f.getDetails());
});
infraValidator.validatePointOfEntry(caze.getPointOfEntry(), caze.getPointOfEntryDetails(), groupNameTag, validationErrors, p -> {
caze.setPointOfEntry(p.getEntity());
caze.setPointOfEntryDetails(p.getDetails());
});
final HospitalizationDto hospitalization = caze.getHospitalization();
if (hospitalization != null) {
hospitalization.getPreviousHospitalizations().forEach(ph -> validatePreviousHospitalization(validationErrors, ph, direction));
}
final MaternalHistoryDto maternalHistory = caze.getMaternalHistory();
if (maternalHistory != null) {
validateMaternalHistory(validationErrors, maternalHistory, direction);
}
validateEpiData(caze.getEpiData(), validationErrors, direction);
return validationErrors;
}
use of de.symeda.sormas.api.caze.maternalhistory.MaternalHistoryDto in project SORMAS-Project by hzi-braunschweig.
the class MaternalHistoryFacadeEjb method toDto.
public static MaternalHistoryDto toDto(MaternalHistory source) {
if (source == null) {
return null;
}
MaternalHistoryDto target = new MaternalHistoryDto();
DtoHelper.fillDto(target, source);
target.setAgeAtBirth(source.getAgeAtBirth());
target.setArthralgiaArthritis(source.getArthralgiaArthritis());
target.setArthralgiaArthritisOnset(source.getArthralgiaArthritisOnset());
target.setArthralgiaArthritisMonth(source.getArthralgiaArthritisMonth());
target.setChildrenNumber(source.getChildrenNumber());
target.setConjunctivitis(source.getConjunctivitis());
target.setConjunctivitisOnset(source.getConjunctivitisOnset());
target.setConjunctivitisMonth(source.getConjunctivitisMonth());
target.setMaculopapularRash(source.getMaculopapularRash());
target.setMaculopapularRashOnset(source.getMaculopapularRashOnset());
target.setMaculopapularRashMonth(source.getMaculopapularRashMonth());
target.setRubella(source.getRubella());
target.setRubellaOnset(source.getRubellaOnset());
target.setSwollenLymphs(source.getSwollenLymphs());
target.setSwollenLymphsOnset(source.getSwollenLymphsOnset());
target.setSwollenLymphsMonth(source.getSwollenLymphsMonth());
target.setRashExposure(source.getRashExposure());
target.setRashExposureDate(source.getRashExposureDate());
target.setRashExposureMonth(source.getRashExposureMonth());
target.setRashExposureRegion(RegionFacadeEjb.toReferenceDto(source.getRashExposureRegion()));
target.setRashExposureDistrict(DistrictFacadeEjb.toReferenceDto(source.getRashExposureDistrict()));
target.setRashExposureCommunity(CommunityFacadeEjb.toReferenceDto(source.getRashExposureCommunity()));
target.setOtherComplications(source.getOtherComplications());
target.setOtherComplicationsOnset(source.getOtherComplicationsOnset());
target.setOtherComplicationsMonth(source.getOtherComplicationsMonth());
target.setOtherComplicationsDetails(source.getOtherComplicationsDetails());
return target;
}
Aggregations