nuts-knooppunt

Demo EHR Application

A demonstration Electronic Health Record (EHR) application for showcasing Dutch healthcare data exchange use cases, specifically focusing on BGZ (Basisgegevensset Zorg) exchange and eOverdracht (care handover) workflows.

Getting Started

Start the Demo EHR together with the Demo Dezi Client (handles Dezi login) using Docker Compose from the repository root:

docker compose --profile demoehr up

Then open http://localhost:8091 in your browser.

The Demo EHR requires a running Knooppunt instance (started separately via docker compose up). For authentication to work, the Demo Dezi Client also needs a valid CIBG Dezi client registration and configuration.

Overview

The Demo EHR app is a React-based web application that demonstrates how healthcare providers can exchange patient data using FHIR standards and the Nuts infrastructure. It implements two primary use cases:

  1. BGZ (Basisgegevensset Zorg) Exchange - Sharing comprehensive patient health summaries
  2. eOverdracht - Care handover between healthcare organizations

Key Capabilities

1. BGZ Exchange Use Case

The BGZ exchange workflow enables healthcare organizations to request and share comprehensive patient health summaries. The application supports:

BGZ Workflow Task Creation

BGZ Notification Task Creation

BGZ Data Generation

BGZ Visualization

2. eOverdracht Use Case

The eOverdracht workflow facilitates structured care handover between healthcare providers:

eOverdracht Task Creation

eOverdracht Task Management

Notification Workflow

3. Organization Localization and Routing

The application leverages two key infrastructure components for discovering and routing to healthcare organizations:

mCSD (Mobile Care Services Directory)

mCSD Endpoint Discovery

NVI (Notified Pull Index)

4. Patient Management

Data Sources

FHIR Servers

The application interacts with multiple FHIR endpoints:

  1. FHIR R4 Server (config.fhirBaseURL)
    • Primary patient data source
    • Patient demographics
    • Observations, conditions, procedures
    • Default: http://localhost:7050/fhir/sunflower-patients
  2. FHIR STU3 Server (config.fhirStu3BaseURL)
    • BGZ and eOverdracht task management
    • Legacy FHIR STU3 resources
    • Default: http://localhost:7060/fhir
  3. mCSD Query Directory (config.mcsdQueryBaseURL)
    • Organization directory
    • HealthcareService directory
    • Endpoint registry
    • Default: http://localhost:8080/fhir

NVI (Notified Pull Index)

The NVI service provides a decentralized index of patient documents:

Example Data

The application includes example FHIR resources for testing:

Architecture

Frontend

API Modules

The application is organized into API client modules:

Proxy Configuration

The app uses setupProxy.js to proxy requests:

Configuration

Application configuration is managed through environment variables. The application reads configuration from config.js, which consumes React environment variables.

Environment Variables

Variable Description Default
REACT_APP_AUTH_BASE_URL Base URL of demo-dezi-client http://localhost:8090
REACT_APP_FHIR_BASE_URL FHIR R4 base URL for patient data -
REACT_APP_FHIR_STU3_BASE_URL FHIR STU3 base URL for BGZ/eOverdracht tasks -
REACT_APP_FHIR_MCSD_QUERY_BASE_URL mCSD Query Directory FHIR endpoint -
REACT_APP_ORGANIZATION_URA Organization URA identifier (optional) -

Docker Compose Configuration

The demo-ehr service is available as a Docker Compose profile. Start with:

docker compose --profile demoehr up

Local Development Configuration

For local development without Docker, create a .env file in mock-components/demo-ehr/:

REACT_APP_AUTH_BASE_URL=http://localhost:8090
REACT_APP_FHIR_BASE_URL=http://localhost:7050/fhir/sunflower-patients
REACT_APP_FHIR_STU3_BASE_URL=http://localhost:7060/fhir
REACT_APP_FHIR_MCSD_QUERY_BASE_URL=http://localhost:8080/fhir
REACT_APP_ORGANIZATION_URA=

Authentication Configuration

Authentication is delegated to the demo-dezi-client service, which handles the complete OIDC flow with Dezi. Demo EHR is a simple client that:

  1. Redirects to /login for authentication
  2. Calls /userinfo to get user data
  3. Calls /logout to end the session

Configure the auth base URL in authConfig.js:

export const authConfig = {
  baseUrl: process.env.REACT_APP_AUTH_BASE_URL || 'http://localhost:8090',
};

Required Service: demo-dezi-client must be running on port 8090 (or configured URL)

Architecture:

[demo-ehr :3000] → [demo-dezi-client :8090] → [Dezi auth.dezi.nl]

User Data: Receives Dezi verklaring (healthcare worker declaration) with:

Knooppunt Configuration

The demo-ehr application requires specific configuration in the Knooppunt server (config/knooppunt.yml). The following sections detail the required configuration changes:

NVI Configuration

Enable NVI (Notified Pull Index) with the FHIR base URL:

nvi:
  baseurl: "http://localhost:7050/fhir/nvi"

mCSD Configuration

Configure mCSD directories for organization discovery and routing:

mcsd:
  # Root directories to synchronize from
  admin:
    "lrza":
      fhirbaseurl: "https://knooppunt-test.nuts-services.nl/lrza/mcsd"

  # Local FHIR directory configuration
  query:
    fhirbaseurl: "http://localhost:7050/fhir/knpt-mcsd-query"

Key Points:

mCSD Admin Configuration

Configure the admin interface FHIR endpoint:

mcsdadmin:
  # Base URL for FHIR server used by admin interface
  fhirbaseurl: "http://localhost:7050/fhir/knpt-mcsd-admin"

Complete Configuration Example

Here’s a complete example of the required sections in config/knooppunt.yml:

strictmode: false

nvi:
  baseurl: "http://localhost:7050/fhir/nvi"

mcsd:
  admin:
    "lrza":
      fhirbaseurl: "https://knooppunt-test.nuts-services.nl/lrza/mcsd"

  query:
    fhirbaseurl: "http://localhost:7050/fhir/knpt-mcsd-query"

  exclude_admin_directories:
    - "http://localhost:7050/fhir/knpt-mcsd-admin"

mcsdadmin:
  fhirbaseurl: "http://localhost:7050/fhir/knpt-mcsd-admin"

FHIR Profiles and Standards

BGZ (Basisgegevensset Zorg)

eOverdracht

Identifiers

Task Codes

Acknowledgments

This demonstration application was developed with significant assistance from Claude Code.