Create a new Triage Session
POST /api/v1/session
Description
Creates a Triage Session and returns a URL that will be used by the client to access the Triage UI. The Session ID shall be stored in the external system to be able to connect the session to a specific client.
The link is valid for up to 24 hours. The default lifetime is set to 30 minutes and can be extended upon request by contacting us.
Sizing
The application has two view modes, when on a mobile device or a screen width at or below 640px it will take the full width. For screens above 640px, it will be displayed inside a container and a background will be added.
Follow the example for the completion event to listen to the event.
Request Parameters (body)
| Name | Description | Required | Type |
|---|---|---|---|
patient | Information of the Patient | Yes | Patient |
languageCode | The ISO 639-1 language code of the parameter text. This will also toggle the Triage UI language. Available values: sv, no, fi, and en is available. | Yes | string |
text | The initial description of the patient history, which will be analysed by the Triage NLP to suggest presenting complaint(s). This will be presented to and editable by the user in the Triage UI. | Yes | string | null |
sessionFlow | Used to create a session in a specific mode, eg. ExternallyInitiatedByProxy as a health care professional. | Yes | SessionFlow |
userIsPatient | False if the patient isn't answering the questions themselves, for example a parent answers for a child | no | boolean | null |
overrideDemandManagement | If demand management should be disregarded and the session created even if closed or at capacity | Yes | boolean |
Want to know more about demand management? Contact us and we will help you.
Patient
| Name | Description | Type | Example |
|---|---|---|---|
age | The age of the patient (range from 1 to 120). | int | null | 22 |
sex | The biological sex of the patient. | Sex | null | Female |
Enums
The API will handle both the number value and the name as input.
Sex
It's important to remember that this is the biological sex of the patient, to ask the correct questions.
| String value | Description |
|---|---|
Male | |
Female | |
Other | The Triage UI will show information to the user why we ask for the biological sex, but the user can still proceed with this option |
Session flow
| String value | Description |
|---|---|
ExternallyInitiated | Use this if the Triage UI will be executed by a layman user (eg. patient) |
ExternallyInitiatedByProxy | Use this if the Triage UI will be executed by a healthcare professional user (eg. nurse or doctor) |
Response
HTTP Status Codes
| Code | Description |
|---|---|
| 200 | Success, returns a Session |
| 400 | Bad request, invalid input |
| 401 | Unauthorized, missing X-Red-Robin-API-Key header |
| 403 | Forbidden, invalid X-Red-Robin-API-Key header |
| 404 | Not found, invalid configuration |
Session
| Name | Description | Type | Example |
|---|---|---|---|
sessionId | The identifier of the session | uuid | 550e8400-e29b-41d4-a716-446655440000 |
patientEntryUrl | The URL to access the Triage UI | string | https://example.com |
Example Usage
- Javascript
const headers = new Headers();
headers.append('X-Red-Robin-API-Key', 'API_KEY');
headers.append('Content-Type', 'application/json');
const body = {
patient: {
sex: 'Male',
age: 20,
},
languageCode: 'en',
text: 'I have a fever',
sessionFlow: 'ExternallyInitiated',
userIsPatient: false,
overrideDemandManagement: false,
};
const requestOptions = {
method: 'POST',
headers: headers,
body: JSON.stringify(body),
};
fetch('https://se.visibatriage.com/api/v1/session', requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
Example Success Response
{
"sessionId": "550e8400-e29b-41d4-a716-446655440000",
"patientEntryUrl": "https://example.com"
}