# jayaprakash27777/docassistiq architecture

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

- Interactive diagram: https://gitdiagram.com/jayaprakash27777/docassistiq
- Repository: https://github.com/jayaprakash27777/docassistiq

## Overview

DocAssistIQ is an evidence-grounded clinical decision-support platform for healthcare professionals. Its principal workflow is a clinician using the web application to enter or review clinical information and receive diagnostic reasoning and supporting evidence; the repository documents these capabilities, but the sampled material does not establish the frontend-to-endpoint routing. Internally, deterministic disease reasoning, live medical knowledge, and offline disease knowledge form distinct intelligence layers. Separate branches cover clinical knowledge ingestion, administration, and the clinician social hub. Dashed edges mark workflow links not verified in the excerpts.

Main entry points: [`backend/app/services/clinical_reasoning_engine.py`](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/clinical_reasoning_engine.py) (Clinical reasoning), [`backend/app/services/realtime_medical_engine.py`](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/realtime_medical_engine.py) (Live medical knowledge), [`backend/app/tasks/ingestion.py`](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/tasks/ingestion.py) (Knowledge ingestion), [`backend/app/services/ingestion/guidelines_ingester.py`](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/ingestion/guidelines_ingester.py) (Guideline ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clinical_ui["Clinical workspace"]
  node_web_app["Clinical workspace<br/>[page.tsx]"]
  node_consultation_ui["Consultation review<br/>[page.tsx]"]
  node_note_review["Note review"]
end

subgraph group_api_security["API and access"]
  node_api_routes["Clinical API"]
  node_auth_access["Authentication and roles<br/>[authorization.py]"]
end

subgraph group_clinical_intelligence["Clinical intelligence"]
  node_reasoning["Clinical reasoning"]
  node_intelligence["Diagnostic intelligence"]
  node_realtime_engine["Live medical knowledge"]
  node_open_domain["Open-domain diagnosis"]
  node_offline_kb["Offline disease knowledge"]
  node_clinical_nlp["Clinical NLP<br/>[clinical_nlp.py]"]
  node_ai_provider["AI provider factory<br/>[factory.py]"]
end

subgraph group_knowledge_data["Knowledge and data"]
  node_knowledge_ingest["Knowledge ingestion<br/>[ingestion.py]"]
  node_guideline_ingester["Guideline ingestion"]
  node_lab_ingester["Lab-test ingestion"]
  node_knowledge_store[("Clinical knowledge store<br/>[knowledge.py]")]
  node_evidence_provenance[("Evidence provenance<br/>[provenance.py]")]
  node_database[("PostgreSQL<br/>[database.py]")]
end

subgraph group_community_admin["Community and administration"]
  node_admin_ui["Knowledge administration<br/>[page.tsx]"]
  node_social_hub["Clinician social hub<br/>[page.tsx]"]
end

node_clinician(("Clinician"))
node_live_sources(("External medical sources"))

node_clinician -.->|"uses"| node_web_app
node_web_app -.->|"submits clinical queries"| node_api_routes
node_consultation_ui -.->|"requests consultation data"| node_api_routes
node_api_routes -.->|"dispatches diagnosis"| node_reasoning
node_reasoning -->|"uses reasoning support"| node_intelligence
node_reasoning -.->|"uses live evidence"| node_realtime_engine
node_reasoning -->|"uses disease knowledge"| node_offline_kb
node_intelligence -->|"reads disease catalog"| node_offline_kb
node_realtime_engine -->|"uses offline fallback"| node_offline_kb
node_realtime_engine -->|"uses open-domain results"| node_open_domain
node_realtime_engine -->|"queries evidence"| node_live_sources
node_reasoning -.->|"normalizes clinical text"| node_clinical_nlp
node_reasoning -.->|"generates narrative"| node_ai_provider
node_admin_ui -.->|"manages ingestion"| node_knowledge_ingest
node_knowledge_ingest -->|"dispatches ingestion"| node_guideline_ingester
node_knowledge_ingest -->|"dispatches ingestion"| node_lab_ingester
node_guideline_ingester -->|"writes knowledge"| node_knowledge_store
node_guideline_ingester -->|"records provenance"| node_evidence_provenance
node_lab_ingester -->|"writes investigations"| node_knowledge_store
node_knowledge_store -.->|"persists records"| node_database
node_evidence_provenance -.->|"persists records"| node_database
node_note_review -.->|"supports review"| node_consultation_ui
node_clinician -.->|"uses"| node_social_hub

click node_web_app "https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/ai/page.tsx"
click node_consultation_ui "https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/consultations/%5Bid%5D/page.tsx"
click node_note_review "https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/components/clinical/NoteReviewWorkspace.tsx"
click node_api_routes "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/api/v1/endpoints/clinical_knowledge.py"
click node_auth_access "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/authorization.py"
click node_reasoning "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/clinical_reasoning_engine.py"
click node_intelligence "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/intelligence_engine.py"
click node_realtime_engine "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/realtime_medical_engine.py"
click node_open_domain "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/open_domain_medical_engine.py"
click node_offline_kb "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/offline_disease_kb.py"
click node_clinical_nlp "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/clinical_nlp.py"
click node_ai_provider "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/infrastructure/ai/factory.py"
click node_knowledge_ingest "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/tasks/ingestion.py"
click node_guideline_ingester "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/ingestion/guidelines_ingester.py"
click node_lab_ingester "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/ingestion/medlineplus_lab_tests_ingester.py"
click node_knowledge_store "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/models/knowledge.py"
click node_evidence_provenance "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/models/provenance.py"
click node_database "https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/infrastructure/database.py"
click node_admin_ui "https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/admin/page.tsx"
click node_social_hub "https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/hub/page.tsx"

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_web_app,node_consultation_ui,node_note_review toneBlue
class node_api_routes,node_auth_access toneAmber
class node_reasoning,node_intelligence,node_realtime_engine,node_open_domain,node_offline_kb,node_clinical_nlp,node_ai_provider toneMint
class node_knowledge_ingest,node_guideline_ingester,node_lab_ingester,node_knowledge_store,node_evidence_provenance,node_database toneRose
class node_admin_ui,node_social_hub,node_clinician,node_live_sources toneIndigo
```

## Components

### Clinical workspace

- [Clinical workspace](https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/ai/page.tsx): `frontend/src/app/(shell)/ai/page.tsx`
- [Consultation review](https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/consultations/%5Bid%5D/page.tsx): `frontend/src/app/(shell)/consultations/[id]/page.tsx`
- [Note review](https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/components/clinical/NoteReviewWorkspace.tsx): `frontend/src/components/clinical/NoteReviewWorkspace.tsx`

### API and access

- [Clinical API](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/api/v1/endpoints/clinical_knowledge.py): `backend/app/api/v1/endpoints/clinical_knowledge.py`
- [Authentication and roles](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/authorization.py): `backend/app/authorization.py`

### Clinical intelligence

- [Clinical reasoning](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/clinical_reasoning_engine.py): `backend/app/services/clinical_reasoning_engine.py`
- [Diagnostic intelligence](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/intelligence_engine.py): `backend/app/services/intelligence_engine.py`
- [Live medical knowledge](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/realtime_medical_engine.py): `backend/app/services/realtime_medical_engine.py`
- [Open-domain diagnosis](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/open_domain_medical_engine.py): `backend/app/services/open_domain_medical_engine.py`
- [Offline disease knowledge](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/offline_disease_kb.py): `backend/app/services/offline_disease_kb.py`
- [Clinical NLP](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/clinical_nlp.py): `backend/app/services/clinical_nlp.py`
- [AI provider factory](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/infrastructure/ai/factory.py): `backend/app/infrastructure/ai/factory.py`

### Knowledge and data

- [Knowledge ingestion](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/tasks/ingestion.py): `backend/app/tasks/ingestion.py`
- [Guideline ingestion](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/ingestion/guidelines_ingester.py): `backend/app/services/ingestion/guidelines_ingester.py`
- [Lab-test ingestion](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/services/ingestion/medlineplus_lab_tests_ingester.py): `backend/app/services/ingestion/medlineplus_lab_tests_ingester.py`
- [Clinical knowledge store](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/models/knowledge.py): `backend/app/models/knowledge.py`
- [Evidence provenance](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/models/provenance.py): `backend/app/models/provenance.py`
- [PostgreSQL](https://github.com/jayaprakash27777/docassistiq/blob/main/backend/app/infrastructure/database.py): `backend/app/infrastructure/database.py`

### Community and administration

- [Knowledge administration](https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/admin/page.tsx): `frontend/src/app/(shell)/admin/page.tsx`
- [Clinician social hub](https://github.com/jayaprakash27777/docassistiq/blob/main/frontend/src/app/(shell)/hub/page.tsx): `frontend/src/app/(shell)/hub/page.tsx`

### Other components

- **Clinician**
- **External medical sources**

## Connections

- Clinician → Clinical workspace: uses
- Clinical workspace → Clinical API: submits clinical queries
- Consultation review → Clinical API: requests consultation data
- Clinical API → Clinical reasoning: dispatches diagnosis
- Clinical reasoning → Diagnostic intelligence: uses reasoning support (evidence: `backend/app/services/clinical_reasoning_engine.py`)
- Clinical reasoning → Live medical knowledge: uses live evidence
- Clinical reasoning → Offline disease knowledge: uses disease knowledge (evidence: `backend/app/services/clinical_reasoning_engine.py`)
- Diagnostic intelligence → Offline disease knowledge: reads disease catalog (evidence: `backend/app/services/intelligence_engine.py`)
- Live medical knowledge → Offline disease knowledge: uses offline fallback (evidence: `backend/app/services/realtime_medical_engine.py`)
- Live medical knowledge → Open-domain diagnosis: uses open-domain results (evidence: `backend/app/services/realtime_medical_engine.py`)
- Live medical knowledge → External medical sources: queries evidence (evidence: `backend/app/services/realtime_medical_engine.py`)
- Clinical reasoning → Clinical NLP: normalizes clinical text
- Clinical reasoning → AI provider factory: generates narrative
- Knowledge administration → Knowledge ingestion: manages ingestion
- Knowledge ingestion → Guideline ingestion: dispatches ingestion (evidence: `backend/app/tasks/ingestion.py`)
- Knowledge ingestion → Lab-test ingestion: dispatches ingestion (evidence: `backend/app/tasks/ingestion.py`)
- Guideline ingestion → Clinical knowledge store: writes knowledge (evidence: `backend/app/services/ingestion/guidelines_ingester.py`)
- Guideline ingestion → Evidence provenance: records provenance (evidence: `backend/app/services/ingestion/guidelines_ingester.py`)
- Lab-test ingestion → Clinical knowledge store: writes investigations (evidence: `backend/app/services/ingestion/medlineplus_lab_tests_ingester.py`)
- Clinical knowledge store → PostgreSQL: persists records (evidence: `backend/app/models/knowledge.py`)
- Evidence provenance → PostgreSQL: persists records (evidence: `backend/app/models/provenance.py`)
- Note review → Consultation review: supports review
- Clinician → Clinician social hub: uses
