Relative Case Linking
Feature Detail
Description
The Relative Case Linking feature connects previously registered relative records to a primary contact case within the same organization. A peer mentor or coordinator can associate one or more relatives with a case, establishing the family unit that coordinates support activities. The link is bidirectional so that viewing a contact case surfaces all associated relatives, and viewing a relative record surfaces the cases it is linked to. This structured association is what transforms standalone relative records into a functional family-centered support model.
Sources & reasoning
The phrase "knyttet til samme sak" (linked to the same case) in line 121 directly specifies that relatives must be associated with a case, not just stored independently. This is the linking mechanism that fulfills that requirement. Phase 1 MUST status confirmed on line 438, mapping to MVP. Without case linking the relatives registration feature has no operational value.
-
docs/source/likeperson.md · line 121-122Appen må støtte registrering av pårørende (foreldre, søsken, nærmeste omsorgsperson) som egne kontaktsubjekter knyttet til samme sak.
-
docs/source/likeperson.md · line 438Pårørende-database er Fase 1 MUST for Barnekreftforeningen
Analysis
Barnekreftforeningen coordinates care across entire family units, not just the primary patient. Without case linking, relative records are orphaned data with no operational utility - coordinators cannot see which relatives belong to which family case, and peer mentors cannot understand the support context during a visit. Linking also prevents double-counting in activity reporting by anchoring all family-related activities to a single case record, maintaining clean Bufdir-reportable data. This feature is what makes the relatives database operationally valuable rather than merely a contact directory.
Case linking is implemented via the relative_case_links junction table, which holds foreign keys to both relatives and contacts with an optional link_type field. The RelativeCaseLinkWidget is a Flutter widget rendered inside the ContactDetailScreen to show and manage linked relatives inline. CaseLinkService handles the business logic for creating, removing, and querying links, delegating persistence to the RelativeRepository. Offline support is handled by Drift with optimistic mutation and outbox sync. The API endpoint enforces that both the relative and the contact belong to the same organization before creating a link, preventing cross-tenant data leakage.
Components (6)
Shared Components
These components are reused across multiple features
User Stories
No user stories have been generated for this feature yet.