Skip to content

Commit

Permalink
Fix nextAppointment bug
Browse files Browse the repository at this point in the history
  • Loading branch information
adeolabadmus committed Mar 15, 2017
1 parent 7895b24 commit 6463268
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
3 changes: 2 additions & 1 deletion app/mixins/patient-visits.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export default Ember.Mixin.create(PouchDbMixin, {
return null;
}
if (!outPatient) {
return futureAppointments;
let [appointment] = futureAppointments;
return appointment;
} else {
return futureAppointments.slice(0, 3);
}
Expand Down
16 changes: 0 additions & 16 deletions tests/acceptance/visit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ const visitData = {
OPD_PROCEDURE_PHYSICIAN: 'Sarah Kearney',
LAB_TYPE: 'Cholesterol',
IMAGING_TYPE: 'Cervical Spine AP-L',
MEDICATION_INPUT: 'Cefazolin 500mg vial (Hazolin) - m00001 (999998 available)',
MEDICATION_PRESCRIPTION: '4 doses before meals',
MEDICATION_QUANTITY: '4',
APPOINTMENT_START_DATE: moment().add(7, 'days').format('l h:mm A'),
APPOINTMENT_END_DATE: moment().add(8, 'days').format('l h:mm A')
},
Expand Down Expand Up @@ -311,16 +308,6 @@ function addOutpatientData(assert) {
typeAheadFillIn('.imaging-type-input', visitData.outPatient.IMAGING_TYPE);
});
updateVisitData(assert, 'Imaging Request Saved');
andThen(() => {
click('button:contains(New Medication)');
});
andThen(() => {
assert.ok(currentURL().indexOf('/medication/edit/new?forVisitId') > -1, 'New Medication URL is visited');
typeAheadFillIn('.test-medication-input', visitData.outPatient.MEDICATION_INPUT);
fillIn('.test-medication-prescription textarea', visitData.outPatient.MEDICATION_PRESCRIPTION);
fillIn('.test-quantity-input input', visitData.outPatient.MEDICATION_QUANTITY);
});
updateVisitData(assert, 'Medication Request Saved');
andThen(() => {
click('button:contains(New Appointment)');
});
Expand Down Expand Up @@ -380,9 +367,6 @@ function checkOPDReport(assert) {
assert.ok(find('.test-labs .test-labs-data').text().indexOf(visitData.outPatient.LAB_TYPE) > -1, 'Lab request is displayed');
findWithAssert('.test-images .test-images-label:contains(Images)');
assert.ok(find('.test-images .test-images-data').text().indexOf(visitData.outPatient.IMAGING_TYPE) > -1, 'Image request is displayed');
findWithAssert('.test-medication .test-medication-label:contains(Medications)');
let medicationName = visitData.outPatient.MEDICATION_INPUT.slice(0, 30); // Medication name earlier filled-in contains other info not displayed in the report, so only actual medication name is extracted
assert.ok(find('.test-medication .test-medication-data').text().indexOf(medicationName) > -1, 'Medication request is displayed');
findWithAssert('.test-operative-plan .test-operative-plan-label:contains(Operative Plan)');
findWithAssert('.test-operative-plan .test-operative-plan-description-label:contains(Operation Description:)');
assert.equal(find('.test-operative-plan .test-operative-plan-description-data').text(), visitData.outPatient.OPERATION_DESCRIPTION);
Expand Down

0 comments on commit 6463268

Please sign in to comment.