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

Commit

Permalink
Added middle name to patient record
Browse files Browse the repository at this point in the history
Resolves #40
  • Loading branch information
jkleinsc committed May 4, 2015
1 parent cb0cac0 commit c35ccfe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions app/mixins/patient-name.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ export default Ember.Mixin.create({
getPatientDisplayName: function(patient) {
var firstName = Ember.get(patient, 'firstName'),
lastName = Ember.get(patient, 'lastName'),
returnName = '';
middleName = Ember.get(patient, 'middleName'),
nameArray = [];
if (!Ember.isEmpty(firstName)) {
returnName += firstName;
nameArray.push(firstName);
}
if (!Ember.isEmpty(returnName) && !Ember.isEmpty(lastName)) {
returnName += ' ';
if (!Ember.isEmpty(middleName)) {
nameArray.push(middleName);
}
if (!Ember.isEmpty(lastName)) {
returnName += lastName;
nameArray.push(lastName);
}
return returnName;
return nameArray.join(' ');
}
});

0 comments on commit c35ccfe

Please sign in to comment.