Skip to content

Commit e4be8f4

Browse files
authored
Merge branch 'development' into bugfix-13751-diagnosis_date
2 parents a3a3ede + e992b39 commit e4be8f4

29 files changed

Lines changed: 473 additions & 194 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/caze/CaseDataDto.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
236236
public static final String RADIOGRAPHY_COMPATIBILITY = "radiographyCompatibility";
237237
public static final String OTHER_DIAGNOSTIC_CRITERIA = "otherDiagnosticCriteria";
238238

239+
public static final String TREATMENT_STARTED = "treatmentStarted";
240+
public static final String TREATMENT_NOT_APPLICABLE = "treatmentNotApplicable";
241+
public static final String TREATMENT_START_DATE = "treatmentStartDate";
242+
239243
// Fields are declared in the order they should appear in the import template
240244

241245
@Outbreaks
@@ -440,6 +444,9 @@ public class CaseDataDto extends SormasToSormasShareableDto implements IsCase {
440444
private EpiDataDto epiData;
441445
@Valid
442446
private TherapyDto therapy;
447+
private YesNoUnknown treatmentStarted;
448+
private boolean treatmentNotApplicable;
449+
private Date treatmentStartDate;
443450
@Valid
444451
private ClinicalCourseDto clinicalCourse;
445452
@Valid
@@ -1844,6 +1851,30 @@ public void setOtherDiagnosticCriteria(String otherDiagnosticCriteria) {
18441851
this.otherDiagnosticCriteria = otherDiagnosticCriteria;
18451852
}
18461853

1854+
public YesNoUnknown getTreatmentStarted() {
1855+
return treatmentStarted;
1856+
}
1857+
1858+
public void setTreatmentStarted(YesNoUnknown treatmentStarted) {
1859+
this.treatmentStarted = treatmentStarted;
1860+
}
1861+
1862+
public boolean isTreatmentNotApplicable() {
1863+
return treatmentNotApplicable;
1864+
}
1865+
1866+
public void setTreatmentNotApplicable(boolean treatmentNotApplicable) {
1867+
this.treatmentNotApplicable = treatmentNotApplicable;
1868+
}
1869+
1870+
public Date getTreatmentStartDate() {
1871+
return treatmentStartDate;
1872+
}
1873+
1874+
public void setTreatmentStartDate(Date treatmentStartDate) {
1875+
this.treatmentStartDate = treatmentStartDate;
1876+
}
1877+
18471878
@JsonIgnore
18481879
public String i18nPrefix() {
18491880
return I18N_PREFIX;

sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/ExternalMessageDto.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public class ExternalMessageDto extends SormasToSormasShareableDto {
8888
public static final String PERSON_GUARDIAN_RELATIONSHIP = "personGuardianRelationship";
8989
public static final String PERSON_GUARDIAN_PHONE = "personGuardianPhone";
9090
public static final String PERSON_GUARDIAN_EMAIL = "personGuardianEmail";
91+
public static final String PERSON_OCCUPATION = "personOccupation";
9192
public static final String EXTERNAL_MESSAGE_DETAILS = "externalMessageDetails";
9293
public static final String PROCESSED = "processed";
9394
public static final String REPORT_ID = "reportId";
@@ -181,6 +182,8 @@ public class ExternalMessageDto extends SormasToSormasShareableDto {
181182
private String personGuardianPhone;
182183
@Size(max = FieldConstraints.CHARACTER_LIMIT_SMALL, message = Validations.textTooLong)
183184
private String personGuardianEmail;
185+
@Size(max = FieldConstraints.CHARACTER_LIMIT_DEFAULT, message = Validations.textTooLong)
186+
private String personOccupation;
184187
private YesNoUnknown treatmentStarted;
185188
private Boolean treatmentNotApplicable;
186189
private Date treatmentStartedDate;
@@ -539,6 +542,14 @@ public void setPersonGuardianEmail(String personGuardianEmail) {
539542
this.personGuardianEmail = personGuardianEmail;
540543
}
541544

545+
public String getPersonOccupation() {
546+
return personOccupation;
547+
}
548+
549+
public void setPersonOccupation(String personOccupation) {
550+
this.personOccupation = personOccupation;
551+
}
552+
542553
public String getExternalMessageDetails() {
543554
return externalMessageDetails;
544555
}

sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/ExternalMessageProcessingFacade.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import de.symeda.sormas.api.infrastructure.facility.FacilityReferenceDto;
5454
import de.symeda.sormas.api.infrastructure.facility.FacilityType;
5555
import de.symeda.sormas.api.infrastructure.region.RegionFacade;
56+
import de.symeda.sormas.api.person.OccupationType;
5657
import de.symeda.sormas.api.person.PersonContext;
5758
import de.symeda.sormas.api.person.PersonDto;
5859
import de.symeda.sormas.api.person.PersonFacade;
@@ -241,6 +242,10 @@ public PersonDto getPersonByContext(PersonContext personContext, String personUu
241242
return personFacade.getByContext(personContext, personUuid);
242243
}
243244

245+
public OccupationType getOccupationTypeOther() throws CustomEnumNotFoundException {
246+
return customizableEnumFacade.getEnumValue(CustomizableEnumType.OCCUPATION_TYPE, "OTHER", null);
247+
}
248+
244249
public CaseDataDto updateAndSetCaseNotifier(String caseUuid, NotifierDto notifierDto) {
245250

246251
final CaseDataDto caseDto = caseFacade.getByUuid(caseUuid);
@@ -252,10 +257,10 @@ public CaseDataDto updateAndSetCaseNotifier(String caseUuid, NotifierDto notifie
252257
}
253258

254259
public void updatePerson(PersonDto personDto) {
255-
if(personFacade == null) {
260+
if (personFacade == null) {
256261
return;
257262
}
258-
if(personDto == null) {
263+
if (personDto == null) {
259264
return;
260265
}
261266

sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/doctordeclaration/AbstractDoctorDeclarationMessageProcessingFlow.java

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
import de.symeda.sormas.api.person.PersonDto;
5757
import de.symeda.sormas.api.sample.SampleSimilarityCriteria;
5858
import de.symeda.sormas.api.symptoms.SymptomsDto;
59-
import de.symeda.sormas.api.therapy.TherapyDto;
6059
import de.symeda.sormas.api.user.UserDto;
6160
import de.symeda.sormas.api.utils.DataHelper;
6261
import de.symeda.sormas.api.utils.DtoCopyHelper;
@@ -75,7 +74,7 @@ public abstract class AbstractDoctorDeclarationMessageProcessingFlow extends Abs
7574

7675
private final Logger logger = LoggerFactory.getLogger(getClass());
7776

78-
public AbstractDoctorDeclarationMessageProcessingFlow(
77+
protected AbstractDoctorDeclarationMessageProcessingFlow(
7978
ExternalMessageDto externalMessage,
8079
UserDto user,
8180
ExternalMessageMapper mapper,
@@ -146,7 +145,6 @@ protected void postBuildCase(CaseDataDto caseDto, ExternalMessageDto externalMes
146145
postBuildCaseData(caseDto, externalMessageDto);
147146
postBuildHealthConditions(caseDto, externalMessageDto);
148147
postBuildCaseSymptoms(caseDto, externalMessageDto);
149-
postBuildCaseTherapy(caseDto, externalMessageDto);
150148
postBuildActivitiesAsCase(caseDto, externalMessageDto);
151149
postBuildExposure(caseDto, externalMessageDto);
152150
postBuildHospitalization(caseDto, externalMessageDto);
@@ -169,6 +167,11 @@ protected void postBuildCaseData(CaseDataDto caseDto, ExternalMessageDto externa
169167
externalMessageDto.getCaseClassification() != null ? externalMessageDto.getCaseClassification() : caseDto.getCaseClassification());
170168
caseDto.setRadiographyCompatibility(externalMessageDto.getRadiographyCompatibility());
171169
caseDto.setOtherDiagnosticCriteria(externalMessageDto.getOtherDiagnosticCriteria());
170+
171+
caseDto.setTreatmentStarted(externalMessageDto.getTreatmentStarted());
172+
caseDto.setTreatmentStartDate(externalMessageDto.getTreatmentStartedDate());
173+
caseDto.setTreatmentNotApplicable(Boolean.TRUE.equals(externalMessageDto.getTreatmentNotApplicable()));
174+
172175
}
173176

174177
/**
@@ -235,26 +238,6 @@ protected void postBuildCaseSymptoms(CaseDataDto caseDto, ExternalMessageDto ext
235238
}
236239
}
237240

238-
/**
239-
* Sets the therapy information for the case from the external message, if present.
240-
*
241-
* @param caseDto
242-
* The case data transfer object to update.
243-
* @param externalMessageDto
244-
* The external message containing therapy data.
245-
*/
246-
protected void postBuildCaseTherapy(CaseDataDto caseDto, ExternalMessageDto externalMessageDto) {
247-
248-
TherapyDto therapyDto = caseDto.getTherapy();
249-
250-
therapyDto.setTreatmentStarted(externalMessageDto.getTreatmentStarted());
251-
therapyDto.setTreatmentStartDate(externalMessageDto.getTreatmentStartedDate());
252-
therapyDto.setTreatmentNotApplicable(Boolean.TRUE.equals(externalMessageDto.getTreatmentNotApplicable()));
253-
254-
logger.debug("[POST BUILD CASE] Therapy set for case with UUID: {}", caseDto.getUuid());
255-
256-
}
257-
258241
/**
259242
* Sets the activities as case for the case from the external message, if present.
260243
* <p>
@@ -415,7 +398,7 @@ protected void postBuildHospitalization(CaseDataDto caseDto, ExternalMessageDto
415398
caseDto.getUuid());
416399
return;
417400
}
418-
401+
419402
// we have a facility, so we set the responsible region, district and community
420403
caseDto.setResponsibleRegion(hospitalFacility.getRegion());
421404
caseDto.setResponsibleDistrict(hospitalFacility.getDistrict());

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
@@ -2239,6 +2239,7 @@ public interface Captions {
22392239
String Notification_noNotification = "Notification.noNotification";
22402240
String Notification_notificationTypeExternal = "Notification.notificationTypeExternal";
22412241
String Notification_notificationTypePhone = "Notification.notificationTypePhone";
2242+
String Notification_notifierInformation = "Notification.notifierInformation";
22422243
String Notification_registrationNumber = "Notification.registrationNumber";
22432244
String Notification_reportingAgent = "Notification.reportingAgent";
22442245
String Notification_viewNotification = "Notification.viewNotification";

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,7 @@ public interface Strings {
16791679
String notificationContactSymptomatic = "notificationContactSymptomatic";
16801680
String notificationContactWithoutCaseSymptomatic = "notificationContactWithoutCaseSymptomatic";
16811681
String notificationCreationNotAllowedWithoutSurveillanceReport = "notificationCreationNotAllowedWithoutSurveillanceReport";
1682+
String notificationDiagnosisDateInformation = "notificationDiagnosisDateInformation";
16821683
String notificationDiseaseChanged = "notificationDiseaseChanged";
16831684
String notificationEventAddedToEventGroup = "notificationEventAddedToEventGroup";
16841685
String notificationEventGroupCreated = "notificationEventGroupCreated";
@@ -1697,6 +1698,7 @@ public interface Strings {
16971698
String notificationLabSampleShippedShort = "notificationLabSampleShippedShort";
16981699
String notificationLabSampleShippedShortForContact = "notificationLabSampleShippedShortForContact";
16991700
String notificationLabSampleShippedShortForEventParticipant = "notificationLabSampleShippedShortForEventParticipant";
1701+
String notificationNotificationDateInformation = "notificationNotificationDateInformation";
17001702
String notificationPersonsUpdated = "notificationPersonsUpdated";
17011703
String notificationSmsSent = "notificationSmsSent";
17021704
String notificationTaskAssociatedCaseLink = "notificationTaskAssociatedCaseLink";

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
@@ -274,6 +274,8 @@ public interface Validations {
274274
String systemConfigurationValueInvalidKey = "systemConfigurationValueInvalidKey";
275275
String systemConfigurationValueInvalidValue = "systemConfigurationValueInvalidValue";
276276
String systemConfigurationValuePatternNotMatched = "systemConfigurationValuePatternNotMatched";
277+
String systemConfigurationValueValidationInvalidBackgroundColor = "systemConfigurationValueValidationInvalidBackgroundColor";
278+
String systemConfigurationValueValidationMenuSubtitle = "systemConfigurationValueValidationMenuSubtitle";
277279
String systemConfigurationValueValidationNotADirectory = "systemConfigurationValueValidationNotADirectory";
278280
String systemConfigurationValueValidationNotAEmail = "systemConfigurationValueValidationNotAEmail";
279281
String systemConfigurationValueValidationNotAFile = "systemConfigurationValueValidationNotAFile";

sormas-api/src/main/java/de/symeda/sormas/api/therapy/TherapyDto.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,10 @@
1717
*******************************************************************************/
1818
package de.symeda.sormas.api.therapy;
1919

20-
import java.util.Date;
21-
2220
import de.symeda.sormas.api.EntityDto;
2321
import de.symeda.sormas.api.feature.FeatureType;
2422
import de.symeda.sormas.api.utils.DataHelper;
2523
import de.symeda.sormas.api.utils.DependingOnFeatureType;
26-
import de.symeda.sormas.api.utils.YesNoUnknown;
2724

2825
@DependingOnFeatureType(featureType = FeatureType.CASE_SURVEILANCE)
2926
public class TherapyDto extends EntityDto {
@@ -36,17 +33,10 @@ public class TherapyDto extends EntityDto {
3633
public static final String MDR_XDR_TUBERCULOSIS = "mdrXdrTuberculosis";
3734
public static final String BEIJING_LINEAGE = "beijingLineage";
3835

39-
public static final String TREATMENT_STARTED = "treatmentStarted";
40-
public static final String TREATMENT_NOT_APPLICABLE = "treatmentNotApplicable";
41-
4236
private boolean directlyObservedTreatment;
4337
private boolean mdrXdrTuberculosis;
4438
private boolean beijingLineage;
4539

46-
private YesNoUnknown treatmentStarted;
47-
private boolean treatmentNotApplicable;
48-
private Date treatmentStartDate;
49-
5040
public static TherapyDto build() {
5141

5242
TherapyDto therapy = new TherapyDto();
@@ -81,28 +71,4 @@ public boolean isBeijingLineage() {
8171
public void setBeijingLineage(boolean beijingLineage) {
8272
this.beijingLineage = beijingLineage;
8373
}
84-
85-
public YesNoUnknown getTreatmentStarted() {
86-
return treatmentStarted;
87-
}
88-
89-
public void setTreatmentStarted(YesNoUnknown treatmentStarted) {
90-
this.treatmentStarted = treatmentStarted;
91-
}
92-
93-
public boolean isTreatmentNotApplicable() {
94-
return treatmentNotApplicable;
95-
}
96-
97-
public void setTreatmentNotApplicable(boolean treatmentNotApplicable) {
98-
this.treatmentNotApplicable = treatmentNotApplicable;
99-
}
100-
101-
public Date getTreatmentStartDate() {
102-
return treatmentStartDate;
103-
}
104-
105-
public void setTreatmentStartDate(Date treatmentStartDate) {
106-
this.treatmentStartDate = treatmentStartDate;
107-
}
10874
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3648,6 +3648,7 @@ Notification.editNotification = Edit Notification
36483648
Notification.viewNotification = View Notification
36493649
Notification.notificationTypeExternal = External notification
36503650
Notification.notificationTypePhone = Phone notification
3651+
Notification.notifierInformation = Notifier information
36513652

36523653
# Diagnosis Criteria Lab Test Details
36533654
diagnosisCriteriaDetailTestResult = Result

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,6 +1983,8 @@ infoSystemConfigurationValueDescriptionSmsAuthSecret=Secret for SMS authenticati
19831983

19841984
notificationCannotCreate=Cannot Create Or Edit Notification
19851985
notificationCreationNotAllowedWithoutSurveillanceReport=Notifier creation or modification is not allowed when a surveillance report already exists for this case.
1986+
notificationNotificationDateInformation=This date is automatically set based on when the notifier is created or modified.
1987+
notificationDiagnosisDateInformation=Diagnostic date is only available when editing surveillance reports, not when editing notifiers.
19861988

19871989
promptEpipulseExportDateFrom = Date from...
19881990
promptEpipulseExportDateTo = Date to...

0 commit comments

Comments
 (0)