diff --git a/app/admin/custom-forms/edit/controller.js b/app/admin/custom-forms/edit/controller.js index 3e1c525e1e..295418802d 100644 --- a/app/admin/custom-forms/edit/controller.js +++ b/app/admin/custom-forms/edit/controller.js @@ -78,7 +78,8 @@ export default AbstractEditController.extend({ 'operativePlan', 'patient', 'socialwork', - 'visit' + 'visit', + 'opdReport' ], formTypes: computed(function() { diff --git a/app/locales/en/translations.js b/app/locales/en/translations.js index 477f3dd8bd..3652a6b486 100644 --- a/app/locales/en/translations.js +++ b/app/locales/en/translations.js @@ -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?', diff --git a/app/models/report.js b/app/models/report.js index 0762dce9d5..0b7196efb6 100644 --- a/app/models/report.js +++ b/app/models/report.js @@ -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 }), diff --git a/app/reports/edit/route.js b/app/reports/edit/route.js index c17fc3f86e..785179485c 100644 --- a/app/reports/edit/route.js +++ b/app/reports/edit/route.js @@ -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) { diff --git a/app/reports/edit/template.hbs b/app/reports/edit/template.hbs index f12b41ee93..d7577366d5 100644 --- a/app/reports/edit/template.hbs +++ b/app/reports/edit/template.hbs @@ -97,5 +97,7 @@ {{/if}} + {{custom-form-manager model=model formType="opdReport"}} + {{/em-form}} {{/edit-panel}} diff --git a/package.json b/package.json index b08c5d8d27..b7bb5b753e 100644 --- a/package.json +++ b/package.json @@ -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": [ @@ -17,7 +18,7 @@ }, "repository": { "type": "git", - "url": "git+ssh://git@github.com:eHealthAfrica/hospitalrun-frontend.git" + "url": "git@github.com:HospitalRun/hospitalrun-frontend" }, "engines": { "node": ">= 4" @@ -25,8 +26,7 @@ "author": "John Kleinschmidt", "contributors": [ "Joel Worrall", - "Joel Glovier", - "eHealth Africa" + "Joel Glovier" ], "license": "GPL-3.0", "devDependencies": { @@ -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", @@ -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", @@ -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" - ] + } }