diff --git a/app/admin/custom-forms/edit/controller.js b/app/admin/custom-forms/edit/controller.js index cc9c446c8a..e872459c2e 100644 --- a/app/admin/custom-forms/edit/controller.js +++ b/app/admin/custom-forms/edit/controller.js @@ -81,7 +81,8 @@ export default AbstractEditController.extend({ 'socialwork', 'visit', 'opdReport', - 'dischargeReport' + 'dischargeReport', + 'lab' ], formTypes: computed(function() { diff --git a/app/labs/edit/route.js b/app/labs/edit/route.js index 0338bbc9ab..e5effb16e9 100644 --- a/app/labs/edit/route.js +++ b/app/labs/edit/route.js @@ -11,6 +11,7 @@ export default AbstractEditRoute.extend(AddToPatientRoute, ChargeRoute, PatientL modelName: 'lab', newTitle: t('labs.newTitle'), pricingCategory: 'Lab', + customForms: Ember.inject.service(), actions: { returnToAllItems() { @@ -19,9 +20,12 @@ export default AbstractEditRoute.extend(AddToPatientRoute, ChargeRoute, PatientL }, getNewData() { - return Ember.RSVP.resolve({ + let newLabData = { selectPatient: true, - requestDate: moment().startOf('day').toDate() - }); + requestDate: moment().startOf('day').toDate(), + customForms: Ember.Object.create() + }; + let customForms = this.get('customForms'); + return customForms.setDefaultCustomForms(['lab'], newLabData); } }); diff --git a/app/labs/edit/template.hbs b/app/labs/edit/template.hbs index cfd3880222..847cef98f9 100644 --- a/app/labs/edit/template.hbs +++ b/app/labs/edit/template.hbs @@ -43,5 +43,6 @@ {{em-input property="result" label=(t 'labels.result') class="test-result-input"}} {{/if}} {{em-text property="notes" label=(t 'labels.notes') rows=3 }} + {{custom-form-manager model=model formType="lab"}} {{/em-form}} {{/edit-panel}} diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index a264c24633..5e31c42063 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -175,7 +175,8 @@ export default { textarea: 'Large Text', visitFormType: 'Visit', opdReportFormType: 'Outpatient Report', - dischargeReportFormType: 'Discharge Report' + dischargeReportFormType: 'Discharge Report', + labFormType: 'Lab' }, messages: { formSaved: 'The {{name}} form has been saved.'