Search in sources :

Example 1 with QuarantineType

use of de.symeda.sormas.api.contact.QuarantineType in project SORMAS-Project by hzi-braunschweig.

the class CaseDataForm method onValueChange.

private void onValueChange() {
    QuarantineType quarantineType = (QuarantineType) quarantine.getValue();
    if (QuarantineType.isQuarantineInEffect(quarantineType)) {
        setVisible(dfPreviousQuarantineTo.getValue() != null, CaseDataDto.PREVIOUS_QUARANTINE_TO, CaseDataDto.QUARANTINE_CHANGE_COMMENT);
        CaseDataDto caze = this.getInternalValue();
        if (caze != null) {
            quarantineFrom.setValue(caze.getQuarantineFrom());
            if (caze.getQuarantineTo() == null) {
                if (caseFollowUpEnabled) {
                    dfQuarantineTo.setValue(caze.getFollowUpUntil());
                }
            } else {
                dfQuarantineTo.setValue(caze.getQuarantineTo());
            }
            if (caze.isQuarantineExtended()) {
                cbQuarantineExtended.setValue(true);
                setVisible(true, CaseDataDto.QUARANTINE_EXTENDED);
            }
            if (caze.isQuarantineReduced()) {
                cbQuarantineReduced.setValue(true);
                setVisible(true, CaseDataDto.QUARANTINE_REDUCED);
            }
        } else {
            quarantineFrom.clear();
            dfQuarantineTo.clear();
            cbQuarantineExtended.setValue(false);
            cbQuarantineReduced.setValue(false);
            setVisible(false, CaseDataDto.QUARANTINE_REDUCED, CaseDataDto.QUARANTINE_EXTENDED, CaseDataDto.PREVIOUS_QUARANTINE_TO, CaseDataDto.QUARANTINE_CHANGE_COMMENT);
        }
    } else {
        quarantineChangeComment.clear();
        setVisible(false, CaseDataDto.PREVIOUS_QUARANTINE_TO, CaseDataDto.QUARANTINE_CHANGE_COMMENT);
    }
}
Also used : CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) QuarantineType(de.symeda.sormas.api.contact.QuarantineType)

Example 2 with QuarantineType

use of de.symeda.sormas.api.contact.QuarantineType in project SORMAS-Project by hzi-braunschweig.

the class TravelEntryDataForm method onQuarantineValueChange.

private void onQuarantineValueChange() {
    QuarantineType quarantineType = (QuarantineType) quarantine.getValue();
    if (QuarantineType.isQuarantineInEffect(quarantineType)) {
        TravelEntryDto travelEntryDto = FacadeProvider.getTravelEntryFacade().getByUuid(travelEntryUuid);
        if (travelEntryDto.getResultingCase() != null) {
            CaseDataDto caze = FacadeProvider.getCaseFacade().getCaseDataByUuid(travelEntryDto.getResultingCase().getUuid());
            if (caze != null) {
                quarantineFrom.setValue(caze.getQuarantineFrom());
                if (caze.getQuarantineTo() == null) {
                    boolean caseFollowUpEnabled = FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.CASE_FOLLOWUP);
                    if (caseFollowUpEnabled) {
                        quarantineTo.setValue(caze.getFollowUpUntil());
                    }
                } else {
                    quarantineTo.setValue(caze.getQuarantineTo());
                }
                if (caze.isQuarantineExtended()) {
                    quarantineExtended.setValue(true);
                    setVisible(true, TravelEntryDto.QUARANTINE_EXTENDED);
                }
                if (caze.isQuarantineReduced()) {
                    quarantineReduced.setValue(true);
                    setVisible(true, TravelEntryDto.QUARANTINE_REDUCED);
                }
            }
        }
    } else {
        quarantineFrom.clear();
        quarantineTo.clear();
        quarantineExtended.setValue(false);
        quarantineReduced.setValue(false);
        setVisible(false, TravelEntryDto.QUARANTINE_REDUCED, TravelEntryDto.QUARANTINE_EXTENDED);
    }
}
Also used : CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) TravelEntryDto(de.symeda.sormas.api.travelentry.TravelEntryDto) QuarantineType(de.symeda.sormas.api.contact.QuarantineType)

Example 3 with QuarantineType

use of de.symeda.sormas.api.contact.QuarantineType in project SORMAS-Project by hzi-braunschweig.

the class ContactDataForm method onQuarantineValueChange.

private void onQuarantineValueChange() {
    QuarantineType quarantineType = (QuarantineType) quarantine.getValue();
    if (QuarantineType.isQuarantineInEffect(quarantineType)) {
        setVisible(dfPreviousQuarantineTo.getValue() != null, ContactDto.PREVIOUS_QUARANTINE_TO, ContactDto.QUARANTINE_CHANGE_COMMENT);
        ContactDto contact = this.getInternalValue();
        if (contact != null) {
            quarantineFrom.setValue(contact.getQuarantineFrom());
            if (contact.getQuarantineTo() == null) {
                dfQuarantineTo.setValue(contact.getFollowUpUntil());
            } else {
                dfQuarantineTo.setValue(contact.getQuarantineTo());
            }
            if (contact.isQuarantineExtended()) {
                cbQuarantineExtended.setValue(true);
                setVisible(true, ContactDto.QUARANTINE_EXTENDED);
            }
            if (contact.isQuarantineReduced()) {
                cbQuarantineReduced.setValue(true);
                setVisible(true, ContactDto.QUARANTINE_REDUCED);
            }
        } else {
            quarantineChangeComment.clear();
            setVisible(false, ContactDto.PREVIOUS_QUARANTINE_TO, ContactDto.QUARANTINE_CHANGE_COMMENT);
        }
    } else {
        quarantineFrom.clear();
        dfQuarantineTo.clear();
        quarantineChangeComment.clear();
        cbQuarantineExtended.setValue(false);
        cbQuarantineReduced.setValue(false);
        setVisible(false, ContactDto.QUARANTINE_REDUCED, ContactDto.QUARANTINE_EXTENDED, ContactDto.PREVIOUS_QUARANTINE_TO, ContactDto.QUARANTINE_CHANGE_COMMENT);
    }
}
Also used : ContactDto(de.symeda.sormas.api.contact.ContactDto) QuarantineType(de.symeda.sormas.api.contact.QuarantineType)

Aggregations

QuarantineType (de.symeda.sormas.api.contact.QuarantineType)3 CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)2 ContactDto (de.symeda.sormas.api.contact.ContactDto)1 TravelEntryDto (de.symeda.sormas.api.travelentry.TravelEntryDto)1