Clinical Diagnostic Assistant#

Overview#

Clinical Diagnostic Assistant Blueprint UI

Clinical notes contain critical diagnostic information that, when processed intelligently, can generate structured differential diagnoses to support clinical decision-making.

Clinical Diagnostic Assistant was previously published as MedWorkUp (chart aimsb-medworkup).

This blueprint presents a 14-step NLP pipeline that processes raw clinical notes written in SOAP format — Subjective, Objective, Assessment, Plan, the standard structure clinicians use to record a patient encounter — through:

  1. Preprocessing — SOAP section detection, negation handling, abbreviation expansion

  2. Named Entity Recognition — Parallel GLiNER biomedical NER and, in the knowledge-graph profile, MedCAT concept linking

  3. Entity Aggregation — Span merging, deduplication, and normalization

  4. Semantic Embeddings — SapBERT cosine-similarity clustering of clinical entities

  5. Categorization — LLM-based classification of entities into symptoms / diseases / findings

  6. Graph Context — 2-hop Neo4j lookup on extracted entities, surfacing candidate diseases as hints for the LLM (knowledge-graph profile only)

  7. Candidate Generation — Differential diagnosis candidate list via LLM reasoning

  8. Evidence Reasoning — Constrained chain-of-thought reasoning grounded in extracted evidence

  9. Ranking — Score-based sorting

  10. Consistency Check — Cross-verification and diagnosis adjustment via LLM

  11. Diagnosis Filter — Confidence-floor filtering

  12. Diagnosis Coding — Attaches a standard UMLS/SNOMED concept identifier (CUI) to each final diagnosis, so results can be matched against other clinical systems rather than remaining free text (knowledge-graph profile only)

  13. Diagnosis Subgraph — Trimmed Neo4j subgraph showing each diagnosis’s SNOMED relationship to the note’s evidence (knowledge-graph profile only)

  14. Diagnosis Grounding — Boost-only confidence adjustment for diagnoses with genuine graph support (never a penalty for diagnoses outside the curated graph’s scope)

AMD Solution Blueprints are packaged as helm charts for deployment on a Kubernetes cluster. For development or further exploration, the source code is public and available in the Solution Blueprints GitHub repository.

Architecture#

The diagram below shows the full system topology:

Clinical Diagnostic Assistant architecture: a UI routes requests through an intake gate to an orchestrator that drives a 14-step pipeline across NER, embedding, MedCAT, Neo4j, and MedGemma services. Clinical Diagnostic Assistant architecture: a UI routes requests through an intake gate to an orchestrator that drives a 14-step pipeline across NER, embedding, MedCAT, Neo4j, and MedGemma services.

The Clinical Diagnostic Assistant is composed of six services, plus a knowledge-graph foundation used by pipeline steps 6 and 13 above:

Service

Port

Description

UI

8080

nginx reverse proxy + React SPA. Primary user entry point.

Orchestrator

8003

FastAPI service that drives the 14-step NLP pipeline (plus a preliminary intake gate) and exposes POST /Composition/$analyze-note, GET /concepts/{cui}, /health, /sys/health, and /pipeline endpoints.

NER Service

8001

GLiNER biomedical named entity recognition. Supports ONNX mode (fast, offline) and HuggingFace mode (auto-download).

Embedding Service

8002

SapBERT biomedical embeddings for entity similarity clustering. Supports ONNX and HuggingFace modes.

MedCAT Service

8004

CogStack MedCAT NER+L REST API for UMLS/SNOMED concept linking (knowledge-graph profile only). Uses pre-built cogstacksystems/medcat-service image.

MedGemma

8000

MedGemma 27B multimodal LLM served via AMD AIM. Requires AMD GPU with ROCm.

Knowledge-graph foundation:#

For more information see Deployment.

Service

Port

Description

Neo4j

7474 (HTTP), 7687 (Bolt)

Graph database holding a curated UMLS/SNOMED knowledge graph (knowledge-graph profile only).

Evaluation harness:#

Optional, off by default — see Deployment for more information.

Service

Port

Description

evaluator

8020

Runs the pipeline against a labeled benchmark, scores results, reports through Langfuse

eval-nginx

80 (8021 on the host with docker compose)

Fronts the evaluator so Langfuse’s webhook can reach it

Langfuse (web/worker + Postgres/ClickHouse/Valkey)

3000

Self-hosted tracing, datasets, and eval-run triggers. Needs an existing S3-compatible object store, which is not bundled

See Evaluation for why this harness exists, the labeled benchmark dataset, and how each metric is computed.

Key Features#

  • Full control over your data and privacy — clinical notes are processed entirely within your own infrastructure, with no external API calls at inference time. Deployment itself downloads models and terminology data once: MedGemma and the NER/embedding models from HuggingFace, and (knowledge-graph profile only) the MedCAT model from KCL and the SNOMED CT release from NLM. The optional evaluation harness additionally needs an S3-compatible object store you provide

  • Structured, evidence-grounded differential diagnoses produced from free-text SOAP notes, optionally reinforced by a curated SNOMED CT knowledge graph

  • Combines specialized biomedical models (GLiNER, SapBERT, and in the knowledge-graph profile MedCAT) with MedGemma 27B reasoning

  • Transparent and inspectable — every pipeline stage and its evidence can be logged, debugged, and audited; optionally traced end-to-end via a self-hosted Langfuse evaluation harness

  • Offline-capable model loading via ONNX mode for air-gapped or regulated environments

  • Suitable for regulated healthcare settings where cloud clinical NLP services are restricted or disallowed

Getting Started#

This is a quick start guide on how to deploy the blueprint. For advanced options — creating the required credential secrets, reusing storage, enabling gateway access, or deploying the optional Langfuse evaluation harness — see the advanced deployment guide.

Prerequisites#

System Requirements#

This blueprint can be deployed on AMD Instinct. By default it deploys the standard profile, without MedCAT or the knowledge graph. The knowledge-graph profile (deploymentProfile: knowledge-graph) and the evaluation harness (evaluator.enabled: true) are optional. The blueprint requires the following cluster resources, depending on what you enable:

Resource

Standard profile (default)

Knowledge-graph profile (optional)

Knowledge-graph profile + evaluation harness (optional)

GPUs

1 (AMD Instinct, for MedGemma)

1 (AMD Instinct, for MedGemma)

1 (AMD Instinct, for MedGemma)

CPUs

27 CPU cores

39 CPU cores

46 CPU cores

RAM

210 Gi

254 Gi

263 Gi

The standard profile is the quickest to deploy and demo: it needs only a HuggingFace token, and it produces the same differential diagnoses, evidence and FHIR output as the knowledge-graph profile. The knowledge-graph profile adds MedCAT concept linking, which attaches UMLS/SNOMED codes to entities and diagnoses, and the SNOMED CT knowledge graph built on those codes, which adds graph hints to candidate generation, supporting-subgraph panels and a graph-grounding confidence boost. It needs a UMLS licence and two more secrets. See Knowledge-graph profile (optional) for details.

To deploy to the Kubernetes cluster, ensure the following prerequisites are met:

  • kubectl: Installed and configured to communicate with the cluster

  • Helm 3.16 – 4.2.0: Installed on your local machine

  • The AMD GPU device plugin installed on the cluster, so the node advertises amd.com/gpu capacity — see ROCm k8s-device-plugin

  • Storage: the default deployment creates two 20 Gi PVCs (NER and embedding model caches) on the cluster’s default StorageClass, and MedGemma uses an 80 Gi ephemeral volume on the mlstorage StorageClass. If your cluster has no mlstorage class, set medgemma.storage.ephemeral.storageClassName — see Storage

  • Before deploying, accept the MedGemma license with your HuggingFace account, create an access token from that same account, and create the hf-token Kubernetes Secret (see the credentials guide for details):

    namespace="my-namespace"
    kubectl create namespace $namespace
    kubectl create secret generic hf-token --from-literal=hf-token=<YOUR_HUGGINGFACE_TOKEN> -n $namespace
    
  • Knowledge-graph profile (optional): also obtain a UMLS API key from NLM (used for both the MedCAT model download and knowledge-graph population), choose a Neo4j password, and create the medcat-credentials and neo4j-auth Secrets as described in Knowledge-graph profile (optional)

Deployment#

Solution Blueprints are packaged as OCI-compliant Helm charts in the Docker Hub registry and can be deployed to a Kubernetes cluster with a single command. After creating the required credential secrets, define the name (deployment name) and the namespace (Kubernetes namespace), then pipe the output of helm template to kubectl apply -f -:

name="my-deployment"
namespace="my-namespace"
helm template $name oci://registry-1.docker.io/amdenterpriseai/aimsb-clinical-diagnostic-assistant \
  --namespace $namespace \
  | kubectl apply -f - -n $namespace

To deploy the knowledge-graph profile instead, create its extra secrets first and add --set deploymentProfile=knowledge-graph to the helm template command.

Verify Deployment#

To check the status of the deployment, run:

kubectl get pods -n $namespace

Wait until all pods report Running and Ready. On first run, the MedGemma model is downloaded automatically and may take some time to become ready. In the knowledge-graph profile, the MedCAT model is also downloaded, and the knowledge graph is populated automatically by a one-shot Job.

Connect to UI#

To connect to the UI, port-forward to port 8080. The UI will then be available at http://localhost:8080 in your browser.

kubectl port-forward services/aimsb-cda-$name-ui 8080:8080 -n $namespace

Clean Up#

When you are finished, remove the deployed resources using the same deployment command, with kubectl delete instead of kubectl apply:

helm template $name oci://registry-1.docker.io/amdenterpriseai/aimsb-clinical-diagnostic-assistant \
  --namespace $namespace \
  | kubectl delete -f - -n $namespace

Pipeline API#

The orchestrator exposes a FHIR-compliant JSON API. FHIR is the healthcare industry’s standard format for exchanging clinical data, so the pipeline’s output can be consumed directly by electronic health record systems and other clinical tooling instead of requiring a custom integration. See FHIR API Reference for the full annotated shape.

Breaking change in 0.2.0: POST /analyze (body {"text": "..."}, custom JSON response), the endpoint in 0.1.x, has been removed and replaced by POST /Composition/$analyze-note below, which takes a FHIR Parameters resource and returns a FHIR Bundle. Clients calling /analyze directly must move to the new request and response shapes; the bundled UI already uses it.

Request#

POST /Composition/$analyze-note
Content-Type: application/json

{
  "resourceType": "Parameters",
  "parameter": [
    {"name": "note", "valueString": "Patient presents with fever, productive cough, and shortness of breath. SpO2 94%. CXR shows consolidation."}
  ]
}

Response#

A FHIR Bundle (type: "document") containing a Composition, a DiagnosticReport, Observation/Condition/Procedure resources for extracted entities, Condition/ RiskAssessment resources for diagnoses, a Provenance, and (when the request did NOT supply a patient reference) a synthesized empty Patient. Diagnoses, raw entity mentions, and their knowledge-graph support all ride as custom FHIR extensions rather than inventing non-standard top-level fields — see FHIR API Reference for a fully annotated example.

A rejected note (the intake sufficiency gate) returns an OperationOutcome instead of a Bundle, still as HTTP 200.

Concept Lookup#

GET /concepts/{cui}

Looks up the human-readable name and synonyms for one of the UMLS/SNOMED concept identifiers the pipeline returns, so a coded result can be displayed as clinical text. Returns {"cui", "preferred_name", "synonyms", "cui_url"}; the UI uses it to label concepts on screen.

Health Endpoints#

Endpoint

Description

GET /health

Fast liveness probe (no downstream calls)

GET /sys/health

Full system health — probes all downstream services concurrently

GET /pipeline

Describe pipeline stages and their service dependencies

GET /docs

Interactive Swagger UI

Model Loading Modes#

The NER and Embedding services support two model loading modes:

HuggingFace Mode (default)#

Models are downloaded from HuggingFace Hub on first startup and cached in a persistent volume. Requires HUGGING_FACE_HUB_TOKEN.

ONNX Mode#

Pre-downloaded model artifacts are mounted from a local directory. No network access required at runtime. Faster startup.

Configure via NER_ONNX_PATH and EMBEDDING_ONNX_PATH environment variables (see values.yaml or .env.example).

Third-Party Components#

This Solution Blueprint utilizes multiple components. For third-party license information, refer to each component’s documentation. Key third-party components can be seen below:

Component

License

MedGemma

Health AI Developer Foundations Terms of Use

MedCAT

Elastic License 2.0

GLiNER-BioMed

Apache 2.0

SapBERT

Apache 2.0

FastAPI

MIT

React

MIT

nginx (UI and eval-nginx)

BSD-2-Clause

Neo4j

GPL v3 (Community Edition)

Langfuse

MIT

fhir.resources / fhir-core

BSD-3-Clause

d3-force

ISC

react-force-graph-2d

MIT

react-rnd

MIT

scispaCy en_core_sci_sm

CC BY-SA 3.0

PostgreSQL (Langfuse database)

PostgreSQL License

ClickHouse (Langfuse analytics store)

Apache 2.0

Valkey (Langfuse cache/queue)

BSD-3-Clause

Unit tests#

The suites in tests/ render this chart’s templates and assert on the resulting manifests. Nothing is deployed and no cluster is needed. They run with the helm-unittest plugin:

helm plugin install https://github.com/helm-unittest/helm-unittest   # once

From a clone of this repository, vendor the subcharts first, since charts/ is gitignored and the suites assert on subchart templates:

helm dependency build
helm unittest .

The suites also ship inside the published chart, so you can run them against a release you have pulled. The subcharts are already vendored in the package, so there is no dependency build step here:

helm pull oci://registry-1.docker.io/amdenterpriseai/aimsb-clinical-diagnostic-assistant --untar
helm unittest ./aimsb-clinical-diagnostic-assistant

That is worth doing if you change values.yaml or a template for your own deployment: the suites pin the service names and derived URLs the components use to reach each other, so they will tell you if an override has broken one of those contracts.

Terms of Use#

AMD Solution Blueprints are released under the MIT License, which governs the parts of the software and materials created by AMD. Third-party software and materials used within the Solution Blueprint are governed by their respective licenses.