From 01d95c73a5524ef7019c1b467cdcd1c351609839 Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Mon, 20 Jul 2015 15:25:28 -0400 Subject: [PATCH] Added radioligist to imaging Resolves HospitalRun/frontend#62 --- app/admin/lookup/controller.js | 6 ++++++ app/imaging/edit/controller.js | 8 ++++++++ app/imaging/edit/template.hbs | 4 ++++ app/imaging/route.js | 3 +++ app/models/imaging.js | 1 + 5 files changed, 22 insertions(+) diff --git a/app/admin/lookup/controller.js b/app/admin/lookup/controller.js index 2920c3a7a6..316e373212 100644 --- a/app/admin/lookup/controller.js +++ b/app/admin/lookup/controller.js @@ -140,6 +140,12 @@ export default Ember.ArrayController.extend(BillingCategories, LabPricingTypes, models: { pricing: 'type' } + }, { + name: 'Radiologists', + value: 'radiologists', + model: { + imaging: 'radiologist' + } }, { name: 'Vendor', value: 'vendor_list', diff --git a/app/imaging/edit/controller.js b/app/imaging/edit/controller.js index e4b91500e0..7282b589d5 100644 --- a/app/imaging/edit/controller.js +++ b/app/imaging/edit/controller.js @@ -36,11 +36,19 @@ export default AbstractEditController.extend(ChargeActions, PatientSubmodule, { } }.property('canComplete', 'isValid'), + lookupListsToUpdate: [{ + name: 'radiologistList', + property: 'radiologist', + id: 'radiologists' + }], + pricingTypeForObjectType: 'Imaging Procedure', pricingTypes: Ember.computed.alias('controllers.imaging.imagingPricingTypes'), pricingList: null, //This gets filled in by the route + radiologistList: Ember.computed.alias('controllers.imaging.radiologistList'), + imagingTypeChanged: function() { this.objectTypeChanged('imagingTypeName', 'imagingType'); }.observes('imagingType'), diff --git a/app/imaging/edit/template.hbs b/app/imaging/edit/template.hbs index ca67be3fe5..6745408d30 100644 --- a/app/imaging/edit/template.hbs +++ b/app/imaging/edit/template.hbs @@ -35,6 +35,10 @@ {{/if}} {{#if canComplete}} + {{select-or-typeahead property="radiologist" + label="Radiologist" list=radiologistList + prompt=" " + }} {{em-input property="result" label="Result"}} {{/if}} {{em-text property="notes" label="Notes" rows=3 }} diff --git a/app/imaging/route.js b/app/imaging/route.js index ebcd3b075f..9c363e5d89 100644 --- a/app/imaging/route.js +++ b/app/imaging/route.js @@ -4,6 +4,9 @@ export default AbstractModuleRoute.extend({ additionalModels: [{ name: 'imagingPricingTypes', findArgs: ['lookup','imaging_pricing_types'] + }, { + name: 'radiologistList', + findArgs: ['lookup','radiologists'], }], allowSearch: false, moduleName: 'imaging', diff --git a/app/models/imaging.js b/app/models/imaging.js index 581fcd9491..50dc84438e 100644 --- a/app/models/imaging.js +++ b/app/models/imaging.js @@ -9,6 +9,7 @@ export default AbstractModel.extend(DateFormat, ResultValidation, { imagingType: DS.belongsTo('pricing'), notes: DS.attr('string'), patient: DS.belongsTo('patient'), + radiologist: DS.attr('string'), requestedBy: DS.attr('string'), requestedDate: DS.attr('date'), result: DS.attr('string'),