The Episode service

The Episode service in opal.services provides us with core functionality related to interacting with episodes in the client.

Constructor

The Episode service is instantiated with the Episode data that comes back from the Episode JSON API.

var episode = new Episode(json_data);

Methods

Episode.getTags

Return a list of the current tags this episode has as strings.

episode.getTags();
// ['mine', 'infectioncontrol']

Episode.hasTag

Predicate function that determines whether the episode is tagged with a given tag.

Arguments:

Episode.newItem

Instantiate a new subrecord for this episode of a given type.

Arguments:

Example usage:

episode.newItem('diagnosis');
// item (an Item() instance.