# tuva-health/tuva-core architecture

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

- Interactive diagram: https://gitdiagram.com/tuva-health/tuva-core
- Repository: https://github.com/tuva-health/tuva-core

## Overview

Tuva Core is a dbt package that transforms healthcare data into a warehouse-resident common analytics model. The main workflow maps source data into the Input Layer, normalizes it, derives claims-preprocessing outputs, and produces Core models; opt-in data-quality and parity models, metadata, and versioned data assets are additional capabilities. The tree and README establish these product areas, but the only sampled source is a portability linter, so runtime model-to-model relationships are not evidenced here and are omitted.

Main entry points: [`models/normalized_layer`](https://github.com/tuva-health/tuva-core/tree/main/models/normalized_layer) (Normalized Layer), [`models/input_layer`](https://github.com/tuva-health/tuva-core/tree/main/models/input_layer) (Input Layer), [`models/core`](https://github.com/tuva-health/tuva-core/tree/main/models/core) (Core Outputs), [`models/data_quality/structural`](https://github.com/tuva-health/tuva-core/tree/main/models/data_quality/structural) (Structural Data Quality)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and Normalization"]
  node_input_layer["Input Layer"]
  node_normalized["Normalized Layer"]
end

subgraph group_claims["Claims Preprocessing"]
  node_service_category["Service Categories"]
  node_encounters["Encounter Processing"]
  node_member_month["Member Months"]
  node_enrollment_flags["Enrollment Flags"]
  node_provider_attribution["Provider Attribution"]
end

subgraph group_core["Core Data Model"]
  node_core_model["Core Outputs"]
end

subgraph group_quality["Quality and Parity"]
  node_structural_dq["Structural Data Quality"]
  node_logical_dq["Logical Data Quality"]
  node_parity["Parity Metrics"]
end

subgraph group_assets["Metadata and Assets"]
  node_metadata["Package Metadata"]
  node_asset_seeds["Terminology and Value Sets"]
  node_provider_data["Provider Data"]
  node_synthetic_data["Synthetic Data"]
end

node_user(("Parent Project"))
node_warehouse[("Cloud Data Warehouse")]

node_user -->|"maps sources"| node_input_layer
node_input_layer -.->|"normalizes inputs"| node_normalized
node_normalized -.->|"preprocesses claims"| node_service_category
node_normalized -.->|"preprocesses claims"| node_encounters
node_normalized -.->|"derives months"| node_member_month
node_normalized -.->|"flags enrollment"| node_enrollment_flags
node_normalized -.->|"attributes providers"| node_provider_attribution
node_normalized -.->|"builds outputs"| node_core_model
node_core_model -.->|"writes models"| node_warehouse
node_structural_dq -.->|"checks structures"| node_warehouse
node_logical_dq -.->|"checks values"| node_warehouse
node_parity -.->|"writes metrics"| node_warehouse
node_asset_seeds -.->|"loads assets"| node_warehouse
node_provider_data -.->|"loads assets"| node_warehouse
node_synthetic_data -.->|"loads assets"| node_warehouse

click node_input_layer "https://github.com/tuva-health/tuva-core/tree/main/models/input_layer"
click node_normalized "https://github.com/tuva-health/tuva-core/tree/main/models/normalized_layer"
click node_service_category "https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/service_category"
click node_encounters "https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/encounters"
click node_member_month "https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/member_month"
click node_enrollment_flags "https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/claims_enrollment_flags"
click node_provider_attribution "https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/provider_attribution"
click node_core_model "https://github.com/tuva-health/tuva-core/tree/main/models/core"
click node_structural_dq "https://github.com/tuva-health/tuva-core/tree/main/models/data_quality/structural"
click node_logical_dq "https://github.com/tuva-health/tuva-core/tree/main/models/data_quality/logical"
click node_parity "https://github.com/tuva-health/tuva-core/tree/main/models/parity"
click node_metadata "https://github.com/tuva-health/tuva-core/tree/main/models/metadata"
click node_asset_seeds "https://github.com/tuva-health/tuva-core/tree/main/seeds"
click node_provider_data "https://github.com/tuva-health/tuva-core/tree/main/seeds/provider_data"
click node_synthetic_data "https://github.com/tuva-health/tuva-core/tree/main/seeds/synthetic_data"

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_input_layer,node_normalized toneBlue
class node_service_category,node_encounters,node_member_month,node_enrollment_flags,node_provider_attribution,node_warehouse toneAmber
class node_core_model toneMint
class node_structural_dq,node_logical_dq,node_parity toneRose
class node_metadata,node_asset_seeds,node_provider_data,node_synthetic_data,node_user toneIndigo
```

## Components

### Input and Normalization

- [Input Layer](https://github.com/tuva-health/tuva-core/tree/main/models/input_layer): `models/input_layer`
- [Normalized Layer](https://github.com/tuva-health/tuva-core/tree/main/models/normalized_layer): `models/normalized_layer`

### Claims Preprocessing

- [Service Categories](https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/service_category): `models/claims_preprocessing/service_category`
- [Encounter Processing](https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/encounters): `models/claims_preprocessing/encounters`
- [Member Months](https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/member_month): `models/claims_preprocessing/member_month`
- [Enrollment Flags](https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/claims_enrollment_flags): `models/claims_preprocessing/claims_enrollment_flags`
- [Provider Attribution](https://github.com/tuva-health/tuva-core/tree/main/models/claims_preprocessing/provider_attribution): `models/claims_preprocessing/provider_attribution`

### Core Data Model

- [Core Outputs](https://github.com/tuva-health/tuva-core/tree/main/models/core): `models/core`

### Quality and Parity

- [Structural Data Quality](https://github.com/tuva-health/tuva-core/tree/main/models/data_quality/structural): `models/data_quality/structural`
- [Logical Data Quality](https://github.com/tuva-health/tuva-core/tree/main/models/data_quality/logical): `models/data_quality/logical`
- [Parity Metrics](https://github.com/tuva-health/tuva-core/tree/main/models/parity): `models/parity`

### Metadata and Assets

- [Package Metadata](https://github.com/tuva-health/tuva-core/tree/main/models/metadata): `models/metadata`
- [Terminology and Value Sets](https://github.com/tuva-health/tuva-core/tree/main/seeds): `seeds`
- [Provider Data](https://github.com/tuva-health/tuva-core/tree/main/seeds/provider_data): `seeds/provider_data`
- [Synthetic Data](https://github.com/tuva-health/tuva-core/tree/main/seeds/synthetic_data): `seeds/synthetic_data`

### Other components

- **Parent Project**
- **Cloud Data Warehouse**

## Connections

- Parent Project → Input Layer: maps sources (evidence: `README.md`)
- Input Layer → Normalized Layer: normalizes inputs
- Normalized Layer → Service Categories: preprocesses claims
- Normalized Layer → Encounter Processing: preprocesses claims
- Normalized Layer → Member Months: derives months
- Normalized Layer → Enrollment Flags: flags enrollment
- Normalized Layer → Provider Attribution: attributes providers
- Normalized Layer → Core Outputs: builds outputs
- Core Outputs → Cloud Data Warehouse: writes models
- Structural Data Quality → Cloud Data Warehouse: checks structures
- Logical Data Quality → Cloud Data Warehouse: checks values
- Parity Metrics → Cloud Data Warehouse: writes metrics
- Terminology and Value Sets → Cloud Data Warehouse: loads assets
- Provider Data → Cloud Data Warehouse: loads assets
- Synthetic Data → Cloud Data Warehouse: loads assets
