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

Conversation

baoqchau
Copy link
Contributor

Fixes #65

Changes proposed in this pull request:

  • Add custom form for lab's report.

cc @HospitalRun/core-maintainers

Copy link
Member

@jkleinsc jkleinsc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@baoqchau thanks for the PR! There are couple of adjustments that need to be made.


actions: {
returnToAllItems() {
this.controller.send('returnToAllItems');
}
},

getCustomFormData() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this code isn't used, but you need this code for forms that are set to "Always Include". Custom forms that are set to this get added automatically on new items.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So how should I fix this @jkleinsc ? You have any suggestion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at how visit does this:
https://github.com/HospitalRun/hospitalrun-frontend/blob/master/app/visits/edit/route.js#L35-L43

Basically what you need to do is to create a newData object and make sure it includes a custom forms object and then you return customForms.setDefaultCustomForms(['lab'], newData) from the getNewData function.

@@ -42,6 +42,7 @@
{{#if canComplete}}
{{em-input property="result" label=(t 'labels.result') class="test-result-input"}}
{{/if}}
{{custom-form-manager model=model formType="lab"}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would move this down after notes

@@ -175,7 +175,8 @@ export default {
textarea: 'Large Text',
visitFormType: 'Visit',
opdReportFormType: 'Outpatient Report',
dischargeReportFormType: 'Discharge Report'
dischargeReportFormType: 'Discharge Report',
labFormType: 'Lab Form Type'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Translated text should just be 'Lab', not 'Lab Form Type'

@jkleinsc
Copy link
Member

Looks good to me @baoqchau. Thanks for the PR!

@jkleinsc jkleinsc merged commit f5ebd65 into HospitalRun:master Mar 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants