Skip to content

Commit

Permalink
removes the unused getNumberOfItems method from episode as this is ne…
Browse files Browse the repository at this point in the history
…ver used
  • Loading branch information
fredkingham committed Aug 19, 2019
1 parent 934728b commit 7bdd13a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
2 changes: 2 additions & 0 deletions changelog.md
Expand Up @@ -5,6 +5,8 @@
Removes the function Episode.isDischarged() (This was rarely if ever used,
and no longer an accurate represenation of dischargedness.)

Removes the Episode.getNumberOfItems method which is rarely used.

Removes the methods PatientDetailCtrl.dischargeEpisode() and PatientListCtrl.dischargeEpisode()
(However you're discharging episodes as of 0.17 it would be strongly unadvisable to do it this way.)

Expand Down
4 changes: 0 additions & 4 deletions opal/static/js/opal/services/episode.js
Expand Up @@ -60,10 +60,6 @@ angular.module('opal.services')
return this.demographics[0].first_name + ' ' + this.demographics[0].surname;
},

getNumberOfItems: function(columnName) {
return this[columnName].length;
},

// Getter function to return active episode tags.
// Default implementation just hits tagging
getTags: function(){
Expand Down
8 changes: 1 addition & 7 deletions opal/static/js/test/episode.service.test.js
Expand Up @@ -144,11 +144,6 @@ describe('Episode', function() {
expect(episode.getFullName()).toEqual('John Smith');
});

it('should know how many items it has in each column', function() {
expect(episode.getNumberOfItems('demographics')).toBe(1);
expect(episode.getNumberOfItems('diagnosis')).toBe(2);
});

it('getTags() should get the current tags', function(){
expect(episode.getTags()).toEqual(['mine', 'tropical']);
});
Expand Down Expand Up @@ -192,9 +187,8 @@ describe('Episode', function() {
episode,
opalTestHelper.getRecordLoaderData().diagnosis
);
expect(episode.getNumberOfItems('diagnosis')).toBe(2);
episode.addItem(item);
expect(episode.getNumberOfItems('diagnosis')).toBe(3);
expect(_.last(episode.diagnosis).id).toBe(104)
});

it('should addItems() for items without an entry on episode', function() {
Expand Down

0 comments on commit 7bdd13a

Please sign in to comment.