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

Commit

Permalink
Added status to appointments
Browse files Browse the repository at this point in the history
Resolves #73
  • Loading branch information
jkleinsc committed Jun 30, 2015
1 parent d58470b commit 84be677
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 2 deletions.
6 changes: 5 additions & 1 deletion app/appointments/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import VisitTypes from 'hospitalrun/mixins/visit-types';

export default AbstractEditController.extend(PatientSubmodule, VisitTypes, {
needs: ['appointments','pouchdb'],


appointmentStatuses: [
'Scheduled',
'Canceled'
],
dateFormat: 'l h:mm A',
findPatientVisits: false,

Expand Down
4 changes: 4 additions & 0 deletions app/appointments/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
label="Location" list=locationList
selection=location
}}
{{em-select class="col-sm-3" property="status"
label="Status" content=appointmentStatuses
optionValuePath="content" optionLabelPath="content"
}}
</div>
{{em-text label="Notes" property="notes" rows=3 }}
{{/em-form}}
1 change: 1 addition & 0 deletions app/appointments/index/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<th>Type</th>
<th>Location</th>
<th>Provider</th>
<th>Status</th>
<th>Actions</th>
</tr>
{{#each itemController='appointments/item'}}
Expand Down
1 change: 1 addition & 0 deletions app/appointments/item/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<td>{{appointmentType}}</td>
<td>{{location}}</td>
<td>{{provider}}</td>
<td>{{displayStatus}}</td>
<td>
{{#if parentController.canAddVisit}}
<button class="btn btn-default" {{action 'createVisit' this bubbles=false }}>Add Visit</button>
Expand Down
2 changes: 1 addition & 1 deletion app/appointments/search/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default AppointmentIndexController.extend({
this.set('previousStartKey');
this.set('previousStartKeys',[]);
if (!Ember.isEmpty(startingDate)) {
this.set('startKey', [startingDate.getTime(),,]);
this.set('startKey', [startingDate.getTime(),null,null]);
}
}.observes('startingDate')
});
1 change: 1 addition & 0 deletions app/appointments/search/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<th>Type</th>
<th>Location</th>
<th>Provider</th>
<th>Status</th>
<th>Actions</th>
</tr>
{{#each itemController='appointments/item'}}
Expand Down
9 changes: 9 additions & 0 deletions app/models/appointment.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,21 @@ export default AbstractModel.extend({
startDate: DS.attr('date'),
endDate: DS.attr('date'),
notes: DS.attr('string'),
status: DS.attr('string', {defaultValue:'Scheduled'}),

appointmentDate: function() {
var startDate = this.get('startDate');
return startDate;
}.property('startDate'),

displayStatus: function() {
var status = this.get('status');
if (Ember.isEmpty(status)) {
status = 'Scheduled';
}
return status;
}.property('status'),

validations: {
appointmentDate: {
presence: {
Expand Down
2 changes: 2 additions & 0 deletions app/patients/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@
<th>Examiner</th>
<th>Location</th>
<th>Type</th>
<th>Status</th>
<th>Actions</th>
</tr>
{{#with this as patientController}}
Expand All @@ -385,6 +386,7 @@
<td>{{provider}}</td>
<td>{{location}}</td>
<td>{{appointmentType}}</td>
<td>{{displayStatus}}</td>
<td>
{{#if patientController.canAddAppointment}}
<button type="button" class="btn btn-default neutral" {{action "editAppointment" this}}>Edit</button>
Expand Down

0 comments on commit 84be677

Please sign in to comment.