API - Get Composition
This API retrieves a Composition resource.
Scope
This transaction involves the requestor sending a GET request to the FHIR service to retrieve the Composition resource based on the id.
Upon successful retrieval, the FHIR Service returns an HTTP response code (i.e 2xx) and a Composition resource.
For unsuccessful retrieval, the FHIR Service returns an HTTP response code (i.e 4xx or 5xx) and an OperationOutcome resource.
Interaction Diagram
Specification
The Get Composition FHIR specification is based on the HL7 FHIR R5 RESTful read API. (Ref: https://www.hl7.org/fhir/http.html)
Invocations
GET [base]/Composition/{id}
The Get Composition Request will retrieve a Composition resource from AWS S3 in the form of a json file. The get interaction is performed by an HTTP GET command.
Example
Type | Value |
---|---|
Method | GET |
Headers | Content-Type: application/fhir+json |
URL | [base]/Composition/12345678 |
Message Response
Depending on the HTTP Status Code, the following resources will be sent back to the requestor.
HTTP Status Code | Example |
---|---|
201 Created | { "resourceType": "Composition", "id": "1", "meta": { "lastUpdated": "2024-08-06T18:02:08.865+08:00" }, "status": "final", "type": { "coding": [ { "system": "http://ihis.sg/cs/document-type", "code": "ccda" } ] }, "category": [ { "coding": [ { "system": "http://ihis.sg/cs/ccda-data-group", "code": "lab-report" } ] } ], "subject": { "display": "SGVsbG8sIFdvcmxkIQ" }, "date": "2023-10-01T12:00:00Z", "author": [ { "type": "Organization", "identifier": { "system": "http://ihis.sg/identifier/institution-code", "value": "ttsh" } } ], "title": "/lab-report/SGVsbG8sIFdvcmxkIQ", "contained": [ { "resourceType": "Observation", "id": "Observation1", "status": "final", "code": { "coding": [ { "system": "http://ihis.sg/cs/ccda-data-entry", "code": "entry1" } ] }, "valueQuantity": { "value": 123, "unit": "mmol/L", "system": "http://unitsofmeasure.org", "code": "mmol/L" } }, { "resourceType": "Observation", "id": "Observation2", "status": "final", "code": { "coding": [ { "system": "http://ihis.sg/cs/ccda-data-entry", "code": "entry2" } ] }, "valueDateTime": "2023-10-01T12:00:00Z" } ], "section": [ { "code": { "coding": [ { "system": "http://ihis.sg/cs/ccda-data-section", "code": "section1" } ] }, "entry": [ { "reference": "#Observation1" } ] }, { "code": { "coding": [ { "system": "http://ihis.sg/cs/ccda-data-section", "code": "section2" } ] }, "entry": [ { "reference": "#Observation2" } ] } ] } |
4xx, 5xx | { "resourceType": "OperationOutcome", "id": "notfound", "issue": [ { "severity": "error", "code": "not-found", "details": { "coding": [ { "system": "http://fhir.synapxe.sg/api-operation-outcome", "code": "E-10000" } ], "text": "No matching resource found based on id" } } ] } |
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 resource found based on id |