-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #13250 Create Survey data structure * #13250 Create Survey data structure - fixed api tests --------- Co-authored-by: Levente Gal <levente.gal.ext@vitagroup.ag>
- Loading branch information
1 parent
101067d
commit e28777d
Showing
39 changed files
with
1,885 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyCriteria.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.symeda.sormas.api.survey; | ||
|
||
import de.symeda.sormas.api.Disease; | ||
import de.symeda.sormas.api.utils.criteria.BaseCriteria; | ||
|
||
public class SurveyCriteria extends BaseCriteria { | ||
private static final long serialVersionUID = -7237755677408791266L; | ||
|
||
private String freeText; | ||
private Disease disease; | ||
|
||
public String getFreeText() { | ||
return freeText; | ||
} | ||
|
||
public void setFreeText(String freeText) { | ||
this.freeText = freeText; | ||
} | ||
|
||
public SurveyCriteria freeText(String freeText) { | ||
setFreeText(freeText); | ||
return this; | ||
} | ||
|
||
public Disease getDisease() { | ||
return disease; | ||
} | ||
|
||
public void setDisease(Disease disease) { | ||
this.disease = disease; | ||
} | ||
|
||
public SurveyCriteria disease(Disease disease) { | ||
setDisease(disease); | ||
return this; | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.symeda.sormas.api.survey; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Size; | ||
|
||
import de.symeda.sormas.api.Disease; | ||
import de.symeda.sormas.api.EntityDto; | ||
import de.symeda.sormas.api.docgeneneration.DocumentTemplateReferenceDto; | ||
import de.symeda.sormas.api.feature.FeatureType; | ||
import de.symeda.sormas.api.i18n.Validations; | ||
import de.symeda.sormas.api.utils.DataHelper; | ||
import de.symeda.sormas.api.utils.DependingOnFeatureType; | ||
import de.symeda.sormas.api.utils.FieldConstraints; | ||
|
||
@DependingOnFeatureType(featureType = FeatureType.SURVEYS) | ||
public class SurveyDto extends EntityDto { | ||
|
||
private static final long serialVersionUID = 8680621267053679223L; | ||
|
||
public static final String I18N_PREFIX = "Survey"; | ||
|
||
@NotBlank(message = Validations.requiredField) | ||
@Size(max = FieldConstraints.CHARACTER_LIMIT_SMALL, message = Validations.textTooLong) | ||
private String name; | ||
@NotNull(message = Validations.requiredField) | ||
private Disease disease; | ||
private DocumentTemplateReferenceDto documentTemplate; | ||
private DocumentTemplateReferenceDto emailTemplate; | ||
|
||
public static SurveyDto build() { | ||
SurveyDto survey = new SurveyDto(); | ||
survey.setUuid(DataHelper.createUuid()); | ||
|
||
return survey; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public Disease getDisease() { | ||
return disease; | ||
} | ||
|
||
public void setDisease(Disease disease) { | ||
this.disease = disease; | ||
} | ||
|
||
public DocumentTemplateReferenceDto getDocumentTemplate() { | ||
return documentTemplate; | ||
} | ||
|
||
public void setDocumentTemplate(DocumentTemplateReferenceDto documentTemplate) { | ||
this.documentTemplate = documentTemplate; | ||
} | ||
|
||
public DocumentTemplateReferenceDto getEmailTemplate() { | ||
return emailTemplate; | ||
} | ||
|
||
public void setEmailTemplate(DocumentTemplateReferenceDto emailTemplate) { | ||
this.emailTemplate = emailTemplate; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyFacade.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.symeda.sormas.api.survey; | ||
|
||
import java.util.List; | ||
|
||
import javax.ejb.Remote; | ||
import javax.validation.Valid; | ||
|
||
import de.symeda.sormas.api.utils.SortProperty; | ||
|
||
@Remote | ||
public interface SurveyFacade { | ||
|
||
SurveyDto save(@Valid SurveyDto dto); | ||
|
||
SurveyDto getByUuid(String uuid); | ||
|
||
long count(SurveyCriteria criteria); | ||
|
||
List<SurveyIndexDto> getIndexList(SurveyCriteria criteria, Integer first, Integer max, List<SortProperty> sortProperties); | ||
|
||
void deletePermanent(String uuid); | ||
} |
41 changes: 41 additions & 0 deletions
41
sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyIndexDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.symeda.sormas.api.survey; | ||
|
||
import de.symeda.sormas.api.Disease; | ||
import de.symeda.sormas.api.uuid.AbstractUuidDto; | ||
|
||
public class SurveyIndexDto extends AbstractUuidDto { | ||
|
||
private static final long serialVersionUID = -5888585683689386052L; | ||
|
||
private final String name; | ||
private final Disease disease; | ||
|
||
public SurveyIndexDto(String uuid, String name, Disease disease) { | ||
super(uuid); | ||
this.name = name; | ||
this.disease = disease; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Disease getDisease() { | ||
return disease; | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyReferenceDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.symeda.sormas.api.survey; | ||
|
||
import de.symeda.sormas.api.ReferenceDto; | ||
|
||
public class SurveyReferenceDto extends ReferenceDto { | ||
private static final long serialVersionUID = -8612115227784272980L; | ||
|
||
public SurveyReferenceDto(String uuid, String caption) { | ||
super(uuid, caption); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
sormas-api/src/main/java/de/symeda/sormas/api/survey/SurveyTokenCriteria.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* SORMAS® - Surveillance Outbreak Response Management & Analysis System | ||
* Copyright © 2016-2025 Helmholtz-Zentrum für Infektionsforschung GmbH (HZI) | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package de.symeda.sormas.api.survey; | ||
|
||
import de.symeda.sormas.api.utils.criteria.BaseCriteria; | ||
|
||
public class SurveyTokenCriteria extends BaseCriteria { | ||
|
||
private static final long serialVersionUID = 4551275234176171493L; | ||
|
||
private SurveyReferenceDto survey; | ||
private String tokenLike; | ||
|
||
public SurveyReferenceDto getSurvey() { | ||
return survey; | ||
} | ||
|
||
public void setSurvey(SurveyReferenceDto survey) { | ||
this.survey = survey; | ||
} | ||
|
||
public SurveyTokenCriteria survey(SurveyReferenceDto survey) { | ||
setSurvey(survey); | ||
return this; | ||
} | ||
|
||
public String getTokenLike() { | ||
return tokenLike; | ||
} | ||
|
||
public void setTokenLike(String tokenLike) { | ||
this.tokenLike = tokenLike; | ||
} | ||
|
||
public SurveyTokenCriteria tokenLike(String tokenLike) { | ||
setTokenLike(tokenLike); | ||
return this; | ||
} | ||
} |
Oops, something went wrong.