Skip to content

Commit

Permalink
removes the episode date deprecation warnings for date of episode, da…
Browse files Browse the repository at this point in the history
…te of admission, date of discharge
  • Loading branch information
fredkingham committed Apr 4, 2018
1 parent f83cc48 commit 06e6b4c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
19 changes: 0 additions & 19 deletions opal/static/js/opal/services/episode.js
Expand Up @@ -20,25 +20,6 @@ angular.module('opal.services')
var date_fields = ['start', 'end'];

Episode.prototype = {
get discharge_date(){
throw "Discharge date is deprecated in opal 0.9.0, use end";
},
set discharge_date(x){
throw "Discharge date is deprecated in opal 0.9.0, use end";
},
get date_of_admission (){
throw "Date of admission is deprecated in opal 0.9.0, use start";
},
set date_of_admission (x){
throw "Date of admission is deprecated in opal 0.9.0, use start";
},
get date_of_episode (){
throw "Date of episode is deprecated in opal 0.9.0, use start";
},
set date_of_episode (x){
throw "Date of episode is deprecated in opal 0.9.0, use start";
},

// Constructor to update from attrs and parse datish fields
initialise: function(data){
var self = this;
Expand Down
42 changes: 0 additions & 42 deletions opal/static/js/test/episode.service.test.js
Expand Up @@ -125,48 +125,6 @@ describe('Episode', function() {
expect(episode.start.toDate()).toEqual(new Date(2013, 10, 19));
});

it('Should raise an error if they try to get discharge date', function(){
var shouldThrow = function(){episode.discharge_date; };
expect(shouldThrow).toThrow(
"Discharge date is deprecated in opal 0.9.0, use end"
);
});

it('Should raise an error if they try to set discharge date', function(){
var shouldThrow = function(){episode.discharge_date = "as";}
expect(shouldThrow).toThrow(
"Discharge date is deprecated in opal 0.9.0, use end"
);
});

it('Should raise an error if they try to set date of admission', function(){
var shouldThrow = function(){episode.date_of_admission = "as";}
expect(shouldThrow).toThrow(
"Date of admission is deprecated in opal 0.9.0, use start"
);
});

it('Should raise an error if they try to get date of admission', function(){
var shouldThrow = function(){episode.date_of_admission; };
expect(shouldThrow).toThrow(
"Date of admission is deprecated in opal 0.9.0, use start"
);
});

it('Should raise an error if they try to get date of episode', function(){
var shouldThrow = function(){episode.date_of_episode = "as";}
expect(shouldThrow).toThrow(
"Date of episode is deprecated in opal 0.9.0, use start"
);
});

it('Should raise an error if they try to set date of episode', function(){
var shouldThrow = function(){episode.date_of_episode; };
expect(shouldThrow).toThrow(
"Date of episode is deprecated in opal 0.9.0, use start"
);
});

it('should create Items', function() {
expect(episode.demographics.length).toBe(1);
expect(episode.diagnosis.length).toBe(2);
Expand Down

0 comments on commit 06e6b4c

Please sign in to comment.