Extending Triage Options

In some cases you might want to add additional triage options to the default set. This is easy to accomplish using SCWebCore.triage.extendTriageOptions. Just call it and provide an array of objects conforming to the TriageOption interface. This step needs to be performed before any symptoms are selected for the provided triage options to apply.

Declare your triage option by providing json that conforms to the TriageOption model. For information on triage options, their properties and examples of how to declare them, see Defining Triage Options.

SCWebCore.triage.extendTriageOptions([{
    'level_min': 0,
    'level_max': 90,
    'button_text': 'See MD Connect Doctor Now',
    'button_class': 'fa-video-camera',
    'icon': 'fa fa-asterisk',
    'url': 'https://www.appcatalyst.com/app-catalyst/'
}])

Extending triage options is an easy way to add additional triage options to the defaults defined by SCWebCore.triage. It is important to remember that the order in which the triage options are defined determines their priority when they are matched against a symptom. In order to declare triage options that take priority over the default triage options, you will need to override the default triage options. For more information on overriding triage options see Overriding Triage Options.

Example Implementation

In the example angular application, the ideal place to extendTriageOptions is during the angular module's run block.

Run blocks are the closest thing in Angular to the main method. A run block is the code which needs to run to kickstart the application. It is executed after all of the services have been configured and the injector has been created. - ngModule

We do this in our app/config.js file. The following snippet is responsible for adding an additional triage option that matches all of the questions from disposition level 0-90 and present a button for a virtual appointment. This is just a demonstration of this feature, pressing the button opens appcatalyst.com.

angular.module('core').run(['SCWebCore', function(SCWebCore) {
    SCWebCore.triage.extendTriageOptions([{
        'level_min': 0,
        'level_max': 90,
        'button_text': 'See MD Connect Doctor Now',
        'button_class': 'fa-video-camera',
        'icon': 'fa fa-asterisk',
        'url': 'https://www.appcatalyst.com/app-catalyst/'
    }])
}])