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;
}
Aggregations