# developere19/clinical-decision-support-system architecture

> Architecture diagram of the GitHub repository developere19/clinical-decision-support-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/developere19/clinical-decision-support-system
- Repository: https://github.com/developere19/clinical-decision-support-system

## Overview

This educational CDSS takes user-reported present and absent symptoms through a CLI, validates them against the symptom set, and passes them to an integration function. That function runs forward-chaining over the knowledge base, conditionally ranks overlapping respiratory candidates with Bayesian scores, and generates rule-based explanations for display. The graph also shows the two JSON knowledge assets and their loaders. Relationships follow the README architecture and sampled source; evaluation cases are omitted as a verification capability rather than a runtime product stage.

Main entry points: [`src/cdss/integration.py`](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/integration.py) (CDSS integration), [`src/cdss/cli.py`](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/cli.py) (CLI input/output), [`src/cdss/knowledge_base.py`](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/knowledge_base.py) (Knowledge loader), [`src/cdss/bayes.py`](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/bayes.py) (Bayesian ranking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_cli["CLI input/output<br/>[cli.py]"]
end

subgraph group_coordination["CDSS coordination"]
  node_integration["CDSS integration<br/>[integration.py]"]
end

subgraph group_reasoning["Reasoning engines"]
  node_inference["Forward chaining<br/>[inference.py]"]
  node_bayes["Bayesian ranking<br/>[bayes.py]"]
  node_explanation["Rule explanations<br/>[explanation.py]"]
end

subgraph group_assets["Knowledge assets"]
  node_kb_loader["Knowledge loader<br/>[knowledge_base.py]"]
  node_knowledge_data["Rules and concepts"]
  node_bayes_config["Bayesian parameters"]
end

node_user(("User"))

node_user -->|"enters symptoms"| node_cli
node_cli -->|"loads symptoms"| node_kb_loader
node_cli -->|"submits facts"| node_integration
node_integration -->|"loads rules"| node_kb_loader
node_kb_loader -->|"reads JSON"| node_knowledge_data
node_integration -->|"runs rules"| node_inference
node_integration -->|"ranks candidates"| node_bayes
node_bayes -->|"loads parameters"| node_bayes_config
node_integration -->|"builds reasoning"| node_explanation
node_integration -->|"returns results"| node_cli

click node_cli "https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/cli.py"
click node_integration "https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/integration.py"
click node_inference "https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/inference.py"
click node_bayes "https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/bayes.py"
click node_explanation "https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/explanation.py"
click node_kb_loader "https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/knowledge_base.py"
click node_knowledge_data "https://github.com/developere19/clinical-decision-support-system/blob/main/data/knowledge_base.json"
click node_bayes_config "https://github.com/developere19/clinical-decision-support-system/blob/main/data/bayesian_config.json"

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_cli,node_user toneBlue
class node_integration toneAmber
class node_inference,node_bayes,node_explanation toneMint
class node_kb_loader,node_knowledge_data,node_bayes_config toneRose
```

## Components

### User interface

- [CLI input/output](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/cli.py): `src/cdss/cli.py`

### CDSS coordination

- [CDSS integration](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/integration.py): `src/cdss/integration.py`

### Reasoning engines

- [Forward chaining](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/inference.py): `src/cdss/inference.py`
- [Bayesian ranking](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/bayes.py): `src/cdss/bayes.py`
- [Rule explanations](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/explanation.py): `src/cdss/explanation.py`

### Knowledge assets

- [Knowledge loader](https://github.com/developere19/clinical-decision-support-system/blob/main/src/cdss/knowledge_base.py): `src/cdss/knowledge_base.py`
- [Rules and concepts](https://github.com/developere19/clinical-decision-support-system/blob/main/data/knowledge_base.json): `data/knowledge_base.json`
- [Bayesian parameters](https://github.com/developere19/clinical-decision-support-system/blob/main/data/bayesian_config.json): `data/bayesian_config.json`

### Other components

- **User**

## Connections

- User → CLI input/output: enters symptoms (evidence: `README.md`)
- CLI input/output → Knowledge loader: loads symptoms (evidence: `src/cdss/cli.py`)
- CLI input/output → CDSS integration: submits facts (evidence: `src/cdss/cli.py`)
- CDSS integration → Knowledge loader: loads rules (evidence: `src/cdss/integration.py`)
- Knowledge loader → Rules and concepts: reads JSON (evidence: `src/cdss/knowledge_base.py`)
- CDSS integration → Forward chaining: runs rules (evidence: `src/cdss/integration.py`)
- CDSS integration → Bayesian ranking: ranks candidates (evidence: `src/cdss/integration.py`)
- Bayesian ranking → Bayesian parameters: loads parameters (evidence: `src/cdss/bayes.py`)
- CDSS integration → Rule explanations: builds reasoning (evidence: `src/cdss/integration.py`)
- CDSS integration → CLI input/output: returns results (evidence: `src/cdss/cli.py`)
