Skip to content

Commit 9853df3

Browse files
committed
Adds Lab results (tests/samples/AST) tab to the cases view
1 parent 320472c commit 9853df3

3 files changed

Lines changed: 9 additions & 8 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16295,7 +16295,7 @@ alter table samples_history alter column retestrequested set not null;
1629516295

1629616296
INSERT INTO schema_version (version_number, comment) VALUES (637, 'Reference laboratory + retest indicators on sample #13954 (#13948)');
1629716297

16298-
-- 2026-06-08 Laboratory results tab: date other + external comments on case #13948
16298+
-- 2026-06-08 Laboratory results tab: date other + external comments on case #13948 (#13955)
1629916299
alter table cases add column IF NOT EXISTS dateother timestamp;
1630016300
alter table cases add column IF NOT EXISTS dateotherdetails varchar(255);
1630116301
alter table cases add column IF NOT EXISTS externalcomments text;
@@ -16304,6 +16304,6 @@ alter table cases_history add column IF NOT EXISTS dateother timestamp;
1630416304
alter table cases_history add column IF NOT EXISTS dateotherdetails varchar(255);
1630516305
alter table cases_history add column IF NOT EXISTS externalcomments text;
1630616306

16307-
INSERT INTO schema_version (version_number, comment) VALUES (638, 'Laboratory results tab: dateOther, dateOtherDetails, externalComments on case #13948');
16307+
INSERT INTO schema_version (version_number, comment) VALUES (638, 'Laboratory results tab: dateOther, dateOtherDetails, externalComments on case #13955');
1630816308

1630916309
-- *** Insert new sql commands BEFORE this line. Remember to always consider _history tables. ***

sormas-backend/src/test/java/de/symeda/sormas/backend/caze/CaseFacadeEjbTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3455,7 +3455,9 @@ public void testLabResultsFieldsRoundTrip() {
34553455
new Date(),
34563456
rdcf);
34573457

3458-
Date dateOther = new Date();
3458+
// Truncate to day granularity so the round-trip assertion is not brittle to sub-second precision
3459+
// differences in DB/JPA timestamp handling.
3460+
Date dateOther = DateHelper.getStartOfDay(new Date());
34593461
caze.setDateOther(dateOther);
34603462
caze.setDateOtherDetails("Sampling visit");
34613463
caze.setExternalComments("Lab sent confirmation");

sormas-ui/src/main/java/de/symeda/sormas/ui/caze/CaseLabResultsView.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ private void refreshTables() {
125125
List<PathogenTestDto> displayTests =
126126
tests.stream().filter(t -> t.getTestType() != PathogenTestType.ANTIBIOTIC_SUSCEPTIBILITY).collect(Collectors.toList());
127127

128-
// "Tests performed" reflects the tests visible in the Tests table (AST results are shown in their own
129-
// table below, not the Tests table, so they are not counted here).
130-
Map<String, Long> testCountBySampleUuid = displayTests.stream()
131-
.filter(t -> t.getSample() != null)
132-
.collect(Collectors.groupingBy(t -> t.getSample().getUuid(), Collectors.counting()));
128+
// "Tests performed" counts ALL pathogen tests of the sample, including AST tests (whose results are
129+
// shown in the separate drug-susceptibility table).
130+
Map<String, Long> testCountBySampleUuid =
131+
tests.stream().filter(t -> t.getSample() != null).collect(Collectors.groupingBy(t -> t.getSample().getUuid(), Collectors.counting()));
133132

134133
tablesLayout.addComponent(buildSectionHeader(Captions.caseLabResultsTestsHeading));
135134
tablesLayout.addComponent(

0 commit comments

Comments
 (0)