use of de.symeda.sormas.api.caze.AgeAndBirthDateDto in project SORMAS-Project by hzi-braunschweig.
the class ImmunizationIndexDtoResultTransformer method transformTuple.
@Override
public Object transformTuple(Object[] objects, String[] strings) {
Integer age = objects[5] != null ? (int) objects[5] : null;
ApproximateAgeType approximateAgeType = (ApproximateAgeType) objects[6];
Integer birthdateDD = objects[7] != null ? (int) objects[7] : null;
Integer birthdateMM = objects[8] != null ? (int) objects[8] : null;
Integer birthdateYYYY = objects[9] != null ? (int) objects[9] : null;
return new ImmunizationIndexDto((String) objects[0], (String) objects[1], (String) objects[2], (String) objects[3], (Disease) objects[4], new AgeAndBirthDateDto(age, approximateAgeType, birthdateDD, birthdateMM, birthdateYYYY), (Sex) objects[10], (String) objects[11], (MeansOfImmunization) objects[12], (ImmunizationManagementStatus) objects[13], (ImmunizationStatus) objects[14], (Date) objects[15], (Date) objects[16], (String) objects[17], (Date) objects[18], (Boolean) objects[19]);
}
use of de.symeda.sormas.api.caze.AgeAndBirthDateDto in project SORMAS-Project by hzi-braunschweig.
the class CaseGridDetailed method initColumns.
@SuppressWarnings("unchecked")
@Override
protected void initColumns() {
addColumn(caze -> {
if (caze.getLatestSampleDateTime() != null) {
return DateFormatHelper.formatLocalDateTime(caze.getLatestSampleDateTime()) + " [" + caze.getSampleCount() + "]";
} else {
return null;
}
}).setCaption(I18nProperties.getPrefixCaption(CaseIndexDetailedDto.I18N_PREFIX, CaseIndexDetailedDto.LATEST_SAMPLE_DATE_TIME)).setId(LATEST_SAMPLE_DATE_TIME_AND_SAMPLE_COUNT).setSortable(false).setWidth(150);
super.initColumns();
if (!FacadeProvider.getConfigFacade().isConfiguredCountry(CountryHelper.COUNTRY_CODE_GERMANY)) {
getColumn(CaseIndexDetailedDto.RE_INFECTION).setHidden(true);
}
getColumn(CaseIndexDetailedDto.SEX).setWidth(80);
getColumn(CaseIndexDetailedDto.AGE_AND_BIRTH_DATE).setWidth(100);
getColumn(CaseIndexDetailedDto.POSTAL_CODE).setWidth(100);
getColumn(CaseIndexDetailedDto.CITY).setWidth(150);
getColumn(CaseIndexDetailedDto.STREET).setWidth(150);
getColumn(CaseIndexDetailedDto.HOUSE_NUMBER).setWidth(50);
getColumn(CaseIndexDetailedDto.ADDITIONAL_INFORMATION).setWidth(200);
getColumn(CaseIndexDetailedDto.PHONE).setWidth(100);
getColumn(CaseIndexDetailedDto.EVENT_COUNT).setWidth(80).setSortable(false);
getColumn(CaseIndexDetailedDto.LATEST_EVENT_ID).setWidth(80).setSortable(false);
getColumn(CaseIndexDetailedDto.LATEST_EVENT_STATUS).setWidth(80).setSortable(false);
getColumn(CaseIndexDetailedDto.LATEST_EVENT_TITLE).setWidth(150).setSortable(false);
((Column<CaseIndexDetailedDto, String>) getColumn(CaseIndexDetailedDto.LATEST_EVENT_ID)).setRenderer(new UuidRenderer());
addItemClickListener(new ShowDetailsListener<>(CaseIndexDetailedDto.LATEST_EVENT_ID, c -> ControllerProvider.getEventController().navigateToData(c.getLatestEventId())));
((Column<CaseIndexDetailedDto, AgeAndBirthDateDto>) getColumn(CaseIndexDetailedDto.AGE_AND_BIRTH_DATE)).setRenderer(value -> value == null ? "" : PersonHelper.getAgeAndBirthdateString(value.getAge(), value.getAgeType(), value.getDateOfBirthDD(), value.getDateOfBirthMM(), value.getDateOfBirthYYYY()), new TextRenderer());
((Column<CaseIndexDetailedDto, Date>) getColumn(CaseIndexDetailedDto.SYMPTOM_ONSET_DATE)).setRenderer(new DateRenderer(DateFormatHelper.getDateFormat())).setCaption(I18nProperties.getPrefixCaption(SymptomsDto.I18N_PREFIX, SymptomsDto.ONSET_DATE)).setWidth(80);
}
use of de.symeda.sormas.api.caze.AgeAndBirthDateDto in project SORMAS-Project by hzi-braunschweig.
the class CaseSelectionDtoResultTransformer method transformTuple.
@Override
public Object transformTuple(Object[] objects, String[] strings) {
Integer age = objects[6] != null ? (int) objects[6] : null;
ApproximateAgeType approximateAgeType = (ApproximateAgeType) objects[7];
Integer birthdateDD = objects[8] != null ? (int) objects[8] : null;
Integer birthdateMM = objects[9] != null ? (int) objects[9] : null;
Integer birthdateYYYY = objects[10] != null ? (int) objects[10] : null;
String healthFacilityName = FacilityHelper.buildFacilityString((String) objects[12], (String) objects[13], (String) objects[14]);
return new CaseSelectionDto((String) objects[0], (String) objects[1], (String) objects[2], (Disease) objects[3], (String) objects[4], (String) objects[5], new AgeAndBirthDateDto(age, approximateAgeType, birthdateDD, birthdateMM, birthdateYYYY), (String) objects[11], healthFacilityName, (Date) objects[15], (Sex) objects[16], (CaseClassification) objects[17], (CaseOutcome) objects[18], (Boolean) objects[19]);
}
Aggregations