Skip to content

Commit 9396e70

Browse files
authored
Merge pull request #13795 from SORMAS-Foundation/bugfix-13775-treatment_fields_move_to_case
#13775 - Moved treatment fields from therapy to cases
2 parents 7bb42a9 + 3be00b0 commit 9396e70

15 files changed

Lines changed: 162 additions & 172 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/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/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...

sormas-backend/src/main/java/de/symeda/sormas/backend/caze/Case.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,10 @@ public class Case extends CoreAdo implements IsCase, SormasToSormasShareable, Ha
255255
public static final String RADIOGRAPHY_COMPATIBILITY = "radiographyCompatibility";
256256
public static final String OTHER_DIAGNOSTIC_CRITERIA = "otherDiagnosticCriteria";
257257

258+
public static final String TREATMENT_STARTED = "treatmentStarted";
259+
public static final String TREATMENT_NOT_APPLICABLE = "treatmentNotApplicable";
260+
public static final String TREATMENT_START_DATE = "treatmentStartDate";
261+
258262
private Person person;
259263
private String description;
260264
private Disease disease;
@@ -282,6 +286,9 @@ public class Case extends CoreAdo implements IsCase, SormasToSormasShareable, Ha
282286
private Hospitalization hospitalization;
283287
private EpiData epiData;
284288
private Therapy therapy;
289+
private YesNoUnknown treatmentStarted;
290+
private boolean treatmentNotApplicable;
291+
private Date treatmentStartDate;
285292
private ClinicalCourse clinicalCourse;
286293
private MaternalHistory maternalHistory;
287294
private PortHealthInfo portHealthInfo;
@@ -1868,4 +1875,32 @@ public String getOtherDiagnosticCriteria() {
18681875
public void setOtherDiagnosticCriteria(String otherDiagnosticCriteria) {
18691876
this.otherDiagnosticCriteria = otherDiagnosticCriteria;
18701877
}
1878+
1879+
@Column
1880+
@Enumerated(EnumType.STRING)
1881+
public YesNoUnknown getTreatmentStarted() {
1882+
return treatmentStarted;
1883+
}
1884+
1885+
public void setTreatmentStarted(YesNoUnknown treatmentStarted) {
1886+
this.treatmentStarted = treatmentStarted;
1887+
}
1888+
1889+
@Column
1890+
public boolean isTreatmentNotApplicable() {
1891+
return treatmentNotApplicable;
1892+
}
1893+
1894+
public void setTreatmentNotApplicable(boolean treatmentNotApplicable) {
1895+
this.treatmentNotApplicable = treatmentNotApplicable;
1896+
}
1897+
1898+
@Temporal(TemporalType.TIMESTAMP)
1899+
public Date getTreatmentStartDate() {
1900+
return treatmentStartDate;
1901+
}
1902+
1903+
public void setTreatmentStartDate(Date treatmentStartDate) {
1904+
this.treatmentStartDate = treatmentStartDate;
1905+
}
18711906
}

sormas-backend/src/main/java/de/symeda/sormas/backend/caze/CaseFacadeEjb.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3228,6 +3228,10 @@ public static CaseDataDto toCaseDto(Case source) {
32283228
target.setRadiographyCompatibility(source.getRadiographyCompatibility());
32293229
target.setOtherDiagnosticCriteria(source.getOtherDiagnosticCriteria());
32303230

3231+
target.setTreatmentStarted(source.getTreatmentStarted());
3232+
target.setTreatmentNotApplicable(source.isTreatmentNotApplicable());
3233+
target.setTreatmentStartDate(source.getTreatmentStartDate());
3234+
32313235
return target;
32323236
}
32333237

@@ -3439,6 +3443,10 @@ public Case fillOrBuildEntity(@NotNull CaseDataDto source, Case target, boolean
34393443
target.setRadiographyCompatibility(source.getRadiographyCompatibility());
34403444
target.setOtherDiagnosticCriteria(source.getOtherDiagnosticCriteria());
34413445

3446+
target.setTreatmentStarted(source.getTreatmentStarted());
3447+
target.setTreatmentNotApplicable(source.isTreatmentNotApplicable());
3448+
target.setTreatmentStartDate(source.getTreatmentStartDate());
3449+
34423450
return target;
34433451
}
34443452

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,9 @@
11
package de.symeda.sormas.backend.therapy;
22

3-
4-
import java.util.Date;
5-
63
import javax.persistence.CascadeType;
7-
import javax.persistence.Column;
84
import javax.persistence.Entity;
9-
import javax.persistence.EnumType;
10-
import javax.persistence.Enumerated;
115
import javax.persistence.OneToOne;
12-
import javax.persistence.Temporal;
13-
import javax.persistence.TemporalType;
146

15-
import de.symeda.sormas.api.utils.YesNoUnknown;
167
import de.symeda.sormas.backend.caze.Case;
178
import de.symeda.sormas.backend.common.AbstractDomainObject;
189

@@ -33,10 +24,6 @@ public class Therapy extends AbstractDomainObject {
3324
private boolean beijingLineage;
3425
private Case caze;
3526

36-
private YesNoUnknown treatmentStarted;
37-
private boolean treatmentNotApplicable;
38-
private Date treatmentStartDate;
39-
4027
@OneToOne(cascade = CascadeType.ALL, mappedBy = Case.THERAPY)
4128
public Case getCaze() {
4229
return caze;
@@ -69,32 +56,4 @@ public boolean isBeijingLineage() {
6956
public void setBeijingLineage(boolean beijingLineage) {
7057
this.beijingLineage = beijingLineage;
7158
}
72-
73-
@Column
74-
@Enumerated(EnumType.STRING)
75-
public YesNoUnknown getTreatmentStarted() {
76-
return treatmentStarted;
77-
}
78-
79-
public void setTreatmentStarted(YesNoUnknown treatmentStarted) {
80-
this.treatmentStarted = treatmentStarted;
81-
}
82-
83-
@Column
84-
public boolean isTreatmentNotApplicable() {
85-
return treatmentNotApplicable;
86-
}
87-
88-
public void setTreatmentNotApplicable(boolean treatmentNotApplicable) {
89-
this.treatmentNotApplicable = treatmentNotApplicable;
90-
}
91-
92-
@Temporal(TemporalType.TIMESTAMP)
93-
public Date getTreatmentStartDate() {
94-
return treatmentStartDate;
95-
}
96-
97-
public void setTreatmentStartDate(Date treatmentStartDate) {
98-
this.treatmentStartDate = treatmentStartDate;
99-
}
10059
}

0 commit comments

Comments
 (0)