Skip to content

Profile detection

fhir-capability-analyzer detects conformance to known international and national FHIR profiles by matching profile URLs declared in the CapabilityStatement.

How it works

The analyzer collects profile URLs from three locations:

  1. CapabilityStatement.instantiates[] — CapabilityStatements this server conforms to
  2. CapabilityStatement.implementationGuide[] — IGs this server implements
  3. Per-resource profile and supportedProfile[] fields

Each collected URL is matched against the profile registry using prefix matching. A URL matches an entry if it starts with that entry's urlPattern.

Supported profiles

StandardCountryCanonical URL prefix
US Core🇺🇸 ushttp://hl7.org/fhir/us/core/
UK Core🇬🇧 ukhttps://fhir.hl7.org.uk/
UK Core (NHS)🇬🇧 ukhttps://fhir.nhs.uk/
AU Core🇦🇺 auhttp://hl7.org.au/fhir/core/
AU Base🇦🇺 auhttp://hl7.org.au/fhir/
CA Baseline🇨🇦 cahttp://hl7.org/fhir/ca/baseline/
IPS🌍 internationalhttp://hl7.org/fhir/uv/ips/
IPA🌍 internationalhttp://hl7.org/fhir/uv/ipa/
SMART App Launch🌍 internationalhttp://fhir-registry.smarthealthit.org/
SMART App Launch🌍 internationalhttp://hl7.org/fhir/smart-app-launch/
ISiK🇩🇪 dehttps://gematik.de/fhir/isik/
ISiK🇩🇪 dehttps://gematik.de/fhir/ISiK/

These are FHIR canonical identifiers. Some canonical URL hosts do not resolve in a browser, but the identifiers still need to be matched exactly when they appear in a CapabilityStatement.

Using the registry in library code

typescript
import { detectProfiles } from "fhir-capability-analyzer/registry";

const profiles = detectProfiles([
  "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient",
  "http://hl7.org/fhir/uv/ips/StructureDefinition/Patient-uv-ips",
]);

// [
//   { url: "...", name: "US Core", country: "us", standard: "US Core" },
//   { url: "...", name: "IPS", country: "international", standard: "IPS" },
// ]

Extending the registry

The profile registry (src/registry/profiles.ts) is a plain data array. Adding a new profile family = adding a new entry:

typescript
{
  urlPattern: "http://hl7.org/fhir/fr/core/",
  name: "FR Core",
  country: "fr",
  standard: "FR Core",
}

See CONTRIBUTING for how to open a PR to add a new profile family.

Limitations

Profile detection is URL-based — it matches URLs that the server declares, not validates. A server that declares a US Core profile URL is not guaranteed to fully conform to US Core. For full profile conformance validation, use the HL7 FHIR Validator.

Released under the MIT License.