Skip to content

Commit 4f0b2d6

Browse files
authored
Merge pull request #13766 from SORMAS-Foundation/task-add_additional_testreport_fields
Added additional test report fields needed for lab messages
2 parents fab3bfa + 8b8f82f commit 4f0b2d6

6 files changed

Lines changed: 74 additions & 2 deletions

File tree

sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import de.symeda.sormas.api.sample.GenoTypeResult;
1515
import de.symeda.sormas.api.sample.PCRTestSpecification;
1616
import de.symeda.sormas.api.sample.PathogenSpecie;
17+
import de.symeda.sormas.api.sample.PathogenStrainCallStatus;
1718
import de.symeda.sormas.api.sample.PathogenTestResultType;
1819
import de.symeda.sormas.api.sample.PathogenTestType;
1920
import de.symeda.sormas.api.sample.RsvSubtype;
@@ -59,6 +60,7 @@ public class TestReportDto extends EntityDto {
5960
public static final String TUBE_AG_TB2_GT10 = "tubeAgTb2GT10";
6061
public static final String TUBE_MITOGENE = "tubeMitogene";
6162
public static final String TUBE_MITOGENE_GT10 = "tubeMitogeneGT10";
63+
public static final String STRAIN_CALL_STATUS = "strainCallStatus";
6264
public static final String PRESCRIBER_PHYSICIAN_CODE = "prescriberPhysicianCode";
6365
public static final String PRESCRIBER_FIRST_NAME = "prescriberFirstName";
6466
public static final String PRESCRIBER_LAST_NAME = "prescriberLastName";
@@ -132,6 +134,8 @@ public class TestReportDto extends EntityDto {
132134
private Float tubeMitogene;
133135
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG)
134136
private Boolean tubeMitogeneGT10;
137+
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG)
138+
private PathogenStrainCallStatus strainCallStatus;
135139

136140
@HideForCountriesExcept(countries = CountryHelper.COUNTRY_CODE_LUXEMBOURG)
137141
@SensitiveData
@@ -208,6 +212,7 @@ public class TestReportDto extends EntityDto {
208212
private String seroGroupSpecificationText;
209213
private SerotypingMethod seroTypingMethod;
210214
private String seroTypingMethodText;
215+
private String serotype;
211216

212217
public SampleReportReferenceDto getSampleReport() {
213218
return sampleReport;
@@ -495,6 +500,14 @@ public void setTubeMitogeneGT10(Boolean tubeMitogeneGT10) {
495500
this.tubeMitogeneGT10 = tubeMitogeneGT10;
496501
}
497502

503+
public PathogenStrainCallStatus getStrainCallStatus() {
504+
return strainCallStatus;
505+
}
506+
507+
public void setStrainCallStatus(PathogenStrainCallStatus strainCallStatus) {
508+
this.strainCallStatus = strainCallStatus;
509+
}
510+
498511
public String getPrescriberPhysicianCode() {
499512
return prescriberPhysicianCode;
500513
}
@@ -879,4 +892,12 @@ public String getSeroTypingMethodText() {
879892
public void setSeroTypingMethodText(String seroTypingMethodText) {
880893
this.seroTypingMethodText = seroTypingMethodText;
881894
}
895+
896+
public String getSerotype() {
897+
return serotype;
898+
}
899+
900+
public void setSerotype(String serotype) {
901+
this.serotype = serotype;
902+
}
882903
}

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,17 @@ public List<String[]> mapToPathogenTest(TestReportDto sourceTestReport, Pathogen
352352
pathogenTest.getSeroGroupSpecificationText(),
353353
sourceTestReport.getSeroGroupSpecificationText(),
354354
PathogenTestDto.SERO_GROUP_SPECIFICATION),
355+
Mapping.of(pathogenTest::setSerotype, pathogenTest.getSerotype(), sourceTestReport.getSerotype(), PathogenTestDto.SEROTYPE),
356+
Mapping.of(
357+
pathogenTest::setSeroTypingMethod,
358+
pathogenTest.getSeroTypingMethod(),
359+
sourceTestReport.getSeroTypingMethod(),
360+
PathogenTestDto.SEROTYPING_METHOD),
361+
Mapping.of(
362+
pathogenTest::setSeroTypingMethodText,
363+
pathogenTest.getSeroTypingMethodText(),
364+
sourceTestReport.getSeroTypingMethodText(),
365+
PathogenTestDto.SERO_TYPING_METHOD_TEXT),
355366
Mapping.of(
356367
pathogenTest::setRsvSubtype,
357368
pathogenTest.getRsvSubtype(),
@@ -397,6 +408,11 @@ public List<String[]> mapToPathogenTest(TestReportDto sourceTestReport, Pathogen
397408
pathogenTest.getTubeMitogeneGT10(),
398409
sourceTestReport.getTubeMitogeneGT10(),
399410
PathogenTestDto.TUBE_MITOGENE_GT10),
411+
Mapping.of(
412+
pathogenTest::setStrainCallStatus,
413+
pathogenTest.getStrainCallStatus(),
414+
sourceTestReport.getStrainCallStatus(),
415+
PathogenTestDto.STRAIN_CALL_STATUS),
400416
Mapping.of(pathogenTest::setSpecie, pathogenTest.getSpecie(), sourceTestReport.getSpecie(), PathogenTestDto.SPECIE),
401417
// Drug susceptibility mappings
402418
Mapping.of(

sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import de.symeda.sormas.api.sample.GenoTypeResult;
4040
import de.symeda.sormas.api.sample.PCRTestSpecification;
4141
import de.symeda.sormas.api.sample.PathogenSpecie;
42+
import de.symeda.sormas.api.sample.PathogenStrainCallStatus;
4243
import de.symeda.sormas.api.sample.PathogenTestResultType;
4344
import de.symeda.sormas.api.sample.PathogenTestType;
4445
import de.symeda.sormas.api.sample.RsvSubtype;
@@ -135,6 +136,7 @@ public class TestReport extends AbstractDomainObject {
135136
private Boolean tubeAgTb2GT10;
136137
private Float tubeMitogene;
137138
private Boolean tubeMitogeneGT10;
139+
private PathogenStrainCallStatus strainCallStatus;
138140

139141
// Drug susceptibility
140142
private Float amikacinMic;
@@ -176,6 +178,7 @@ public class TestReport extends AbstractDomainObject {
176178
private String seroGroupSpecificationText;
177179
private SerotypingMethod seroTypingMethod;
178180
private String seroTypingMethodText;
181+
private String serotype;
179182

180183
@Column(length = CHARACTER_LIMIT_DEFAULT)
181184
public String getTestLabName() {
@@ -581,6 +584,15 @@ public void setTubeMitogeneGT10(Boolean tubeMitogeneGT10) {
581584
this.tubeMitogeneGT10 = tubeMitogeneGT10;
582585
}
583586

587+
@Enumerated(EnumType.STRING)
588+
public PathogenStrainCallStatus getStrainCallStatus() {
589+
return strainCallStatus;
590+
}
591+
592+
public void setStrainCallStatus(PathogenStrainCallStatus strainCallStatus) {
593+
this.strainCallStatus = strainCallStatus;
594+
}
595+
584596
public Float getAmikacinMic() {
585597
return amikacinMic;
586598
}
@@ -904,4 +916,12 @@ public void setSeroTypingMethodText(String seroTypingMethodText) {
904916
this.seroTypingMethodText = seroTypingMethodText;
905917
}
906918

919+
public String getSerotype() {
920+
return serotype;
921+
}
922+
923+
public void setSerotype(String serotype) {
924+
this.serotype = serotype;
925+
}
926+
907927
}

sormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ public static TestReportDto toDto(TestReport source) {
115115
target.setTubeAgTb2GT10(source.getTubeAgTb2GT10());
116116
target.setTubeMitogene(source.getTubeMitogene());
117117
target.setTubeMitogeneGT10(source.getTubeMitogeneGT10());
118+
target.setStrainCallStatus(source.getStrainCallStatus());
118119

119120
// Drug susceptibility mappings
120121
target.setAmikacinMic(source.getAmikacinMic());
@@ -156,6 +157,7 @@ public static TestReportDto toDto(TestReport source) {
156157
target.setSeroGroupSpecificationText(source.getSeroGroupSpecificationText());
157158
target.setSeroTypingMethod(source.getSeroTypingMethod());
158159
target.setSeroTypingMethodText(source.getSeroTypingMethodText());
160+
target.setSerotype(source.getSerotype());
159161

160162
return target;
161163
}
@@ -208,6 +210,7 @@ public TestReport fillOrBuildEntity(@NotNull TestReportDto source, @NotNull Samp
208210
target.setTubeAgTb2GT10(source.getTubeAgTb2GT10());
209211
target.setTubeMitogene(source.getTubeMitogene());
210212
target.setTubeMitogeneGT10(source.getTubeMitogeneGT10());
213+
target.setStrainCallStatus(source.getStrainCallStatus());
211214

212215
// Drug susceptibility mappings
213216
target.setAmikacinMic(source.getAmikacinMic());
@@ -249,6 +252,7 @@ public TestReport fillOrBuildEntity(@NotNull TestReportDto source, @NotNull Samp
249252
target.setSeroGroupSpecificationText(source.getSeroGroupSpecificationText());
250253
target.setSeroTypingMethod(source.getSeroTypingMethod());
251254
target.setSeroTypingMethodText(source.getSeroTypingMethodText());
255+
target.setSerotype(source.getSerotype());
252256

253257
return target;
254258
}

sormas-backend/src/main/resources/sql/sormas_schema.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15054,4 +15054,12 @@ ALTER TABLE epipulse_location_configuration_history OWNER TO sormas_user;
1505415054

1505515055
INSERT INTO schema_version (version_number, comment) VALUES (601, 'Epipulse reference tables history');
1505615056

15057+
-- external message tuberculosis additional pathogen test fields
15058+
ALTER TABLE testreport ADD COLUMN serotype character varying(255);
15059+
ALTER TABLE testreport ADD COLUMN straincallstatus character varying(255);
15060+
15061+
ALTER TABLE testreport_history ADD COLUMN serotype character varying(255);
15062+
ALTER TABLE testreport_history ADD COLUMN straincallstatus character varying(255);
15063+
15064+
INSERT INTO schema_version (version_number, comment) VALUES (602, 'External message additional fields');
1505715065
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***

sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjbMappingTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
import de.symeda.sormas.api.externalmessage.labmessage.SampleReportReferenceDto;
1818
import de.symeda.sormas.api.externalmessage.labmessage.TestReportDto;
1919
import de.symeda.sormas.api.sample.PCRTestSpecification;
20+
import de.symeda.sormas.api.sample.PathogenSpecie;
21+
import de.symeda.sormas.api.sample.PathogenStrainCallStatus;
2022
import de.symeda.sormas.api.sample.PathogenTestResultType;
2123
import de.symeda.sormas.api.sample.PathogenTestType;
2224
import de.symeda.sormas.api.sample.SeroGroupSpecification;
2325
import de.symeda.sormas.api.sample.SerotypingMethod;
24-
import de.symeda.sormas.api.sample.PathogenSpecie;
2526
import de.symeda.sormas.api.therapy.DrugSusceptibilityType;
2627
import de.symeda.sormas.api.utils.DataHelper;
2728
import de.symeda.sormas.backend.externalmessage.ExternalMessageService;
@@ -228,6 +229,7 @@ public void testToDto() {
228229
source.setTubeAgTb2GT10(true);
229230
source.setTubeMitogene(4.56f);
230231
source.setTubeMitogeneGT10(false);
232+
source.setStrainCallStatus(PathogenStrainCallStatus.BEIJING);
231233

232234
// Drug susceptibility test data
233235
source.setAmikacinMic(1.5f);
@@ -270,8 +272,9 @@ public void testToDto() {
270272
source.setSeroGroupSpecificationText("SeroGroup A");
271273
source.setSeroTypingMethod(SerotypingMethod.MULTIPLEX_PCR);
272274
source.setSeroTypingMethodText("Multiplex PCR Method");
275+
source.setSerotype("Test serotype");
273276

274-
TestReportDto result = TestReportFacadeEjb.toDto(source);
277+
TestReportDto result = TestReportFacadeEjb.toDto(source);
275278

276279
assertNotSame(source.getCreationDate().getTime(), result.getCreationDate().getTime());
277280
assertEquals(source.getChangeDate(), result.getChangeDate());

0 commit comments

Comments
 (0)