Health Gorilla implements FHIR $everything operation that can be used to retrieve all the information related to the given patient.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
The $everything operation retrieves available patient-scoped FHIR R4 resources associated with a specified patient identifier. It returns the patient’s available record as a FHIR Bundle, including the Patient resource and related resources available to the authorized user.
For migration and record retrieval workflows, $everything provides a patient-level export of structured FHIR data in a single transaction pattern. The response may include both resources that directly reference the patient and supporting resources required to preserve clinical context and inter-resource references.
Errors are returned as FHIR OperationOutcome resources.
The operation conforms to HL7 FHIR R4. OAuth 2.0 authentication is required before invoking the operation.
Base URL and Environment
The base URL is environment-specific. Separate base URLs are provided for sandbox and production environments.
Example base URLs
https://sandbox.healthgorilla.com/fhir/R4/
https://api.healthgorilla.com/fhir/R4/
All requests use the versioned FHIR R4 path structure:
/fhir/R4/
All requests require OAuth 2.0 authentication. Your system must obtain an access token and include it in the request header:
Authorization: Bearer YOUR_ACCESS_TOKEN
Required scopes are enforced according to your organization’s configuration.
Request Syntax
Use the following syntax to invoke the $everything operation.
Required Components
- Method:
GET - Path:
/fhir/R4/Patient/{PATIENT_ID}/$everything - Headers:
Authorization: Bearer YOUR_ACCESS_TOKEN
Accept: application/fhir+json
Example Request
curl -X GET \
'https://sandbox.healthgorilla.com/fhir/R4/Patient/12345/$everything' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Accept: application/fhir+json'Optional Query Parameters
Optional query parameters can filter returned resources and control response size.
Resource Filtering
Use the following parameters to limit returned resources:
| Parameter | Description |
|---|---|
_type | Comma-separated list of FHIR resource types |
start | Inclusive lower bound for clinically relevant date |
end | Inclusive upper bound for clinically relevant date |
_since | Returns resources modified after the specified timestamp |
_count | Limits the maximum number of resources returned per page |
Parameter formats:
startandenduse ISO 8601 date format (YYYY-MM-DD)_sinceuses ISO 8601 dateTime format (YYYY-MM-DDThh:mm:ssZ)
The start and end parameters apply to clinically relevant care dates rather than resource update timestamps.
Filtering Example
curl -X GET \
'https://sandbox.healthgorilla.com/fhir/R4/Patient/12345/$everything?_type=Patient,Encounter,Observation,Condition&_count=100&start=2024-01-01&end=2024-12-31' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Accept: application/fhir+json'Pagination Controls
Use _count to request the maximum number of resources returned per page, subject to server limits.
When pagination links are returned, follow the link[relation="next"] URL exactly as provided. Do not construct pagination requests manually.
Response Behavior
When the request succeeds, Health Gorilla returns:
HTTP 200 OK
Content-Type: application/fhir+json
Body:
FHIR Bundle
The response Bundle contains the Patient resource and related resources associated with that patient.
The response may include:
entry[]: Patient-scoped FHIR resourceslink[]: Pagination linkslink[relation="next"]: Present when additional pages are availabletotal: Total number of matching resources, when supported
If the specified patient identifier does not exist, the server returns: 404 Not Found.
If the patient exists but no associated resources are available, the server may return a Bundle with an empty entry[] array.
Example Response
{
"resourceType": "Bundle",
"id": "example-everything-response",
"type": "searchset",
"total": 3,
"entry": [
{
"fullUrl": "https://sandbox.healthgorilla.com/fhir/R4/Patient/12345",
"resource": {
"resourceType": "Patient",
"id": "12345",
"name": [
{
"family": "Doe",
"given": ["Jane"]
}
],
"gender": "female",
"birthDate": "1985-06-15"
}
}
]
}Data Scope
The $everything operation returns FHIR R4 resources associated with the specified patient. Resource types may include:
- Encounter
- Condition
- Observation
- MedicationRequest
- MedicationStatement
- AllergyIntolerance
- DiagnosticReport
- Immunization
- Procedure
- CarePlan
- Goal
- ServiceRequest
- Coverage
- DocumentReference
- FamilyMemberHistory
Returned resources preserve references between related resources.
The response may also include resources that do not directly reference the Patient but are required to satisfy references from patient-associated resources, such as:
- Practitioner
- Organization
- Location
Error Handling
Errors are returned as FHIR OperationOutcome resources.
Possible HTTP status codes include:
400 Bad Request401 Unauthorized403 Forbidden404 Not Found410 Gone429 Too Many Requests500 Internal Server Error
Example Error Response
HTTP/1.1 404 Not Found
Content-Type: application/fhir+json{
"resourceType": "OperationOutcome",
"issue": [
{
"severity": "error",
"code": "not-found",
"diagnostics": "Patient 12345 was not found."
}
]
}For transient failures such as 429 or 500, exponential backoff is recommended.
Operational Considerations
When implementing the $everything operation, consider the following:
- Rate limits may apply based on your organization’s configuration
- Filtering parameters reduce dataset size and improve performance
- Large patient records may result in paginated responses
- Returned data reflects the patient record available in Health Gorilla at the time the request is processed
Note: Large
$everythingrequests may take significant time to process. If a request exceeds approximately 60 seconds, it may time out at the communication layer and return an HTTP504response. To reduce the likelihood of timeouts, use filtering parameters such as_type,start,end, or_since, and paginate results using_count.

