Search in sources :

Example 1 with MaternalHistoryForm

use of de.symeda.sormas.ui.caze.maternalhistory.MaternalHistoryForm in project SORMAS-Project by hzi-braunschweig.

the class CaseController method getMaternalHistoryComponent.

public CommitDiscardWrapperComponent<MaternalHistoryForm> getMaternalHistoryComponent(final String caseUuid, ViewMode viewMode) {
    CaseDataDto caze = findCase(caseUuid);
    MaternalHistoryForm form = new MaternalHistoryForm(viewMode, caze.getMaternalHistory().isPseudonymized());
    form.setValue(caze.getMaternalHistory());
    final CommitDiscardWrapperComponent<MaternalHistoryForm> component = new CommitDiscardWrapperComponent<MaternalHistoryForm>(form, UserProvider.getCurrent().hasUserRight(UserRight.CASE_EDIT), form.getFieldGroup());
    component.addCommitListener(() -> {
        CaseDataDto caze1 = FacadeProvider.getCaseFacade().getCaseDataByUuid(caseUuid);
        caze1.setMaternalHistory(form.getValue());
        saveCase(caze1);
    });
    return component;
}
Also used : CaseDataDto(de.symeda.sormas.api.caze.CaseDataDto) CommitDiscardWrapperComponent(de.symeda.sormas.ui.utils.CommitDiscardWrapperComponent) MaternalHistoryForm(de.symeda.sormas.ui.caze.maternalhistory.MaternalHistoryForm)

Aggregations

CaseDataDto (de.symeda.sormas.api.caze.CaseDataDto)1 MaternalHistoryForm (de.symeda.sormas.ui.caze.maternalhistory.MaternalHistoryForm)1 CommitDiscardWrapperComponent (de.symeda.sormas.ui.utils.CommitDiscardWrapperComponent)1