Integration

FHIR Capability Governance

Review and activate FHIR profiles, resource operations, search parameters, mappings, and validation requirements.

Purpose

The FHIR registry controls which profiles and operations are available. Importing a StructureDefinition creates a candidate capability. An authorized administrator or integration modeler must review and activate it before it can expose an API, accept Bundles or store clinical data.

Check the active configuration for your tenant and environment with GET /fhir/metadata. Integrators must use this FHIR CapabilityStatement as the authoritative list of active resource types, interactions, search parameters, and supported profiles.

Governed activation flow
Import SDProfile version
->
CandidateNot exposed
->
ReviewBinding, API, validation
->
Active/fhir/{ResourceType}
->
Suspend or retireFail closed

Standard endpoint rule

A profile retains its standard FHIR base-resource endpoint. A profile named UgandaLaboratoryObservation with StructureDefinition.type = Observation uses /fhir/Observation. It does not create a non-standard profile-named route.

Capability classes

ClassHandlerBehavior
NativenativeSpecialized AMCDR services for identity, encounters, directories, consent, medication, specimens, audit, and other platform-owned workflows. Visible in the registry but read-only in the profile activation editor.
Profile-drivencanonicalCreated from an imported StructureDefinition and activated through governance. Uses the generic validation, reference, persistence, mapping, search, and projection services.

Native handlers provide resource-specific behavior. New approved clinical base types can be activated without a software release. Infrastructure resources that require authoritative domain behavior must still receive a specialized handler; profile activation must not bypass MPI, encounter, consent, medication, or another authoritative workflow.

Lifecycle states

StatusRuntime behaviorUse
candidateNot resolved by generic endpoints.Import, modelling, mapping, testing, and review.
activeApproved operations are available and advertised.Approved production or non-production operation.
suspendedRemoved temporarily from profile-driven runtime resolution.Safety stop, investigation, or dependency outage.
retiredClosed for runtime use; governance and audit history remain.Withdrawn or superseded profile version.

If a base type also has a native handler, suspension of one profile does not remove the independently governed native behavior.

Capability contract

FieldControl
resource_typeFHIR base resource from StructureDefinition.type.
profile_uri, semantic_versionCanonical, versioned profile identity.
interactionscreate, read, update, and search-type.
search_parametersImplemented, explicitly approved query parameters.
allow_bundle_ingestAdmits the resource through Bundle processing.
allow_projectionPermits outbound projection through an approved mapping.
requires_template_bindingBlocks activation until an active FHIR-to-openEHR or bidirectional binding exists.
template_binding_readyRead-only binding readiness calculated by AMCDR.
governance_metadataApproval, owner, jurisdiction, IG, review, and change evidence.
activated_at, activated_byActivation evidence.

Available search parameters

_id, patient, subject, encounter, identifier, status, code, date

Native handlers can publish additional resource-specific searches. Uploading a custom FHIR SearchParameter does not automatically compile query behavior. It must receive an approved runtime implementation and test evidence before publication.

Authorization

Capability modification requires an authenticated user with an approved modelling or platform role: platform_admin, system_admin, super_admin, clinical_data_modeler, integration_modeler, or mapping_author. Tenant scope is still mandatory; a role in one tenant does not authorize another.

UI procedure

  1. Import the approved StructureDefinition.
  2. Use Semantic Studio to inspect extracted paths and create the approved openEHR template binding where clinical persistence is required.
  3. Open Platform configuration → FHIR governance.
  4. Select the candidate profile version.
  5. Approve only the required REST interactions and search parameters.
  6. Enable Bundle ingestion and projection only when their mappings and fixtures have passed review.
  7. Retain Require openEHR binding for canonical clinical data.
  8. Set the status to Active and save.
  9. Verify the published contract in GET /fhir/metadata before partner traffic is enabled.

API workflow

POST  /fhir/profiles/import-file
GET   /fhir/capabilities?include_native=false
PATCH /fhir/capabilities/{capability_id}
GET   /fhir/metadata

Activation example

PATCH /fhir/capabilities/2f6b6b62-4608-4b1a-b39e-28ea75a19f42
Authorization: Bearer <access-token>
Content-Type: application/json

{
  "status": "active",
  "interactions": ["create", "read", "search-type"],
  "search_parameters": [
    "_id", "patient", "subject", "encounter",
    "identifier", "status", "code", "date"
  ],
  "allow_bundle_ingest": true,
  "allow_projection": true,
  "requires_template_binding": true,
  "governance_metadata": {
    "approval_reference": "CAB-FHIR-2026-014",
    "jurisdiction": "national",
    "clinical_owner": "National Laboratory Programme",
    "implementation_guide": "example.fhir.lab#1.0.0",
    "review_due": "2027-07-01"
  }
}

Activation fails when the profile or FHIR version is invalid, an unsupported interaction or search is requested, search-type has no approved parameter, or a required template binding is absent.

Using the activated endpoint

POST /fhir/Observation?source_namespace=https://laboratory.example.org/fhir
Authorization: Bearer <partner-token>
Content-Type: application/fhir+json

{
  "resourceType": "Observation",
  "id": "lab-result-1001",
  "meta": {
    "profile": [
      "https://example.org/fhir/StructureDefinition/ug-lab-observation"
    ]
  },
  "status": "final",
  "code": {
    "coding": [{"system": "http://loinc.org", "code": "718-7"}]
  },
  "subject": {"reference": "Patient/national-patient-1001"},
  "effectiveDateTime": "2026-07-21T10:15:00Z",
  "valueQuantity": {
    "value": 12.7,
    "unit": "g/dL",
    "system": "http://unitsofmeasure.org",
    "code": "g/dL"
  }
}
GET /fhir/Observation?patient=national-patient-1001&code=http://loinc.org|718-7
GET /fhir/Observation/lab-result-1001?source_namespace=https://laboratory.example.org/fhir

Validation and openEHR persistence

Locally registered profiles declared in meta.profile must be active for governed creation. Active local profile definitions are supplied to the official HL7 FHIR Validator, allowing an approved unpublished canonical to be resolved. Pinned IG packages remain preferred because they include dependency profiles, extensions, terminology resources, and package metadata.

Version-safe validation

R4 remains the stable default façade. R5 and future releases are added alongside it through exact, pinned package sets in AMCDR_FHIR_VALIDATOR_VERSION_PACKAGES. The validation router uses an explicit fhirVersion, otherwise the release declared by the governed profile, otherwise the stable default. Conflicting or mixed-release declarations fail closed. The default release retains the established cache root for upgrade compatibility; additional releases use isolated version-named cache directories.

POST /fhir/$validate?fhirVersion=5.0.0
Content-Type: application/fhir+json; fhirVersion=5.0

Before enabling another release major, administrators must pin and mirror its core and IG packages, add the major to AMCDR_FHIR_RUNTIME_SUPPORTED_MAJOR_VERSIONS, populate the validator cache, approve mappings and openEHR bindings, run release-specific conformance and round-trip fixtures, and retain promotion evidence. Adding a release does not silently convert existing R4 resources or change the default API contract.

FHIR remains the exchange contract; openEHR remains the canonical clinical model. When a template binding is required, that approved binding determines how FHIR paths become versioned openEHR composition content.

Every sender and environment should use a distinct source_namespace. Persistent external identity is tenant + source namespace + resource type + external resource id, supporting cross-request references without allowing senders or tenants to claim each other's resources.

Bundle approval

Before enabling Bundle ingestion, test fullUrl, relative references, references to previously persisted resources, MPI Patient reconciliation, encounter resolution, source namespaces, retries, duplicates, unresolved-reference handling, and cross-tenant denial. The Bundle envelope uses the native handler; every contained resource is admitted through its native or active profile-driven capability.

Versioning and safe suspension

Import each new profile version as a new candidate. Test its bindings and fixtures, activate it under change control, then retire the prior version only after partner contracts and historical-read requirements are confirmed.

For an immediate safety stop, set the capability to suspended, disable Bundle/projection if appropriate, confirm that the profile is absent from active metadata, preserve incident evidence, and reactivate only under an approved recovery record.

Audit and approval records

Every profile-driven change creates an audit record with action fhir_resource_capability_updated. It includes the actor, capability, profile URI, prior contract, new contract, and governance metadata.

Keep a record of the profile and IG versions, clinical approval, mapping/template versions, terminology dependencies, validator results, Bundle/reference fixtures, round-trip projection evidence, security and tenant-denial results, and lifecycle audit records.

Operational checks

Troubleshooting

SymptomResolution
Imported profile is absent from metadataIt is a candidate by design. Review and activate it.
Binding-required activation errorPublish the active FHIR-to-openEHR or bidirectional binding, then retry.
Resource endpoint is unsupportedCheck active capability status and the required interaction.
Search parameter is rejectedUse an advertised parameter or implement and govern the missing query behavior.
Validator cannot resolve dependenciesInstall the pinned IG package or approved dependent profiles, extensions, and terminology resources.
Bundle resource is rejectedCheck capability state, Bundle permission, source namespace, MPI/encounter context, references, and validation results.

Related guidance