Skip to content

Commit

Permalink
Merge pull request #1599 from openhealthcare/1597-remove-jump-to-epis…
Browse files Browse the repository at this point in the history
…ode-from-search

1597 remove jump to episode from search
  • Loading branch information
davidmiller committed Oct 8, 2018
2 parents e335dd7 + 8c14c51 commit e5fb95e
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 51 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### 0.13.0 (Major Release)

#### Removes scope.jumpToEpisode and scope.getEpisodeId from Search and Extract

We no longer use these functions, instead we use an HTML link to the patient detail view.

#### Removes Patient.to_dict().active_episode_id

Expand Down
5 changes: 0 additions & 5 deletions opal/core/search/static/js/search/controllers/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,4 @@ angular.module('opal.controllers').controller(
$scope.filters.push(result);
});
};

$scope.jumpToEpisode = function(episode){
window.open('#/episode/'+episode.id, '_blank');
};

});
9 changes: 0 additions & 9 deletions opal/core/search/static/js/search/controllers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,4 @@ angular.module('opal.controllers').controller(

$window.location.href = searchUrl + '/#/' + "?" + $.param(params);
};

$scope.getEpisodeID = function(patient){
return _.first(_.keys(patient.episodes));
};

$scope.jumpToEpisode = function(patient){
$location.path('/episode/'+$scope.getEpisodeID(patient));
};

});
10 changes: 0 additions & 10 deletions opal/core/search/static/js/test/extract.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,16 +768,6 @@ describe('ExtractCtrl', function(){

});

describe('jumpToEpisode()', function() {

it('should open the tab', function() {
spyOn($window, 'open');
$scope.jumpToEpisode({id: 2});
expect($window.open).toHaveBeenCalledWith('#/episode/2', '_blank');
});

});

describe('Getting searchable columns', function(){
it('should only get the columns that are advanced searchable', function(){
expect($scope.columns).toEqual([
Expand Down
27 changes: 0 additions & 27 deletions opal/core/search/static/js/test/search.controller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,31 +169,4 @@ describe('SearchCtrl', function (){
$httpBackend.flush();
});
});

describe('getEpisodeId', function() {

it('should use the first episode', function() {
var patient = {
episodes: {
42: {}, //dummy episode
8738: {} // another dummy episode
}
}
expect($scope.getEpisodeID(patient)).toEqual('42');
});

});

describe('jumpToEpisode()', function (){
it('Should call location.path()', function () {
$scope.jumpToEpisode({
episodes: {
555: {},
8492: {}
}
});
expect(location.path).toHaveBeenCalledWith('/episode/555');
});
});

});

0 comments on commit e5fb95e

Please sign in to comment.