# builtbyprashant/devicerecallassistant architecture

> Architecture diagram of the GitHub repository builtbyprashant/devicerecallassistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/builtbyprashant/devicerecallassistant
- Repository: https://github.com/builtbyprashant/devicerecallassistant

## Overview

RRA turns public recall evidence into a reviewed, explainable hospital worklist, then supports clinician decisions and patient follow-up. The main path is recall review and approval, local implant matching, evidence review, and versioned notice/case tracking. The architecture also includes a complementary patient-inventory view and optional AI-assisted parsing and notice drafting. Edges rely on README workflow statements or shown source references; several internal API persistence details were not excerpted, so those links are omitted.

Main entry points: [`matcher/rra_matcher/api/app.py`](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/api/app.py) (Matcher API), [`backend/Api/Workflow.cs`](https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/Workflow.cs) (.NET API workflow), [`frontend/src/App.tsx`](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/App.tsx) (Recall worklist app), [`matcher/rra_matcher/matching/tiers.py`](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/matching/tiers.py) (Tier assignment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_review["Recall review"]
  node_review_ui["Recall review panel"]
  node_recall_api["Recall API client<br/>[recallApi.ts]"]
  node_snapshots[("Recall snapshots<br/>[RecallSnapshots.cs]")]
end

subgraph group_matching["Matching service"]
  node_matcher_api["Matcher API<br/>[app.py]"]
  node_fda_data["FDA device data<br/>[gudid.py]"]
  node_scope_parser["Scope parser<br/>[parser.py]"]
  node_llm_fallback["Optional parse assist<br/>[llm_fallback.py]"]
  node_llm_provider["LLM provider interface<br/>[interface.py]"]
  node_normalizer["Identifier normalization<br/>[normalizer.py]"]
  node_tiers["Tier assignment<br/>[tiers.py]"]
  node_scorer["Match scoring<br/>[scorer.py]"]
end

subgraph group_workflow["Hospital workflow"]
  node_workflow_api[".NET API workflow<br/>[Workflow.cs]"]
  node_matcher_client["Matcher client<br/>[MatcherClient.cs]"]
  node_hospital_records["Hospital records<br/>[HospitalRecords.cs]"]
end

subgraph group_experience["Clinician experience"]
  node_app["Recall worklist app<br/>[App.tsx]"]
  node_candidate_table["Candidate worklist<br/>[CandidateTable.tsx]"]
  node_patient_detail["Patient case detail"]
  node_patient_inventory["Patient inventory"]
  node_adapter["Contract adapter<br/>[contractAdapter.ts]"]
end

node_reviewer(("Recall reviewer"))
node_fda[("FDA recall evidence")]
node_hapi[("HAPI FHIR")]
node_implant_log["Supplemental implant log"]
node_postgres[("PostgreSQL")]
node_clinician(("Clinician and coordinator"))

node_fda -->|"provides recall evidence"| node_workflow_api
node_reviewer -->|"reviews scope"| node_review_ui
node_review_ui -->|"requests recall actions"| node_recall_api
node_workflow_api -->|"uses snapshots"| node_snapshots
node_workflow_api -->|"invokes matcher"| node_matcher_client
node_matcher_client -->|"sends parse and match requests"| node_matcher_api
node_matcher_api -->|"parses recall scope"| node_scope_parser
node_matcher_api -->|"assigns match tiers"| node_tiers
node_matcher_api -->|"uses optional parsing"| node_llm_fallback
node_llm_fallback -->|"requests model output"| node_llm_provider
node_scope_parser -->|"normalizes identifiers"| node_normalizer
node_tiers -->|"uses scoring"| node_scorer
node_tiers -->|"normalizes comparisons"| node_normalizer
node_matcher_api -->|"loads device data"| node_fda_data
node_workflow_api -->|"loads local candidates"| node_hospital_records
node_hospital_records -->|"reads patient devices"| node_hapi
node_hospital_records -->|"combines implant records"| node_implant_log
node_workflow_api -->|"retains workflow history"| node_postgres
node_clinician -->|"reviews and follows up"| node_app
node_app -->|"shows candidates"| node_candidate_table
node_app -->|"opens case detail"| node_patient_detail
node_app -->|"shows inventory view"| node_patient_inventory
node_candidate_table -->|"adapts match rows"| node_adapter
node_patient_detail -->|"adapts case data"| node_adapter
node_app -->|"loads API data"| node_recall_api

click node_review_ui "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/RecallReviewPanel.tsx"
click node_recall_api "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/api/recallApi.ts"
click node_workflow_api "https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/Workflow.cs"
click node_snapshots "https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/RecallSnapshots.cs"
click node_matcher_client "https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/MatcherClient.cs"
click node_matcher_api "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/api/app.py"
click node_fda_data "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/fda/gudid.py"
click node_scope_parser "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/parsing/parser.py"
click node_llm_fallback "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/parsing/llm_fallback.py"
click node_llm_provider "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/llm/interface.py"
click node_normalizer "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/parsing/normalizer.py"
click node_tiers "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/matching/tiers.py"
click node_scorer "https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/matching/scorer.py"
click node_hospital_records "https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/HospitalRecords.cs"
click node_app "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/App.tsx"
click node_candidate_table "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/worklist/CandidateTable.tsx"
click node_patient_detail "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/PatientDetailView.tsx"
click node_patient_inventory "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/PatientInventoryView.tsx"
click node_adapter "https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/utils/contractAdapter.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_review_ui,node_recall_api,node_snapshots,node_reviewer toneBlue
class node_matcher_api,node_fda_data,node_scope_parser,node_llm_fallback,node_llm_provider,node_normalizer,node_tiers,node_scorer,node_fda,node_hapi,node_postgres toneAmber
class node_workflow_api,node_matcher_client,node_hospital_records toneMint
class node_app,node_candidate_table,node_patient_detail,node_patient_inventory,node_adapter toneRose
class node_implant_log,node_clinician toneIndigo
```

## Components

### Recall review

- [Recall review panel](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/RecallReviewPanel.tsx): `frontend/src/components/RecallReviewPanel.tsx`
- [Recall API client](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/api/recallApi.ts): `frontend/src/api/recallApi.ts`
- [Recall snapshots](https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/RecallSnapshots.cs): `backend/Api/RecallSnapshots.cs`

### Matching service

- [Matcher API](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/api/app.py): `matcher/rra_matcher/api/app.py`
- [FDA device data](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/fda/gudid.py): `matcher/rra_matcher/fda/gudid.py`
- [Scope parser](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/parsing/parser.py): `matcher/rra_matcher/parsing/parser.py`
- [Optional parse assist](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/parsing/llm_fallback.py): `matcher/rra_matcher/parsing/llm_fallback.py`
- [LLM provider interface](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/llm/interface.py): `matcher/rra_matcher/llm/interface.py`
- [Identifier normalization](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/parsing/normalizer.py): `matcher/rra_matcher/parsing/normalizer.py`
- [Tier assignment](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/matching/tiers.py): `matcher/rra_matcher/matching/tiers.py`
- [Match scoring](https://github.com/builtbyprashant/devicerecallassistant/blob/main/matcher/rra_matcher/matching/scorer.py): `matcher/rra_matcher/matching/scorer.py`

### Hospital workflow

- [.NET API workflow](https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/Workflow.cs): `backend/Api/Workflow.cs`
- [Matcher client](https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/MatcherClient.cs): `backend/Api/MatcherClient.cs`
- [Hospital records](https://github.com/builtbyprashant/devicerecallassistant/blob/main/backend/Api/HospitalRecords.cs): `backend/Api/HospitalRecords.cs`

### Clinician experience

- [Recall worklist app](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Candidate worklist](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/worklist/CandidateTable.tsx): `frontend/src/components/worklist/CandidateTable.tsx`
- [Patient case detail](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/PatientDetailView.tsx): `frontend/src/components/PatientDetailView.tsx`
- [Patient inventory](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/components/PatientInventoryView.tsx): `frontend/src/components/PatientInventoryView.tsx`
- [Contract adapter](https://github.com/builtbyprashant/devicerecallassistant/blob/main/frontend/src/utils/contractAdapter.ts): `frontend/src/utils/contractAdapter.ts`

### Other components

- **Recall reviewer**
- **FDA recall evidence**
- **HAPI FHIR**
- **Supplemental implant log**
- **PostgreSQL**
- **Clinician and coordinator**

## Connections

- FDA recall evidence → .NET API workflow: provides recall evidence (evidence: `README.md`)
- Recall reviewer → Recall review panel: reviews scope (evidence: `README.md`)
- Recall review panel → Recall API client: requests recall actions (evidence: `frontend/src/App.tsx`)
- .NET API workflow → Recall snapshots: uses snapshots (evidence: `backend/Api/Program.cs`)
- .NET API workflow → Matcher client: invokes matcher (evidence: `backend/Api/Workflow.cs`)
- Matcher client → Matcher API: sends parse and match requests (evidence: `backend/Api/MatcherClient.cs`)
- Matcher API → Scope parser: parses recall scope (evidence: `matcher/rra_matcher/api/app.py`)
- Matcher API → Tier assignment: assigns match tiers (evidence: `matcher/rra_matcher/api/app.py`)
- Matcher API → Optional parse assist: uses optional parsing (evidence: `matcher/rra_matcher/api/app.py`)
- Optional parse assist → LLM provider interface: requests model output (evidence: `matcher/rra_matcher/parsing/llm_fallback.py`)
- Scope parser → Identifier normalization: normalizes identifiers (evidence: `matcher/rra_matcher/parsing/parser.py`)
- Tier assignment → Match scoring: uses scoring (evidence: `matcher/rra_matcher/matching/tiers.py`)
- Tier assignment → Identifier normalization: normalizes comparisons (evidence: `matcher/rra_matcher/matching/tiers.py`)
- Matcher API → FDA device data: loads device data (evidence: `matcher/rra_matcher/api/app.py`)
- .NET API workflow → Hospital records: loads local candidates (evidence: `backend/Api/Program.cs`)
- Hospital records → HAPI FHIR: reads patient devices (evidence: `README.md`)
- Hospital records → Supplemental implant log: combines implant records (evidence: `README.md`)
- .NET API workflow → PostgreSQL: retains workflow history (evidence: `README.md`)
- Clinician and coordinator → Recall worklist app: reviews and follows up (evidence: `README.md`)
- Recall worklist app → Candidate worklist: shows candidates (evidence: `frontend/src/App.tsx`)
- Recall worklist app → Patient case detail: opens case detail (evidence: `frontend/src/App.tsx`)
- Recall worklist app → Patient inventory: shows inventory view (evidence: `frontend/src/App.tsx`)
- Candidate worklist → Contract adapter: adapts match rows (evidence: `frontend/src/components/worklist/CandidateTable.tsx`)
- Patient case detail → Contract adapter: adapts case data (evidence: `frontend/src/components/PatientDetailView.tsx`)
- Recall worklist app → Recall API client: loads API data (evidence: `frontend/src/App.tsx`)
