#14058 - Add 'performedByReferenceLaboratory' field to TestReport and related classes#14074
Conversation
… related classes
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds ChangesperformedByReferenceLaboratory field propagation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjbMappingTest.java (1)
198-198: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a regression test for
ExternalMessageMapper.mapToPathogenTest.These assertions only cover DTO/entity propagation. The linked bug is fixed on the
TestReportDto -> PathogenTestDtomapping path, so this PR still needs a test that provesperformedByReferenceLaboratorytoggles on the resulting pathogen test.Also applies to: 353-353
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjbMappingTest.java` at line 198, Add a regression test for ExternalMessageMapper.mapToPathogenTest that verifies performedByReferenceLaboratory is propagated to the resulting PathogenTestDto. The current assertions only check DTO/entity round-tripping in TestReportFacadeEjbMappingTest, so add a focused test that maps a TestReportDto with the flag set and asserts the produced PathogenTestDto toggles performedByReferenceLaboratory accordingly. Use the existing mapping method and related DTO types as the reference points so the test covers the fixed bug path directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sormas-backend/src/main/resources/sql/sormas_schema.sql`:
- Line 16405: The migration comment contains an invalid date string that breaks
traceability. Update the date in the schema migration comment near the lab
messages entry to a real calendar date, keeping the same descriptive text and
ensuring the comment remains a valid migration marker.
---
Nitpick comments:
In
`@sormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjbMappingTest.java`:
- Line 198: Add a regression test for ExternalMessageMapper.mapToPathogenTest
that verifies performedByReferenceLaboratory is propagated to the resulting
PathogenTestDto. The current assertions only check DTO/entity round-tripping in
TestReportFacadeEjbMappingTest, so add a focused test that maps a TestReportDto
with the flag set and asserts the produced PathogenTestDto toggles
performedByReferenceLaboratory accordingly. Use the existing mapping method and
related DTO types as the reference points so the test covers the fixed bug path
directly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 34415b2f-61ee-4343-bb02-512b57daa1f8
📒 Files selected for processing (6)
sormas-api/src/main/java/de/symeda/sormas/api/externalmessage/labmessage/TestReportDto.javasormas-api/src/main/java/de/symeda/sormas/api/externalmessage/processing/ExternalMessageMapper.javasormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReport.javasormas-backend/src/main/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjb.javasormas-backend/src/main/resources/sql/sormas_schema.sqlsormas-backend/src/test/java/de/symeda/sormas/backend/externalmessage/labmessage/TestReportFacadeEjbMappingTest.java
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sormas-backend/src/main/resources/sql/sormas_schema.sql`:
- Around line 16436-16455: Update the NOTICE strings in the migration block for
the `pathogentest` and `pathogentest_history` truncation handling so they report
`Migration 643` instead of `Migration 642`. Keep the message wording consistent
with the schema version entry in this block, and verify the `RAISE NOTICE`
statements in the related migration section use the same version label as the
`schema_version` record.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b8633519-38c5-46cc-8216-77d8bc0a4ca7
📒 Files selected for processing (1)
sormas-backend/src/main/resources/sql/sormas_schema.sql
There was a problem hiding this comment.
Caution
Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@sormas-backend/src/main/resources/sql/sormas_schema.sql`:
- Around line 16436-16455: Update the NOTICE strings in the migration block for
the `pathogentest` and `pathogentest_history` truncation handling so they report
`Migration 643` instead of `Migration 642`. Keep the message wording consistent
with the schema version entry in this block, and verify the `RAISE NOTICE`
statements in the related migration section use the same version label as the
`schema_version` record.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b8633519-38c5-46cc-8216-77d8bc0a4ca7
📒 Files selected for processing (1)
sormas-backend/src/main/resources/sql/sormas_schema.sql
🛑 Comments failed to post (1)
sormas-backend/src/main/resources/sql/sormas_schema.sql (1)
16436-16455: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Keep the NOTICE labels aligned with schema version 643.
Lines 16436 and 16455 still emit
Migration 642, but this block is recorded as version643on Line 16469. That makes rollout logs point at the wrong migration when operators try to reconcile notices withschema_version.Suggested fix
- RAISE NOTICE 'Migration 642: % pathogentest row(s) had their preserved resultdetails truncated to fit varchar(4096).', truncated_count; + RAISE NOTICE 'Migration 643: % pathogentest row(s) had their preserved resultdetails truncated to fit varchar(4096).', truncated_count; @@ - RAISE NOTICE 'Migration 642: % pathogentest_history row(s) had their preserved resultdetails truncated to fit varchar(4096).', truncated_count; + RAISE NOTICE 'Migration 643: % pathogentest_history row(s) had their preserved resultdetails truncated to fit varchar(4096).', truncated_count;Also applies to: 16469-16469
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@sormas-backend/src/main/resources/sql/sormas_schema.sql` around lines 16436 - 16455, Update the NOTICE strings in the migration block for the `pathogentest` and `pathogentest_history` truncation handling so they report `Migration 643` instead of `Migration 642`. Keep the message wording consistent with the schema version entry in this block, and verify the `RAISE NOTICE` statements in the related migration section use the same version label as the `schema_version` record.
Fixes #14058
Summary by CodeRabbit
New Features
Bug Fixes
Tests