Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes the unused getNumberOfItems method from episode as this is ne… #1765

Merged
merged 1 commit into from Aug 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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