Skip to content

Add V3 scan report field endpoint and wire up V3 field/value tables#1312

Open
Kehindecodes wants to merge 17 commits into
Health-Informatics-UoN:mainfrom
Kehindecodes:mapping
Open

Add V3 scan report field endpoint and wire up V3 field/value tables#1312
Kehindecodes wants to merge 17 commits into
Health-Informatics-UoN:mainfrom
Kehindecodes:mapping

Conversation

@Kehindecodes
Copy link
Copy Markdown
Contributor

✨ Feature

PR Description

Migrates the scan report fields and values tables from the V2 API to a new V3 endpoint. The V3 endpoint returns fields with their concepts and mapping_recommendations embedded.

Key changes:

  • New endpoint GET /api/v3/scanreports/<id>/tables/<table_pk>/fields/ with filtering (has_concepts, creation_type, name), ordering, and pagination
  • Frontend fields and values pages wired to V3 data
  • "Unmapped only" checkbox filter added to field and value tables
  • ConceptDataTableV3 made generic so it works for both fields and values
  • useId added to all React-Select form components to prevent SSR hydration mismatches

Related Issues or other material

Related #1277

Screenshots, example outputs/behaviour etc.

Fields table with concepts mapped:

Screenshot 2026-05-28 at 12 54 45 AM

"Unmapped only" filter active:

Screenshot 2026-05-28 at 12 55 39 AM

✅ Added/updated tests?

- TestScanReportFieldSerializerV3 — verifies ScanReportFieldListSerializerV3 includes nested concepts and recommendations

  • TestScanReportFieldListViewset — verifies the V3 endpoint returns fields with concepts, recommendations, and correctly filters by has_concepts=false

brian-kim31 and others added 13 commits February 3, 2026 19:46
Introduces ScanReportFieldIndexV3 with nested concepts and mapping
recommendations, plus has_concepts/creation_type filters. Switches the
field and value table pages to the V3 API and components, and adds an
"Unmapped only" toggle to the concept data filter.
- Restore disabled={!canEdit} on AddConceptV3 in field columns (was hardcoded to false)
- Revert auth login URL back to NEXTAUTH_BACKEND_URL to match token refresh URL
- Add instanceId via useId() to all FormikSelect components to prevent SSR hydration mismatches
- Remove unused getAllScanReportFieldsV3 from scanreports.ts
- Add showUnmappedFilter prop to ConceptDataFilter (defaults to false)
- Pass showUnmappedFilter only on the values page, not the fields page
- Remove unused Button, Link, ArrowLeft imports from values page
- Move api.* imports to top of third-party block to satisfy ruff I001 (alphabetical order)
- Remove scan_report_table from ScanReportFieldV3 destructure (property doesn't exist on V3 type)
@AndyRae
Copy link
Copy Markdown
Member

AndyRae commented May 29, 2026

Thanks @Kehindecodes this looks really good, it's a lot of files so will take a bit of time to review this side, as my head is not in the code right now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants