Skip to content

Commit 7b5ac33

Browse files
authored
Add an import feature at cases to update the survey token responses #13199 (#13273)
* Add an import feature at cases to update the survey token responses #13199
1 parent 64d23e7 commit 7b5ac33

File tree

20 files changed

+326
-3
lines changed

20 files changed

+326
-3
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public interface Captions {
8585
String actionImportAllContinents = "actionImportAllContinents";
8686
String actionImportAllCountries = "actionImportAllCountries";
8787
String actionImportAllSubcontinents = "actionImportAllSubcontinents";
88+
String actionImportSurveyTokenResponses = "actionImportSurveyTokenResponses";
8889
String actionImportSurveyTokens = "actionImportSurveyTokens";
8990
String actionLastModifiedByLabel = "actionLastModifiedByLabel";
9091
String actionLeaveBulkEditMode = "actionLeaveBulkEditMode";

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ public interface Strings {
710710
String headingImportRegions = "headingImportRegions";
711711
String headingImportSelfReports = "headingImportSelfReports";
712712
String headingImportSubcontinents = "headingImportSubcontinents";
713+
String headingImportSurveyTokenResponses = "headingImportSurveyTokenResponses";
713714
String headingImportSurveyTokens = "headingImportSurveyTokens";
714715
String headingImportTravelEntries = "headingImportTravelEntries";
715716
String headingIncorrectDateRange = "headingIncorrectDateRange";

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,8 @@ public interface Validations {
267267
String taskMissingEventLink = "taskMissingEventLink";
268268
String textSizeNotInRange = "textSizeNotInRange";
269269
String textTooLong = "textTooLong";
270+
String tokenColumnWasNotFound = "tokenColumnWasNotFound";
271+
String tokenWasNotFound = "tokenWasNotFound";
270272
String userNameNotUnique = "userNameNotUnique";
271273
String uuidPatternNotMatching = "uuidPatternNotMatching";
272274
String vaccineDosesFormat = "vaccineDosesFormat";

sormas-api/src/main/java/de/symeda/sormas/api/importexport/ImportFacade.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ public interface ImportFacade {
7575

7676
void generateSurveyTokenImportTemplateFile(List<FeatureConfigurationDto> featureConfigurations) throws IOException, NoSuchFieldException;
7777

78+
void generateSurveyTokenResponsesImportTemplateFile(List<FeatureConfigurationDto> featureConfigurations) throws IOException, NoSuchFieldException;
79+
7880
String getCaseImportTemplateFileName();
7981

8082
String getCaseImportTemplateFilePath();
@@ -158,4 +160,6 @@ public interface ImportFacade {
158160
String getSelfReportImportTemplateFileName();
159161

160162
String getSurveyTokenImportTemplateFilePath();
163+
164+
String getSurveyTokenResponsesImportTemplateFilePath();
161165
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public class SurveyTokenCriteria extends BaseCriteria {
2424

2525
private SurveyReferenceDto survey;
2626
private String tokenLike;
27+
private String token;
2728
private CaseReferenceDto caseAssignedTo;
2829

2930
public SurveyReferenceDto getSurvey() {
@@ -47,6 +48,14 @@ public void setTokenLike(String tokenLike) {
4748
this.tokenLike = tokenLike;
4849
}
4950

51+
public String getToken() {
52+
return token;
53+
}
54+
55+
public void setToken(String token) {
56+
this.token = token;
57+
}
58+
5059
public SurveyTokenCriteria tokenLike(String tokenLike) {
5160
setTokenLike(tokenLike);
5261
return this;

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,9 @@ public interface SurveyTokenFacade {
3939

4040
String getSurveyTokensImportTemplateFileName();
4141

42+
String getSurveyTokenResponsesImportTemplateFilePath();
43+
44+
String getSurveyTokenResponsesImportTemplateFileName();
45+
46+
SurveyTokenDto getBySurveyAndToken(SurveyReferenceDto survey, String token);
4247
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ actionConfirmAction = Confirm action
199199
actionAefiSelectPrimarySuspectVaccination = Select Suspect Vaccination
200200
actionAefiAssignNewReportingIdNumber = "Assign New AEFI ID"
201201
actionImportSurveyTokens = Import survey tokens
202+
actionImportSurveyTokenResponses = Import survey token responses
202203
activityAsCaseFlightNumber=Flight number
203204
ActivityAsCase=Activity as case
204205
ActivityAsCase.startDate=Start of activity

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,7 @@ headingSurveyGenerateDocument=Generate document
916916
headingSurveySendDocument=Send document
917917
headingErrorSendingExternalEmail=Error sending email
918918
headingImportSurveyTokens = Import Survey Tokens
919+
headingImportSurveyTokenResponses = Import Survey Token Responses
919920

920921
# Info texts
921922
infoActivityAsCaseInvestigation = <i>Please document ALL relevant activities after infection:</i>

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ externalMessagePdfConversionError = The messages could not be converted to PDF.
253253
taskMissingCaseLink = Tasks with case context have to be linked to an existing case
254254
taskMissingContactLink = Tasks with contact context have to be linked to an existing contact
255255
taskMissingEventLink = Tasks with event context have to be linked to an existing event
256+
tokenWasNotFound = Token was not found: %s
257+
tokenColumnWasNotFound = Column 'token' was not found in import file
256258
externalMessageConversionError = The external messages could not be converted.
257259
externalMessageDisplayError = The external message could not be converted to a graphical representation.
258260
externalMessageFetchError = The external messages could not be fetched from the external system.

sormas-backend/src/main/java/de/symeda/sormas/backend/common/StartupShutdownService.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,6 +1024,12 @@ private void createImportTemplateFiles(List<FeatureConfigurationDto> featureConf
10241024
} catch (IOException | NoSuchFieldException e) {
10251025
logger.error("Could not create survey token import template .csv file.");
10261026
}
1027+
1028+
try {
1029+
importFacade.generateSurveyTokenResponsesImportTemplateFile(featureConfigurations);
1030+
} catch (IOException | NoSuchFieldException e) {
1031+
logger.error("Could not create survey token responses import template .csv file.");
1032+
}
10271033
}
10281034

10291035
private void createMissingDiseaseConfigurations() {

0 commit comments

Comments
 (0)