Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/#13131 Adding EIOS Integration to SORMAS #13136

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import de.symeda.sormas.api.externaljournal.PatientDiaryConfig;
import de.symeda.sormas.api.externaljournal.SymptomJournalConfig;
import de.symeda.sormas.api.geo.GeoLatLon;
import de.symeda.sormas.api.news.eios.EiosConfig;
import de.symeda.sormas.api.sormastosormas.SormasToSormasConfig;

@Remote
Expand Down Expand Up @@ -159,4 +160,8 @@ public interface ConfigFacade {
void resetRequestContext();

String[] getAllowedFileExtensions();

EiosConfig getEIOSConfig();

String getEiosBoardIds();
}
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
import de.symeda.sormas.api.infrastructure.region.RegionFacade;
import de.symeda.sormas.api.infrastructure.subcontinent.SubcontinentFacade;
import de.symeda.sormas.api.manualmessagelog.ManualMessageLogFacade;
import de.symeda.sormas.api.news.NewsFacade;
import de.symeda.sormas.api.outbreak.OutbreakFacade;
import de.symeda.sormas.api.person.PersonFacade;
import de.symeda.sormas.api.report.AggregateReportFacade;
Expand Down Expand Up @@ -539,6 +540,10 @@ public static SelfReportImportFacade getSelfReportImportFacade() {
return get().lookupEjbRemote(SelfReportImportFacade.class);
}

public static NewsFacade getNewsFacade() {
return get().lookupEjbRemote(NewsFacade.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 @@ -330,7 +330,8 @@ public enum FeatureType {
CASE_SURVEILANCE,
CONTACT_TRACING },
null,
ImmutableMap.of(FeatureTypeProperty.S2S_SHARING, Boolean.FALSE));
ImmutableMap.of(FeatureTypeProperty.S2S_SHARING, Boolean.FALSE)),
NEWS_FEATURE(true, false, null, null, null);

public static final FeatureType[] SURVEILLANCE_FEATURE_TYPES = {
FeatureType.CASE_SURVEILANCE,
Expand Down
22 changes: 22 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,8 @@ public interface Captions {
String countryActiveCountries = "countryActiveCountries";
String countryAllCountries = "countryAllCountries";
String countryArchivedCountries = "countryArchivedCountries";
String createEvent = "createEvent";
String createNew = "createNew";
String createSymptomJournalAccountButton = "createSymptomJournalAccountButton";
String creationDate = "creationDate";
String CustomizableEnum_hasDetails = "CustomizableEnum.hasDetails";
Expand Down Expand Up @@ -1559,6 +1561,7 @@ public interface Captions {
String HealthConditions_otherConditions = "HealthConditions.otherConditions";
String HealthConditions_sickleCellDisease = "HealthConditions.sickleCellDisease";
String HealthConditions_tuberculosis = "HealthConditions.tuberculosis";
String hideDescription = "hideDescription";
String humanSampleViewType = "humanSampleViewType";
String Immunization = "Immunization";
String Immunization_additionalDetails = "Immunization.additionalDetails";
Expand Down Expand Up @@ -1752,6 +1755,22 @@ public interface Captions {
String moreActions = "moreActions";
String name = "name";
String nationalHealthId = "nationalHealthId";
String news = "news";
String News_community = "News.community";
String News_description = "News.description";
String News_disease = "News.disease";
String News_district = "News.district";
String News_link = "News.link";
String News_newsDate = "News.newsDate";
String News_region = "News.region";
String News_riskLevel = "News.riskLevel";
String News_status = "News.status";
String News_title = "News.title";
String newsAction = "newsAction";
String NewsCriteria_endDate = "NewsCriteria.endDate";
String NewsCriteria_startDate = "NewsCriteria.startDate";
String newsList = "newsList";
String newsUpdate = "newsUpdate";
String notAvailableShort = "notAvailableShort";
String notificationType = "notificationType";
String notificationType_caption = "notificationType.caption";
Expand All @@ -1764,6 +1783,7 @@ public interface Captions {
String openInPatientDiaryButton = "openInPatientDiaryButton";
String openInSymptomJournalButton = "openInSymptomJournalButton";
String openLinkedCaseToImmunizationButton = "openLinkedCaseToImmunizationButton";
String openLinkInTab = "openLinkInTab";
String options = "options";
String otherDeletionReason = "otherDeletionReason";
String outbreakAffectedDistricts = "outbreakAffectedDistricts";
Expand Down Expand Up @@ -2220,6 +2240,7 @@ public interface Captions {
String selfReportProcess = "selfReportProcess";
String selfReportSelfReportsList = "selfReportSelfReportsList";
String sex = "sex";
String showDescription = "showDescription";
String showPlacesOnMap = "showPlacesOnMap";
String singleDayEventDate = "singleDayEventDate";
String singleDayEventEvolutionDate = "singleDayEventEvolutionDate";
Expand Down Expand Up @@ -2671,6 +2692,7 @@ public interface Captions {
String treatmentOpenPrescription = "treatmentOpenPrescription";
String unassigned = "unassigned";
String unknown = "unknown";
String updateNews = "updateNews";
String User = "User";
String User_active = "User.active";
String User_address = "User.address";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ public interface Strings {
String errorDeletingDocumentTemplate = "errorDeletingDocumentTemplate";
String errorDocumentGeneration = "errorDocumentGeneration";
String errorDocumentGenerationMultipleDiseasses = "errorDocumentGenerationMultipleDiseasses";
String errorEiosRequestToken = "errorEiosRequestToken";
String errorEntityNotEditable = "errorEntityNotEditable";
String errorEntityOutdated = "errorEntityOutdated";
String errorEnvironmentSampleNoDispatchRight = "errorEnvironmentSampleNoDispatchRight";
Expand Down Expand Up @@ -1543,6 +1544,10 @@ public interface Strings {
String mmhg = "mmhg";
String month = "month";
String nameOf = "nameOf";
String newsData = "newsData";
String newsEndDate = "newsEndDate";
String newsFilterText = "newsFilterText";
String newsStartDate = "newsStartDate";
String no = "no";
String none = "none";
String notAnswered = "notAnswered";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package de.symeda.sormas.api.news;

import java.util.List;

import com.fasterxml.jackson.annotation.JsonProperty;

public class NewsBodyResponse {

@JsonProperty("data")
private List<NewsIndexDto> newsList;
@JsonProperty("meta")
private NewsMetaResponseDto newsMetaResponse;

public List<NewsIndexDto> getNewsList() {
return newsList;
}

public void setNewsList(List<NewsIndexDto> newsList) {
this.newsList = newsList;
}

public NewsMetaResponseDto getNewsMetaResponse() {
return newsMetaResponse;
}

public void setNewsMetaResponse(NewsMetaResponseDto newsMetaResponse) {
this.newsMetaResponse = newsMetaResponse;
}
}
26 changes: 26 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/news/NewsConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package de.symeda.sormas.api.news;

import de.symeda.sormas.api.audit.AuditedClass;

@AuditedClass
public class NewsConfig {

private String baseUrl;
private String authToken;

public String getBaseUrl() {
return baseUrl;
}

public void setBaseUrl(String baseUrl) {
this.baseUrl = baseUrl;
}

public String getAuthToken() {
return authToken;
}

public void setAuthToken(String authToken) {
this.authToken = authToken;
}
}
106 changes: 106 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/news/NewsCriteria.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package de.symeda.sormas.api.news;

import java.util.Date;

import de.symeda.sormas.api.event.RiskLevel;
import de.symeda.sormas.api.infrastructure.community.CommunityReferenceDto;
import de.symeda.sormas.api.infrastructure.district.DistrictReferenceDto;
import de.symeda.sormas.api.infrastructure.region.RegionReferenceDto;
import de.symeda.sormas.api.news.eios.NewsStatus;
import de.symeda.sormas.api.utils.IgnoreForUrl;
import de.symeda.sormas.api.utils.criteria.BaseCriteria;

public class NewsCriteria extends BaseCriteria {

public static final String REGION = "region";
public static final String DISTRICT = "district";
public static final String COMMUNITY = "community";
public final static String RISK_LEVE = "riskLevel";
public final static String STATUS = "status";
public final static String START_DATE = "startDate";
public final static String END_DATE = "endDate";
public final static String IS_USER_LEVEL_FILER = "onlyInMyJurisdiction";
public final static String NEWS_LIKE = "newsLike";
private RegionReferenceDto region;
private DistrictReferenceDto district;
private CommunityReferenceDto community;
private RiskLevel riskLevel;
private NewsStatus status;
private Date startDate;
private Date endDate;
private Boolean onlyInMyJurisdiction;
private String newsLike;

public RegionReferenceDto getRegion() {
return region;
}

public void setRegion(RegionReferenceDto region) {
this.region = region;
}

public DistrictReferenceDto getDistrict() {
return district;
}

public void setDistrict(DistrictReferenceDto district) {
this.district = district;
}

public CommunityReferenceDto getCommunity() {
return community;
}

public void setCommunity(CommunityReferenceDto community) {
this.community = community;
}

public RiskLevel getRiskLevel() {
return riskLevel;
}

public void setRiskLevel(RiskLevel riskLevel) {
this.riskLevel = riskLevel;
}

public NewsStatus getStatus() {
return status;
}

public void setStatus(NewsStatus status) {
this.status = status;
}

public Date getStartDate() {
return startDate;
}

public void setStartDate(Date startDate) {
this.startDate = startDate;
}

public Date getEndDate() {
return endDate;
}

public void setEndDate(Date endDate) {
this.endDate = endDate;
}

public Boolean getOnlyInMyJurisdiction() {
return onlyInMyJurisdiction;
}

public void setOnlyInMyJurisdiction(Boolean onlyInMyJurisdiction) {
this.onlyInMyJurisdiction = onlyInMyJurisdiction;
}

@IgnoreForUrl
public String getNewsLike() {
return newsLike;
}

public void setNewsLike(String newsLike) {
this.newsLike = newsLike;
}
}
Loading