# cdcgov/nhsnlink architecture

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

- Interactive diagram: https://gitdiagram.com/cdcgov/nhsnlink
- Repository: https://github.com/cdcgov/nhsnlink

## Overview

Link Cloud is a FHIR-based public-health reporting and clinical-data platform composed of .NET and Java services. Its broad workflow acquires patient data, normalizes and evaluates it, validates and reports it, then supports submission; the repository tree also shows account, administration, and query-dispatch capabilities. The sampled code confirms query-plan persistence, template seeding, query-dispatch HTTP calls, and FHIR bundle generation/upload. Other service-to-service links are shown only as unverified where the README describes the lifecycle but sampled source does not establish the wiring.

Main entry points: [`DotNet/Automation.UI/Controllers/QueryPlansController.cs`](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Controllers/QueryPlansController.cs) (Template management API), [`DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs`](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs) (Query plan management), [`DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs`](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs) (Template seeding), [`DotNet/Automation/Generation/FhirGenerationPipeline.cs`](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/FhirGenerationPipeline.cs) (FHIR generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Data acquisition"]
  node_query_config_api["Query configuration API"]
  node_query_plans["Query plan management"]
  node_query_plan_model["Query plan models<br/>[Models]"]
  node_query_plan_entity["Query plan entity<br/>[QueryPlan.cs]"]
  node_acquisition_db[("Acquisition database")]
  node_auth_selection["EHR authentication"]
  node_fhir_list_model["FHIR list configuration"]
  node_frequency["Query frequency<br/>[Frequency.cs]"]
  node_variable["Query variables<br/>[Variable.cs]"]
end

subgraph group_automation["Automation"]
  node_template_api["Template management API"]
  node_template_seed["Template seeding"]
  node_generation["FHIR generation"]
  node_generation_manifest["Generation manifest"]
  node_automation_ui_template["Template model"]
  node_query_defaults["Query plan defaults"]
end

subgraph group_processing["Processing services"]
  node_normalization["FHIR normalization"]
  node_measure_eval["Measure evaluation"]
  node_validation["Clinical validation"]
  node_reporting["Report services"]
  node_submission["Submission services"]
end

subgraph group_admin["Administration"]
  node_admin_api["Admin API<br/>[Program.cs]"]
  node_service_clients["Service clients<br/>[Clients]"]
  node_query_dispatch_api["Query dispatch API"]
  node_query_dispatch_client["Dispatch client"]
end

subgraph group_platform["Platform services"]
  node_accounts["Account management<br/>[UserEndpoints.cs]"]
  node_audit["Audit service<br/>[AuditController.cs]"]
  node_service_registry["Service registry<br/>[ServiceRegistry.cs]"]
  node_policy_names["Authorization policies<br/>[PolicyNames.cs]"]
end

node_operator(("Platform operator"))
node_ehr{{"FHIR EHR"}}

node_operator -.->|"manages templates"| node_template_api
node_template_api -->|"loads defaults"| node_query_defaults
node_template_seed -->|"loads defaults"| node_query_defaults
node_template_seed -->|"creates templates"| node_automation_ui_template
node_template_api -->|"uses model"| node_automation_ui_template
node_query_plans -->|"persists entity"| node_query_plan_entity
node_query_plans -->|"accepts input"| node_query_plan_model
node_query_plan_entity -.->|"stored in"| node_acquisition_db
node_query_config_api -->|"handles configuration"| node_fhir_list_model
node_ehr -.->|"provides patient data"| node_query_config_api
node_auth_selection -.->|"selects credentials"| node_ehr
node_generation -.->|"uploads bundles"| node_ehr
node_generation -.->|"builds manifest"| node_generation_manifest
node_query_dispatch_client -->|"calls HTTP API"| node_query_dispatch_api
node_query_dispatch_api -.->|"configures dispatch"| node_service_clients
node_operator -.->|"uses administration"| node_admin_api
node_admin_api -.->|"routes service requests"| node_service_clients
node_normalization -.->|"passes clinical data"| node_measure_eval
node_measure_eval -.->|"passes evaluated data"| node_validation
node_validation -.->|"enables reporting"| node_reporting
node_reporting -.->|"supports submission"| node_submission

click node_query_config_api "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition/Controllers/QueryListController.cs"
click node_query_plans "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs"
click node_query_plan_model "https://github.com/cdcgov/nhsnlink/tree/main/DotNet/DataAcquisition.Domain/Application/Models"
click node_query_plan_entity "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Infrastructure/Entities/QueryPlan.cs"
click node_acquisition_db "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Infrastructure/Context/DataAcquisitionDbContext.cs"
click node_auth_selection "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Services/AuthenticationRetrievalService.cs"
click node_template_api "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Controllers/QueryPlansController.cs"
click node_template_seed "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs"
click node_generation "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/FhirGenerationPipeline.cs"
click node_generation_manifest "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/GenerationManifest.cs"
click node_normalization "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Normalization.Engine/Engine/NormalizationEngine.cs"
click node_measure_eval "https://github.com/cdcgov/nhsnlink/blob/main/Java/measureeval/src/main/java/com/lantanagroup/link/measureeval/services/BlobStorageService.java"
click node_validation "https://github.com/cdcgov/nhsnlink/blob/main/Java/validation/src/main/java/com/lantanagroup/link/validation/services/BlobStorageService.java"
click node_reporting "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Report/Services/BlobStorageService.cs"
click node_submission "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Submission/Application/Services/BlobStorageService.cs"
click node_admin_api "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Admin.BFF/Program.cs"
click node_service_clients "https://github.com/cdcgov/nhsnlink/tree/main/DotNet/Admin.BFF/Application/Clients"
click node_query_dispatch_api "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/QueryDispatch/Presentation/Controllers/QueryDispatchController.cs"
click node_query_dispatch_client "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/LinkSdk/Clients/QueryDispatchServiceClient.cs"
click node_accounts "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Account/Presentation/Endpoints/User/UserEndpoints.cs"
click node_audit "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Audit/Presentation/Controllers/AuditController.cs"
click node_automation_ui_template "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Models/QueryPlanTemplate.cs"
click node_query_defaults "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/QueryPlanDefaults.cs"
click node_fhir_list_model "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirListConfigurationModel.cs"
click node_frequency "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Shared/Application/Models/Frequency.cs"
click node_variable "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Infrastructure/Models/QueryConfig/Parameter/Variable.cs"
click node_service_registry "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Shared/Application/Models/Configs/ServiceRegistry.cs"
click node_policy_names "https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Link.Authorization/Policies/PolicyNames.cs"

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_query_config_api,node_query_plans,node_query_plan_model,node_query_plan_entity,node_acquisition_db,node_auth_selection,node_fhir_list_model,node_frequency,node_variable toneBlue
class node_template_api,node_template_seed,node_generation,node_generation_manifest,node_automation_ui_template,node_query_defaults toneAmber
class node_normalization,node_measure_eval,node_validation,node_reporting,node_submission toneMint
class node_admin_api,node_service_clients,node_query_dispatch_api,node_query_dispatch_client toneRose
class node_accounts,node_audit,node_service_registry,node_policy_names,node_operator,node_ehr toneIndigo
```

## Components

### Data acquisition

- [Query configuration API](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition/Controllers/QueryListController.cs): `DotNet/DataAcquisition/Controllers/QueryListController.cs`
- [Query plan management](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs): `DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs`
- [Query plan models](https://github.com/cdcgov/nhsnlink/tree/main/DotNet/DataAcquisition.Domain/Application/Models): `DotNet/DataAcquisition.Domain/Application/Models`
- [Query plan entity](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Infrastructure/Entities/QueryPlan.cs): `DotNet/DataAcquisition.Domain/Infrastructure/Entities/QueryPlan.cs`
- [Acquisition database](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Infrastructure/Context/DataAcquisitionDbContext.cs): `DotNet/DataAcquisition.Domain/Infrastructure/Context/DataAcquisitionDbContext.cs`
- [EHR authentication](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Services/AuthenticationRetrievalService.cs): `DotNet/DataAcquisition.Domain/Application/Services/AuthenticationRetrievalService.cs`
- [FHIR list configuration](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirListConfigurationModel.cs): `DotNet/DataAcquisition.Domain/Application/Models/Api/Configuration/FhirListConfigurationModel.cs`
- [Query frequency](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Shared/Application/Models/Frequency.cs): `DotNet/Shared/Application/Models/Frequency.cs`
- [Query variables](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/DataAcquisition.Domain/Infrastructure/Models/QueryConfig/Parameter/Variable.cs): `DotNet/DataAcquisition.Domain/Infrastructure/Models/QueryConfig/Parameter/Variable.cs`

### Automation

- [Template management API](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Controllers/QueryPlansController.cs): `DotNet/Automation.UI/Controllers/QueryPlansController.cs`
- [Template seeding](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs): `DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs`
- [FHIR generation](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/FhirGenerationPipeline.cs): `DotNet/Automation/Generation/FhirGenerationPipeline.cs`
- [Generation manifest](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/GenerationManifest.cs): `DotNet/Automation/Generation/GenerationManifest.cs`
- [Template model](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation.UI/Models/QueryPlanTemplate.cs): `DotNet/Automation.UI/Models/QueryPlanTemplate.cs`
- [Query plan defaults](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Automation/Generation/QueryPlanDefaults.cs): `DotNet/Automation/Generation/QueryPlanDefaults.cs`

### Processing services

- [FHIR normalization](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Normalization.Engine/Engine/NormalizationEngine.cs): `DotNet/Normalization.Engine/Engine/NormalizationEngine.cs`
- [Measure evaluation](https://github.com/cdcgov/nhsnlink/blob/main/Java/measureeval/src/main/java/com/lantanagroup/link/measureeval/services/BlobStorageService.java): `Java/measureeval/src/main/java/com/lantanagroup/link/measureeval/services/BlobStorageService.java`
- [Clinical validation](https://github.com/cdcgov/nhsnlink/blob/main/Java/validation/src/main/java/com/lantanagroup/link/validation/services/BlobStorageService.java): `Java/validation/src/main/java/com/lantanagroup/link/validation/services/BlobStorageService.java`
- [Report services](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Report/Services/BlobStorageService.cs): `DotNet/Report/Services/BlobStorageService.cs`
- [Submission services](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Submission/Application/Services/BlobStorageService.cs): `DotNet/Submission/Application/Services/BlobStorageService.cs`

### Administration

- [Admin API](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Admin.BFF/Program.cs): `DotNet/Admin.BFF/Program.cs`
- [Service clients](https://github.com/cdcgov/nhsnlink/tree/main/DotNet/Admin.BFF/Application/Clients): `DotNet/Admin.BFF/Application/Clients`
- [Query dispatch API](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/QueryDispatch/Presentation/Controllers/QueryDispatchController.cs): `DotNet/QueryDispatch/Presentation/Controllers/QueryDispatchController.cs`
- [Dispatch client](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/LinkSdk/Clients/QueryDispatchServiceClient.cs): `DotNet/LinkSdk/Clients/QueryDispatchServiceClient.cs`

### Platform services

- [Account management](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Account/Presentation/Endpoints/User/UserEndpoints.cs): `DotNet/Account/Presentation/Endpoints/User/UserEndpoints.cs`
- [Audit service](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Audit/Presentation/Controllers/AuditController.cs): `DotNet/Audit/Presentation/Controllers/AuditController.cs`
- [Service registry](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Shared/Application/Models/Configs/ServiceRegistry.cs): `DotNet/Shared/Application/Models/Configs/ServiceRegistry.cs`
- [Authorization policies](https://github.com/cdcgov/nhsnlink/blob/main/DotNet/Link.Authorization/Policies/PolicyNames.cs): `DotNet/Link.Authorization/Policies/PolicyNames.cs`

### Other components

- **Platform operator**
- **FHIR EHR**

## Connections

- Platform operator → Template management API: manages templates
- Template management API → Query plan defaults: loads defaults (evidence: `DotNet/Automation.UI/Controllers/QueryPlansController.cs`)
- Template seeding → Query plan defaults: loads defaults (evidence: `DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs`)
- Template seeding → Template model: creates templates (evidence: `DotNet/Automation.UI/Services/QueryPlanTemplateSeedService.cs`)
- Template management API → Template model: uses model (evidence: `DotNet/Automation.UI/Controllers/QueryPlansController.cs`)
- Query plan management → Query plan entity: persists entity (evidence: `DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs`)
- Query plan management → Query plan models: accepts input (evidence: `DotNet/DataAcquisition.Domain/Application/Managers/QueryPlanManager.cs`)
- Query plan entity → Acquisition database: stored in
- Query configuration API → FHIR list configuration: handles configuration (evidence: `DotNet/DataAcquisition/Controllers/QueryListController.cs`)
- FHIR EHR → Query configuration API: provides patient data
- EHR authentication → FHIR EHR: selects credentials
- FHIR generation → FHIR EHR: uploads bundles
- FHIR generation → Generation manifest: builds manifest (evidence: `DotNet/Automation/Generation/FhirGenerationPipeline.cs`)
- Dispatch client → Query dispatch API: calls HTTP API (evidence: `DotNet/LinkSdk/Clients/QueryDispatchServiceClient.cs`)
- Query dispatch API → Service clients: configures dispatch
- Platform operator → Admin API: uses administration
- Admin API → Service clients: routes service requests
- FHIR normalization → Measure evaluation: passes clinical data
- Measure evaluation → Clinical validation: passes evaluated data
- Clinical validation → Report services: enables reporting
- Report services → Submission services: supports submission
