API Name: Composition.$retrieve


This API retrieves document Bundle(s) containing clinical compositions (Discharge Summary, ED Notes, OT Notes, Summary Notes and Cardiology Report) associated with a patient, identified by the patient's identifier.

Specification


Endpoint [baseurl]/Composition/$retrieve
Protocol HTTPS
HTTP Method GET
HTTP Header Accept: application/fhir+json

Request Parameters

Parameter Type Cardinality Description
patient.identifier token 1..1 The patient's identifier in system\|value format. Use https://fhir.synapxe.sg/NamingSystem/nric\|<NRIC>.
type token 0..1 Filter by composition type. Provide a LOINC code (e.g. http://loinc.org\|18842-5 for Discharge Summary).
date date 0..2 Filter by composition date. Supports ge and le prefixes for date range (e.g. ge2026-01-01&date=le2026-06-30).
_count number 0..1 Maximum number of results to return per page.

Composition Type Codes

Document Type System Code
Discharge Summary http://loinc.org 18842-5
ED Notes http://loinc.org 34878-9
OT Notes http://loinc.org 11506-3
Summary Notes http://loinc.org 60591-5
Cardiology Report http://loinc.org 11488-4

Example Request

GET [baseurl]/Composition/$retrieve?patient.identifier=https://fhir.synapxe.sg/NamingSystem/nric|S1234567A&type=http://loinc.org|18842-5

Successful Response

The response is a searchset Bundle containing the matching document Bundle(s), each conforming to the respective allowed profile.

Profile Name StructureDefinition StructureDefinition URL
Discharge Summary BundleDischargeSummary https://fhir.synapxe.sg/StructureDefinition/profile-bundle-dischargesummary
ED Notes BundleEDNotes https://fhir.synapxe.sg/StructureDefinition/profile-bundle-ednotes
OT Notes BundleOTNotes https://fhir.synapxe.sg/StructureDefinition/profile-bundle-otnotes
Command 'pagelink' could not render: Page not found.
Command 'link' could not render: Resource was not found for 'canonical=https://fhir.synapxe.sg/StructureDefinition/profile-bundle-summarynotes'
https://fhir.synapxe.sg/StructureDefinition/profile-bundle-summarynotes
Cardiology Report BundleCardiologyReport https://fhir.synapxe.sg/StructureDefinition/profile-bundle-cardiologyreport
{
"resourceType": "Bundle",
"type": "searchset",
"timestamp": "2026-02-06T14:00:00+08:00",
"total": 1,
"link": [
{
"relation": "self",
"url": "[baseurl]/Composition/$retrieve?patient.identifier=https://fhir.synapxe.sg/NamingSystem/nric|S1234567A&type=http://loinc.org|18842-5"
}
],
"entry": [
{
"fullUrl": "https://fhir.synapxe.sg/Composition/a5b7c8d9-e4f5-4a3b-8c6d-7e8f9a0b1c2d",
"resourceType": "Composition",
"id": "a5b7c8d9-e4f5-4a3b-8c6d-7e8f9a0b1c2d",
"meta": {
"lastUpdated": "2026-02-06T14:00:00.1+08:00"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/record-id",
"value": "DS-2026-02-06-001"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/accession-no",
"value": "ACC-DS-2026-02-06-001"
}
],
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "18842-5",
"display": "Discharge Summary"
}
]
},
"subject": [
{
"type": "Patient",
"system": "https://fhir.synapxe.sg/NamingSystem/nric",
"value": "S1234567A"
}
}
],
"date": "2026-02-06T14:00:00+08:00",
"author": [
{
"type": "Practitioner",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M12345"
}
}
],
"title": "Discharge Summary for John Doe - Acute Myocardial Infarction",
{
"mode": {
"coding": [
{
"system": "http://hl7.org/fhir/CodeSystem/composition-attestation-mode",
"code": "official",
"display": "Official"
}
]
},
"time": "2026-02-06T14:30:00+08:00",
"party": {
"type": "Practitioner",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M67890"
},
"display": "Dr. Michael Tan"
}
}
],
"type": "Organization",
"system": "https://fhir.synapxe.sg/NamingSystem/hci-code",
"value": "11234"
},
"display": "Singapore General Hospital"
}
},
"search": {
"mode": "match"
}
}
]
}
{
"resourceType": "Bundle",
"type": "searchset",
"timestamp": "2026-03-19T11:45:00+08:00",
"total": 1,
"link": [
{
"relation": "self",
"url": "[baseurl]/Composition/$retrieve?patient.identifier=https://fhir.synapxe.sg/NamingSystem/nric|S5432109C&type=http://loinc.org|34878-9"
}
],
"entry": [
{
"fullUrl": "https://fhir.synapxe.sg/Composition/ednotes-composition-ed-002",
"resourceType": "Composition",
"id": "ednotes-composition-ed-002",
"meta": {
"lastUpdated": "2026-03-19T11:45:00.1+08:00"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/record-id",
"value": "ED-REC-2026-02001"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/accession-no",
"value": "ED-ACC-2026-02001"
}
],
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "15507-7",
"display": "Emergency department Progress note"
}
]
},
"subject": [
{
"type": "Patient",
"system": "https://fhir.synapxe.sg/NamingSystem/nric",
"value": "S5432109C"
}
}
],
"date": "2026-03-19T11:45:00+08:00",
"author": [
{
"type": "Practitioner",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M67890"
}
}
],
"title": "Emergency Department (ED) Notes",
"type": "Organization",
"system": "https://fhir.synapxe.sg/NamingSystem/hci-code",
"value": "TTSH"
}
}
},
"search": {
"mode": "match"
}
}
]
}
{
"resourceType": "Bundle",
"type": "searchset",
"timestamp": "2026-02-09T15:45:00+08:00",
"total": 1,
"link": [
{
"relation": "self",
"url": "[baseurl]/Composition/$retrieve?patient.identifier=https://fhir.synapxe.sg/NamingSystem/nric|S1234567C&type=http://loinc.org|11506-3"
}
],
"entry": [
{
"fullUrl": "https://fhir.synapxe.sg/Composition/otnotes-001",
"resourceType": "Composition",
"id": "otnotes-001",
"meta": {
"lastUpdated": "2026-02-09T15:45:00.1+08:00"
},
{
"url": "https://fhir.synapxe.sg/StructureDefinition/ext-displayMethod",
"valueString": "OT Clinical Documentation System"
}
],
{
"system": "https://fhir.synapxe.sg/NamingSystem/record-id",
"value": "OT-REC-2026-00123"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/accession-no",
"value": "OT-ACC-2026-00123"
}
],
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "11504-8",
"display": "Surgical operation note"
}
]
},
"subject": [
{
"type": "Patient",
"system": "https://fhir.synapxe.sg/NamingSystem/nric",
"value": "S1234567C"
}
}
],
"date": "2026-02-09T14:30:00+08:00",
"author": [
{
"type": "Practitioner",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M12345"
}
}
],
"title": "Operating Theatre (OT) Notes",
"type": "Organization",
"system": "https://fhir.synapxe.sg/NamingSystem/hci-code",
"value": "HCI-12345"
}
}
},
"search": {
"mode": "match"
}
}
]
}
{
"resourceType": "Bundle",
"type": "searchset",
"timestamp": "2026-03-19T14:30:00+08:00",
"total": 1,
"link": [
{
"relation": "self",
"url": "[baseurl]/Composition/$retrieve?patient.identifier=https://fhir.synapxe.sg/NamingSystem/nric|S7654321B&type=http://loinc.org|60591-5"
}
],
"entry": [
{
"fullUrl": "https://fhir.synapxe.sg/Composition/a3f5c8d2-1e4b-4a7f-9b2c-6d8e0f3a5b7c",
"resourceType": "Composition",
"id": "a3f5c8d2-1e4b-4a7f-9b2c-6d8e0f3a5b7c",
"meta": {
"lastUpdated": "2026-03-19T14:30:00.1+08:00"
},
{
"url": "https://fhir.synapxe.sg/StructureDefinition/ext-recorder",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M88888"
}
}
],
{
"system": "https://fhir.synapxe.sg/NamingSystem/record-id",
"value": "SN-REC-2026-01001"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/accession-no",
"value": "SN-ACC-2026-01001"
}
],
"status": "final",
"type": {
"coding": [
{
"system": "http://loinc.org",
"code": "18761-7",
"display": "Transfer summary note"
}
]
},
"subject": [
{
"type": "Patient",
"system": "https://fhir.synapxe.sg/NamingSystem/nric",
"value": "S7654321B"
}
}
],
"date": "2026-03-19T14:30:00+08:00",
"author": [
{
"type": "Practitioner",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M88888"
}
}
],
"title": "Summary Notes"
},
"search": {
"mode": "match"
}
}
]
}
{
"resourceType": "Bundle",
"type": "searchset",
"timestamp": "2026-02-06T10:30:00+08:00",
"total": 1,
"link": [
{
"relation": "self",
"url": "[baseurl]/Composition/$retrieve?patient.identifier=https://fhir.synapxe.sg/NamingSystem/nric|S9876543A&type=http://loinc.org|11488-4"
}
],
"entry": [
{
"fullUrl": "https://fhir.synapxe.sg/Composition/3a7b9c2d-4e5f-4a1b-8c6d-9e0f1a2b3c4d",
"resourceType": "Composition",
"id": "3a7b9c2d-4e5f-4a1b-8c6d-9e0f1a2b3c4d",
"meta": {
"lastUpdated": "2026-02-06T10:30:00.1+08:00"
},
{
"url": "https://fhir.synapxe.sg/StructureDefinition/ext-displayMethod",
"valueString": "html"
}
],
{
"system": "https://fhir.synapxe.sg/NamingSystem/record-id",
"value": "CARDIO-2026-02-06-001"
},
{
"system": "https://fhir.synapxe.sg/NamingSystem/accession-no",
"value": "ACC-2026-02-06-001"
}
],
"status": "final",
"type": {
"coding": [
{
"system": "https://fhir.synapxe.sg/CodeSystem/nehr-doc-types",
"code": "CARDIOLOGY",
"display": "Cardiology Report"
}
]
},
"subject": [
{
"type": "Patient",
"system": "https://fhir.synapxe.sg/NamingSystem/nric",
"value": "S9876543A"
}
}
],
"date": "2026-02-06T10:30:00+08:00",
"author": [
{
"type": "Practitioner",
"system": "https://fhir.synapxe.sg/NamingSystem/mcr",
"value": "M12345"
}
}
],
"title": "Cardiology Report"
},
"search": {
"mode": "match"
}
}
]
}

Business Level Errors


This section details the business level errors exposed by OperationOutcome resource for this operation. Refer to API Error Handling for framework level errors.

For illustration only

http status code code details.coding.code details.text
404 not-found E-10000 No matching patient found based on NRIC, Date of Birth and Gender
404 not-found E-10001 Institution code for organization is not found
404 not-found E-10002 Organization code is not found
400 business-rule E-10003 Patient is not currently enrolled to the organization
400 duplicate E-10004 An attempt was made to create a duplicate record
400 invalid E-10005 Invalid allergy intolerance identifier
400 invalid E-10006 Invalid clinical or verification status