Class: Encounter

Encounter


new Encounter( [config] [, _triage] [, _locale])

This is a constructor for a service that manages an encounter summary with information gathered during each encounter.

Parameters:
Name Type Argument Description
config Configuration <optional>

The configuration object for this SCWebCore instance. If this is not provided, a new instance will be instantiated.

_triage Triage <optional>

The triage instance that should be used to assess triage options for this instance. If this is not provided, a new instance will be instantiated.

_locale Locale <optional>

The locale instance for localizing the getAgePretty return value. If this is not provided, a new instance will be instantiated.

Members


<inner> ageGroups :Array.<string>

The age groups which this instance should support. The first one listed will be the default when no age in days or param is provided.

Type:
  • Array.<string>

Methods


<inner> getAge()

Gets the age for the encounter, giving preference to the more specific value ageInDays to the ageGroup

Returns:

an age in days or 'adult', 'child' if age in days is undefined

Type
*

<inner> getAgeGroup()

Gets specifically the age group for the encounter

Returns:

'adult', 'child'

Type
string

<inner> getAgePretty()

If age in days is provided, it will return the age for the encounter as a string with the coresponding age group appended. If age in days is not provided it will return the age group 'adult' or 'child'.

Returns:

Localized string like 'x years old' if age in days is provided or the age group 'adult', 'child'.

Type
*

<inner> getSummary()

Gets the encounter summary that this service is managing

Returns:

The encounter summary that this service is managing

Type
EncounterSummary

<inner> removeSymptom(symptom)

Removes a symptom from summary.symptomsSelected and recalculates triage options, if it is the most acute symptom.

Parameters:
Name Type Description
symptom Symptom

The symptom that should be removed.

Returns:

The index of the symptom in summary.symptomsSelected, before it was removed. 0 indicates that the most acute symptom was deselected.

Type
number

<inner> removeSymptoms()

Remove all symptoms selected


<inner> resetSummary()

Create a new encounter summary. Applications should call this if they know of a change in symptom checker patient during the lifecycle of their SCWebCore instance.


<inner> searchPerformed(search)

Prepends a search string to summary.searchesPerformed indicating any searches performed.

Parameters:
Name Type Description
search string

The search string


<inner> selectBodyArea(bodyArea)

Prepends a body area string to summary.bodyAreasSelected. If the body area has already been selected it will be moved to the first position.

Parameters:
Name Type Description
bodyArea BodyArea

The selected body area

Returns:

The array of selected body area strings

Type
array

<inner> selectSymptom(symptom)

Pushes a symptom to summary.symptomsSelected. Preserves that summary.symptomsSelected is sorted by acuity.

Parameters:
Name Type Description
symptom Symptom

The selected symptom

Returns:

The array of selected symptoms for the encounter, sorted by disposition level, decreasing

Type
array

<inner> selectTriageOption(triageOption, any)

Select a triage option, performing the triage option callback or relocating to its url

Parameters:
Name Type Description
triageOption TriageOption

The selected triage option

any object

Any other argument you want to use in your TriageOption callback


<inner> setAge(ageGroupOrDays)

Set the Age of the encounter using an age group or an age in days

Parameters:
Name Type Description
ageGroupOrDays string

either 'adult', 'child', or an age in days e.g. '120'

Returns:

an age in days or 'adult', 'child' if age in days is undefined

Type
*

<inner> setGender(gender)

Sets the gender for the summary. When defined, summary.gender filters the experience for a particular gender.

Parameters:
Name Type Description
gender string

'male', 'female'

Returns:

'male', 'female', undefined

Type
*

<inner> setLocale(supportedLocale)

Set the summary locale to any supported locale.

Parameters:
Name Type Description
supportedLocale string

The locale you would like to set for.

Returns:

The new locale code set for the encounter

Type
string

<inner> topicViewed(topic, type)

Push topic to summary.topicsViewed

Parameters:
Name Type Description
topic object

Symptom Checker Topic object to grab the id and title from

type string

The type of topic that is provided

Returns:

Array of abbreviated topic objects

Type
Array.<object>