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

Commit

Permalink
Allow patient checkin from appointment
Browse files Browse the repository at this point in the history
Partially addresses #835
  • Loading branch information
jkleinsc committed Dec 9, 2016
1 parent 6666615 commit 01fb7e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion app/appointments/item/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
<button class="btn btn-default neutral" {{action 'editAppointment' appointment bubbles=false }}>{{t 'labels.edit'}}</button>
{{/if}}
{{#if canAddVisit}}
<button class="btn btn-default" {{action 'createVisit' appointment bubbles=false }}>{{t 'buttons.addVisit'}}</button>
<button class="btn btn-default" {{action 'checkIn' appointment bubbles=false }}>
<span class="glyphicon glyphicon-log-in"></span>
{{t 'visits.buttons.checkIn'}}
</button>
{{/if}}
{{#if canDelete}}
<button class="btn btn-default warning" {{action 'deleteItem' appointment bubbles=false }}><span class="octicon octicon-x"></span> {{t 'buttons.delete'}}</button>
Expand Down
10 changes: 8 additions & 2 deletions app/appointments/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,18 @@ export default AbstractModuleRoute.extend(UserSession, {
sectionTitle: t('appointments.sectionTitle'),

actions: {
createVisit(appointment) {
checkIn(appointment) {
let patient = appointment.get('patient');
let visitProps = appointment.getProperties('startDate', 'endDate', 'location', 'patient');
visitProps.visitType = appointment.get('appointmentType');
visitProps.examiner = appointment.get('provider');
this.transitionTo('visits.edit', 'new').then(function(newRoute) {
visitProps.appointment = appointment;
visitProps.hidePatientSelection = true;
visitProps.patient = patient;
visitProps.returnTo = 'appointments';
this.transitionTo('visits.edit', 'checkin').then(function(newRoute) {
newRoute.currentModel.setProperties(visitProps);
newRoute.controller.getPatientDiagnoses(patient);
}.bind(this));
}
},
Expand Down

0 comments on commit 01fb7e9

Please sign in to comment.