No description
  • C# 99.9%
  • Dockerfile 0.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Frank Solli 227cda88b6
All checks were successful
Build and Deploy / build (push) Successful in 57s
Build and Deploy / scan (push) Successful in 15s
Build and Deploy / update-mani-viti-dev (push) Successful in 3s
ci: use TOKEN_FORGEJO secret, keep only dev auto-update
2026-07-15 09:31:22 +02:00
.forgejo/workflows ci: use TOKEN_FORGEJO secret, keep only dev auto-update 2026-07-15 09:31:22 +02:00
.idea/.idea.XcaDocumentSource/.idea documentation update 2026-06-01 14:15:01 +02:00
.vscode CDA generation uses documententry.uniqueID instead of documententry.id now 2026-04-07 14:22:29 +02:00
Docs Refactored RegistryMetadataTransformer into DI Service to allow use of terminology service 2026-07-02 12:00:14 +02:00
XcaXds.BusinessLogic Fixing null refernces 2026-07-06 08:31:54 +02:00
XcaXds.Commons Refactor and enhance monitoring and transformation 2026-07-09 13:57:03 +02:00
XcaXds.Shared Refactor and enhance monitoring and transformation 2026-07-09 13:57:03 +02:00
XcaXds.Source FOR DEV Test: Added support for PostgresSql with migration logic from SqLite 2026-07-06 19:03:44 +02:00
XcaXds.Terminology Fixing null refernces 2026-07-06 08:31:54 +02:00
XcaXds.Tests Refactor and enhance monitoring and transformation 2026-07-09 13:57:03 +02:00
XcaXds.WebService Refactor and enhance monitoring and transformation 2026-07-09 13:57:03 +02:00
.dockerignore application is now dockerized. more fhir stuff 2025-08-05 09:07:09 +02:00
.gitattributes Add .gitattributes and .gitignore. 2025-01-22 09:18:09 +01:00
.gitignore final commit 2026-03-31 13:33:36 +02:00
.gitlab-ci.yml update gitlab.ci 2026-07-06 19:06:17 +02:00
docker-compose.yml move offlinecodesystems to xcaxds.source 2026-06-18 00:43:38 +02:00
Dockerfile Refactor code system handling and obfuscation logic 2026-06-22 14:06:47 +02:00
global.json terminology service refactor and obfuscation refactor combined to make obfuscation code for N(normal) resolve to 9603 codesystem, not HL7... 2026-06-23 23:36:42 +02:00
LICENSE Create LICENSE 2026-06-16 15:32:42 +02:00
nuget.config small stuff 2025-11-29 10:57:57 +01:00
README.md Refactored RegistryMetadataTransformer into DI Service to allow use of terminology service 2026-07-02 12:00:14 +02:00
XcaDocumentSource.sln more terminology stuff. fixed namespaces to xcaxds.shared 2026-06-10 18:11:24 +02:00

XcaDocumentSource Open Source XCA Responding Gateway Framework

Preface: The vision of XcaDocumentSource

Important Note!
XcaDocumentSource is provided as an open-source reference for the implementer to extend or customize its interfaces to align with the requirements of their existing Electronic Patient Record (EPR) systems.
The solution is not a substitute for an EPR system nor a full EPR storage solution; it acts as a translating framework between SOAP messages from NHN's XCA and the implementers existing EPR-system.

Norsk helsenett (NHN) does not assume responsibility for the integrity, availability, or confidentiality of patient data handled through deployments based on XcaDocumentSource. Use of XcaDocumentSource is at the implementer's own risk, and any integration between XcaDocumentSource and live Electronic Patient Record (EPR) systems must be thoroughly tested and validated within the implementers own governance and compliance frameworks.

XcaDocumentSource allows healthcare providers to expose their internal, document storage solution as an XDS-compliant Registry and Repository interface.

Concerns covered by XcaDocumentSource

  • Profiles: Implements IHE XCA profile for cross-community access
  • Storage: Provides an XDS.b-compatible registry and repository layer backed by customizable storage adapters
  • National integration Supports integration with Norsk Helsenetts XCA Initiating Gateway
  • Access control Implements Policy Enforcement point, transforming SAML and JWT security attributes (Based on Norwegian standards) to Attribute-Based Access Control (ABAC), allowing for fine grained access control
  • Access control Implements programmable business-logic for partial or full obfuscation of patient data based on security attributes

XcaDocumentSource provides basic document registry and repository. However, the recommended option is for implementers to connect their own storage infrastructure to XcaDocumentSource - whether proprietary, legacy, or standards-based - by implementing custom translation logic between document storage metadata and the simpler, internal data-structures of XcaDocumentSource.

%%{init: {'theme':'dark'}}%%
flowchart

nhnxca[NHN XCA Initiating Gateway]
subgraph "Actor"
  xcads[XcaDocumentSource<br>XCA Responding Gateway]
  epr[Electronic Patient Records]
end

nhnxca--"ITI-38/-ITI39"-->xcads--"Custom Adapter Interface (Written by the implementer)"-->epr
 [External XCA Initiating Gateway]
             ↓ ITI-38/39
  [XcaDocumentSource Translation Layer, simple data structures]
             ↓ Custom Adapter Interface (Written by the implementer)
     [Existing Document Storage Backend]

It aims to accelerate prototyping and integration with NHN, without requiring full knowledge of IHE profiles and ebXML RegRep specifications up-front; the solution handles the complexities of SOAP and XML, essentially "doing the plumbing work". This allows the end user to focus on their domain-specific implementations needs, like shaping business logic and handling access control.

Architecturally, XcaDocumentSource acts as a translation gateway that sits between an external XCA Initiating Gateway (e.g., NHN) and an organizations internal EPR system, mapping IHE protocols to local API formats.

Introduction/Getting started

In the healthcare industry, hospitals, clinics, and municipalities use a variety of Electronic Health Record (EHR) systems, often from different vendors. These systems were rarely designed to communicate with each other, leading to:

  • Data silos where patient records are confined in local systems
  • Manual, error-prone processes for sharing health information
  • Delayed treatment due to lack of access to complete medical histories

This lack of interoperability results in documents having to be shared via manual routines, such as fax-machines, sent as letters via taxi or calling the hospitals a patient has previously visited. This results in fragmented care, increased administrative burden, and risk to patient safety.

XcaDocumentSource is a component which acts as a middleware-system between healthcare provider system and Norsk helsenett's XCA-gateway infrastructure. This will allow actors such as hospitals and municipalities to share patient health records across organizational and technical boundaries by handling the SOAP-implementation, and allowing the implementer to easily modify the solution to for integrating between XcaDocumentSource and their own systems.
The implementation is based around the IHE integration profiles based on XDS and XCA provided in Volumes 1 through 3 of the IHE IT Infrastructure Technical Framework - profiles.ihe.net ↗ in a national context, aswell as HL7:

  • XDS.b (Cross-Enterprise Document Sharing) for registering and retrieving clinical documents
  • XCA (Cross-Community Access) Responding Gateway for querying and retrieving documents from NHN's XCA
  • HL7 (Health Level 7) version 2 - for some queries related to patient identity
  • PEP (Policy Enforcement Point) - for access control (ABAC-implementation)

Technical overview

%%{init: {'theme':'dark'}}%%

flowchart LR
subgraph "Norsk Helsenett"
  nhnxca[NHN XCA<br>Initiating Gateway]
end

subgraph "Actor systems"
  subgraph "XcaDocumentSource"
    resgw[XCA<br>Responding Gateway]

    pep[<br><br>PEP<br><br><br>]

    doclist([Get Document list])
    document([Get Document])
  end

  subgraph "Document storage solution"
    docstore[(Document<br>store)]
  end
end

nhnxca <--SOAP-Request--> pep


pep <--> resgw
resgw <--> doclist

resgw <--> document

doclist <--> docstore
document <--> docstore

Solution architecture overview

Solution Documentation

⚠️ Note!
The Dockerfile supports overriding the upstream container registry via UPSTREAM_REGISTRY (default: mcr.microsoft.com). In GitLab CI this is set through build args so base images are pulled via CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX.

🌐 Document Sharing overiew - Actors and Components

Describes the high-level principles of document sharing, and the components involved in the process.

📝 Use case scenarios - XcaDocumentSource

Scenarios of XcaDocumentSource in a source system.

⚙️ Solution Overview/Technical implementation details

How XcaDocumentSource solution is structured, and how it can be implemented in a source system, taking in account existing document registries/repositories, and PAP/PDP/PR systems.

📜 Custom Registry Format

Describes the custom Registry format which is used to store document entries.

🧾 (ebRIM) Metadata, XDS and SOAP-message formats and standards

Covering the SOAP-message format and the XDS profile and transactions involved in uploading, downloading and sharing documents and document metadata.

Interacting With the Document Registry/Repository

📨 SOAP-endpoints/ITI-messages (SOAP-transactions) and Multipart

Overviews the ITI-messages supported by XcaDocumentSource and their endpoints, as well as examples. Also describes MTOM/multipart request handling in XcaDocumentSource

👩‍💻 REST-endpoints (CRUD-transactions)

Describes the REST-endpoints of the solution, allowing for quick and easy CRUD-operations on the Document Registry and Repository.

🔥 FHIR/MHD-endpoints

Describes the RESTful FHIR and MHD-endpoints (Mobile access to Health Documents) of the solution, accesing the registry and repository in a standards-based format (XDS on FHIR).

Governing the solution

💠 OIDs (Object Identifiers)

OIDs are important in identifying the different components in the systems involved in the document sharing exchange. Effective governing and managing of OIDs are crucial in efficiently identifying systems.

🏛 Authorization and Access Control

Describes the methods and interfaces for access control.

Other Functionality

📄 CDA To Registry Metadata

Describes the functionality for converting a CDA document to an ITI-41 message/Registry Metadata and vice-versa.

Coding Conventions

The following coding conventions are used in XcaDocumentSource. They are not enforced onto the implementer, but described here for informational purposes:

  • Functions are used extensively to break up code and separate concerns. Functions should rarely be more than 100 lines.
    • Functions should have a single purpose (SRP)
  • Service-classes encapsulate functionality related to a single "purpose" or function (interact with registry/repository, transform objects from X to Y format etc.)
  • Naming:
    • PascalCase for classes, methods, and public properties.
    • camelCase for local variables and private fields.
  • File structure: One class per file.
  • Indentation: 4 spaces (no tabs).
  • Uses async/await over Task.ContinueWith, no .Result or .Wait().
  • Avoid abbreviations in names (e.g., userProfile, not usrProf, can be abbreviated for long variable names).

Separation of concerns

The code is divided into clear layers (API/controller, Service, Wrapper, Domain(classes))

/Controllers
  - RegistryController.cs
/Services
  - RegistryService.cs
/Repositories
  - RegistryWrapper.cs

Semantics Used

This section defines how different elements are formatted and referenced within the documentation.

External links are suffixed by an arrow pointing up to the right (↗), signifying that the link leads to a website not affiliated or related to Norsk helsenett. Links will follow this format: <title> - <domain> ↗ Example:
External link - example.com ↗

XML-tags

Used when referencing something thats part of an XML SOAP-message
Example:
<xml-tag>

Normal Quotes

Used as an addendum for a section of text
Example:

Quote

Alert Quote

When there's something that should be paid extra attention to, or is important to know
Example:

⚠️ Alert x
Example text

Implementation Quotes

Used to describe an implementation which is notable or specific to XcaDocumentSource
Example:

🔶 Implementation Note x
Example text

National Extension Quote

Used to describe something specific to the Norwegian implementation of IHE XDS/XCA
Example:

🚩 National Extension x
Example text

Question/Answer

Questions that the reader might ask themselves. Usually in a lighthearted tone.
Example:

⁉️ Why is the S in SOAP a lie?
The answer might shock you!