# gel1has3/cds-web-app architecture

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

- Interactive diagram: https://gitdiagram.com/gel1has3/cds-web-app
- Repository: https://github.com/gel1has3/cds-web-app

## Overview

This is a Streamlit clinical decision-support application for pregnancy care, aimed at point-of-care use in low-resource settings. The visible user journey is login, pregnancy symptom entry, and clinical-pathway generation; the README additionally describes a hybrid knowledge/data-driven approach and clinician review of generated pathways. The graph preserves the documented ANC/PNC and evidence-based capabilities, but sampled excerpts do not establish every downstream call or the full Bayesian-model lifecycle, so uncertain links are omitted.

Main entry points: [`CP APPs (V2 on progress)/cp_Processing.py`](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_Processing.py) (Pathway processing), [`CP APPs (V2 on progress)/CP_login.py`](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/CP_login.py) (Login and menu), [`CP APPs (V2 on progress)/pregnantPatient_Workflow.py`](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatient_Workflow.py) (Pregnancy workflow), [`CP APPs (V2 on progress)/cp_endrosment.py`](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_endrosment.py) (Clinician endorsement)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Access and workflow"]
  node_login["Login and menu<br/>[CP_login.py]"]
  node_workflow["Pregnancy workflow"]
  node_symptoms["Symptom capture"]
  node_login_db[("User database<br/>[data.db]")]
end

subgraph group_clinical["Clinical knowledge"]
  node_indicators["Guideline indicators"]
  node_indicator_access["Indicator access"]
  node_pregnancy_rules["Pregnancy rules"]
  node_rule_access["Rule access"]
  node_management["Management guidance"]
  node_recommendations["Recommendations"]
end

subgraph group_generation["Pathway generation"]
  node_symptom_processing["Symptom processing"]
  node_pathway_engine["Pathway processing<br/>[cp_Processing.py]"]
  node_bayesian_model["Learned CP model"]
end

subgraph group_review["Review and persistence"]
  node_pruning["Pathway pruning<br/>[cp_pruning.py]"]
  node_endorsement["Clinician endorsement<br/>[cp_endrosment.py]"]
  node_cp_tools["CP data utilities<br/>[cp_tools.py]"]
  node_graph["Pathway graph"]
  node_endorsed_store[("Endorsed pathways")]
end

node_clinician(("Clinician"))

node_clinician -->|"opens app"| node_login
node_login -->|"authenticates against"| node_login_db
node_login -->|"opens workflow"| node_workflow
node_workflow -->|"collects symptoms"| node_symptoms
node_workflow -->|"generates pathways"| node_pathway_engine
node_pathway_engine -->|"loads indicators"| node_indicator_access
node_indicator_access -->|"reads rules"| node_indicators
node_rule_access -->|"loads rules"| node_pregnancy_rules
node_clinician -->|"selects pathways"| node_endorsement
node_endorsement -->|"formats selection"| node_cp_tools
node_endorsement -->|"requests graph"| node_graph
node_cp_tools -.->|"reads or writes"| node_endorsed_store
node_pathway_engine -.->|"uses guidance"| node_management
node_pathway_engine -.->|"uses recommendations"| node_recommendations
node_pathway_engine -.->|"uses learned model"| node_bayesian_model
node_pathway_engine -.->|"processes findings"| node_symptom_processing
node_clinician -.->|"filters results"| node_pruning

click node_login "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/CP_login.py"
click node_workflow "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatient_Workflow.py"
click node_symptoms "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatient_Workflow.py"
click node_symptom_processing "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/processing_Measured_Symptoms.py"
click node_indicators "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/CG_rulesets_and_indicators.py"
click node_indicator_access "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/showCG_Indicators.py"
click node_pregnancy_rules "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/ThePregnantPathways_Rules.py"
click node_rule_access "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/getPregnantPatientRules.py"
click node_pathway_engine "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_Processing.py"
click node_management "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/Mgmt_and_Suggestions.py"
click node_recommendations "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatientRecommendations.py"
click node_bayesian_model "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/Pickle_CP_Model.pkl"
click node_pruning "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_pruning.py"
click node_endorsement "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_endrosment.py"
click node_cp_tools "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_tools.py"
click node_graph "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/generate_cp_graph.py"
click node_login_db "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/data.db"
click node_endorsed_store "https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/ThePregnantPatient_EndrosedCPs.pkl"

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_login,node_workflow,node_symptoms,node_login_db toneBlue
class node_indicators,node_indicator_access,node_pregnancy_rules,node_rule_access,node_management,node_recommendations toneAmber
class node_symptom_processing,node_pathway_engine,node_bayesian_model toneMint
class node_pruning,node_endorsement,node_cp_tools,node_graph,node_endorsed_store toneRose
class node_clinician toneIndigo
```

## Components

### Access and workflow

- [Login and menu](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/CP_login.py): `CP APPs (V2 on progress)/CP_login.py`
- [Pregnancy workflow](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatient_Workflow.py): `CP APPs (V2 on progress)/pregnantPatient_Workflow.py`
- [Symptom capture](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatient_Workflow.py): `CP APPs (V2 on progress)/pregnantPatient_Workflow.py`
- [User database](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/data.db): `CP APPs (V2 on progress)/data.db`

### Clinical knowledge

- [Guideline indicators](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/CG_rulesets_and_indicators.py): `CP APPs (V2 on progress)/CG_rulesets_and_indicators.py`
- [Indicator access](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/showCG_Indicators.py): `CP APPs (V2 on progress)/showCG_Indicators.py`
- [Pregnancy rules](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/ThePregnantPathways_Rules.py): `CP APPs (V2 on progress)/ThePregnantPathways_Rules.py`
- [Rule access](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/getPregnantPatientRules.py): `CP APPs (V2 on progress)/getPregnantPatientRules.py`
- [Management guidance](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/Mgmt_and_Suggestions.py): `CP APPs (V2 on progress)/Mgmt_and_Suggestions.py`
- [Recommendations](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/pregnantPatientRecommendations.py): `CP APPs (V2 on progress)/pregnantPatientRecommendations.py`

### Pathway generation

- [Symptom processing](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/processing_Measured_Symptoms.py): `CP APPs (V2 on progress)/processing_Measured_Symptoms.py`
- [Pathway processing](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_Processing.py): `CP APPs (V2 on progress)/cp_Processing.py`
- [Learned CP model](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/Pickle_CP_Model.pkl): `CP APPs (V2 on progress)/Pickle_CP_Model.pkl`

### Review and persistence

- [Pathway pruning](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_pruning.py): `CP APPs (V2 on progress)/cp_pruning.py`
- [Clinician endorsement](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_endrosment.py): `CP APPs (V2 on progress)/cp_endrosment.py`
- [CP data utilities](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/cp_tools.py): `CP APPs (V2 on progress)/cp_tools.py`
- [Pathway graph](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/generate_cp_graph.py): `CP APPs (V2 on progress)/generate_cp_graph.py`
- [Endorsed pathways](https://github.com/gel1has3/cds-web-app/blob/main/CP%20APPs%20(V2%20on%20progress)/ThePregnantPatient_EndrosedCPs.pkl): `CP APPs (V2 on progress)/ThePregnantPatient_EndrosedCPs.pkl`

### Other components

- **Clinician**

## Connections

- Clinician → Login and menu: opens app (evidence: `CP APPs (V2 on progress)/CP_login.py`)
- Login and menu → User database: authenticates against (evidence: `CP APPs (V2 on progress)/CP_login.py`)
- Login and menu → Pregnancy workflow: opens workflow (evidence: `CP APPs (V2 on progress)/CP_login.py`)
- Pregnancy workflow → Symptom capture: collects symptoms (evidence: `CP APPs (V2 on progress)/pregnantPatient_Workflow.py`)
- Pregnancy workflow → Pathway processing: generates pathways (evidence: `CP APPs (V2 on progress)/pregnantPatient_Workflow.py`)
- Pathway processing → Indicator access: loads indicators (evidence: `CP APPs (V2 on progress)/cp_Processing.py`)
- Indicator access → Guideline indicators: reads rules (evidence: `CP APPs (V2 on progress)/showCG_Indicators.py`)
- Rule access → Pregnancy rules: loads rules (evidence: `CP APPs (V2 on progress)/getPregnantPatientRules.py`)
- Clinician → Clinician endorsement: selects pathways (evidence: `CP APPs (V2 on progress)/cp_endrosment.py`)
- Clinician endorsement → CP data utilities: formats selection (evidence: `CP APPs (V2 on progress)/cp_endrosment.py`)
- Clinician endorsement → Pathway graph: requests graph (evidence: `CP APPs (V2 on progress)/cp_endrosment.py`)
- CP data utilities → Endorsed pathways: reads or writes
- Pathway processing → Management guidance: uses guidance (evidence: `CP APPs (V2 on progress)/cp_Processing.py`)
- Pathway processing → Recommendations: uses recommendations (evidence: `CP APPs (V2 on progress)/cp_Processing.py`)
- Pathway processing → Learned CP model: uses learned model
- Pathway processing → Symptom processing: processes findings
- Clinician → Pathway pruning: filters results
