Skip to content

Commit

Permalink
Merge pull request #1 from eHealthAfrica/opd-custom-form
Browse files Browse the repository at this point in the history
OPD Reports Custom Forms
  • Loading branch information
Chima Alaebo authored Feb 9, 2017
2 parents 63f5571 + 32bf618 commit 3be61a1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 29 deletions.
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"
]
}
}

0 comments on commit 3be61a1

Please sign in to comment.