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

Commit

Permalink
Fixes #923
Browse files Browse the repository at this point in the history
Make sure create new patient check box is not checked on new check ins
  • Loading branch information
jkleinsc committed Jan 18, 2017
1 parent 0fb079e commit 7d6cba0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions app/visits/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import VisitTypes from 'hospitalrun/mixins/visit-types';

const {
computed,
isEmpty
isEmpty,
set
} = Ember;

export default AbstractEditController.extend(AddNewPatient, ChargeActions, DiagnosisActions, PatientSubmodule, PatientNotes, UserSession, VisitTypes, {
Expand Down Expand Up @@ -104,7 +105,6 @@ export default AbstractEditController.extend(AddNewPatient, ChargeActions, Diagn
allowAddOperativePlan: computed.not('model.isNew'),
chargePricingCategory: 'Ward',
chargeRoute: 'visits.charge',
createNewPatient: false,
diagnosisList: Ember.computed.alias('visitsController.diagnosisList'),
findPatientVisits: false,
hideChargeHeader: true,
Expand Down Expand Up @@ -295,9 +295,9 @@ export default AbstractEditController.extend(AddNewPatient, ChargeActions, Diagn

patientSelected(patient) {
if (isEmpty(patient)) {
this.set('createNewPatient', true);
set(this, 'model.createNewPatient', true);
} else {
this.set('createNewPatient', false);
set(this, 'model.createNewPatient', false);
this.getPatientDiagnoses(patient);
}
},
Expand Down Expand Up @@ -392,7 +392,7 @@ export default AbstractEditController.extend(AddNewPatient, ChargeActions, Diagn
},

newPatientChanged(createNewPatient) {
this.set('createNewPatient', createNewPatient);
set(this, 'model.createNewPatient', createNewPatient);
let model = this.get('model');
let patient = model.get('patient');
if (createNewPatient && !isEmpty(patient)) {
Expand Down
4 changes: 2 additions & 2 deletions app/visits/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{{/if}}
{{#if showPatientSelection}}
<div class="row">
{{#if createNewPatient}}
{{#if model.createNewPatient}}
{{em-input property="patientTypeAhead" label=(t 'visits.labels.patientToCheckIn')class="required patient-name col-sm-9"}}
{{else}}
{{patient-typeahead
Expand All @@ -44,7 +44,7 @@
{{/if}}
<div class="checkbox col-sm-3 new-patient-checkbox">
<label>
<input type="checkbox" checked={{createNewPatient}} onchange={{action "newPatientChanged" value="target.checked"}}>
<input type="checkbox" checked={{model.createNewPatient}} onchange={{action "newPatientChanged" value="target.checked"}}>
{{t 'visits.labels.createNewPatient'}}
</label>
</div>
Expand Down

0 comments on commit 7d6cba0

Please sign in to comment.