Home > API Usage > General Usage
General Usage
Refer to the Authentication page first. Your client must be authenticated before the server will accept any requests.
Resource Level Interactions
Bundle
Operation | Method | URL | Description | Scope |
---|---|---|---|---|
create | POST | /fhir/bundle | Upload a bundle for a single patient or visit. | write |
Usage
There is a single endpoint (/fhir/bundle) which accepts POST requests containing a json formatted FHIR bundle as the body.
The bundle and all resources it contains must conform to the profiles defined in this implementation guide.
Bundles must have type: document, and the first resource in the Bundle.entry field must be a Composition.
There are four types of Composition, each corresponding to a type of form on the SSR website.
Composition | Simplifier Link | Description |
---|---|---|
SSRNewPatient | SSR New Patient | Indicates the request is to upload a new patient. |
SSRBaselineVisit | SSR Baseline Visit | Indicates the request is to upload a new baseline visit. |
SSRFollowupVisit | SSR Followup Visit | Indicates the request is to upload a new follow up visit. |
SSRTreatmentVisit | SSR Treatment Visit | Indicates the request is to upload a new treatment-only visit. |
All requests must contain the Authorization
, Content-Type
and Host
http headers with their appropriate values.
Example Request
The following is an example of a request to the bundle endpoint, with most of the request body omitted.
For full examples of request bodies that can be used as templates or for testing purposes, see Examples.
POST /fhir/bundle HTTP/1.1
Host: frbresearch.org
Authorization: Bearer ABC123
Content-Type: application/json
{
"resourceType": "Bundle",
"type": "document",
...
}
Example Response (Success)
The following is an example of a response to a successful request to the bundle endpoint.
Response 201
{
"success": true
}
Example Response (Error)
The following is an example of a response to an unsuccessful request to the bundle endpoint.
Response 400
{
"success": false,
"message": "Validation error",
"errors": [
"Right baseline visit already recorded. Can't update or create another one for the same eye."
]
}