feat(microbiology): add WHONET export population filters - #4103
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5d87913d60
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds combinable WHONET export population filters (specimen type, organism, patient origin, isolate significance) with a single normalized server-side query contract shared by preview and CSV generation, and relocates the WHONET navigation entry under Reports while preserving the stable /Microbiology/whonet route.
Changes:
- Backend: Normalize/export population filtering and expose period-scoped filter option endpoint used by UI.
- Frontend: Add Carbon multiselect filter controls that round-trip via deterministic repeated query params.
- Tests/docs: Update unit/integration/E2E coverage and align spec artifacts with the new filter slice.
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| volume/menu/menu_config.json | Moves WHONET menu entry under Reports and adjusts ordering. |
| src/main/java/org/openelisglobal/reports/service/WHONetReportService.java | Adds service API for filter-options retrieval. |
| src/main/java/org/openelisglobal/reports/service/WHONetReportServiceImpl.java | Implements filter-options retrieval as read-only transactional call. |
| src/main/java/org/openelisglobal/microbiology/controller/rest/MicroWhonetExportRestController.java | Adds /filter-options GET endpoint with authorization. |
| src/main/java/org/openelisglobal/microbiology/service/MicroWhonetDatasetService.java | Extends dataset service contract to include filter-options. |
| src/main/java/org/openelisglobal/microbiology/service/MicroWhonetDatasetServiceImpl.java | Applies combinable filters before deduplication; adds population loading + filter option derivation. |
| src/main/java/org/openelisglobal/microbiology/form/MicroWhonetExportQueryForm.java | Migrates population inputs to repeated-value lists (with single-value JSON compatibility). |
| src/main/java/org/openelisglobal/microbiology/form/MicroWhonetPreviewForm.java | Adds preview counters for each filter stage. |
| src/main/java/org/openelisglobal/microbiology/form/MicroWhonetFilterOptionsForm.java | New DTO for period-scoped filter choices. |
| src/main/java/org/openelisglobal/microbiology/form/MicroWhonetFilterOptionForm.java | New DTO for id/label option pairs. |
| src/main/java/org/openelisglobal/microbiology/dao/MicroCaseOrderDetailDAO.java | Adds DAO method to bulk load order details by case IDs. |
| src/main/java/org/openelisglobal/microbiology/dao/MicroOrganismDAO.java | Adds DAO method to bulk load organisms by IDs. |
| src/main/java/org/openelisglobal/microbiology/dao/MicroPatientOriginDAO.java | Adds DAO method to bulk load patient origins by codes. |
| src/main/java/org/openelisglobal/microbiology/daoimpl/MicroCaseOrderDetailDAOImpl.java | Implements bulk case-id lookup for order details. |
| src/main/java/org/openelisglobal/microbiology/daoimpl/MicroOrganismDAOImpl.java | Implements bulk organism lookup by IDs. |
| src/main/java/org/openelisglobal/microbiology/daoimpl/MicroPatientOriginDAOImpl.java | Implements bulk patient-origin lookup by codes. |
| src/main/java/org/openelisglobal/microbiology/service/MicrobiologyUatScenarioService.java | Provisions required sample status + report test section through services for scenario setup. |
| src/test/java/org/openelisglobal/reports/service/WHONetReportServiceMicrobiologyTest.java | Updates test query to use significance as list. |
| src/test/java/org/openelisglobal/microbiology/service/MicroWhonetDatasetServiceTest.java | Adds tests for combined filtering and period-scoped filter options; updates list-based significance. |
| src/test/java/org/openelisglobal/microbiology/controller/MicroWhonetExportRestControllerTest.java | Adds filter-options endpoint test; updates request binding expectations for repeated params. |
| src/test/java/org/openelisglobal/menu/util/MenuConfigurationLoaderTest.java | Asserts WHONET is exposed only under Reports and keeps stable URL. |
| src/test/java/org/openelisglobal/microbiology/service/MicrobiologyUatScenarioServiceTest.java | Adds tests for service provisioning of sample entered status and report test section. |
| src/test/java/org/openelisglobal/microbiology/MicroWhonetPersistenceIntegrationTest.java | Ensures sample type has WHONET code and updates list-based significance. |
| src/test/java/org/openelisglobal/microbiology/MicrobiologyReferenceDataIntegrationTest.java | Verifies fixture culture setup reuse for same method/workflow. |
| src/test/java/org/openelisglobal/microbiology/MicrobiologyOrderSaveIntegrationTest.java | Uses fixture helper that provisions an active sample type if missing. |
| src/test/java/org/openelisglobal/microbiology/fixture/MicrobiologyTestFixtures.java | Adds getOrCreateActiveSampleType and makes culture setup creation idempotent via service. |
| src/test/java/org/openelisglobal/microbiology/fixture/MicrobiologyTestFixturesTest.java | Adds unit test for provisioning active sample type via services (incl. localization). |
| src/test/java/org/openelisglobal/inventory/service/InventoryItemServiceTest.java | Adds assertion to ensure generated inventory IDs exceed fixture IDs. |
| src/test/java/org/openelisglobal/BaseWebContextSensitiveTest.java | Adds inventory item sequence mapping to avoid fixture/sequence collisions. |
| specs/782-ogc-782-microbiology-mvp-spec/tasks.md | Updates roadmap markers and records the filter slice + next culture-purpose slice. |
| specs/782-ogc-782-microbiology-mvp-spec/spec.md | Adds acceptance coverage for consistent filter application; clarifies terminology. |
| specs/782-ogc-782-microbiology-mvp-spec/data-model.md | Documents culture purpose field as follow-on model addition. |
| specs/782-ogc-782-microbiology-mvp-spec/evidence/code-qa-r9-2026-08-20.md | Adds QA evidence note for this slice. |
| specs/782-ogc-782-microbiology-m10-whonet-export/spec.md | Updates nav acceptance and adds follow-on stories/requirements for population and purpose. |
| specs/782-ogc-782-microbiology-m10-whonet-export/research.md | Adds research/ruling on clinical vs active screening culture purpose. |
| specs/782-ogc-782-microbiology-m10-whonet-export/plan.md | Updates plan for Reports-only nav and introduces R9 addendum for slice split. |
| frontend/src/languages/en.json | Adds i18n keys for filter labels, significance values, and filter-stage metrics. |
| frontend/src/components/microbiology/WhonetService.js | Serializes repeated filter params deterministically; adds filter-options fetch. |
| frontend/src/components/microbiology/WhonetService.test.js | Updates preview query serialization and adds filter-options request test. |
| frontend/src/components/microbiology/WhonetRoutes.js | Adds parsing/building of repeated population filters and legacy significance=ALL normalization. |
| frontend/src/components/microbiology/WhonetRoutes.test.js | Adds tests for round-tripping repeated filters and legacy ALL links. |
| frontend/src/components/microbiology/WhonetExport.scss | Adds filter grid styling and tightens layout toward operational compaction. |
| frontend/src/components/microbiology/WhonetExport.jsx | Adds multiselect filter UI backed by period-scoped filter options + preview metrics. |
| frontend/src/components/microbiology/tests/WhonetExport.test.jsx | Updates component tests for multiselect controls, canonical URL state, and list-based request. |
| frontend/playwright/tests/foundational/core/microbiology-whonet-export.spec.ts | Updates journeys to use Reports nav and validates filter preservation + metrics. |
| frontend/playwright/tests/demo/core/ogc-782-microbiology-whonet-export.spec.ts | Updates demo assertions for multiselect inclusion and mapping repair return flow. |
| frontend/playwright/helpers/seed-microbiology-data.ts | Extends seeding to set patient origin and significance for filter-focused fixtures. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
e313ecd to
484a138
Compare
484a138 to
94f10a0
Compare
94f10a0 to
479f3ee
Compare
479f3ee to
3a53085
Compare
3a53085 to
6807e77
Compare
6807e77 to
cdc46f0
Compare
cdc46f0 to
f0bafbd
Compare
f0bafbd to
b01dadf
Compare
b01dadf to
fecfad7
Compare
fecfad7 to
2420017
Compare
2420017 to
7bbaa7f
Compare
61000f3 to
338fed3
Compare
338fed3 to
ee516ee
Compare
ee516ee to
30fe27c
Compare
30fe27c to
3179492
Compare
Behavior delivered
patient origin, and isolate significance using authoritative case data.
generation, and stores that selection with the completed export record.
Configure and Preview can be bookmarked, reloaded, and shared.
stable
/Microbiology/whonetroute and Reports breadcrumb.funnel counts, all eligible AST readings, and exact mapping-repair links.
valid unidentified isolates without failing filter options or preview.
Product boundary
This slice does not infer screening or surveillance from Program, patient
origin, specimen, organism, location, or AMR eligibility. The next roadmap row
captures explicit Culture purpose as Clinical diagnosis/treatment or Active
screening/carriage, with historical missing data shown as Unspecified.
Export History, scheduling, AST-worklist and individual-case entry points,
advanced first-isolate policies, output-format qualification, and additional
readiness catalogs remain later M-09 roadmap slices. OpenELIS Work is
authoritative for workflow and visual intent.
Engineering notes
087-microbiology-whonet-export-selection.xmladds the onedata-model field needed to retain export provenance and includes rollback.
and persisted provenance; there is no second filter implementation.
query rather than per-case service calls.
WHONET_FILTERSfixtures use authenticated applicationservices only: no SQL seed, fixed primary key, DAO bypass, or production
fixture endpoint exposure.
construction, supported Carbon multi-select interaction, readiness, fixture
labels, and CSV reading.
Verification
(3/3), producing five inspected screenshots and two titled MP4s.
forced interactions or sleeps for test synchronization. Video-only pauses
display title cards for human review.
Stack and review evidence
PR #4097.
OGC-788 Macro is a separate product stack and is not part of this PR's
application scope; its current base relationship must be corrected
independently before merge.
AMR-S30.Completion state
verification passed, and the deployed authenticated WHONET Playwright journey
passed. The later roadmap-only commit changes no runtime behavior and is
intentionally not deployed.
The Review button overlaps one filter in the full-page mobile screenshot. It is
external review-tooling chrome, not OpenELIS layout, and is not hidden with
application or evidence-only CSS.