Clinical Use

End-to-End Clinical Workflow Guide

How AMCDR moves from foundational configuration to patient registration, clinical care, medication delivery, openEHR persistence, FHIR projection, and external system retrieval.

Purpose

Use this guide to set up AMCDR, follow a patient through clinical care, and exchange records through FHIR. It brings together the steps for platform administrators, clinical informatics teams, and integration teams.

Foundation records identify the patient and care context. openEHR templates define the stored clinical record, AMCDR services coordinate tasks and audit, and FHIR exposes authorised records to other systems.

End-to-end operating model
FoundationsTenant, facility, users, roles, modules
->
Clinical modelsTerminology, templates, forms, bindings
->
Patient contextMPI, patient, EHR, visit, encounter
->
Queue routingTriage, service lane, priority, worklist
->
Care deliveryAssessment, orders, medication, labs, documents
->
ExchangeFHIR, openEHR REST, SHR, subscriptions

Phase 1: Foundation Setup

Production workflow starts with foundation records. Clinical work must not begin until the platform can identify who is acting, where care is happening, which modules are enabled, and which policies govern access.

Foundation areaExpected configurationOperational effect
Tenant and organisationConfigured in Platform Configuration with active environments and facilities.Scopes all records, users, modules, audit, and reporting.
Facility and resourcesFacility registry, care areas, rooms, beds, cots, incubators, pharmacies, and service locations.Supports location, movement, allocation, ward stock, and facility-level reporting.
Users and membershipsAuthenticated users, organisation memberships, role assignments, and access policies.Controls who can register patients, prescribe, dispense, administer, release records, and export data.
Service modulesPatient workspace, encounters, medication, laboratory, documents, worklists, SHR, FHIR, and monitoring enabled according to deployment scope.Controls navigation, API availability, background workers, and operational surfaces.
TerminologyBuilt-in codes, AMy-Term, SNOMED CT, RxNorm, ATC, local value sets, and mapping policies.Supports coded forms, medication safety, FHIR coding, reporting, and AQL consistency.
PoliciesRBAC, protected records, patient visibility, release rules, sharing policies, duty policies, and audit configuration.Prevents unrestricted access and keeps patient-facing release explicit.

Phase 2: Clinical Model Setup

Clinical data capture must be template-led. Forms are user interfaces over approved templates. Workflow foundation bindings identify which template fields update operational projections such as visit, encounter, movement, queue, medication safety, visibility, and reporting.

  1. Import and publish openEHR templates in Semantic Studio.
  2. Create forms from approved template fields and bind coded fields to terminology sources.
  3. Configure workflow stage bindings for registration, admission, consultation, medication, laboratory, discharge, transfer, birth, death, or other active pathways.
  4. Map template fields to foundation targets when operational state must be updated from clinical capture.
  5. Configure FHIR mappings only after the canonical template target is clear.
Design artifactPrimary roleProduction rule
openEHR templateCanonical clinical contract.Required before structured clinical persistence.
FormClinician-facing capture surface.Must not create a competing data model outside the template.
Foundation bindingProjection from template field to operational foundation.Use only for rebuildable operational state and workflow routing.
FHIR mappingExchange mapping between FHIR paths and canonical template fields or projections.FHIR does not replace the openEHR clinical model.
Bidirectional mappingGoverned mapping artifact with explicit inbound and outbound rules.Use only when both directions have fixtures, terminology handling, identity links, audit, and conflict policy.

Phase 3: Workflow Orchestration

Once foundation records and clinical models are ready, configure the stages, transitions, queues, task routing, forms, and completion rules for each care process.

Use Workflow Orchestration and Enforcement for workflow definitions, queues, instances, tasks, transitions, stage-form bindings, completion rules, and monitoring. Use Workflow Foundation Bindings when a submitted openEHR form must update operational state.

Phase 4: Patient Registration, EHR, Visit, and Encounter Context

Patient registration must resolve identity before clinical composition persistence. A registration form may be template-driven, but the submitted registration composition is committed only after a patient identity and EHR exist.

  1. Search the Client Registry or MPI before creating a new identity.
  2. Select an existing client or create a new client only after duplicate review.
  3. Create the Person, Patient, identifiers, contacts, coverages, and security labels.
  4. Create the openEHR EHR, EHR_STATUS, and default EHR access.
  5. Commit the registration artifact or companion composition after the EHR exists.
  6. Optionally open the initial visit, encounter, worklist task, movement, or allocation.

The API acknowledgement is part of the contract. POST /clients and POST /patients return 201 Created with a JSON acknowledgement containing the patient identifier, EHR identifier, created resource summary, and follow-up links.

POST /clients
Content-Type: application/json

{
  "given_name": "Amina",
  "family_name": "Kato",
  "date_of_birth": "1992-08-17",
  "sex_at_birth": "female",
  "mrn": "MRN-UG-2026-0002",
  "identifiers": [
    {"system": "local-facility-id", "value": "LF-100", "use": "usual"}
  ]
}

After registration, the platform creates or selects the visit and encounter context required by the active workflow. Clinical documentation should use the selected patient, EHR, visit, encounter, location, responsible service, and role context rather than starting from an unrelated form or workspace.

ContextExpected useFHIR/openEHR relationship
PatientThe clinical subject of care.FHIR Patient; openEHR EHR_STATUS.subject.
EHRThe openEHR container for compositions./openehr/v1/ehr/{ehr_id}.
VisitOperational care episode such as outpatient, emergency, inpatient, maternity, neonatal, or field visit.Projected operational context; represented in FHIR as Encounter grouping where required by the exchange profile.
EncounterClinical documentation context such as consultation, triage, admission, medication review, laboratory request, or NICU round.Composition context and FHIR Encounter projection.
CompositionVersioned clinical content created from a template.openEHR canonical record; FHIR projection when mapped.
HTTP/1.1 201 Created
Location: /clients/{patient_id}
X-AMCDR-EHR-Location: /openehr/v1/ehr/{ehr_id}

{
  "acknowledgement": "client-registration-created",
  "patient_id": "{patient_id}",
  "ehr_id": "{ehr_id}",
  "created_resources": {
    "client_identity": true,
    "patient_identity": true,
    "ehr": true,
    "ehr_status": true,
    "ehr_access": true,
    "registration_composition": true
  }
}

Phase 5: Queue Assignment and Worklist Routing

After the patient, EHR, visit, and encounter context are available, the next operational step is queue assignment. Queue assignment determines where the patient or clinical task waits, which service owns the next action, and how urgent the work is. This phase applies to emergency triage, outpatient queues, inpatient ward tasks, laboratory collection, pharmacy verification, referral review, maternity triage, neonatal review, and other configured pathways.

Queue elementExpected useExample
Queue typeDefines the routing model.clinical_priority, service_lane, department_queue.
Queue nameNames the operational worklist.Red Queue, OPD Queue, Laboratory Collection, Pharmacy Verification.
Priority rankSorts clinically urgent work ahead of routine work.1 for Red, 2 for Orange, 3 for Yellow.
Ticket numberLocal operational queue number, not a patient identifier.E0234, OP0001, IP0001.
Assignment statusTracks whether the item is waiting, called, in progress, completed, requeued, or cancelled.waiting.

Queue assignment can be created directly by a workflow stage or derived from a submitted clinical composition through foundation projection rules. For example, an emergency triage form can project final acuity and route the patient to Red, Orange, Yellow, Green, or Blue Queue. A maternity triage form can route to routine review, urgent obstetric review, labour ward, theatre, or referral. A laboratory order can route to specimen collection or manual reporting.

Transfer queues may be internal, external outgoing, or external incoming. External outgoing queues manage patients being sent to another facility. External incoming queues manage transfer requests received from partner hospitals, clinics, programmes, or another networked AMCDR instance. The receiving site must still control MPI matching, acceptance, arrival confirmation, receiving visit and encounter creation, and audit.

For the detailed transfer model, including networked AMCDR transfer packages, partner-hospital receipt, outgoing and incoming transfer queue states, MPI review, acceptance, receiving encounters, and audit, use Transfers and Networked Referrals.

Registration
  -> Encounter created
  -> Queue assignment
  -> Required form or task
  -> Decision / routing rule
  -> Next queue or clinical stage

Networked Transfer Example

Sending facility
  -> Outgoing transfer queue
  -> Transfer/referral package
  -> Receiving facility incoming transfer queue
  -> MPI review
  -> Accept, reject, redirect, or request more information
  -> Receiving visit and encounter
  -> Receiving service queue

Phase 6: Clinical Assessment, Investigation, and Diagnostic Findings

After queue assignment, the clinical workflow should first support assessment, triage, consultation, investigation, and diagnostic findings. Medication and other treatment actions usually depend on this clinical evidence: presenting complaint, observations, examination, diagnostic impressions, laboratory results, imaging, procedure findings, and problem or diagnosis records.

Clinical workflowTypical triggerCanonical clinical evidence
Triage or assessmentPatient reaches triage or review queue.Assessment, vital signs, acuity, risk flags, or clinical note composition.
ConsultationPatient is called from the service or priority queue.History, examination, clinical note, provisional diagnosis, and care plan composition.
InvestigationClinician requests laboratory, imaging, procedure, or other diagnostic work.Order, specimen, result, report attachment, diagnostic report, or procedure composition.
Diagnosis and findingsAssessment or investigation produces clinically meaningful findings.Problem, diagnosis, diagnostic finding, interpretation, severity, certainty, and linked evidence.
DocumentsReport, summary, certificate, referral, or external document received.Document reference, attachment, and linked openEHR composition where clinically meaningful.

Phase 7: Treatment, Medication, Procedures, Discharge, and Follow-up

Treatment workflows act on the assessment and diagnostic context. This phase includes medication ordering, dispensing and administration, procedures, referrals, care plans, discharge, transfer, and follow-up. Service-specific workflows should use the active patient, visit, encounter, queue, diagnosis or finding context, and role context.

Treatment workflowTypical triggerCanonical clinical evidence
MedicationDiagnosis, diagnostic finding, symptom control need, or treatment plan.Medication order, safety decision, dispense, administration, or medication history composition.
ProcedureDiagnostic or therapeutic procedure is required.Procedure request, procedure record, finding, complication, and follow-up evidence.
Referral or transferPatient needs another service, facility, ward, specialty, or partner hospital.Referral package, transfer note, movement record, outgoing transfer queue, incoming transfer queue, receiving decision, handoff, and audit trail.
Discharge and follow-upCare stage reaches closure or continuing care plan.Discharge summary, final diagnosis, medications, advice, appointments, and follow-up tasks.

Medication Treatment Example

Medication provision normally follows assessment, diagnosis, diagnostic findings, or a documented treatment plan. AMCDR owns the patient clinical record, medication order, safety context, and audit. MediServe or Medication Tracker owns product, formulary, stock, batch, expiry, and pharmacy inventory operations.

  1. The clinician selects the patient and active encounter.
  2. The clinician creates a medication order from the Medication workspace or a medication template form.
  3. AMCDR resolves the selected medication product against MediServe or the configured medication authority.
  4. AMCDR gathers relevant safety facts: allergies, current medication list, diagnoses, pregnancy status, age, renal function, weight, gestational age, and other configured facts.
  5. The clinical safety sidecar evaluates allergies, interactions, contraindications, duplicate therapy, dose range, and configured neonatal or high-risk rules.
  6. The order is allowed, warned, requires override, or blocked according to policy.
  7. Pharmacy verifies and dispenses through MediServe or the medication tracker surface.
  8. Stock decrement, batch, expiry, and dispense ledger are recorded in the medication authority and linked back to AMCDR.
  9. Administration is recorded in AMCDR as a clinical event or openEHR composition and linked to the order and dispense context.
  10. Lifecycle events, audit, and FHIR projections are updated.
Medication stageClinical recordOperational authorityFHIR projection
OrderAMCDR medication order and optional openEHR composition.Product existence and formulary from MediServe.MedicationRequest.
Safety checkAMCDR safety decision and audit event.Clinical Safety Sidecar for rule evaluation.Usually audit or DetectedIssue where configured.
DispenseAMCDR dispense event linked to the order.MediServe stock, batch, expiry, and ledger.MedicationDispense.
AdministrationAMCDR medication administration event or composition.Ward stock decrement if configured.MedicationAdministration.
Cancellation or overrideAMCDR lifecycle event with reason and actor.MediServe reconciliation when stock was affected.Status update or audit projection where configured.
POST /medications/orders
POST /medications/orders/{order_id}/transition
POST /medications/dispenses
POST /medications/administrations
GET  /medications/lifecycles/{medication_workflow_id}

Phase 8: Clinical Persistence and Projection

Store or link clinically meaningful content as openEHR records. Medication, laboratory, document, alert, care-plan, and encounter services can also expose the operational state needed for immediate work.

Data surfaceCanonical persistenceProjection surface
Clinical observations and formsopenEHR composition.Patient timeline, AQL, FHIR Observation, SHR.
Medication orderMedication order record and optional openEHR composition.Medication workspace, FHIR MedicationRequest, SHR medication summary.
Dispense and administrationLinked clinical events and lifecycle records.Medication timeline, FHIR MedicationDispense, FHIR MedicationAdministration.
Allergy or adverse reactionopenEHR composition or clinical safety record.Patient safety strip, FHIR AllergyIntolerance, CDS facts.
FHIR outputDerived from canonical records and governed projections./fhir/*, /fhir/project, subscriptions, saved-query extracts.

Phase 9: FHIR Resource Read and Send Patterns

FHIR is the exchange boundary. External systems should not read internal AMCDR tables. They should use authenticated FHIR, SHR, openEHR REST, saved-query, or subscription APIs according to their approved integration contract.

System Reads FHIR Resources

  1. The external system authenticates with a scoped token or API key.
  2. The external system confirms capability using GET /fhir/metadata.
  3. The system reads patient identity with GET /fhir/Patient/{id} or searches using approved parameters.
  4. The system reads clinical resources such as MedicationRequest, MedicationDispense, Observation, DiagnosticReport, DocumentReference, or Encounter.
  5. AMCDR applies authentication, authorization, patient visibility, protected-record policy, and projection rules before returning the resource.
GET /fhir/metadata
GET /fhir/Patient/{patient_id}
GET /fhir/MedicationRequest?patient={patient_id}
GET /fhir/MedicationDispense?patient={patient_id}
GET /fhir/MedicationAdministration?patient={patient_id}
GET /fhir/Patient/{patient_id}/$everything

AMCDR Sends or Notifies Another System

The recommended production pattern is notification plus pull. AMCDR sends a signed event notification with identifiers and event metadata. The receiving system then pulls the authorized FHIR resource from AMCDR. This avoids pushing excessive clinical payloads to systems that may not be ready, authorized, or available.

  1. Configure a subscription for the relevant lifecycle events.
  2. AMCDR emits an event when a medication order, dispense, administration, lab result, document, encounter, or composition changes.
  3. The webhook or broker message carries event identifiers, patient id, resource type, and retrieval link where allowed.
  4. The partner system calls the FHIR endpoint to retrieve the current authorized resource.
  5. AMCDR records delivery attempts, retries, acknowledgement state, and replay evidence.
POST /triggers/subscriptions
GET  /triggers/subscriptions/{subscription_id}/deliveries
POST /triggers/subscriptions/{subscription_id}/replay

Partner pull after notification:
GET /fhir/MedicationRequest/{resource_id}
GET /fhir/MedicationDispense/{resource_id}
GET /fhir/Patient/{patient_id}/$everything

FHIR Project Endpoint

/fhir/project uses "project" as a projection operation, not as the name of an implementation project. It asks AMCDR to derive a FHIR representation from governed AMCDR records using the requested resource type, patient, template, composition, or mapping context.

POST /fhir/project
Content-Type: application/json

{
  "resource_type": "MedicationRequest",
  "patient_id": "{patient_id}",
  "source": {
    "composition_id": "{composition_id}",
    "template_key": "medication_order.v1"
  }
}

Phase 10: Monitoring, Audit, and Evidence

Every production workflow is observable without exposing patient-level clinical data in monitoring systems. Audit logs provide patient-level traceability, while Prometheus and Grafana provide aggregate operational metrics.

Monitoring areaExpected evidence
Platform health/health, schema revision, Redis, OpenSearch, backend, frontend, and dependency status.
Clinical workflowOrder counts, dispense counts, administration counts, failed safety checks, stale queues, and clinical metrics samples.
FHIR exchangeFHIR request rate, errors, subscription delivery state, replay counts, and validation results.
AuditUser, patient, EHR, action, resource id, policy decision, override reason, and timestamp.
PerformanceRequest latency, dependency availability, queue processing time, cache status, and projection freshness.

Production Checklist

  1. Foundation records are configured: tenant, organisation, facility, resources, users, roles, policies, service modules, and terminology.
  2. Templates and forms are published and mapped to workflow foundation targets where operational projections are required.
  3. Workflow definitions, stages, previous-stage links, queues, and form bindings are configured before the workflow is activated.
  4. Registration returns a 201 Created acknowledgement with patient id and EHR id.
  5. No openEHR composition is committed before the EHR exists.
  6. Visits and encounters are created before clinical documentation where the workflow requires encounter context.
  7. Queue assignment occurs before the patient or task is handed to triage, consultation, investigation, pharmacy, laboratory, maternity, neonatal, or discharge worklists.
  8. Clinical service workflows use the selected patient, visit, encounter, queue, and role context.
  9. Medication products, formulary, stock, batch, and expiry are resolved through MediServe or the configured medication authority where medication workflows are enabled.
  10. Clinical safety checks run before configured high-risk actions such as medication order acceptance, dispensing, discharge, or workflow progression.
  11. Dispense, administration, laboratory, document, transfer, and discharge events are linked to the patient record and active workflow context.
  12. FHIR resources are derived from canonical records or governed projections, not from uncontrolled internal tables.
  13. Bidirectional mappings are published only when inbound and outbound rule sets, fixtures, terminology translations, and conflict policies are complete.
  14. External systems use scoped authentication and policy-controlled FHIR, SHR, openEHR, saved-query, or subscription APIs.
  15. Subscriptions use notification plus pull unless a deployment contract explicitly requires payload push.
  16. Monitoring uses aggregate metrics only. Patient identifiers, composition UIDs, raw AQL rows, and clinical values are not Prometheus labels.

Related Guides