Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Resolves #48
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed May 6, 2015
1 parent c3983e3 commit 8c0abaa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/patients/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,14 @@ export default AbstractEditController.extend(BloodTypes, GenderList, PouchAdapte
},

newVisit: function() {
var newVisit = this.get('store').createRecord('visit', {
startDate: new Date(),
patient: this.get('model')
});
var lastVisit = this.get('visits.lastObject'),
newVisit = this.get('store').createRecord('visit', {
startDate: new Date(),
patient: this.get('model')
});
if (!Ember.isEmpty(lastVisit)) {
newVisit.setProperties(lastVisit.getProperties('primaryDiagnosis','primaryBillingDiagnosis'));
}
this.transitionToRoute('visits.edit', newVisit);
},

Expand Down

0 comments on commit 8c0abaa

Please sign in to comment.