Skip to content

Commit 4d7baab

Browse files
sergiupacurariuSergiuPacurariu
andauthored
#13252 - Create Survey pages (#13263)
* #13252 - Create Survey pages * #13252 - Create Survey pages * #13252 - Create Survey pages - changes after review * #13252 - Create Survey pages - changes after review * #13252 - Create Survey pages - changes after review --------- Co-authored-by: SergiuPacurariu <sergiu.pacurariu@she.ro>
1 parent d21613d commit 4d7baab

23 files changed

+567
-10
lines changed

sormas-api/src/main/java/de/symeda/sormas/api/FacadeProvider.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
import de.symeda.sormas.api.sormastosormas.share.outgoing.ShareRequestInfoFacade;
104104
import de.symeda.sormas.api.sormastosormas.share.outgoing.SormasToSormasShareInfoFacade;
105105
import de.symeda.sormas.api.specialcaseaccess.SpecialCaseAccessFacade;
106+
import de.symeda.sormas.api.survey.SurveyFacade;
106107
import de.symeda.sormas.api.survey.SurveyTokenFacade;
107108
import de.symeda.sormas.api.symptoms.SymptomsFacade;
108109
import de.symeda.sormas.api.systemevents.SystemEventFacade;
@@ -555,6 +556,10 @@ public static SelfReportImportFacade getSelfReportImportFacade() {
555556
return get().lookupEjbRemote(SelfReportImportFacade.class);
556557
}
557558

559+
public static SurveyFacade getSurveyFacade() {
560+
return get().lookupEjbRemote(SurveyFacade.class);
561+
}
562+
558563
public static SurveyTokenFacade getSurveyTokenFacade() {
559564
return get().lookupEjbRemote(SurveyTokenFacade.class);
560565
}

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Captions.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2071,6 +2071,7 @@ public interface Captions {
20712071
String mainMenuSelfReports = "mainMenuSelfReports";
20722072
String mainMenuShareRequests = "mainMenuShareRequests";
20732073
String mainMenuStatistics = "mainMenuStatistics";
2074+
String mainMenuSurveys = "mainMenuSurveys";
20742075
String mainMenuTasks = "mainMenuTasks";
20752076
String mainMenuUsers = "mainMenuUsers";
20762077
String MaternalHistory_ageAtBirth = "MaternalHistory.ageAtBirth";
@@ -2690,7 +2691,9 @@ public interface Captions {
26902691
String surveillanceReportNoReportsForCase = "surveillanceReportNoReportsForCase";
26912692
String surveyGenerate = "surveyGenerate";
26922693
String surveyNew = "surveyNew";
2694+
String surveyNewSurvey = "surveyNewSurvey";
26932695
String surveySend = "surveySend";
2696+
String surveySurveyList = "surveySurveyList";
26942697
String SurveyToken = "SurveyToken";
26952698
String SurveyToken_assignmentDate = "SurveyToken.assignmentDate";
26962699
String SurveyToken_caseAssignedTo = "SurveyToken.caseAssignedTo";
@@ -3248,6 +3251,7 @@ public interface Captions {
32483251
String View_shareRequests = "View.shareRequests";
32493252
String View_statistics = "View.statistics";
32503253
String View_statistics_database_export = "View.statistics.database-export";
3254+
String View_surveys = "View.surveys";
32513255
String View_tasks = "View.tasks";
32523256
String View_tasks_archive = "View.tasks.archive";
32533257
String View_tasks_sub = "View.tasks.sub";

sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,7 @@ public interface Strings {
549549
String headingCreateNewPerson = "headingCreateNewPerson";
550550
String headingCreateNewPrescription = "headingCreateNewPrescription";
551551
String headingCreateNewSample = "headingCreateNewSample";
552+
String headingCreateNewSurvey = "headingCreateNewSurvey";
552553
String headingCreateNewTask = "headingCreateNewTask";
553554
String headingCreateNewTaskQuestion = "headingCreateNewTaskQuestion";
554555
String headingCreateNewTravelEntry = "headingCreateNewTravelEntry";
@@ -1544,6 +1545,8 @@ public interface Strings {
15441545
String messageSubcontinentDearchivingNotPossible = "messageSubcontinentDearchivingNotPossible";
15451546
String messageSubcontinentsArchived = "messageSubcontinentsArchived";
15461547
String messageSubcontinentsDearchived = "messageSubcontinentsDearchived";
1548+
String messageSurveyCreated = "messageSurveyCreated";
1549+
String messageSurveySaved = "messageSurveySaved";
15471550
String messageSymptomsHint = "messageSymptomsHint";
15481551
String messageSymptomsVisitHint = "messageSymptomsVisitHint";
15491552
String messageSyncUsersFromAuthProviderConfigurationError = "messageSyncUsersFromAuthProviderConfigurationError";
@@ -1789,6 +1792,7 @@ public interface Strings {
17891792
String promptSelfReportEpiWeekFrom = "promptSelfReportEpiWeekFrom";
17901793
String promptSelfReportEpiWeekTo = "promptSelfReportEpiWeekTo";
17911794
String promptSelfReportFreeTextSearch = "promptSelfReportFreeTextSearch";
1795+
String promptSurveyFreeTextSearch = "promptSurveyFreeTextSearch";
17921796
String promptTaskDateFrom = "promptTaskDateFrom";
17931797
String promptTaskDateTo = "promptTaskDateTo";
17941798
String promptTaskDateType = "promptTaskDateType";

sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyCriteria.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@
1919
package de.symeda.sormas.api.survey;
2020

2121
import de.symeda.sormas.api.Disease;
22+
import de.symeda.sormas.api.utils.IgnoreForUrl;
2223
import de.symeda.sormas.api.utils.criteria.BaseCriteria;
2324

2425
public class SurveyCriteria extends BaseCriteria {
2526
private static final long serialVersionUID = -7237755677408791266L;
27+
public static final String FREE_TEXT = "freeText";
28+
public static final String DISEASE = "disease";
2629

2730
private String freeText;
2831
private Disease disease;
2932

33+
@IgnoreForUrl
3034
public String getFreeText() {
3135
return freeText;
3236
}

sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public class SurveyDto extends EntityDto {
3535

3636
public static final String I18N_PREFIX = "Survey";
3737

38+
public static final String DISEASE = "disease";
39+
public static final String SURVEY_NAME = "name";
40+
3841
@NotBlank(message = Validations.requiredField)
3942
@Size(max = FieldConstraints.CHARACTER_LIMIT_SMALL, message = Validations.textTooLong)
4043
private String name;

sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyFacade.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,10 @@ public interface SurveyFacade {
3434
List<SurveyIndexDto> getIndexList(SurveyCriteria criteria, Integer first, Integer max, List<SortProperty> sortProperties);
3535

3636
void deletePermanent(String uuid);
37+
38+
boolean exists(String uuid);
39+
40+
SurveyReferenceDto getReferenceByUuid(String uuid);
41+
42+
Boolean isEditAllowed(String uuid);
3743
}

sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyIndexDto.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public class SurveyIndexDto extends AbstractUuidDto {
2222

2323
private static final long serialVersionUID = -5888585683689386052L;
2424

25+
public static final String DISEASE = "disease";
26+
public static final String SURVEY_NAME = "name";
27+
2528
private final String name;
2629
private final Disease disease;
2730

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,28 @@
11
/*
22
* SORMAS® - Surveillance Outbreak Response Management & Analysis System
33
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI)
4-
*
54
* This program is free software: you can redistribute it and/or modify
65
* it under the terms of the GNU General Public License as published by
76
* the Free Software Foundation, either version 3 of the License, or
87
* (at your option) any later version.
9-
*
108
* This program is distributed in the hope that it will be useful,
119
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1311
* GNU General Public License for more details.
14-
*
1512
* You should have received a copy of the GNU General Public License
16-
* along with this program. If not, see <https://www.gnu.org/licenses/>.
13+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
1714
*/
1815

1916
package de.symeda.sormas.api.survey;
2017

2118
import de.symeda.sormas.api.ReferenceDto;
2219

2320
public class SurveyReferenceDto extends ReferenceDto {
24-
private static final long serialVersionUID = -8612115227784272980L;
2521

26-
public SurveyReferenceDto(String uuid, String caption) {
27-
super(uuid, caption);
28-
}
22+
private static final long serialVersionUID = -8612115227784272980L;
23+
24+
public SurveyReferenceDto(String uuid, String surveyName) {
25+
setUuid(uuid);
26+
setCaption(surveyName != null ? surveyName : "");
27+
}
2928
}

sormas-api/src/main/resources/captions.properties

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,7 @@ mainMenuUsers=Users
17431743
mainMenuAggregateReports=Aggregate
17441744
mainMenuShareRequests=Shares
17451745
mainMenuSelfReports=Self Reports
1746+
mainMenuSurveys = Surveys
17461747
MaternalHistory.childrenNumber=Total number of children
17471748
MaternalHistory.ageAtBirth=Mother's age at birth of infant patient
17481749
MaternalHistory.conjunctivitis=Conjunctivitis
@@ -3138,6 +3139,7 @@ View.users.sub=
31383139
View.shareRequests=Share directory
31393140
View.environments=Environment directory
31403141
View.selfreports=Self reports directory
3142+
View.surveys=Surveys directory
31413143
# Visit
31423144
visitNewVisit=New visit
31433145
Visit=Visit
@@ -3249,6 +3251,8 @@ cancelExternalFollowUpButton=Cancel external follow-up
32493251
createSymptomJournalAccountButton=Create PIA Account
32503252
registerInPatientDiaryButton=Register in CLIMEDO eDiary
32513253
symptomJournalOptionsButton=PIA eDiary
3254+
surveyNewSurvey = New survey
3255+
surveySurveyList = Survey list
32523256
patientDiaryOptionsButton=CLIMEDO eDiary
32533257
openInSymptomJournalButton=Open in PIA
32543258
openInPatientDiaryButton=Open in CLIMEDO

sormas-api/src/main/resources/strings.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ headingCreateNewImmunization = Create new immunization
518518
headingCreateNewPerson = Create new person
519519
headingCreateNewPrescription = Create new prescription
520520
headingCreateNewSample = Create new sample
521+
headingCreateNewSurvey = Create new survey
521522
headingCreateNewTask = Create new task
522523
headingCreateNewTaskQuestion = Create new task?
523524
headingCreateNewTreatment = Create new treatment
@@ -1448,6 +1449,8 @@ messageContinentsArchived = All selected continents have been archived
14481449
messageContinentsDearchived = All selected continents have been de-archived
14491450
messageSubcontinentsArchived = All selected subcontinents have been archived
14501451
messageSubcontinentsDearchived = All selected subcontinents have been de-archived
1452+
messageSurveySaved = Survey saved
1453+
messageSurveyCreated = Survey created
14511454
messageCountriesArchived = All selected countries have been archived
14521455
messageCountriesDearchived = All selected regions have been de-archived
14531456
messageRegionsArchived = All selected regions have been archived
@@ -1809,6 +1812,8 @@ promptCustomizableEnumTranslationLanguage = Language
18091812
promptCustomizableEnumTranslationCaption = Translated caption
18101813
promptCustomizableEnumSearchField = Search by value or caption...
18111814

1815+
promptSurveyFreeTextSearch = Name
1816+
18121817
# Unsaved changes
18131818
unsavedChanges.warningTitle = Unsaved changes
18141819
unsavedChanges.warningMessage = This form contains unsaved changes. Please decide whether you want to cancel the action you have just taken in order to review them, or save or discard the changes and continue.

0 commit comments

Comments
 (0)