use of de.symeda.sormas.ui.clinicalcourse.ClinicalCourseForm in project SORMAS-Project by hzi-braunschweig.
the class CaseController method getClinicalCourseComponent.
public CommitDiscardWrapperComponent<ClinicalCourseForm> getClinicalCourseComponent(String caseUuid) {
CaseDataDto caze = FacadeProvider.getCaseFacade().getCaseDataByUuid(caseUuid);
ClinicalCourseForm form = new ClinicalCourseForm(caze.isPseudonymized());
form.setValue(caze.getClinicalCourse());
final CommitDiscardWrapperComponent<ClinicalCourseForm> view = new CommitDiscardWrapperComponent<>(form, UserProvider.getCurrent().hasUserRight(UserRight.CLINICAL_COURSE_EDIT), form.getFieldGroup());
view.addCommitListener(() -> {
if (!form.getFieldGroup().isModified()) {
CaseDataDto cazeDto = FacadeProvider.getCaseFacade().getCaseDataByUuid(caseUuid);
cazeDto.setClinicalCourse(form.getValue());
saveCase(cazeDto);
}
});
view.getCommitButton().setVisible(false);
view.getDiscardButton().setVisible(false);
return view;
}
Aggregations