diff --git a/dist/assets/hospitalrun.js b/dist/assets/hospitalrun.js index bf7525b4df..e64ea4bfb2 100644 --- a/dist/assets/hospitalrun.js +++ b/dist/assets/hospitalrun.js @@ -11,13 +11,13 @@ eval("define(\"hospitalrun/appointments/delete/view\", \n [\"hospitalrun/views/ eval("define(\"hospitalrun/views/modal\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.View.extend({\n layoutName: \'modal\',\n \n didInsertElement: function() {\n var $modal = this.$(\'.modal\').modal();\n\n $modal.on(\'hidden.bs.modal\', function () {\n this.get(\'controller\').send(\'closeModal\');\n }.bind(this));\n },\n\n willDestroyElement: function() {\n this.$(\'.modal\').modal(\'hide\');\n //jquery fixes\n $(\'body\').removeClass(\'modal-open\');\n $(\'.modal-backdrop\').remove();\n }\n });\n });//# sourceURL=hospitalrun/views/modal.js"); eval("define(\"hospitalrun/appointments/edit/controller\", \n [\"hospitalrun/mixins/gender-list\",\"hospitalrun/controllers/abstract-edit-controller\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var GenderList = __dependency1__[\"default\"];\n \n var AbstractEditController = __dependency2__[\"default\"];\n \n\n __exports__[\"default\"] = AbstractEditController.extend(GenderList, {\n afterUpdate: function(record) {\n this.transitionToRoute(\'/patients/search/\'+record.get(\'id\'));\n }\n });\n });//# sourceURL=hospitalrun/appointments/edit/controller.js"); eval("define(\"hospitalrun/mixins/gender-list\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Mixin.create({\n genderList: [{\n label: \"Male\",\n value: \"M\"\n }, {\n label: \"Female\",\n value: \"F\" \n }]\n });\n });//# sourceURL=hospitalrun/mixins/gender-list.js"); -eval("define(\"hospitalrun/controllers/abstract-edit-controller\", \n [\"hospitalrun/mixins/is-update-disabled\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var IsUpdateDisabled = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.ObjectController.extend(IsUpdateDisabled, {\n /**\n * Lookup lists that should be updated when the model has a new value to add to the lookup list.\n * lookupListsToUpdate: [{\n * name: \'countryList\', //Name of property containing lookup list\n * property: \'country\', //Corresponding property on model that potentially contains a new value to add to the list\n * id: \'country_list\' //Id of the lookup list to update\n * }\n */\n lookupListsToUpdate: null,\n \n isUpdateDisabled: function() {\n if (!Ember.isNone(this.get(\'isValid\'))) {\n return !this.get(\'isValid\');\n } else {\n return false;\n }\n }.property(\'isValid\'),\n \n updateButtonAction: \'update\',\n \n updateButtonText: function() {\n if (this.get(\'isNew\')) {\n return \'Add\';\n } else {\n return \'Update\';\n }\n }.property(\'isNew\'),\n \n actions: {\n cancel: function() {\n var cancelledItem = this.get(\'model\');\n if (this.get(\'isNew\')) {\n cancelledItem.deleteRecord();\n } else {\n cancelledItem.rollback();\n }\n this.send(\'allItems\');\n },\n \n /**\n * Update the model and perform the before update and after update\n * @param skipAfterUpdate boolean (optional) indicating whether or not \n * to skip the afterUpdate call.\n */\n update: function(skipAfterUpdate) {\n this.beforeUpdate();\n this.get(\'model\').save().then(function(record) {\n this.updateLookupLists();\n if (!skipAfterUpdate) {\n this.afterUpdate(record);\n }\n }.bind(this)); \n }\n },\n \n /**\n * Override this function to perform logic after record update\n * @param record the record that was just updated.\n */\n afterUpdate: function() {\n },\n \n /**\n * Override this function to perform logic before record update.\n */\n beforeUpdate: function() {\n },\n \n /**\n * Update any new values added to a lookup list\n */\n updateLookupLists: function() {\n var lookupLists = this.get(\'lookupListsToUpdate\'); \n if (!Ember.isEmpty(lookupLists)) { \n lookupLists.forEach(function(list) {\n var propertyValue = this.get(list.property),\n lookupList = this.get(list.name);\n if (!Ember.isEmpty(propertyValue)) {\n if (lookupList) {\n var lookupListValues = lookupList.get(\'value\');\n if (!lookupListValues.contains(propertyValue)) {\n lookupListValues.push(propertyValue);\n lookupListValues.sort();\n lookupList.set(\'value\', lookupListValues);\n lookupList.save();\n this.set(list.name, lookupList);\n }\n } else {\n lookupList = this.get(\'store\').push(\'lookup\',{\n id: list.id,\n value: [propertyValue]\n });\n lookupList.save();\n this.set(list.name, lookupList);\n }\n }\n }.bind(this));\n }\n }\n\n\n });\n });//# sourceURL=hospitalrun/controllers/abstract-edit-controller.js"); +eval("define(\"hospitalrun/controllers/abstract-edit-controller\", \n [\"hospitalrun/mixins/is-update-disabled\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var IsUpdateDisabled = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.ObjectController.extend(IsUpdateDisabled, {\n /**\n * Lookup lists that should be updated when the model has a new value to add to the lookup list.\n * lookupListsToUpdate: [{\n * name: \'countryList\', //Name of property containing lookup list\n * property: \'country\', //Corresponding property on model that potentially contains a new value to add to the list\n * id: \'country_list\' //Id of the lookup list to update\n * }\n */\n lookupListsToUpdate: null,\n updateButtonAction: \'update\',\n \n updateButtonText: function() {\n if (this.get(\'isNew\')) {\n return \'Add\';\n } else {\n return \'Update\';\n }\n }.property(\'isNew\'),\n \n actions: {\n cancel: function() {\n var cancelledItem = this.get(\'model\');\n if (this.get(\'isNew\')) {\n cancelledItem.deleteRecord();\n } else {\n cancelledItem.rollback();\n }\n this.send(\'allItems\');\n },\n \n /**\n * Update the model and perform the before update and after update\n * @param skipAfterUpdate boolean (optional) indicating whether or not \n * to skip the afterUpdate call.\n */\n update: function(skipAfterUpdate) {\n this.beforeUpdate();\n this.get(\'model\').save().then(function(record) {\n this.updateLookupLists();\n if (!skipAfterUpdate) {\n this.afterUpdate(record);\n }\n }.bind(this)); \n }\n },\n \n /**\n * Override this function to perform logic after record update\n * @param record the record that was just updated.\n */\n afterUpdate: function() {\n },\n \n /**\n * Override this function to perform logic before record update.\n */\n beforeUpdate: function() {\n },\n \n /**\n * Update any new values added to a lookup list\n */\n updateLookupLists: function() {\n var lookupLists = this.get(\'lookupListsToUpdate\'); \n if (!Ember.isEmpty(lookupLists)) { \n lookupLists.forEach(function(list) {\n var propertyValue = this.get(list.property),\n lookupList = this.get(list.name);\n if (!Ember.isEmpty(propertyValue)) {\n if (lookupList) {\n var lookupListValues = lookupList.get(\'value\');\n if (!lookupListValues.contains(propertyValue)) {\n lookupListValues.push(propertyValue);\n lookupListValues.sort();\n lookupList.set(\'value\', lookupListValues);\n lookupList.save();\n this.set(list.name, lookupList);\n }\n } else {\n lookupList = this.get(\'store\').push(\'lookup\',{\n id: list.id,\n value: [propertyValue]\n });\n lookupList.save();\n this.set(list.name, lookupList);\n }\n }\n }.bind(this));\n }\n }\n\n\n });\n });//# sourceURL=hospitalrun/controllers/abstract-edit-controller.js"); eval("define(\"hospitalrun/mixins/is-update-disabled\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Mixin.create({\n isUpdateDisabled: function() {\n if (!Ember.isNone(this.get(\'isValid\'))) {\n return !this.get(\'isValid\');\n } else {\n return false;\n }\n }.property(\'isValid\')\n });\n });//# sourceURL=hospitalrun/mixins/is-update-disabled.js"); eval("define(\"hospitalrun/appointments/edit/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-input\'] || (depth0 && depth0[\'date-picker-input\']),options={hash:{\n \'controls\': (\"my-datepicker\"),\n \'value\': (\"appointmentDate\"),\n \'class\': (\"form-control\")\n },hashTypes:{\'controls\': \"STRING\",\'value\': \"ID\",\'class\': \"STRING\"},hashContexts:{\'controls\': depth0,\'value\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-input\", options))));\n data.buffer.push(\"\\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"patientId\"),\n \'label\': (\"Patient\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"providerId\"),\n \'label\': (\"With\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"locationId\"),\n \'label\': (\"At Location\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"appointmentType\"),\n \'label\': (\"Type\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"note\"),\n \'label\': (\"Notes\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n return buffer;\n }\n\n data.buffer.push(\"
\\n \");\n stack1 = (helper = helpers[\'em-form\'] || (depth0 && depth0[\'em-form\']),options={hash:{\n \'model\': (\"\"),\n \'submit_button\': (false)\n },hashTypes:{\'model\': \"ID\",\'submit_button\': \"BOOLEAN\"},hashContexts:{\'model\': depth0,\'submit_button\': depth0},inverse:self.noop,fn:self.program(1, program1, data),contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-form\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/appointments/edit/template.js"); eval("define(\"hospitalrun/appointments/edit/view\", \n [\"hospitalrun/views/panel\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var PanelView = __dependency1__[\"default\"];\n __exports__[\"default\"] = PanelView.extend();\n });//# sourceURL=hospitalrun/appointments/edit/view.js"); eval("define(\"hospitalrun/views/panel\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.View.extend({\n layoutName: \'panel\'\n });\n });//# sourceURL=hospitalrun/views/panel.js"); eval("define(\"hospitalrun/appointments/index/controller\", \n [\"hospitalrun/controllers/abstract-paged-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractPagedController = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractPagedController.extend();\n });//# sourceURL=hospitalrun/appointments/index/controller.js"); -eval("define(\"hospitalrun/controllers/abstract-paged-controller\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.ArrayController.extend({\n offset: 0,\n limit: 10,\n sortProperties: [\'dateFulfilled\'],\n // Sort in descending order\n sortAscending: false,\n \n arrangedContent: function() {\n var arrangedContent = this._super();\n var limit = this.get(\'limit\'),\n offset = this.get(\'offset\');\n return arrangedContent.slice(offset, offset+limit);\n }.property(\'model\', \'offset\', \'limit\'),\n \n disablePreviousPage: function() {\n return (this.get(\'offset\') === 0);\n }.property(\'offset\'),\n \n disableNextPage: function() {\n var limit = this.get(\'limit\'),\n length = this.get(\'model.length\'),\n offset = this.get(\'offset\');\n return ((offset+limit) >= length);\n }.property(\'offset\',\'limit\',\'model.length\'),\n\n actions: {\n nextPage: function() {\n var limit = this.get(\'limit\');\n this.incrementProperty(\'offset\', limit);\n }, \n previousPage: function() {\n var limit = this.get(\'limit\');\n this.decrementProperty(\'offset\', limit); \n }\n }\n });\n });//# sourceURL=hospitalrun/controllers/abstract-paged-controller.js"); +eval("define(\"hospitalrun/controllers/abstract-paged-controller\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.ArrayController.extend({\n offset: 0,\n limit: 10,\n\n arrangedContent: function() {\n var arrangedContent = this._super();\n var limit = this.get(\'limit\'),\n offset = this.get(\'offset\');\n return arrangedContent.slice(offset, offset+limit);\n }.property(\'model\', \'offset\', \'limit\'),\n \n disablePreviousPage: function() {\n return (this.get(\'offset\') === 0);\n }.property(\'offset\'),\n \n disableNextPage: function() {\n var limit = this.get(\'limit\'),\n length = this.get(\'model.length\'),\n offset = this.get(\'offset\');\n return ((offset+limit) >= length);\n }.property(\'offset\',\'limit\',\'model.length\'),\n \n showPagination: function() {\n var length = this.get(\'model.length\'),\n limit = this.get(\'limit\');\n return (length > limit); \n }.property(\'model.length\'),\n\n actions: {\n nextPage: function() {\n var limit = this.get(\'limit\');\n this.incrementProperty(\'offset\', limit);\n }, \n previousPage: function() {\n var limit = this.get(\'limit\');\n this.decrementProperty(\'offset\', limit); \n }\n }\n });\n });//# sourceURL=hospitalrun/controllers/abstract-paged-controller.js"); eval("define(\"hospitalrun/appointments/index/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \\n \\n \\n \\n \\n \\n \\n \");\n stack1 = helpers.each.call(depth0, {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(2, program2, data),contexts:[],types:[],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
DateLocationPatientWith?Actions
\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \");\n stack1 = helpers.unless.call(depth0, \"isNew\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n return buffer;\n }\n function program3(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"appointmentDate\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"locationName\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"patientName\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"providerName\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \\n \\n \\n \\n \");\n return buffer;\n }\n\n function program5(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n
\\n No appointments found. Create a new appointment? \\n
\\n\");\n return buffer;\n }\n\n stack1 = helpers[\'if\'].call(depth0, \"hasRecords\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(5, program5, data),fn:self.program(1, program1, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/appointments/index/template.js"); eval("define(\"hospitalrun/appointments/index/view\", \n [\"hospitalrun/views/item-listing\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var ItemListingView = __dependency1__[\"default\"];\n __exports__[\"default\"] = ItemListingView.extend({\n title: \'Appointment List\',\n newButtonText: \'New Appointment\'\n });\n });//# sourceURL=hospitalrun/appointments/index/view.js"); eval("define(\"hospitalrun/views/item-listing\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.View.extend({\n layoutName: \'item-listing\'\n });\n });//# sourceURL=hospitalrun/views/item-listing.js"); @@ -29,7 +29,7 @@ eval("define(\"hospitalrun/appointments/search/template\", \n [\"ember\",\"expo eval("define(\"hospitalrun/components/ext-radio\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Component.extend({ \n name: \"radio\",\n });\n });//# sourceURL=hospitalrun/components/ext-radio.js"); eval("define(\"hospitalrun/components/icd10-typeahead\", \n [\"hospitalrun/components/type-ahead\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var TypeAhead = __dependency1__[\"default\"];\n __exports__[\"default\"] = TypeAhead.extend({\n selectionKey: \'id\', \n setOnBlur: true,\n \n _getSource: function() {\n return this.bloodhound.ttAdapter();\n }\n });\n });//# sourceURL=hospitalrun/components/icd10-typeahead.js"); eval("define(\"hospitalrun/components/type-ahead\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Em.Forms.FormInputComponent.extend({\n mappedContent: function() {\n var content = this.get(\'content\');\n if (content) {\n var mapped = content.filter(function(item) {\n return !Ember.isEmpty(item);\n });\n if (content instanceof DS.RecordArray) {\n mapped = mapped.map(function(item) {\n var returnObj = item.getProperties(this.get(\'displayKey\'));\n returnObj[this.get(\'selectionKey\')] = item;\n return returnObj;\n }.bind(this)); \n } else {\n mapped = mapped.map(function(item) {\n var returnObj = {};\n returnObj[this.get(\'displayKey\')] = item;\n return returnObj;\n }.bind(this));\n }\n return mapped;\n } else {\n return [];\n } \n }.property(\'content\'),\n \n bloodhound: null,\n displayKey: \'value\',\n selectionKey: \'value\',\n hint: true, \n highlight: true,\n lastHint: null,\n minlength: 1,\n selectedItem: false,\n inputElement: null,\n typeAhead: null,\n setOnBlur: false,\n\n _getSource: function() {\n var typeAheadBloodhound = new Bloodhound( {\n datumTokenizer: Bloodhound.tokenizers.obj.whitespace(this.get(\'displayKey\')),\n queryTokenizer: Bloodhound.tokenizers.whitespace, \n local: this.get(\'mappedContent\')\n });\n typeAheadBloodhound.initialize();\n this.set(\'bloodhound\', typeAheadBloodhound);\n return typeAheadBloodhound.ttAdapter();\n },\n \n didInsertElement: function() {\n var $input = this.$(\'input\');\n this.set(\'inputElement\', $input);\n var $typeahead = $input.typeahead({\n autoselect: true,\n hint: this.get(\'hint\'),\n highlight: this.get(\'highlight\'),\n minLength: this.get(\'minlength\'),\n }, { \n displayKey: this.get(\'displayKey\'),\n source: this._getSource()\n });\n this.set(\'typeAhead\', $typeahead);\n \n $typeahead.on(\'typeahead:selected\', function(event, item) {\n this.set(\'selection\', item[this.get(\'selectionKey\')]); \n this.set(\'selectedItem\', true);\n }.bind(this));\n\n $typeahead.on(\'typeahead:autocompleted\', function(event, item) {\n this.set(\'selection\', item[this.get(\'selectionKey\')]);\n this.set(\'selectedItem\', true);\n }.bind(this));\n \n if (this.get(\'setOnBlur\')) {\n $input.on(\'keyup\', function() {\n var $hint = this.$(\'.tt-hint\'),\n hintValue = $hint.val();\n this.set(\'lastHint\', hintValue);\n this.set(\'selectedItem\', false);\n }.bind(this));\n \n $input.on(\'blur\', function(event) {\n if (!this.get(\'selectedItem\')) {\n var lastHint = this.get(\'lastHint\'),\n exactMatch = false;\n if (Ember.isEmpty(lastHint)) {\n lastHint = event.target.value;\n exactMatch = true;\n }\n if (!Ember.isEmpty(event.target.value) && !Ember.isEmpty(lastHint)) {\n this.get(\'bloodhound\').get(lastHint, function(suggestions) { \n if (suggestions.length > 0) {\n if (!exactMatch || lastHint.toLowerCase() === suggestions[0][this.get(\'displayKey\')].toLowerCase()) {\n this.set(\'selectedItem\', true);\n this.set(\'selection\', suggestions[0][this.get(\'selectionKey\')]);\n event.target.value = suggestions[0][this.get(\'displayKey\')];\n this.get(\'model\').set(this.get(\'propertyName\'), event.target.value);\n }\n }\n }.bind(this));\n } \n }\n }.bind(this)); \n \n }\n },\n\n willDestroyElement: function() {\n this.get(\'inputElement\').typeahead(\'destroy\');\n }\n\n });\n });//# sourceURL=hospitalrun/components/type-ahead.js"); -eval("define(\"hospitalrun/components/inventory-typeahead\", \n [\"hospitalrun/components/type-ahead\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var TypeAhead = __dependency1__[\"default\"];\n __exports__[\"default\"] = TypeAhead.extend({\n displayKey: \'name\', \n setOnBlur: true,\n \n mappedContent: function() {\n var content = this.get(\'content\'),\n mapped;\n if (content) {\n if (content instanceof DS.RecordArray) {\n mapped = content.map(function(item) {\n var returnObj = {};\n returnObj.name = \'%@ (%@ available)\'.fmt(item.get(\'name\'), item.get(\'quantity\'));\n returnObj[this.get(\'selectionKey\')] = item;\n return returnObj;\n }.bind(this)); \n }\n return mapped;\n } else {\n return [];\n } \n }.property(\'content\')\n });\n });//# sourceURL=hospitalrun/components/inventory-typeahead.js"); +eval("define(\"hospitalrun/components/inventory-typeahead\", \n [\"hospitalrun/components/type-ahead\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var TypeAhead = __dependency1__[\"default\"];\n __exports__[\"default\"] = TypeAhead.extend({\n displayKey: \'name\', \n setOnBlur: true,\n \n mappedContent: function() {\n var content = this.get(\'content\'),\n mapped;\n if (content) {\n mapped = content.map(function(item) {\n var returnObj = {};\n returnObj.name = \'%@ (%@ available)\'.fmt(item.get(\'name\'), item.get(\'quantity\'));\n returnObj[this.get(\'selectionKey\')] = item;\n return returnObj;\n }.bind(this));\n return mapped;\n } else {\n return [];\n } \n }.property(\'content\')\n });\n });//# sourceURL=hospitalrun/components/inventory-typeahead.js"); eval("define(\"hospitalrun/components/radio-button\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Component.extend({\n tagName : \"input\",\n type : \"radio\",\n attributeBindings : [ \"name\", \"type\", \"value\", \"checked:checked\" ],\n click : function() {\n this.set(\"selection\", this.$().val());\n },\n checked : function() {\n return this.get(\"value\") === this.get(\"selection\");\n }.property(\'selection\')\n });\n });//# sourceURL=hospitalrun/components/radio-button.js"); eval("define(\"hospitalrun/components/role-select\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n var get = Ember.get;\n\n __exports__[\"default\"] = Ember.Select.extend({\n optionValuePath: \'content.roles\',\n optionLabelPath: \'content.name\',\n \n valueDidChange: Ember.observer(\'value\', function() {\n var content = get(this, \'content\'),\n value = get(this, \'value\'),\n valuePath = get(this, \'optionValuePath\').replace(/^content\\.?/, \'\'),\n selectedValue = (valuePath ? get(this, \'selection.\' + valuePath) : get(this, \'selection\')),\n selection;\n if (Ember.compare(value,selectedValue) !== 0) {\n selection = content ? content.find(\n function(obj) { \n return Ember.compare(value,(valuePath ? get(obj, valuePath) : obj)) === 0;\n }) : null;\n this.set(\'selection\', selection);\n }\n }),\n });\n });//# sourceURL=hospitalrun/components/role-select.js"); eval("define(\"hospitalrun/components/smart-prescription\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.TextArea.extend(Ember.TargetActionSupport, {\n valueDidChange: Ember.observer(\'value\', function() {\n this.triggerAction({\n action: \'search\' \n });\n })\n });\n });//# sourceURL=hospitalrun/components/smart-prescription.js"); @@ -57,7 +57,7 @@ eval("define(\"hospitalrun/inventory/batch/edit/controller\", \n [\"hospitalrun eval("define(\"hospitalrun/inventory/batch/edit/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\" \\n
\\n
\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"canEditQuantity\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4, program4, data),fn:self.program(2, program2, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"batchCost\"),\n \'label\': (\"Batch Cost\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n
\\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"batchNo\"),\n \'label\': (\"Batch Number\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n
\\n
\\n
\\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-input\'] || (depth0 && depth0[\'date-picker-input\']),options={hash:{\n \'controls\': (\"my-datepicker\"),\n \'value\': (\"expirationDate\"),\n \'class\': (\"form-control\"),\n \'dateFormat\': (\"l\")\n },hashTypes:{\'controls\': \"STRING\",\'value\': \"ID\",\'class\': \"STRING\",\'dateFormat\': \"STRING\"},hashContexts:{\'controls\': depth0,\'value\': depth0,\'class\': depth0,\'dateFormat\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-controls\'] || (depth0 && depth0[\'date-picker-controls\']),options={hash:{\n \'id\': (\"my-datepicker\"),\n \'minYear\': (\"+0\"),\n \'maxYear\': (\"+100\")\n },hashTypes:{\'id\': \"STRING\",\'minYear\': \"STRING\",\'maxYear\': \"STRING\"},hashContexts:{\'id\': depth0,\'minYear\': depth0,\'maxYear\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-controls\", options))));\n data.buffer.push(\" \\n
\\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"vendor\"),\n \'label\': (\"Vendor\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"originalQuantity\"),\n \'label\': (\"Quantity\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n return buffer;\n }\n\n function program4(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers.input || (depth0 && depth0.input),options={hash:{\n \'class\': (\"form-control\"),\n \'value\': (\"originalQuantity\"),\n \'type\': (\"text\"),\n \'disabled\': (true)\n },hashTypes:{\'class\': \"STRING\",\'value\': \"ID\",\'type\': \"STRING\",\'disabled\': \"BOOLEAN\"},hashContexts:{\'class\': depth0,\'value\': depth0,\'type\': depth0,\'disabled\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"input\", options))));\n data.buffer.push(\" \\n
\\n \");\n return buffer;\n }\n\n stack1 = (helper = helpers[\'em-form\'] || (depth0 && depth0[\'em-form\']),options={hash:{\n \'model\': (\"\"),\n \'submit_button\': (false)\n },hashTypes:{\'model\': \"ID\",\'submit_button\': \"BOOLEAN\"},hashContexts:{\'model\': depth0,\'submit_button\': depth0},inverse:self.noop,fn:self.program(1, program1, data),contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-form\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/batch/edit/template.js"); eval("define(\"hospitalrun/inventory/batch/edit/view\", \n [\"hospitalrun/views/modal\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var ModalView = __dependency1__[\"default\"];\n __exports__[\"default\"] = ModalView.extend();\n });//# sourceURL=hospitalrun/inventory/batch/edit/view.js"); eval("define(\"hospitalrun/inventory/batch/item-controller/controller\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.ObjectController.extend({\r\n /**\r\n * Batch can only be deleted if no items have been consumed from the batch.\r\n */\r\n canDelete: function() {\r\n var currentQuantity = this.get(\'currentQuantity\'),\r\n originalQuantity = this.get(\'originalQuantity\');\r\n if (currentQuantity === originalQuantity) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }.property(\'originalQuantity\', \'currentQuantity\'),\r\n \r\n rowClass: function() {\r\n var expired = this.get(\'expired\');\r\n if (expired) {\r\n return \'warning\';\r\n } else {\r\n return \'\';\r\n }\r\n }.property(\'expired\')\r\n });\n });//# sourceURL=hospitalrun/inventory/batch/item-controller/controller.js"); -eval("define(\"hospitalrun/inventory/completed/controller\", \n [\"hospitalrun/controllers/abstract-paged-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractPagedController = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractPagedController.extend();\n });//# sourceURL=hospitalrun/inventory/completed/controller.js"); +eval("define(\"hospitalrun/inventory/completed/controller\", \n [\"hospitalrun/controllers/abstract-paged-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractPagedController = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractPagedController.extend({\n sortProperties: [\'dateFulfilled\'],\n // Sort in descending order\n sortAscending: false,\n \n });\n });//# sourceURL=hospitalrun/inventory/completed/controller.js"); eval("define(\"hospitalrun/inventory/completed/route\", \n [\"hospitalrun/routes/abstract-index-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractIndexRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractIndexRoute.extend({\n pageTitle: \'Completed Requests\',\n model: function() {\n return this.store.find(\'inv-request\', {status: \'Fulfilled\'});\n }\n });\n });//# sourceURL=hospitalrun/inventory/completed/route.js"); eval("define(\"hospitalrun/routes/abstract-index-route\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, {\n newButtonAction: null,\n newButtonText: null,\n pageTitle: null,\n \n setupController: function(controller, model) {\n controller.set(\'hasRecords\', (model.get(\'length\') > 0));\n var sectionDetails = {\n currentScreenTitle: this.get(\'pageTitle\')\n };\n if (!Ember.isEmpty(this.get(\'newButtonAction\'))) {\n sectionDetails.newButtonAction = this.get(\'newButtonAction\');\n }\n if (!Ember.isEmpty(this.get(\'newButtonText\'))) {\n sectionDetails.newButtonText = this.get(\'newButtonText\');\n }\n this.send(\'setSectionHeader\', sectionDetails);\n this._super(controller, model);\n }\n });\n });//# sourceURL=hospitalrun/routes/abstract-index-route.js"); eval("define(\"hospitalrun/inventory/completed/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \");\n stack1 = helpers.each.call(depth0, {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(2, program2, data),contexts:[],types:[],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
Fulfilled OnNameQuantityFulfilled ByRequested OnRequested ByCost Per UnitQuantity At Fulfillment
\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-format\'] || (depth0 && depth0[\'date-format\']),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data},helper ? helper.call(depth0, \"dateFulfilled\", options) : helperMissing.call(depth0, \"date-format\", \"dateFulfilled\", options))));\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"inventoryItem.name\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"quantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"fulfilledBy\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\" \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-format\'] || (depth0 && depth0[\'date-format\']),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data},helper ? helper.call(depth0, \"dateRequested\", options) : helperMissing.call(depth0, \"date-format\", \"dateRequested\", options))));\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"requestedBy\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"costPerUnit\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"quantityAtFulfillment\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \");\n return buffer;\n }\n\n function program4(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n
\\n No requests found. Create a new delivery? \\n
\\n\");\n return buffer;\n }\n\n stack1 = helpers[\'if\'].call(depth0, \"hasRecords\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/completed/template.js"); @@ -65,7 +65,7 @@ eval("define(\"hospitalrun/inventory/completed/view\", \n [\"hospitalrun/views/ eval("define(\"hospitalrun/inventory/delete/controller\", \n [\"hospitalrun/controllers/abstract-delete-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractDeleteController = __dependency1__[\"default\"];\n \n __exports__[\"default\"] = AbstractDeleteController.extend({\n title: \'Delete Item\'\n });\n });//# sourceURL=hospitalrun/inventory/delete/controller.js"); eval("define(\"hospitalrun/inventory/delete/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1;\n\n\n data.buffer.push(\"
\\n \\n Are you sure you wish to delete \");\n stack1 = helpers._triageMustache.call(depth0, \"name\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"?\\n
\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/inventory/delete/template.js"); eval("define(\"hospitalrun/inventory/delete/view\", \n [\"hospitalrun/views/modal\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var ModalView = __dependency1__[\"default\"];\n __exports__[\"default\"] = ModalView.extend();\n });//# sourceURL=hospitalrun/inventory/delete/view.js"); -eval("define(\"hospitalrun/inventory/delivery/controller\", \n [\"hospitalrun/controllers/abstract-edit-controller\",\"hospitalrun/mixins/get-user-name\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var AbstractEditController = __dependency1__[\"default\"];\n \n var GetUserName = __dependency2__[\"default\"];\n\n __exports__[\"default\"] = AbstractEditController.extend(GetUserName, {\n needs: \'inventory\',\n \n inventoryList: Ember.computed.alias(\'controllers.inventory.model\'),\n \n inventoryItemChanged: function() {\n Ember.run.once(this, function(){\n this.get(\'model\').validate();\n });\n }.observes(\'inventoryItem\'),\n \n actions: {\n update: function() {\n this.set(\'dateRequested\', new Date());\n this.set(\'requestedBy\', this.getUserName());\n this.send(\'fulfillRequest\', this.get(\'model\'));\n }\n }\n });\n });//# sourceURL=hospitalrun/inventory/delivery/controller.js"); +eval("define(\"hospitalrun/inventory/delivery/controller\", \n [\"hospitalrun/controllers/abstract-edit-controller\",\"hospitalrun/mixins/get-user-name\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var AbstractEditController = __dependency1__[\"default\"];\n \n var GetUserName = __dependency2__[\"default\"];\n\n __exports__[\"default\"] = AbstractEditController.extend(GetUserName, {\n needs: \'inventory\',\n \n inventoryItems: Ember.computed.alias(\'controllers.inventory.model\'),\n \n inventoryList: Ember.computed.filter(\'inventoryItems\', function(item) {\n return item.get(\'type\') !== \'Asset\';\n }),\n \n inventoryItemChanged: function() {\n Ember.run.once(this, function(){\n this.get(\'model\').validate();\n });\n }.observes(\'inventoryItem\'),\n \n actions: {\n update: function() {\n if (this.get(\'isNew\')) {\n this.set(\'dateRequested\', new Date());\n this.set(\'requestedBy\', this.getUserName());\n this.send(\'fulfillRequest\', this.get(\'model\'));\n }\n }\n }\n });\n });//# sourceURL=hospitalrun/inventory/delivery/controller.js"); eval("define(\"hospitalrun/mixins/get-user-name\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Mixin.create({\n getUserName: function() {\n var returnName = \'\',\n session = this.get(\'session\');\n if (!Ember.isEmpty(session) && session.isAuthenticated) {\n var sessionVars = session.store.restore();\n if (!Ember.isEmpty(sessionVars.name)) {\n returnName = sessionVars.name;\n }\n }\n return returnName;\n }\n });\n });//# sourceURL=hospitalrun/mixins/get-user-name.js"); eval("define(\"hospitalrun/inventory/delivery/route\", \n [\"hospitalrun/routes/abstract-edit-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractEditRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractEditRoute.extend({\n editTitle: \'Edit Request\', \n newTitle: \'New Request\'\n });\n });//# sourceURL=hospitalrun/inventory/delivery/route.js"); eval("define(\"hospitalrun/routes/abstract-edit-route\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Route.extend(Ember.SimpleAuth.AuthenticatedRouteMixin, {\n editTitle: null,\n newTitle: null,\n setupController: function(controller, model) {\n var sectionDetails = {};\n if (model.get(\'isNew\')) {\n sectionDetails.currentScreenTitle = this.get(\'newTitle\');\n } else {\n sectionDetails.currentScreenTitle = this.get(\'editTitle\');\n }\n this.send(\'setSectionHeader\', sectionDetails);\n this._super(controller, model);\n }\n });\n });//# sourceURL=hospitalrun/routes/abstract-edit-route.js"); @@ -74,7 +74,7 @@ eval("define(\"hospitalrun/inventory/delivery/view\", \n [\"hospitalrun/views/p eval("define(\"hospitalrun/inventory/edit/controller\", \n [\"hospitalrun/mixins/inventory-type-list\",\"hospitalrun/controllers/abstract-edit-controller\",\"exports\"],\n function(__dependency1__, __dependency2__, __exports__) {\n \"use strict\";\n var InventoryTypeList = __dependency1__[\"default\"];\n \n var AbstractEditController = __dependency2__[\"default\"];\n \n\n __exports__[\"default\"] = AbstractEditController.extend(InventoryTypeList, {\n canEditQuantity: function() {\n return (this.get(\'isNew\') || !this.get(\'showBatches\'));\n }.property(\'isNew\', \'showBatches\'),\n\n showNewBatch: function() {\n return (this.get(\'isNew\') && this.get(\'showBatches\'));\n }.property(\'isNew\', \'showBatches\'),\n \n showBatches: function() {\n return (this.get(\'type\') !== \'Asset\');\n }.property(\'type\'),\n \n actions: {\n deleteBatch: function(batch, expire) {\n var batches = this.get(\'batches\');\n if (expire) {\n batch.set(\'expired\', true);\n batch.save();\n } else {\n batches.removeObject(batch);\n batch.destroyRecord();\n }\n this.get(\'model\').updateQuantity();\n this.send(\'update\',true);\n this.send(\'closeModal\'); \n },\n\n showDeleteBatch: function(batch) {\n this.send(\'openModal\', \'inventory.batch.delete\', batch);\n },\n \n showEditBatch: function(batch) {\n this.send(\'openModal\', \'inventory.batch.edit\', batch);\n },\n \n showExpireBatch: function(batch) {\n batch.set(\'expire\', true);\n this.send(\'openModal\', \'inventory.batch.delete\', batch);\n },\n \n updateBatch: function(batch, updateQuantity) {\n if (updateQuantity) {\n this.get(\'model\').updateQuantity();\n this.send(\'update\',true);\n }\n this.send(\'closeModal\'); \n },\n },\n \n beforeUpdate: function() {\n if (this.get(\'isNew\')) {\n var newBatch = this.getProperties(\'batchCost\', \'batchNo\', \'expirationDate\', \'vendor\');\n newBatch.dateAdded = new Date();\n newBatch.originalQuantity = this.get(\'quantity\');\n newBatch.currentQuantity = newBatch.originalQuantity;\n var batch = this.get(\'store\').createRecord(\'inv-batch\', newBatch);\n batch.save();\n this.get(\'batches\').addObject(batch);\n } \n },\n\n \n afterUpdate: function(record) {\n this.transitionToRoute(\'/inventory/search/\'+record.get(\'id\'));\n }\n });\n });//# sourceURL=hospitalrun/inventory/edit/controller.js"); eval("define(\"hospitalrun/mixins/inventory-type-list\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.Mixin.create({\n inventoryTypes: [\n \'Asset\',\n \'Medication\',\n \'Supply\'\n ]\n });\n });//# sourceURL=hospitalrun/mixins/inventory-type-list.js"); eval("define(\"hospitalrun/inventory/edit/route\", \n [\"hospitalrun/routes/abstract-edit-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractEditRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractEditRoute.extend({\n editTitle: \'Edit Item\', \n newTitle: \'New Item\',\n \n actions: { \n deleteBatch: function(batch) {\n this.controller.send(\'deleteBatch\', batch);\n },\n \n expireBatch: function(batch) {\n this.controller.send(\'deleteBatch\', batch, true);\n },\n \n updateBatch: function(batch, updateQuantity) {\n this.controller.send(\'updateBatch\', batch, updateQuantity);\n }\n }\n });\n });//# sourceURL=hospitalrun/inventory/edit/route.js"); -eval("define(\"hospitalrun/inventory/edit/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"name\"),\n \'label\': (\"Name\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-text\'] || (depth0 && depth0[\'em-text\']),options={hash:{\n \'label\': (\"Description\"),\n \'property\': (\"description\"),\n \'rows\': (3)\n },hashTypes:{\'label\': \"STRING\",\'property\': \"STRING\",\'rows\': \"INTEGER\"},hashContexts:{\'label\': depth0,\'property\': depth0,\'rows\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-text\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-select\'] || (depth0 && depth0[\'em-select\']),options={hash:{\n \'label\': (\"Type\"),\n \'property\': (\"type\"),\n \'content\': (\"inventoryTypes\"),\n \'optionValuePath\': (\"content\"),\n \'optionLabelPath\': (\"content\")\n },hashTypes:{\'label\': \"STRING\",\'property\': \"STRING\",\'content\': \"ID\",\'optionValuePath\': \"STRING\",\'optionLabelPath\': \"STRING\"},hashContexts:{\'label\': depth0,\'property\': depth0,\'content\': depth0,\'optionValuePath\': depth0,\'optionLabelPath\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-select\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"crossReference\"),\n \'label\': (\"Cross Reference\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\" \\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"reorderPoint\"),\n \'label\': (\"Reorder Point\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"price\"),\n \'label\': (\"Price Per Unit\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n
\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showNewBatch\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(2, program2, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"canEditQuantity\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showNewBatch\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(8, program8, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showNewBatch\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(12, program12, data),fn:self.program(10, program10, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n \n data.buffer.push(\"\\n

Batch information

\\n \");\n }\n\n function program4(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"quantity\"),\n \'label\': (\"Quantity\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n return buffer;\n }\n\n function program6(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers.input || (depth0 && depth0.input),options={hash:{\n \'class\': (\"form-control\"),\n \'value\': (\"quantity\"),\n \'type\': (\"text\"),\n \'disabled\': (true)\n },hashTypes:{\'class\': \"STRING\",\'value\': \"ID\",\'type\': \"STRING\",\'disabled\': \"BOOLEAN\"},hashContexts:{\'class\': depth0,\'value\': depth0,\'type\': depth0,\'disabled\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"input\", options))));\n data.buffer.push(\"\\n
\\n \");\n return buffer;\n }\n\n function program8(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"batchCost\"),\n \'label\': (\"Batch Cost\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"batchNo\"),\n \'label\': (\"Batch Number\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-input\'] || (depth0 && depth0[\'date-picker-input\']),options={hash:{\n \'controls\': (\"my-datepicker\"),\n \'value\': (\"expirationDate\"),\n \'class\': (\"form-control\"),\n \'dateFormat\': (\"l\")\n },hashTypes:{\'controls\': \"STRING\",\'value\': \"ID\",\'class\': \"STRING\",\'dateFormat\': \"STRING\"},hashContexts:{\'controls\': depth0,\'value\': depth0,\'class\': depth0,\'dateFormat\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-controls\'] || (depth0 && depth0[\'date-picker-controls\']),options={hash:{\n \'id\': (\"my-datepicker\"),\n \'minYear\': (\"+0\"),\n \'maxYear\': (\"+100\"),\n \'dateFormat\': (\"l\")\n },hashTypes:{\'id\': \"STRING\",\'minYear\': \"STRING\",\'maxYear\': \"STRING\",\'dateFormat\': \"STRING\"},hashContexts:{\'id\': depth0,\'minYear\': depth0,\'maxYear\': depth0,\'dateFormat\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-controls\", options))));\n data.buffer.push(\" \\n
\\n \");\n return buffer;\n }\n\n function program10(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"vendor\"),\n \'label\': (\"Vendor\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n return buffer;\n }\n\n function program12(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showBatches\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(13, program13, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n return buffer;\n }\n function program13(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n

Batches

\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \");\n stack1 = helpers.each.call(depth0, \"batches\", {hash:{\n \'itemController\': (\"inventory/batch/item-controller\")\n },hashTypes:{\'itemController\': \"STRING\"},hashContexts:{\'itemController\': depth0},inverse:self.noop,fn:self.program(14, program14, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
Date AddedBatch CostCost Per UnitOriginal QuantityCurrent QuantityBatch NumberExpiration DateVendorAction
\\n \");\n return buffer;\n }\n function program14(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\" \\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-format\'] || (depth0 && depth0[\'date-format\']),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data},helper ? helper.call(depth0, \"dateAdded\", options) : helperMissing.call(depth0, \"date-format\", \"dateAdded\", options))));\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"batchCost\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"costPerUnit\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"originalQuantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"currentQuantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"batchNo\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\" \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"expirationDate\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"vendor\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers[\'if\'].call(depth0, \"expired\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(17, program17, data),fn:self.program(15, program15, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \\n \");\n return buffer;\n }\n function program15(depth0,data) {\n \n \n data.buffer.push(\"\\n Expired\\n \");\n }\n\n function program17(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers[\'if\'].call(depth0, \"canDelete\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(20, program20, data),fn:self.program(18, program18, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n return buffer;\n }\n function program18(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n \\n \");\n return buffer;\n }\n\n function program20(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n \\n \");\n return buffer;\n }\n\n stack1 = (helper = helpers[\'em-form\'] || (depth0 && depth0[\'em-form\']),options={hash:{\n \'model\': (\"\"),\n \'submit_button\': (false)\n },hashTypes:{\'model\': \"ID\",\'submit_button\': \"BOOLEAN\"},hashContexts:{\'model\': depth0,\'submit_button\': depth0},inverse:self.noop,fn:self.program(1, program1, data),contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-form\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/edit/template.js"); +eval("define(\"hospitalrun/inventory/edit/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"name\"),\n \'label\': (\"Name\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-text\'] || (depth0 && depth0[\'em-text\']),options={hash:{\n \'label\': (\"Description\"),\n \'property\': (\"description\"),\n \'rows\': (3)\n },hashTypes:{\'label\': \"STRING\",\'property\': \"STRING\",\'rows\': \"INTEGER\"},hashContexts:{\'label\': depth0,\'property\': depth0,\'rows\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-text\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-select\'] || (depth0 && depth0[\'em-select\']),options={hash:{\n \'label\': (\"Type\"),\n \'property\': (\"type\"),\n \'content\': (\"inventoryTypes\"),\n \'optionValuePath\': (\"content\"),\n \'optionLabelPath\': (\"content\")\n },hashTypes:{\'label\': \"STRING\",\'property\': \"STRING\",\'content\': \"ID\",\'optionValuePath\': \"STRING\",\'optionLabelPath\': \"STRING\"},hashContexts:{\'label\': depth0,\'property\': depth0,\'content\': depth0,\'optionValuePath\': depth0,\'optionLabelPath\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-select\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"crossReference\"),\n \'label\': (\"Cross Reference\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showBatches\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(2, program2, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showNewBatch\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(4, program4, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"canEditQuantity\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showNewBatch\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(10, program10, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showNewBatch\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(14, program14, data),fn:self.program(12, program12, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"reorderPoint\"),\n \'label\': (\"Reorder Point\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"price\"),\n \'label\': (\"Price Per Unit\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n
\\n \");\n return buffer;\n }\n\n function program4(depth0,data) {\n \n \n data.buffer.push(\"\\n

Batch information

\\n \");\n }\n\n function program6(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"quantity\"),\n \'label\': (\"Quantity\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n return buffer;\n }\n\n function program8(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers.input || (depth0 && depth0.input),options={hash:{\n \'class\': (\"form-control\"),\n \'value\': (\"quantity\"),\n \'type\': (\"text\"),\n \'disabled\': (true)\n },hashTypes:{\'class\': \"STRING\",\'value\': \"ID\",\'type\': \"STRING\",\'disabled\': \"BOOLEAN\"},hashContexts:{\'class\': depth0,\'value\': depth0,\'type\': depth0,\'disabled\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"input\", options))));\n data.buffer.push(\"\\n
\\n \");\n return buffer;\n }\n\n function program10(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"batchCost\"),\n \'label\': (\"Batch Cost\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"batchNo\"),\n \'label\': (\"Batch Number\"),\n \'class\': (\"col-sm-3\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n
\\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-input\'] || (depth0 && depth0[\'date-picker-input\']),options={hash:{\n \'controls\': (\"my-datepicker\"),\n \'value\': (\"expirationDate\"),\n \'class\': (\"form-control\"),\n \'dateFormat\': (\"l\")\n },hashTypes:{\'controls\': \"STRING\",\'value\': \"ID\",\'class\': \"STRING\",\'dateFormat\': \"STRING\"},hashContexts:{\'controls\': depth0,\'value\': depth0,\'class\': depth0,\'dateFormat\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-input\", options))));\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-picker-controls\'] || (depth0 && depth0[\'date-picker-controls\']),options={hash:{\n \'id\': (\"my-datepicker\"),\n \'minYear\': (\"+0\"),\n \'maxYear\': (\"+100\"),\n \'dateFormat\': (\"l\")\n },hashTypes:{\'id\': \"STRING\",\'minYear\': \"STRING\",\'maxYear\': \"STRING\",\'dateFormat\': \"STRING\"},hashContexts:{\'id\': depth0,\'minYear\': depth0,\'maxYear\': depth0,\'dateFormat\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"date-picker-controls\", options))));\n data.buffer.push(\" \\n
\\n \");\n return buffer;\n }\n\n function program12(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'em-input\'] || (depth0 && depth0[\'em-input\']),options={hash:{\n \'property\': (\"vendor\"),\n \'label\': (\"Vendor\")\n },hashTypes:{\'property\': \"STRING\",\'label\': \"STRING\"},hashContexts:{\'property\': depth0,\'label\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-input\", options))));\n data.buffer.push(\"\\n \");\n return buffer;\n }\n\n function program14(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showBatches\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(15, program15, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n return buffer;\n }\n function program15(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n

Batches

\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \");\n stack1 = helpers.each.call(depth0, \"batches\", {hash:{\n \'itemController\': (\"inventory/batch/item-controller\")\n },hashTypes:{\'itemController\': \"STRING\"},hashContexts:{\'itemController\': depth0},inverse:self.noop,fn:self.program(16, program16, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
Date AddedBatch CostCost Per UnitOriginal QuantityCurrent QuantityBatch NumberExpiration DateVendorAction
\\n \");\n return buffer;\n }\n function program16(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\" \\n \\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-format\'] || (depth0 && depth0[\'date-format\']),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data},helper ? helper.call(depth0, \"dateAdded\", options) : helperMissing.call(depth0, \"date-format\", \"dateAdded\", options))));\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"batchCost\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"costPerUnit\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"originalQuantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"currentQuantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"batchNo\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\" \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"expirationDate\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"vendor\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers[\'if\'].call(depth0, \"expired\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(19, program19, data),fn:self.program(17, program17, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \\n \");\n return buffer;\n }\n function program17(depth0,data) {\n \n \n data.buffer.push(\"\\n Expired\\n \");\n }\n\n function program19(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers[\'if\'].call(depth0, \"canDelete\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(22, program22, data),fn:self.program(20, program20, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n return buffer;\n }\n function program20(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n \\n \");\n return buffer;\n }\n\n function program22(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n \\n \");\n return buffer;\n }\n\n stack1 = (helper = helpers[\'em-form\'] || (depth0 && depth0[\'em-form\']),options={hash:{\n \'model\': (\"\"),\n \'submit_button\': (false)\n },hashTypes:{\'model\': \"ID\",\'submit_button\': \"BOOLEAN\"},hashContexts:{\'model\': depth0,\'submit_button\': depth0},inverse:self.noop,fn:self.program(1, program1, data),contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"em-form\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/edit/template.js"); eval("define(\"hospitalrun/inventory/edit/view\", \n [\"hospitalrun/views/panel\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var PanelView = __dependency1__[\"default\"];\n __exports__[\"default\"] = PanelView.extend();\n });//# sourceURL=hospitalrun/inventory/edit/view.js"); eval("define(\"hospitalrun/inventory/fulfill/controller\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.ObjectController.extend({\n title: \'Fulfill Request\',\n updateButtonText: \'Fulfill\',\n updateButtonAction: \'fulfill\',\n isUpdateDisabled: function() {\n var item = this.get(\'inventoryItem\');\n return (this.get(\'quantity\') > item.get(\'quantity\'));\n }.property(\'inventoryItem\'),\n \n actions: {\n cancel: function() {\n this.send(\'closeModal\');\n },\n \n fulfill: function() {\n this.send(\'fulfillRequest\', this.get(\'model\'), true); \n }\n }\n });\n });//# sourceURL=hospitalrun/inventory/fulfill/controller.js"); eval("define(\"hospitalrun/inventory/fulfill/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1;\n\n\n data.buffer.push(\"
\\n \\n Are you sure you wish to fulfill the following request?\\n
\\n
\\n
\\n \\n

\");\n stack1 = helpers._triageMustache.call(depth0, \"inventoryItem.name\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"

\\n
\\n
\\n \\n

\");\n stack1 = helpers._triageMustache.call(depth0, \"quantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"

\\n
\\n
\\n \\n

\");\n stack1 = helpers._triageMustache.call(depth0, \"inventoryItem.quantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"

\\n
\\n
\\n\\n\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/inventory/fulfill/template.js"); @@ -84,11 +84,11 @@ eval("define(\"hospitalrun/inventory/index/route\", \n [\"hospitalrun/routes/ab eval("define(\"hospitalrun/inventory/index/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \\n \\n \\n \\n \\n \\n \\n \");\n stack1 = helpers.each.call(depth0, {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(2, program2, data),contexts:[],types:[],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
NameQuantityRequested OnRequested ByActions
\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"inventoryItem.name\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"quantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'date-format\'] || (depth0 && depth0[\'date-format\']),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data},helper ? helper.call(depth0, \"dateRequested\", options) : helperMissing.call(depth0, \"date-format\", \"dateRequested\", options))));\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"requestedBy\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \\n \\n \\n \");\n return buffer;\n }\n\n function program4(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n
\\n No requests found. Create a new delivery? \\n
\\n\");\n return buffer;\n }\n\n stack1 = helpers[\'if\'].call(depth0, \"hasRecords\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/index/template.js"); eval("define(\"hospitalrun/inventory/index/view\", \n [\"hospitalrun/views/item-listing\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var ItemListingView = __dependency1__[\"default\"];\n __exports__[\"default\"] = ItemListingView.extend();\n });//# sourceURL=hospitalrun/inventory/index/view.js"); eval("define(\"hospitalrun/inventory/item-controller/controller\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = Ember.ObjectController.extend({ \n showAdd: function() {\n return (this.get(\'type\') !== \'Asset\');\n }.property(\'type\')\n });\n });//# sourceURL=hospitalrun/inventory/item-controller/controller.js"); -eval("define(\"hospitalrun/inventory/listing/controller\", \n [\"hospitalrun/controllers/abstract-paged-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractPagedController = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractPagedController.extend();\n });//# sourceURL=hospitalrun/inventory/listing/controller.js"); +eval("define(\"hospitalrun/inventory/listing/controller\", \n [\"hospitalrun/controllers/abstract-paged-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractPagedController = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractPagedController.extend({\n sortProperties: [\'name\', \'type\'],\n });\n });//# sourceURL=hospitalrun/inventory/listing/controller.js"); eval("define(\"hospitalrun/inventory/listing/route\", \n [\"hospitalrun/routes/abstract-index-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractIndexRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractIndexRoute.extend({\n newButtonAction: \'newItem\',\n newButtonText: \'+ new item\',\n pageTitle: \'Inventory Listing\'\n });\n });//# sourceURL=hospitalrun/inventory/listing/route.js"); eval("define(\"hospitalrun/inventory/listing/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, escapeExpression=this.escapeExpression, self=this, helperMissing=helpers.helperMissing;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \");\n stack1 = helpers.each.call(depth0, {hash:{\n \'itemController\': (\"inventory/item-controller\")\n },hashTypes:{\'itemController\': \"STRING\"},hashContexts:{\'itemController\': depth0},inverse:self.noop,fn:self.program(2, program2, data),contexts:[],types:[],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
IDNameDescriptionTypeQuantityPriceXRefActions
\\n\");\n return buffer;\n }\n function program2(depth0,data) {\n \n var buffer = \'\', stack1;\n data.buffer.push(\"\\n \");\n stack1 = helpers.unless.call(depth0, \"isNew\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(3, program3, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n return buffer;\n }\n function program3(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"id\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"name\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"description\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"type\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"quantity\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"price\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"crossReference\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \");\n stack1 = helpers[\'if\'].call(depth0, \"showAdd\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(4, program4, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\" \\n \\n \\n \");\n stack1 = (helper = helpers[\'link-to\'] || (depth0 && depth0[\'link-to\']),options={hash:{\n \'class\': (\"btn btn-default\")\n },hashTypes:{\'class\': \"STRING\"},hashContexts:{\'class\': depth0},inverse:self.noop,fn:self.program(6, program6, data),contexts:[depth0,depth0],types:[\"STRING\",\"ID\"],data:data},helper ? helper.call(depth0, \"inventory.barcode\", \"\", options) : helperMissing.call(depth0, \"link-to\", \"inventory.barcode\", \"\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n \\n \\n \");\n return buffer;\n }\n function program4(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n \\n \");\n return buffer;\n }\n\n function program6(depth0,data) {\n \n \n data.buffer.push(\"Barcode\");\n }\n\n function program8(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n
\\n No items found. Create a new record? \\n
\\n\");\n return buffer;\n }\n\n stack1 = helpers[\'if\'].call(depth0, \"hasRecords\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.program(8, program8, data),fn:self.program(1, program1, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/listing/template.js"); eval("define(\"hospitalrun/inventory/listing/view\", \n [\"hospitalrun/views/item-listing\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var ItemListingView = __dependency1__[\"default\"];\n __exports__[\"default\"] = ItemListingView.extend();\n });//# sourceURL=hospitalrun/inventory/listing/view.js"); -eval("define(\"hospitalrun/inventory/route\", \n [\"hospitalrun/routes/abstract-module-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModuleRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractModuleRoute.extend({\n currentItem: null,\n modelName: \'inventory\',\n moduleName: \'inventory\',\n newButtonAction: \'newDelivery\',\n newButtonText: \'+ new delivery\',\n subActions: [{\n text: \'Requests\',\n linkTo: \'inventory.index\'\n }, {\n text: \'Items\',\n linkTo: \'inventory.listing\'\n }, {\n text: \'History\',\n linkTo: \'inventory.completed\'\n }],\n sectionTitle: \'Inventory\',\n \n actions: {\n addBatch: function(newBatch) {\n var currentItem = this.get(\'currentItem\'),\n batches = currentItem.get(\'batches\');\n batches.addObject(newBatch);\n currentItem.updateQuantity();\n currentItem.save();\n this.send(\'closeModal\');\n },\n \n fulfillRequest: function(request, closeModal) {\n request.fulfillRequest().then(function() {\n var inventoryItem = request.get(\'inventoryItem\'),\n promises = [],\n requestBatches = request.get(\'batches\');\n requestBatches.forEach(function(batch) {\n promises.push(batch.save());\n });\n promises.push(inventoryItem.get(\'content\').save());\n promises.push(request.save());\n Ember.RSVP.all(promises,\'All saving done for inventory fulfillment\').then(function(){\n if (closeModal) {\n this.send(\'closeModal\');\n }\n this.transitionTo(\'inventory.completed\');\n }.bind(this));\n }.bind(this));\n },\n\n newDelivery: function() {\n var item = this.get(\'store\').createRecord(\'inv-request\', {}); \n this.transitionTo(\'inventory.delivery\', item);\n },\n \n showAddBatch: function(inventoryItem) {\n var newBatch = this.get(\'store\').createRecord(\'inv-batch\', {}); \n this.set(\'currentItem\', inventoryItem);\n this.send(\'openModal\', \'inventory.batch.edit\', newBatch);\n } \n\n },\n \n /**\n * Calculate a new id based on time stamp and randomized number\n * @return a generated id in base 36 so that its a shorter barcode.\n */\n generateId: function() {\n var min = 1,\n max = 999,\n part1 = new Date().getTime(),\n part2 = Math.floor(Math.random() * (max - min + 1)) + min;\n return part1.toString(36) +\'_\' + part2.toString(36);\n },\n \n /**\n * Define what data a new inventory item should be instantiated with. \n * The only default is to set the type to asset; at some point this may be driven by subsection of inventory you are in.\n * @return the default properties for a new inventory item.\n */ \n getNewData: function() {\n return {\n type: \'Asset\'\n };\n },\n\n });\n });//# sourceURL=hospitalrun/inventory/route.js"); +eval("define(\"hospitalrun/inventory/route\", \n [\"hospitalrun/routes/abstract-module-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModuleRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractModuleRoute.extend({\n currentItem: null,\n modelName: \'inventory\',\n moduleName: \'inventory\',\n newButtonAction: \'newDelivery\',\n newButtonText: \'+ new delivery\',\n subActions: [{\n text: \'Requests\',\n linkTo: \'inventory.index\'\n }, {\n text: \'Items\',\n linkTo: \'inventory.listing\'\n }, {\n text: \'History\',\n linkTo: \'inventory.completed\'\n }],\n sectionTitle: \'Inventory\',\n \n actions: {\n addBatch: function(newBatch) {\n var currentItem = this.get(\'currentItem\'),\n batches = currentItem.get(\'batches\');\n batches.addObject(newBatch);\n currentItem.updateQuantity();\n currentItem.save();\n this.send(\'closeModal\');\n },\n \n allItems: function() {\n this.transitionTo(\'inventory.listing\');\n }, \n \n fulfillRequest: function(request, closeModal) {\n request.fulfillRequest().then(function() {\n var inventoryItem = request.get(\'inventoryItem\'),\n promises = [],\n requestBatches = request.get(\'batches\');\n requestBatches.forEach(function(batch) {\n promises.push(batch.save());\n });\n promises.push(inventoryItem.get(\'content\').save());\n promises.push(request.save());\n Ember.RSVP.all(promises,\'All saving done for inventory fulfillment\').then(function(){\n if (closeModal) {\n this.send(\'closeModal\');\n }\n this.transitionTo(\'inventory.completed\');\n }.bind(this));\n }.bind(this));\n },\n\n newDelivery: function() {\n var item = this.get(\'store\').createRecord(\'inv-request\', {}); \n this.transitionTo(\'inventory.delivery\', item);\n },\n \n showAddBatch: function(inventoryItem) {\n var newBatch = this.get(\'store\').createRecord(\'inv-batch\', {}); \n this.set(\'currentItem\', inventoryItem);\n this.send(\'openModal\', \'inventory.batch.edit\', newBatch);\n } \n\n },\n \n /**\n * Calculate a new id based on time stamp and randomized number\n * @return a generated id in base 36 so that its a shorter barcode.\n */\n generateId: function() {\n var min = 1,\n max = 999,\n part1 = new Date().getTime(),\n part2 = Math.floor(Math.random() * (max - min + 1)) + min;\n return part1.toString(36) +\'_\' + part2.toString(36);\n },\n \n /**\n * Define what data a new inventory item should be instantiated with. \n * The only default is to set the type to asset; at some point this may be driven by subsection of inventory you are in.\n * @return the default properties for a new inventory item.\n */ \n getNewData: function() {\n return {\n type: \'Asset\'\n };\n },\n\n });\n });//# sourceURL=hospitalrun/inventory/route.js"); eval("define(\"hospitalrun/inventory/search/route\", \n [\"hospitalrun/routes/abstract-search-route\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractSearchRoute = __dependency1__[\"default\"];\n __exports__[\"default\"] = AbstractSearchRoute.extend({\n moduleName: \'inventory\',\n searchKeys: [\n \'_id\',\n \'description\',\n \'name\',\n \'crossreference\'\n ],\n searchModel: \'inventory\'\n });\n });//# sourceURL=hospitalrun/inventory/search/route.js"); eval("define(\"hospitalrun/inventory/search/template\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \");\n data.buffer.push(escapeExpression((helper = helpers.partial || (depth0 && depth0.partial),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"STRING\"],data:data},helper ? helper.call(depth0, \"inventory/listing\", options) : helperMissing.call(depth0, \"partial\", \"inventory/listing\", options))));\n data.buffer.push(\"\\n\");\n return buffer;\n }\n\n stack1 = helpers.view.call(depth0, \"search-listing\", {hash:{\n \'newButtonText\': (\"New Item\"),\n \'allButtonText\': (\"All Inventory\")\n },hashTypes:{\'newButtonText\': \"STRING\",\'allButtonText\': \"STRING\"},hashContexts:{\'newButtonText\': depth0,\'allButtonText\': depth0},inverse:self.noop,fn:self.program(1, program1, data),contexts:[depth0],types:[\"STRING\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/inventory/search/template.js"); eval("define(\"hospitalrun/invoices/delete/controller\", \n [\"hospitalrun/controllers/abstract-delete-controller\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractDeleteController = __dependency1__[\"default\"];\n \n __exports__[\"default\"] = AbstractDeleteController.extend({\n title: \'Delete Invoice\'\n });\n });//# sourceURL=hospitalrun/invoices/delete/controller.js"); @@ -129,7 +129,7 @@ eval("define(\"hospitalrun/utils/diagnosis-validation\", \n [\"exports\"],\n f eval("define(\"hospitalrun/models/appointment\", \n [\"hospitalrun/models/abstract\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModel = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = AbstractModel.extend({\n patientId: DS.attr(\'string\'),\n staffId: DS.attr(\'string\'),\n locationId: DS.attr(\'string\'),\n appointmentType: DS.attr(\'string\'),\n appointmentDate: DS.attr(\'date\'),\n note: DS.attr(\'string\'),\n validations: {\n patientId: {\n presence: true\n },\n appointmentType: {\n presence: true\n },\n locationId: {\n presence: true\n },\n appointmentDate: {\n presence: true\n } \n }\n });\n });//# sourceURL=hospitalrun/models/appointment.js"); eval("define(\"hospitalrun/models/config\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = DS.Model.extend({\n value: DS.attr(\'\') \n });\n });//# sourceURL=hospitalrun/models/config.js"); eval("define(\"hospitalrun/models/inv-batch\", \n [\"hospitalrun/models/abstract\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModel = __dependency1__[\"default\"];\n /**\n * Model to represent a batch within an inventory item.\n * File/model name is inv-batch because using inventory-batch will cause batch \n * items to be shown as inventory items since the pouchdb adapter does a \n * retrieve for keys starting with \'inventory\' to fetch inventory items.\n */ \n var InventoryBatchItem = AbstractModel.extend({\n batchCost: DS.attr(\'number\'), \n batchNo: DS.attr(\'string\'),\n dateAdded: DS.attr(\'date\'),\n costPerUnit: function() {\n var batchCost = this.get(\'batchCost\'),\n quantity = parseInt(this.get(\'originalQuantity\'));\n if (Ember.isEmpty(batchCost) || Ember.isEmpty(quantity)) {\n return 0;\n }\n return (batchCost/quantity).toFixed(2);\n }.property(\'batchCost\', \'originalQuantity\'),\n originalQuantity: DS.attr(\'number\'),\n currentQuantity: DS.attr(\'number\'),\n expirationDate: DS.attr(),\n expired: DS.attr(\'boolean\'),\n vendor: DS.attr(\'string\'), \n validations: {\n batchCost: {\n numericality: true\n },\n originalQuantity: {\n numericality: true\n }\n }\n });\n\n __exports__[\"default\"] = InventoryBatchItem;\n });//# sourceURL=hospitalrun/models/inv-batch.js"); -eval("define(\"hospitalrun/models/inv-request\", \n [\"hospitalrun/models/abstract\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModel = __dependency1__[\"default\"];\n /**\n * Model to represent a request for inventory items.\n */ \n var InventoryRequest = AbstractModel.extend({\n inventoryItem: DS.belongsTo(\'inventory\', { async: true }),\n status: DS.attr(\'string\'),\n quantity: DS.attr(\'number\'),\n fulfilledBy: DS.attr(\'string\'),\n dateFulfilled: DS.attr(\'date\'),\n dateRequested: DS.attr(\'date\'),\n requestedBy: DS.attr(\'string\'),\n batches: DS.hasMany(\'inv-batch\', { async: true }),\n costPerUnit: DS.attr(\'number\'), \n quantityAtFulfillment: DS.attr(\'number\'), \n validations: {\n inventoryItemTypeAhead: {\n acceptance: {\n accept: true,\n if: function(object) {\n var itemName = object.get(\'inventoryItem.name\'),\n itemTypeAhead = object.get(\'inventoryItemTypeAhead\');\n if (Ember.isEmpty(itemName) || Ember.isEmpty(itemTypeAhead)) {\n //force validation to fail\n return true;\n } else {\n var typeAheadName = itemTypeAhead.substr(0, itemName.length);\n if (itemName !== typeAheadName) {\n return true;\n }\n }\n //Inventory item is properly selected; don\'t do any further validation\n return false;\n\n }, \n message: \'Please select a valid inventory item\'\n }\n },\n quantity: {\n numericality: true,\n acceptance: {\n accept: true,\n if: function(object) {\n var itemQuantity = object.get(\'inventoryItem.quantity\'),\n requestQuantity = parseInt(object.get(\'quantity\'));\n if ( requestQuantity > itemQuantity) {\n //force validation to fail\n return true;\n } else {\n //Diagnosis is properly set; don\'t do any further validation\n return false;\n }\n }, \n message: \'The quantity must be less than or equal to the number of available items.\'\n }\n }\n },\n\n /**\n * Fulfill the request, decrementing from the batches available on the inventory item\n * This function doesn\'t save anything, it just updates the objects in memory, so \n * a route will need to ensure that the models affected here get updated.\n * @returns true if the request is fulfilled; false if it cannot be fulfilled due to a lack\n * of stock.\n */\n fulfillRequest: function() {\n return new Ember.RSVP.Promise(function(resolve, reject){\n var item = this.get(\'inventoryItem\'),\n batches = item.get(\'batches\'),\n promises = [],\n quantityOnHand = item.get(\'quantity\'),\n quantityRequested = this.get(\'quantity\'),\n requestBatches = this.get(\'batches\');\n \n if (quantityOnHand >= quantityRequested) {\n promises.push(item, requestBatches);\n Ember.RSVP.all(promises,\'All fetching done for inventory fulfillment\').then(function(){\n var findResult = this.findQuantity(batches, item, requestBatches);\n if (findResult === true) {\n resolve();\n } else {\n reject(findResult);\n }\n }.bind(this));\n } else {\n reject(\'The quantity on hand, %@ is less than the requested quantity of %@.\'.fmt(quantityOnHand,quantityRequested));\n }\n }.bind(this));\n },\n\n findQuantity: function(batches, item, requestBatches) {\n var currentQuantity,\n costPerUnit,\n quantityOnHand = item.get(\'quantity\'),\n quantityRequested = this.get(\'quantity\'),\n quantityNeeded = quantityRequested,\n totalCost = 0;\n \n var foundQuantity = batches.any(function(batch) {\n currentQuantity = batch.get(\'currentQuantity\');\n if (batch.get(\'expired\') || currentQuantity <= 0) {\n return false;\n }\n costPerUnit = batch.get(\'costPerUnit\');\n if (quantityNeeded > currentQuantity) {\n totalCost += (costPerUnit * currentQuantity);\n quantityNeeded = quantityNeeded - currentQuantity;\n currentQuantity = 0;\n } else {\n totalCost += (costPerUnit * quantityNeeded);\n currentQuantity = currentQuantity - quantityNeeded;\n quantityNeeded = 0;\n }\n batch.set(\'currentQuantity\',currentQuantity);\n requestBatches.addObject(batch);\n return (quantityNeeded === 0);\n });\n if (!foundQuantity) {\n return \'Could not find any batches that had the required quantity:\'+quantityRequested;\n }\n this.set(\'costPerUnit\', (totalCost/quantityRequested).toFixed(2));\n this.set(\'quantityAtFulfillment\', quantityOnHand);\n this.set(\'status\',\'Fulfilled\');\n this.set(\'dateFulfilled\', new Date());\n this.set(\'fulfilledBy\', this.getUserName());\n item.get(\'content\').updateQuantity();\n return true;\n }\n });\n\n __exports__[\"default\"] = InventoryRequest;\n });//# sourceURL=hospitalrun/models/inv-request.js"); +eval("define(\"hospitalrun/models/inv-request\", \n [\"hospitalrun/models/abstract\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModel = __dependency1__[\"default\"];\n /**\n * Model to represent a request for inventory items.\n */ \n var InventoryRequest = AbstractModel.extend({\n inventoryItem: DS.belongsTo(\'inventory\', { async: true }),\n status: DS.attr(\'string\'),\n quantity: DS.attr(\'number\'),\n fulfilledBy: DS.attr(\'string\'),\n dateFulfilled: DS.attr(\'date\'),\n dateRequested: DS.attr(\'date\'),\n requestedBy: DS.attr(\'string\'),\n batches: DS.hasMany(\'inv-batch\', { async: true }),\n costPerUnit: DS.attr(\'number\'), \n quantityAtFulfillment: DS.attr(\'number\'), \n validations: {\n inventoryItemTypeAhead: {\n acceptance: {\n accept: true,\n if: function(object) {\n if (!object.get(\'isDirty\')) {\n return false;\n }\n var itemName = object.get(\'inventoryItem.name\'),\n itemTypeAhead = object.get(\'inventoryItemTypeAhead\');\n if (Ember.isEmpty(itemName) || Ember.isEmpty(itemTypeAhead)) {\n //force validation to fail\n return true;\n } else {\n var typeAheadName = itemTypeAhead.substr(0, itemName.length);\n if (itemName !== typeAheadName) {\n return true;\n }\n }\n //Inventory item is properly selected; don\'t do any further validation\n return false;\n\n }, \n message: \'Please select a valid inventory item\'\n }\n },\n quantity: {\n numericality: true,\n acceptance: {\n accept: true,\n if: function(object) {\n var itemQuantity = object.get(\'inventoryItem.quantity\'),\n requestQuantity = parseInt(object.get(\'quantity\'));\n if ( requestQuantity > itemQuantity) {\n //force validation to fail\n return true;\n } else {\n //Diagnosis is properly set; don\'t do any further validation\n return false;\n }\n }, \n message: \'The quantity must be less than or equal to the number of available items.\'\n }\n }\n },\n\n /**\n * Fulfill the request, decrementing from the batches available on the inventory item\n * This function doesn\'t save anything, it just updates the objects in memory, so \n * a route will need to ensure that the models affected here get updated.\n * @returns true if the request is fulfilled; false if it cannot be fulfilled due to a lack\n * of stock.\n */\n fulfillRequest: function() {\n return new Ember.RSVP.Promise(function(resolve, reject){\n var item = this.get(\'inventoryItem\'),\n batches = item.get(\'batches\'),\n promises = [],\n quantityOnHand = item.get(\'quantity\'),\n quantityRequested = this.get(\'quantity\'),\n requestBatches = this.get(\'batches\');\n \n if (quantityOnHand >= quantityRequested) {\n promises.push(item, requestBatches);\n Ember.RSVP.all(promises,\'All fetching done for inventory fulfillment\').then(function(){\n var findResult = this.findQuantity(batches, item, requestBatches);\n if (findResult === true) {\n resolve();\n } else {\n reject(findResult);\n }\n }.bind(this));\n } else {\n reject(\'The quantity on hand, %@ is less than the requested quantity of %@.\'.fmt(quantityOnHand,quantityRequested));\n }\n }.bind(this));\n },\n\n findQuantity: function(batches, item, requestBatches) {\n var currentQuantity,\n costPerUnit,\n quantityOnHand = item.get(\'quantity\'),\n quantityRequested = this.get(\'quantity\'),\n quantityNeeded = quantityRequested,\n totalCost = 0;\n \n var foundQuantity = batches.any(function(batch) {\n currentQuantity = batch.get(\'currentQuantity\');\n if (batch.get(\'expired\') || currentQuantity <= 0) {\n return false;\n }\n costPerUnit = batch.get(\'costPerUnit\');\n if (quantityNeeded > currentQuantity) {\n totalCost += (costPerUnit * currentQuantity);\n quantityNeeded = quantityNeeded - currentQuantity;\n currentQuantity = 0;\n } else {\n totalCost += (costPerUnit * quantityNeeded);\n currentQuantity = currentQuantity - quantityNeeded;\n quantityNeeded = 0;\n }\n batch.set(\'currentQuantity\',currentQuantity);\n requestBatches.addObject(batch);\n return (quantityNeeded === 0);\n });\n if (!foundQuantity) {\n return \'Could not find any batches that had the required quantity:\'+quantityRequested;\n }\n this.set(\'costPerUnit\', (totalCost/quantityRequested).toFixed(2));\n this.set(\'quantityAtFulfillment\', quantityOnHand);\n this.set(\'status\',\'Fulfilled\');\n this.set(\'dateFulfilled\', new Date());\n this.set(\'fulfilledBy\', this.getUserName());\n item.get(\'content\').updateQuantity();\n return true;\n }\n });\n\n __exports__[\"default\"] = InventoryRequest;\n });//# sourceURL=hospitalrun/models/inv-request.js"); eval("define(\"hospitalrun/models/inventory\", \n [\"hospitalrun/models/abstract\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModel = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = AbstractModel.extend({\n batches: DS.hasMany(\'inv-batch\'),\n description: DS.attr(\'string\'),\n keywords: DS.attr(),\n name: DS.attr(\'string\'),\n quantity: DS.attr(\'number\'),\n crossReference: DS.attr(\'string\'),\n type: DS.attr(\'string\'),\n price: DS.attr(\'number\'),\n reorderPoint: DS.attr(\'number\'),\n validations: {\n batchCost: {\n numericality: {\n if: function(object) {\n //Only validate on new items that are not assets\n return (object.get(\'isNew\') && object.get(\'type\') !== \'Asset\');\n }\n }\n },\n name: {\n presence: true,\n },\n quantity: {\n numericality: true\n },\n price: {\n numericality: {\n allowBlank: true\n }\n },\n reorderPoint: {\n numericality: {\n allowBlank: true\n }\n }\n },\n\n updateQuantity: function() {\n if (this.get(\'type\') === \'Asset\') {\n //Asset quantity is edited directly\n return;\n }\n var batches = this.get(\'batches\');\n var newQuantity = batches.reduce(function(previousItem, currentItem) {\n var currentQuantity = 0;\n if (!currentItem.get(\'expired\')) {\n currentQuantity = currentItem.get(\'currentQuantity\');\n }\n return previousItem + currentQuantity;\n }, 0);\n this.set(\'quantity\', newQuantity);\n }\n\n });\n });//# sourceURL=hospitalrun/models/inventory.js"); eval("define(\"hospitalrun/models/invoice\", \n [\"hospitalrun/models/abstract\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var AbstractModel = __dependency1__[\"default\"];\n\n __exports__[\"default\"] = AbstractModel.extend({\n invoiceId: DS.attr(\'string\'),\n invoiceNumber: DS.attr(\'number\'),\n patientId: DS.attr(\'string\'),\n publishStatus: DS.attr(\'string\'),\n publishDate: DS.attr(\'date\'),\n priceTotal: DS.attr(\'number\'),\n paidTotal: DS.attr(\'number\'),\n paidStatus: DS.attr(\'boolean\', {defaultValue: false}),\n paymentProfile: DS.attr(\'string\'),\n payments: [],\n billableEvents: [],\n lineItems: [],\n validations: {\n invoiceNumber: {\n numericality: true\n },\n priceTotal: {\n numericality: {\n allowBlank: true\n }\n },\n paidTotal: {\n numericality: {\n allowBlank: true\n }\n }\n }\n });\n });//# sourceURL=hospitalrun/models/invoice.js"); eval("define(\"hospitalrun/models/lookup\", \n [\"exports\"],\n function(__exports__) {\n \"use strict\";\n __exports__[\"default\"] = DS.Model.extend({\n value: DS.attr(\'\') \n });\n });//# sourceURL=hospitalrun/models/lookup.js"); @@ -167,7 +167,7 @@ eval("define(\"hospitalrun/templates/loading\", \n [\"ember\",\"exports\"],\n eval("define(\"hospitalrun/templates/login\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', escapeExpression=this.escapeExpression;\n\n\n data.buffer.push(\"
\\n
\\n \\n
\\n \\n \");\n data.buffer.push(escapeExpression(helpers.view.call(depth0, \"Ember.TextField\", {hash:{\n \'id\': (\"identification\"),\n \'valueBinding\': (\"identification\"),\n \'placeholder\': (\"Enter Login\"),\n \'class\': (\"form-control\")\n },hashTypes:{\'id\': \"STRING\",\'valueBinding\': \"STRING\",\'placeholder\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'id\': depth0,\'valueBinding\': depth0,\'placeholder\': depth0,\'class\': depth0},contexts:[depth0],types:[\"ID\"],data:data})));\n data.buffer.push(\"\\n
\\n
\\n \\n \");\n data.buffer.push(escapeExpression(helpers.view.call(depth0, \"Ember.TextField\", {hash:{\n \'id\': (\"password\"),\n \'type\': (\"password\"),\n \'valueBinding\': (\"password\"),\n \'placeholder\': (\"Enter Password\"),\n \'class\': (\"form-control\")\n },hashTypes:{\'id\': \"STRING\",\'type\': \"STRING\",\'valueBinding\': \"STRING\",\'placeholder\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'id\': depth0,\'type\': depth0,\'valueBinding\': depth0,\'placeholder\': depth0,\'class\': depth0},contexts:[depth0],types:[\"ID\"],data:data})));\n data.buffer.push(\"\\n
\\n \\n
\\n
\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/login.js"); eval("define(\"hospitalrun/templates/modal\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1, escapeExpression=this.escapeExpression;\n\n\n data.buffer.push(\"
\\n
\\n
\\n
\\n \\n

\");\n stack1 = helpers._triageMustache.call(depth0, \"title\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"

\\n
\\n
\\n \");\n stack1 = helpers._triageMustache.call(depth0, \"yield\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/modal.js"); eval("define(\"hospitalrun/templates/navigation\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\', helper, options;\n data.buffer.push(\"\\n \\n
\\n
\\n \");\n data.buffer.push(escapeExpression((helper = helpers[\'text-search\'] || (depth0 && depth0[\'text-search\']),options={hash:{\n \'valueBinding\': (\"searchText\"),\n \'autofocus\': (\"true\"),\n \'placeholder\': (\"Search\"),\n \'class\': (\"form-control\")\n },hashTypes:{\'valueBinding\': \"STRING\",\'autofocus\': \"STRING\",\'placeholder\': \"STRING\",\'class\': \"STRING\"},hashContexts:{\'valueBinding\': depth0,\'autofocus\': depth0,\'placeholder\': depth0,\'class\': depth0},contexts:[],types:[],data:data},helper ? helper.call(depth0, options) : helperMissing.call(depth0, \"text-search\", options))));\n data.buffer.push(\" \\n
\\n \\n
\\n \");\n return buffer;\n }\n\n function program3(depth0,data) {\n \n \n data.buffer.push(\"Users\");\n }\n\n function program5(depth0,data) {\n \n \n data.buffer.push(\"Inventory\");\n }\n\n function program7(depth0,data) {\n \n \n data.buffer.push(\"Appointments\");\n }\n\n function program9(depth0,data) {\n \n \n data.buffer.push(\"Medication\");\n }\n\n function program11(depth0,data) {\n \n \n data.buffer.push(\"Patients\");\n }\n\n function program13(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n
  • Logout
  • \\n \");\n return buffer;\n }\n\n function program15(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n
  • \");\n stack1 = (helper = helpers[\'link-to\'] || (depth0 && depth0[\'link-to\']),options={hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(16, program16, data),contexts:[depth0],types:[\"STRING\"],data:data},helper ? helper.call(depth0, \"login\", options) : helperMissing.call(depth0, \"link-to\", \"login\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"
  • \\n \");\n return buffer;\n }\n function program16(depth0,data) {\n \n \n data.buffer.push(\"Login\");\n }\n\n data.buffer.push(\"\\n\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/navigation.js"); -eval("define(\"hospitalrun/templates/paging\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', escapeExpression=this.escapeExpression;\n\n\n data.buffer.push(\"
    \\n \\n \\n
    \");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/paging.js"); +eval("define(\"hospitalrun/templates/paging\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var stack1, escapeExpression=this.escapeExpression, self=this;\n\n function program1(depth0,data) {\n \n var buffer = \'\';\n data.buffer.push(\"\\n
    \\n \\n \\n
    \\n\");\n return buffer;\n }\n\n stack1 = helpers[\'if\'].call(depth0, \"showPagination\", {hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(1, program1, data),contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n \n });\n });//# sourceURL=hospitalrun/templates/paging.js"); eval("define(\"hospitalrun/templates/panel\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1, escapeExpression=this.escapeExpression;\n\n\n data.buffer.push(\"
    \\n
    \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"yield\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
    \\n
    \\n \\n \\n
    \\n
    \");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/panel.js"); eval("define(\"hospitalrun/templates/search-listing\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1, escapeExpression=this.escapeExpression;\n\n\n data.buffer.push(\"
    \\n
    \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"yield\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
    \\n
    \\n\\n\\n\");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/search-listing.js"); eval("define(\"hospitalrun/templates/section\", \n [\"ember\",\"exports\"],\n function(__dependency1__, __exports__) {\n \"use strict\";\n var Ember = __dependency1__[\"default\"];\n __exports__[\"default\"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {\n this.compilerInfo = [4,\'>= 1.0.0\'];\n helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};\n var buffer = \'\', stack1, self=this, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;\n\n function program1(depth0,data) {\n \n var buffer = \'\', stack1, helper, options;\n data.buffer.push(\"\\n
  • \");\n stack1 = (helper = helpers[\'link-to\'] || (depth0 && depth0[\'link-to\']),options={hash:{},hashTypes:{},hashContexts:{},inverse:self.noop,fn:self.program(2, program2, data),contexts:[depth0],types:[\"ID\"],data:data},helper ? helper.call(depth0, \"linkTo\", options) : helperMissing.call(depth0, \"link-to\", \"linkTo\", options));\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"
  • \\n \");\n return buffer;\n }\n function program2(depth0,data) {\n \n var stack1;\n stack1 = helpers._triageMustache.call(depth0, \"text\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n else { data.buffer.push(\'\'); }\n }\n\n data.buffer.push(\"
    \\n
    \\n

    \");\n stack1 = helpers._triageMustache.call(depth0, \"sectionTitle\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"

    \\n
    \\n \\n
    \\n \\n
    \\n

    \");\n stack1 = helpers._triageMustache.call(depth0, \"currentScreenTitle\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"

    \\n
    \\n\\n
    \\n
    \\n \");\n stack1 = helpers._triageMustache.call(depth0, \"outlet\", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:[\"ID\"],data:data});\n if(stack1 || stack1 === 0) { data.buffer.push(stack1); }\n data.buffer.push(\"\\n
    \\n
    \");\n return buffer;\n \n });\n });//# sourceURL=hospitalrun/templates/section.js");