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

add custom form for labs #1009

Merged
merged 3 commits into from
Mar 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/admin/custom-forms/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ export default AbstractEditController.extend({
'socialwork',
'visit',
'opdReport',
'dischargeReport'
'dischargeReport',
'lab'
],

formTypes: computed(function() {
Expand Down
10 changes: 7 additions & 3 deletions app/labs/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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);
}
});
1 change: 1 addition & 0 deletions app/labs/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
3 changes: 2 additions & 1 deletion app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down