Search in sources :

Example 1 with AgeAndBirthDateDto

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]);
}
Also used : ImmunizationIndexDto(de.symeda.sormas.api.immunization.ImmunizationIndexDto) AgeAndBirthDateDto(de.symeda.sormas.api.caze.AgeAndBirthDateDto) ApproximateAgeType(de.symeda.sormas.api.person.ApproximateAgeType)

Example 2 with AgeAndBirthDateDto

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);
}
Also used : TextRenderer(com.vaadin.ui.renderers.TextRenderer) UuidRenderer(de.symeda.sormas.ui.utils.UuidRenderer) CaseCriteria(de.symeda.sormas.api.caze.CaseCriteria) Date(java.util.Date) FacadeProvider(de.symeda.sormas.api.FacadeProvider) I18nProperties(de.symeda.sormas.api.i18n.I18nProperties) DateFormatHelper(de.symeda.sormas.ui.utils.DateFormatHelper) PersonHelper(de.symeda.sormas.api.person.PersonHelper) AgeAndBirthDateDto(de.symeda.sormas.api.caze.AgeAndBirthDateDto) CaseIndexDetailedDto(de.symeda.sormas.api.caze.CaseIndexDetailedDto) SortProperty(de.symeda.sormas.api.utils.SortProperty) ControllerProvider(de.symeda.sormas.ui.ControllerProvider) CaseIndexDto(de.symeda.sormas.api.caze.CaseIndexDto) ShowDetailsListener(de.symeda.sormas.ui.utils.ShowDetailsListener) List(java.util.List) Stream(java.util.stream.Stream) CountryHelper(de.symeda.sormas.api.CountryHelper) SymptomsDto(de.symeda.sormas.api.symptoms.SymptomsDto) DateRenderer(com.vaadin.ui.renderers.DateRenderer) UuidRenderer(de.symeda.sormas.ui.utils.UuidRenderer) DateRenderer(com.vaadin.ui.renderers.DateRenderer) TextRenderer(com.vaadin.ui.renderers.TextRenderer)

Example 3 with AgeAndBirthDateDto

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]);
}
Also used : AgeAndBirthDateDto(de.symeda.sormas.api.caze.AgeAndBirthDateDto) ApproximateAgeType(de.symeda.sormas.api.person.ApproximateAgeType) CaseSelectionDto(de.symeda.sormas.api.caze.CaseSelectionDto)

Aggregations

AgeAndBirthDateDto (de.symeda.sormas.api.caze.AgeAndBirthDateDto)3 ApproximateAgeType (de.symeda.sormas.api.person.ApproximateAgeType)2 DateRenderer (com.vaadin.ui.renderers.DateRenderer)1 TextRenderer (com.vaadin.ui.renderers.TextRenderer)1 CountryHelper (de.symeda.sormas.api.CountryHelper)1 FacadeProvider (de.symeda.sormas.api.FacadeProvider)1 CaseCriteria (de.symeda.sormas.api.caze.CaseCriteria)1 CaseIndexDetailedDto (de.symeda.sormas.api.caze.CaseIndexDetailedDto)1 CaseIndexDto (de.symeda.sormas.api.caze.CaseIndexDto)1 CaseSelectionDto (de.symeda.sormas.api.caze.CaseSelectionDto)1 I18nProperties (de.symeda.sormas.api.i18n.I18nProperties)1 ImmunizationIndexDto (de.symeda.sormas.api.immunization.ImmunizationIndexDto)1 PersonHelper (de.symeda.sormas.api.person.PersonHelper)1 SymptomsDto (de.symeda.sormas.api.symptoms.SymptomsDto)1 SortProperty (de.symeda.sormas.api.utils.SortProperty)1 ControllerProvider (de.symeda.sormas.ui.ControllerProvider)1 DateFormatHelper (de.symeda.sormas.ui.utils.DateFormatHelper)1 ShowDetailsListener (de.symeda.sormas.ui.utils.ShowDetailsListener)1 UuidRenderer (de.symeda.sormas.ui.utils.UuidRenderer)1 Date (java.util.Date)1