Skip to content

Commit

Permalink
Feature 13085 self report edit (#13100)
Browse files Browse the repository at this point in the history
* #13085 Add an edit/delete/archive functionality for Self Reporting messages (UI) - WIP
  • Loading branch information
leventegal-she authored May 23, 2024
1 parent d23691e commit a564f9a
Show file tree
Hide file tree
Showing 27 changed files with 1,092 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2184,16 +2184,22 @@ public interface Captions {
String sampleSpecimenNotAdequate = "sampleSpecimenNotAdequate";
String selectOtherSample = "selectOtherSample";
String selectSimilarSample = "selectSimilarSample";
String SelfReport = "SelfReport";
String SelfReport_address = "SelfReport.address";
String SelfReport_birthdateDD = "SelfReport.birthdateDD";
String SelfReport_birthdateMM = "SelfReport.birthdateMM";
String SelfReport_birthdateYYYY = "SelfReport.birthdateYYYY";
String SelfReport_comment = "SelfReport.comment";
String SelfReport_contactDate = "SelfReport.contactDate";
String SelfReport_dateOfSymptoms = "SelfReport.dateOfSymptoms";
String SelfReport_dateOfTest = "SelfReport.dateOfTest";
String SelfReport_dateWorkplace = "SelfReport.dateWorkplace";
String SelfReport_disease = "SelfReport.disease";
String SelfReport_diseaseVariant = "SelfReport.diseaseVariant";
String SelfReport_email = "SelfReport.email";
String SelfReport_firstName = "SelfReport.firstName";
String SelfReport_investigationStatus = "SelfReport.investigationStatus";
String SelfReport_isolationDate = "SelfReport.isolationDate";
String SelfReport_lastName = "SelfReport.lastName";
String SelfReport_nationalHealthId = "SelfReport.nationalHealthId";
String SelfReport_phoneNumber = "SelfReport.phoneNumber";
Expand All @@ -2202,10 +2208,12 @@ public interface Captions {
String SelfReport_responsibleUser = "SelfReport.responsibleUser";
String SelfReport_sex = "SelfReport.sex";
String SelfReport_type = "SelfReport.type";
String SelfReport_workplace = "SelfReport.workplace";
String selfReportActiveEnvironments = "selfReportActiveEnvironments";
String selfReportAllActiveAndArchivedEnvironments = "selfReportAllActiveAndArchivedEnvironments";
String selfReportArchivedEnvironments = "selfReportArchivedEnvironments";
String selfReportDeletedEnvironments = "selfReportDeletedEnvironments";
String selfReportSelfReportsList = "selfReportSelfReportsList";
String sex = "sex";
String showPlacesOnMap = "showPlacesOnMap";
String singleDayEventDate = "singleDayEventDate";
Expand Down
10 changes: 10 additions & 0 deletions sormas-api/src/main/java/de/symeda/sormas/api/i18n/Strings.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public interface Strings {
String confirmationArchivePointsOfEntry = "confirmationArchivePointsOfEntry";
String confirmationArchiveRegion = "confirmationArchiveRegion";
String confirmationArchiveRegions = "confirmationArchiveRegions";
String confirmationArchiveSelfReport = "confirmationArchiveSelfReport";
String confirmationArchiveSubcontinent = "confirmationArchiveSubcontinent";
String confirmationArchiveSubcontinents = "confirmationArchiveSubcontinents";
String confirmationArchiveTask = "confirmationArchiveTask";
Expand Down Expand Up @@ -126,6 +127,7 @@ public interface Strings {
String confirmationDearchivePointsOfEntry = "confirmationDearchivePointsOfEntry";
String confirmationDearchiveRegion = "confirmationDearchiveRegion";
String confirmationDearchiveRegions = "confirmationDearchiveRegions";
String confirmationDearchiveSelfReport = "confirmationDearchiveSelfReport";
String confirmationDearchiveSubcontinent = "confirmationDearchiveSubcontinent";
String confirmationDearchiveSubcontinents = "confirmationDearchiveSubcontinents";
String confirmationDearchiveTask = "confirmationDearchiveTask";
Expand Down Expand Up @@ -275,6 +277,7 @@ public interface Strings {
String entityRegions = "entityRegions";
String entitySample = "entitySample";
String entitySamples = "entitySamples";
String entitySelfReport = "entitySelfReport";
String entityStatistics = "entityStatistics";
String entitySubcontinents = "entitySubcontinents";
String entityTask = "entityTask";
Expand Down Expand Up @@ -416,6 +419,7 @@ public interface Strings {
String headingArchiveEventGroup = "headingArchiveEventGroup";
String headingArchiveEventParticipant = "headingArchiveEventParticipant";
String headingArchiveImmunization = "headingArchiveImmunization";
String headingArchiveSelfReport = "headingArchiveSelfReport";
String headingArchiveTravelEntry = "headingArchiveTravelEntry";
String headingAutomaticDeletionStarted = "headingAutomaticDeletionStarted";
String headingBulkEmailMaxAttachedFiles = "headingBulkEmailMaxAttachedFiles";
Expand Down Expand Up @@ -535,6 +539,7 @@ public interface Strings {
String headingDearchiveEventGroup = "headingDearchiveEventGroup";
String headingDearchiveEventParticipant = "headingDearchiveEventParticipant";
String headingDearchiveImmunization = "headingDearchiveImmunization";
String headingDearchiveSelfReport = "headingDearchiveSelfReport";
String headingDearchiveTravelEntry = "headingDearchiveTravelEntry";
String headingDearchivingNotPossible = "headingDearchivingNotPossible";
String headingDefineOutbreakDistricts = "headingDefineOutbreakDistricts";
Expand Down Expand Up @@ -709,6 +714,7 @@ public interface Strings {
String headingNoPrescriptionsSelected = "headingNoPrescriptionsSelected";
String headingNoRowsSelected = "headingNoRowsSelected";
String headingNoSamplesSelected = "headingNoSamplesSelected";
String headingNoSelfReportsSelected = "headingNoSelfReportsSelected";
String headingNoTasksSelected = "headingNoTasksSelected";
String headingNoTravelEntriesSelected = "headingNoTravelEntriesSelected";
String headingNoTreatmentsSelected = "headingNoTreatmentsSelected";
Expand Down Expand Up @@ -1401,6 +1407,7 @@ public interface Strings {
String messageNoPrescriptionsSelected = "messageNoPrescriptionsSelected";
String messageNoRowsSelected = "messageNoRowsSelected";
String messageNoSamplesSelected = "messageNoSamplesSelected";
String messageNoSelfReportsSelected = "messageNoSelfReportsSelected";
String messageNoTasksSelected = "messageNoTasksSelected";
String messageNoTravelEntriesSelected = "messageNoTravelEntriesSelected";
String messageNoTreatmentsSelected = "messageNoTreatmentsSelected";
Expand Down Expand Up @@ -1451,6 +1458,9 @@ public interface Strings {
String messageSamplesDeleted = "messageSamplesDeleted";
String messageSamplesRestored = "messageSamplesRestored";
String messageSelectedPeriodTooLong = "messageSelectedPeriodTooLong";
String messageSelfReportArchived = "messageSelfReportArchived";
String messageSelfReportDearchived = "messageSelfReportDearchived";
String messageSelfReportOutsideJurisdictionDeletionDenied = "messageSelfReportOutsideJurisdictionDeletionDenied";
String messageSetContactRegionAndDistrict = "messageSetContactRegionAndDistrict";
String messageSormasToSormasSimilarCaseFound = "messageSormasToSormasSimilarCaseFound";
String messageSormasToSormasSimilarCaseToContactFound = "messageSormasToSormasSimilarCaseToContactFound";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@

import java.util.Date;

import javax.validation.Valid;
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.common.DeletionReason;
import de.symeda.sormas.api.disease.DiseaseVariant;
import de.symeda.sormas.api.feature.FeatureType;
import de.symeda.sormas.api.i18n.Validations;
Expand All @@ -31,51 +32,117 @@
import de.symeda.sormas.api.user.UserReferenceDto;
import de.symeda.sormas.api.utils.DataHelper;
import de.symeda.sormas.api.utils.DependingOnFeatureType;
import de.symeda.sormas.api.utils.EmbeddedPersonalData;
import de.symeda.sormas.api.utils.EmbeddedSensitiveData;
import de.symeda.sormas.api.utils.FieldConstraints;
import de.symeda.sormas.api.utils.HideForCountries;
import de.symeda.sormas.api.utils.PersonalData;
import de.symeda.sormas.api.utils.SensitiveData;
import de.symeda.sormas.api.utils.pseudonymization.PseudonymizableDto;

@DependingOnFeatureType(featureType = FeatureType.SELF_REPORTING)
public class SelfReportDto extends EntityDto {
public class SelfReportDto extends PseudonymizableDto {

private static final long serialVersionUID = 604507951783731873L;

public static final String I18N_PREFIX = "SelfReport";

public static final String TYPE = "type";
public static final String REPORT_DATE = "reportDate";
public static final String CASE_REFERENCE = "caseReference";
public static final String DISEASE = "disease";
public static final String DISEASE_DETAILS = "diseaseDetails";
public static final String DISEASE_VARIANT = "diseaseVariant";
public static final String DISEASE_VARIANT_DETAILS = "diseaseVariantDetails";
public static final String FIRST_NAME = "firstName";
public static final String LAST_NAME = "lastName";
public static final String SEX = "sex";
public static final String BIRTHDATE_DD = "birthdateDD";
public static final String BIRTHDATE_MM = "birthdateMM";
public static final String BIRTHDATE_YYYY = "birthdateYYYY";
public static final String NATIONAL_HEALTH_ID = "nationalHealthId";
public static final String EMAIL = "email";
public static final String PHONE_NUMBER = "phoneNumber";
public static final String ADDRESS = "address";
public static final String DATE_OF_TEST = "dateOfTest";
public static final String DATE_OF_SYMPTOMS = "dateOfSymptoms";
public static final String WORKPLACE = "workplace";
public static final String DATE_WORKPLACE = "dateWorkplace";
public static final String ISOLATION_DATE = "isolationDate";
public static final String CONTACT_DATE = "contactDate";
public static final String COMMENT = "comment";
public static final String RESPONSIBLE_USER = "responsibleUser";
public static final String INVESTIGATION_STATUS = "investigationStatus";
public static final String PROCESSING_STATUS = "processingStatus";
public static final String DELETED = "deleted";
public static final String DELETION_REASON = "deletionReason";
public static final String OTHER_DELETION_REASON = "otherDeletionReason";

@NotNull(message = Validations.requiredField)
private SelfReportType type;
@NotNull(message = Validations.validReportDateTime)
private Date reportDate;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@SensitiveData
private String caseReference;
@NotNull(message = Validations.requiredField)
private Disease disease;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
private String diseaseDetails;
private DiseaseVariant diseaseVariant;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
private String diseaseVariantDetails;
@NotBlank(message = Validations.requiredField)
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@PersonalData
@SensitiveData
private String firstName;
@NotBlank(message = Validations.requiredField)
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@PersonalData
@SensitiveData
private String lastName;
@NotNull(message = Validations.requiredField)
private Sex sex;
@PersonalData
@SensitiveData
private Integer birthdateDD;
private Integer birthdateMM;
private Integer birthdateYYYY;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@HideForCountries
@SensitiveData
private String nationalHealthId;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@SensitiveData
private String email;
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
@SensitiveData
private String phoneNumber;
@EmbeddedPersonalData
@EmbeddedSensitiveData
@Valid
private LocationDto address;
private Date dateOfTest;
private Date dateOfSymptoms;
@SensitiveData
private String workplace;
private Date dateWorkplace;
private Date isolationDate;
private Date contactDate;
@Size(max = FieldConstraints.CHARACTER_LIMIT_BIG, message = Validations.textTooLong)
private UserReferenceDto responsibleUser;
@SensitiveData
private String comment;
private UserReferenceDto responsibleUser;
@NotNull(message = Validations.requiredField)
private SelfReportInvestigationStatus investigationStatus;
@NotNull(message = Validations.requiredField)
private SelfReportProcessingStatus processingStatus;
private boolean deleted;
private DeletionReason deletionReason;
@Size(max = FieldConstraints.CHARACTER_LIMIT_TEXT, message = Validations.textTooLong)
@SensitiveData
private String otherDeletionReason;

public static SelfReportDto build(SelfReportType type) {
SelfReportDto dto = new SelfReportDto();
Expand Down Expand Up @@ -121,10 +188,26 @@ public void setDisease(Disease disease) {
this.disease = disease;
}

public String getDiseaseDetails() {
return diseaseDetails;
}

public void setDiseaseDetails(String diseaseDetails) {
this.diseaseDetails = diseaseDetails;
}

public DiseaseVariant getDiseaseVariant() {
return diseaseVariant;
}

public String getDiseaseVariantDetails() {
return diseaseVariantDetails;
}

public void setDiseaseVariantDetails(String diseaseVariantDetails) {
this.diseaseVariantDetails = diseaseVariantDetails;
}

public void setDiseaseVariant(DiseaseVariant diseaseVariant) {
this.diseaseVariant = diseaseVariant;
}
Expand Down Expand Up @@ -209,6 +292,54 @@ public void setAddress(LocationDto address) {
this.address = address;
}

public Date getDateOfTest() {
return dateOfTest;
}

public void setDateOfTest(Date dateOfTest) {
this.dateOfTest = dateOfTest;
}

public Date getDateOfSymptoms() {
return dateOfSymptoms;
}

public void setDateOfSymptoms(Date dateOfSymptoms) {
this.dateOfSymptoms = dateOfSymptoms;
}

public String getWorkplace() {
return workplace;
}

public void setWorkplace(String workplace) {
this.workplace = workplace;
}

public Date getDateWorkplace() {
return dateWorkplace;
}

public void setDateWorkplace(Date dateWorkplace) {
this.dateWorkplace = dateWorkplace;
}

public Date getIsolationDate() {
return isolationDate;
}

public void setIsolationDate(Date isolationDate) {
this.isolationDate = isolationDate;
}

public Date getContactDate() {
return contactDate;
}

public void setContactDate(Date contactDate) {
this.contactDate = contactDate;
}

public String getComment() {
return comment;
}
Expand Down Expand Up @@ -240,4 +371,28 @@ public SelfReportProcessingStatus getProcessingStatus() {
public void setProcessingStatus(SelfReportProcessingStatus processingStatus) {
this.processingStatus = processingStatus;
}

public boolean isDeleted() {
return deleted;
}

public void setDeleted(boolean deleted) {
this.deleted = deleted;
}

public DeletionReason getDeletionReason() {
return deletionReason;
}

public void setDeletionReason(DeletionReason deletionReason) {
this.deletionReason = deletionReason;
}

public String getOtherDeletionReason() {
return otherDeletionReason;
}

public void setOtherDeletionReason(String otherDeletionReason) {
this.otherDeletionReason = otherDeletionReason;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,7 @@ public Set<UserRight> getDefaultUserRights() {
SELF_REPORT_CREATE,
SELF_REPORT_EDIT,
SELF_REPORT_DELETE,
SELF_REPORT_ARCHIVE,
DOCUMENT_VIEW,
DOCUMENT_UPLOAD,
DOCUMENT_DELETE,
Expand Down Expand Up @@ -1786,6 +1787,7 @@ public Set<UserRight> getDefaultUserRights() {
SELF_REPORT_CREATE,
SELF_REPORT_EDIT,
SELF_REPORT_DELETE,
SELF_REPORT_ARCHIVE,
DOCUMENT_VIEW,
DOCUMENT_UPLOAD,
OUTBREAK_VIEW,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public enum UserRight {
SELF_REPORT_CREATE(UserRightGroup.SELF_REPORT, UserRight._SELF_REPORT_VIEW),
SELF_REPORT_EDIT(UserRightGroup.SELF_REPORT, UserRight._SELF_REPORT_VIEW),
SELF_REPORT_DELETE(UserRightGroup.SELF_REPORT, UserRight._SELF_REPORT_VIEW),
SELF_REPORT_ARCHIVE(UserRightGroup.SELF_REPORT, UserRight._SELF_REPORT_VIEW),

DOCUMENT_VIEW(UserRightGroup.DOCUMENT),
DOCUMENT_UPLOAD(UserRightGroup.DOCUMENT, UserRight._DOCUMENT_VIEW),
Expand Down Expand Up @@ -468,6 +469,7 @@ public enum UserRight {
public static final String _SELF_REPORT_CREATE = "SELF_REPORT_CREATE";
public static final String _SELF_REPORT_EDIT = "SELF_REPORT_EDIT";
public static final String _SELF_REPORT_DELETE = "SELF_REPORT_DELETE";
public static final String _SELF_REPORT_ARCHIVE = "SELF_REPORT_ARCHIVE";

public static final String _DOCUMENT_VIEW = "DOCUMENT_VIEW";
public static final String _DOCUMENT_UPLOAD = "DOCUMENT_UPLOAD";
Expand Down
Loading

0 comments on commit a564f9a

Please sign in to comment.