Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPD Reports Custom Forms #1

Merged
merged 3 commits into from
Feb 9, 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 @@ -78,7 +78,8 @@ export default AbstractEditController.extend({
'operativePlan',
'patient',
'socialwork',
'visit'
'visit',
'opdReport'
],

formTypes: computed(function() {
Expand Down
3 changes: 2 additions & 1 deletion app/locales/en/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ export default {
socialworkFormType: 'Social Work',
text: 'Text',
textarea: 'Large Text',
visitFormType: 'Visit'
visitFormType: 'Visit',
opdReportFormType: 'Outpatient Report'
},
messages: {
deleteForm: 'Are you sure you want to delete this custom form?',
Expand Down
1 change: 1 addition & 0 deletions app/models/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export default AbstractModel.extend({
// Attributes
description: DS.attr('string'),
reportDate: DS.attr('date'),
customForms: DS.attr('custom-forms'),

// Associations
visit: DS.belongsTo('visit', { async: false }),
Expand Down
11 changes: 8 additions & 3 deletions app/reports/edit/route.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@ import Ember from 'ember';
export default AbstractEditRoute.extend({
modelName: 'report',
database: Ember.inject.service(),
customForms: Ember.inject.service(),

getNewData() {
return Ember.RSVP.resolve({
reportDate: new Date()
});
let newReportData = {
reportDate: new Date(),
customForms: Ember.Object.create()
};
let customForms = this.get('customForms');
return customForms.setDefaultCustomForms(['opdReport'], newReportData);
},

setupController(controller, model) {
Expand Down
2 changes: 2 additions & 0 deletions app/reports/edit/template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,7 @@
</div>
{{/if}}

{{custom-form-manager model=model formType="opdReport"}}

{{/em-form}}
{{/edit-panel}}
31 changes: 7 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "hospitalruncli",
"name": "hospitalrun",
"version": "0.9.17",
"description": "Ember front end for HospitalRun",
"homepage": "http://hospitalrun.io",
"directories": {
"doc": "doc",
"test": "tests"
},
"files": [
Expand All @@ -17,16 +18,15 @@
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com:eHealthAfrica/hospitalrun-frontend.git"
"url": "[email protected]:HospitalRun/hospitalrun-frontend"
},
"engines": {
"node": ">= 4"
},
"author": "John Kleinschmidt",
"contributors": [
"Joel Worrall",
"Joel Glovier",
"eHealth Africa"
"Joel Glovier"
],
"license": "GPL-3.0",
"devDependencies": {
Expand All @@ -37,7 +37,7 @@
"broccoli-manifest": "0.0.7",
"broccoli-merge-trees": "^1.1.1",
"broccoli-serviceworker": "0.1.4",
"broccoli-stylelint": "github:billybonks/broccoli-stylelint",
"broccoli-stylelint": "billybonks/broccoli-stylelint",
"ember-ajax": "2.5.2",
"ember-browserify": "^1.1.12",
"ember-cli": "2.10.0",
Expand Down Expand Up @@ -69,7 +69,7 @@
"ember-load-initializers": "^0.6.0",
"ember-pouch": "4.2.1",
"ember-radio-buttons": "^4.0.1",
"ember-rapid-forms": "github:gcorbel/ember-rapid-forms#26229804a2c430bbdf1ffb6bab8fb53af17bb3a4",
"ember-rapid-forms": "GCorbel/ember-rapid-forms#26229804a2c430bbdf1ffb6bab8fb53af17bb3a4",
"ember-resolver": "^2.0.3",
"ember-select-list": "0.9.5",
"ember-simple-auth": "^1.1.0",
Expand Down Expand Up @@ -98,22 +98,5 @@
"paths": [
"lib/pouch-fixtures"
]
},
"bugs": {
"url": "https://github.com/HospitalRun/hospitalrun-frontend/issues"
},
"main": "index.js",
"dependencies": {
"ember": "^1.0.0-pre.2"
},
"keywords": [
"eHealth",
"Systems",
"Africa",
"HealthCare",
"Health",
"Hospital",
"Run",
"Hospital Run"
]
}
}