Skip to main content

Professional Interface

The professional interface is where the healthcare professional can review and evaluate the case. The interface should be loaded as a frame within another system. The interface should be loaded using the RRDS Manager, but for legacy reasons, the API also provides a URL to the interface for self controlled implementation.

Sizing

The decision support will adjust between one and two column mode. One column is displayed up to 800px, then it will switch to two columns. The manager will automatically adjust the height of the iframe to ensure all content is visible without a scroll. If you wish to limit the hight of the decision support, you can do so by wrapping it and limiting the height. The interface should not be shown in a smaller width than 500px.

Authentication

The use authenticates using a token retrieved from the API. The token for the decision support is valid for 5 minutes. During that time it can be exchanged using the RRDS Manager. When the token is exchanged a cookie is created for the used. As long as the decision support is open the cookie will be kept alive for up to 5 hours. If for any reason the cookie gets invalidated, a new token needs to be fetched through the API.

RRDS Manager

The RRDS Manager will ensure a good experience for you users. It will ensure that the file viewer and other popups are loaded correctly and that the user can interact with the decision support.

When initiating the Manager you will get acces to a RRDS Manager Instance. The instance exposes a few methods and events that can be used to interact with the decision support. These are:

Instance options (RRDSManagerSpecSettings)

  • lang
    • Language code for the interface
    • Default: account configuration
    • Type: en | sv | fi | no
  • showFileViewerDownloadButton
    • Show download button in file viewer
    • Default: false
    • Type: boolean

destroy()

  • Purpose: Cleanup manager instance
  • Usage: Call when removing the interface
  • Returns: void

on(eventName, callback)

  • Purpose: Subscribe to interface events
  • Events:
    • loaded
      • Purpose: Fired when interface is fully initialized
  • Returns: void

action(actionName, data)

  • Purpose: Trigger interface actions
  • Available actions:
    • OpenEvaluation
      • Purpose: Opens evaluation popup
      • Parameters: { ignoreIfSubmitted?: boolean }
      • Returns: Promise<'AlreadySubmitted' | 'Submitted' | 'Skipped'>

Using the RRDS Manager

To use the RRDS Manager, you need to include the script in your application. The url for the script is provided in the API response. Please always use the URL provided in the API response to ensure you are using the correct version of the manager. Ensure to only load the script once.

Example implementation: Markup
<div id="RRDSCONTAINER"></div>
Example implementation: Typescript Code
// Get the decision support token and script url
const sessionId = 'my-sesion-id';
const response = await fetch(
`https://se.visibatriage.com/api/v1/session/${sessionId}/decisionSupportLink?auditUserIdentifier=a-user-identifier`,
{
method: 'GET',
headers: { 'Content-Type': 'application/json', 'X-Red-Robin-API-Key': 'API_KEY' },
},
);
const data = response.ok ? await response.json() : await response.text();

if (!response.ok) return;

const { token, managerScriptUrl } = data;

async function loadScript(url: string): Promise<void> {
return new Promise((resolve, reject) => {
const script = document.createElement('script');
script.type = 'text/javascript';
script.src = url;

script.onload = () => {
resolve();
};

script.onerror = () => {
reject(new Error(`Failed to load script: ${url}`));
};

document.head.appendChild(script);
});
}

// Load script only if not loaded
if (typeof RRDSManagerInit === 'undefined') {
await loadScript(managerScriptUrl);
}

const id = 'RRDSCONTAINER';
const instance = RRDSManagerInit(id, token, {
lang: 'en',
showFileViewerDownloadButton: true,
});

// Trigger evaluation popup
const result = await rrds.action('OpenEvaluation', { ignoreIfSubmitted: true });

// Listed to loaded event
rrds.on('loaded', (event) => {});

// Destroy the instance when leaving the page
instance.destroy();

RRDS Manager Types

There are currently no automatically generated types, but the following can be included in you application to help with the implementation.

RRDSManagerInstance
declare function RRDSManagerInit(targetElement: string, token: string, settings?: RRDSManagerSpecSettings): RRDSManagerInstance;
type RRDSManagerExposedEventName = 'loaded';
type RRDSManagerEvents = {
loaded: {
event: 'loaded';
instanceId: string;
data?: never;
};
};
type RRDSManagerSpecSettings = {
lang?: string;
showFileViewerDownloadButton?: boolean;
};
export type OpenEvaluationActionResult = 'AlreadySubmitted' | 'Submitted' | 'Skipped';
export interface RRDSManagerInstance {
destroy: () => void;
on: <T extends RRDSManagerExposedEventName>(event: T, callback: (eventData: RRDSManagerEvents[T]) => void) => void;

action: (action: 'OpenEvaluation', data: { ignoreIfSubmitted?: boolean }) => Promise<OpenEvaluationActionResult>;
}

Legacy implementation Deprecated

Direct URL implementation is available but not recommended. Use RRDS Manager for optimal integration.

Language Configuration

Set interface language using the languageCode query parameter:

https://se.visibatriage.com/decision-support/123?languageCode=en