Skip to content

Commit

Permalink
Merge branch 'SORMAS-Foundation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
gouthamvadi authored Jun 7, 2024
2 parents 83c3127 + 37f996b commit 2c5d5ec
Show file tree
Hide file tree
Showing 311 changed files with 18,923 additions and 2,624 deletions.
2 changes: 1 addition & 1 deletion sormas-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>de.symeda.sormas</groupId>
<artifactId>sormas-base</artifactId>
<version>1.97.0-SNAPSHOT</version>
<version>1.97.0</version>
<relativePath>../sormas-base</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
import de.symeda.sormas.api.sample.PathogenTestFacade;
import de.symeda.sormas.api.sample.SampleFacade;
import de.symeda.sormas.api.selfreport.SelfReportFacade;
import de.symeda.sormas.api.selfreport.SelfReportImportFacade;
import de.symeda.sormas.api.share.ExternalShareInfoFacade;
import de.symeda.sormas.api.sormastosormas.SormasToSormasEncryptionFacade;
import de.symeda.sormas.api.sormastosormas.SormasToSormasFacade;
Expand Down Expand Up @@ -534,6 +535,10 @@ public static SelfReportFacade getSelfReportFacade() {
return get().lookupEjbRemote(SelfReportFacade.class);
}

public static SelfReportImportFacade getSelfReportImportFacade() {
return get().lookupEjbRemote(SelfReportImportFacade.class);
}

@SuppressWarnings("unchecked")
public <P> P lookupEjbRemote(Class<P> clazz) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public enum Language {
FR_TN(new Locale("fr", "TN"), "dd/MM/yyyy", "dd/MM/yyyy HH:mm", "dd/MM"),
DE(new Locale("de", "DE"), "dd.MM.yyyy", "dd.MM.yyyy HH:mm", "dd.MM"),
DE_CH(new Locale("de", "CH"), "dd.MM.yyyy", "dd.MM.yyyy HH:mm", "dd.MM"),
ES_BO(new Locale("es", "BO"), "dd/MM/yyyy", "dd/MM/yyyy H:mm", "dd/MM"),
ES_EC(new Locale("es", "EC"), "dd/MM/yyyy", "dd/MM/yyyy H:mm", "dd/MM"),
ES_CU(new Locale("es", "CU"), "dd/MM/yyyy", "dd/MM/yyyy H:mm", "dd/MM"),
IT(new Locale("it", "IT"), "dd/MM/yyyy", "dd/MM/yyyy H:mm", "dd/MM"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public interface CampaignFacade extends CoreFacade<CampaignDto, CampaignIndexDto

CampaignReferenceDto getLastStartedCampaign();

CampaignDto getCampaignByUuid(String uuid);

List<CampaignDashboardElement> getCampaignDashboardElements(String campaignUuid);

List<String> getAllActiveUuids();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ public class CaseCriteria extends CriteriaWithDateType implements ExternalShareC
*/
private Set<String> caseUuidsForMerge;

private String caseReferenceNumber;

public CaseCriteria() {
super(NewCaseDateType.class);
}
Expand Down Expand Up @@ -793,4 +795,14 @@ public CaseCriteria caseUuidsForMerge(Set<String> caseUuidsForMerge) {

return this;
}

@IgnoreForUrl
public String getCaseReferenceNumber() {
return caseReferenceNumber;
}

public CaseCriteria caseReferenceNumber(String caseReferenceNumber) {
this.caseReferenceNumber = caseReferenceNumber;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ public class ContactCriteria extends BaseCriteria implements Serializable {
*/
private Set<String> contactUuidsForMerge;

private String caseReferenceNumber;
private Boolean withCase;

public UserRoleReferenceDto getReportingUserRole() {
return reportingUserRole;
}
Expand Down Expand Up @@ -752,4 +755,23 @@ public ContactCriteria contactUuidsForMerge(Set<String> contactUuidsForMerge) {

return this;
}

@IgnoreForUrl
public String getCaseReferenceNumber() {
return caseReferenceNumber;
}

public ContactCriteria caseReferenceNumber(String caseReferenceNumber) {
this.caseReferenceNumber = caseReferenceNumber;
return this;
}

public Boolean getWithCase() {
return withCase;
}

public ContactCriteria withCase(Boolean withNoCase) {
this.withCase = withNoCase;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public interface ContactFacade extends CoreFacade<ContactDto, ContactIndexDto, C

List<String> getAllActiveUuids();

ContactDto getContactByUuid(String uuid);

void generateContactFollowUpTasks();

Long countContactsForMap(RegionReferenceDto regionRef, DistrictReferenceDto districtRef, Disease disease, Date from, Date to);
Expand Down Expand Up @@ -154,4 +156,6 @@ List<ProcessedEntity> saveBulkContacts(
boolean contactOfficerChange);

long getContactCount(CaseReferenceDto caze);

void linkContactToCase(ContactReferenceDto contactRef, CaseReferenceDto caseRef);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
package de.symeda.sormas.api.docgeneneration;

import de.symeda.sormas.api.sample.PathogenTestReferenceDto;
import de.symeda.sormas.api.sample.SampleReferenceDto;
import de.symeda.sormas.api.vaccination.VaccinationReferenceDto;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Properties;

public class QuarantineOrderDocumentOptionsDto implements Serializable {

private String templateFile;
private SampleReferenceDto sample;
private PathogenTestReferenceDto pathogenTest;
private VaccinationReferenceDto vaccinationReference;
private Properties extraProperties;
private Boolean shouldUploadGeneratedDoc;
private DocumentWorkflow documentWorkflow;


public String getTemplateFile() {
return templateFile;
}

public void setTemplateFile(String templateFile) {
this.templateFile = templateFile;
}

public SampleReferenceDto getSample() {
return sample;
}

public void setSample(SampleReferenceDto sample) {
this.sample = sample;
}

public PathogenTestReferenceDto getPathogenTest() {
return pathogenTest;
}

public void setPathogenTest(PathogenTestReferenceDto pathogenTest) {
this.pathogenTest = pathogenTest;
}

public VaccinationReferenceDto getVaccinationReference() {
return vaccinationReference;
}

public void setVaccinationReference(VaccinationReferenceDto vaccinationReference) {
this.vaccinationReference = vaccinationReference;
}

public Properties getExtraProperties() {
return extraProperties;
}

public void setExtraProperties(Properties extraProperties) {
this.extraProperties = extraProperties;
}

public Boolean getShouldUploadGeneratedDoc() {
return shouldUploadGeneratedDoc;
}

public void setShouldUploadGeneratedDoc(Boolean shouldUploadGeneratedDoc) {
this.shouldUploadGeneratedDoc = shouldUploadGeneratedDoc;
}

public DocumentWorkflow getDocumentWorkflow() {
return documentWorkflow;
}

public void setDocumentWorkflow(DocumentWorkflow documentWorkflow) {
this.documentWorkflow = documentWorkflow;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ public interface EnvironmentFacade extends CoreFacade<EnvironmentDto, Environmen

List<String> getAllActiveUuids();

EnvironmentDto getEnvironmentByUuid(String uuid);

}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Page<EventGroupIndexDto> getIndexPage(

void deleteEventGroup(String uuid);

void archiveOrDearchiveEventGroup(String uuid, boolean archive);
void archiveEventGroup(String uuid);

void dearchiveEventGroup(String uuid);

List<RegionReferenceDto> getEventGroupRelatedRegions(String uuid);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface ExternalEmailFacade {
List<DocumentReferenceDto> getAttachableDocuments(DocumentWorkflow documentWorkflow, String relatedEntityUuid);

void sendEmail(@Valid ExternalEmailOptionsDto options)
throws DocumentTemplateException, ExternalEmailException, AttachmentException, ValidationException;
throws DocumentTemplateException, ExternalEmailException, AttachmentException, ValidationException, IOException;

List<ProcessedEntity> sendBulkEmail(@Valid ExternalEmailOptionsWithAttachmentsDto options, List<ReferenceDto> rootEntityReferences)
throws IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import de.symeda.sormas.api.ReferenceDto;
import de.symeda.sormas.api.audit.AuditedClass;
import de.symeda.sormas.api.docgeneneration.DocumentWorkflow;
import de.symeda.sormas.api.docgeneneration.QuarantineOrderDocumentOptionsDto;
import de.symeda.sormas.api.docgeneneration.RootEntityType;
import de.symeda.sormas.api.document.DocumentReferenceDto;
import de.symeda.sormas.api.i18n.Validations;
Expand Down Expand Up @@ -53,6 +54,8 @@ public class ExternalEmailOptionsDto implements Serializable {
private String recipientEmail;
private Set<DocumentReferenceDto> attachedDocuments;

private QuarantineOrderDocumentOptionsDto quarantineOrderDocumentOptions;

public ExternalEmailOptionsDto(DocumentWorkflow documentWorkflow, RootEntityType rootEntityType, ReferenceDto rootEntityReference) {
this.documentWorkflow = documentWorkflow;
this.rootEntityType = rootEntityType;
Expand Down Expand Up @@ -98,4 +101,12 @@ public Set<DocumentReferenceDto> getAttachedDocuments() {
public void setAttachedDocuments(Set<DocumentReferenceDto> attachedDocuments) {
this.attachedDocuments = attachedDocuments;
}

public QuarantineOrderDocumentOptionsDto getQuarantineOrderDocumentOptions() {
return quarantineOrderDocumentOptions;
}

public void setQuarantineOrderDocumentOptions(QuarantineOrderDocumentOptionsDto quarantineOrderDocumentOptions) {
this.quarantineOrderDocumentOptions = quarantineOrderDocumentOptions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@
package de.symeda.sormas.api.externalemail;

import java.io.Serializable;
import java.util.Properties;
import java.util.Set;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import de.symeda.sormas.api.audit.AuditedClass;
import de.symeda.sormas.api.docgeneneration.DocumentWorkflow;
import de.symeda.sormas.api.docgeneneration.EmailAttachementDto;
import de.symeda.sormas.api.docgeneneration.QuarantineOrderDocumentOptionsDto;
import de.symeda.sormas.api.docgeneneration.RootEntityType;
import de.symeda.sormas.api.i18n.Validations;

Expand All @@ -52,6 +55,8 @@ public class ExternalEmailOptionsWithAttachmentsDto implements Serializable {
private String templateName;
private Set<EmailAttachementDto> attachedDocuments;

private QuarantineOrderDocumentOptionsDto quarantineOrderDocumentOptionsDto;

public ExternalEmailOptionsWithAttachmentsDto(DocumentWorkflow documentWorkflow, RootEntityType rootEntityType) {
this.documentWorkflow = documentWorkflow;
this.rootEntityType = rootEntityType;
Expand Down Expand Up @@ -80,4 +85,12 @@ public Set<EmailAttachementDto> getAttachedDocuments() {
public void setAttachedDocuments(Set<EmailAttachementDto> attachedDocuments) {
this.attachedDocuments = attachedDocuments;
}

public QuarantineOrderDocumentOptionsDto getQuarantineOrderDocumentOptionsDto() {
return quarantineOrderDocumentOptionsDto;
}

public void setQuarantineOrderDocumentOptionsDto(QuarantineOrderDocumentOptionsDto quarantineOrderDocumentOptionsDto) {
this.quarantineOrderDocumentOptionsDto = quarantineOrderDocumentOptionsDto;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,26 @@

package de.symeda.sormas.api.externalmessage.processing;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.function.Function;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import de.symeda.sormas.api.CountryHelper;
import de.symeda.sormas.api.caze.CaseCriteria;
import de.symeda.sormas.api.caze.CaseDataDto;
import de.symeda.sormas.api.caze.CaseSelectionDto;
import de.symeda.sormas.api.caze.CaseSimilarityCriteria;
import de.symeda.sormas.api.externalmessage.ExternalMessageDto;
import de.symeda.sormas.api.externalmessage.processing.ExternalMessageProcessingResult.EntitySelection;
import de.symeda.sormas.api.externalmessage.processing.flow.FlowThen;
import de.symeda.sormas.api.externalmessage.processing.flow.ProcessingResult;
import de.symeda.sormas.api.externalmessage.processing.flow.ProcessingResultStatus;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.infrastructure.facility.FacilityDto;
import de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto;
import de.symeda.sormas.api.infrastructure.facility.FacilityType;
import de.symeda.sormas.api.person.PersonDto;
import de.symeda.sormas.api.person.PersonReferenceDto;
import de.symeda.sormas.api.user.UserDto;
import de.symeda.sormas.api.user.UserRight;
import de.symeda.sormas.api.utils.dataprocessing.EntitySelection;
import de.symeda.sormas.api.utils.dataprocessing.HandlerCallback;
import de.symeda.sormas.api.utils.dataprocessing.ProcessingResult;
import de.symeda.sormas.api.utils.dataprocessing.ProcessingResultStatus;
import de.symeda.sormas.api.utils.dataprocessing.flow.FlowThen;

public abstract class AbstractProcessingFlow {

Expand Down Expand Up @@ -149,23 +142,6 @@ private PersonDto buildPerson() {
return personDto;
}

protected List<CaseSelectionDto> getSimilarCases(PersonReferenceDto selectedPerson, ExternalMessageDto externalMessageDto) {

if (processingFacade.isFeatureDisabled(FeatureType.CASE_SURVEILANCE)
|| !processingFacade.hasAllUserRights(UserRight.CASE_CREATE, UserRight.CASE_EDIT)) {
return Collections.emptyList();
}

CaseCriteria caseCriteria = new CaseCriteria();
caseCriteria.person(selectedPerson);
caseCriteria.disease(externalMessageDto.getDisease());
CaseSimilarityCriteria caseSimilarityCriteria = new CaseSimilarityCriteria();
caseSimilarityCriteria.caseCriteria(caseCriteria);
caseSimilarityCriteria.personUuid(selectedPerson.getUuid());

return processingFacade.getSimilarCases(caseSimilarityCriteria);
}

protected CaseDataDto buildCase(PersonDto person, ExternalMessageDto externalMessageDto) {

CaseDataDto caseDto = CaseDataDto.build(person.toReference(), externalMessageDto.getDisease());
Expand Down Expand Up @@ -202,21 +178,4 @@ protected CaseDataDto buildCase(PersonDto person, ExternalMessageDto externalMes
return caseDto;
}

public static class HandlerCallback<T> {

public final CompletableFuture<ProcessingResult<T>> futureResult;

public HandlerCallback() {
this.futureResult = new CompletableFuture<>();
}

public void done(T result) {
futureResult.complete(ProcessingResult.continueWith(result));
}

public void cancel() {
futureResult.complete(ProcessingResult.withStatus(ProcessingResultStatus.CANCELED, null));
}
}

}
Loading

0 comments on commit 2c5d5ec

Please sign in to comment.