Skip to main content

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.

Link lifetime

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)

NameDescriptionRequiredType
patientInformation of the PatientYesPatient
languageCodeThe 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.Yesstring
textThe 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.Yesstring | null
sessionFlowUsed to create a session in a specific mode, eg. ExternallyInitiatedByProxy as a health care professional.YesSessionFlow
userIsPatientFalse if the patient isn't answering the questions themselves, for example a parent answers for a childnoboolean | null
overrideDemandManagementIf demand management should be disregarded and the session created even if closed or at capacityYesboolean
Demand Management?

Want to know more about demand management? Contact us and we will help you.

Patient

NameDescriptionTypeExample
ageThe age of the patient (range from 1 to 120).int | null22
sexThe biological sex of the patient.Sex | nullFemale

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 valueDescription
Male
Female
OtherThe 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 valueDescription
ExternallyInitiatedUse this if the Triage UI will be executed by a layman user (eg. patient)
ExternallyInitiatedByProxyUse this if the Triage UI will be executed by a healthcare professional user (eg. nurse or doctor)

Response

HTTP Status Codes

CodeDescription
200Success, returns a Session
400Bad request, invalid input
401Unauthorized, missing X-Red-Robin-API-Key header
403Forbidden, invalid X-Red-Robin-API-Key header
404Not found, invalid configuration

Session

NameDescriptionTypeExample
sessionIdThe identifier of the sessionuuid550e8400-e29b-41d4-a716-446655440000
patientEntryUrlThe URL to access the Triage UIstringhttps://example.com

Example Usage

POST /api/v1/session
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"
}