Operations

Configuration Reference

Look up runtime settings for deployment, modules, policies, templates, workflows, reporting, and infrastructure.

For the new intelligence sandbox controls, model-profile configuration and administrator setup, see Agent Studio setup. The intelligence sandbox is disabled by default.

AMCDR loads bundled YAML defaults, optional deployment YAML, environment variables and administrator module settings. When AMCDR_DEPLOYMENT_MODE=FULL is set, the CDR modules stay enabled and stored module toggles cannot disable it. AI/CDSS remains separately governed by super-admin controls.

AmyTerm companion configuration

The full-EHR profile should register AmyTerm with the stable key amyterm-main. Configure its routable terminology API URL, verified TLS certificate, OAuth2 client-credentials token endpoint and secret through deployment secrets or Platform Configuration. Never reuse the example private IP or disable TLS verification in production.

AMCDR's terminology gateway and browser cache keep reference selection fast. Facility Registry stores the selected composition language, territory, encoding, financial currency and routine payment method. Those defaults are injected into registration, clinical and finance forms; they are not retyped or copied into AmyTerm.

Platform setup: Policy & Access

Configure this from Super-admin -> Platform configuration -> Policy & access. Set up the tenant, organisation, environment, users, memberships and roles first. Then use policies to refine access while keeping RBAC in place.

  1. Create or confirm the tenant, organisation, and environment.
  2. Create users and memberships in the correct scope.
  3. Assign the smallest required role keys first.
  4. Add access policies only where the route matrix is too broad or too narrow.
  5. Add sharing policies for cross-organisation, partner, reporting, or jurisdictional data movement.
  6. Add professional duty policies for purpose-of-use, care-team, profession, service-line, or programme controls.
  7. Add jurisdiction policy packs for country, regional, humanitarian, cross-border, or national-programme rules.
  8. Add protected-record clearances separately for VIP, sealed, witness-protected, national-security, restricted-minor, or unknown protected-person records.
  9. Test with a non-admin user and confirm audit events for denied and granted access.
Setup itemPurposeExample
Access policyExecutable allow/deny control over route family, method, path prefix, role, scope, and purpose.Deny broad patient browsing for temporary staff.
Sharing policyControls data movement between organisations, facilities, partners, reporting services, or jurisdictions.Allow aggregate HMIS output while blocking identifiable exports.
Professional duty policyConnects access to duty of care, practitioner role, service line, care-team relation, or purpose of use.Allow maternity clinicians to access birth workflows for assigned patients.
Jurisdiction policy packBundles country, regional, humanitarian, cross-border, or national-programme rules.National birth/death reporting or refugee programme controls.
Protected-record clearanceGrants classification-specific access in addition to standard role keys.VIP_ACCESS, SEALED_RECORD_ACCESS, BREAK_GLASS_ACCESS.

High-risk route families such as API docs, authentication administration, metrics, platform administration, protected-record administration, and system health must remain non-overridable. See RBAC and Access Control for the full role, policy, AQL, data-browser, export, and audit model.

Patient portal clinical release policy

Configure this from Super-admin -> Platform configuration -> Patient portal release. The selected policy is enforced by the release-control API, not only hidden or shown by the UI.

Authorization modeWho may change patient visibility
Authenticated staffAny active non-patient staff identity.
Clinical rolesStaff holding one of the configured role keys.
Named cliniciansOnly explicitly selected clinician user accounts.
Patient care teamStaff linked through the patient's appointment, active encounter, assigned workflow task, or openEHR EHR_ACCESS care-team settings.
Release managerStaff holding one of the configured release-manager role keys.

A super-admin override can be enabled or disabled independently. Scheduled release may also be enabled: scheduled_release with a future release_at remains hidden until that time. A default delay can schedule new non-sensitive records automatically, while sensitive records remain withheld pending an explicit decision.

GET /admin/patient-release-policy
PUT /admin/patient-release-policy
GET /patient-portal/patients/{patient_id}/release-controls
POST /patient-portal/patients/{patient_id}/release-controls

Explicit patient care teams

The patient_care_team and patient_care_team_member registry stores governed patient-to-team assignments. Members can be linked by AMCDR membership, practitioner, or user reference, with role, status, and validity dates. Active explicit membership is evaluated before appointment, encounter, task, and openEHR EHR_ACCESS fallbacks.

From the administration screen, you can find a patient, create or edit a team, change its status, find staff memberships, assign roles with validity dates and end membership while preserving its history. The same actions are available through the care-team API.

Super-admins can use Seed sample care teams in a non-production environment. It links existing active patients to existing active clinical memberships, creates no patients or users, and records lifecycle audit events. Repeating the action does not create duplicate assignments. Do not use it in clinical production.

AMCDR creates an Active care team when a patient has an explicit clinical relationship. This can come from an active workflow task assigned to a member with a clinical role, a non-cancelled appointment with an assigned practitioner, or a clinician membership or practitioner recorded as a typed participant in an active encounter.

Each generated membership records the relationships that created it and ends when the last qualifying relationship closes. Searching for or viewing a patient never creates membership. MPI stewards, administrators and other non-clinical staff are not added solely because they performed administrative work.

Administrators must be able to make the same governed configuration changes through the product UI as through the API.

GET /patient-care-teams
POST /patient-care-teams
PATCH /patient-care-teams/{care_team_id}
POST /patient-care-teams/{care_team_id}/members
DELETE /patient-care-teams/{care_team_id}/members/{member_id}
POST /admin/patient-release-policy/care-teams/seed-samples

Platform setup: Operations

Use Super-admin -> Platform configuration -> Operations to assign service owners, track onboarding and record approvals for sensitive duties. Keep these records separate from patient worklists and clinical encounters.

RecordPurposeExample
Service managementService owner, SLA tier, operational status, incident status, and runbook.CDR runtime, FHIR gateway, terminology service, reporting transport.
Onboarding checklistGo-live checklist for an organisation, facility, integration, programme, or module rollout.New hospital onboarding, partner FHIR onboarding, national reporting rollout.
Capability attestationApproval that a role or membership is authorized to perform a sensitive capability.Saved-query authoring, integration administration, protected-record review.

Operational setup order: create service records, assign owners, set SLA tiers, keep incident status current, add onboarding checklists before go-live, then attest sensitive roles or memberships. The dashboard highlights open incidents, degraded services, overdue onboarding, pending attestations, owned controls, and unassigned owners.

Standard configuration model

AMCDR configures runtime capabilities, solution packages, clinical services, staff placement, patient relationships and permissions separately. Bindings connect these records without giving them the same purpose or authority.

ConceptPurposeExamples
Runtime capabilityTechnical feature available in a deployment.Composition repository, SMART platform, form runtime.
Solution packageGoverned collection of templates, forms, workflows, connectors, or analytics assets.Maternal workflow or national connector package.
Health areaBroad tenant-extensible analytical classification.Acute and critical care, women and children, diagnostics.
Clinical serviceType of care delivered by a provider.Primary care, emergency medicine, maternity, pharmacy.
Facility service offeringA service actually available at a facility and exposed as FHIR HealthcareService.Emergency medicine at Hospital A.
Workforce assignment and care teamOrganisational placement and patient-specific responsibility.Clinician assigned to a unit; treating team for a patient.
Access profile and policyAuthenticated authority and policy constraints.Clinician, MPI steward, release manager.

Configure health areas and clinical service types under Clinical configuration -> Classification catalogues. Hospitals may add local values and relate a service to its parent health area with metadata_json.health_area_code. Keycloak /access-profiles/... groups assign authority; clinical services are intentionally not Keycloak authority groups.

Register services actually delivered by a provider under Clinical configuration -> Clinical services. Each offering is facility-scoped and may bind specialties, locations, appointment/referral rules, templates, workflows, and contextual access profiles. AMCDR still evaluates access policies for every contextual assignment.

GET  /clinical-services
POST /clinical-services
GET  /clinical-services/{service_id}
PATCH /clinical-services/{service_id}

GET /fhir/HealthcareService
GET /fhir/HealthcareService/{service_id}

Platform setup: Solution packages

Use Super-admin -> Platform configuration to publish governed solution packages. A solution package is not a clinical department and is not the same as a runtime capability.

RecordPurposeExample
Solution packageGoverned collection of deployable assets.Maternal workflow, portable forms, terminology, reporting.
Package activationControls where an approved package is active.Activate maternal-health for a pilot facility.
Feature flagControls independently governed behaviour.Show a beta workflow only for one programme environment.

Publish solution packages before binding templates or forms to them. Package activation determines where approved assets are active; the runtime capability registry separately determines which technical services are available.

Platform setup: Runtime

Use Super-admin -> Platform configuration -> Runtime for feature flags, package activations, and runtime visibility controls. Runtime settings make approved packages effective for a scope or deployment node.

RecordPurposeExample
Feature flagEnable or disable runtime behaviour globally or for one solution package.Enable birth workflow UI or hide a beta integration.
Solution package activationActivate an approved package for a scope or node.Activate maternal-health for /moh/sandbox1 or node-01.
AI visibility switchShow or hide the patient-context AI assistant UI.Hide AI during demos or deployments where AI/CDSS has not been approved.

Runtime setup order: confirm the package is published, activate the package, add feature flags only for independently toggleable behavior, verify with POST /governance/effective-features, and test with a non-admin user.

Medication Tracker and Clinical Safety

AMCDR must not act as the medication product master in standard deployments. The platform compose stack starts MediServe from ./mediserve as a separate medication service, then AMCDR references its product identifiers from clinical medication records.

AMCDR_MEDICATION_TRACKER_ENABLED=true
AMCDR_MEDICATION_TRACKER_BASE_URL_CONTAINER=http://mediserve-nginx
AMCDR_MEDICATION_TRACKER_PUBLIC_URL=http://localhost:8088
AMCDR_MEDICATION_TRACKER_PRODUCT_CATALOG_MODE=external
AMCDR_MEDICATION_TRACKER_ALLOW_LOCAL_PRODUCT_CATALOG_WRITES=false
AMCDR_MEDICATION_TRACKER_SEND_PRESCRIPTIONS=true
AMCDR_MEDICATION_TRACKER_DECREMENT_ON_DISPENSE=true
AMCDR_MEDICATION_TRACKER_DECREMENT_ON_ADMINISTRATION=true

AMCDR_CLINICAL_SAFETY_ENABLED=true
AMCDR_CLINICAL_SAFETY_BASE_URL=http://clinical-safety-sidecar:8085
AMCDR_CLINICAL_SAFETY_API_KEY=change-me
AMCDR_CLINICAL_SAFETY_FAIL_MODE=warn

MEDISERVE_PORT=8088
CLINICAL_SAFETY_API_KEY=change-me
CLINICAL_SAFETY_DATABASE_URL=postgresql+psycopg://amcdr:change-me@postgres:5432/amcdr
CLINICAL_SAFETY_RULES_PATH=/workspace/runtime/clinical-safety/rules.json
CLINICAL_SAFETY_SEED_DEFAULT_RULES=true
SettingMeaning
product_catalog_mode=externalAMCDR medication product source and formulary list APIs return no local master rows.
allow_local_product_catalog_writes=falseAMCDR rejects local product-source/formulary writes with EXTERNAL_MEDICATION_PRODUCT_SOURCE.
send_prescriptions=trueAMCDR mirrors medication orders to Medication Tracker when configured.
decrement_on_dispense=trueAMCDR posts completed dispense events to the stock ledger.
decrement_on_administration=trueAMCDR posts administration events to the stock ledger where policy requires ward/procedure stock decrement.
clinical_safety.enabled=trueMedication prescribe, dispense, and administration actions call the Clinical Safety Sidecar before persistence.
CLINICAL_SAFETY_DATABASE_URLPostgreSQL URL for persisted safety decisions, overrides, rules, and sidecar audit rows in namespaced clinical_safety_* tables.
CLINICAL_SAFETY_RULES_PATHOptional governed JSON rule file loaded when the sidecar rule table is empty.

Use Medication Products and Clinical Safety for the full architecture, safety decision model, allergy/reaction handling, override workflow, stock movement, and audit guidance.

Laboratory lifecycle

The Laboratory module is optional and lifecycle-based. AMCDR owns clinical lab intent, validated observations, clinical acknowledgement, and the openEHR record. The Laboratory module owns operational queues, specimen collection, transport, transfer, accessioning, processing, rejection, correction, and critical alert workflow.

AMCDR_MODULE_LABORATORY_ENABLED=true
GET /lab/status
GET /lab/orders
POST /lab/orders
POST /lab/orders/{lab_order_id}/cancel
POST /lab/orders/{lab_order_id}/transfer
POST /lab/orders/{lab_order_id}/specimens
POST /lab/results
POST /lab/results/{observation_result_id}/correct
POST /lab/alerts/{alert_id}/acknowledge

Use one lab_workflow_id to link order, specimen, transport, transfer, processing, result, correction, cancellation, and acknowledgement events. Clinical orders and results map to openEHR compositions and FHIR ServiceRequest, Specimen, Observation, and DiagnosticReport. Operational logistics stay in the lab module unless a transport issue affects clinical interpretation. See Laboratory Lifecycle.

Deployment modes

ModeUse
FULLForce-full AMCDR runtime. Enables the real module surface and keeps mock CDR off.
full_amcdrComplete CDR with admin/stored module overrides allowed.
core_cdr_onlyClinical repository, patient context, composition storage, MPI, terminology, and governance. Optional operational services stay disabled.
cdr_medicationsCore CDR plus medication operations, MediServe integration, Clinical Safety Sidecar, workflow engine, and tasking/worklists.
form_builder_onlyPortable form designer, template registry, external template discovery, import/export, and mock CDR. Patient storage and composition persistence are disabled.
form_runtimePublished forms and openEHR composition submission. Form editing and AQL workbench are disabled.
demo_trainingTraining mode with mock CDR behavior and no real composition storage.

Effective runtime capability matrix

CapabilityFull / Full AMCDRForm Builder OnlyForm RuntimeDemo / Training
Template registryEnabledEnabledEnabledEnabled
Form builderEnabledEnabledDisabledEnabled
Form runtimeEnabledDisabledEnabledEnabled
Patient workspaceEnabledDisabledEnabledEnabled
Composition storageEnabledDisabledEnabledDisabled
AQL workbenchEnabledDisabledDisabledEnabled
External CDR connectorsEnabledEnabledEnabledDisabled
Semantic StudioEnabledEnabledDisabledEnabled
Workflow engineEnabledDisabledDisabledEnabled
Tasking + worklistsEnabledDisabledDisabledEnabled
Medication operationsEnabledDisabledDisabledEnabled
MediServe integrationEnabledDisabledDisabledEnabled
Clinical safety sidecarEnabledDisabledDisabledEnabled
Laboratory lifecycleEnabledDisabledDisabledEnabled
Terminology servicesEnabledEnabledEnabledEnabled
AnalyticsEnabledDisabledDisabledEnabled
GovernanceEnabledDisabledEnabledEnabled
MPIEnabledDisabledEnabledEnabled
Community HealthDisabled by defaultDisabledDisabledDisabled by default
Mock CDRDisabledEnabledDisabledEnabled

Select a mode from Super-admin -> Platform configuration -> Runtime capabilities, or set AMCDR_DEPLOYMENT_MODE before starting the backend. Use full_amcdr for a full deployment that super admins can tailor. Use uppercase FULL only when the deployment must keep the CDR modules enabled and ignore stored capability toggles.

The effective API response includes deployment_mode, deployment_mode_source, and per-module sources. deployment_mode_source is env, admin, or config.

Live switching and restart rules

Switching from Full AMCDR to Form Builder Only, Form Runtime, or Demo / Training through Runtime capabilities is live. It updates platform_module_settings, and backend route guards read the effective capability configuration on each request. No container restart is needed for UI or admin API preset changes.

Restart is needed only when changing process environment, such as AMCDR_DEPLOYMENT_MODE in .env, Docker Compose, Kubernetes, or systemd. Use full_amcdr when the full platform must remain switchable at runtime. Use uppercase FULL for locked full mode; FULL prevents stored presets from disabling real CDR modules.

Mode precedence is AMCDR_DEPLOYMENT_MODE, then the last admin-applied preset, then bundled config. Module flags start from the selected preset, optionally apply YAML defaults when no env/admin mode is selected, then stored admin toggles, then individual AMCDR_MODULE_*_ENABLED overrides. FULL bypasses stored and individual overrides for the CDR modules.

GET /platform/modules
GET /admin/platform-modules
PUT /admin/platform-modules/{module_key}
POST /admin/platform-modules/apply-preset/{deployment_mode}

Mode smoke checks

ProfileCheckExpected result
form_builder_onlyGET /patients403 Module disabled by platform configuration.
form_builder_onlyPOST /openehr/v1/ehr/{ehr_id}/composition403 Module disabled by platform configuration.
form_runtimeGET /forms/templates/{template_key}/generated-draft403 Module disabled by platform configuration.
form_runtimeGET /forms/templates/{template_key}/publishedPublished runtime form when it exists.
cdr_medicationsGET /medications/ordersMedication operations are available; MediServe and Clinical Safety calls remain external-service controlled.
demo_trainingGET /template-sourcesAMCDR registry and local upload only; external CDR sources are hidden.

Module flags

AMCDR_DEPLOYMENT_MODE=FULL
AMCDR_MODULE_TEMPLATE_REGISTRY_ENABLED=true
AMCDR_MODULE_FORM_BUILDER_ENABLED=true
AMCDR_MODULE_FORM_RUNTIME_ENABLED=true
AMCDR_MODULE_PATIENT_WORKSPACE_ENABLED=true
AMCDR_MODULE_COMPOSITION_STORAGE_ENABLED=true
AMCDR_MODULE_AQL_WORKBENCH_ENABLED=true
AMCDR_MODULE_EXTERNAL_CDR_CONNECTORS_ENABLED=true
AMCDR_MODULE_SEMANTIC_STUDIO_ENABLED=true
AMCDR_MODULE_WORKFLOW_ENGINE_ENABLED=true
AMCDR_MODULE_TASKING_WORKLISTS_ENABLED=true
AMCDR_MODULE_MEDICATION_OPERATIONS_ENABLED=true
AMCDR_MODULE_MEDISERVE_INTEGRATION_ENABLED=true
AMCDR_MODULE_CLINICAL_SAFETY_ENABLED=true
AMCDR_MODULE_LABORATORY_ENABLED=true
AMCDR_MODULE_TERMINOLOGY_SERVICES_ENABLED=true
AMCDR_MODULE_ANALYTICS_ENABLED=true
AMCDR_MODULE_GOVERNANCE_ENABLED=true
AMCDR_MODULE_MPI_ENABLED=true
AMCDR_MODULE_COMMUNITY_HEALTH_ENABLED=false
AMCDR_MODULE_MOCK_CDR_ENABLED=false

Community Health module

community_health is optional and disabled by default. When enabled, the existing Community Health service-module entry opens the tabbed Community Health workspace. It does not create a second module or duplicate navigation.

AMCDR_MODULE_COMMUNITY_HEALTH_ENABLED=true
GET /community/health/status
GET /community/households
POST /community/households
GET /community/tasks
POST /community/tasks
PATCH /community/tasks/{task_id}/status
POST /community/visits
GET /community/campaigns
POST /community/campaigns
POST /community/referrals
POST /community/sync/push
GET /community/sync/pull

Community clinical findings remain openEHR-template-first. Household records, CHW tasks, outreach schedules, campaigns, referrals, devices, offline drafts, sync queues, and conflicts are operational records. Clinical field data is submitted through published forms and linked back with template_id, form_key, and composition_uid.

Core clinical type catalogues

AMCDR seeds foundational classification values in the clinical_type_catalogues table. These values drive patient, identity party, EHR, visit, and encounter typing for standard care, birth and death workflows, foreigners, refugees, undocumented people, unknown persons, emergency care, reporting, and MPI reconciliation.

CatalogueUse
patient_typeClinical subject classifications.
identity_party_typeDemographic, identifier, MPI, humanitarian, and temporary identity classifications.
ehr_typeopenEHR record container classifications.
visit_typeFacility attendance and care episode classifications.
encounter_typeClinical, administrative, reporting, birth, death, emergency, transfer, and MPI workflow contexts.
GET  /catalogues
GET  /catalogues/{catalogue}/types
POST /admin/catalogues/{catalogue}/types
PUT  /admin/catalogues/{catalogue}/types/{code}
POST /admin/catalogues/{catalogue}/types/{code}/activate
POST /admin/catalogues/{catalogue}/types/{code}/deactivate

Codes must use uppercase snake case. System-defined rows must be deactivated rather than deleted when a deployment does not use them.

Forms and templates

Forms stay openEHR-template-driven. The builder owns layout and UI behavior; the selected template_id and openEHR paths remain the clinical contract. The backend handles local template upload, AMCDR template registry selection, external CDR template discovery, and portable form package import/export.

Portable form packages

Portable form packages let teams move form definitions between AMCDR deployments or run a form-designer-only deployment without enabling patient workflows. Import still requires the referenced template_id to already exist in the target AMCDR template registry.

POST /forms/{form_key}/export-package
POST /forms/import-package

Packages include the manifest, template metadata, web-template JSON, form definition, UI layout, value-set bindings, validation rules, and example FLAT and STRUCTURED composition payloads. See Portable Forms.

External CDR submission from forms

When form runtime and external CDR connectors are enabled, a runtime submits a template-compliant composition to AMCDR or another openEHR CDR through the backend adapter layer. The browser does not construct external CDR URLs and does not hold external CDR credentials.

In Form Designer routing, selecting External integrations means that the published form is eligible for external openEHR CDR connector flows. Submissions still pass through AMCDR, and compatibility depends on the target CDR. The target still needs the same template contract, compatible composition format support, compatible terminology bindings, resolved patient/EHR context, endpoint configuration, and authentication.

External openEHR CDRs are configured as RemoteCDR records in the AMCDR database. backend/config/module_config.yml and AMCDR_MODULE_EXTERNAL_CDR_CONNECTORS_ENABLED control whether the adapter surface is enabled. backend/connectors.yaml is separate and is used for external MPI, terminology connectivity, and generic outbound connectors.

GET /template-sources
GET /template-sources/{source_id}/templates
GET /template-sources/{source_id}/templates/{template_id}/web-template

POST {base_url}/ehr/{ehr_id}/composition?templateId={template_id}&format=FLAT
PUT {base_url}/ehr/{ehr_id}/composition/{composition_uid}?format=FLAT

Birth, neonatal, and MPI

AMCDR_BIRTH_WORKFLOW_ENABLED=true
AMCDR_BIRTH_WORKFLOW_REQUIRE_MOTHER_ANCHOR=true
AMCDR_BIRTH_WORKFLOW_ALLOW_TEMPORARY_MOTHER_REGISTRATION=true
AMCDR_BIRTH_WORKFLOW_DEFAULT_BIRTH_TEMPLATE_ID=neonatal_birth_record.v1
AMCDR_NEWBORN_MPI_ENABLED=true
AMCDR_NEWBORN_MPI_AUTO_LINK_THRESHOLD=0.95
AMCDR_NEWBORN_MPI_REVIEW_THRESHOLD=0.70
AMCDR_NEWBORN_MPI_ALLOW_AUTO_MERGE=false
AMCDR_MULTIPLE_BIRTHS_ENABLED=true

The workflow supports temporary maternal registration, newborn identity candidates, newborn-specific MPI review, multiple births, neonatal encounters, mother-newborn relationships, and openEHR birth compositions.

Death and unknown deceased

AMCDR_DEATH_WORKFLOW_ENABLED=true
AMCDR_DEATH_WORKFLOW_DEFAULT_DEATH_TEMPLATE_ID=death_notification.v1
AMCDR_DEATH_WORKFLOW_REQUIRE_CERTIFICATION_BEFORE_VITAL_STATUS_UPDATE=true
AMCDR_DEATH_WORKFLOW_ALLOW_UNKNOWN_DECEASED_WORKFLOW=true
AMCDR_DEATH_WORKFLOW_ALLOW_REFUGEE_HUMANITARIAN_FIELDS=true
AMCDR_UNKNOWN_DECEASED_GENERATE_TEMPORARY_DECEASED_ID=true
AMCDR_DEATH_MPI_ALLOW_AUTO_MERGE=false

Known deaths, death on arrival, community deaths, unknown deceased persons, refugee/humanitarian deaths, neonatal deaths, maternal deaths, and stillbirth/fetal deaths are modeled as workflows with identity, encounter, composition, certification, vital-status, reconciliation, and audit links.

Humanitarian and foreign identifiers

AMCDR_INTERNAL_MPI_STRONG_IDENTIFIER_SYSTEMS=["mrn","national-id","passport","refugee-registration-number","humanitarian-agency-reference","unhcr","external-mpi"]
AMCDR_DEATH_MPI_FOREIGN_IDENTIFIER_SYSTEMS=["unhcr","refugee-registration-number","humanitarian-agency-reference","passport","national-id","external-mpi"]

Foreigners, refugees, undocumented people, and unknown persons are handled with structured identifiers or temporary identity records. Fake names must not become primary identity keys. Uncertain matches create reconciliation tasks.

Protected records and VIP handling

Protected-person and VIP handling is implemented with security labels, clearances, access events, break-glass sessions, and reclassification events. These are security events, not clinical encounter types.

AMCDR_PROTECTED_RECORDS_ENABLED=true
AMCDR_PROTECTED_RECORDS_HIDE_FROM_NORMAL_SEARCH=true
AMCDR_PROTECTED_RECORDS_REQUIRE_EXACT_IDENTIFIER_SEARCH_FOR_VIP=true
AMCDR_PROTECTED_RECORDS_REQUIRE_REASON_FOR_ACCESS=true
AMCDR_PROTECTED_RECORDS_AUDIT_GRANTED_ACCESS=true
AMCDR_PROTECTED_RECORDS_AUDIT_DENIED_ACCESS=true
AMCDR_PROTECTED_RECORDS_ALLOW_BREAK_GLASS=true
AMCDR_PROTECTED_RECORDS_BREAK_GLASS_DURATION_MINUTES=60
AMCDR_PROTECTED_RECORDS_BREAK_GLASS_REQUIRES_POST_REVIEW=true
AMCDR_PROTECTED_RECORDS_ALLOW_PROMOTION_DEMOTION=true
AMCDR_PROTECTED_RECORDS_UPDATE_PATIENT_AND_EHR_TYPE_ON_RECLASSIFICATION=true
AMCDR_PROTECTED_RECORDS_AQL_FILTER_PROTECTED_RECORDS_BY_DEFAULT=true
AMCDR_PROTECTED_RECORDS_EXPORT_MASK_PROTECTED_RECORDS_BY_DEFAULT=true

Seeded catalogues include security_classification, security_event_type, security_clearance, and protected patient/EHR type extensions. VIP records are hidden from general broad search and require exact identifier search unless the user has protected-record administration or audit clearance. See Protected Records for the full workflow, policy model, and operations playbooks.

POST /admin/protected-records/{patient_id}/promote
POST /admin/protected-records/{patient_id}/demote
GET  /admin/protected-records/{patient_id}/labels
GET  /admin/protected-records/access-events
GET  /admin/protected-records/break-glass-sessions
POST /protected-records/{patient_id}/access-request
POST /protected-records/{patient_id}/break-glass
POST /protected-records/break-glass/{session_id}/close

External MPI and FHIR servers

External MPI profiles are configured in backend/connectors.yaml or AMCDR_CONNECTORS_CONFIG_PATH. AMCDR supports PDQ, PIX, and FHIR Patient/Party style integration through the backend integrations layer.

GET /integrations/mpi/servers
POST /integrations/mpi/{server_key}/pdq/search
POST /integrations/mpi/{server_key}/pix/query
POST /integrations/mpi/{server_key}/pix/feed
POST /integrations/mpi/{server_key}/fhir/patient/search
POST /integrations/mpi/{server_key}/fhir/patient

GET /fhir/metadata
POST /fhir/Patient
POST /fhir/Bundle
GET /fhir/{ResourceType}

For details, see MPI, FHIR, and External CDRs and Foundational Workflows.

Vital-event reporting

AMCDR_REPORTING_CIVIL_REGISTRATION_NOTIFICATION_ENABLED=false
AMCDR_REPORTING_PUBLIC_HEALTH_NOTIFICATION_ENABLED=false
AMCDR_REPORTING_HUMANITARIAN_REPORTING_ENABLED=false
AMCDR_REPORTING_VITAL_EVENT_TRANSPORT_ENABLED=true
AMCDR_REPORTING_VITAL_EVENT_SOURCE=vital_reporting

The transport emits report-ready lifecycle events. External national delivery is activated through trigger subscriptions once the destination endpoint is configured.

Search and cache

AMCDR_OPENSEARCH_ENABLED=true
AMCDR_OPENSEARCH_URL=http://opensearch:9200
AMCDR_OPENSEARCH_INDEX_PREFIX=amcdr
AMCDR_OPENSEARCH_BULK_BATCH_SIZE=25
AMCDR_REDIS_URL=redis://redis:6379/0
AMCDR_CACHE_WARMUP_ENABLED=true
AMCDR_CACHE_WARMUP_BLOCKING_STARTUP=false
AMCDR_CACHE_REWARM_INTERVAL_SECONDS=240

OpenSearch stores rebuildable projections. Use GET /performance/readiness for a combined operational check covering schema readiness, Redis availability, OpenSearch projection health, cache warmup ownership, and probe latency. Use GET /metrics for the Prometheus-compatible production monitoring surface covering HTTP traffic, dependency status, probe latency, authoritative openEHR EHR record counts, OpenSearch projections, and cache warmup. Configure Prometheus with AMCDR_METRICS_BEARER_TOKEN rather than an expiring user session token. Use GET /search/status and POST /search/reindex?scope=all after migrations, large imports, and projection changes. Redis warmup fills template, designer, AQL, terminology, and saved-query caches.

Laboratory operational lists use short Redis cache keys under amcdr:lab:* and amcdr:scope:lab:operational. Lab writes, cancellations, transfers, specimen events, result corrections, and alert acknowledgements invalidate the lab operational cache. PostgreSQL remains authoritative, while composite indexes keep common order, specimen, result, alert, patient, workflow, and timeline filters fast.

Documentation page cache

AMCDR_DOCUMENTATION_STATIC_DIR=/app/protected_documentation
AMCDR_DOCUMENTATION_CACHE_SECONDS=3600

Documentation pages are served only through the authenticated backend route. The backend returns private cache headers, ETags, and an authenticated documentation bundle endpoint. After the first authenticated page opens, the frontend prefetches the bundle into memory/session storage so page-to-page navigation is local to the browser tab. Documentation cache is cleared on logout. Static documentation search is generated into search-index.json and loaded only when the user searches, instead of being embedded in every page.

Production guardrails

Enterprise outbound workers

# Run scheduled delivery in the worker role. Keep endpoint-specific delivery
# disabled until the endpoint and local conformance process are approved.
AMCDR_OUTBOUND_INTEGRATION_ENABLED=true
AMCDR_OUTBOUND_SCHEDULER_ENABLED=false
AMCDR_OUTBOUND_PAYER_EXCHANGE_ENABLED=false
AMCDR_OUTBOUND_JURISDICTION_REPORTING_ENABLED=false
AMCDR_OUTBOUND_RUNTIME_POLL_SECONDS=30
AMCDR_OUTBOUND_SCHEDULE_PROCESS_LIMIT=20

AMCDR_OUTBOUND_INTEGRATION_ENABLED is the global master switch. AMCDR_OUTBOUND_SCHEDULER_ENABLED allows the worker runtime to process governed queues under a distributed lease; keep it false on isolated installations and do not rely on independently scheduled API replicas. The endpoint-specific switches remain separate certification gates.

Payer and jurisdiction endpoint records contain only secret references. Resolve OAuth credentials, API keys, basic/bearer secrets, mTLS certificate/key/CA paths and HMAC signing material from environment or file-backed deployment secrets. Production endpoints require HTTPS; the transport requires TLS 1.2 or newer, does not follow redirects, limits response size and records retry evidence.

For the full environment-variable matrix, see docs/configuration-reference.md in the repository.