Skip to main content

Read Resource

The FHIR read operation allows you to retrieve a specific resource instance by its ID from the FHIR server. This is done using an HTTP GET request to the endpoint corresponding to the resource type and ID.

Read a Patient resource using the Haste Health CLI:

haste-health api read Patient 12345

This command retrieves the Patient resource with ID 12345 and outputs the result to the console.

Replace [tenant] with your tenant name and [project] with your project ID.

Error Handling

If the resource is not found, the server will respond with a 404 Not Found status code and include an OperationOutcome resource in the response body.

HTTP/1.1 404 Not Found
Content-Type: application/fhir+json
{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "not-found",
"diagnostics": "Resource Patient/12345 not found"
}
]
}