use of de.symeda.sormas.api.caze.CaseSimilarityCriteria in project SORMAS-Project by hzi-braunschweig.
the class LabMessageController method getSimilarCases.
private List<CaseSelectionDto> getSimilarCases(PersonReferenceDto selectedPerson, LabMessageDto labMessage) {
CaseCriteria caseCriteria = new CaseCriteria();
caseCriteria.person(selectedPerson);
caseCriteria.disease(labMessage.getTestedDisease());
CaseSimilarityCriteria caseSimilarityCriteria = new CaseSimilarityCriteria();
caseSimilarityCriteria.caseCriteria(caseCriteria);
caseSimilarityCriteria.personUuid(selectedPerson.getUuid());
return FacadeProvider.getCaseFacade().getSimilarCases(caseSimilarityCriteria);
}
use of de.symeda.sormas.api.caze.CaseSimilarityCriteria in project SORMAS-Project by hzi-braunschweig.
the class AbstractLabMessageProcessingFlow method getSimilarCases.
private List<CaseSelectionDto> getSimilarCases(PersonReferenceDto selectedPerson, LabMessageDto labMessage) {
CaseCriteria caseCriteria = new CaseCriteria();
caseCriteria.person(selectedPerson);
caseCriteria.disease(labMessage.getTestedDisease());
CaseSimilarityCriteria caseSimilarityCriteria = new CaseSimilarityCriteria();
caseSimilarityCriteria.caseCriteria(caseCriteria);
caseSimilarityCriteria.personUuid(selectedPerson.getUuid());
return FacadeProvider.getCaseFacade().getSimilarCases(caseSimilarityCriteria);
}
use of de.symeda.sormas.api.caze.CaseSimilarityCriteria in project SORMAS-Project by hzi-braunschweig.
the class CaseController method selectOrCreateCase.
public void selectOrCreateCase(CaseDataDto caseDto, PersonDto person, Consumer<String> selectedCaseUuidConsumer) {
CaseSimilarityCriteria criteria = CaseSimilarityCriteria.forCase(caseDto, person.getUuid());
// Check for similar cases for the **given person**.
// This is a case similarity check for a fixed person and will not return cases where persons are similar.
List<CaseSelectionDto> similarCases = FacadeProvider.getCaseFacade().getSimilarCases(criteria);
if (similarCases.size() > 0) {
CasePickOrCreateField pickOrCreateField = new CasePickOrCreateField(caseDto, person, similarCases);
pickOrCreateField.setWidth(1280, Unit.PIXELS);
final CommitDiscardWrapperComponent<CasePickOrCreateField> component = new CommitDiscardWrapperComponent<>(pickOrCreateField);
component.getCommitButton().setCaption(I18nProperties.getCaption(Captions.actionConfirm));
component.getCommitButton().setEnabled(false);
component.addCommitListener(() -> {
CaseSelectionDto pickedCase = pickOrCreateField.getValue();
if (pickedCase != null) {
selectedCaseUuidConsumer.accept(pickedCase.getUuid());
} else {
selectedCaseUuidConsumer.accept(null);
}
});
pickOrCreateField.setSelectionChangeCallback((commitAllowed) -> {
component.getCommitButton().setEnabled(commitAllowed);
});
VaadinUiUtil.showModalPopupWindow(component, I18nProperties.getString(Strings.headingPickOrCreateCase));
} else {
selectedCaseUuidConsumer.accept(null);
}
}
Aggregations