Scope
Shared Health Record
Policy-controlled patient-wide clinical read model over canonical records.
Multi-template Projection
Problems, medications, allergies, observations, laboratory results, encounters, documents, and relationships assembled through governed projections.
IPS
International Patient Summary output assembled from canonical records for continuity-of-care and cross-border exchange.
Available APIs
Records, FHIR, AQL, and projection APIs used for summary retrieval, timeline filtering, population queries, and exports.
Definition
A Shared Health Record brings together a patient's current and past health information across care settings. AMCDR builds it from patient identity, EHRs, encounters, compositions, documents and relationships, with terminology, audit and consent records guiding how the information is presented.
The source clinical records remain in openEHR compositions. SHR APIs summarize, filter and export them according to access policy, release controls, protected-record rules and purpose of use.
External systems that need SHR or IPS output should receive lifecycle notifications and then pull the governed summary or FHIR projection through authorized APIs. See Subscriptions and Outbound Delivery.
External systems that need to send SHR, IPS, referral, transfer, or clinical document content into AMCDR must use the governed inbound partner model: registered integration identity, scoped credential, purpose-of-use header, patient/EHR resolution, validation, canonical persistence, and audit.
How the record is assembled
| Boundary | Production model |
|---|---|
| Template model | The SHR is assembled from many template-backed compositions, relationship links, and policy-filtered projections. It is not maintained as one large template. |
| Canonical record | openEHR compositions remain canonical. SHR services read, summarize, filter, export, and project them. |
| Template joins | Joining means query or projection across multiple composition templates for the same patient, encounter, relationship, time window, or reporting purpose. |
| FHIR boundary | FHIR is an exchange and output contract. AMCDR ingests and outputs FHIR while retaining canonical openEHR persistence. |
Receiving SHR Or IPS From External Platforms
A partner platform can send patient summaries or shared-record packages to AMCDR only through authenticated ingest APIs. Network reachability alone is not sufficient. The sending system must be onboarded as an integration/service account and issued a scoped API key or bearer token.
| Inbound pattern | API | Expected payload | Credential scope |
|---|---|---|---|
| Atomic transaction or isolated batch | POST /fhir | FHIR R4 Bundle with type=transaction or type=batch and an entry.request for every entry. | integration:ingest:fhir |
| FHIR SHR/IPS package | POST /fhir/Bundle | FHIR Bundle containing Patient, Encounter, Composition, Observation, Condition, Medication, AllergyIntolerance, DocumentReference, DiagnosticReport, or related resources. | integration:ingest:fhir |
| Profile-validated FHIR mapping | POST /fhir/ingest | FHIR resource validated against a registered profile and mapped to one or more openEHR templates. | integration:ingest:fhir |
| Template-specific XML transformation | POST /records/ingest | Governed transformation of a TDD mapping artefact; this is not a second composition CRUD API. | integration:ingest:compositions |
| openEHR FLAT or STRUCTURED JSON | POST /openehr/v1/ehr/{ehr_id}/composition | The media type and openehr-template-id header select the representation and template. | integration:ingest:compositions |
POST /fhir/Bundle
X-API-Key: <partner-api-key>
X-Purpose-Of-Use: TREAT
Content-Type: application/fhir+json
{
"resourceType": "Bundle",
"type": "document",
"entry": [
{ "resource": { "resourceType": "Patient", "identifier": [{ "system": "https://partner.example/mrn", "value": "P-10001" }] } },
{ "resource": { "resourceType": "Composition", "status": "final", "type": { "text": "International Patient Summary" } } }
]
}
AMCDR resolves or creates patient/EHR context according to MPI and registration policy, records the authenticated partner as the actor, persists supported resources into canonical clinical records, returns warnings for unsupported resources, and audits the complete transaction. For production integrations, use HTTPS, secret-managed credentials, optional mTLS or VPN, idempotent external identifiers, and replay-safe partner messages.
FHIR Transactions And Batches
POST /fhir is the standards-based system endpoint. A transaction commits MPI reconciliation, FHIR registry changes, openEHR composition versions, validation evidence, provenance, and audit records as one atomic unit. Any failed entry rolls back the entire transaction and returns a FHIR OperationOutcome. A batch isolates each entry and returns a batch-response containing the outcome of every request.
POST /fhir/Bundle has a different responsibility: it ingests a document, IPS document, collection, or other exchange Bundle. It does not interpret entry.request as an atomic transaction.
POST /fhir
Authorization: Bearer <integration-token>
Content-Type: application/fhir+json
Accept: application/fhir+json
Prefer: return=minimal
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:550e8400-e29b-41d4-a716-446655440001",
"resource": {
"resourceType": "Patient",
"name": [{"family": "Doe", "given": ["Jane"]}],
"identifier": [{"system": "urn:national-id", "value": "NAT-1001"}]
},
"request": {
"method": "POST",
"url": "Patient",
"ifNoneExist": "identifier=urn:national-id|NAT-1001"
}
},
{
"fullUrl": "urn:uuid:550e8400-e29b-41d4-a716-446655440002",
"resource": {
"resourceType": "Observation",
"status": "final",
"subject": {"reference": "urn:uuid:550e8400-e29b-41d4-a716-446655440001"},
"code": {"text": "Body temperature"},
"valueQuantity": {"value": 37.1, "unit": "Cel"}
},
"request": {"method": "POST", "url": "Observation"}
}
]
}
A successful transaction returns HTTP 200 with Bundle.type=transaction-response. Response entries remain in request order and carry status, location, weak etag, lastModified, and optional representations or OperationOutcomes. AMCDR advertises the system-level transaction and batch interactions through GET /fhir/metadata.
Multi-template Assembly
A patient may have many template-backed compositions across time. The SHR service assembles clinically meaningful sections through stable patient and EHR context, encounter context, composition metadata, relationship links, selected template keys, and projection rules. This allows one patient view to include data captured by many forms, service modules, and clinical workflows without duplicating the source record.
| SHR section | Typical source templates | Output use |
|---|---|---|
| Problems and diagnoses | Problem list, diagnosis note, discharge summary, death cause record. | Current problem list, chronic condition summary, IPS problem section. |
| Allergies and intolerances | Adverse reaction list, allergy intake, medication reconciliation. | Safety alerts, medication review, IPS allergy section. |
| Medication summary | Medication list, medication request, administration, pharmacy dispensing, discharge medicines. | Current medicines, recent prescriptions, IPS medication section. |
| Observations and vital signs | Vital signs, nursing observations, triage, neonatal monitoring, ICU observations. | Latest observations, timeline, encounter summary. |
| Laboratory and diagnostic results | Lab result, diagnostic report, imaging report, procedure report. | Recent results, abnormal results, IPS results section. |
| Immunisations and procedures | Vaccination, procedure note, operation note, newborn immunisation. | Continuity record, public health reporting, IPS procedure/immunisation sections. |
| Encounters and documents | Admission note, discharge summary, referral, transfer summary, birth report, death notification. | Episode context, transitions of care, document history. |
| Relationships | Mother-newborn links, referral links, transfer links, guardian relationships. | Related records, family context, birth packs, transfer continuity. |
SHR Available APIs
The records API is the primary SHR-facing API surface. It returns patient summaries, population indexes, timelines, annual snapshots, longitudinal records, documents, and AQL-backed projections over canonical records. Use the format query parameter where available to return json, fhir, or xml.
Swagger groups 13 AMCDR document and media operations under Documents & Media. This group is visible in the default FHIR + openEHR view and in the focused Documents + Media API area. Standard FHIR DocumentReference operations remain exclusively under FHIR to avoid presenting the same call twice.
GET /records/patient/{patient_id}/summary
GET /records/patient/{patient_id}/summary/current?format=json
GET /records/patient/{patient_id}/summary/current?format=fhir
GET /records/patient/{patient_id}/summary/current?format=xml
GET /records/patient/{patient_id}/summary/encounters/{encounter_id}
GET /records/patient/{patient_id}/summary/annual
GET /records/patient/{patient_id}/summary/annual/{year}
GET /records/patients/summary?profile=shr|ips&include=index|summary&format=json|fhir|xml
GET /fhir/Patient/{patient_id}/$summary
POST /fhir/Patient/{patient_id}/$summary
GET /fhir/Patient/$summary?identifier={system}|{value}
POST /fhir/Patient/$summary
POST /records/patient/{patient_id}/ips/documents
GET /records/patient/{patient_id}/ips/documents
GET /records/patient/{patient_id}/ips/documents/{document_id}
GET /records/patient/{patient_id}/timeline
GET /records/patient/{patient_id}/timeline/query?page=1&page_size=50
GET /records/patient/{patient_id}/documents
GET /records/patient/{patient_id}/longitudinal
POST /records/ingest
POST /openehr/v1/query/aql
FHIR-facing consumers also use:
GET /fhir/Patient/{patient_id}/$everything
POST /fhir/project
POST /fhir/ingest
POST /fhir/Bundle
Current SHR Summary
The patient workspace summary brings together the latest released, clinically relevant information from the patient's templates.
GET /records/patient/2f7c1b3e-9f42-4f4d-b14b-9e0dbf77a983/summary/current?format=json
Authorization: Bearer <token>
The response includes configured sections such as demographics, identifiers, active problems, allergies, medications, latest observations, recent documents, encounter context, annual summary index, and timeline preview. The exact content depends on stored compositions, FHIR-visible resource bindings, protected-record policy, release controls, and patient context.
Population SHR Or IPS Query
Population summary retrieval supports trusted cohort, facility, location, and date-range access without requiring a client to open every patient record individually. The default include=index response returns matching patient rows and links. Use include=summary only when the caller is permitted to retrieve embedded patient-level summaries.
GET /records/patients/summary?profile=ips&include=index&date_from=2026-01-01&date_to=2026-06-30&location=Emergency&page=1&page_size=25&format=fhir
Authorization: Bearer <token>
Supported filters include date_from, date_to, location, facility_id, encounter_type, identifier, name, gender, birthdate, and _lastUpdated. Use profile=shr for shared health record views. profile=ips selects patients and evaluates IPS section policy for readiness workflows; generate the conformant patient-level document through the FHIR $summary operation.
Joining Multiple Templates With AQL
Use AQL when a report or integration needs a defined result set across several templates. The query reads several composition types and returns a report result while keeping their templates separate.
SELECT
e/ehr_id/value AS ehr_id,
p/uid/value AS problem_uid,
p/name/value AS problem_document,
m/uid/value AS medication_uid,
m/name/value AS medication_document
FROM EHR e
CONTAINS (
COMPOSITION p[openEHR-EHR-COMPOSITION.problem_list.v1]
AND COMPOSITION m[openEHR-EHR-COMPOSITION.medication_list.v0]
)
WHERE
p/archetype_details/template_id/value = 'Problem List'
AND m/archetype_details/template_id/value = 'Medication Statement List'
For patient-specific SHR retrieval, add an EHR or patient filter. For national reporting, add date, facility, organisation, and template filters.
SHR Timeline Query
The timeline query is preferred over one broad AQL query for user-facing browsing because it supports date filters, encounter filters, entry type filters, template filters, pagination, and output formatting.
GET /records/patient/{patient_id}/timeline/query?date_from=2026-01-01&date_to=2026-12-31&entry_type=composition&page=1&page_size=25
Authorization: Bearer <token>
International Patient Summary
IPS is a distinct standards-facing document operation over the SHR, especially for unscheduled care and governed cross-border exchange. AMCDR implements the universal HL7 FHIR IPS 2.0.1 document contract on FHIR R4. It is not the generic SHR FHIR export and it does not replace the canonical openEHR record.
The on-demand $summary operation returns the latest available information without creating a historical document. Problems, Allergies and Medications occur exactly once; where required information is unavailable, the section carries an explicit FHIR emptyReason. Populated optional sections include immunisations, results, procedures, medical devices, alerts, functional status, pregnancy history, plan of care, social history and vital signs.
GET /fhir/Patient/2f7c1b3e-9f42-4f4d-b14b-9e0dbf77a983/$summary
Authorization: Bearer <token>
Accept: application/fhir+json
Accept-Language: sw
POST /fhir/Patient/$summary
Authorization: Bearer <token>
Content-Type: application/fhir+json
{
"resourceType": "Parameters",
"parameter": [
{"name": "identifier", "valueString": "urn:amcdr:mrn|MRN-0001"},
{"name": "profile", "valueCanonical": "http://hl7.org/fhir/uv/ips/StructureDefinition/Composition-uv-ips|2.0.1"}
]
}
The type-level operation resolves identifiers through MPI and rejects ambiguous identity. The response declares the universal IPS Bundle and Composition profiles, places the Composition first, includes the subject Patient, gives every entry a unique fullUrl, supplies generated XHTML narratives and BCP 47 language metadata, and preserves provenance to contributing projections and source openEHR composition versions.
Accept-Language negotiation honors HTTP quality weights. Narrative packs are bundled for English, German, French, Spanish, Portuguese, Estonian, Swahili, and Luganda. Other valid BCP 47 language tags use the English narrative fallback until a governed locale pack is installed. Each deployment must clinically and linguistically approve every enabled locale.
Immutable IPS snapshots
Use the governed records operation when the exchange needs a reviewable point-in-time artifact. The server validates the document, persists the snapshot, records a SHA-256 digest and returns its retrieval URL in the Location header.
POST /records/patient/2f7c1b3e-9f42-4f4d-b14b-9e0dbf77a983/ips/documents
Authorization: Bearer <token>
Content-Type: application/json
Accept: application/fhir+json
{
"language": "fr-CA",
"include_empty_optional_sections": false,
"purpose_of_use": "TREAT",
"break_glass": false
}
Both modes run consent, release, protected-record and purpose-of-use policy before assembly. Structural IPS validation always runs. Production must additionally use the official HL7 validator in fail-closed mode with hl7.fhir.uv.ips#2.0.1. Jurisdictional terminology, consent, trust, digital-signature and gateway testing remain required before cross-border go-live; implementation does not constitute third-party certification.
Federation gateway integration
Cross-border IPS delivery uses the Hygeoniq Health National Federation Gateway and Regional Federation Agent. The National Gateway exposes GET /fhir/Patient/{patient_id}/$summary, resolves the patient record location, and routes only to nodes advertising ips-2.0.1 or patient-summary-operation. The Regional Agent repeats local policy evaluation and calls the regional AMCDR standard operation without creating another clinical store.
Production federation requires a scoped Regional Agent service credential, TLS and egress restrictions, disabled runtime connector URL changes, and AMCDR_PCM_DECISION_REQUIRED=true. AMCDR verifies the forwarded signed PCM decision against patient, action, purpose, expiry, issuer, audience, and signature before releasing federated IPS data.
| Implementation question | AMCDR model |
|---|---|
| Is IPS stored as one template? | A deployment may store a generated summary composition, but IPS output is normally assembled from several source templates and projection rules. |
| Where does IPS data come from? | Problem, allergy, medication, observation, result, immunisation, procedure, encounter, document, and relationship compositions. |
| How is IPS created? | Define the IPS section contract, map source templates into sections, run a patient summary projection, validate required sections, then export as FHIR or XML. |
| Where do forms fit? | Forms can capture missing summary fields, attestations, or clinician review. They should not duplicate data already present in source compositions. |
IPS Source Map
| IPS section | AMCDR source | FHIR output target |
|---|---|---|
| Patient | Patient, Person, identifiers, MPI links, protected-record release filters. | Patient |
| Problems | Problem list and diagnosis compositions. | Condition |
| Allergies | Adverse reaction list and allergy compositions. | AllergyIntolerance |
| Medications | Medication request, statement, administration, reconciliation, discharge medicines. | MedicationRequest, MedicationStatement, Medication |
| Results | Laboratory result, diagnostic report, imaging report. | Observation, DiagnosticReport |
| Procedures | Procedure note, operation note, immunisation record. | Procedure, Immunization |
| Care context | Encounter, referral, transfer, care plan, discharge summary. | Encounter, CarePlan, DocumentReference, Composition |
Creating IPS Output
Use the standard IPS operation for an IPS document. Patient/$everything remains available for an authorized patient-wide FHIR export, but it is not an IPS document and must not be presented as one.
GET /fhir/Patient/{patient_id}/$summary
Authorization: Bearer <token>
Accept: application/fhir+json
Accept-Language: fr-CA
POST /records/patient/{patient_id}/ips/documents
Authorization: Bearer <token>
Content-Type: application/json
{
"language": "fr-CA",
"include_empty_optional_sections": false,
"purpose_of_use": "TREAT",
"break_glass": false
}
The service assembles the document from released canonical records, enforces consent and access policy, validates the result, and records governance evidence. The records operation additionally persists an immutable point-in-time snapshot.
Mother And Newborn Shared Record
A maternity SHR view includes the mother's delivery record and the newborn records without making one EHR contain the other EHR's clinical data. Relationship links connect the EHRs. Clinical records remain in their correct subject EHR.
Mother EHR
Composition: maternity admission
Composition: labour and delivery summary
Composition: birth report with twins
Baby A EHR
Composition: newborn admission
Composition: newborn examination
Composition: immunisation
Baby B EHR
Composition: newborn admission
Composition: NICU admission
Composition: incubator monitoring
Composition: diagnosis notes
The SHR uses relationship APIs to find the linked records, then uses AQL or timeline queries to retrieve the clinical facts from each EHR.
GET /patients/{mother_patient_id}/ehr-context-links
GET /ehrs/{newborn_ehr_id}/context-links?direction=target&context_type=birth_event
GET /birth-workflows/{birth_event_id}/ehr-links
Operational Rules
- Do not copy all source composition content into a single SHR composition unless there is a clear legal or reporting reason.
- Prefer summary projections for browsing and export, while keeping source compositions versioned and auditable.
- Use relationships for mother-newborn, referral, transfer, and cross-EHR context instead of embedding another patient's clinical record inside the wrong EHR.
- Use FHIR StructureDefinitions and mappings when external systems need standards-based output or inbound exchange.
- Apply RBAC, protected-record policy, consent, release controls, purpose of use, and audit before returning SHR or IPS output.
- When creating IPS output, include provenance showing source templates, composition IDs, generated time, requester, and validation result.
Configuration Checklist
- Ensure patient, MPI, EHR, encounter, and relationship data are correctly linked.
- Publish source templates for the clinical domains that will appear in the SHR.
- Configure FHIR bindings or mappings for FHIR-visible sections.
- Define saved AQL queries or summary projections for current, encounter, annual, and IPS summaries.
- Configure terminology systems for diagnosis, medications, labs, procedures, immunisations, and units.
- Configure RBAC, protected-record access, break-glass, patient release controls, and audit review.
- Test JSON, FHIR, and XML output with known patients before enabling partner access.