SCWebCore Encounter offers an api that captures key elements of a user's interaction with the symptom checker. It is designed to produce a summary of the symptom check. This summary contains any relevant triage information that can be captured from the encounter.
To maintain an encounter summary, your application needs to report important events to SCWebCore.encounter
. For example when your user indicates that they are selecting symptoms for an adult, you should call:
SCWebCore.encounter.setAge("adult")
This will set the age group in the encounter summary. The next time that you request an encounter summary with Encounter.getSummary you will see that the summary says that the user's ageGroup is adult.
Anytime a user does any of the following actions, your application should call the corresponding function on Encounter:
- indicates an age or age group
- indicates a gender
- views a topic
- selects a symptom
- deselects a symptom
- selects a triage option
- performs a search
- selects a body area
The benefit of doing this is being able to request an up to date encounter summary at any point in your symptom checker application's lifecycle. The encounter interface ensures some logic that is essential to quality triage. It maintains that the array of symptoms selected is sorted by acuity such that the first symptom listed is always the most acute. It also maintains that triage options are offered based upon the most acute selected symptom. Without the encounter interface, it would be easy to make a mess of this essential information and put your users health at risk.
Example Implementation
In our example application, the Encounter interface is used from the view model wherever user interaction is handled. In our view model for the symptom checker topic app/controllers/symptom.controller.js
you can find the following code block for handling a user's symptom selection.
vm.selectSymptom = function(_question, disposition) {
...
var symptom = SCWebCore.makeSymptom(_question, disposition, topic);
SCWebCore.encounter.selectSymptom(symptom);
};
Here you can see how SCWebCore can be used to create a symptom from the selected question, its disposition and the current topic. The symptom selection is then added to the encounter summary through SCWebCore.encounter.selectSymptom. Next time we check the encounter summary, we will see the selected symptom there.