diff --git a/prod/assets/hospitalrun-0b2c325c3ec6f6f7171c04307b7f1a74.js b/prod/assets/hospitalrun-0b2c325c3ec6f6f7171c04307b7f1a74.js new file mode 100644 index 0000000000..36a315425b --- /dev/null +++ b/prod/assets/hospitalrun-0b2c325c3ec6f6f7171c04307b7f1a74.js @@ -0,0 +1,33 @@ +"use strict";define("hospitalrun/adapters/application",["exports","ember","ember-pouch","hospitalrun/mixins/pouch-adapter-utils","npm:uuid"],function(e,t,n,a,l){var s=t.default.run.bind;e.default=n.Adapter.extend(a.default,{database:t.default.inject.service(),db:t.default.computed.reads("database.mainDB"),_specialQueries:["containsValue","mapReduce"],_esDefaultSize:25,_executeContainsSearch:function(e,n,a){var l=this;return new t.default.RSVP.Promise(function(s,i){var o=l.getRecordTypeName(n),r="/search/hrdb/"+o+"/_search";a.containsValue&&a.containsValue.value?!function(){var o="";a.containsValue.keys.forEach(function(e){t.default.isEmpty(o)||(o+=" OR ");var n=a.containsValue.value;switch(e.type){case"contains":n="*"+n+"*";break;case"fuzzy":n+="~"}o=o+"data."+e.name+":"+n});var d=function(a){if(a&&a.hits&&a.hits.hits){var o=t.default.A(a.hits.hits).map(function(e){var t=e._source;return t.id=t._id,t}),r={rows:o};l._handleQueryResponse(r,e,n).then(s,i)}else a.rows?l._handleQueryResponse(a,e,n).then(s,i):i("Search results are not valid")};t.default.isEmpty(a.size)&&(a.size=l.get("_esDefaultSize")),t.default.$.ajax(r,{dataType:"json",data:{q:o,size:l.get("_esDefaultSize")},success:d})}():i("invalid query")})},_handleQueryResponse:function(e,n,a){var l=this,s=this.get("database");return new t.default.RSVP.Promise(function(t,i){if(e.rows.length>0)!function(){var o=e.rows.map(function(e){return s.getEmberId(e.id)});l.findRecord(n,a,o).then(function(e){var n=a.modelName.camelize().pluralize(),l=[];o.forEach(function(t){var a=e[n].findBy("id",t);l.push(a)}),e[n]=l,t(e)},i)}();else{var o={};o[a.modelName]=[],t(o)}})},_doesStartKeyContainSpecialCharacters:function(e){var n=!1,a=this.get("maxValue");return!t.default.isEmpty(e)&&t.default.isArray(e)&&e.forEach(function(e){null!==e&&e!==a||(n=!0)}),n},_startChangesToStoreListener:function(){var e=this.get("db");e&&(this.changes=e.changes({since:"now",live:!0,returnDocs:!1}).on("change",s(this,"onChange")).on("error",t.default.K),e.changesListener=this.changes)},generateIdForRecord:function(){return l.default.v4()},query:function(e,n,a,l){for(var s=this,i=!1,o=0;o0}),_canModifyValue:function(e,t){switch(t){case"inventory_types":if("Medication"===e)return!1;break;case"lab_pricing_types":if("Lab Procedure"===e)return!1;break;case"imaging_pricing_types":if("Imaging Procedure"===e)return!1;break;case"visit_types":if("Admission"===e)return!1;if("Imaging"===e)return!1;if("Lab"===e)return!1;if("Pharmacy"===e)return!1}return!0},_sortValues:function(e,n){return t.default.compare(e.toLowerCase(),n.toLowerCase())},activateKeyboard:t.default.on("init",function(){this.set("keyboardActivated",!0)}),updateListKeyboard:t.default.on((0,o.keyDown)("ctrl+KeyS"),(0,o.keyDown)("cmd+KeyS"),function(e){this.send("updateList"),e.preventDefault()}),actions:{addValue:function(){this.send("openModal","admin.lookup.edit",t.default.Object.create({isNew:!0}))},confirmDeleteValue:function(e){var n=this.get("i18n"),a=n.t("admin.lookup.titles.deleteLookupValue"),l=n.t("admin.lookup.messages.deleteLookupValue",{value:e});this.displayConfirm(a,l,"deleteValue",t.default.Object.create({valueToDelete:e}))},deleteValue:function(e){var t=this.get("lookupTypeList"),n=t.get("value"),a=e.get("valueToDelete");n.removeObject(a.toString()),t.save()},editValue:function(e){t.default.isEmpty(e)||this.send("openModal","admin.lookup.edit",t.default.Object.create({isNew:!1,originalValue:e.toString(),value:e.toString()}))},importList:function(){var e=this.get("fileSystem"),t=this.get("importFile"),n=this.get("lookupTypeList");t&&t.type?e.fileToDataURL(t).then(function(e){var a=e.split(",");n.setProperties({_attachments:{file:{content_type:t.type,data:a[1]}},importFile:!0}),n.save().then(function(){this.displayAlert(this.get("i18n").t("admin.lookup.alertImportListSaveTitle"),this.get("i18n").t("admin.lookup.alertImportListSaveMessage"),"refreshLookupLists"),this.set("importFile"),this.set("model.importFileName")}.bind(this))}.bind(this)):this.displayAlert(this.get("i18n").t("admin.lookup.alertImportListTitle"),this.get("i18n").t("admin.lookup.alertImportListMessage"))},updateList:function(){var e=this.get("lookupTypeList");e.save().then(function(){this.displayAlert(this.get("i18n").t("admin.lookup.alertImportListUpdateTitle"),this.get("i18n").t("admin.lookup.alertImportListUpdateMessage"))}.bind(this))},updateValue:function(e){var t=!1,n=this.get("lookupTypeList"),a=n.get("value"),l=e.get("value");if(e.get("isNew"))t=!0;else{var s=e.get("originalValue");l!==s&&(a.removeObject(s),t=!0)}t&&(a.addObject(l),a=a.sort(this._sortValues),n.set("value",a),n.save())}}})}),define("hospitalrun/admin/lookup/edit/controller",["exports","ember","hospitalrun/mixins/is-update-disabled"],function(e,t,n){e.default=t.default.Controller.extend(n.default,{editController:t.default.inject.controller("admin/lookup"),showUpdateButton:!0,updateButtonAction:"update",updateButtonText:function(){var e=this.get("i18n");return this.get("model.isNew")?e.t("buttons.add"):e.t("buttons.update")}.property("model.isNew"),actions:{cancel:function(){this.send("closeModal")},update:function(){t.default.isEmpty(this.get("model.value"))||(this.get("editController").send("updateValue",this.get("model")),this.send("closeModal"))}}})}),define("hospitalrun/admin/lookup/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"2fhdRW7b",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["helper",["t"],[["helper",["if"],[["get",["model","isNew"]],"admin.lookup.edit.template.addTitle","admin.lookup.edit.template.editTitle"],null]],null],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["helper",["t"],["admin.lookup.edit.template.labelTitle"],null],"value","lookup-type-value"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton","action"],[["get",["model"]],false,"update"]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/lookup/edit/template.hbs"}})}),define("hospitalrun/admin/lookup/route",["exports","hospitalrun/routes/abstract-index-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({hideNewButton:!0,pageTitle:(0,n.translationMacro)("admin.lookup.pageTitle"),model:function(){return this.store.findAll("lookup")},afterModel:function(e){e.set("lookupType","anesthesia_types")},actions:{deleteValue:function(e){this.controller.send("deleteValue",e)},refreshLookupLists:function(){this.refresh()}}})}),define("hospitalrun/admin/lookup/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Kwt+t5YD",block:'{"statements":[["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],6],["text"," "],["close-element"],["text","\\n"],["close-element"],["text","\\n"],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["unknown",["lookupTitle"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["canEditValues"]]],null,5],["text"," "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEditValues"]]],null,2],["block",["em-form"],null,[["model","submitButton"],[["get",["lookupTypeList"]],false]],1],["text"," "],["close-element"],["text","\\n"],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],["Organize Pricing By Type","organizeByType","col-sm-4"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-4"],["flush-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["labels.userCanAddNewValue"],null],"userCanAdd"]]],false],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"updateList"]],["flush-element"],["append",["helper",["t"],["buttons.update"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["showOrganizeByType"]]],null,0],["text"," "],["open-element","div",[]],["static-attr","class","col-sm-4"],["flush-element"],["text","\\n "],["append",["helper",["file-upload"],null,[["label","property","selectedFile"],[["helper",["t"],["labels.importFile"],null],"importFileName",["get",["importFile"]]]]],false],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"importList"]],["flush-element"],["append",["helper",["t"],["buttons.import"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"addValue"]],["flush-element"],["append",["helper",["t"],["buttons.addValue"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editValue",["get",["lookupTypeValue","value"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.edit"],null],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"confirmDeleteValue",["get",["lookupTypeValue","value"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["labels.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","lookup-type-value"],["flush-element"],["append",["unknown",["lookupTypeValue","value"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["lookupTypeValue","canModify"]]],null,3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["lookupTypeValue"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.value"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["lookupTypeValues"]]],null,4],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected"],["col-xs-3 lookup-type form-input-group",["helper",["t"],["labels.lookupType"],null],"lookupType",["get",["lookupTypes"]],"value","name",["get",["model","lookupType"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/lookup/template.hbs"}})}),define("hospitalrun/admin/query/controller",["exports","ember","hospitalrun/mixins/edit-panel-props","hospitalrun/utils/select-values"],function(e,t,n,a){e.default=t.default.Controller.extend(n.default,{hideCancelButton:!0,showUpdateButton:!0,updateButtonAction:"query",updateButtonText:"Query",objectTypeList:["appointment","imaging","inv-location","inv-purchase","inv-request","inventory","invoice","lab","medication","patient","photo","procedure","visit","vital"],objectTypes:t.default.computed.map("objectTypeList",a.default.selectValuesMap),actions:{query:function e(){var n=this.get("fieldName"),a=this.get("objectType"),l=this.get("queryValue"),e={containsValue:{value:l,keys:[n]}};this.store.query(a,e).then(function(e){var n=this;t.default.isEmpty(e)?(this.set("errorMessage","Query returned no results."),this.set("haveError",!0),this.set("showQueryResults",!1)):!function(){var a=void 0,l=["id"],s=[];e.get("firstObject").eachAttribute(function(e){l.push(e)}),e.forEach(function(e){var n=[];l.forEach(function(l){a=e.get(l),t.default.isEmpty(a)||n.push({name:l,value:a})}),s.push(n)}),n.set("resultRows",s),n.set("haveError",!1),n.set("showQueryResults",!0)}()}.bind(this),function(e){this.set("errorMessage",e),this.set("haveError",!0),this.set("showQueryResults",!1)}.bind(this))}}})}),define("hospitalrun/admin/query/route",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember","hospitalrun/mixins/user-session"],function(e,t,n,a){e.default=n.default.Route.extend(a.default,t.default,{beforeModel:function(){this.currentUserCan("query_db")||this.transitionTo("application")}})}),define("hospitalrun/admin/query/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"jNp4d1tp",block:'{"statements":[["text","\\n"],["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["unknown",["name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["value"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["result"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["text","Field"],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["text","Value"],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["resultRow"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":["resultRow"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","Query Results"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["each"],[["get",["resultRows"]]],null,1],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["static-attr","role","alert"],["flush-element"],["append",["unknown",["errorMessage"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","selected"],["col-xs-3","Object Type","objectType",["get",["objectTypes"]],["get",["objectType"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-input"],null,[["label","property"],["Field Name","fieldName"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["label","property"],["Query Value","queryValue"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],4],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveError"]]],null,3],["block",["if"],[["get",["showQueryResults"]]],null,2]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/query/template.hbs"}})}),define("hospitalrun/admin/roles/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/user-roles","hospitalrun/mixins/user-session"],function(e,t,n,a,l){e.default=t.default.extend(a.default,l.default,{currentRole:"",disabledAction:!1,hideCancelButton:!0,updateCapability:"define_user_roles",filteredRoles:n.default.computed.filter("userRoles",function(e){return"System Administrator"!==e.name}),availableCapabilities:[{name:"admin",capabilities:["admin","loadDb","updateConfig","defineUserRoles"]},{name:"appointments",capabilities:["appointments","addAppointment"]},{name:"billing",capabilities:["billing","addBillingDiagnosis","addCharge","addPricing","addPricingProfile","addInvoice","addPayment","deleteInvoice","deletePricing","deletePricingProfile","editInvoice","invoices","overrideInvoice","pricing"]},{name:"patients",capabilities:["patients","addAllergy","addDiagnosis","addNote","addOperativePlan","addPhoto","addPatient","addProcedure","addSocialwork","addVisit","addVitals","admitPatient","deleteNote","deletePhoto","deletePatient","deleteAppointment","deleteDiagnosis","deleteProcedure","deleteSocialwork","deleteVitals","deleteVisit","dischargePatient","patientReports","visits"]},{name:"medication",capabilities:["medication","addMedication","deleteMedication","fulfillMedication"]},{name:"labs",capabilities:["labs","addLab","completeLab","deleteLab"]},{name:"imaging",capabilities:["imaging","addImaging","completeImaging","deleteImaging"]},{name:"inventory",capabilities:["inventory","addInventoryRequest","addInventoryItem","addInventoryPurchase","adjustInventoryLocation","deleteInventoryItem","fulfillInventory"]}],missingCapablities:n.default.computed("availableCapabilities","defaultCapabilities",function(){var e=this.get("availableCapabilities"),t=Object.keys(e),n=Object.keys(this.get("defaultCapabilities")),a=[];return n.forEach(function(n){var l=!1;t.forEach(function(t){var a=e[t];a.capabilities.includes(n.camelize())&&(l=!0)}),l||a.push(n+" - "+n.camelize())}),a}),capabilitySections:n.default.computed.map("availableCapabilities",function(e){var t=this,n=[];return e.capabilities.forEach(function(e){n.push({key:e,name:t.get("i18n").t("admin.roles.capability."+e)})}),{name:this.get("i18n").t("admin.roles.capability."+e.name),capabilities:n}}),actions:{selectRole:function(e){var t=this,n=this.get("model").findBy("id",e.dasherize());this.set("currentRole",e),this.set("roleToUpdate",n);try{n?!function(){var e=n.get("capabilities");t.get("availableCapabilities").forEach(function(n){n.capabilities.forEach(function(n){e.includes(n)?t.set(n,!0):t.set(n,!1)})})}():!function(){var n=t.get("defaultCapabilities");Object.keys(n).forEach(function(a){var l=n[a];l.includes(e)?t.set(a.camelize(),!0):t.set(a.camelize(),!1)})}()}catch(e){console.log("ex setting role:",e)}},update:function(){var e=this,t=this.get("currentRole"),a=this.get("roleToUpdate");n.default.isEmpty(a)&&(a=this.get("store").createRecord("user-role",{id:t.dasherize(),name:t}));var l=[];this.get("availableCapabilities").forEach(function(t){t.capabilities.forEach(function(t){e.get(t)===!0&&l.push(t)})}),a.set("capabilities",l),a.save().then(function(){e.displayAlert(e.get("i18n").t("admin.roles.titles.roleSaved"),e.get("i18n").t("admin.roles.messages.roleSaved",{roleName:t}))})}}})}),define("hospitalrun/admin/roles/route",["exports","hospitalrun/routes/abstract-edit-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({hideNewButton:!0,newTitle:(0,n.translationMacro)("admin.userRoles"),editTitle:(0,n.translationMacro)("admin.userRoles"),model:function(){return this.get("store").findAll("user-role")}})}),define("hospitalrun/admin/roles/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"2aNV3BOq",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["capability","name"]],["get",["capability","key"]],["helper",["concat"],["checkbox"," checkbox-",["get",["capability","key"]]],null]]]],false],["text","\\n"]],"locals":["capability"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["unknown",["capabilitySection","name"]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","detail-section-content"],["flush-element"],["text","\\n"],["block",["each"],[["get",["capabilitySection","capabilities"]]],null,0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["capabilitySection"]},{"statements":[["text"," "],["open-element","option",[]],["dynamic-attr","value",["concat",[["unknown",["userRole","name"]]]]],["dynamic-attr","selected",["helper",["eq"],[["get",["selectedRole"]],["get",["userRole","name"]]],null],null],["flush-element"],["text","\\n "],["append",["unknown",["userRole","name"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["userRole"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group has-success"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.role"],null],false],["close-element"],["text","\\n "],["open-element","select",[]],["dynamic-attr","onchange",["helper",["action"],[["get",[null]],"selectRole"],[["value"],["target.value"]]],null],["static-attr","class","form-control role-select"],["flush-element"],["text","\\n "],["open-element","option",[]],["static-attr","disabled",""],["dynamic-attr","selected",["helper",["is-not"],[["get",["selectedRole"]]],null],null],["flush-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["filteredRoles"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["capabilitySections"]]],null,1]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/admin/roles/template.hbs"}})}),define("hospitalrun/admin/route",["exports","hospitalrun/routes/abstract-module-route"],function(e,t){e.default=t.default.extend({addCapability:"add_user",allowSearch:!1,moduleName:"admin",sectionTitle:"Admin",editPath:function(){return"users.edit"}.property(),deletePath:function(){return"users.delete"}.property()})}),define("hospitalrun/admin/visit-forms/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/visit-types"],function(e,t,n,a){var l=n.default.computed;e.default=t.default.extend(a.default,{hideCancelButton:!0,updateCapability:"update_config",visitTypesList:l.alias("model.visitTypesList"),visitFormsForEditing:l("model.visitForms","visitTypes",function(){var e=this.get("model.visitForms"),t=this.get("visitTypes"),n=t.map(function(t){return e[t.value]||(e[t.value]="initial"),{type:t.value,form:e[t.value]}});return n}),visitTemplateIds:["initial","followup"],visitTemplates:l(function(){var e=this.get("i18n"),t=this.get("visitTemplateIds");return t.map(function(t){return{id:t,value:e.t("admin.visitForms.labels."+t)}})}),afterUpdate:function(){this.displayAlert(this.get("i18n").t("admin.address.titles.optionsSaved"),this.get("i18n").t("admin.address.messages.addressSaved"))},actions:{selectForm:function(e,t){var n=this.get("model.visitForms");n[e]=t.target.value}}})}),define("hospitalrun/admin/visit-forms/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({hideNewButton:!0,editTitle:(0,a.translationMacro)("admin.visitForms.titles.visitForms"),newTitle:n.default.computed.alias("editTitle"),model:function(){var e=this.get("store"),t={visitFormsOption:e.find("option","visit_forms"),visitTypes:e.find("lookup","visit_types")};return new n.default.RSVP.Promise(function(e,a){n.default.RSVP.hashSettled(t).then(function(t){var a=n.default.Object.create();"fulfilled"===t.visitTypes.state&&a.set("visitTypesList",t.visitTypes.value),"fulfilled"===t.visitFormsOption.state?a.set("visitForms",t.visitFormsOption.value):a.set("visitForms",{}),e(a)},a)})}})}),define("hospitalrun/admin/visit-forms/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Wi/FzQog",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","option",[]],["dynamic-attr","value",["concat",[["unknown",["visitTemplate","id"]]]]],["dynamic-attr","selected",["helper",["eq"],[["get",["visitForm","form"]],["get",["visitTemplate","id"]]],null],null],["flush-element"],["text","\\n "],["append",["unknown",["visitTemplate","value"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visitTemplate"]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visitForm","type"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","select",[]],["dynamic-attr","onchange",["helper",["action"],[["get",[null]],"selectForm",["get",["visitForm","type"]]],null],null],["static-attr","class","form-control role-select"],["flush-element"],["text","\\n"],["block",["each"],[["get",["visitTemplates"]]],null,1],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visitForm"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["admin.visitForms.labels.visitType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["admin.visitForms.labels.form"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["visitFormsForEditing"]]],null,2],["text"," "],["close-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/visit-forms/template.hbs"}})}),define("hospitalrun/admin/workflow/controller",["exports","hospitalrun/controllers/abstract-edit-controller"],function(e,t){e.default=t.default.extend({hideCancelButton:!0,updateCapability:"update_config",afterUpdate:function(){this.displayAlert(this.get("i18n").t("admin.workflow.titles.optionsSaved"),this.get("i18n").t("admin.workflow.messages.optionsSaved"))}})}),define("hospitalrun/admin/workflow/route",["exports","hospitalrun/routes/abstract-edit-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({hideNewButton:!0,editTitle:(0,n.translationMacro)("admin.workflow.editTitle"),model:function(){var e=this.get("store");return e.find("option","workflow_options").catch(function(){return e.push(e.normalize("option",{id:"workflow_options",value:{admissionDeposit:!1,clinicPrepayment:!1,followupPrepayment:!1,outpatientLabPrepayment:!1,outpatientImagingPrepayment:!1,outpatientMedicationPrepayment:!1}}))})}})}),define("hospitalrun/admin/workflow/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Mr+Jr99y",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.admissionDepositLabel"],null],"value.admissionDeposit"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.clinicPrepaymentLabel"],null],"value.clinicPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.followupPrepaymentLabel"],null],"value.followupPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.outpatientLabLabel"],null],"value.outpatientLabPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.outpatientImagingLabel"],null],"value.outpatientImagingPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.outpatientMedicationLabel"],null],"value.outpatientMedicationPrepayment"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/workflow/template.hbs"}})}),define("hospitalrun/app",["exports","ember","hospitalrun/resolver","ember-load-initializers","hospitalrun/config/environment"],function(e,t,n,a,l){var s=void 0;t.default.MODEL_FACTORY_INJECTIONS=!0,s=t.default.Application.extend({modulePrefix:l.default.modulePrefix,podModulePrefix:l.default.podModulePrefix,Resolver:n.default}),(0,a.default)(s,l.default.modulePrefix),e.default=s}),define("hospitalrun/appointments/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller"],function(e,t){e.default=t.default.extend({title:"Delete Appointment",afterDeleteAction:function(){var e=this.get("model.deleteFromPatient");return e?"appointmentDeleted":"closeModal"}.property("model.deleteFromPatient")})}),define("hospitalrun/appointments/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"k7CkZQLv",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["appointments.messages.deleteAppointmentMessage"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/appointments/delete/template.hbs"}})}),define("hospitalrun/appointments/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/appointment-statuses","ember","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s){e.default=t.default.extend(n.default,l.default,s.default,{appointmentsController:a.default.inject.controller("appointments"),findPatientVisits:!1,locationList:a.default.computed.alias("appointmentsController.locationList"),lookupListsToUpdate:[{name:"physicianList",property:"model.provider",id:"physician_list"},{name:"locationList",property:"model.location",id:"visit_location_list"}],physicianList:a.default.computed.alias("appointmentsController.physicianList"),showTime:function(){var e=this.get("model.allDay"),t=this.get("isAdmissionAppointment");return!e&&t}.property("model.allDay","isAdmissionAppointment"),visitTypesList:a.default.computed.alias("appointmentsController.visitTypesList"),cancelAction:function(){var e=this.get("model.returnTo");return a.default.isEmpty(e)?this._super():"returnTo"}.property("model.returnTo"),isAdmissionAppointment:function(){var e=this.get("model"),t=e.get("appointmentType"),n="Admission"===t;return n}.property("model.appointmentType"),updateCapability:"add_appointment",afterUpdate:function(){this.send(this.get("cancelAction"))},actions:{appointmentTypeChanged:function(e){var t=this.get("model");t.set("appointmentType",e);var n=this.get("isAdmissionAppointment");t.set("allDay",n)}}})}),define("hospitalrun/appointments/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember","hospitalrun/mixins/patient-list-route","ember-i18n"],function(e,t,n,a,l){e.default=t.default.extend(a.default,{editTitle:(0,l.translationMacro)("appointments.editTitle"),modelName:"appointment",newTitle:(0,l.translationMacro)("appointments.newTitle"),getNewData:function(){return n.default.RSVP.resolve({appointmentType:"Admission",allDay:!0,selectPatient:!0,startDate:new Date})}})}),define("hospitalrun/appointments/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"T3iCZyRj",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["date-time-picker"],null,[["datePickerClass","label","model"],["required test-appointment-date",["helper",["t"],["labels.date"],null],["get",["model"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-picker"],null,[["property","label","showTime","class"],["startDate",["helper",["t"],["labels.startDate"],null],["get",["showTime"]],"col-sm-4 required test-appointment-start"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","showTime","class"],["endDate",["helper",["t"],["labels.endDate"],null],["get",["showTime"]],"col-sm-4 required test-appointment-end"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"appointments.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required test-patient-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","selectPatient"]]],null,3,2],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["if"],[["get",["isAdmissionAppointment"]]],null,1,0],["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["helper",["t"],["labels.allDay"],null],"allDay","col-sm-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-input-group col-sm-6 required test-appointment-type"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["static-attr","for","startTime"],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["append",["helper",["select-list"],null,[["content","optionLabelPath","optionValuePath","value","class","id","action"],[["get",["visitTypes"]],"value","id",["get",["model","appointmentType"]],"form-control","appointmentType",["helper",["action"],[["get",[null]],"appointmentTypeChanged"],null]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["className","property","label","list","selection"],["col-sm-6 test-appointment-with","provider",["helper",["t"],["labels.with"],null],["get",["physicianList"]],["get",["model","provider"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["className","property","label","list","selection"],["col-sm-6 required test-appointment-location","location",["helper",["t"],["labels.location"],null],["get",["locationList"]],["get",["model","location"]]]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content"],["form-input-group col-sm-3 test-appointment-status","status",["helper",["t"],["labels.status"],null],["get",["appointmentStatuses"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["label","property","rows"],[["helper",["t"],["labels.notes"],null],"notes",3]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],4]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/appointments/edit/template.hbs"}})}),define("hospitalrun/appointments/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],canAddVisit:function(){return this.currentUserCan("add_visit")}.property(),canEdit:function(){return this.currentUserCan("add_appointment")}.property(),canDelete:function(){return this.currentUserCan("delete_appointment")}.property(),sortProperties:["startDate","endDate"],sortAscending:!0})}),define("hospitalrun/appointments/index/route",["exports","hospitalrun/routes/abstract-index-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({editReturn:"appointments.index",modelName:"appointment",pageTitle:(0,n.translationMacro)("appointments.thisWeek"),_getStartKeyFromItem:function(e){var t=e.get("endDate"),n=this._getPouchIdFromItem(e),a=e.get("startDate");return t&&""!==t&&(t=new Date(t),t.getTime&&(t=t.getTime())),a&&""!==a&&(a=new Date(a),a.getTime&&(a=a.getTime())),[a,t,n]},_modelQueryParams:function(){var e=moment().endOf("week").toDate().getTime(),t=moment().startOf("week").toDate().getTime(),n=this._getMaxPouchId();return{options:{startkey:[t,null,null],endkey:[e,e,n]},mapReduce:"appointments_by_date"}},actions:{editAppointment:function(e){e.set("returnTo",this.get("editReturn")),this.send("editItem",e)}}})}),define("hospitalrun/appointments/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"om9IAHIz",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","appointments/item"],["text","\\n"]],"locals":["appointment"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.provider"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/index/template.hbs"}})}),define("hospitalrun/appointments/item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"tgFrtDZJ",block:'{"statements":[["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","appointment-date"],["flush-element"],["text","\\n "],["append",["unknown",["appointment","formattedAppointmentDate"]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","patient","displayName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","appointmentType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","provider"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","appointment-status"],["flush-element"],["append",["unknown",["appointment","displayStatus"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEdit"]]],null,3],["block",["if"],[["get",["canAddVisit"]]],null,2],["block",["if"],[["get",["canDelete"]]],null,0],["text"," "],["close-element"],["text","\\n"],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"checkIn",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-in"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["visits.buttons.checkIn"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["appointment","displayStatus"]],"Scheduled"],null]],null,1]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/appointments/item/template.hbs"}})}),define("hospitalrun/appointments/missed/controller",["exports","hospitalrun/appointments/index/controller"],function(e,t){e.default=t.default.extend({startKey:[]})}),define("hospitalrun/appointments/missed/route",["exports","hospitalrun/appointments/index/route","ember-i18n"],function(e,t,n){e.default=t.default.extend({editReturn:"appointments.missed",modelName:"appointment",pageTitle:(0,n.translationMacro)("appointments.missed"),_modelQueryParams:function(){var e=this._super.apply(this,arguments);return e.filterBy=[{name:"status",value:"Missed"}],e}})}),define("hospitalrun/appointments/missed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"I2CynOk8",block:'{"statements":[["partial","appointments/index"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/missed/template.hbs"}})}),define("hospitalrun/appointments/route",["exports","hospitalrun/routes/abstract-module-route","hospitalrun/mixins/user-session","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{addCapability:"add_appointment",allowSearch:!1,currentScreenTitle:(0,a.translationMacro)("appointments.currentScreenTitle"),editTitle:(0,a.translationMacro)("appointments.editTitle"),newTitle:(0,a.translationMacro)("appointments.newTitle"),moduleName:"appointments",newButtonText:(0,a.translationMacro)("appointments.buttons.newButton"),sectionTitle:(0,a.translationMacro)("appointments.sectionTitle"),actions:{checkIn:function(e){var t=e.get("patient"),n=e.getProperties("startDate","endDate","location","patient");n.visitType=e.get("appointmentType"),n.examiner=e.get("provider"),n.appointment=e,n.hidePatientSelection=!0,n.patient=t,n.returnTo="appointments",this.transitionTo("visits.edit","checkin").then(function(e){e.currentModel.setProperties(n),e.controller.getPatientDiagnoses(t)}.bind(this))}},additionalModels:[{name:"physicianList",findArgs:["lookup","physician_list"]},{name:"locationList",findArgs:["lookup","visit_location_list"]},{name:"visitTypesList",findArgs:["lookup","visit_types"]}]})}),define("hospitalrun/appointments/search/controller",["exports","hospitalrun/appointments/index/controller","hospitalrun/mixins/appointment-statuses","ember","hospitalrun/utils/select-values","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s){e.default=t.default.extend(n.default,s.default,{appointmentsController:a.default.inject.controller("appointments"),appointmentType:null,physicians:a.default.computed.alias("appointmentsController.physicianList.value"),physicianList:function(){return l.default.selectValues(this.get("physicians"),!0)}.property("physicians"),provider:null,queryParams:["appointmentType","provider","status","startKey","startDate"],selectedProvider:null,selectedStatus:null,sortProperties:null,startDate:null,startKey:[],status:null,visitTypesList:a.default.computed.alias("appointmentsController.visitTypesList"),actions:{search:function(){var e=this.get("model.selectedAppointmentType"),t={startKey:[],previousStartKey:null,previousStartKeys:[]},n=this.get("model.selectedProvider"),l=this.get("model.selectedStatus"),s=this.get("model.selectedStartingDate");a.default.isEmpty(e)?t.appointmentType=null:t.appointmentType=e,a.default.isEmpty(n)?t.provider=null:t.provider=n,a.default.isEmpty(l)?t.status=null:t.status=l,a.default.isEmpty(s)||(t.startDate=s.getTime()),a.default.isEmpty(t)||this.setProperties(t)}}})}),define("hospitalrun/appointments/search/route",["exports","hospitalrun/appointments/index/route","hospitalrun/mixins/date-format","ember","ember-i18n"],function(e,t,n,a,l){e.default=t.default.extend(n.default,{editReturn:"appointments.search",filterParams:["appointmentType","provider","status"],modelName:"appointment",pageTitle:(0,l.translationMacro)("appointments.searchTitle"),queryParams:{appointmentType:{refreshModel:!0},provider:{refreshModel:!0},status:{refreshModel:!0},startDate:{refreshModel:!0},startKey:{refreshModel:!0}},_modelQueryParams:function(e){var t=e.startDate,n=this.get("maxValue");t=a.default.isEmpty(t)?moment():moment(parseInt(t));var l=t.startOf("day").toDate().getTime(),s={startkey:[l,null,"appointment_"],endkey:[n,n,"appointment_"+n]};return{options:s,mapReduce:"appointments_by_date"}},model:function(e){return this._super(e).then(function(t){t.setProperties({selectedAppointmentType:e.appointmentType,selectedProvider:e.provider,selectedStatus:e.status});var n=e.startDate;return n=new Date,a.default.isEmpty(e.startDate)||n.setTime(e.startDate),t.set("selectedStartingDate",n),t.set("display_selectedStartingDate",this._dateFormat(n)),t}.bind(this))}})}),define("hospitalrun/appointments/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"jVMV4UgE",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],7]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","appointments/item"],["text","\\n"]],"locals":["appointment"]},{"statements":[["append",["helper",["t"],["labels.status"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.with"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.location"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.type"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.date"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["selectedStartingDate",["helper",["t"],["appointments.labels.selectedStartingDate"],null],"col-sm-3"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content"],["col-sm-3","selectedStatus",["helper",["t"],["labels.status"],null],["get",["appointmentStatusesWithEmpty"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content"],["col-sm-3",["helper",["t"],["labels.type"],null],"selectedAppointmentType",["get",["visitTypesWithEmpty"]]]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content"],["col-sm-3","selectedProvider",["helper",["t"],["labels.with"],null],["get",["physicianList"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-info"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],6],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"search"]],["flush-element"],["append",["helper",["t"],["buttons.search"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["date",["get",["sortDesc"]],["get",["sortKey"]]]],5],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["appointmentType",["get",["sortDesc"]],["get",["sortKey"]]]],4],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["location",["get",["sortDesc"]],["get",["sortKey"]]]],3],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["provider",["get",["sortDesc"]],["get",["sortKey"]]]],2],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["status",["get",["sortDesc"]],["get",["sortKey"]]]],1],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/search/template.hbs"}})}),define("hospitalrun/appointments/today/controller",["exports","hospitalrun/appointments/index/controller"],function(e,t){e.default=t.default.extend({startKey:[]})}),define("hospitalrun/appointments/today/route",["exports","hospitalrun/appointments/index/route","ember-i18n"],function(e,t,n){e.default=t.default.extend({editReturn:"appointments.today",modelName:"appointment",pageTitle:(0,n.translationMacro)("appointments.todayTitle"),_modelQueryParams:function(){var e=moment().endOf("day").toDate().getTime(),t=this.get("maxValue"),n=moment().startOf("day").toDate().getTime();return{options:{startkey:[n,null,"appointment_"],endkey:[e,e,"appointment_"+t]},mapReduce:"appointments_by_date"}}})}),define("hospitalrun/appointments/today/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"NpXWri4D",block:'{"statements":[["partial","appointments/index"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/today/template.hbs"}})}),define("hospitalrun/authenticators/custom",["exports","ember","ember-simple-auth/authenticators/base"],function(e,t,n){e.default=n.default.extend({config:t.default.inject.service(),database:t.default.inject.service(),serverEndpoint:"/db/_session", +useGoogleAuth:!1,_absolutizeExpirationTime:function(e){if(!t.default.isEmpty(e))return new Date((new Date).getTime()+1e3*(e-5)).getTime()},_checkUser:function(e){var n=this;return new t.default.RSVP.Promise(function(t,a){n._makeRequest("POST",{name:e.name},"/chkuser").then(function(n){n.error&&a(n),e.displayName=n.displayName,e.role=n.role,e.prefix=n.prefix,t(e)},function(){t(e)})})},_getPromise:function(e,n){return new t.default.RSVP.Promise(function(a,l){this._makeRequest(e,n).then(function(e){t.default.run(function(){a(e)})},function(e){t.default.run(function(){l(e.responseJSON||e.responseText)})})}.bind(this))},_makeRequest:function(e,n,a){return a||(a=this.serverEndpoint),t.default.$.ajax({url:a,type:e,data:n,dataType:"json",contentType:"application/x-www-form-urlencoded",xhrFields:{withCredentials:!0}})},authenticate:function(e){var n=this;if(e.google_auth){var a=function(){n.useGoogleAuth=!0;var a={google_auth:!0,consumer_key:e.params.k,consumer_secret:e.params.s1,token:e.params.t,token_secret:e.params.s2,name:e.params.i};return{v:new t.default.RSVP.Promise(function(e,t){n._checkUser(a).then(function(t){e(t),n.get("config").setCurrentUser(t.name)},t)})}}();if("object"==typeof a)return a.v}return new t.default.RSVP.Promise(function(t,a){var l={name:e.identification,password:e.password};n._makeRequest("POST",l).then(function(e){e.name=l.name,e.expires_at=n._absolutizeExpirationTime(600),n._checkUser(e).then(function(e){n.get("config").setCurrentUser(e.name);var l=n.get("database");l.setup({}).then(function(){t(e)},a)},a)},function(e){a(e.responseJSON||e.responseText)})})},invalidate:function(){return this.useGoogleAuth?t.default.RSVP.resolve():this._getPromise("DELETE")},restore:function(e){var n=this;return new t.default.RSVP.Promise(function(a,l){var s=(new Date).getTime();!t.default.isEmpty(e.expires_at)&&e.expires_at0;){var l=a.splice(0,t).map(this._mapCheckboxValues.bind(this));e.push(l)}return e}.property("content","checkboxesPerRow"),actions:{checkboxChanged:function(e,n){var a=this.get("property"),l="model."+a,s=this.get(l);t.default.isArray(s)||(s=[]),n&&!s.includes(e)?s.addObject(e):!n&&s.includes(e)&&s.removeObject(e),this.set(l,s),this.set("selection",s),this.get("model").validate().catch(t.default.K)}}})}),define("hospitalrun/components/control-within-label",["exports","ember-rapid-forms/components/control-within-label"],function(e,t){e.default=t.default}),define("hospitalrun/components/custom-form-manager",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){var a=t.default.computed,l=t.default.isEmpty;e.default=t.default.Component.extend(n.default,{customForms:t.default.inject.service(),formType:null,formsForType:null,model:null,openModalAction:"openModal",didReceiveAttrs:function(){var e=this;this._super.apply(this,arguments);var t=this.get("customForms"),n=this.get("formType");t.getCustomForms([n]).then(function(t){var n=e.get("isDestroyed");n||e.set("formsForType",t)})},formsForSelect:a("formsForType","usedForms",function(){var e=this.get("formsForType"),t=this.get("usedForms");if(!l(e)){var n=e.filter(function(e){return!t.includes(e.get("id"))});return n=n.map(function(e){return{id:e.get("id"),value:e.get("name")}})}}),formsToDisplay:a("formsForType","model.customForms",function(){var e=this.get("formsForType"),t=this.get("model.customForms");if(!l(t)&&!l(e))return Object.keys(t).map(function(t){return{form:e.findBy("id",t),propertyPrefix:"customForms."+t+"."}})}),usedForms:a("model.customForms",function(){var e=this.get("model.customForms");return l(e)?[]:Object.keys(e)}),showAddButton:a("formsForSelect",function(){var e=this.get("formsForSelect");return!l(e)}),actions:{addForm:function(){var e=this.get("model"),n=this.get("formsForSelect");this.sendAction("openModalAction","custom-form-add",t.default.Object.create({modelToAddTo:e,customForms:n}))}}})}),define("hospitalrun/components/custom-form",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){var a=t.default.computed,l=t.default.isEmpty;e.default=t.default.Component.extend(n.default,{classNames:"detail-section-content",propertyPrefix:"",fieldsByRow:a("form","form.fields.[]","form.columns",function(){var e=this,n=[],a=this.get("form"),s=this.get("form.fields");return l(a)||l(s)||!function(){var a=e.getWithDefault("form.columns",1),l=[],i=0,o=Math.floor(12/a);s.forEach(function(e){var s=e.get("classNames");s||(s="");var r=e.get("colSpan")||1;(i===a||i+r>a)&&(n.push(l.slice()),l=[],i=0),s+=" col-sm-"+o*r,e.set("displayClassNames",s),"radio"===e.get("type")&&e.set("mappedValues",e.get("values").map(function(e){return t.default.get(e,"label")})),l.push(e),i+=r}),i>0&&n.push(l)}(),n})})}),define("hospitalrun/components/date-input",["exports","ember","ember-rapid-forms/components/html-input"],function(e,t,n){e.default=n.default.extend({_picker:null,_shouldSetDate:function(e,n){return n&&(t.default.isEmpty(e)||t.default.isEmpty(n.getDate())||e.getTime&&n.getDate().getTime()!==e.getTime())},currentDateChangedValue:function(){var e=this.get("currentDate"),n=this.get("_picker");!t.default.isEmpty(e)&&this._shouldSetDate(e,n)&&n.setDate(e)},format:function(){var e=this.get("showTime");return e?"l h:mm A":"l"}.property("mainComponent.showTime"),showTimeChanged:function(){var e=this.get("_picker");e&&(e.destroy(),this.didInsertElement())}.observes("mainComponent.showTime"),dateSet:function(){var e=this.get("currentDate"),n=this.get("_picker");if(this._shouldSetDate(e,n)){var a=n.getDate(),l=this.get("mainComponent"),s=l.get("dateSetAction");this.set("currentDate",a),t.default.isEmpty(s)||l.sendAction("dateSetAction",a)}},didInsertElement:function(){var e=this.get("currentDate"),n=this.$("input"),a=null,l=this.getProperties("format","yearRange","showTime");l.onSelect=this.dateSet.bind(this),t.default.isEmpty(this.get("minDate"))||(l.minDate=this.get("minDate"),"now"===l.minDate&&(l.minDate=new Date)),t.default.isEmpty(this.get("maxDate"))||(l.maxDate=this.get("maxDate"),"now"===l.maxDate&&(l.maxDate=new Date)),l.field=n[0],a=new Pikaday(l),t.default.run.next(this,function(){a.setDate(e)}),this.set("_picker",a)},didReceiveAttrs:function(){this._super.apply(this,arguments);var e=this.get("mainComponent.originalPropery"),n="display_"+e;this.currentDate=t.default.computed.alias("mainComponent.model."+e),this.minDate=t.default.computed.alias("mainComponent.minDate"),this.maxDate=t.default.computed.alias("mainComponent.maxDate"),this.showTime=t.default.computed.alias("mainComponent.showTime"),this.yearRange=t.default.computed.alias("mainComponent.yearRange"),this.addObserver("mainComponent.model."+e,this,this.currentDateChangedValue),t.default.Binding.from("mainComponent.model.errors."+e).to("mainComponent.model.errors."+n).connect(this)},willDestroyElement:function(){var e=this.get("_picker");e&&e.destroy(),this.set("_picker",null)}})}),define("hospitalrun/components/date-picker",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default.extend({dateSetAction:null,htmlComponent:"date-input",minDate:null,maxDate:null,originalPropery:null,showTime:!1,yearRange:10,didReceiveAttrs:function(e){var t=this.get("property"),n="display_"+t;this.set("property",n),this.set("originalPropery",t),this._super(e)}})}),define("hospitalrun/components/date-time-picker",["exports","ember"],function(e,t){var n=t.default.computed,a=t.default.isEmpty;e.default=t.default.Component.extend({i18n:t.default.inject.service(),dateTimePickerDate:null,datePickerClass:"",endDate:t.default.computed.alias("model.endDate"),endHour:null,endMinute:null,label:"",startDate:t.default.computed.alias("model.startDate"),startHour:null,startMinute:null,didReceiveAttrs:function(){var e=moment(this.get("endDate")),t=moment(this.get("startDate"));a(e)&&(e=t),this.set("endHour",e.hour()),this.set("endMinute",e.minute()),this.set("startHour",t.hour()),this.set("startMinute",t.minute()),this.set("dateTimePickerDate",t.toDate()),this._updateDates()},hourList:n(function(){var e=void 0,t=[],n=this.get("i18n");for(e=0;e<24;e++){var a=void 0,l={hour:e%12};a=0===e?n.t("components.dateTimePicker.midnight"):12===e?n.t("components.dateTimePicker.noon"):e<12?n.t("components.dateTimePicker.amHour",l):n.t("components.dateTimePicker.pmHour",l),t.push({name:a,value:e})}return t}),isAllDay:n("model.allDay",function(){var e=this.get("model.allDay");return e&&(this.set("startHour",0),this.set("startMinute",0),this.set("endHour",23),this.set("endMinute",59),this._updateDates()),e}),minuteList:n(function(){var e=void 0,t=[];for(e=0;e<60;e++)t.push({name:String("00"+e).slice(-2),value:e});return t}),actions:{dateChanged:function(){this._updateDates()},endHourChanged:function(e){this.set("endHour",e),this._updateDates()},endMinuteChanged:function(e){this.set("endMinute",e),this._updateDates()},startHourChanged:function(e){this.set("startHour",e),this._updateDates()},startMinuteChanged:function(e){this.set("startMinute",e),this._updateDates()}},endTimeHasError:n("model.isValid",function(){var e=this.get("model.errors.endDate");return e.length>0}),_updateDates:function(){var e=this;t.default.run.once(this,function(){var n=["start","end"];n.forEach(function(n){var a=n+"Date",l=e.get(a),s=e.get("dateTimePickerDate"),i=e.get(n+"Hour"),o=e.get(n+"Minute");t.default.isEmpty(s)||(l=moment(s),l.hour(i),l.minute(o),e.set(a,l.toDate()))});var a=e.get("model");a.validate().catch(t.default.K)})}})}),define("hospitalrun/components/edit-panel",["exports","ember"],function(e,t){e.default=t.default.Component.extend({editPanelProps:null,cancelAction:"cancel",actions:{cancel:function(){this.sendAction("cancelAction")},disabledAction:function(){this.sendAction("editPanelProps.disabledAction")},fireButtonAction:function(e){this.set(e,e),this.sendAction(e)},updateButtonAction:function(){this.sendAction("editPanelProps.updateButtonAction")}}})}),define("hospitalrun/components/em-checkbox",["exports","ember-rapid-forms/components/em-checkbox"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-custom-input",["exports","ember-rapid-forms/components/em-custom-input"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-control-help",["exports","ember-rapid-forms/components/em-form-control-help"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-group",["exports","ember-rapid-forms/components/em-form-group"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-label",["exports","ember-rapid-forms/components/em-form-label"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-submit",["exports","ember-rapid-forms/components/em-form-submit"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form",["exports","ember-rapid-forms/components/em-form"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-input",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-select",["exports","ember-rapid-forms/components/em-select"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-text",["exports","ember-rapid-forms/components/em-text"],function(e,t){e.default=t.default}),define("hospitalrun/components/erf-html-checkbox",["exports","ember-rapid-forms/components/html-checkbox"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-custom-input",["exports","ember-rapid-forms/components/html-custom-input"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-input",["exports","ember-rapid-forms/components/html-input"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-select",["exports","ember-rapid-forms/components/html-select"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-text",["exports","ember-rapid-forms/components/html-text"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/ext-radio",["exports","ember"],function(e,t){e.default=t.default.Component.extend({includeOtherOption:!1,otherOptionLabel:null,showInline:!1,haveLabel:function(){var e=this.get("content.firstObject");return!t.default.isEmpty(e.label)}.property("content"),radioClass:function(){return this.get("showInline")?"radio-inline":"radio"}.property("showInline")})}),define("hospitalrun/components/file-upload",["exports","hospitalrun/components/image-upload"],function(e,t){e.default=t.default.extend({resizeFile:!1})}),define("hospitalrun/components/form-group-control",["exports","ember-rapid-forms/components/form-group-control"],function(e,t){e.default=t.default}),define("hospitalrun/components/form-group",["exports","ember-rapid-forms/components/form-group"],function(e,t){e.default=t.default}),define("hospitalrun/components/icd10-pcs-typeahead",["exports","hospitalrun/components/icd10-typeahead"],function(e,t){e.default=t.default.extend()}),define("hospitalrun/components/icd10-typeahead",["exports","hospitalrun/components/type-ahead"],function(e,t){e.default=t.default.extend({class:"scrollable-typeahead",minlength:2,selectionKey:"id",setOnBlur:!0,templates:{header:''},_sourceQuery:function(e,t){this.bloodhound.get(e,function(n){t(n);var a=this.$(".query-results");a.html(""+e+" returned "+n.length+" results")}.bind(this))},_getSource:function(){return this._sourceQuery.bind(this)}})}),define("hospitalrun/components/image-upload",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default.extend({fileInputEl:null,resizeFile:!0,selectedFile:null,type:"file",_fileChanged:function(){var e=this,t=this.get("fileInputEl"),n=this.get("resizeFile");n?!function(){window.URL=window.URL||window.webkitURL;var n=window.URL.createObjectURL(t.files[0]),a=new Image;a.src=n,a.onload=function(){window.URL.revokeObjectURL(n),this.set("selectedFile",this._resizeImage(a))}.bind(e)}():this.set("selectedFile",t.files[0])},_resizeImage:function(e){var t=document.createElement("canvas"),n=e.height,a=e.width,l=1024,s=1024;a>n?a>s&&(n=Math.round(n*=s/a),a=s):n>l&&(a=Math.round(a*=l/n),n=l),t.width=a,t.height=n;var i=t.getContext("2d");i.drawImage(e,0,0,a,n);for(var o=t.toDataURL("image/png"),r=atob(o.split(",")[1]),d=[],c=0;c=l&&(s=a),o},0),s>-1?a.get("length")>s+1&&(a=a.slice(0,s+1),this.set("calculatedLocationPickers",a)):a.addObject(t.default.Object.create()),this._setupLocationPickers(a,n)),a.forEach(function(e){i.addObject(e.get("selectedLocation"))}),this.set("componentSelectedLocations",i)},_setup:function(){t.default.Binding.from("selectedLocations").to("componentSelectedLocations").connect(this)}.on("init"),_setupLocationPickers:function(e,a,l){e.reduce(function(e,t){var a=t.get("selectedLocation");return t.set("subLocationList",e.map(n.default.selectObjectMap)),e.includes(a)&&!l||t.set("selectedLocation",e.get("firstObject")),t.set("label","And"),e.filter(function(e){return t.get("selectedLocation.id")!==e.get("id")})},a);var s=e.get("firstObject");t.default.isEmpty(s)||s.set("label",this.get("label")),this.set("calculatedLocationPickers",e)},locationPickers:function(){var e=this.get("locationList"),n=[],a=this.get("quantityRequested");if(!t.default.isEmpty(e)&&!t.default.isEmpty(a))return this.set("doingSetup",!0),e.reduce(function(e,l){return e0)return"have-inventory-items"}.property("content"),mappedContent:function(){var e=this.get("content"),t=[];return e&&(t=e.map(this._mapInventoryItems.bind(this))),t}.property("content"),contentChanged:function(){var e=this.get("bloodhound"),t=this.get("content");e&&(e.clear(),e.add(t.map(this._mapInventoryItems.bind(this))))}.observes("content.[]"),itemSelected:function(e){var n=this;this._super();var a=this.get("store");t.default.isEmpty(e)||a.find("inventory",e.id).then(function(e){var a=n.get("model");a.set("inventoryItem",e),t.default.run.once(n,function(){a.validate().catch(t.default.K)})})}})}),define("hospitalrun/components/item-listing",["exports","ember","hospitalrun/mixins/paging-actions"],function(e,t,n){e.default=t.default.Component.extend(n.default,{classNames:["panel","panel-primary"]})}),define("hospitalrun/components/loading-message",["exports","ember","ember-i18n"],function(e,t,n){e.default=t.default.Component.extend({tagName:"span",showLoadingMessages:!1,loadingMessages:[(0,n.translationMacro)("loading.messages.0"),(0,n.translationMacro)("loading.messages.1"),(0,n.translationMacro)("loading.messages.2"),(0,n.translationMacro)("loading.messages.3"),(0,n.translationMacro)("loading.messages.4"),(0,n.translationMacro)("loading.messages.5"),(0,n.translationMacro)("loading.messages.6"),(0,n.translationMacro)("loading.messages.7"),(0,n.translationMacro)("loading.messages.8"),(0,n.translationMacro)("loading.messages.9"),(0,n.translationMacro)("loading.messages.10"),(0,n.translationMacro)("loading.messages.11")],_setRandomMessage:function(){var e=this.get("loadingMessages"),n=Math.floor(Math.random()*e.length);this.set("message",e[n]),this.set("timer",t.default.run.later(this,this._setRandomMessage,1e3))},didInsertElement:function(){this._setRandomMessage()},willDestroyElement:function(){var e=this.get("timer");t.default.isEmpty(e)||t.default.run.cancel(e)}})}),define("hospitalrun/components/location-select",["exports","ember"],function(e,t){e.default=t.default.Component.extend({locationPicker:null,_setup:function(){this.locationChange=this.currentLocationChanged.bind(this)}.on("init"),currentLocationChanged:function(e){this.get("locationPicker").set("selectedLocation",e),t.default.run.once(this,function(){this.get("parentView").locationChange()})}})}),define("hospitalrun/components/medication-allergy",["exports","ember"],function(e,t){var n=t.default.computed,a=t.default.get,l=t.default.isEmpty;e.default=t.default.Component.extend({classNames:"ps-info-group long-form",store:t.default.inject.service(),i18n:t.default.inject.service(),patient:null,displayModal:!1,currentAllergy:!1,buttonConfirmText:n("currentAllergy",function(){var e=this.get("i18n"),t=this.get("currentAllergy");return t?e.t("buttons.update"):e.t("buttons.add")}),additionalButtons:n("currentAllergy",function(){var e=this.get("currentAllergy"),t=this.get("i18n").t("buttons.delete");if(e)return[{class:"btn btn-default warning",buttonAction:"deleteAllergy",buttonIcon:"octicon octicon-x",buttonText:t}]}),showAllergies:n("canAddAllergy","patient.allergies.[]",{get:function(){var e=a(this,"canAddAllergy"),t=a(this,"patient.allergies");return e||!l(t)}}),modalTitle:t.default.computed("currentAllergy",function(){var e=this.get("currentAllergy"),t=this.get("i18n");return e?t.t("allergies.titles.editAllergy"):t.t("allergies.titles.addAllergy")}),closeAllergyModal:function(){this.set("currentAllergy",!1),this.set("displayModal",!1)},actions:{cancel:function(){this.closeAllergyModal()},closeModal:function(){this.closeAllergyModal()},editAllergy:function(e){this.set("currentAllergy",e),this.set("displayModal",!0)},createNewAllergy:function(){this.set("displayModal",!0)},updateAllergy:function(){var e=this,t=this.get("patient"),n=this.get("currentAllergy");n?n.save().then(function(){e.closeAllergyModal()}):(n=this.get("store").createRecord("allergy",{name:this.get("name")}),n.save().then(function(){t.get("allergies").pushObject(n),t.save().then(function(){e.set("name",""),e.closeAllergyModal()})}))},deleteAllergy:function(){var e=this,t=this.get("currentAllergy"),n=this.get("patient"),a=n.get("allergies");t.destroyRecord().then(function(){a.removeObject(t),n.save().then(function(){e.closeAllergyModal()})})}}})}),define("hospitalrun/components/modal-dialog",["exports","ember"],function(e,t){e.default=t.default.Component.extend({i18n:t.default.inject.service(),cancelAction:"cancel",closeModalAction:"closeModal",hideCancelButton:!1,hideUpdateButton:!1,isUpdateDisabled:!1,title:"",updateButtonAction:"",updateButtonClass:"",updateButtonText:"",cancelButtonText:"",cancelBtnText:function(){var e=this.get("cancelButtonText");return t.default.isEmpty(e)?this.get("i18n").t("buttons.cancel"):e}.property("cancelButtonText"),actions:{cancelAction:function(){this.sendAction("cancelAction")},fireButtonAction:function(e){this.set(e,e),this.sendAction(e)},updateAction:function(){this.sendAction("updateButtonAction")}},didInsertElement:function(){var e=this.$(".modal").modal();e.on("hidden.bs.modal",function(){this.sendAction("closeModalAction")}.bind(this))},willDestroyElement:function(){var e=this.$(".modal");e.off("hidden.bs.modal"),e.modal("hide"),$("body").removeClass("modal-open"),$(".modal-backdrop").remove()}})}),define("hospitalrun/components/nav-menu",["exports","ember","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.Component.extend(n.default,{tagName:"div",classNames:["primary-nav-item"],nav:null,show:function(){return this._setupSubNav(),this.currentUserCan(this.get("nav").capability)}.property("nav","session.data.authenticated.userCaps"),isShowing:!1,_setup:function(){var e=this.get("nav");e.closeSubnav=function(){this.set("isShowing",!1)}.bind(this),this._setupSubNav()}.on("init"),_setupSubNav:function(){var e=this,t=this.get("nav");t.subnav.forEach(function(t){t.show=e.currentUserCan(t.capability)})},callNavAction:"navAction",callCloseSettings:"closeSettings",actions:{toggleContent:function(){this.set("isShowing",!this.get("isShowing")),this.sendAction("callNavAction",this.nav)},resetNav:function(){this.sendAction("callCloseSettings")}}})}),define("hospitalrun/components/nav-paging",["exports","ember","hospitalrun/mixins/paging-actions"],function(e,t,n){e.default=t.default.Component.extend(n.default,{classNames:["paging-buttons"],paginationProps:null})}),define("hospitalrun/components/number-input",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default.extend({sanitizeFunction:function(e){return e.replace(new RegExp(/([^0-9|.]+)/g),"")},focusOut:function(){return this._sanitizeValue(),this._super()},keyUp:function(){return this._sanitizeValue(),this._super()},_sanitizeValue:function(){var e=this.get("model"),t=this.get("property"),n=e.get(t),a=this.get("sanitizeFunction")(n);e.set(t,a)}})}),define("hospitalrun/components/patient-orders",["exports","ember","hospitalrun/mixins/filter-list","hospitalrun/mixins/user-session"],function(e,t,n,a){var l=t.default.computed;e.default=t.default.Component.extend(n.default,a.default,{editImagingAction:"editImaging",editLabAction:"editLab",editMedicationAction:"editMedication",filterBy:null,filterValue:null,newImagingAction:"newImaging",newLabAction:"newLab",newMedicationAction:"newMedication",showDeleteImagingAction:"showDeleteImaging",showDeleteLabAction:"showDeleteLab",showDeleteMedicationAction:"showDeleteMedication",sortKey:null,sortDesc:!1,orderTypeFilters:t.default.computed(function(){var e=this.get("i18n");return[e.t("components.patientOrders.labels.imagingOrderType").toString(),e.t("components.patientOrders.labels.labOrderType").toString(),e.t("components.patientOrders.labels.medicationOrderType").toString()]}),canAddImaging:t.default.computed(function(){return this.currentUserCan("add_imaging")}),canAddLab:t.default.computed(function(){return this.currentUserCan("add_lab")}),canAddMedication:t.default.computed(function(){return this.currentUserCan("add_medication")}),canDeleteImaging:t.default.computed(function(){return this.currentUserCan("delete_imaging")}),canDeleteLab:t.default.computed(function(){return this.currentUserCan("delete_lab")}),canDeleteMedication:t.default.computed(function(){return this.currentUserCan("delete_medication")}),filteredList:l("orderList.[]","filterBy","filterValue",function(){var e=this.get("filterBy"),t=this.get("filterValue"),n=this.get("orderList");return n=this.filterList(n,e,t)}),orderList:l("visit.imaging.[]","visit.labs.[]","visit.medication.[]",function(){var e=this,n=this.get("i18n"),a=this.get("visit.imaging"),l=this.get("visit.labs"),s=this.get("visit.medication"),i=new t.default.A;return i.addObjects(a.map(function(t){return t.set("orderType",n.t("components.patientOrders.labels.imagingOrderType")),t.set("name",t.get("imagingType.name")),t.set("dateProcessed",t.get("imagingDate")),e._setPermissions(t,"canAddImaging","canDeleteImaging"),t})),i.addObjects(l.map(function(t){return t.set("orderType",n.t("components.patientOrders.labels.labOrderType")),t.set("name",t.get("labType.name")),t.set("dateProcessed",t.get("labDate")),e._setPermissions(t,"canAddLab","canDeleteLab"),t})),i.addObjects(s.map(function(t){return t.set("orderType",n.t("components.patientOrders.labels.medicationOrderType")),t.set("name",t.get("medicationName")),t.set("dateProcessed",t.get("prescriptionDate")),t.set("result",""),t.set("notes",t.get("prescription")),e._setPermissions(t,"canAddMedication","canDeleteMedication"),t})),i}),sortedOrders:t.default.computed("filteredList","sortKey","sortDesc",function(){var e=this.get("filteredList"),n=this.get("sortDesc"),a=this.get("sortKey");return t.default.isEmpty(e)||t.default.isEmpty(a)?e:e=e.sort(function(e,l){var s=e.get(a),i=l.get(a);return"orderType"===a&&(s=s.toString(),i=i.toString()),n?t.default.compare(i,s):t.default.compare(s,i)})}),i18n:t.default.inject.service(),visit:null,_setPermissions:function(e,t,n){e.get("canEdit")&&(this.get(t)&&e.set("canEdit",!0),this.get(n)&&e.set("canDelete",!0))},actions:{filter:function(e,t){this.setProperties({filterBy:e,filterValue:t})},newImaging:function(){this.sendAction("newImagingAction")},newLab:function(){this.sendAction("newLabAction")},newMedication:function(){this.sendAction("newMedicationAction")},editOrder:function(e){var t=e.get("constructor.modelName").capitalize();this.sendAction("edit"+t+"Action",e)},showDeleteOrder:function(e){var t=e.get("constructor.modelName").capitalize();this.sendAction("showDelete"+t+"Action",e)},sortByKey:function(e,t){this.setProperties({sortKey:e,sortDesc:t})}}})}),define("hospitalrun/components/patient-summary",["exports","ember","hospitalrun/mixins/patient-diagnosis","hospitalrun/mixins/user-session"],function(e,t,n,a){var l=t.default.computed,s=t.default.get,i=t.default.isEmpty,o=["diganosisContainer","hideInActiveDiagnoses","patient.diagnoses.@each.active","patient.diagnoses.@each.secondaryDiagnosis","visit.diagnoses.@each.secondaryDiagnosis"];e.default=t.default.Component.extend(n.default,a.default,{allowAddAllergy:!1,allowAddDiagnosis:!1,allowAddOperativePlan:!1,classNames:["patient-summary"],disablePatientLink:!1,diagnosisList:null,editDiagnosisAction:"editDiagnosis",editOperativePlanAction:"editOperativePlan",editProcedureAction:"editProcedure",hideInActiveDiagnoses:!0,patient:null,patientProcedures:null,showAddDiagnosisAction:"showAddDiagnosis",showPatientAction:"showPatient",visit:null,canAddAllergy:l("allowAddAllergy",{get:function(){var e=s(this,"allowAddAllergy");return e&&this.currentUserCan("add_allergy")}}),canAddDiagnosis:l("allowAddAllergy",{get:function(){var e=s(this,"allowAddDiagnosis");return e&&this.currentUserCan("add_diagnosis")}}),canAddOperativePlan:l("allowAddOperativePlan",{get:function(){var e=s(this,"allowAddOperativePlan"); +return e&&this.currentUserCan("add_operative_plan")}}),currentOperativePlan:l("patient.operativePlans.@each.status",{get:function(){var e=s(this,"patient.operativePlans");return e.findBy("isPlanned",!0)}}),diagnosisContainer:l("patient","visit",function(){var e=this.get("visit");return i(e)&&(e=this.get("patient")),e}),havePrimaryDiagnoses:l("primaryDiagnoses.length",function(){var e=this.get("primaryDiagnoses.length");return e>0}),haveProcedures:l("patientProcedures.length",function(){var e=this.get("patientProcedures.length");return e>0}),haveSecondaryDiagnoses:l("secondaryDiagnoses.length",function(){var e=this.get("secondaryDiagnoses.length");return e>0}),primaryDiagnoses:l.apply(void 0,o.concat([function(){var e=this.get("diagnosisContainer"),t=this.get("hideInActiveDiagnoses");return this.getDiagnoses(e,t,!1)}])),secondaryDiagnoses:l.apply(void 0,o.concat([function(){var e=this.get("diagnosisContainer"),t=this.get("hideInActiveDiagnoses");return this.getDiagnoses(e,t,!0)}])),shouldLinkToPatient:l("disablePatientLink",function(){var e=this.get("disablePatientLink");return!e}),showPrimaryDiagnoses:l("canAddDiagnosis","havePrimaryDiagnoses",function(){return this.get("canAddDiagnosis")||this.get("havePrimaryDiagnoses")}),actions:{addOperativePlan:function(){this.sendAction("editOperativePlanAction")},editOperativePlan:function(e){this.sendAction("editOperativePlanAction",e)},linkToPatient:function(){var e=this.get("shouldLinkToPatient");if(e){var t=this.get("patient"),n=this.get("returnTo"),a=this.get("returnToContext");t.set("returnTo",n),t.set("returnToContext",a),this.sendAction("showPatientAction",this.get("patient"))}},editDiagnosis:function(e){this.sendAction("editDiagnosisAction",e)},editProcedure:function(e){e.set("returnToVisit"),e.set("returnToPatient",this.get("patient.id")),e.set("patient",this.get("patient")),this.sendAction("editProcedureAction",e)},showAddDiagnosis:function(){this.sendAction("showAddDiagnosisAction")}}})}),define("hospitalrun/components/patient-typeahead",["exports","ember","hospitalrun/mixins/patient-name","hospitalrun/components/type-ahead"],function(e,t,n,a){e.default=a.default.extend(n.default,{displayKey:"name",selectedAction:"selectedPatientChanged",setOnBlur:!0,_mapPatient:function(e){var t={};return t.name=this.getPatientDisplayName(e)+" - "+this.getPatientDisplayId(e),t[this.get("selectionKey")]=e,t},contentChanged:function(){var e=this.get("bloodhound"),n=this.get("content");e&&(e.clear(),t.default.isEmpty(n)||e.add(n.map(this._mapPatient.bind(this))))}.observes("content.[]"),mappedContent:function(){var e=this.get("content"),t=[];return e&&(t=e.map(this._mapPatient.bind(this))),t}.property("content")})}),define("hospitalrun/components/photo-display",["exports","ember"],function(e,t){e.default=t.default.Component.extend({computedPhotoUrl:null,filesystem:t.default.inject.service(),isFileSystemEnabled:t.default.computed.alias("filesystem.isFileSystemEnabled"),fileName:t.default.computed.alias("photo.fileName"),photo:null,url:t.default.computed.alias("photo.url"),photoUrl:function(){var e=this.get("computedPhotoUrl"),n=this.get("fileName"),a=this.get("filesystem"),l=this.get("isFileSystemEnabled"),s=this.get("url");return t.default.isEmpty(e)?(l&&a.pathToFileSystemURL(n).then(function(e){t.default.isEmpty(e)||this.set("computedPhotoUrl",e)}.bind(this)),s):e}.property("computedPhotoUrl","fileName","url")})}),define("hospitalrun/components/price-list",["exports","ember","hospitalrun/mixins/charge-actions"],function(e,t,n){e.default=t.default.Component.extend(n.default,{attributeBindings:["tabId:id","role"],charges:t.default.computed.alias("model.charges"),classNameBindings:["active"],classNames:["tab-pane"],index:null,model:null,pricingList:null,pricingType:null,role:"tab",setChargeQuantityAction:"setChargeQuantity",active:function(){var e=this.get("index");return 0===e}.property(),pricingListByType:function(){var e=this.get("pricingList"),n=this.get("pricingType"),a=[];if(!t.default.isEmpty(e)){e=e.filterBy("pricingType",n),e=e.map(function(e){var t=this.findChargeForPricingItem(e,this.get("charges"));return t&&this.sendAction("setChargeQuantityAction",e.id,t.get("quantity")),e}.bind(this));for(var l=0,s=e,i=s.length;l1&&!t.default.isEmpty(e)&&!isNaN(e)}.property("calculated"),currentQuantityGroups:function(){var e=void 0,n=this.get("quantityGroups"),a=this.get("targetUnit");if(e=n.get("firstObject"),!t.default.isEmpty(e)){var l=e.unit;t.default.isEmpty(l)?this.set("quantityGroups.firstObject.unit",a):this.updateCurrentUnit(l,0)}return n}.property("quantityGroups","targetUnit"),calculateTotal:function(){var e=this.get("quantityGroups"),n=!1,a=e.get("lastObject"),l=this.get("targetUnit");if(n=e.every(function(e){var n=e.quantity,a=e.unit;return!t.default.isEmpty(n)&&!t.default.isEmpty(a)&&!isNaN(n)}),n&&a.unit===l){var s=e.reduce(function(e,t){return e*parseInt(t.quantity)},1);this.set("calculated",s)}else this.set("calculated")},updateCurrentUnit:function(e,n){var a=this.get("targetUnit"),l=this.get("quantityGroups"),s=l.length;t.default.isEmpty(a)||(e===a?n0&&(this.set("selectedCamera",a[0].id),this.cameraChange(a[0].id))},_gotStream:function(e){if(this.isDestroyed)this._stopStream(e);else{var t=this.get("video");this.set("stream",e),t.src=window.URL.createObjectURL(e),t.play()}},_photoSourceChanged:function(e){var t=this.$(".camera"),n=this.$(".fileupload"),a=this.get("setupCamera");if(this.set("photoSource",e),e===l)n.show(),t.hide();else if(n.hide(),t.show(),!a){var s=this.$("canvas").get(0),i=this.$("img").get(0),o=this.$("video").get(0);this.setProperties({canvas:s,photo:i,video:o}),"undefined"==typeof MediaStreamTrack||"undefined"===MediaStreamTrack.getSources?navigator.getUserMedia&&(navigator.getUserMedia({audio:!1,video:!0},this._gotStream.bind(this),this._errorCallback),this._setupCanPlayListener(o)):(MediaStreamTrack.getSources(this._gotSources.bind(this)),this._setupCanPlayListener(o)),this.set("setupCamera",!0)}},_setupCanPlayListener:function(e){e.removeEventListener("canplay",this._setupVideo.bind(this),!1),e.addEventListener("canplay",this._setupVideo.bind(this),!1)},_setupVideo:function(){var e=this.get("canvas"),t=this.get("height"),n=this.get("video"),a=this.get("width");t=n.videoHeight/(n.videoWidth/a),n.setAttribute("width",a),n.setAttribute("height",t),e.setAttribute("width",a),e.setAttribute("height",t),this.setProperties({height:t,width:a})},_setup:function(){this.cameraChange=this._cameraChange.bind(this),this.photoSourceChange=this._photoSourceChanged.bind(this);var e=a;this.get("canCaptureVideo")||(e=l),this.set("photoSource",e)}.on("init"),_stopStream:function(e){var a=e||this.get("stream");if(!t.default.isEmpty(a))if("undefined"==typeof a.active)a.stop();else{var l=a.getTracks(),s=n(l,1),i=s[0];i.stop()}},actions:{takePhoto:function(){var e=this.get("canvas"),t=this.get("height"),n=this.get("video"),a=this.get("width");e.width=a,e.height=t,e.getContext("2d").drawImage(n,0,0,a,t);for(var l=e.toDataURL("image/png"),s=atob(l.split(",")[1]),i=[],o=0;o1}.property("photoSource","videoSources"),willDestroyElement:function(){this._stopStream()}})}),define("hospitalrun/components/text-search",["exports","ember"],function(e,t){e.default=t.default.TextField.extend(t.default.TargetActionSupport,{change:function(){this.triggerAction({action:"search"})},didInsertElement:function(){this.$().focus()}})}),define("hospitalrun/components/type-ahead",["exports","ember-rapid-forms/components/em-input","hospitalrun/mixins/typeahead"],function(e,t,n){e.default=t.default.extend(n.default)}),define("hospitalrun/components/typeahead-filter",["exports","ember","hospitalrun/mixins/typeahead"],function(e,t,n){e.default=t.default.Component.extend(n.default,{classNames:["input-group"],selectedAction:"filter",setOnBlur:!1,actions:{clearFilter:function(){var e=this.$(".tt-input");e.val(""),this.sendAction("selectedAction")}}})}),define("hospitalrun/controllers/abstract-delete-controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({afterDeleteAction:"closeModal",showUpdateButton:!0,updateButtonText:"Delete",updateButtonAction:"delete",isUpdateDisabled:!1,actions:{cancel:function(){this.send("closeModal")},delete:function(){var e=this.get("model");e.set("archived",!0),e.save().then(function(){e.unloadRecord(),this.send(this.get("afterDeleteAction"),e)}.bind(this))}}})}),define("hospitalrun/controllers/abstract-edit-controller",["exports","ember","hospitalrun/mixins/edit-panel-props","hospitalrun/mixins/is-update-disabled","hospitalrun/mixins/modal-helper","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s){e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,{cancelAction:"allItems",cancelButtonText:function(){var e=this.get("i18n"),t=this.get("model.hasDirtyAttributes");return t?e.t("buttons.cancel"):e.t("buttons.returnButton")}.property("model.hasDirtyAttributes"),disabledAction:function(){var e=this.get("model");e.validate&&e.validate().catch(t.default.K);var n=e.get("isValid");if(!n)return"showDisabledDialog"}.property("model.isValid"),isNewOrDeleted:function(){return this.get("model.isNew")||this.get("model.isDeleted")}.property("model.isNew","model.isDeleted"),lookupListsToUpdate:null,showUpdateButton:function(){var e=this.get("updateCapability");return this.currentUserCan(e)}.property("updateCapability"),updateButtonAction:"update",updateButtonText:function(){var e=this.get("i18n");return this.get("model.isNew")?e.t("buttons.add"):e.t("buttons.update")}.property("model.isNew"),updateCapability:null,_addValueToLookupList:function(e,n,a,l){var s=e.get("value");t.default.isArray(s)||(s=[]),s.includes(n)||(s.push(n),s.sort(),e.set("value",s),a.includes(e)||a.push(e),this.set(l,e))},_cancelUpdate:function(){var e=this.get("model");e.rollbackAttributes()},actions:{cancel:function(){this._cancelUpdate(),this.send(this.get("cancelAction"))},returnTo:function e(){this._cancelUpdate();var e=this.get("model.returnTo"),n=this.get("model.returnToContext");t.default.isEmpty(n)?this.transitionToRoute(e):this.transitionToRoute(e,n)},showDisabledDialog:function(){var e=this.get("i18n");this.displayAlert(e.t("alerts.warningExclamation"),e.t("messages.requiredFieldsCorrectErrors"))},update:function(e){var t=this;try{this.beforeUpdate().then(function(){t.saveModel(e)}).catch(function(e){if(!e.ignore){var n=t.get("i18n");t.displayAlert(n.t("alerts.errorExclamation"),n.t("messages.saveActionException",{message:JSON.stringify(e)}))}})}catch(e){var n=this.get("i18n");this.displayAlert(n.t("alerts.errorExclamation"),n.t("messages.saveActionException",{message:JSON.stringify(e)}))}}},afterUpdate:function(){},beforeUpdate:function(){return t.default.RSVP.Promise.resolve()},saveModel:function(e){this.get("model").save().then(function(t){this.updateLookupLists(),e||this.afterUpdate(t)}.bind(this))},updateLookupLists:function(){var e=this.get("lookupListsToUpdate"),n=t.default.A();t.default.isEmpty(e)||(e.forEach(function(e){var a=this.get(e.property),l=this.get(e.name),s=this.get("store");t.default.isEmpty(a)||(l||(l=s.push(s.normalize("lookup",{id:e.id,value:[],userCanAdd:!0}))),t.default.isArray(a)?a.forEach(function(t){this._addValueToLookupList(l,t,n,e.name)}.bind(this)):this._addValueToLookupList(l,a,n,e.name))}.bind(this)),n.forEach(function(e){e.save()}))}})}),define("hospitalrun/controllers/abstract-paged-controller",["exports","ember","hospitalrun/mixins/pagination-props","hospitalrun/mixins/progress-dialog","hospitalrun/mixins/user-session"],function(e,t,n,a,l){e.default=t.default.Controller.extend(n.default,a.default,l.default,{addPermission:null,deletePermission:null,nextStartKey:null,previousStartKey:null,previousStartKeys:[],progressMessage:"Loading Records. Please wait...",progressTitle:"Loading",queryParams:["startKey","sortKey","sortDesc"],sortDesc:!1,sortKey:null,canAdd:function(){return this.currentUserCan(this.get("addPermission"))}.property(),canDelete:function(){return this.currentUserCan(this.get("deletePermission"))}.property(),canEdit:function(){return this.currentUserCan(this.get("addPermission"))}.property(),showActions:function(){return this.get("canAdd")||this.get("canEdit")||this.get("canDelete")}.property("canAdd","canEdit","canDelete"),disablePreviousPage:function(){return t.default.isEmpty(this.get("previousStartKey"))}.property("previousStartKey"),disableNextPage:function(){return t.default.isEmpty(this.get("nextStartKey"))}.property("nextStartKey"),showPagination:function(){return!t.default.isEmpty(this.get("previousStartKey"))||!t.default.isEmpty(this.get("nextStartKey"))}.property("nextStartKey","previousStartKey"),hasRecords:t.default.computed("model.length",{get:function(){var e=this.get("model");return!t.default.isEmpty(e)&&e.get("length")>0}}),actions:{nextPage:function(){var e=this.get("nextStartKey"),t=this.get("previousStartKeys"),n=this.get("firstKey");this.set("previousStartKey",n),t.push(n),this.set("startKey",e),this.showProgressModal()},previousPage:function(){var e=this.get("previousStartKey"),t=this.get("previousStartKeys");t.pop(),this.set("startKey",e),this.set("previousStartKey",t.pop()),this.set("previousStartKeys",t),this.showProgressModal()},sortByKey:function(e,t){this.setProperties({previousStartKey:null,previousStartKeys:[],nextStartKey:null,sortDesc:t,sortKey:e,startKey:null,firstKey:null}),this.showProgressModal()}}})}),define("hospitalrun/controllers/abstract-report-controller",["exports","ember","hospitalrun/mixins/date-format","hospitalrun/mixins/modal-helper","hospitalrun/mixins/number-format","hospitalrun/mixins/pagination-props","hospitalrun/mixins/pouchdb","hospitalrun/mixins/progress-dialog"],function(e,t,n,a,l,s,i,o){e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,i.default,o.default,{defaultErrorMessage:"An error was encountered while generating the requested report. Please let your system administrator know that you have encountered an error.",offset:0,limit:25,progressMessage:"Please wait while your report is generated.",progressTitle:"Generating Report",reportColumns:null,reportHeaders:null,reportRows:[],reportTitle:null,reportType:null,reportTypes:null,showFirstPageButton:!0,showLastPageButton:!0,showReportResults:!1,_addReportRow:function(e,n,a,l){var s=void 0,i=this.get("reportRows"),o=[];t.default.isEmpty(a)&&(a=this.get("reportColumns"));for(var r in a)a[r].include&&(s=t.default.get(e,a[r].property),t.default.isEmpty(s)?o.push(""):"_numberFormat"===a[r].format?n?o.push(s):o.push(this._numberFormat(s)):!n&&a[r].format?o.push(this[a[r].format](s)):o.push(s));l?i.addObject({rowAction:l,row:o}):i.addObject(o)},_finishReport:function(e){this.set("showReportResults",!0),this.set("offset",0),this._setReportHeaders(e),this._setReportTitle(),this._generateExport(),this.closeProgressModal()},_generateExport:function(){var e=[],t=this.get("reportHeaders"),n=[t];n.addObjects(this.get("reportRows")),n.forEach(function(t){var n=void 0;n=t.row?t.row:t,n=n.map(function(e){return e?e.replace?e.replace('"','""'):e:""}),e.push('"'+n.join('","')+'"')});var a=e.join("\r\n"),l="data:application/csv;charset=utf-8,"+encodeURIComponent(a);this.set("csvExport",l)},_notifyReportError:function(e){var t=this.get("i18n");throw this.closeProgressModal(),this.displayAlert(t.t("alerts.reportError"),t.t("messages.reportError")),new Error(e)},_setReportHeaders:function(e){var n=[];t.default.isEmpty(e)&&(e=this.get("reportColumns"));for(var a in e)e[a].include&&n.push(e[a].label);this.set("reportHeaders",n)},_setReportTitle:function(){var e=this.get("endDate"),n="",a="",l=this.get("reportType"),s=this.get("reportTypes"),i=this.get("startDate");t.default.isEmpty(e)||(n=moment(e).format("l"));var o=s.findBy("value",l);t.default.isEmpty(i)?this.set("reportTitle",this.get("i18n").t("inventory.reports.titleSingleDate",{name:o.name,date:n})):(a=moment(i).format("l"),this.set("reportTitle",this.get("i18n").t("inventory.reports.titleDateRange",{name:o.name,startDate:a,endDate:n})))},actions:{firstPage:function(){this.set("offset",0)},nextPage:function(){var e=this.get("limit");this.incrementProperty("offset",e)},previousPage:function(){var e=this.get("limit");this.decrementProperty("offset",e)},lastPage:function(){var e=this.get("reportRows.length"),t=this.get("limit"),n=parseInt(e/t);this.set("offset",n*t)}},currentReportRows:function(){var e=this.get("limit"),t=this.get("offset"),n=this.get("reportRows");return n.slice(t,t+e)}.property("reportRows.[]","offset","limit"),disablePreviousPage:function(){return 0===this.get("offset")}.property("offset"),disableNextPage:function(){var e=this.get("limit"),t=this.get("reportRows.length"),n=this.get("offset");return n+e>=t}.property("offset","limit","reportRows.length"),showPagination:function(){var e=this.get("reportRows.length"),t=this.get("limit");return e>t}.property("reportRows.length")})}),define("hospitalrun/controllers/application",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({filesystem:t.default.inject.service(),session:t.default.inject.service(),_setup:function(){var e=this.get("filesystem");e.setup()}.on("init")})}),define("hospitalrun/controllers/index",["exports","ember","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.Controller.extend(n.default,{indexLinks:["Appointments","Labs","Imaging","Inventory","Medication","Patients","Users"],setupPermissions:function(){var e=this.get("defaultCapabilities");for(var t in e)this.currentUserCan(t)&&this.set("userCan_"+t,!0)}.on("init"),activeLinks:function(){var e=[],t=this.get("indexLinks");return t.forEach(function(t){var n=t.toLowerCase();this.currentUserCan(n)&&e.push({action:n,text:t})}.bind(this)),e}.property("indexLinks")})}),define("hospitalrun/controllers/login",["exports","ember"],function(e,t){var n=t.default.Controller.extend({session:t.default.inject.service(),errorMessage:null,identification:null,password:null,actions:{authenticate:function(){var e=this,t=this.getProperties("identification","password"),n=t.identification,a=t.password;this.get("session").authenticate("authenticator:custom",{identification:n,password:a}).catch(function(t){e.set("errorMessage",t.reason)})}}});e.default=n}),define("hospitalrun/controllers/navigation",["exports","ember","hospitalrun/mixins/hospitalrun-version","hospitalrun/mixins/modal-helper","hospitalrun/mixins/progress-dialog","hospitalrun/mixins/user-session","hospitalrun/mixins/navigation"],function(e,t,n,a,l,s,i){e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,i.default,{ajax:t.default.inject.service(),application:t.default.inject.controller(),allowSearch:!1,config:t.default.inject.service(),currentSearchText:null,currentRouteName:t.default.computed.alias("application.currentRouteName"),progressTitle:"Searching",searchRoute:null,session:t.default.inject.service(),syncStatus:"",currentOpenNav:null,actions:{about:function(){var e=this,n=this.get("version");this.get("ajax").request("/serverinfo").then(function(a){var l="Version: "+n;t.default.isEmpty(a)||(l+=" Site Info: "+a),e.displayAlert(e.get("i18n").t("navigation.about"),l)})},invalidateSession:function(){var e=this.get("session");e.get("isAuthenticated")&&e.invalidate()},search:function(){if(this.allowSearch&&this.searchRoute){var e=this.get("currentRouteName"),t=this.get("currentSearchText"),n=this.get("searchText");t===n&&e.indexOf(".search")!==-1||(this.set("searchText",""),this.set("progressMessage","Searching for "+n+". Please wait..."),this.showProgressModal(),this.transitionToRoute(this.searchRoute+"/"+n))}},navAction:function(e){this.currentOpenNav&&this.currentOpenNav.route!==e.route&&this.currentOpenNav.closeSubnav(),this.currentOpenNav=e,this.transitionToRoute(e.route),this.set("isShowingSettings",!1)},toggleSettings:function(){this.toggleProperty("isShowingSettings")},closeSettings:function(){this.set("isShowingSettings",!1)}}})}),define("hospitalrun/custom-form-add/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember"],function(e,t,n){var a=n.default.computed,l=n.default.isEmpty;e.default=t.default.extend({updateAction:"addForm",actions:{addForm:function(){var e=this.get("model.modelToAddTo"),t=e.get("customForms"),a=this.get("model.selectedForm");l(t)&&(t=n.default.Object.create(),e.set("customForms",t)),t.set(a,n.default.Object.create()),e.notifyPropertyChange("customForms"),this.send("closeModal")}},isUpdateDisabled:a("model.selectedForm",function(){return l(this.get("model.selectedForm"))})})}),define("hospitalrun/custom-form-add/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"jaecxfpb",block:'{"statements":[["block",["modal-dialog"],null,[["cancelAction","isUpdateDisabled","title","updateButtonAction","updateButtonText"],["closeModal",["get",["isUpdateDisabled"]],["helper",["t"],["customForms.titles.addCustomForm"],null],"addForm",["helper",["t"],["customForms.buttons.addForm"],null]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-select"],null,[["label","property","content","prompt"],[["helper",["t"],["customForms.labels.formToAdd"],null],"selectedForm",["get",["model","customForms"]]," "]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/custom-form-add/template.hbs"}})}),define("hospitalrun/diagnosis/edit/controller",["exports","ember","hospitalrun/controllers/abstract-edit-controller"],function(e,t,n){var a=t.default.computed;e.default=n.default.extend({updateCapability:"add_diagnosis",editController:t.default.computed.alias("model.editController"),diagnosisList:t.default.computed.alias("editController.diagnosisList"),newDiagnosis:!1,lookupListsToUpdate:[{name:"diagnosisList",property:"model.diagnosis",id:"diagnosis_list"}],additionalButtons:a("model.isNew",function(){var e=this.get("i18n"),t=this.get("model.isNew");if(!t)return[{class:"btn btn-default warning",buttonAction:"deleteDiagnosis",buttonIcon:"octicon octicon-x",buttonText:e.t("buttons.delete")}]}),canDeleteDiagnosis:a(function(){return this.currentUserCan("delete_diagnosis")}),title:a("model.isNew",function(){var e=this.get("i18n"),t=this.get("model.isNew");return t?e.t("diagnosis.titles.addDiagnosis"):e.t("diagnosis.titles.editDiagnosis")}),afterUpdate:function(e){var t=this.get("newDiagnosis");t?this.get("editController").send("addDiagnosis",e):this.send("closeModal")},beforeUpdate:function(){var e=this.get("model");return this.set("newDiagnosis",e.get("isNew")),t.default.RSVP.Promise.resolve()},actions:{cancel:function(){this.send("closeModal")},deleteDiagnosis:function(){var e=this.get("model");this.get("editController").send("deleteDiagnosis",e)}}})}),define("hospitalrun/diagnosis/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"BW/Gub9/",block:'{"statements":[["block",["modal-dialog"],null,[["additionalButtons","hideCancelButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["additionalButtons"]],["get",["hideCancelButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["helper",["t"],["diagnosis.labels.activeDiagnosis"],null],"active","col-sm-4"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["diagnosis.labels.diagnosis"],null],false],["close-element"],["text","\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","diagnosis"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","hint","class"],["diagnosis",["helper",["t"],["diagnosis.labels.diagnosis"],null],["get",["diagnosisList"]],false,"diagnosis-text required"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,2,1],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["date",["helper",["t"],["diagnosis.labels.date"],null],"col-sm-4 required"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["helper",["t"],["diagnosis.labels.secondaryDiagnosis"],null],"secondaryDiagnosis","col-sm-4"]]],false],["text","\\n"],["block",["unless"],[["get",["model","isNew"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],3]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/diagnosis/edit/template.hbs"}})}),define("hospitalrun/dialog/controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({showUpdateButton:!0,isUpdateDisabled:!1,actions:{cancel:function(){this.send("closeModal")},confirm:function(){var e=this.getWithDefault("model.confirmAction","model.confirm");this.send(e,this.get("model")),this.send("closeModal")},ok:function(){var e=this.get("model.okAction");t.default.isEmpty(e)||this.send(e,this.get("model")),this.send("closeModal")}}})}),define("hospitalrun/dialog/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"zQVnRxTE",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","hideUpdateButton","isUpdateDisabled","title","updateButtonAction","updateButtonText","cancelButtonText"],[["get",["model","hideCancelButton"]],["get",["model","hideUpdateButton"]],["get",["model","isUpdateDisabled"]],["get",["model","title"]],["get",["model","updateButtonAction"]],["get",["model","updateButtonText"]],["get",["model","cancelButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","progress"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","progress-bar progress-bar-striped active"],["static-attr","role","progressbar"],["dynamic-attr","aria-valuenow",["unknown",["model","progressBarValue"]],null],["static-attr","aria-valuemin","0"],["static-attr","aria-valuemax","100"],["dynamic-attr","style",["unknown",["model","progressBarStyle"]],null],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","sr-only"],["flush-element"],["append",["helper",["t"],["loading.progressBar.progress"],[["progressBarValue"],[["get",["model","progressBarValue"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","showProgress"]]],null,0],["text"," "],["append",["unknown",["model","message"]],false],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/dialog/template.hbs"}})}),define("hospitalrun/finishgauth/route",["exports","ember","hospitalrun/mixins/setup-user-role"],function(e,t,n){e.default=t.default.Route.extend(n.default,{config:t.default.inject.service(),database:t.default.inject.service(),session:t.default.inject.service(),model:function(e){var t=this;if(e.k&&e.s1&&e.s2&&e.t){var n=function(){t.get("session").authenticate("authenticator:custom",{google_auth:!0,params:e});var n={config_consumer_key:e.k,config_consumer_secret:e.s1,config_oauth_token:e.t,config_token_secret:e.s2};return{v:t.get("config").saveOauthConfigs(n).then(function(){var e=this;return n.config_use_google_auth=!0,this.get("database").setup(n).then(function(){return e.setupUserRole()})}.bind(t))}}();if("object"==typeof n)return n.v}}})}),define("hospitalrun/helpers/and",["exports","ember","ember-truth-helpers/helpers/and"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.andHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.andHelper)),e.default=a}),define("hospitalrun/helpers/app-version",["exports","ember","hospitalrun/config/environment"],function(e,t,n){function a(){return l}e.appVersion=a;var l=n.default.APP.version;e.default=t.default.Helper.helper(a)}),define("hospitalrun/helpers/date-format",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e,a){if(!t.default.isEmpty(e[0])){var l="l",s=n(e,1),i=s[0];return a&&a.format&&(l=a.format),moment(i).format(l)}})}),define("hospitalrun/helpers/eq",["exports","ember","ember-truth-helpers/helpers/equal"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.equalHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.equalHelper)),e.default=a}),define("hospitalrun/helpers/gt",["exports","ember","ember-truth-helpers/helpers/gt"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.gtHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.gtHelper)),e.default=a}),define("hospitalrun/helpers/gte",["exports","ember","ember-truth-helpers/helpers/gte"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.gteHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.gteHelper)),e.default=a}),define("hospitalrun/helpers/html-line-break",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,1),l=a[0];return null!==l&&"undefined"!=typeof l?t.default.String.htmlSafe(l.replace(/\n/g,"
")):null})}),define("hospitalrun/helpers/is-array",["exports","ember","ember-truth-helpers/helpers/is-array"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.isArrayHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.isArrayHelper)),e.default=a}),define("hospitalrun/helpers/is-equal-array",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,2),l=a[0],s=a[1];return!(!t.default.isArray(l)||!t.default.isArray(s)||l.get("length")!==s.get("length"))&&l.every(function(e){return s.includes(e)})})}),define("hospitalrun/helpers/is-equal-by-path",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,3),l=a[0],s=a[1],i=a[2];return i?t.default.get(l,i)===s:l===s})}),define("hospitalrun/helpers/is-equal",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var t=n(e,2),a=t[0],l=t[1];return a===l})}),define("hospitalrun/helpers/is-not",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var t=n(e,1),a=t[0];return!a})}),define("hospitalrun/helpers/lt",["exports","ember","ember-truth-helpers/helpers/lt"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.ltHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.ltHelper)),e.default=a}),define("hospitalrun/helpers/lte",["exports","ember","ember-truth-helpers/helpers/lte"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.lteHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.lteHelper)),e.default=a}),define("hospitalrun/helpers/not-eq",["exports","ember","ember-truth-helpers/helpers/not-equal"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.notEqualHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.notEqualHelper)),e.default=a}),define("hospitalrun/helpers/not",["exports","ember","ember-truth-helpers/helpers/not"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.notHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.notHelper)),e.default=a}),define("hospitalrun/helpers/number-format",["exports","ember","hospitalrun/mixins/number-format"],function(e,t,n){var a=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=t.default.Object.extend(n.default);e.default=t.default.Helper.helper(function(e){var t=a(e,1),n=t[0],s=new l;return s._numberFormat(n)})}),define("hospitalrun/helpers/or",["exports","ember","ember-truth-helpers/helpers/or"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.orHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.orHelper)),e.default=a}),define("hospitalrun/helpers/pluralize",["exports","ember-inflector/lib/helpers/pluralize"],function(e,t){e.default=t.default}),define("hospitalrun/helpers/read-path",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,2),l=a[0],s=a[1];return t.default.isEmpty(s)?l:t.default.get(l,s)})}),define("hospitalrun/helpers/singularize",["exports","ember-inflector/lib/helpers/singularize"],function(e,t){e.default=t.default}),define("hospitalrun/helpers/t",["exports","ember-i18n/helper"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/helpers/xor",["exports","ember","ember-truth-helpers/helpers/xor"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.xorHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.xorHelper)),e.default=a}),define("hospitalrun/imaging/charge/controller",["exports","hospitalrun/procedures/charge/controller","ember"],function(e,t,n){e.default=t.default.extend({cancelAction:"closeModal",newPricingItem:!1,requestingController:n.default.inject.controllers("imaging/edit"),pricingList:n.default.computed.alias("requestingController.chargesPricingList")})}),define("hospitalrun/imaging/charge/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"bkPMKXlR",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","procedures/charge"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/imaging/charge/template.hbs"}})}),define("hospitalrun/imaging/completed/completed-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr"})}),define("hospitalrun/imaging/completed/completed-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"mAPPy+fo",block:'{"statements":[["open-element","td",[]],["static-attr","class","requested-date"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","requestedDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","imaging-date"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","imagingDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["imaging","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","display-name"],["flush-element"],["append",["unknown",["imaging","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","type"],["flush-element"],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","results"],["flush-element"],["append",["unknown",["imaging","result"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["imaging","notes"]],false],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/completed/completed-list-item/template.hbs"}})}),define("hospitalrun/imaging/completed/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({startKey:[],showActions:!1})}),define("hospitalrun/imaging/completed/route",["exports","ember-i18n","hospitalrun/imaging/index/route"],function(e,t,n){e.default=n.default.extend({pageTitle:(0,t.translationMacro)("imaging.titles.completedImaging"),searchStatus:"Completed"})}),define("hospitalrun/imaging/completed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Rfh3vstr",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["imaging.messages.noCompleted"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["imaging/completed/completed-list-item"],null,[["imaging"],[["get",["imaging"]]]]],false],["text","\\n"]],"locals":["imaging"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table imaging-completed-table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateCompleted"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.results"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,1],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model"]]],null,2,0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/completed/template.hbs"}})}),define("hospitalrun/imaging/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller","hospitalrun/mixins/patient-submodule"],function(e,t,n){e.default=t.default.extend(n.default,{title:"Delete Request",actions:{delete:function(){this.deleteChildFromVisit("imaging")}}})}),define("hospitalrun/imaging/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"9b0/J8uA",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["imaging.messages.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/delete/template.hbs"}})}),define("hospitalrun/imaging/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/charge-actions","ember","hospitalrun/mixins/patient-submodule"],function(e,t,n,a,l){e.default=t.default.extend(n.default,l.default,{imagingController:a.default.inject.controller("imaging"),chargePricingCategory:"Imaging",chargeRoute:"imaging.charge",selectedImagingType:null,canComplete:function(){var e=this.get("model.isNew"),t=this.get("model.imagingTypeName"),n=this.get("selectedImagingType");return(!e||!(a.default.isEmpty(t)||a.default.isArray(n)&&n.length>1))&&this.currentUserCan("complete_imaging")}.property("selectedImagingType.[]","model.imagingTypeName"),actions:{completeImaging:function(){this.set("model.status","Completed"),this.get("model").validate().then(function(){this.get("model.isValid")&&(this.set("model.imagingDate",new Date),this.send("update"))}.bind(this)).catch(a.default.K)},update:function(){var e=this;this.get("model.isNew")?!function(){var t=e.get("model"),n=e.get("selectedImagingType");a.default.isEmpty(e.get("model.status"))&&e.set("model.status","Requested"),e.set("model.requestedBy",t.getUserName()),e.set("model.requestedDate",new Date),a.default.isEmpty(n)?e.saveNewPricing(e.get("model.imagingTypeName"),"Imaging","model.imagingType").then(function(){this.addChildToVisit(t,"imaging","Imaging").then(function(){this.saveModel()}.bind(this))}.bind(e)):e.getSelectedPricing("selectedImagingType").then(function(e){a.default.isArray(e)?this.createMultipleRequests(e,"imagingType","imaging","Imaging"):(this.set("model.imagingType",e),this.addChildToVisit(t,"imaging","Imaging").then(function(){this.saveModel()}.bind(this)))}.bind(e))}():this.saveModel()}},additionalButtons:function(){var e=this.get("i18n"),t=this.get("canComplete"),n=this.get("model.isValid");if(n&&t)return[{buttonAction:"completeImaging",buttonIcon:"glyphicon glyphicon-ok",class:"btn btn-primary on-white",buttonText:e.t("buttons.complete")}]}.property("canComplete","model.isValid"),lookupListsToUpdate:[{name:"radiologistList",property:"model.radiologist",id:"radiologists"}],pricingTypeForObjectType:"Imaging Procedure",pricingTypes:a.default.computed.alias("imagingController.imagingPricingTypes"),pricingList:null,radiologistList:a.default.computed.alias("imagingController.radiologistList"),updateCapability:"add_imaging",afterUpdate:function(e,t){var n=this.get("i18n");this.updateLookupLists();var a=void 0,l=void 0,s=void 0;"Completed"===this.get("model.status")?(l=n.t("imaging.alerts.completedTitle"),s=n.t("imaging.alerts.completedMessage")):(l=n.t("imaging.alerts.savedTitle"),s=n.t("imaging.alerts.savedMessage")),t&&(a=this.get("cancelAction")),this.saveVisitIfNeeded(l,s,a),this.set("model.selectPatient",!1)}})}),define("hospitalrun/imaging/edit/route",["exports","ember-i18n","hospitalrun/routes/abstract-edit-route","hospitalrun/mixins/charge-route","ember","hospitalrun/mixins/patient-list-route"],function(e,t,n,a,l,s){e.default=n.default.extend(a.default,s.default,{editTitle:(0,t.translationMacro)("imaging.titles.editTitle"),modelName:"imaging",newTitle:(0,t.translationMacro)("imaging.titles.editTitle"),pricingCategory:"Imaging",actions:{returnToAllItems:function(){this.controller.send("returnToAllItems")}},getNewData:function(){return l.default.RSVP.resolve({selectPatient:!0,requestDate:moment().startOf("day").toDate()})}})}),define("hospitalrun/imaging/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"FpG92j1s",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","prompt","class"],["radiologist",["helper",["t"],["imaging.labels.radiologist"],null],["get",["radiologistList"]]," ","radiologist-input"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["result",["helper",["t"],["labels.result"],null],"result-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDate"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-9"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","imagingType","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-12"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","requestedBy"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","prompt","selected"],["col-xs-3 required",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["helper",["t"],["imaging.labels.addNewVisit"],null],["get",["model","visit"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["checkbox-or-typeahead"],null,[["property","label","list","selection","optionLabelPath","typeAheadType","className","prompt","model","class"],["imagingTypeName",["helper",["t"],["labels.imagingType"],null],["get",["objectTypeList"]],["get",["selectedImagingType"]],"name","pricing","required"," ",["get",["model"]],"imaging-type-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"imaging.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required patient-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","selectPatient"]]],null,4,3],["block",["if"],[["get",["model","isNew"]]],null,2,1],["block",["if"],[["get",["canComplete"]]],null,0],["text"," "],["append",["helper",["em-text"],null,[["property","label","rows"],["notes",["helper",["t"],["labels.notes"],null],3]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],5]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/edit/template.hbs"}})}),define("hospitalrun/imaging/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],addPermission:"add_imaging"})}),define("hospitalrun/imaging/index/imaging-edit-button/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"button",classNames:["btn","btn-default","neutral"]})}),define("hospitalrun/imaging/index/imaging-edit-button/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"fgj2GO/M",block:'{"statements":[["block",["link-to"],["imaging.edit",["get",["imaging"]]],null,0],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["append",["helper",["t"],["labels.edit"],null],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/index/imaging-edit-button/template.hbs"}})}),define("hospitalrun/imaging/index/requested-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr",classNames:["clickable"],click:function(){this.sendAction("action",this.imaging)}})}),define("hospitalrun/imaging/index/requested-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"JWG9328s",block:'{"statements":[["open-element","td",[]],["static-attr","class","date"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","requestedDate"]]],[["format"],["l h:mm A"]]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["imaging","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","patient"],["flush-element"],["append",["unknown",["imaging","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","type"],["flush-element"],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["imaging","notes"]],false],["close-element"],["text","\\n\\n"],["block",["if"],[["get",["showActions"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["imaging/index/imaging-edit-button"],null,[["imaging"],[["get",["imaging"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEdit"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/index/requested-list-item/template.hbs"}})}),define("hospitalrun/imaging/index/route",["exports","ember-i18n","hospitalrun/routes/abstract-index-route"],function(e,t,n){e.default=n.default.extend({modelName:"imaging",pageTitle:(0,t.translationMacro)("imaging.pageTitle"),searchStatus:"Requested",_getStartKeyFromItem:function(e){var t=e.get("imagingDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("requestedDateAsTime"),l=this.get("searchStatus");return[l,a,t,n]},_modelQueryParams:function(){var e=this._getMaxPouchId(),t=this.get("maxValue"),n=this._getMinPouchId(),a=this.get("searchStatus");return{options:{startkey:[a,null,null,n],endkey:[a,t,t,e]},mapReduce:"imaging_by_status"}}})}),define("hospitalrun/imaging/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"bA1O68vE",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["messages.createNewRecord"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["imaging/index/requested-list-item"],null,[["imaging","action","showActions","canEdit"],[["get",["imaging"]],"editItem",["get",["showActions"]],["get",["canEdit"]]]]],false],["text","\\n"]],"locals":["imaging"]},{"statements":[["text"," "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,3],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,4,1]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/imaging/index/template.hbs"}})}),define("hospitalrun/imaging/route",["exports","ember-i18n","hospitalrun/routes/abstract-module-route"],function(e,t,n){e.default=n.default.extend({addCapability:"add_imaging",additionalModels:[{name:"imagingPricingTypes",findArgs:["lookup","imaging_pricing_types"]},{name:"radiologistList",findArgs:["lookup","radiologists"]}],allowSearch:!1,moduleName:"imaging",newButtonText:(0,t.translationMacro)("imaging.buttons.newButton"),sectionTitle:(0,t.translationMacro)("imaging.sectionTitle")})}),define("hospitalrun/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","hospitalrun/config/environment"],function(e,t,n){var a=n.default.APP,l=a.name,s=a.version;e.default={name:"App Version",initialize:(0,t.default)(l,s)}}),define("hospitalrun/initializers/container-debug-adapter",["exports","ember-resolver/container-debug-adapter"],function(e,t){e.default={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0];e.register("container-debug-adapter:main",t.default),e.inject("container-debug-adapter:main","namespace","application:main")}}}),define("hospitalrun/initializers/data-adapter",["exports","ember"],function(e,t){e.default={name:"data-adapter",before:"store",initialize:t.default.K}}),define("hospitalrun/initializers/ember-data",["exports","ember-data/setup-container","ember-data/-private/core"],function(e,t,n){e.default={name:"ember-data",initialize:t.default}}),define("hospitalrun/initializers/ember-i18n",["exports","ember-i18n/initializers/ember-i18n"],function(e,t){e.default=t.default}),define("hospitalrun/initializers/ember-keyboard-first-responder-inputs",["exports","ember-keyboard/initializers/ember-keyboard-first-responder-inputs"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"initialize",{enumerable:!0,get:function(){return t.initialize}})}),define("hospitalrun/initializers/ember-simple-auth",["exports","ember","hospitalrun/config/environment","ember-simple-auth/configuration","ember-simple-auth/initializers/setup-session","ember-simple-auth/initializers/setup-session-service"],function(e,t,n,a,l,s){e.default={name:"ember-simple-auth",initialize:function(e){var t=n.default["ember-simple-auth"]||{};t.baseURL=n.default.baseURL,a.default.load(t),(0,l.default)(e),(0,s.default)(e)}}}),define("hospitalrun/initializers/export-application-global",["exports","ember","hospitalrun/config/environment"],function(e,t,n){function a(){var e=arguments[1]||arguments[0];if(n.default.exportApplicationGlobal!==!1){var a;if("undefined"!=typeof window)a=window;else if("undefined"!=typeof global)a=global;else{if("undefined"==typeof self)return;a=self}var l,s=n.default.exportApplicationGlobal;l="string"==typeof s?s:t.default.String.classify(n.default.modulePrefix),a[l]||(a[l]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete a[l]}}))}}e.initialize=a,e.default={name:"export-application-global",initialize:a}}),define("hospitalrun/initializers/i18n",["exports"],function(e){e.default={name:"i18n",after:"ember-i18n",initialize:function(e){e.inject("route","i18n","service:i18n"),e.inject("controller","i18n","service:i18n"),e.inject("mixin","i18n","service:i18n"),e.inject("model","i18n","service:i18n")}}}),define("hospitalrun/initializers/injectStore",["exports","ember"],function(e,t){e.default={name:"injectStore",before:"store",initialize:t.default.K}}),define("hospitalrun/initializers/store",["exports","ember"],function(e,t){e.default={name:"store",after:"ember-data",initialize:t.default.K}}),define("hospitalrun/initializers/transforms",["exports","ember"],function(e,t){e.default={name:"transforms",before:"store",initialize:t.default.K}}),define("hospitalrun/initializers/truth-helpers",["exports","ember","ember-truth-helpers/utils/register-helper","ember-truth-helpers/helpers/and","ember-truth-helpers/helpers/or","ember-truth-helpers/helpers/equal","ember-truth-helpers/helpers/not","ember-truth-helpers/helpers/is-array","ember-truth-helpers/helpers/not-equal","ember-truth-helpers/helpers/gt","ember-truth-helpers/helpers/gte","ember-truth-helpers/helpers/lt","ember-truth-helpers/helpers/lte"],function(e,t,n,a,l,s,i,o,r,d,c,u,p){function m(){t.default.Helper||((0,n.registerHelper)("and",a.andHelper),(0,n.registerHelper)("or",l.orHelper),(0,n.registerHelper)("eq",s.equalHelper),(0,n.registerHelper)("not",i.notHelper),(0,n.registerHelper)("is-array",o.isArrayHelper),(0,n.registerHelper)("not-eq",r.notEqualHelper),(0,n.registerHelper)("gt",d.gtHelper),(0,n.registerHelper)("gte",c.gteHelper),(0,n.registerHelper)("lt",u.ltHelper),(0,n.registerHelper)("lte",p.lteHelper))}e.initialize=m,e.default={name:"truth-helpers",initialize:m}}),define("hospitalrun/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e.default={name:"ember-data",initialize:t.default}}),define("hospitalrun/instance-initializers/ember-i18n",["exports","ember-i18n/instance-initializers/ember-i18n"],function(e,t){e.default=t.default}),define("hospitalrun/instance-initializers/ember-simple-auth",["exports","ember-simple-auth/instance-initializers/setup-session-restoration"],function(e,t){e.default={name:"ember-simple-auth",initialize:function(e){(0,t.default)(e)}}}),define("hospitalrun/inventory/adjust/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/inventory-adjustment-types","ember","ember-i18n"],function(e,t,n,a,l){e.default=t.default.extend(n.default,{inventoryController:a.default.inject.controller("inventory"),expenseAccountList:a.default.computed.alias("inventoryController.expenseAccountList"),title:(0,l.translationMacro)("inventory.titles.adjustment"),transactionTypeChanged:function(){a.default.run.once(this,function(){this.get("model").validate().catch(a.default.K)})}.observes("transactionType"),updateButtonText:function(){return this.get("model.transactionType")}.property("model.transactionType"),updateButtonAction:"adjust",updateCapability:"adjust_inventory_location",actions:{cancel:function(){this.send("closeModal")},adjust:function(){this.send("adjustItems",this.get("model"),!0)}}})}),define("hospitalrun/inventory/adjust/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"9dBN/TFf",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.item"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","adjustmentItem","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.adjustmentFor"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","locationName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.currentQuantity"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath"],["col-sm-4",["helper",["t"],["inventory.labels.adjustmentType"],null],"transactionType",["get",["adjustmentTypes"]],"type","name"]]],false],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["adjustmentQuantity",["helper",["t"],["labels.quantity"],null],"col-sm-3 required"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["label","property","rows"],[["helper",["t"],["inventory.labels.reason"],null],"reason",3]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["inventory.labels.adjustmentDate"],null],"col-sm-4 required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["expenseAccount",["helper",["t"],["inventory.labels.expense"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]],"col-sm-8"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/adjust/template.hbs"}})}),define("hospitalrun/inventory/barcode/controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({selectedPrinter:null,barcodeUri:function(){var e=this.get("model.id"),n=this.get("model.name");return t.default.$(document).JsBarcode(e,{width:1,height:20,fontSize:10,displayValue:n,returnUri:!0})}.property("model.id","model.name"),printers:function(){return dymo.label.framework.getTapePrinters()}.property(),havePrinters:function(){var e=this.get("printers");return e.length>0}.property("printers"),singlePrinter:function(){var e=this.get("printers");return 1===e.length}.property("printers"),actions:{print:function(){var e=this.get("barcodeUri"),n=this.get("selectedPrinter");n||(n=this.get("printers")[0].name),t.default.$.get("/dymo/BarcodeAsImage.label",function(t){var a=dymo.label.framework.openLabelXml(t),l=e.substr("data:image/png;base64,".length);a.setObjectText("Image",l),a.print(n)},"text")}}})}),define("hospitalrun/inventory/barcode/route",["exports","ember"],function(e,t){e.default=t.default.Route.extend({model:function(e){return this.store.find("inventory",e.inventory_id)}})}),define("hospitalrun/inventory/barcode/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"PD6MlfyD",block:'{"statements":[["open-element","div",[]],["static-attr","class","panel panel-default"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","img",[]],["dynamic-attr","src",["unknown",["barcodeUri"]],null],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["close-element"],["text","\\n\\n"],["block",["if"],[["get",["havePrinters"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","label",[]],["static-attr","for","printerSelect"],["flush-element"],["append",["helper",["t"],["inventory.labels.printer"],null],false],["close-element"],["text","\\n "],["append",["helper",["select-list"],null,[["content","optionLabelPath","optionValuePath","value","class","action","id"],[["get",["printers"]],"name","name",["get",["selectedPrinter"]],"form-control",["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["selectedPrinter"]]],null]],null],"printerSelect"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["helper",["t"],["inventory.labels.printBarcode"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n"],["block",["unless"],[["get",["singlePrinter"]]],null,0],["text"," "],["close-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"print"]],["flush-element"],["open-element","span",[]],["static-attr","class"," glyphicon glyphicon-print"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.labels.print"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/barcode/template.hbs"}})}),define("hospitalrun/inventory/batch/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/inventory-id","hospitalrun/mixins/inventory-locations","ember","ember-i18n"],function(e,t,n,a,l,s){e.default=t.default.extend(n.default,a.default,{doingUpdate:!1,inventoryController:l.default.inject.controller("inventory"),inventoryItems:null,warehouseList:l.default.computed.alias("inventoryController.warehouseList"),aisleLocationList:l.default.computed.alias("inventoryController.aisleLocationList"),vendorList:l.default.computed.alias("inventoryController.vendorList"),purchaseAttributes:["expirationDate","inventoryItem","lotNumber","purchaseCost","quantity","vendorItemNo"],inventoryList:function(){var e=this.get("inventoryItems");if(!l.default.isEmpty(e)){var t=e.map(function(e){return e.doc});return t}}.property("inventoryItems.[]"),lookupListsToUpdate:[{name:"aisleLocationList",property:"model.aisleLocation",id:"aisle_location_list"},{name:"vendorList",property:"model.vendor",id:"vendor_list"},{name:"warehouseList",property:"model.location",id:"warehouse_list"}],showDistributionUnit:function(){return this._haveValidInventoryItem()}.property("model.inventoryItemTypeAhead","model.inventoryItem"),showInvoiceItems:function(){var e=this.get("model.invoiceItems");return!l.default.isEmpty(e)}.property("model.invoiceItems.[]"),totalReceived:function(){var e=this.get("model.invoiceItems"),t=0;l.default.isEmpty("invoiceItems")||(t=e.reduce(function(e,t){return e+Number(t.get("purchaseCost"))},t));var n=this.get("model.purchaseCost");return this.get("model.isValid")&&!l.default.isEmpty(n)&&(t+=Number(n)),t}.property("model.invoiceItems.[].purchaseCost","model.isValid","model.purchaseCost"),updateButtonText:(0,s.translationMacro)("inventory.labels.save"),updateCapability:"add_inventory_item",_addNewInventoryItem:function(){this.generateId().then(function(e){var t=this.store.createRecord("inventory",{id:e,name:this.get("model.inventoryItemTypeAhead"),quantity:0,skipSavePurchase:!0});this.send("openModal","inventory.quick-add",t)}.bind(this))},_addInventoryItem:function(){var e=this.get("model"),t=this.get("model.inventoryItemTypeAhead"),n=this.get("model.purchaseCost"),a=this.get("model.quantity");return e.validate().then(function(){if(!this.get("model.isValid")||l.default.isEmpty(t)||l.default.isEmpty(a)||l.default.isEmpty(n))throw Error("invalid");return this._haveValidInventoryItem()?void this._addInvoiceItem():(this._addNewInventoryItem(),!0)}.bind(this)).catch(function(){this.displayAlert(this.get("i18n").t("inventory.titles.warning"),this.get("i18n").t("inventory.messages.warning"))}.bind(this))},_addInvoiceItem:function(){var e=this.get("model"),t=e.get("invoiceItems"),n=e.getProperties(this.get("purchaseAttributes")),a=l.default.Object.create(n);t.addObject(a),e.set("expirationDate"),e.set("inventoryItem"),e.set("inventoryItemTypeAhead"),e.set("lotNumber"),e.set("purchaseCost"),e.set("quantity"),e.set("selectedInventoryItem"),e.set("vendorItemNo")},_findInventoryItem:function(e){var t=this.get("model.invoiceItems"),n=e.get("inventoryItem");if(!l.default.isEmpty(n)){var a=t.find(function(e){return e.get("inventoryItem.id")===n},this);if(!l.default.isEmpty(a))return a.get("inventoryItem")}},_haveValidInventoryItem:function(){var e=this.get("model.inventoryItemTypeAhead"),t=this.get("model.inventoryItem");if(l.default.isEmpty(e)||l.default.isEmpty(t))return!1;var n=t.get("name"),a=e.substr(0,n.length);return a===n},_savePurchases:function(){var e=this.get("model"),t=e.getProperties(["dateReceived","vendor","invoiceNo","location","aisleLocation","giftInKind"]),n=e.get("invoiceItems"),a=void 0,s=[];n.forEach(function(e){var n=e.get("inventoryItem"),l=e.get("quantity");a=this.store.createRecord("inv-purchase",t),a.setProperties(e.getProperties(this.get("purchaseAttributes"))),a.setProperties({distributionUnit:n.get("distributionUnit"),currentQuantity:l,originalQuantity:l,inventoryItem:n.get("id")}),s.push(a.save())}.bind(this)),l.default.RSVP.all(s).then(function(e){var t=[],n=[];e.forEach(function(e){var t=this._findInventoryItem(e),a=t.get("purchases");a.addObject(e),n.push(this.newPurchaseAdded(t,e))}.bind(this)),l.default.RSVP.all(t).then(function(){e.forEach(function(e){var n=this._findInventoryItem(e);n.updateQuantity(),t.push(n.save())}.bind(this)),l.default.RSVP.all(t).then(function(){this.updateLookupLists(),this.displayAlert(this.get("i18n").t("inventory.titles.purchaseSaved"),this.get("i18n").t("inventory.messages.purchaseSaved"),"allItems")}.bind(this))}.bind(this))}.bind(this))},actions:{addInventoryItem:function(){this._addInventoryItem()},addedNewInventoryItem:function(e){this.set("model.inventoryItem",e),this._addInvoiceItem(),this.send("closeModal"),this.get("doingUpdate")&&this._savePurchases()},removeItem:function(e){var t=this.get("model.invoiceItems"),n=e.itemToRemove;t.removeObject(n),this.send("closeModal")},showRemoveItem:function(e){var t=this.get("i18n").t("inventory.messages.removeItem"),n=l.default.Object.create({itemToRemove:e}),a=this.get("i18n").t("inventory.titles.removeItem");this.displayConfirm(a,t,"removeItem",n)},update:function(){this.set("doingUpdate",!0),this._addInventoryItem().then(function(e){e||this._savePurchases()}.bind(this))}}})});define("hospitalrun/inventory/batch/route",["exports","hospitalrun/inventory/request/route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({editTitle:(0,a.translationMacro)("navigation.subnav.inventoryReceived"),modelName:"inventory-batch",newTitle:(0,a.translationMacro)("navigation.subnav.inventoryReceived"),getNewData:function(){return n.default.RSVP.resolve({invoiceItems:[],dateReceived:new Date})},actions:{addedNewInventoryItem:function(e){this.controller.send("addedNewInventoryItem",e)}}})});define("hospitalrun/inventory/batch/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"9T4fAteu",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["append",["unknown",["invoiceItem","inventoryItem","name"]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","quantity"]]]]],false],["text","\\n "],["open-element","span",[]],["static-attr","class","input-group-addon"],["flush-element"],["text","\\n "],["append",["unknown",["invoiceItem","inventoryItem","distributionUnit"]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","purchaseCost"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","vendorItemNo"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","lotNumber"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","minDate","model"],["expirationDate","now",["get",["invoiceItem"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-1"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showRemoveItem",["get",["invoiceItem"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["inventory.labels.remove"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["invoiceItem"]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.invoiceItems"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.cost"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.itemNumber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.serialNumber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.expirationDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","invoiceItems"]]],null,0],["text"," "],["close-element"],["text","\\n "],["open-element","h4",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.totalReceived"],[["total"],[["get",["totalReceived"]]]]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","p",[]],["static-attr","class","form-control-static inventory-distribution-unit"],["flush-element"],["append",["unknown",["model","inventoryItem","distributionUnit"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateReceived",["helper",["t"],["inventory.labels.dateReceived"],null],"col-sm-4 required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["vendor",["helper",["t"],["inventory.labels.vendor"],null],["get",["vendorList"]],["get",["model","vendor"]],"col-sm-4 required test-vendor"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["invoiceNo",["helper",["t"],["inventory.labels.invoiceNumber"],null],"col-sm-4 test-invoice-number"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["location",["helper",["t"],["inventory.labels.location"],null],["get",["warehouseList"]],["get",["model","location"]],"col-sm-5"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["aisleLocation",["helper",["t"],["inventory.labels.aisleLocation"],null],["get",["aisleLocationList"]],["get",["model","aisleLocation"]],"col-sm-5"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-2 checkbox-label-space"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-check"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label sr-only"],["flush-element"],["append",["helper",["t"],["inventory.labels.gift"],null],false],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["inventory.labels.gift"],null],"giftInKind"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["helper",["t"],["inventory.labels.invoiceLineItem"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["inventory-typeahead"],null,[["class","property","label","content","selection","showQuantity"],["col-sm-7 required test-inv-item","inventoryItemTypeAhead",["helper",["t"],["inventory.labels.inventoryItem"],null],["get",["inventoryList"]],["get",["selectedInventoryItem"]],false]]],false],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["helper",["t"],["labels.quantity"],null],"col-sm-2 required test-inv-quantity"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-1"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.unit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showDistributionUnit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["purchaseCost",["helper",["t"],["inventory.labels.purchaseCost"],null],"col-sm-2 required test-inv-cost"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["vendorItemNo",["helper",["t"],["inventory.labels.vendorItemNumber"],null],"col-sm-4"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["lotNumber",["helper",["t"],["inventory.labels.serialNumber"],null],"col-sm-4"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","minDate","class"],["expirationDate",["helper",["t"],["inventory.labels.expirationDate"],null],"now","col-sm-2"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-2"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["text"," "],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"addInventoryItem"]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.labels.add"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["model","invoiceItems"]]],null,1]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],3]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/batch/template.hbs"}})}),define("hospitalrun/inventory/delete/controller",["exports","ember-i18n","hospitalrun/controllers/abstract-delete-controller"],function(e,t,n){e.default=n.default.extend({title:(0,t.translationMacro)("inventory.labels.deleteItem")})}),define("hospitalrun/inventory/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"sUGbE9jt",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text"," \\n "],["append",["helper",["t"],["inventory.messages.delete"],[["name"],[["get",["model","name"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/inventory/delete/template.hbs"}})}),define("hospitalrun/inventory/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-type-list","hospitalrun/mixins/return-to","hospitalrun/mixins/unit-types","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(a.default,l.default,s.default,i.default,o.default,{inventory:n.default.inject.controller(),savingNewItem:!1,canAddPurchase:function(){return this.currentUserCan("add_inventory_purchase")}.property(),canAdjustLocation:function(){return this.currentUserCan("adjust_inventory_location")},warehouseList:n.default.computed.alias("inventory.warehouseList"),aisleLocationList:n.default.computed.alias("inventory.aisleLocationList"),inventoryTypeList:n.default.computed.alias("inventory.inventoryTypeList.value"),inventoryUnitList:n.default.computed.alias("inventory.inventoryUnitList.value"),vendorList:n.default.computed.alias("inventory.vendorList"),database:n.default.inject.service(),lookupListsToUpdate:[{name:"aisleLocationList",property:"model.aisleLocation",id:"aisle_location_list"},{name:"vendorList",property:"model.vendor",id:"vendor_list"},{name:"warehouseList",property:"model.location",id:"warehouse_list"}],canEditQuantity:function(){return this.get("model.isNew")}.property("model.isNew"),haveTransactions:function(){var e=this.get("transactions");return null!==e}.property("transactions.[]"),locationQuantityTotal:function(){var e=this.get("model.locations"),t=e.reduce(function(e,t){return e+parseInt(t.get("quantity"))},0);return t}.property("model.locations"),quantityDiscrepency:function(){var e=this.get("locationQuantityTotal"),t=this.get("model.quantity");return!n.default.isEmpty(e)&&!n.default.isEmpty(t)&&e!==t}.property("locationQuantityTotal","model.quantity"),quantityDifferential:function(){var e=this.get("locationQuantityTotal"),t=this.get("model.quantity");return Math.abs(e-t)}.property("locationQuantityTotal","model.quantity"),originalQuantityUpdated:function(){var e=this.get("model.isNew"),t=this.get("model.originalQuantity");e&&!n.default.isEmpty(t)&&this.set("model.quantity",t)}.observes("model.isNew","model.originalQuantity"),showTransactions:function(){var e=this.get("transactions");return!n.default.isEmpty(e)}.property("transactions.[]"),transactions:null,updateCapability:"add_inventory_item",actions:{adjustItems:function(e){var t=parseInt(e.get("adjustmentQuantity")),n=this.get("model"),a=e.get("transactionType"),l=this.get("store").createRecord("inv-request",{adjustPurchases:!0,dateCompleted:e.get("dateCompleted"),expenseAccount:e.get("expenseAccount"),inventoryItem:n,quantity:t,transactionType:a,reason:e.get("reason"),deliveryAisle:e.get("aisleLocation"),deliveryLocation:e.get("location")});l.set("inventoryLocations",[e]);var s=!1;"Adjustment (Add)"!==a&&"Return"!==a||(s=!0),l.set("markAsConsumed",!0),l.get("inventoryItem").then(function(){this.send("fulfillRequest",l,!0,s,!0)}.bind(this))},editNewItem:function(){this.send("editItem",this.get("model.id"))},showAdjustment:function(e){e.setProperties({dateCompleted:new Date,adjustmentItem:this.get("model"),adjustmentQuantity:"",reason:"",transferItem:null,transactionType:"Adjustment (Add)"}),this.send("openModal","inventory.adjust",e)},showTransfer:function(e){e.set("adjustmentQuantity"),e.set("transferItem",this.get("model")),e.set("dateCompleted",new Date),this.send("openModal","inventory.transfer",e)},transferItems:function(e){var t=this.get("model"),n=this.get("store").createRecord("inv-request",{adjustPurchases:!1,dateCompleted:e.get("dateCompleted"),inventoryItem:t,quantity:e.get("adjustmentQuantity"),deliveryAisle:e.get("transferAisleLocation"),deliveryLocation:e.get("transferLocation"),transactionType:"Transfer"});this.transferToLocation(t,e).then(function(){e.setProperties({transferItem:null,transferLocation:null,transferAisleLocation:null,adjustmentQuantity:null}),n.set("locationsAffected",[{name:e.get("locationName"),quantity:n.get("quantity")}]),n.get("inventoryItem").then(function(){this._saveRequest(n)}.bind(this))}.bind(this))},updatePurchase:function(e,t){t&&(this.get("model").updateQuantity(),this.send("update",!0)),this.send("closeModal")}},_completeBeforeUpdate:function(e,t,a){var l=null,s=e.get("prefix"),i=[],o=this.get("model"),r=o.getProperties("aisleLocation","dateReceived","purchaseCost","lotNumber","expirationDate","giftInKind","invoiceNo","location","originalQuantity","quantityGroups","vendor","vendorItemNo"),d=this.get("model.originalQuantity");if(!n.default.isEmpty(d)){r.currentQuantity=d,r.inventoryItem=this.get("model.id");var c=this.get("store").createRecord("inv-purchase",r);i.push(c.save()),this.get("model.purchases").addObject(c),i.push(this.newPurchaseAdded(this.get("model"),c))}e.incrementProperty("value",1),l=e.get("value"),s+=l<1e5?String("00000"+l).slice(-5):l,o.set("friendlyId",s),i.push(e.save()),n.default.RSVP.all(i,"All before update done for inventory item").then(function(){t()},function(e){a(e)})},_findSequence:function(e,t,a){var l=new n.default.RSVP.Promise(function(t){this._checkNextSequence(t,e,0)}.bind(this));l.then(function(n){var l=this.get("store"),s=l.push(l.normalize("sequence",{id:"inventory_"+e,prefix:e.toLowerCase().substr(0,n),value:0}));this._completeBeforeUpdate(s,t,a)}.bind(this))},_findSequenceByPrefix:function(e,t){var n=this.get("database"),a={key:e.toLowerCase().substr(0,t)};return n.queryMainDB(a,"sequence_by_prefix")},_checkNextSequence:function(e,t,a){a++,this._findSequenceByPrefix(t,a).then(function(l){n.default.isEmpty(l.rows)?e(a):this._checkNextSequence(e,t,a)}.bind(this),function(){e(a)})},_saveRequest:function(e){e.set("status","Completed"),e.set("completedBy",e.getUserName()),e.save().then(function(){this.send("update",!0),this.send("closeModal"),this.getTransactions()}.bind(this))},getTransactions:function(){var e=this.get("model.id");this.set("transactions",null),this.store.query("inv-request",{options:{endkey:[e,"Completed",0],startkey:[e,"Completed",9999999999999],descending:!0},mapReduce:"inventory_request_by_item"}).then(function(e){this.set("transactions",e)}.bind(this))},beforeUpdate:function(){var e=this;if(!this.get("model.isNew"))return n.default.RSVP.Promise.resolve();var t=function(){var t=e.get("model"),a=t.get("inventoryType");return{v:new n.default.RSVP.Promise(function(e,n){t.validate().then(function(){t.get("isValid")?(this.set("savingNewItem",!0),this.store.find("sequence","inventory_"+a).then(function(t){this._completeBeforeUpdate(t,e,n)}.bind(this),function(){this._findSequence(a,e,n)}.bind(this))):(this.send("showDisabledDialog"),n("invalid model"))}.bind(this)).catch(function(){this.send("showDisabledDialog")}.bind(this))}.bind(e))}}();return"object"==typeof t?t.v:void 0},afterUpdate:function(){var e=null;this.get("savingNewItem")&&(e="editNewItem",this.set("savingNewItem",!1)),this.displayAlert("Inventory Item Saved","The inventory item has been saved.",e)}})}),define("hospitalrun/inventory/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n","hospitalrun/mixins/inventory-id"],function(e,t,n,a,l){e.default=t.default.extend(l.default,{editTitle:(0,a.translationMacro)("inventory.labels.editItem"),modelName:"inventory",newTitle:(0,a.translationMacro)("inventory.labels.newItem"),actions:{adjustItems:function(e){this.controller.send("adjustItems",e)},doneFulfillRequest:function(){this.controller.getTransactions()},editNewItem:function(){this.controller.send("editNewItem")},transferItems:function(e){this.controller.send("transferItems",e)},updatePurchase:function(e,t){this.controller.send("updatePurchase",e,t)}},getNewData:function(){return n.default.RSVP.resolve({dateReceived:new Date,quantityGroups:[]})},setupController:function(e,t){this._super(e,t),e.getTransactions()}})}),define("hospitalrun/inventory/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"dewSrZbs",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],27]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","4"],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-refresh glyphicon-refresh-animate"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.messages.loading"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["unknown",["location","name"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n"]],"locals":["location"]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.transferredFrom"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["transaction","locationsAffected"]]],null,1],["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.transferredTo"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.delivered"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.prescription"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["unknown",["location","name"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n"]],"locals":["location"]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.cost"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","costPerUnit"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.quantity"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","quantityAtCompletion"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.pulled"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["transaction","locationsAffected"]]],null,5],["block",["if"],[["get",["transaction","patient"]]],null,4,3]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.location"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.returned"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.reason"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","reason"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["transaction","haveReason"]]],null,9],["block",["if"],[["get",["transaction","patient"]]],null,8,7]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["transaction","dateCompleted"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["transaction","quantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["transaction","transactionType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["transaction","expenseAccount"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["transaction","isAdjustment"]]],null,10],["block",["if"],[["get",["transaction","isFulfillment"]]],null,6],["block",["if"],[["get",["transaction","isTransfer"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["transaction"]},{"statements":[["block",["each"],[["get",["transactions"]]],null,11]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.transactions"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.dateCompleted"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.transaction"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.expense"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.details"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveTransactions"]]],null,12,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary neutral"],["modifier",["action"],[["get",[null]],"showAdjustment",["get",["location"]]]],["flush-element"],["append",["helper",["t"],["inventory.labels.adjust"],null],false],["close-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary neutral"],["modifier",["action"],[["get",[null]],"showTransfer",["get",["location"]]]],["flush-element"],["append",["helper",["t"],["inventory.labels.transfer"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["location","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["location","aisleLocation"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["location","quantity"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canAdjustLocation"]]],null,14],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["location","quantity"]]],null,15]],"locals":["location"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.locations"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.aisleLocation"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canAdjustLocation"]]],null,17],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","locations"]]],null,16],["text"," "],["close-element"],["text","\\n"],["block",["if"],[["get",["showTransactions"]]],null,13]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["inventory.labels.giftInKindNo"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["inventory.labels.giftInKindYes"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["dynamic-attr","class",["helper",["if"],[["get",["purchase","expired"]],"warning"],null],null],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["purchase","dateReceived"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","purchaseCost"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","costPerUnit"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","originalQuantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","currentQuantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["purchase","giftInKind"]]],null,20,19],["text"," "],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","lotNumber"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["purchase","expirationDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","vendor"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","invoiceNo"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["purchase"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPurchase",["get",["model"]]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.titles.addPurchase"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger alert-dismissible"],["static-attr","role","alert"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","close"],["static-attr","data-dismiss","alert"],["flush-element"],["open-element","span",[]],["static-attr","aria-hidden","true"],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["open-element","span",[]],["static-attr","class","sr-only"],["flush-element"],["append",["helper",["t"],["buttons.close"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["inventory.messages.quantity"],[["quantity","locationQuantity"],[["get",["model","quantity"]],["get",["locationQuantityTotal"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["inventory.messages.adjust"],[["difference"],[["get",["quantityDifferential"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["quantityDiscrepency"]]],null,23],["text"," "],["open-element","h3",[]],["flush-element"],["text","\\n "],["append",["helper",["t"],["inventory.labels.purchases"],null],false],["text","\\n"],["block",["if"],[["get",["canAddPurchase"]]],null,22],["text"," "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.dateReceived"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.purchaseCost"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.costPerUnit"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.originalQuantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.currentQuantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.gift"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.serialNumber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.expirationDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.vendor"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.invoiceNumber"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","purchases"]]],null,21],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.purchaseInfo"],null],false],["close-element"],["text","\\n "],["partial","inv-purchase"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["partial","inventory-basic"],["text","\\n"],["block",["if"],[["get",["model","isNew"]]],null,25,24],["block",["unless"],[["get",["model","isNew"]]],null,18]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],26]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/inventory/edit/template.hbs"}})}),define("hospitalrun/inventory/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],canAdd:function(){return this.currentUserCan("add_inventory_request")}.property(),canFulfill:function(){return this.currentUserCan("fulfill_inventory")}.property()})}),define("hospitalrun/inventory/index/route",["exports","hospitalrun/routes/abstract-index-route","hospitalrun/mixins/user-session","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{modelName:"inv-request",newButtonAction:function(){return this.currentUserCan("add_inventory_request")?"newRequest":null}.property(),newButtonText:(0,a.translationMacro)("buttons.newRequestPlus"),pageTitle:(0,a.translationMacro)("navigation.subnav.requests"),_getStartKeyFromItem:function(e){var t=this._getPouchIdFromItem(e);return["Requested",null,t]},_modelQueryParams:function(){var e=this.get("maxValue");return{options:{startkey:["Requested",null,null],endkey:["Requested",e,e]},mapReduce:"inventory_request_by_status"}},actions:{fulfill:function(e){e.set("dateCompleted",new Date),this.transitionTo("inventory.request",e)}}})}),define("hospitalrun/inventory/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"kh9OXcNN",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newRequest"]],["flush-element"],["text"," "],["append",["helper",["t"],["inventory.messages.createRequest"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["inventory.messages.noRequests"],null],false],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"fulfill",["get",["request"]]]],["flush-element"],["append",["helper",["t"],["labels.fulfill"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["request","inventoryItem","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["request","quantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["request","dateRequested"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["request","requestedBy"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canFulfill"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":["request"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedOn"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canFulfill"]]],null,4],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,3],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,5,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/index/template.hbs"}})}),define("hospitalrun/inventory/listing/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{canAddItem:function(){return this.currentUserCan("add_inventory_item")}.property(),canAddPurchase:function(){return this.currentUserCan("add_inventory_purchase")}.property(),canDeleteItem:function(){return this.currentUserCan("delete_inventory_item")}.property(),startKey:[]})}),define("hospitalrun/inventory/listing/route",["exports","hospitalrun/routes/abstract-index-route","hospitalrun/mixins/user-session","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{modelName:"inventory",newButtonAction:function(){return this.currentUserCan("add_inventory_item")?"newItem":null}.property(),newButtonText:(0,a.translationMacro)("buttons.newItem"),pageTitle:(0,a.translationMacro)("inventory.labels.items"),_modelQueryParams:function(){return{mapReduce:"inventory_by_name"}},_getStartKeyFromItem:function(e){var t=this._getPouchIdFromItem(e);return[e.get("name"),t]}})}),define("hospitalrun/inventory/listing/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"lA3sUJLz",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],14]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["messages.createNewRecord"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAddItem"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["buttons.barcode"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["inventory"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editItem",["get",["inventory"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"showAddPurchase",["get",["inventory"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["buttons.add"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["inventory"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","friendlyId"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","inventoryType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","quantity"]],false],["text"," "],["append",["unknown",["inventory","distributionUnit"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","displayLocations"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","crossReference"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddPurchase"]]],null,5],["block",["if"],[["get",["canAddItem"]]],null,4],["block",["if"],[["get",["canDeleteItem"]]],null,3],["text"," "],["block",["link-to"],["inventory.barcode",["get",["inventory"]]],[["class","bubbles"],["btn btn-default neutral",false]],2],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["inventory","isNew"]]],null,6]],"locals":["inventory"]},{"statements":[["append",["helper",["t"],["inventory.labels.xref"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.quantity"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.type"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.name"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.id"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["friendlyId",["get",["sortDesc"]],["get",["sortKey"]]]],12],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["name",["get",["sortDesc"]],["get",["sortKey"]]]],11],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["inventoryType",["get",["sortDesc"]],["get",["sortKey"]]]],10],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["quantity",["get",["sortDesc"]],["get",["sortKey"]]]],9],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.location"],null],false],["close-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["crossReference",["get",["sortDesc"]],["get",["sortKey"]]]],8],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,7],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,13,1]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/inventory/listing/template.hbs"}})}),define("hospitalrun/inventory/purchase/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/unit-types"],function(e,t,n,a){e.default=t.default.extend(a.default,{inventoryController:n.default.inject.controller("inventory"),cancelAction:"closeModal",canEditQuantity:function(){var e=this.get("model.originalQuantity"),t=this.get("model.currentQuantity");return!(t-1)return e.name.split(":")[1]})},_addLocationColumn:function(e){var t=this;if(!n.default.isEmpty(e)){var a=function(){var n=[];return e.forEach(function(e){var t=void 0;t=0===e.name.indexOf("From:")?e.name:this._getWarehouseLocationName(e.name),n.includes(t)||n.push(t)}.bind(t)),{v:n}}();if("object"==typeof a)return a.v}},_addReportRow:function(e,t,a,l){!n.default.isEmpty(l)||n.default.isEmpty(e.inventoryItem)||n.default.isEmpty(e.inventoryItem.id)||(l={action:"viewInventory",model:e.inventoryItem.id}),this._super(e,t,a,l)},_addTotalsRow:function(e,t,n){n>0&&this._addReportRow({totalCost:e+this._numberFormat(t),quantity:e+this._numberFormat(n),unitCost:e+this._numberFormat(t/n)},!0)},_adjustLocation:function(e,t,a,l){var s=e.findBy("name",t);n.default.isEmpty(s)&&(s={name:t,quantity:0},e.push(s)),l?s.quantity+=a:s.quantity-=a},_adjustPurchase:function(e,t,a,l){var s=e.findBy("id",t);if(!n.default.isEmpty(s)){var i=s.calculatedQuantity;l?i+=a:i-=a,s.calculatedQuantity=i}},_calculateCosts:function(e,t){return n.default.isEmpty(e)||e.forEach(function(e){var n=this._calculateCostPerUnit(e),a=e.calculatedQuantity;t.quantity+=e.calculatedQuantity,t.totalCost+=a*n}.bind(this)),0===t.totalCost||0===t.quantity?t.unitCost=0:t.unitCost=t.totalCost/t.quantity,t},_calculateUsage:function(e,t){return n.default.isEmpty(e)||e.forEach(function(e){var n=this._calculateCostPerUnit(e),a=e.calculatedQuantity;t.quantity-=e.calculatedQuantity,t.totalCost-=a*n}.bind(this)),0===t.totalCost||0===t.quantity?t.unitCost=0:t.unitCost=t.totalCost/t.quantity,t},_calculateCostPerUnit:function(e){var t=e.purchaseCost,a=parseInt(e.originalQuantity);return n.default.isEmpty(t)||n.default.isEmpty(a)?0:Number((t/a).toFixed(2))},_findInventoryItems:function(e,t,a,l){n.default.isEmpty(a)&&(a={});var s=this.get("database");return new n.default.RSVP.Promise(function(i,o){s.queryMainDB(e,t).then(function(e){var t=Object.keys(a),r=[];n.default.isEmpty(e.rows)||e.rows.forEach(function(e){e.doc.inventoryItem&&!t.includes(e.doc.inventoryItem)&&(r.push(s.getPouchId(e.doc.inventoryItem,"inventory")),t.push(e.doc.inventoryItem))}),this._getInventoryItems(r,a).then(function(t){e.rows.forEach(function(e){var a=t[e.doc.inventoryItem];if(!n.default.isEmpty(a)&&("purchaseObjects"!==l||a.purchases.includes(e.doc.id))){var s=a[l];n.default.isEmpty(s)&&(s=[]),s.push(e.doc),a[l]=s}}),i(t)},o)}.bind(this),o)}.bind(this))},_findInventoryItemsByPurchase:function(e,t){return this._findInventoryItems({startkey:[e.startTime,"invPurchase_"],endkey:[e.endTime,"invPurchase_￿"],include_docs:!0},"inventory_purchase_by_date_received",t,"purchaseObjects")},_findInventoryItemsByRequest:function(e,t){return this._findInventoryItems({startkey:["Completed",e.startTime,"invRequest_"],endkey:["Completed",e.endTime,"invRequest_￿"],include_docs:!0},"inventory_request_by_status",t,"requestObjects")},_finishExpenseReport:function(e){var t=this.get("expenseCategories"),a=this.get("expenseMap"),l=this.get("i18n");t.forEach(function(t){var s=0,i=void 0,o=void 0;this._addReportRow({inventoryItem:{name:l.t("inventory.reports.rows.expensesFor")+t}}),a[t].expenseAccounts.forEach(function(a){"detailedExpense"===e&&a.reportRows.forEach(function(e){this._addReportRow(e)}.bind(this)),i=n.default.isEmpty(a.name)?l.t("inventory.reports.rows.noAccount"):a.name,o=l.t("inventory.reports.rows.subtotalFor",{category:t,account:i}),this._addReportRow({totalCost:o+this._numberFormat(a.total)},!0),s+=a.total}.bind(this)),o=l.t("inventory.reports.rows.totalFor",{var:t}),this._addReportRow({totalCost:o+this._numberFormat(s)},!0),this.incrementProperty("grandCost",s)}.bind(this)),this._addReportRow({totalCost:l.t("inventory.reports.rows.total")+this._numberFormat(this.get("grandCost"))},!0)},_finishLocationReport:function(){var e="",t=0,n=this.get("locationSummary"),a="",l=0,s=this.get("i18n");n=n.sortBy("name"),n.forEach(function(n){a=this._getWarehouseLocationName(n.name);var i=s.t("inventory.reports.rows.totalFor",{var:e});if(e!==a&&(this._addTotalsRow(i,t,l),l=0,t=0,e=a),this._includeLocation(a))for(var o in n.items)n.items[o].quantity>0&&(this._addReportRow({giftInKind:n.items[o].giftInKind,inventoryItem:n.items[o].item,quantity:n.items[o].quantity,locations:[{name:n.name}],totalCost:n.items[o].totalCost,unitCost:n.items[o].unitCost}),l+=this._getValidNumber(n.items[o].quantity),t+=this._getValidNumber(n.items[o].totalCost),this.incrementProperty("grandCost",this._getValidNumber(n.items[o].totalCost)),this.incrementProperty("grandQuantity",this._getValidNumber(n.items[o].quantity)))}.bind(this)),l>0&&this._addTotalsRow(s.t("inventory.reports.rows.totalFor",{var:a}),t,l)},_generateExpirationReport:function(){var e=0,t=this.get("database"),a=this.get("reportRows"),l=this._getDateQueryParams();t.queryMainDB({startkey:[l.startTime,"invPurchase_"],endkey:[l.endTime,"invPurchase_￿"],include_docs:!0},"inventory_purchase_by_expiration_date").then(function(l){var s=[],i=[];l.rows.forEach(function(e){e.doc.currentQuantity>0&&!n.default.isEmpty(e.doc.expirationDate)&&(s.push(e.doc),i.push(t.getPouchId(e.doc.inventoryItem,"inventory")))}.bind(this)),this._getInventoryItems(i).then(function(t){var n=this.get("i18n");s.forEach(function(n){var l=n.currentQuantity,s=new Date(n.expirationDate),i=t[n.inventoryItem];i&&this._includeLocation(n.location)&&(a.addObject([i.friendlyId,i.name,l,i.distributionUnit,moment(s).format("l"),this.formatLocationName(n.location,n.aisleLocation)]),e+=l)}.bind(this)),a.addObject(["","",n.t("inventory.reports.rows.total")+e,"",""]),this.set("showReportResults",!0),this.set("reportHeaders",[n.t("labels.id"),n.t("labels.name"),n.t("inventory.labels.currentQuantity"),n.t("inventory.labels.distributionUnit"),n.t("inventory.labels.expirationDate"),n.t("inventory.labels.location")]),this._generateExport(),this._setReportTitle(),this.closeProgressModal()}.bind(this))}.bind(this))},_generateFinancialSummaryReport:function(){var e=this._getDateQueryParams();this._calculateBeginningBalance(e).then(function(t){this._generateSummaries(e).then(function(e){var n=this._numberFormat(t+e),a=this.get("i18n");t+e<0?this.get("reportRows").addObject([a.t("inventory.reports.rows.balanceEnd"),"","("+n+")"]):this.get("reportRows").addObject([a.t("inventory.reports.rows.balanceEnd"),"",n]),this.set("showReportResults",!0),this.set("reportHeaders",[a.t("inventory.reports.rows.category"),a.t("labels.type"),a.t("inventory.labels.total")]),this._generateExport(),this._setReportTitle(),this.closeProgressModal()}.bind(this),function(e){this._notifyReportError(this.get("i18n").t("inventory.reports.rows.errInFinSum")+e)}.bind(this))}.bind(this))},_generateSummaries:function(e){return new n.default.RSVP.Promise(function(t,a){var l=0,s=this.get("i18n");this._findInventoryItemsByRequest(e,{}).then(function(i){this._findInventoryItemsByPurchase(e,i).then(function(e){var a={},i={},o={},r={};if(this.adjustmentTypes.forEach(function(e){r[e.type]=[]}),Object.keys(e).forEach(function(t){if(!n.default.isEmpty(t)&&!n.default.isEmpty(e[t])){var l=e[t];n.default.isEmpty(l.purchaseObjects)||l.purchaseObjects.forEach(function(e){a[l.inventoryType]=this._getValidNumber(a[l.inventoryType])+this._getValidNumber(e.purchaseCost)}.bind(this)),n.default.isEmpty(l.requestObjects)||l.requestObjects.forEach(function(e){e.adjustPurchases&&("Fulfillment"===e.transactionType?e.giftInKind?o[l.inventoryType]=this._getValidNumber(o[l.inventoryType])+this._getValidNumber(e.quantity*e.costPerUnit):i[l.inventoryType]=this._getValidNumber(i[l.inventoryType])+this._getValidNumber(e.quantity*e.costPerUnit):r[e.transactionType][l.inventoryType]=this._getValidNumber(r[e.transactionType][l.inventoryType])+this._getValidNumber(e.quantity*e.costPerUnit))}.bind(this))}}.bind(this)),Object.keys(a).length>0){var d=0;this.get("reportRows").addObject([s.t("inventory.labels.purchases"),"",""]),Object.keys(a).forEach(function(e){var t=this._getValidNumber(a[e]);d+=t,this.get("reportRows").addObject(["",e,this._numberFormat(t)])}.bind(this)),this.get("reportRows").addObject([s.t("inventory.reports.rows.totalPurchases"),"",this._numberFormat(d)]),l+=d}if(Object.keys(i).length>0||Object.keys(o).length>0){this.get("reportRows").addObject([s.t("inventory.reports.rows.consumed"),"",""]);var c=0;if(Object.keys(i).length>0){this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedPuchases"),"",""]);var u=0;Object.keys(i).forEach(function(e){var t=this._getValidNumber(i[e]);u+=t,this.get("reportRows").addObject(["",e,"("+this._numberFormat(t)+")"])}.bind(this)),c+=u,this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedPurchasesTotal"),"","("+this._numberFormat(u)+")"])}if(Object.keys(o).length>0){this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedGik"),"",""]);var p=0;Object.keys(o).forEach(function(e){var t=this._getValidNumber(o[e]);p+=t,this.get("reportRows").addObject(["",e,"("+this._numberFormat(t)+")"])}.bind(this)),c+=p,this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedGikTotal"),"","("+this._numberFormat(p)+")"])}this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedTotal"),"","("+this._numberFormat(c)+")"]),l-=c}var m=0;this.get("reportRows").addObject([s.t("inventory.reports.rows.adjustments"),"",""]),Object.keys(r).forEach(function(e){Object.keys(r[e]).length>0&&(this.get("reportRows").addObject([e,"",""]),Object.keys(r[e]).forEach(function(t){var n=this._getValidNumber(r[e][t]);"Adjustment (Add)"===e||"Return"===e?(m+=n,this.get("reportRows").addObject(["",t,this._numberFormat(n)])):(m-=n,this.get("reportRows").addObject(["",t,"("+this._numberFormat(n)+")"]))}.bind(this)))}.bind(this)),m<0?this.get("reportRows").addObject([s.t("inventory.reports.rows.adjustmentsTotal"),"","("+this._numberFormat(m)+")"]):this.get("reportRows").addObject([s.t("inventory.reports.rows.adjustmentsTotal"),"",this._numberFormat(m)]),l+=m,t(l)}.bind(this),a)}.bind(this),a)}.bind(this))},_calculateBeginningBalance:function(e){return new n.default.RSVP.Promise(function(t,a){var l={startTime:null,endTime:e.startTime},s=0,i=this.get("i18n");this._findInventoryItemsByRequest(l,{}).then(function(e){this._findInventoryItemsByPurchase(l,e).then(function(e){Object.keys(e).forEach(function(t){if(!n.default.isEmpty(t)&&!n.default.isEmpty(e[t])){var a=e[t],l=a.purchaseObjects,i=a.requestObjects,o={inventoryItem:a,quantity:0,unitCost:0,totalCost:0};n.default.isEmpty(l)||l.forEach(function(e){var t=e.originalQuantity;e.calculatedQuantity=t}),n.default.isEmpty(i)||i.forEach(function(e){var t=e.adjustPurchases,a=!1,s=e.purchasesAffected,i=e.transactionType;a="Adjustment (Add)"===i||"Return"===i,t&&(n.default.isEmpty(s)||n.default.isEmpty(l)||s.forEach(function(e){this._adjustPurchase(l,e.id,e.quantity,a)}.bind(this)))}.bind(this)),n.default.isEmpty(l)||(o=this._calculateCosts(l,o),s+=this._getValidNumber(o.totalCost))}}.bind(this)),s<0?this.get("reportRows").addObject([i.t("inventory.reports.rows.balanceBegin"),"","("+this._numberFormat(s)+")"]):this.get("reportRows").addObject([i.t("inventory.reports.rows.balanceBegin"),"",this._numberFormat(s)]),t(s)}.bind(this),a)}.bind(this),a)}.bind(this))},_generateInventoryReport:function(){this.set("grandCost",0),this.set("grandQuantity",0),this.set("locationSummary",[]);var e=void 0,t=this.get("locationSummary"),a=this.get("reportType"),l=this._getDateQueryParams(),s=this.get("i18n");if("daysLeft"===a){var i=this.get("endDate"),o=this.get("startDate");if(n.default.isEmpty(i)||n.default.isEmpty(o))return void this.closeProgressModal();e=moment(i).diff(o,"days")}this._findInventoryItemsByRequest(l,{}).then(function(i){this._findInventoryItemsByPurchase(l,i).then(function(l){switch(Object.keys(l).forEach(function(i){if(!n.default.isEmpty(l[i])){var o=l[i],r=o.purchaseObjects,d=o.requestObjects,c={giftInKind:"N",inventoryItem:o,quantity:0,unitCost:0,totalCost:0,locations:[],vendors:[]};n.default.isEmpty(r)||r.forEach(function(e){var t=this.getDisplayLocationName(e.location,e.aisleLocation),a=e.originalQuantity;e.calculatedQuantity=a,e.giftInKind===!0&&(c.giftInKind="Y"),n.default.isEmpty(e.vendor)||c.vendors.includes(e.vendor)||c.vendors.push(e.vendor),this._adjustLocation(c.locations,t,a,!0)}.bind(this)),n.default.isEmpty(d)||d.forEach(function(e){var t=e.adjustPurchases,a=e.transactionType,l=!1,s=e.locationsAffected,i=e.purchasesAffected;if(l="Adjustment (Add)"===a||"Return"===a,t)n.default.isEmpty(i)||n.default.isEmpty(r)||i.forEach(function(e){this._adjustPurchase(r,e.id,e.quantity,l)}.bind(this));else if("Transfer"===a){var o=this.getDisplayLocationName(e.deliveryLocation,e.deliveryAisle);this._adjustLocation(c.locations,o,e.quantity,!0)}s.forEach(function(e){this._adjustLocation(c.locations,e.name,e.quantity,l)}.bind(this))}.bind(this));var u=0,p=0;switch(a){case"byLocation":c.locations.forEach(function(e){var a=t.findBy("name",this._getWarehouseLocationName(e.name));n.default.isEmpty(a)?(a=n.default.copy(e),a.items={},t.push(a)):a.quantity+=this._getValidNumber(e.quantity);var l=this._calculateCosts(r,{quantity:0,totalCost:0});a.items[o.id]={item:o,quantity:this._getValidNumber(e.quantity),giftInKind:c.giftInKind,totalCost:this._getValidNumber(l.unitCost)*this._getValidNumber(e.quantity),unitCost:this._getValidNumber(l.unitCost)}}.bind(this));break;case"daysLeft":if(!n.default.isEmpty(d)&&this._hasIncludedLocation(c.locations)){var m=d.reduce(function(e,t){return"Fulfillment"===t.transactionType?e+=this._getValidNumber(t.quantity):e}.bind(this),0);c.quantity=this._getValidNumber(o.quantity),m>0?(c.consumedPerDay=this._numberFormat(m/e,!0),c.daysLeft=this._numberFormat(c.quantity/c.consumedPerDay)):(0===m?c.consumedPerDay="0":c.consumedPerDay="?"+m,c.daysLeft="?"),this._addReportRow(c)}break;case"detailedAdjustment":case"detailedTransfer":case"detailedUsage":case"detailedExpense":case"summaryExpense":n.default.isEmpty(d)||(d.forEach(function(e){var t=this;this._includeTransaction(a,e.transactionType)&&this._hasIncludedLocation(e.locationsAffected)&&!function(){var n=t.getDisplayLocationName(e.deliveryLocation,e.deliveryAisle),l=[],i=t._getValidNumber(e.quantity),o=t._getValidNumber(e.quantity)*t._getValidNumber(e.costPerUnit);l=e.locationsAffected.map(function(e){return"detailedTransfer"===a?{name:s.t("inventory.reports.rows.transfer2",{source:e.name,target:n}).toString()}:{name:s.t("inventory.reports.rows.transfer1",{quantity:i,location:e.name}).toString()}}.bind(t));var r={date:moment(new Date(e.dateCompleted)).format("l"),expenseAccount:e.expenseAccount,giftInKind:c.giftInKind,inventoryItem:c.inventoryItem,quantity:e.quantity,transactionType:e.transactionType,locations:l,unitCost:e.costPerUnit,totalCost:o};"detailedExpense"===a||"summaryExpense"===a?t._updateExpenseMap(e,r):(t._addReportRow(r),p+=t._getValidNumber(e.quantity),u+=t._getValidNumber(o))}()}.bind(this)),"detailedExpense"!==a&&"summaryExpense"!==a&&(this._addTotalsRow(s.t("inventory.reports.rows.subtotal"),u,p),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",p)));break;case"summaryTransfer":case"summaryUsage":!n.default.isEmpty(d)&&this._hasIncludedLocation(c.locations)&&(c.quantity=d.reduce(function(e,t){if(this._includeTransaction(a,t.transactionType)){var n=this._getValidNumber(t.quantity)*this._getValidNumber(t.costPerUnit);return u+=n,e+=this._getValidNumber(t.quantity)}return e}.bind(this),0),c.quantity>0&&(c.totalCost=u,c.unitCost=u/c.quantity,this._addReportRow(c),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",c.quantity)));break;case"detailedPurchase":n.default.isEmpty(r)||(r.forEach(function(e){if(this._includeLocation(e.location)){var t="N";e.giftInKind===!0&&(t="Y"),this._addReportRow({date:moment(new Date(e.dateReceived)).format("l"),giftInKind:t,inventoryItem:c.inventoryItem,quantity:e.originalQuantity,unitCost:e.costPerUnit,totalCost:e.purchaseCost,locations:[{name:this.getDisplayLocationName(e.location,e.aisleLocation)}]}),u+=this._getValidNumber(e.purchaseCost),p+=this._getValidNumber(e.originalQuantity)}}.bind(this)),this._addTotalsRow(s.t("inventory.reports.rows.subtotal"),u,p),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",p));break;case"summaryPurchase":n.default.isEmpty(r)||(c.locations=[],c.quantity=r.reduce(function(e,t){u+=this._getValidNumber(t.purchaseCost);var n=this.getDisplayLocationName(t.location,t.aisleLocation);return c.locations.findBy("name",n)||c.locations.push({name:this.getDisplayLocationName(t.location,t.aisleLocation)}),e+=this._getValidNumber(t.originalQuantity)}.bind(this),0),this._hasIncludedLocation(c.locations)&&(c.unitCost=u/c.quantity,c.totalCost=u,this._addReportRow(c),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",c.quantity)));break;case"valuation":!n.default.isEmpty(r)&&this._hasIncludedLocation(c.locations)&&(this._calculateCosts(r,c),this.incrementProperty("grandCost",this._getValidNumber(c.totalCost)),this.incrementProperty("grandQuantity",this._getValidNumber(c.quantity)),this._addReportRow(c))}}}.bind(this)),a){case"detailedExpense":case"summaryExpense":this._finishExpenseReport(a);break;case"byLocation":this._finishLocationReport(),this._addTotalsRow(s.t("inventory.reports.rows.total"),this.get("grandCost"),this.get("grandQuantity"));break;default:this._addTotalsRow(s.t("inventory.reports.rows.total"),this.get("grandCost"),this.get("grandQuantity"))}this._finishReport()}.bind(this),function(e){this._notifyReportError(s.t("inventory.reports.rows.errInFindPur")+e)}.bind(this))}.bind(this),function(e){this._notifyReportError(s.t("inventory.reports.rows.errInFindPur")+e)}.bind(this))},_getDateQueryParams:function(){var e=this.get("endDate"),t=this.get("maxValue"),a=this.get("startDate"),l=void 0;return n.default.isEmpty(e)||(t=moment(e).endOf("day").toDate().getTime()),n.default.isEmpty(a)||(l=moment(a).startOf("day").toDate().getTime()),{endTime:t,startTime:l}},_getInventoryItems:function(e,t){var a=this.get("database");return new n.default.RSVP.Promise(function(l,s){n.default.isEmpty(t)&&(t={}),a.queryMainDB({keys:e,include_docs:!0}).then(function(e){e.rows.forEach(function(e){e.doc&&e.doc.archived!==!0&&(t[e.doc.id]=e.doc)}),l(t)},s)})},_getWarehouseLocationName:function(e){var t="";return t=e.indexOf(":")>-1?e.split(":")[0].trim():e},_hasIncludedLocation:function(e){var t=!1;return e.forEach(function(e){var n=this._getWarehouseLocationName(e.name);this._includeLocation(n)&&(t=!0)}.bind(this)),t},_includeLocation:function(e){var t=this.get("filterLocation");return n.default.isEmpty(t)||e===t},_includeTransaction:function(e,t){var n=0===e.indexOf("detailed"),a=void 0;if("detailedExpense"===e||"summaryExpense"===e)return!0;switch(t){case"Fulfillment":a=n?"detailedUsage":"summaryUsage";break;case"Transfer":a=n?"detailedTransfer":"summaryTransfer";break;default:a=n?"detailedAdjustment":"summaryAdjustment"}return e===a},_updateExpenseMap:function(e,t){var a=void 0,l=this.get("expenseMap"),s="Y"===t.giftInKind,i=!0;switch(e.transactionType){case"Fulfillment":case"Return":a=s?l["Gift In Kind Usage"]:l["Inventory Consumed"],"Return"===e.transactionType&&(i=!1);break;case"Adjustment (Add)":case"Adjustment (Remove)":case"Return To Vendor":case"Write Off":a=l["Inventory Obsolence"],"Adjustment (Add)"===e.transactionType&&(i=!1)}if(!n.default.isEmpty(a)){var o=a.expenseAccounts.findBy("name",e.expenseAccount);n.default.isEmpty(o)&&(o={name:e.expenseAccount,total:0,reportRows:[]},a.expenseAccounts.push(o)),o.reportRows.push(t);var r=this._getValidNumber(e.quantity)*this._getValidNumber(e.costPerUnit);i?(a.total+=r,o.total+=r):(a.total=a.total-r,o.total=o.total-r,t.totalCost=t.totalCost*-1)}},actions:{generateReport:function(){var e=this,t=this.get("endDate"),a=this.get("reportRows"),l=this.get("reportType"),s=this.get("startDate");if(!n.default.isEmpty(s)||!n.default.isEmpty(t))switch(a.clear(),this.showProgressModal(),l){case"expiration":this._generateExpirationReport();break;case"summaryFinance":this._generateFinancialSummaryReport();break;case"detailedExpense":case"summaryExpense":var i=function(){var t=e.get("expenseCategories"),n={};return t.forEach(function(e){n[e]={total:0,expenseAccounts:[]}}),e.set("expenseMap",n),e._generateInventoryReport(),"break"}();if("break"===i)break;default:this._generateInventoryReport()}},viewInventory:function(e){this.store.find("inventory",e).then(function(e){e.set("returnTo","inventory.reports"),this.transitionToRoute("inventory.edit",e)}.bind(this))}}})}),define("hospitalrun/inventory/reports/route",["exports","hospitalrun/routes/abstract-index-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({pageTitle:(0,a.translationMacro)("inventory.titles.inventoryReport"),model:function(){return n.default.RSVP.resolve(n.default.Object.create({}))}})}),define("hospitalrun/inventory/reports/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"g8+aEF0m",block:'{"statements":[["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],11],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"generateReport"]],["flush-element"],["append",["helper",["t"],["inventory.reports.generate"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["close-element"],["text","\\n"],["block",["if"],[["get",["showReportResults"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["text","\\n "],["append",["get",["reportHeader"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["reportHeader"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["unknown",["reportTitle"]],false],["append",["helper",["nav-paging"],null,[["paginationProps"],[["get",["paginationProps"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n"],["block",["each"],[["get",["reportHeaders"]]],null,0],["text"," "],["close-element"],["text","\\n "],["partial","report-rows"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n "],["open-element","a",[]],["dynamic-attr","href",["unknown",["csvExport"]],null],["static-attr","target","_blank"],["dynamic-attr","download",["concat",[["unknown",["reportTitle"]],".csv"]]],["static-attr","class","btn btn-default"],["flush-element"],["append",["helper",["t"],["inventory.reports.export"],null],false],["close-element"],["text","\\n\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","transactionType","label"]],"reportColumns.transactionType.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","expenseAccount","label"]],"reportColumns.expenseAccount.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","consumedPerDay","label"]],"reportColumns.consumedPerDay.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","daysLeft","label"]],"reportColumns.daysLeft.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","total","label"]],"reportColumns.total.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","unitcost","label"]],"reportColumns.unitcost.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","date","label"]],"reportColumns.date.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.reports.fields"],null],false],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n"],["block",["if"],[["get",["includeDate"]]],null,6],["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","id","label"]],"reportColumns.id.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","name","label"]],"reportColumns.name.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","description","label"]],"reportColumns.description.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","type","label"]],"reportColumns.type.include","col-xs-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","quantity","label"]],"reportColumns.quantity.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","unit","label"]],"reportColumns.unit.include","col-xs-2"]]],false],["text","\\n"],["block",["if"],[["get",["includeCostFields"]]],null,5],["block",["if"],[["get",["includeDaysLeft"]]],null,4],["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","price","label"]],"reportColumns.price.include","col-xs-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","reorder","label"]],"reportColumns.reorder.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","gift","label"]],"reportColumns.gift.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","locations","label"]],"reportColumns.locations.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","aisle","label"]],"reportColumns.aisle.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","xref","label"]],"reportColumns.xref.include","col-xs-2"]]],false],["text","\\n\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","vendor","label"]],"reportColumns.vendor.include","col-xs-2"]]],false],["text","\\n"],["block",["if"],[["get",["includeExpenseAccount"]]],null,3],["block",["if"],[["get",["includeTransactionType"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-picker"],null,[["property","label","class"],["startDate",["helper",["t"],["inventory.labels.dateStart"],null],"col-sm-4 test-start-date"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["endDate",["helper",["t"],["inventory.labels.dateEnd"],null],"col-sm-4 test-end-date"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-picker"],null,[["property","label","class"],["endDate",["helper",["t"],["inventory.labels.dateEffective"],null],"col-sm-4"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-select"],null,[["class","label","property","content","prompt"],["col-xs-6",["helper",["t"],["inventory.labels.location"],null],"filterLocation",["get",["warehouseList"]]," "]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-6"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["static-attr","for","report-type"],["flush-element"],["append",["helper",["t"],["inventory.reports.reportType"],null],false],["close-element"],["text","\\n "],["append",["helper",["select-list"],null,[["action","class","content","id","optionValuePath","optionLabelPath","value"],[["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["reportType"]]],null]],null],"form-control",["get",["reportTypes"]],"report-type","value","name",["get",["reportType"]]]]],false],["text","\\n "],["close-element"],["text","\\n"],["block",["unless"],[["get",["hideLocationFilter"]]],null,10],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["if"],[["get",["showEffectiveDate"]]],null,9,8],["text"," "],["close-element"],["text","\\n"],["block",["if"],[["get",["useFieldPicker"]]],null,7],["text","\\n"]],"locals":[]}],"hasPartials":true}', +meta:{moduleName:"hospitalrun/inventory/reports/template.hbs"}})}),define("hospitalrun/inventory/request/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","ember"],function(e,t,n,a,l){e.default=t.default.extend(n.default,a.default,{inventoryController:l.default.inject.controller("inventory"),inventoryItems:null,cancelAction:"allRequests",warehouseList:l.default.computed.alias("inventoryController.warehouseList"),aisleLocationList:l.default.computed.alias("inventoryController.aisleLocationList"),expenseAccountList:l.default.computed.alias("inventoryController.expenseAccountList"),inventoryList:function(){var e=this.get("inventoryItems");if(!l.default.isEmpty(e)){var t=e.map(function(e){return e.doc});return t}}.property("inventoryItems.[]"),lookupListsToUpdate:[{name:"expenseAccountList",property:"model.expenseAccount",id:"expense_account_list"},{name:"aisleLocationList",property:"model.deliveryAisle",id:"aisle_location_list"},{name:"warehouseList",property:"model.deliveryLocation",id:"warehouse_list"}],canFulfill:function(){var e=this.get("model.requestedItems");return l.default.isEmpty(e)&&this.currentUserCan("fulfill_inventory")}.property("model.requestedItems.[]"),isFulfilling:function(){var e=this.get("canFulfill"),t=this.get("isRequested"),n=this.get("model.shouldFulfillRequest"),a=e&&(t||n);return a?l.default.isEmpty(this.get("model.dateCompleted"))&&this.set("model.dateCompleted",new Date):this.set("model.dateCompleted"),a}.property("isRequested","model.shouldFulfillRequest"),isRequested:function(){var e=this.get("model.status");return"Requested"===e}.property("model.status"),quantityLabel:function(){var e=this.get("selectedInventoryItem");return l.default.isEmpty(e)?this.get("i18n").t("labels.quantity").toString():this.get("i18n").t("inventory.labels.quantity",{unit:e.distributionUnit}).toString()}.property("selectedInventoryItem"),showRequestedItems:function(){var e=this.get("model.requestedItems");return!l.default.isEmpty(e)}.property("model.requestedItems.[]"),updateViaFulfillRequest:!1,updateButtonText:function(){return this.get("isFulfilling")?this.get("i18n").t("buttons.fulfill"):this._super()}.property("model.isNew","isFulfilling"),updateCapability:"add_inventory_request",actions:{addInventoryItem:function(){var e=this.get("model"),t=e.get("inventoryItem"),n=e.get("requestedItems"),a=e.get("quantity");e.validate().then(function(){if(e.get("isValid")&&!l.default.isEmpty(t)&&!l.default.isEmpty(a)){var s=l.default.Object.create({item:t.get("content"),quantity:a});n.addObject(s),e.set("inventoryItem"),e.set("inventoryItemTypeAhead"),e.set("quantity"),this.set("selectedInventoryItem")}}.bind(this)).catch(l.default.K)},allRequests:function(){this.transitionToRoute("inventory.index")},removeItem:function(e){var t=this.get("model.requestedItems"),n=e.itemToRemove;t.removeObject(n),this.send("closeModal")},showRemoveItem:function(e){var t=this.get("i18n").t("inventory.messages.removeItemRequest"),n=l.default.Object.create({itemToRemove:e}),a=this.get("i18n").t("inventory.titles.removeItem");this.displayConfirm(a,t,"removeItem",n)},update:function(e){this.beforeUpdate().then(function(){var t=this,n=this.get("updateViaFulfillRequest");if(n)this.updateLookupLists(),this.performFulfillRequest(this.get("model"),!1,!1,!0).then(this.afterUpdate.bind(this));else{var a=this.get("model.isNew"),s=this.get("model.requestedItems");a&&!l.default.isEmpty(s)?!function(){var e=t.get("model"),n=e.getProperties(["dateRequested","deliveryAisle","deliveryLocation","expenseAccount","requestedBy","status"]),a=[],i=[],o=[];l.default.isEmpty(t.get("model.inventoryItem"))||l.default.isEmpty(t.get("model.quantity"))||o.push(e.save()),s.forEach(function(e){n.inventoryItem=e.get("item"),n.quantity=e.get("quantity");var t=this.get("store").createRecord("inv-request",n);a.push(t.get("inventoryItem")),i.push(t)}.bind(t)),l.default.RSVP.all(a,"Get inventory items for inventory requests").then(function(){i.forEach(function(e){o.push(e.save())}),l.default.RSVP.all(o,"Save batch inventory requests").then(function(){this.updateLookupLists(),this.afterUpdate()}.bind(this))}.bind(t))}():this.get("model").save().then(function(t){this.updateLookupLists(),e||this.afterUpdate(t)}.bind(this))}}.bind(this))}},afterUpdate:function(){var e=this.get("updateViaFulfillRequest");e?this.displayAlert(this.get("i18n").t("inventory.titles.requestFulfilled"),this.get("i18n").t("inventory.messages.requestFulfilled"),"allRequests"):this.displayAlert(this.get("i18n").t("inventory.titles.requestUpdated"),this.get("i18n").t("inventory.messages.requestUpdated"))},beforeUpdate:function(){return this.get("isFulfilling")?this.set("updateViaFulfillRequest",!0):this.set("updateViaFulfillRequest",!1),this.get("model.isNew")&&(this.set("model.dateRequested",new Date),this.set("model.requestedBy",this.get("model").getUserName()),this.get("isFulfilling")||this.set("model.status","Requested")),l.default.RSVP.resolve()}})}),define("hospitalrun/inventory/request/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({editTitle:(0,a.translationMacro)("inventory.titles.editRequest"),modelName:"inv-request",newTitle:(0,a.translationMacro)("inventory.titles.addRequest"),database:n.default.inject.service(),getNewData:function(){return n.default.RSVP.resolve({transactionType:"Request",requestedItems:[]})},actions:{allRequests:function(e){this.controller.send("allRequests",e)},removeItem:function(e){this.controller.send("removeItem",e)}},setupController:function(e,t){this._super(e,t);var n={startkey:"inventory_",endkey:"inventory_￿",include_docs:!0};this.get("database").queryMainDB(n).then(function(t){e.set("inventoryItems",t.rows)})}})}),define("hospitalrun/inventory/request/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"qer6XY+A",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],7]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["labels.dateCompleted"],null],"col-sm-4"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["inventory-location-picker"],null,[["label","quantityRequested","locationList","selectedLocations","class"],[["helper",["t"],["inventory.labels.pullFrom"],null],["get",["model","quantity"]],["get",["model","inventoryItem","availableLocations"]],["get",["model","inventoryLocations"]],"inventory-location"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label sr-only"],["flush-element"],["append",["helper",["t"],["inventory.labels.consumePurchases"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["inventory.labels.markAsConsumed"],null],"markAsConsumed"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label sr-only"],["flush-element"],["append",["helper",["t"],["inventory.labels.fulfillRequest"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["inventory.labels.fulfillRequest"],null],"shouldFulfillRequest"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["append",["unknown",["requestedItem","item","name"]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["requestedItem","quantity"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group-addon"],["flush-element"],["append",["unknown",["requestedItem","item","distributionUnit"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showRemoveItem",["get",["requestedItem"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.remove"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["requestedItem"]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.requestedItems"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","requestedItems"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["inventory-typeahead"],null,[["class","property","label","content","selection"],["col-sm-8 test-inv-item","inventoryItemTypeAhead",["helper",["t"],["inventory.labels.inventoryItem"],null],["get",["inventoryList"]],["get",["selectedInventoryItem"]]]]],false],["text","\\n\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["get",["quantityLabel"]],"col-sm-3 test-inv-quantity"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-1"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["close-element"],["text","\\n "],["open-element","h4",[]],["static-attr","class","form-control-static"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-plus"],["modifier",["action"],[["get",[null]],"addInventoryItem"]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["showRequestedItems"]]],null,3],["block",["if"],[["get",["canFulfill"]]],null,1]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.item"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","inventoryItem","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.quantityRequested"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.quantityOnHand"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","inventoryItem","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["isRequested"]]],null,5,4],["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["deliveryLocation",["helper",["t"],["inventory.labels.deliveryLocation"],null],["get",["warehouseList"]],["get",["model","deliveryLocation"]],"test-delivery-location"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["deliveryAisle",["helper",["t"],["inventory.labels.deliveryAisle"],null],["get",["aisleLocationList"]],["get",["model","deliveryAisle"]],"test-delivery-aisle"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["expenseAccount",["helper",["t"],["inventory.labels.billTo"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]],"test-bill-to"]]],false],["text","\\n"],["block",["if"],[["get",["isFulfilling"]]],null,0]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],6]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/request/template.hbs"}})}),define("hospitalrun/inventory/route",["exports","hospitalrun/routes/abstract-module-route","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-id","hospitalrun/mixins/inventory-locations"],function(e,t,n,a,l){e.default=t.default.extend(n.default,a.default,l.default,{addCapability:"add_inventory_item",additionalButtons:function(){if(this.currentUserCan(this.get("addCapability")))return[{buttonAction:"newInventoryBatch",buttonText:"+ inventory received",class:"btn btn-primary"}]}.property(),additionalModels:[{name:"aisleLocationList",findArgs:["lookup","aisle_location_list"]},{name:"expenseAccountList",findArgs:["lookup","expense_account_list"]},{name:"inventoryTypeList",findArgs:["lookup","inventory_types"]},{name:"inventoryUnitList",findArgs:["lookup","unit_types"]},{name:"warehouseList",findArgs:["lookup","warehouse_list"]},{name:"vendorList",findArgs:["lookup","vendor_list"]}],currentItem:null,moduleName:"inventory",newButtonText:"+ new request",sectionTitle:"Inventory",actions:{addPurchase:function(e){var t=this.get("currentItem"),n=t.get("purchases");n.addObject(e),this.newPurchaseAdded(t,e).then(function(){t.updateQuantity(),t.save().then(function(){this.send("closeModal")}.bind(this))}.bind(this))},newInventoryBatch:function(){this.currentUserCan(this.get("addCapability"))&&this.transitionTo("inventory.batch","new")},newRequest:function(){this.transitionTo("inventory.request","new")},allItems:function(){this.transitionTo("inventory.listing")},showAddPurchase:function(e){var t=this.get("store").createRecord("inv-purchase",{dateReceived:new Date,distributionUnit:e.get("distributionUnit"),inventoryItem:e.get("id")});this.set("currentItem",e),this.send("openModal","inventory.purchase.edit",t)}}})}),define("hospitalrun/inventory/search/controller",["exports","hospitalrun/inventory/listing/controller"],function(e,t){e.default=t.default.extend()}),define("hospitalrun/inventory/search/route",["exports","hospitalrun/routes/abstract-search-route"],function(e,t){e.default=t.default.extend({moduleName:"inventory",searchKeys:[{name:"crossReference",type:"contains"},{name:"description",type:"fuzzy"},{name:"friendlyId",type:"contains"},{name:"name",type:"fuzzy"}],searchModel:"inventory"})}),define("hospitalrun/inventory/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"MRgLDxZL",block:'{"statements":[["block",["search-listing"],null,[["newButtonText","allButtonText"],[["helper",["t"],["inventory.labels.newItem"],null],["helper",["t"],["inventory.labels.allInventory"],null]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","inventory/listing"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/inventory/search/template.hbs"}})}),define("hospitalrun/inventory/transfer/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({inventoryController:n.default.inject.controller("inventory"),warehouseList:n.default.computed.alias("inventoryController.warehouseList"),aisleLocationList:n.default.computed.alias("inventoryController.aisleLocationList"),lookupListsToUpdate:[{name:"aisleLocationList",property:"model.transferAisleLocation",id:"aisle_location_list"},{name:"warehouseList",property:"model.transferLocation",id:"warehouse_list"}],title:(0,a.translationMacro)("inventory.titles.transfer"),updateButtonText:(0,a.translationMacro)("inventory.labels.transfer"),updateButtonAction:"transfer",updateCapability:"adjust_inventory_location",actions:{cancel:function(){this.send("closeModal")},transfer:function(){this.updateLookupLists(),this.send("transferItems",this.get("model"),!0)}}})}),define("hospitalrun/inventory/transfer/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"agZXzn11",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.item"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","transferItem","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.transferFrom"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","locationName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.quantityAvailable"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["class","property","label","list","selection"],["required","transferLocation",["helper",["t"],["inventory.labels.transferTo"],null],["get",["warehouseList"]],["get",["model","transferLocation"]]]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection"],["transferAisleLocation",["helper",["t"],["inventory.labels.transferToAisle"],null],["get",["aisleLocationList"]],["get",["model","transferAisleLocation"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["adjustmentQuantity",["helper",["t"],["labels.quantity"],null],"col-sm-3 required"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["inventory.labels.dateTransferred"],null],"col-sm-4 required"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/transfer/template.hbs"}})}),define("hospitalrun/invoices/add-line-item/controller",["exports","hospitalrun/mixins/billing-categories","ember","hospitalrun/mixins/is-update-disabled"],function(e,t,n,a){e.default=n.default.Controller.extend(t.default,a.default,{invoiceController:n.default.inject.controller("invoices"),billingCategoryList:n.default.computed.alias("invoiceController.billingCategoryList"),editController:n.default.inject.controller("invoices/edit"),title:"Add Line Item",updateButtonText:"Add",updateButtonAction:"add",showUpdateButton:!0,actions:{cancel:function(){this.send("closeModal")},add:function(){this.get("model").save().then(function(e){this.get("editController").send("addLineItem",e)}.bind(this))}},billingCategories:function(){var e=this.get("defaultBillingCategories"),t=this.get("billingCategoryList");return n.default.isEmpty(t)?n.default.Object.create({value:e}):t}.property("billingCategoryList","defaultBillingCategories")})}),define("hospitalrun/invoices/add-line-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"n6Aw1U4J",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-input"],null,[["property","label","class"],["name",["helper",["t"],["labels.name"],null],"required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","className","label","list","selection"],["category","required",["helper",["t"],["labels.category"],null],["get",["billingCategories"]],["get",["model","category"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/add-line-item/template.hbs"}})}),define("hospitalrun/invoices/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller"],function(e,t){e.default=t.default.extend({title:"Delete Invoice"})}),define("hospitalrun/invoices/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"eXEh2gJn",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[],"locals":[]},{"statements":[["text"," "],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0],["text","\\n "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["billing.alerts.deleteItem"],[["item"],[["get",["model","displayInvoiceNumber"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/delete/template.hbs"}})}),define("hospitalrun/invoices/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/number-format","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/publish-statuses","hospitalrun/utils/select-values","npm:uuid"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(a.default,l.default,s.default,{invoiceController:n.default.inject.controller("invoices"),expenseAccountList:n.default.computed.alias("invoiceController.expenseAccountList.value"),patientList:n.default.computed.alias("invoiceController.patientList"),pharmacyCharges:[],pricingProfiles:n.default.computed.map("invoiceController.pricingProfiles",i.default.selectObjectMap),supplyCharges:[],updateCapability:"add_invoice",wardCharges:[],additionalButtons:function(){var e=[],t=this.get("model.isValid"),n=this.get("model.status");return t&&"Draft"===n&&e.push({class:"btn btn-default default",buttonAction:"finalizeInvoice",buttonIcon:"glyphicon glyphicon-ok",buttonText:"Invoice Ready"}),e.push({class:"btn btn-default neutral",buttonAction:"printInvoice",buttonIcon:"glyphicon glyphicon-print",buttonText:"Print"}),e}.property("model.isValid","model.status"),canAddCharge:function(){return this.currentUserCan("add_charge")}.property(),canAddPayment:function(){return this.currentUserCan("add_payment")}.property(),pharmacyExpenseAccount:function(){var e=this.get("expenseAccountList");if(!n.default.isEmpty(e)){var t=e.find(function(e){if(e.toLowerCase().indexOf("pharmacy")>-1)return!0});return t}}.property("expenseAccountList.value"),actions:{addItemCharge:function(e){var t=e.get("details"),n=this.store.createRecord("line-item-detail",{id:o.default.v4()});t.addObject(n)},addLineItem:function(e){var t=this.get("model.lineItems");t.addObject(e),this.send("update",!0),this.send("closeModal")},deleteCharge:function(e){this._deleteObject(e.itemToDelete,e.deleteFrom)},deleteLineItem:function(e){this._deleteObject(e.itemToDelete,this.get("model.lineItems"))},finalizeInvoice:function(){var e=this.get("model"),t=e.get("payments"),a=[];e.get("patient.payments").then(function(l){l.forEach(function(l){var s=l.get("invoice");n.default.isEmpty(s)&&(l.set("invoice",e),a.push(l.save()),t.addObject(l))}.bind(this)),n.default.RSVP.all(a).then(function(){this.set("model.status","Billed"),this.send("update")}.bind(this))}.bind(this))},printInvoice:function(){this.transitionToRoute("print.invoice",this.get("model"))},removePayment:function(e){var t=this.get("model.payments"),n=e.itemToRemove;n.set("invoice"),t.removeObject(e.itemToRemove),this.send("update",!0),this.send("closeModal")},showAddLineItem:function(){var e=this.store.createRecord("billing-line-item",{id:o.default.v4()});this.send("openModal","invoices.add-line-item",e)},showDeleteItem:function(e,t){this.showDeleteModal(e,n.default.Object.create({confirmAction:"deleteCharge",deleteFrom:t,title:"Delete Charge"}))},showDeleteLineItem:function(e){this.showDeleteModal(e,n.default.Object.create({confirmAction:"deleteLineItem",title:"Delete Line Item"}))},showDeleteModal:function(e,t){t=n.default.merge(t,n.default.Object.create({message:"Are you sure you want to delete "+e.get("name")+"?",itemToDelete:e,updateButtonAction:"confirm",updateButtonText:this.get("i18n").t("buttons.ok")})),this.send("openModal","dialog",t)},showRemovePayment:function(e){var t="Are you sure you want to remove this payment from this invoice?",a=n.default.Object.create({itemToRemove:e}),l="Remove Payment";this.displayConfirm(l,t,"removePayment",a)},toggleDetails:function(e){e.toggleProperty("showDetails")}},changePaymentProfile:function(){var e=this.get("model.patient"),t=this.get("model.paymentProfile");!n.default.isEmpty(e)&&n.default.isEmpty(t)&&this.set("model.paymentProfile",e.get("paymentProfile"))}.observes("model.patient"),paymentProfileChanged:function(){var e=this._getValidNumber(this.get("model.paymentProfile.discountPercentage")),t=this.get("model.originalPaymentProfileId"),a=this.get("model.paymentProfile.id");if(a!==t){var l=this.get("model.lineItems");l.forEach(function(t){var l=t.get("details"),s=0;if(l.forEach(function(e){var t=e.get("pricingItem.pricingOverrides");if(!n.default.isEmpty(t)){var l=t.findBy("profile.id",a);n.default.isEmpty(l)||n.default.set(e,"price",l.get("price"))}}.bind(this)),e>0){var i=t.get("total");s=this._numberFormat(e/100*i,!0),t.set("discount",s)}}.bind(this)),this.set("model.originalPaymentProfileId",a)}}.observes("model.paymentProfile"),visitChanged:function(){var e=this.get("model.visit"),t=this.get("model.lineItems");if(!n.default.isEmpty(e)&&n.default.isEmpty(t)){this.set("model.originalPaymentProfileId");var a=this.resolveVisitChildren();n.default.RSVP.allSettled(a,"Resolved visit children before generating invoice").then(function(t){var a=this,l=this._resolveVisitDescendents(t,"charges");n.default.isEmpty(l)?(this._generateLineItems(e,t),this.paymentProfileChanged()):!function(){var s="Reloaded charges before generating invoice";n.default.RSVP.allSettled(l,s).then(function(a){var l=[];a.forEach(function(e){if(!n.default.isEmpty(e.value)){var t=e.value.get("pricingItem");n.default.isEmpty(t)||l.push(t.reload())}}),s="Reloaded pricing items before generating invoice",n.default.RSVP.allSettled(l,s).then(function(){this._generateLineItems(e,t),this.paymentProfileChanged()}.bind(this))}.bind(a))}()}.bind(this),function(e){console.log("Error resolving visit children",e)})}}.observes("model.visit"),_addPharmacyCharge:function(e,t){var n=this;return e.getMedicationDetails(t).then(function(t){var a=e.get("quantity"),l=n.get("pharmacyCharges"),s=n.get("pharmacyExpenseAccount"),i=n.store.createRecord("line-item-detail",{id:o.default.v4(),name:t.name,quantity:a,price:t.price,department:"Pharmacy",expenseAccount:s});l.addObject(i)})},_addSupplyCharge:function(e,t){var n=this.get("supplyCharges"),a=this._createChargeItem(e,t);n.addObject(a)},_createChargeItem:function(e,t){var n=this.store.createRecord("line-item-detail",{id:o.default.v4(),name:e.get("pricingItem.name"),expenseAccount:e.get("pricingItem.expenseAccount"),quantity:e.get("quantity"),price:e.get("pricingItem.price"),department:t,pricingItem:e.get("pricingItem")});return n},_deleteObject:function(e,t){t.removeObject(e),e.get("isNew")||e.destroyRecord(),this.send("update",!0),this.send("closeModal")},_mapWardCharge:function(e){return this._createChargeItem(e,"Ward")},_completeBeforeUpdate:function(e,t,n){var a="inv",l=void 0;e.incrementProperty("value",1),l=e.get("value"),a+=l<1e5?String("00000"+l).slice(-5):l,this.set("model.id",a),e.save().then(t,n)},_generateLineItems:function(e,t){var a=this,l=e.get("endDate"),s=t[0].value,i=t[1].value,r=void 0,d=void 0,c=this.get("model.lineItems"),u=t[2].value,p=t[3].value,m=e.get("startDate"),f=e.get("charges");if(this.setProperties({ +pharmacyCharges:[],supplyCharges:[],wardCharges:[]}),!n.default.isEmpty(l)&&!n.default.isEmpty(m)){l=moment(l),m=moment(m);var h=l.diff(m,"days");h>1&&(r=this.store.createRecord("line-item-detail",{id:o.default.v4(),name:"Days",quantity:h}),d=this.store.createRecord("billing-line-item",{id:o.default.v4(),category:"Hospital Charges",name:"Room/Accomodation"}),d.get("details").addObject(r),c.addObject(d))}var g=[];u.forEach(function(e){g.push(this._addPharmacyCharge(e,"inventoryItem"))}.bind(this)),this.set("wardCharges",f.map(this._mapWardCharge.bind(this))),p.forEach(function(e){var t=e.get("charges");t.forEach(function(e){e.get("medicationCharge")?g.push(this._addPharmacyCharge(e,"medication")):this._addSupplyCharge(e,"O.R.")}.bind(this))}.bind(this)),i.forEach(function(e){n.default.isEmpty(e.get("labType"))||this._addSupplyCharge(n.default.Object.create({pricingItem:e.get("labType"),quantity:1}),"Lab"),e.get("charges").forEach(function(e){this._addSupplyCharge(e,"Lab")}.bind(this))}.bind(this)),s.forEach(function(e){n.default.isEmpty(e.get("imagingType"))||this._addSupplyCharge(n.default.Object.create({pricingItem:e.get("imagingType"),quantity:1}),"Imaging"),e.get("charges").forEach(function(e){this._addSupplyCharge(e,"Imaging")}.bind(this))}.bind(this)),n.default.RSVP.all(g).then(function(){d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Pharmacy",category:"Hospital Charges"}),d.get("details").addObjects(a.get("pharmacyCharges")),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"X-ray/Lab/Supplies",category:"Hospital Charges"}),d.get("details").addObjects(a.get("supplyCharges")),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Ward Items",category:"Hospital Charges"}),d.get("details").addObjects(a.get("wardCharges")),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Physical Therapy",category:"Hospital Charges"}),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Others/Misc",category:"Hospital Charges"}),c.addObject(d),a.send("update",!0)})},_resolveVisitDescendents:function(e,t){var a=[];return e.forEach(function(e){n.default.isEmpty(e.value)||e.value.forEach(function(e){var l=e.get(t);n.default.isEmpty(l)||l.forEach(function(e){a.push(e.reload())})})}),a},beforeUpdate:function(){return new n.default.RSVP.Promise(function(e,t){var a=this.get("model.lineItems"),l=[];a.forEach(function(e){e.get("details").forEach(function(e){l.push(e.save())}.bind(this)),l.push(e.save())}.bind(this)),n.default.RSVP.all(l,"Saved invoice children before saving invoice").then(function(){this.get("model.isNew")?this.store.find("sequence","invoice").then(function(n){this._completeBeforeUpdate(n,e,t)}.bind(this),function(){var n=this.get("store"),a=n.push(n.normalize("sequence",{id:"invoice",value:0}));this._completeBeforeUpdate(a,e,t)}.bind(this)):e()}.bind(this),t)}.bind(this))},afterUpdate:function(){var e="The invoice record has been saved.";this.displayAlert("Invoice Saved",e)}})}),define("hospitalrun/invoices/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember"],function(e,t,n){e.default=t.default.extend({editTitle:"Edit Invoice",modelName:"invoice",newTitle:"New Invoice",actions:{deleteCharge:function(e){this.controller.send("deleteCharge",e)},deleteLineItem:function(e){this.controller.send("deleteLineItem",e)},removePayment:function(e){this.controller.send("removePayment",e)}},afterModel:function(e){return new n.default.RSVP.Promise(function(t,a){var l=e.get("lineItems"),s=[];l.forEach(function(e){s.push(e.reload())}),n.default.RSVP.all(s,"Reload billing line items for invoice").then(function(e){var l=[];e.forEach(function(e){e.get("details").forEach(function(e){l.push(e.reload())})}),n.default.RSVP.all(l,"Reload billing line item details for invoice").then(t,a)},a)})},getNewData:function(){return n.default.RSVP.resolve({billDate:new Date,status:"Draft"})},setupController:function(e,t){t.set("originalPaymentProfileId",t.get("paymentProfile.id")),this._super(e,t);var a=t.get("lineItems"),l=[];a.forEach(function(e){e.get("details").forEach(function(e){var t=e.get("pricingItem");n.default.isEmpty(t)||l.push(t.reload())})})}})}),define("hospitalrun/invoices/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"HLQLw+RK",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],17]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showRemovePayment",["get",["payment"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.remove"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showEditPayment",["get",["payment"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["payment","canRemovePayment"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"showEditPayment",["get",["payment"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["payment","datePaid"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["payment","amount"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["payment","paymentType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["payment","notes"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canAddPayment"]]],null,1],["text"," "],["close-element"],["text","\\n"]],"locals":["payment"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPayment",["get",["model"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["admin.roles.capability.addPayment"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteItem",["get",["detail"]],["get",["item","details"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","2"],["static-attr","class","col-xs-6 input-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["detail","name"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["detail","quantity"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["detail","price"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["select-list"],null,[["class","content","value","action"],["form-control",["get",["expenseAccountList"]],["get",["detail","expenseAccount"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["detail","expenseAccount"]]],null]],null]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["text","\\n "],["append",["helper",["number-format"],[["get",["detail","amountOwed"]]],null],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,4],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["detail"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"addItemCharge",["get",["item"]]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["admin.roles.capability.addCharge"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","colspan","2"],["static-attr","class","col-xs-6"],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["t"],["labels.price"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["t"],["labels.expense_to"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,6],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["item","details"]]],null,5]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteLineItem",["get",["item"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-5"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group"],["flush-element"],["text","\\n "],["open-element","span",[]],["dynamic-attr","class",["concat",["input-group-addon glyphicon\\n ",["helper",["if"],[["get",["item","showDetails"]],"glyphicon-minus","glyphicon-plus"],null]]]],["modifier",["action"],[["get",[null]],"toggleDetails",["get",["item"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["item","name"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["text","\\n "],["append",["helper",["number-format"],[["get",["item","total"]]],null],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control text-right",["get",["item","discount"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control text-right",["get",["item","nationalInsurance"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control text-right",["get",["item","privateInsurance"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["item","amountOwed"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,8],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["item","showDetails"]]],null,7]],"locals":["item"]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-12"],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["unknown",["categoryGroup","category"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["categoryGroup","items"]]],null,9],["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["text"," "],["append",["unknown",["categoryGroup","category"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","total"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","discount"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","nationalInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","privateInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","amountOwed"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["categoryGroup"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddLineItem"],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.addLineItem"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDescription"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"col-xs-4 required invoice-patient"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected","prompt"],["col-xs-4 required invoice-visit",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["get",["model","visit"]],"Please select a visit"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group col-xs-2"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.invoiceId"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","id"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"invoices.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["model","isNew"]]],null,15],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["unless"],[["get",["model","isNew"]]],null,14],["text"," "],["append",["helper",["date-picker"],null,[["property","label","class"],["billDate",["helper",["t"],["labels.billDate"],null],"col-xs-2"]]],false],["text","\\n"],["block",["if"],[["get",["model","isNew"]]],null,13,12],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["externalInvoiceNumber",["helper",["t"],["billing.labels.externalInvoiceNumber"],null],"col-xs-3 external-invoice-no"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["label","property","content","optionValuePath","optionLabelPath","class","prompt","selected"],[["helper",["t"],["billing.labels.paymentProfile"],null],"paymentProfile",["get",["pricingProfiles"]],"selectObject","selectObject.name","col-xs-3"," ",["get",["model","paymentProfile"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],16],["text"," "],["open-element","form",[]],["static-attr","class","form-inline"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.lineItems"],null],false],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,11],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-5"],["flush-element"],["append",["helper",["t"],["labels.description"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["billing.labels.actualCharges"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["labels.discount"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["billing.labels.insurance"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["billing.labels.hmoCom"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["labels.excess"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2 text-right"],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","lineItemsByCategory"]]],null,10],["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","total"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","discount"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","nationalInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","privateInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","patientResponsibility"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["billing.labels.paymentsDeposits"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","4"],["flush-element"],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["text","-"],["append",["helper",["number-format"],[["get",["model","paidTotal"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["labels.grandTotal"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","4"],["flush-element"],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","remainingBalance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.remarks"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["append",["helper",["textarea"],null,[["class","value"],["form-control",["get",["model","remarks"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.payments"],null],false],["text","\\n"],["block",["if"],[["get",["canAddPayment"]]],null,3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.amount"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","payments"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/edit/template.hbs"}})}),define("hospitalrun/invoices/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({addPermission:"add_invoice",deletePermission:"delete_invoice",canAddPayment:function(){return this.currentUserCan("add_payment")}.property(),startKey:[],queryParams:["startKey","status"]})}),define("hospitalrun/invoices/index/route",["exports","hospitalrun/routes/abstract-index-route","ember"],function(e,t,n){e.default=t.default.extend({modelName:"invoice",pageTitle:"Invoice Listing",_getStartKeyFromItem:function(e){var t=e.get("billDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("status");return[a,t,n]},_modelQueryParams:function(e){var t=void 0,a=this._getMaxPouchId(),l=this.get("maxValue"),s=this._getMinPouchId(),i=e.status;return n.default.isEmpty(i)&&(i="Billed"),this.set("pageTitle",i+" Invoices"),t={options:{startkey:[i,null,s],endkey:[i,l,a]},mapReduce:"invoice_by_status"},"All"===i&&(delete t.options.startkey,delete t.options.endkey),t},queryParams:{startKey:{refreshModel:!0},status:{refreshModel:!0}}})}),define("hospitalrun/invoices/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"+thqAl2P",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],9]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["billing.alerts.noInvoiceFound"],null],false],["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["billing.buttons.createInvoice"],null],false],["close-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["invoice"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editItem",["get",["invoice"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["buttons.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showAddPayment",["get",["invoice"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["admin.roles.capability.addPayment"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddPayment"]]],null,3],["block",["if"],[["get",["canAdd"]]],null,2],["block",["if"],[["get",["canDelete"]]],null,1]],"locals":[]},{"statements":[["block",["if"],[["get",["showActions"]]],null,4]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["invoice"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","invoice-number"],["flush-element"],["append",["unknown",["invoice","displayInvoiceNumber"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["invoice","billDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","patient","displayName"]],false],["text"," - "],["append",["unknown",["invoice","patient","displayPatientId"]],false],["text"," "],["open-element","br",[]],["flush-element"],["close-element"],["append",["unknown",["invoice","visit","primaryDiagnoses"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","total"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","remainingBalance"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["unless"],[["get",["invoice","paidFlag"]]],null,5],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["invoice"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.number"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.billDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.balanceDue"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,7],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,6],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,8,0]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/invoices/index/template.hbs"}})}),define("hospitalrun/invoices/payment/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/patient-submodule"],function(e,t,n,a){e.default=t.default.extend(a.default,{cancelAction:"closeModal",findPatientVisits:!1,invoiceController:n.default.inject.controller("invoices"),newPayment:!1,expenseAccountList:n.default.computed.alias("invoiceController.expenseAccountList"),patientList:n.default.computed.alias("invoiceController.patientList"),_finishUpdate:function(e,t){this.send("closeModal"),this.displayAlert(t,e)},currentPatient:function(){var e=this.get("model.paymentType");return"Deposit"===e?this.get("model.patient"):this.get("model.invoice.patient")}.property("model.patient","model.paymentType","model.invoice.patient"),title:function(){var e=this.get("model.isNew"),t=this.get("model.paymentType");return e?"Add "+t:"Edit "+t}.property("model.isNew","model.paymentType"),selectPatient:function(){var e=this.get("model.isNew"),t=this.get("model.paymentType");return e&&"Deposit"===t}.property("model.isNew","model.paymentType"),beforeUpdate:function(){this.get("model.isNew")?this.set("newPayment",!0):this.set("newPayment",!1);var e=this.get("currentPatient");return this.set("model.charityPatient","Charity"===e.get("patientType")),n.default.RSVP.resolve()},afterUpdate:function(){this.get("model").save().then(function(e){var t=this;this.get("newPayment")?!function(){var n=t.get("currentPatient");n.get("payments").then(function(t){t.addObject(e),n.save().then(function(){var t=this;if("Deposit"===e.get("paymentType")){var a="A deposit of "+e.get("amount")+" was added for patient "+n.get("displayName");this._finishUpdate(a,"Deposit Added")}else!function(){var n=t.get("model.invoice");n.addPayment(e),n.save().then(function(){var t="A payment of "+e.get("amount")+" was added to invoice "+n.get("id");this._finishUpdate(t,"Payment Added")}.bind(t))}()}.bind(this))}.bind(t))}():this.send("closeModal")}.bind(this))}})}),define("hospitalrun/invoices/payment/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"R4hTidw9",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText","updateButtonClass"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]],"update-payment-btn"]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","invoice","patient","displayName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required payment-patient"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["selectPatient"]]],null,1,0]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,2],["text"," "],["append",["helper",["number-input"],null,[["property","label","class"],["amount",["helper",["t"],["labels.amount"],null],"required payment-amount"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","maxDate","class"],["datePaid",["helper",["t"],["labels.datePaid"],null],"now","required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection"],["expenseAccount",["helper",["t"],["labels.creditTo"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]]]]],false],["text","\\n "],["append",["helper",["em-text"],null,[["property","label"],["notes",["helper",["t"],["labels.notes"],null]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],3]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/payment/template.hbs"}})}),define("hospitalrun/invoices/route",["exports","hospitalrun/routes/abstract-module-route","hospitalrun/mixins/modal-helper","hospitalrun/mixins/patient-list-route"],function(e,t,n,a){e.default=t.default.extend(n.default,a.default,{addCapability:"add_invoice",currentScreenTitle:"Invoices",editTitle:"Edit Invoice",newTitle:"New Invoice",moduleName:"invoices",newButtonText:"+ new invoice",sectionTitle:"Invoices",additionalButtons:function(){if(this.currentUserCan("add_payment"))return[{class:"btn btn-default",buttonText:"+ add deposit",buttonAction:"showAddDeposit"}]}.property(),additionalModels:[{name:"billingCategoryList",findArgs:["lookup","billing_categories"]},{name:"expenseAccountList",findArgs:["lookup","expense_account_list"]},{name:"pricingProfiles",findArgs:["price-profile"]}],actions:{showAddDeposit:function(){var e=this.store.createRecord("payment",{paymentType:"Deposit",datePaid:new Date});this.send("openModal","invoices.payment",e)},showAddPayment:function(e){var t=this.store.createRecord("payment",{invoice:e,paymentType:"Payment",datePaid:new Date});this.send("openModal","invoices.payment",t)},showEditPayment:function(e){this.currentUserCan("add_payment")&&this.send("openModal","invoices.payment",e)}},subActions:function(){var e=[{text:"Billed",linkTo:"invoices.index",statusQuery:"Billed"}];return this.currentUserCan("add_invoice")&&(e.push({text:"Drafts",linkTo:"invoices.index",statusQuery:"Draft"}),e.push({text:"All Invoices",linkTo:"invoices.index",statusQuery:"All"})),e.push({text:"Paid",linkTo:"invoices.index",statusQuery:"Paid"}),e}.property()})}),define("hospitalrun/invoices/search/route",["exports","hospitalrun/routes/abstract-search-route"],function(e,t){e.default=t.default.extend({moduleName:"invoices",searchKeys:[{name:"externalInvoiceNumber",type:"contains"},{name:"patientInfo",type:"contains"}],searchModel:"invoice"})}),define("hospitalrun/invoices/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"7Stx2dsU",block:'{"statements":[["block",["search-listing"],null,[["newButtonText","allButtonText"],["New Invoice","All Invoices"]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","invoices/index"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/invoices/search/template.hbs"}})}),define("hospitalrun/labs/charge/controller",["exports","hospitalrun/procedures/charge/controller","ember"],function(e,t,n){e.default=t.default.extend({labsEdit:n.default.inject.controller("labs/edit"),cancelAction:"closeModal",newPricingItem:!1,requestingController:n.default.computed.alias("controllers.labs/edit"),pricingList:n.default.computed.alias("controllers.labs/edit.chargesPricingList")})}),define("hospitalrun/labs/charge/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"8qHLvc50",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","procedures/charge"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/labs/charge/template.hbs"}})}),define("hospitalrun/labs/completed/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({startKey:[],showActions:!1})}),define("hospitalrun/labs/completed/labs-completed-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr"})}),define("hospitalrun/labs/completed/labs-completed-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"53/ixka0",block:'{"statements":[["open-element","td",[]],["static-attr","class","requested-date"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","requestedDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","lab-date"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","labDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","patient"],["flush-element"],["append",["unknown",["lab","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["lab","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","lab-type"],["flush-element"],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","result"],["flush-element"],["append",["unknown",["lab","result"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["lab","notes"]],false],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/completed/labs-completed-list-item/template.hbs"}})}),define("hospitalrun/labs/completed/route",["exports","hospitalrun/labs/index/route","ember-i18n"],function(e,t,n){e.default=t.default.extend({pageTitle:(0,n.translationMacro)("labs.completedTitle"),searchStatus:"Completed"})}),define("hospitalrun/labs/completed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"hCs/6AmP",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["labs.messages.noCompleted"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["labs/completed/labs-completed-list-item"],null,[["lab"],[["get",["lab"]]]]],false],["text","\\n"]],"locals":["lab"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateCompleted"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.results"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,1],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model"]]],null,2,0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/completed/template.hbs"}})}),define("hospitalrun/labs/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller","hospitalrun/mixins/patient-submodule","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{title:(0,a.translationMacro)("labs.deleteTitle"),actions:{delete:function(){this.deleteChildFromVisit("labs")}}})}),define("hospitalrun/labs/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"+OJQ5Cwg",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["labs.messages.confirmDeletion"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/delete/template.hbs"}})}),define("hospitalrun/labs/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/charge-actions","ember","hospitalrun/mixins/patient-submodule"],function(e,t,n,a,l){e.default=t.default.extend(n.default,l.default,{labsController:a.default.inject.controller("labs"),chargePricingCategory:"Lab",chargeRoute:"labs.charge",selectedLabType:null,canComplete:function(){var e=this.get("model.isNew"),t=this.get("model.labTypeName"),n=this.get("selectedLabType");return(!e||!(a.default.isEmpty(t)||a.default.isArray(n)&&n.length>1))&&this.currentUserCan("complete_lab")}.property("selectedLabType.[]","model.labTypeName"),actions:{completeLab:function(){this.set("model.status","Completed"),this.get("model").validate().then(function(){this.get("model.isValid")&&(this.set("model.labDate",new Date),this.send("update"))}.bind(this)).catch(a.default.K)},update:function(){var e=this;this.get("model.isNew")?!function(){var t=e.get("model"),n=e.get("selectedLabType");a.default.isEmpty(e.get("model.status"))&&e.set("model.status","Requested"),e.set("model.requestedBy",t.getUserName()),e.set("model.requestedDate",new Date),a.default.isEmpty(n)?e.saveNewPricing(e.get("model.labTypeName"),"Lab","model.labType").then(function(){this.addChildToVisit(t,"labs","Lab").then(function(){this.saveModel()}.bind(this))}.bind(e)):e.getSelectedPricing("selectedLabType").then(function(e){a.default.isArray(e)?this.createMultipleRequests(e,"labType","labs","Lab"):(this.set("model.labType",e),this.addChildToVisit(t,"labs","Lab").then(function(){this.saveModel()}.bind(this)))}.bind(e))}():this.saveModel()}},additionalButtons:function(){var e=this.get("canComplete"),t=this.get("model.isValid"),n=this.get("i18n");if(t&&e)return[{buttonAction:"completeLab",buttonIcon:"glyphicon glyphicon-ok",class:"btn btn-primary on-white",buttonText:n.t("buttons.complete")}]}.property("canComplete","model.isValid"),pricingTypeForObjectType:"Lab Procedure",pricingTypes:a.default.computed.alias("labsController.labPricingTypes"),pricingList:null,updateCapability:"add_lab",afterUpdate:function(e,t){var n=this.get("i18n"),a=void 0,l=void 0,s=void 0;"Completed"===this.get("model.status")?(s=n.t("labs.alerts.requestCompletedTitle"),l=n.t("labs.alerts.requestCompletedMessage")):(s=n.t("labs.alerts.requestSavedTitle"),l=n.t("labs.alerts.requestSavedMessage")),t&&(a=this.get("cancelAction")),this.saveVisitIfNeeded(s,l,a),this.set("model.selectPatient",!1)}})}),define("hospitalrun/labs/edit/route",["exports","ember","hospitalrun/routes/abstract-edit-route","hospitalrun/mixins/charge-route","hospitalrun/mixins/patient-list-route","ember-i18n"],function(e,t,n,a,l,s){e.default=n.default.extend(a.default,l.default,{editTitle:(0,s.translationMacro)("labs.editTitle"),modelName:"lab",newTitle:(0,s.translationMacro)("labs.newTitle"),pricingCategory:"Lab",actions:{returnToAllItems:function(){this.controller.send("returnToAllItems")}},getNewData:function(){return t.default.RSVP.resolve({selectPatient:!0,requestDate:moment().startOf("day").toDate()})}})}),define("hospitalrun/labs/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"zksQIuZ7",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-input"],null,[["property","label","class"],["result",["helper",["t"],["labels.result"],null],"test-result-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDate"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-6"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","labType","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-9"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","requestedBy"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","prompt","selected"],["col-xs-3 required test-visit-type",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["helper",["t"],["labs.labels.addNewVisit"],null],["get",["model","visit"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["checkbox-or-typeahead"],null,[["property","label","list","selection","optionLabelPath","typeAheadType","className","prompt","model"],["labTypeName",["helper",["t"],["labs.labels.labType"],null],["get",["objectTypeList"]],["get",["selectedLabType"]],"name","pricing","required test-lab-type"," ",["get",["model"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"labs.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required test-patient-name"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","selectPatient"]]],null,4,3],["block",["if"],[["get",["model","isNew"]]],null,2,1],["block",["if"],[["get",["canComplete"]]],null,0],["text"," "],["append",["helper",["em-text"],null,[["property","label","rows"],["notes",["helper",["t"],["labels.notes"],null],3]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],5]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/edit/template.hbs"}})}),define("hospitalrun/labs/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],addPermission:"add_lab"})}),define("hospitalrun/labs/index/labs-edit-button/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"button",classNames:["btn","btn-default","neutral"]})}),define("hospitalrun/labs/index/labs-edit-button/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"D+D+/RzO",block:'{"statements":[["block",["link-to"],["labs.edit",["get",["lab"]]],null,0],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["append",["helper",["t"],["labels.edit"],null],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/index/labs-edit-button/template.hbs"}})}),define("hospitalrun/labs/index/labs-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr",classNames:["clickable"],click:function(){this.sendAction("action",this.lab)}})}),define("hospitalrun/labs/index/labs-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"lUoTUBbz",block:'{"statements":[["open-element","td",[]],["static-attr","class","requested-date"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","requestedDate"]]],[["format"],["l h:mm A"]]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","patient"],["flush-element"],["append",["unknown",["lab","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["lab","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","lab-type"],["flush-element"],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["lab","notes"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["labs/index/labs-edit-button"],null,[["lab"],[["get",["lab"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEdit"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/index/labs-list-item/template.hbs"}})}),define("hospitalrun/labs/index/route",["exports","hospitalrun/routes/abstract-index-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({modelName:"lab",pageTitle:(0,n.translationMacro)("labs.requestsTitle"),searchStatus:"Requested",_getStartKeyFromItem:function(e){var t=e.get("labDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("requestedDateAsTime"),l=this.get("searchStatus");return[l,a,t,n]},_modelQueryParams:function(){var e=this._getMaxPouchId(),t=this.get("maxValue"),n=this._getMinPouchId(),a=this.get("searchStatus");return{options:{startkey:[a,null,null,n],endkey:[a,t,t,e]},mapReduce:"lab_by_status"}}})}),define("hospitalrun/labs/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"6Iu3UI4u",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["labs.messages.createNewRecord"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["labs.messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["labs/index/labs-list-item"],null,[["lab","action","showActions","canEdit"],[["get",["lab"]],"editItem",["get",["showActions"]],["get",["canEdit"]]]]],false],["text","\\n"]],"locals":["lab"]},{"statements":[["text"," "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,3],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,4,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/index/template.hbs"}})}),define("hospitalrun/labs/route",["exports","hospitalrun/routes/abstract-module-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({addCapability:"add_lab",additionalModels:[{name:"labPricingTypes",findArgs:["lookup","lab_pricing_types"]}],allowSearch:!1,moduleName:"labs",newButtonText:(0,n.translationMacro)("labs.buttons.newButton"),sectionTitle:(0,n.translationMacro)("labs.sectionTitle")})}),define("hospitalrun/locales/de/translations",["exports"],function(e){e.default={dashboard:{title:"Was möchten Sie tun?"},navigation:{imaging:"Bildgebung",inventory:"Inventar",patients:"Patienten",appointments:"Termine",medication:"Medikation",labs:"Labore",billing:"Abrechnung",administration:"Administration",subnav:{requests:"Anfragen",items:"Einheiten",completed:"Erledigt",newRequest:"Neue Anfrage",inventoryReceived:"Eingeganges Inventar",reports:"Berichte",patientListing:"Patietenliste",newPatient:"Neuer Patient",thisWeek:"Diese Woche",today:"Heute",search:"Suche",addAppointment:"Termin eintragen",dispense:"Verabreichen",returnMedication:"Medikamente zurückgeben",invoices:"Rechnungen",newInvoice:"Neue Rechnung",prices:"Kosten",priceProfiles:"Preisprofile",lookupLists:"Nachschlagelisten",addressFields:"Adressfelder",loadDb:"Datenbank laden",users:"Benutzer",newUser:"Neuer Benutzer"},actions:{logout:"Abmelden",login:"Anmelden"},about:"Über HospitalRun"},user:{plusNewUser:"+ Neuer Benutzer",usersPageTile:"Benutzerliste"},admin:{addressOptions:"Adressoptionen",lookupLists:"Nachschlagelisten",loadDb:"Datenbank laden",users:"Benutzer",address:{address1Label:"Adresse 1 Kennzeichen",address2Label:"Adresse 2 Kennzeichen",address3Label:"Adresse 3 Kennzeichen",address4Label:"Adresse 4 Kennzeichen",include1Label:"Einbezug 1 Kennzeichen",include2Label:"Einbezug 2 Kennzeichen",include3Label:"Einbezug 3 Kennzeichen",include4Label:"Einbezug 4 Kennzeichen",titles:{optionsSaved:"Optionen gespeichert"},messages:{addressSaved:"Die Adressoptionen wurden gespeichert"}},lookup:{anesthesiaTypes:"Anästhesiearten",anesthesiologists:"Anästhesiologe",billingCategories:"Abrechnungskategorien",clinicList:"Kliniken",countryList:"Länder",diagnosisList:"Diagnosen",cptCodeList:"CPT Codes",expenseAccountList:"Ausgabekonten",aisleLocationList:"Gänge-Verzeichnis",warehouseList:"Warenhaus",inventoryTypes:"Inventartypen",imagingPricingTypes:"Bildgebungs-Preiskategorien",labPricingTypes:"Labor-Preiskategorien",patientStatusList:"Patientenstatus",physicianList:"Ärzte",procedureList:"Abläufe",procedureLocations:"Ablaufs-Orte",procedurePricingTypes:"Ablaufs-Preiskategorien",radiologists:"Radiologen",unitTypes:"Einheiten",vendorList:"Anbieter",visitLocationList:"Einsatzorte",visitTypes:"Besuchsarten",wardPricingTypes:"Krankenstations-Preistypen"}},labels:{name:"Name",patient:"Patient",quantity:"Anzahl",requestedOn:"Angefragt am",dateRequested:"Anfragedatum",dateCompleted:"Abschlussdatum",requestedBy:"Angefragt von",fulfill:"Ausführen",actions:"Aktionen",action:"Aktion",notes:"Notizen",edit:"Bearbeiten",imagingType:"Bildgebungsart",result:"Ergebnis",results:"Ergebnisse",visit:"Besuch",requests:"Anfragen",completed:"Erledigt",id:"Id-Nr",sex:"Geschlecht",age:"Alter",username:"Username",email:"E-Mail",role:"Rolle",delete:"Entfernen",userCanAddNewValue:"Benutzer kann neue Werte hinzufügen",value:"Wert",lookupType:"Nachschlagebereich",importFile:"Datei importieren",fileLoadSuccessful:"Datei erfolgreich geladen",fileToLoad:"Datei laden",startTime:"Startzeit",endTime:"Endzeit",docRead:"Dokument gelesen",docWritten:"Dokument geschrieben",displayName:"Angezeigter Name",password:"Passwort",editUser:"Benutzer bearbeiten",newUser:"Neuer Benutzer",deleteUser:"Benutzer löschen"},messages:{noItemsFound:"Keine Einträge gefunden.",createNewRecord:"Neuen Eintrag erstellen?",createNewUser:"Neuen Benutzer hinzufügen?",noUsersFound:"Keine Benutzer gefunden.",areYouSureDelete:"Wollen Sie den Benutzer {{user}} sicher löschen?",userHasBeenSaved:"Der Benutzer wurde gespeichert.",userSaved:"Benutzer gespeichert",forAuthorizedPersons:"Dieser Bericht ist nur für autorisierte Personen."},buttons:{complete:"Abschließen",cancel:"Abbrechen",returnButton:"Zurück",add:"Hinzufügen",update:"Aktualisieren",ok:"Okay",delete:"Entfernen",newUser:"Neuer Benutzer",addValue:"Wert hinzufügen",import:"Importieren",loadFile:"Datei laden"},login:{messages:{signIn:"Bitte anmelden",error:"Benutzername oder Passwort falsch."},labels:{password:"Passwort",username:"Benutzername",signIn:"Anmelden"}},inventory:{messages:{noRequests:"Keine Anfragen gefunden.",createRequest:"Neue Anfrage erstellen?"}},imaging:{pageTitle:"Anfrage zur Bildgebung",sectionTitle:"Bildgebung",buttons:{newButton:"+ Neue Bildgebung"},labels:{radiologist:"Radiologe",addNewVisit:"--Neuen Besuch hinzufügen--"},messages:{noCompleted:"Keine erledigten Einträge gefunden."},titles:{completedImaging:"Erledigte Bildgebung",editTitle:"Bildgebungs-Anfrage bearbeiten",newTitle:"Neue Bildgebungs-Anfrage"},alerts:{completedTitle:"Bildgebungs-Anfrage gestellt",completedMessage:"Die Anfrage zur Bildgebung wurde abgeschlossen.",savedTitle:"Bildgebungs-Anfrage gespeichert",savedMessage:"Die Anfrage zur Bildgebung wurde gespeichert." +}}}}),define("hospitalrun/locales/en/config",["exports"],function(e){e.default={}}),define("hospitalrun/locales/en/translations",["exports"],function(e){e.default={dashboard:{title:"What would you like to do?"},errors:{inclusion:"is not included in the list",exclusion:"is reserved",invalid:"is invalid",confirmation:"doesn't match {{attribute}}",accepted:"must be accepted",empty:"can't be empty",blank:"can't be blank",present:"must be blank",tooLong:"is too long (maximum is {{count}} characters)",tooShort:"is too short (minimum is {{count}} characters)",wrongLength:"is the wrong length (should be {{count}} characters)",notANumber:"is not a number",notAnInteger:"must be an integer",greaterThan:"must be greater than {{count}}",greaterThanOrEqualTo:"must be greater than or equal to {{count}}",equalTo:"must be equal to {{count}}",lessThan:"must be less than {{count}}",lessThanOrEqualTo:"must be less than or equal to {{count}}",otherThan:"must be other than {{count}}",odd:"must be odd",even:"must be even",invalidNumber:"not a valid number",result:"Please enter a result before completing"},dates:{long:"{{years}} year {{months}} months {{days}} days",longPlural:"{{years}} years {{months}} months {{days}} days",longOmitYears:"{{months}} months {{days}} days",longOmitDays:"{{years}} year {{months}} months",longOmitDaysPlural:"{{years}} years {{months}} months",longOmitDaysYears:"{{months}} months",shortOmitYears:"{{months}}m {{days}}d",short:"{{years}}y {{months}}m {{days}}d"},navigation:{imaging:"Imaging",inventory:"Inventory",patients:"Patients",appointments:"Appointments",medication:"Medication",labs:"Labs",billing:"Billing",administration:"Administration",subnav:{actions:"Actions",requests:"Requests",items:"Items",completed:"Completed",newRequest:"New Request",inventoryReceived:"Inventory Received",reports:"Reports",patientListing:"Patient Listing",newPatient:"New Patient",thisWeek:"This Week",today:"Today",search:"Search",addAppointment:"Add Appointment",dispense:"Dispense",returnMedication:"Return Medication",invoices:"Invoices",newInvoice:"New Invoice",prices:"Prices",priceProfiles:"Price Profiles",lookupLists:"Lookup Lists",addressFields:"Address Fields",loadDB:"Load DB",users:"Users",newUser:"New User",admittedPatients:"Admitted Patients",missed:"Missed",userRoles:"User Roles",workflow:"Workflow",outpatient:"Outpatient",customForms:"Custom Forms"},actions:{logout:"Logout",login:"Login"},about:"About HospitalRun"},user:{plusNewUser:"+ new user",usersPageTile:"User Listing"},admin:{addressOptions:"Address Options",lookupLists:"Lookup Lists",loadDb:"Load DB",userRoles:"User Roles",users:"Users",address:{address1Label:"Address 1 Label",address2Label:"Address 2 Label",address3Label:"Address 3 Label",address4Label:"Address 4 Label",include1Label:"Include 1 Label",include2Label:"Include 2 Label",include3Label:"Include 3 Label",include4Label:"Include 4 Label",titles:{optionsSaved:"Options Saved"},messages:{addressSaved:"The address options have been saved"},newTitle:"Address Options",editTitle:"Address Options",addressLabel:"Address"},customForms:{buttons:{addField:"Add Field",moveDown:"Move Down",moveUp:"Move Up",newForm:"+ new form",preview:"Preview"},labels:{alwaysInclude:"Always Include",checkbox:"Checkbox",columns:"Columns",colSpan:"Number of Columns To Span",customForm:"Custom Form",formName:"Form Name",formType:"Form Type",includeOtherOption:"Include Other Option",label:"Label",newForm:"New Form",operativePlanFormType:"Operative Plan",otherOptionLabel:"Other Option Label",patientFormType:"Patient",property:"Property",radio:"Radio",select:"Dropdown",socialworkFormType:"Social Work",text:"Text",textarea:"Large Text",visitFormType:"Visit"},messages:{deleteForm:"Are you sure you want to delete this custom form?",formSaved:"The {{name}} form has been saved."},titles:{customForms:"Custom Forms",deleteForm:"Delete Custom Form",editCustomForm:"Edit Custom Form",fields:"Fields",formSaved:"Form Saved",checkboxValues:"Checkbox Values",dropDownValues:"Dropdown Values",newCustomForm:"New Custom Form",radioValues:"Radio Values"}},loaddb:{progressMessage:"Please wait while your database is loaded.",progressTitle:"Loading Database",displayAlertTitle:"Select File To Load",displayAlertMessage:"Please select file to load.",errorDisplayAlertTitle:"Error Loading",errorDisplayAlertMessage:"The database could not be imported. The error was: {{error}}",editTitle:"Load DB"},lookup:{alertImportListTitle:"Select File To Import",alertImportListMessage:"Please select file to import.",alertImportListSaveTitle:"List Imported",alertImportListSaveMessage:"The lookup list has been imported.",alertImportListUpdateTitle:"List Saved",alertImportListUpdateMessage:"The lookup list has been saved.",pageTitle:"Lookup Lists",edit:{template:{addTitle:"Add Value",editTitle:"Edit Value",updateButtonTextAdd:"Add",updateButtonTextUpdate:"Update",labelTitle:"Value"}},anesthesiaTypes:"Anesthesia Types",anesthesiologists:"Anesthesiologists",billingCategories:"Billing Categories",clinicList:"Clinic Locations",countryList:"Countries",diagnosisList:"Diagnoses",cptCodeList:"CPT Codes",expenseAccountList:"Expense Accounts",aisleLocationList:"Inventory Aisle Locations",warehouseList:"Inventory Locations",inventoryTypes:"Inventory Types",imagingPricingTypes:"Imaging Pricing Types",labPricingTypes:"Lab Pricing Types",patientStatusList:"Patient Status List",physicianList:"Physicians",procedureList:"Procedures",procedureLocations:"Procedures Locations",procedurePricingTypes:"Procedure Pricing Types",radiologists:"Radiologists",unitTypes:"Unit Types",vendorList:"Vendor",visitLocationList:"Visit Locations",visitTypes:"Visit Types",wardPricingTypes:"Ward Pricing Types",messages:{deleteLookupValue:"Are you sure you want to delete the {{value}} value?"},titles:{deleteLookupValue:"Delete Value"}},roles:{capability:{admin:"Administration",loadDb:"Load Database",updateConfig:"Update Configurations",appointments:"Appointments",addAppointment:"Add Appointment",billing:"Billing",addCharge:"Add Charge",addPricing:"Add Pricing",addPricingProfile:"Add Pricing Profile",addInvoice:"Add Invoice",addPayment:"Add Payment",deleteInvoice:"Delete Invoice",deletePricing:"Delete Pricing",deletePricingProfile:"Delete Pricing Profile",editInvoice:"Edit Invoice",invoices:"Invoices",overrideInvoice:"Override Invoice",pricing:"Pricing",patients:"Patients",addDiagnosis:"Add Diagnosis",addPhoto:"Add Photo",addPatient:"Add Patient",addProcedure:"Add Procedure",addVisit:"Add Visit",addVitals:"Add Vitals",admitPatient:"Admit Patient",deletePhoto:"Delete Photo",deletePatient:"Delete Patient",deleteAppointment:"Delete Appointment",deleteDiagnosis:"Delete Diagnosis",deleteProcedure:"Delete Procedure",deleteSocialwork:"Delete Social Work",deleteVitals:"Delete Vitals",deleteVisit:"Delete Visit",dischargePatient:"Discharge Patient",patientReports:"Patient Reports",visits:"Visits",medication:"Medication",addMedication:"Add Medication",deleteMedication:"Delete Medication",fulfillMedication:"Fulfill Medication",labs:"Labs",addLab:"Add Lab",completeLab:"Complete Lab",deleteLab:"Delete Lab",imaging:"Imaging",addImaging:"Add Imaging",completeImaging:"Complete Imaging",deleteImaging:"Delete Imaging",inventory:"Inventory",addInventoryRequest:"Add Inventory Request",addInventoryItem:"Add Inventory Item",addInventoryPurchase:"Add Inventory Purchase",adjustInventoryLocation:"Adjust Inventory Location",deleteInventoryItem:"Delete Inventory Item",fulfillInventory:"Fulfill Inventory",defineUserRoles:"Define User Roles",addBillingDiagnosis:"Add Billing Diagnosis",addNote:"Add Note",addSocialwork:"Add Social Work",deleteNote:"Delete Note",addOperativePlan:"Add Operative Plan",addAllergy:"Add Allergy"},messages:{roleSaved:"The {{roleName}} role has been saved."},titles:{roleSaved:"Role Saved"}},visitForms:{labels:{followup:"Followup",form:"Form",initial:"Initial",visitType:"Visit Type"},titles:{visitForms:"Visit Forms"}},workflow:{admissionDepositLabel:"Admission deposit required",clinicPrepaymentLabel:"Clinic prepayment required",followupPrepaymentLabel:"Followup prepayment required",outpatientLabLabel:"Outpatient Lab prepayment required",outpatientImagingLabel:"Outpatient Imaging prepayment required",outpatientMedicationLabel:"Outpatient Medication prepayment required",titles:{optionsSaved:"Options Saved"},messages:{optionsSaved:"The workflow options have been saved"},newTitle:"Workflow Options",editTitle:"Workflow Options",workflowLabel:"Workflow"}},labels:{cptcode:"CPT Code",loading:"Loading",name:"Name",note:"Note",patient:"Patient",prescriber:"Prescriber",quantity:"Quantity",requestedOn:"Requested On",date:"Date",dateOfBirth:"Date of Birth",dateOfBirthShort:"DoB",dateRequested:"Date Requested",dateCompleted:"Date Completed",description:"Description",requestedBy:"Requested By",fulfill:"Fulfill",fulfillRequest:"Fulfill Request",fulfillRequestNow:"Fulfill Request Now",actions:"Actions",action:"Action",notes:"Notes",edit:"Edit",imageOrders:"Image Orders",labOrders:"Lab Orders",imagingType:"Imaging Type",result:"Result",results:"Results",visit:"Visit",requests:"Requests",completed:"Completed",id:"Id",on:"on",type:"Type",sex:"Sex",age:"Age",search:"Search",username:"Username",email:"Email",role:"Role",delete:"Delete",userCanAddNewValue:"User Can Add New Values",value:"Value",lookupType:"Lookup Type",importFile:"Import File",fileLoadSuccessful:"File To Load Successful",fileToLoad:"File Load",fileName:"File Name",startTime:"Start Time",startDate:"Start Date",endTime:"End Time",endDate:"End Date",docRead:"Docs Read",docWritten:"Docs Written",displayName:"Display Name",password:"Password",editUser:"Edit User",newUser:"New User",deleteUser:"Delete User",medication:"Medication",status:"Status",addNewOutpatientVisit:"--Add New Outpatient Visit--",prescription:"Prescription",prescriptionDate:"Prescription Date",billTo:"Bill To",pullFrom:"Pull From",fulfilled:"Fulfilled",deleteRequest:"Delete Request",location:"Location",provider:"Provider",with:"With",allDay:"All Day",physician:"Physician",assisting:"Assisting",anesthesia:"Anesthesia",procedures:"Procedures",number:"Number",billDate:"Bill Date",balanceDue:"Balance Due",amount:"Amount",datePaid:"Date Paid",creditTo:"Credit To",invoiceId:"Invoice ID",lineItems:"Line Items",discount:"Discount",excess:"Excess",price:"Price",total:"Total",expenseTo:"Expense To",grandTotal:"Grand Total",remarks:"Remarks",payments:"Payments",category:"Category",department:"Department",address:"Address",country:"Country"},messages:{noItemsFound:"No items found.",noHistoryAvailable:"No history available.",createNewRecord:"Create a new record?",createNewUser:"Create a new user?",noUsersFound:"No users found.",areYouSureDelete:"Are you sure you wish to delete the user {{user}}?",userHasBeenSaved:"The user has been saved.",userSaved:"User Saved",onBehalfOf:"on behalf of",newPatientHasToBeCreated:"A new patient needs to be created...Please wait..",noNotesAvailable:"No additional clinical notes are available for this visit.",sorry:"Sorry, something went wrong...",forAuthorizedPersons:"This report is for authorized persons only.",requiredFieldsCorrectErrors:"Please fill in required fields (marked with *) and correct the errors before saving.",saveActionException:"An error occurred while attempting to save: {{message}}",reportError:"An error was encountered while generating the requested report. Please let your system administrator know that you have encountered an error."},alerts:{pleaseWait:"Please Wait",warningExclamation:"Warning!!!!",errorExclamation:"Error!!!!",reportError:"Error Generating Report"},headings:{chargedItems:"Charged Items"},buttons:{addItem:"Add Item",complete:"Complete",cancel:"Cancel",close:"Close",returnButton:"Return",barcode:"Barcode",add:"Add",update:"Update",ok:"Ok",fulfill:"Fulfill",remove:"Remove",delete:"Delete",newUser:"New User",addValue:"Add Value",newNote:"New Note",import:"Import",loadFile:"Load File",newRequest:"New Request",allRequests:"All Requests",dispense:"Dispense",newItem:"+ new item",newRequestPlus:"+ new request",addVisit:"Add Visit",search:"Search",edit:"Edit",addLineItem:"Add Line Item",showFewer:"Show Fewer",showAll:"Show All"},login:{messages:{signIn:"please sign in",error:"Username or password is incorrect."},labels:{password:"Password",username:"Username",signIn:"Sign in"}},loading:{progressBar:{progress:"{{progressBarValue}}% Complete"},messages:{0:"The top butterfly flight speed is 12 miles per hour. Some moths can fly 25 miles per hour!",1:"Owls are the only birds that can see the color blue.",2:"Cats have over 100 vocal sounds; dogs only have 10.",3:"Humans use a total of 72 different muscles in speech.",4:"More than 1,000 different languages are spoken on the continent of Africa.",5:"An erythrophobe is someone who blushes easily.",6:"The most common phobia in the world is odynophobia which is the fear of pain.",7:"Your body uses 300 muscles to balance itself when you are standing still.",8:"Certain frogs can be frozen solid then thawed, and continue living.",9:"Our eyes are always the same size from birth, but our nose and ears never stop growing.",10:"Your tongue is the only muscle in your body that is attached at only one end.",11:"Camels have three eyelids to protect themselves from blowing sand."}},inventory:{edit:{cost:"Cost Per Unit:",delivered:"Delievered To:",location:"Location Adjusted:",prescription:"Prescription For:",pulled:"Pulled From:",quantity:"Quantity at Completion:",reason:"Reason:",returned:"Returned from Patient:",transferredFrom:"Transferred From:",transferredTo:"Transferred To:"},labels:{action:"Action",add:"Add",adjust:"Adjust",adjustmentDate:"Adjustment Date",adjustmentFor:"Adjustment For",adjustmentType:"Adjustment Type",aisle:"Aisle",aisleLocation:"Aisle Location",allInventory:"All Inventory",availableQuantity:"{{quantity}} available",billTo:"Bill To",consumePurchases:"Consume Purchases",consumptionRate:"Consumption Rate",cost:"Cost",costPerUnit:"Cost per Unit",crossReference:"Cross Reference",currentQuantity:"Current Quantity",dateCompleted:"Date Completed",dateEffective:"Effective Date",dateEnd:"End Date",dateStart:"Start Date",dateReceived:"Date Received",dateTransferred:"Date Transferred",daysLeft:"Days Left",deliveryAisle:"Delivery Aisle",deliveryLocation:"Delivery Location",distributionUnit:"Distribution Unit",deleteItem:"Delete Item",details:"Details",editItem:"Edit Item",expense:"Expense To",expirationDate:"Expiration Date",fulfillRequest:"Fulfill Request",fulfillRequestNow:"Fulfill Request Now",gift:"Gift in Kind",giftUsage:"Gift in Kind Usage",giftInKindNo:"N",giftInKindYes:"Y",inventoryConsumed:"Inventory Consumed",inventoryItem:"Inventory Item",inventoryObsolence:"Inventory Obsolence",invoiceItems:"Invoice Items",invoiceLineItem:"Invoice Line Item",invoiceNumber:"Invoice Number",item:"Item",items:"Items",itemNumber:"Item Number",location:"Location",locations:"Locations",name:"Name",markAsConsumed:"Mark as Consumed",newItem:"New Item",allItems:"All Items",originalQuantity:"Original Quantity",print:"Print",printBarcode:"Print Barcode",printer:"Printer",pullFrom:"Pull From",purchases:"Purchases",purchaseCost:"Purchase Cost",purchaseInfo:"Purchase Information",quantity:"Quantity ({{unit}})",quantityAvailable:"Quantity Available",quantityOnHand:"Quantity on Hand",quantityRequested:"Quantity Requested",rank:"Rank",reason:"Reason",remove:"Remove",reorderPoint:"Reorder Point",requestedItems:"Requested Items",salePricePerUnit:"Sale Price per Unit",save:"Save",serialNumber:"Serial/Lot Number",total:"Total",totalCost:"Total Cost",totalReceived:"Total Received: {{total}}",transaction:"Transaction",transactions:"Transactions",transfer:"Transfer",transferFrom:"Transfer From",transferTo:"Transfer To Location",transferToAisle:"Transfer to Aisle Location",unit:"Unit",unitCost:"Unit Cost",vendor:"Vendor",vendorItemNumber:"Vendor Item Number",xref:"XRef"},messages:{adjust:"Please adjust the quantities on the appropriate location(s) to account for the difference of {{difference}}.",createRequest:"Create a new request?",delete:"Are you sure you wish to delete {{name}}?",itemNotFound:"The inventory item {{item}} could not be found.
If you would like to create a new inventory item, fill in the information below.
Otherwise, press the Cancel button to return.",loading:"Loading transactions ...",purchaseSaved:"The inventory purchases have been successfully saved.",noRequests:"No requests found.",noItems:"No items found.",quantity:"The total quantity of ({{quantity}}) does not match the total quantity in the locations ({{locationQuantity}}).",removeItem:"Are you sure you want to remove this item from this invoice?",removeItemRequest:"Are you sure you want to remove this item from this request?",requestFulfilled:"The inventory request has been fulfilled.",requestUpdated:"The inventory request has been updated.",warning:"Please fill in required fields (marked with *) and correct the errors before adding."},reports:{rows:{adjustments:"Adjustments",adjustmentsTotal:"Total Adjustments",balanceBegin:"Beginning Balance",balanceEnd:"Ending Balance",category:"Category",consumed:"Consumed",consumedGik:"GiK Consumed",consumedGikTotal:"Total GiK Consumed",consumedPuchases:"Purchases Consumed",consumedPurchasesTotal:"Total Purchases Consumed",consumedTotal:"Total Consumed",errInFinSum:"Error in _generateFinancialSummaryReport: ",errInFindPur:"Error in _findInventoryItemsByPurchase: ",errInFindReq:"Error in _findInventoryItemsByRequest: ",expensesFor:"Expenses For: ",noAccount:"(No Account)",subtotal:"Subtotal: ",subtotalFor:"Subtotal for {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total for {{var}}: ",totalPurchases:"Total Purchases",transfer1:"{{quantity}} from {{location}}",trasnfer2:"From: {{source}} To: {{target}}"},adjustment:"Detailed Adjustment",daysSupply:"Days Supply Left In Stock",expenseDetail:"Detailed Expenses",expenseSum:"Summary Expenses",expiration:"Expiration Date",export:"Export Report",fields:"Fields to Include",finance:"Finance Summary",generate:"Generate Report",invLocation:"Inventory By Location",invValuation:"Inventory Valuation",purchaseDetail:"Detailed Purchase",purchaseSum:"Summary Purchase",reportType:"Report Type",stockTransferDetail:"Detailed Stock Transfer",stockTransferSum:"Summary Stock Transfer",stockUsageDetail:"Detailed Stock Usage",stockUsageSum:"Summary Stock Usage",titleSingleDate:"{{name}} Report {{date}}",titleDateRange:"{{name}} Report {{startDate}} - {{endDate}}"},titles:{addPurchase:"Add Purchase",addRequest:"New Request",adjustment:"Adjustment",editPurchase:"Edit Purchase",editRequest:"Edit Request",inventoryItem:"New Inventory Item",inventoryReport:"Inventory Report",purchaseSaved:"Inventory Purchases Saved",quickAddTitle:"New Inventory Item",removeItem:"Remove Item",requestFulfilled:"Request Fulfilled",requestUpdated:"Request Updated",transfer:"Transfer Items",warning:"Warning!!!!!"}},imaging:{pageTitle:"Imaging Requests",sectionTitle:"Imaging",buttons:{newButton:"+ new imaging"},labels:{radiologist:"Radiologist",addNewVisit:"--Add New Visit--"},messages:{delete:"Are you sure you wish to delete this imaging request?",noCompleted:"No completed items found."},titles:{completedImaging:"Completed Imaging",editTitle:"Edit Imaging Request",newTitle:"New Imaging Request"},alerts:{completedTitle:"Imaging Request Completed",completedMessage:"The imaging request has been completed.",savedTitle:"Imaging Request Saved",savedMessage:"The imaging request has been saved."}},medication:{pageTitle:"Medication Requests",sectionTitle:"Medication",returnMedication:"Return Medication",buttons:{dispenseMedication:"dispense medication",newButton:"+ new request",returnMedication:"return medication"},titles:{completedMedication:"Completed Medication",editMedicationRequest:"Edit Medication Request",newMedicationRequest:"New Medication Request"},messages:{createNew:"Create a new medication request?",confirmDeletion:"Are you sure you wish to delete this medication request?"},labels:{refills:"Refills",quantityRequested:"Quantity Requested",quantityDispensed:"Quantity Dispensed",quantityDistributed:"Quantity Distributed",quantityToReturn:"Quantity To Return",returnLocation:"Return Location",returnAisle:"Return Aisle",returnReason:"Return Reason/Notes",adjustmentDate:"Adjustment Date",creditToAccount:"Credit To Account"},alerts:{returnedTitle:"Medication Returned",returnedMessage:"The medication has been marked as returned.",savedTitle:"Medication Request Saved",savedMessage:"The medication record has been saved.",fulfilledTitle:"Medication Request Fulfilled"}},appointments:{currentScreenTitle:"Appointment List",editTitle:"Edit Appointment",newTitle:"New Appointment",sectionTitle:"Appointments",thisWeek:"Appointments This Week",missed:"Missed Appointments",searchTitle:"Search Appointments",todayTitle:"Today's Appointments",messages:{deleteAppointmentMessage:"Are you sure you wish to delete this appointment?",endTimeLaterThanStart:"Please select an end time later than the start time."},buttons:{newButton:"+ new appointment"},labels:{selectedStartingDate:"Show Appointments On Or After"}},vitals:{messages:{delete:"Are you sure you wish to delete these vitals?"},labels:{dateRecorded:"Date Recorded",temperature:"Temperature",weight:"Weight",height:"Height",sbp:"SBP",dbp:"DBP",heartRate:"Heart Rate",respiratoryRate:"Respiratory Rate"}},visits:{titles:{additionalDiagnoses:"Additional Diagnoses",checkedIn:"Patient Checked In",checkOut:"Patient Check Out",checkedOut:"Patient Checked Out",discharged:"Patient Discharged",editVisit:"Edit Visit",newVisit:"New Visit",patientCheckIn:"Patient Check In",visitSaved:"Visit Saved"},messages:{delete:"Are you sure you wish to delete this visit?",checkOut:"Are you sure you wish to check out {{patientName}}?",checkedOut:"{{patientName}} has been checked out.",discharged:"{{patientName}} has been discharged.",patientCheckedIn:"{{patientName}} has been checked in.",patientCreatedAndCheckedIn:"{{patientName}} has been created and checked in.",visitAndPatientSaved:"The visit and patient records have been saved.",visitSaved:"The visit record has been saved."},buttons:{newProcedure:"New Procedure",newAppointment:"New Appointment",addDiagnosis:"Add Diagnosis",newVitals:"New Vitals",checkIn:"Check In",checkOut:"Check Out",discharge:"Discharge"},labels:{diagnosis:"Diagnosis",procedure:"Procedure",procedureDate:"Procedure Date",authoredBy:"Authored By",visitInformation:"Visit Information",examiner:"Examiner",status:"Visit Status",finalDiagnosis:"Final/Billing Diagnosis",visitDate:"Visit Date",visitType:"Visit Type",patientToCheckIn:"Patient To Check In",checkInTime:"Check In",checkOutTime:"Check Out",appointment:"Appointment",haveAppointment:"Y",noAppointment:"N",ordersDone:"Orders Done",haveDoneOrders:"Y",ordersNotDone:"N",reasonForVisit:"Reason For Visit",statusAdmitted:"Admitted",statusDischarged:"Discharged",statusCheckedIn:"Checked In",statusCheckedOut:"Checked Out",createNewPatient:"Create New Patient"},navigation:{charges:"Charges",notes:"Notes",orders:"Orders",procedures:"Procedures",vitals:"Vitals"}},labs:{sectionTitle:"Labs",requestsTitle:"Lab Requests",editTitle:"Edit Lab Request",newTitle:"New Lab Request",deleteTitle:"Delete Request",completedTitle:"Completed Labs",labels:{labType:"Lab Type",addNewVisit:"--Add New Visit--"},messages:{noItemsFound:"No labs found.",createNewRecord:"Create a new record?",confirmDeletion:"Are you sure you wish to delete this lab request?",noCompleted:"No completed items found."},buttons:{newButton:"+ new lab"},alerts:{requestCompletedTitle:"Lab Request Completed",requestCompletedMessage:"The lab request has been completed.",requestSavedTitle:"Lab Request Saved",requestSavedMessage:"The lab request has been saved."}},patients:{navigation:{photos:"Photos",general:"General",history:"History",appointments:"Appointments",visits:"Visits",medication:"Medication",imaging:"Imaging",labs:"Labs",socialWork:"Social Work"},titles:{addContact:"Add Contact",admittedPatients:"Admitted Patients",expenses:"Expenses",additionalContacts:"Additional Contacts",familyInformation:"Family Information",delete:"Delete Patient",new:"New Patient",edit:"Edit Patient",patient:"Patient Report",patientListing:"Patient Listing",patientReport:"Patient Report",addPhoto:"Add Photo",editPhoto:"Edit Photo",socialWork:"Expense",familyInfo:"Family Info",deleteFamilyMember:"Delete Family Member",deleteExpense:"Delete Expense",deletePhoto:"Delete Photo",deleteContact:"Delete Contact",savedPatient:"Patient Saved",todaysOutpatients:"Today's Outpatients",admissionsDetail:"Admissions Detail",admissionsSummary:"Admissions Summary",diagnosticTesting:"Diagnostic Testing",dischargesDetail:"Discharges Detail",dischargesSummary:"Discharges Summary",proceduresDetail:"Procedures Detail",proceduresSummary:"Procedures Summary",patientStatus:"Patient Status",totalPatientDays:"Total Patient Days",totalPatientDaysDetailed:"Total Patient Days (Detailed)",visit:"Visit",deletePatientRecord:"Delete Patient Record",outpatientsForDate:"Outpatients for {{visitDate}}"},messages:{areYouSureDelete:"Are you sure you want to delete this {{object}}?",deletePatient:"Are you sure you wish to delete {{firstName}} {{lastName}}?",noPatientsFound:"No patients found.",savedPatient:"The patient record for {{displayName}} has been saved.",notFoundQuickAdd:"The patient {{patientFullName}} could not be found. If you would like to create a new patient, fill in the information below. Otherwise press the Cancel button to return.",createNewPatient:"Create a new patient record?",deletingPatient:"Deleting patient and all associated records"},buttons:{addExpense:"Add Expense",addContact:"Add Contact",addOperativePlan:"Add Operative Plan",editOperativePlan:"Current Operative Plan",newLab:"New Lab",newVisit:"New Visit",newMedication:"New Medication",newImaging:"New Imaging",addFamilyMember:"Add Family Member",newPhoto:"New Photo",newAppointment:"New Appointment",backToPatients:"Back to Patient List",newPatient:"+ new patient",patientCheckIn:"Patient Check In"},labels:{primaryDiagnosis:"Primary Diagnoses",secondaryDiagnosis:"Secondary Diagnoses",monthlyCost:"Monthly Cost",totalMontlyExpense:"Total Monthly Expenses",patientType:"Patient Type",admissionDate:"Admission Date",patientDays:"Patient Days",dischargeDate:"Discharge Date",admit:"Admit",relationships:"Relationships",phone:"Phone",email:"Email",firstName:"First Name",middleName:"Middle Name",lastName:"Last Name",sex:"Sex",dob:"DOB",dateOfBirth:"Date Of Birth",placeOfBirth:"Place Of Birth",sources:"Sources",cost:"Cost",civilStatus:"Civil Status",relationship:"Relationship To Patient",education:"Education",occupation:"Occupation",income:"Income",insurance:"Insurance",dateProcessed:"Date Processed",status:"Patient Status",externalPatientId:"External Patient Id",bloodType:"Blood Type",clinic:"Clinic Site",referredBy:"Referred By",referredDate:"Referred Date",religion:"Religion",parent:"Parent/Guardian",contacts:"Contacts",sexNotEntered:"Sex Not Entered",operativePlan:"Operative Plan"},notes:{newNote:"New Note for",updateNote:"Updating Note from",onBehalfOfLabel:"On Behalf Of",onBehalfOfCopy:"on behalf of",pleaseSelectAVisit:"Please select a visit"}},billing:{alerts:{noInvoiceFound:"No invoices found",deleteItem:"Are you sure you wish to delete {{item}}?",noPricingItems:"No pricing items found.",noPricingProfiles:"No pricing profiles found."},buttons:{createInvoice:"Create an invoice?",addOverride:"Add Override"},labels:{externalInvoiceNumber:"External Invoice #",paymentProfile:"Payment Profile",actualCharges:"Actual Charges",insurance:"National Insurance",hmoCom:"HMO/COM",paymentsDeposits:"Payments/Deposits",pricingPanelOverrides:"Pricing profile overrides",pricingProfile:"Pricing Profile",discountAmount:"Discount Amount",discountPercentage:"Discount Percentage"}},print:{invoice:{labels:{patientName:"NAME OF PATIENT:",patientId:"PATIENT #:",patientAge:"AGE:",patientAddress:"ADDRESS:",dateAdmitted:"ADMITTED:",dateDischarged:"DISCHARGE:",dischargeNotes:"Discharge Notes:",remarks:"Remarks:",billedBy:"Billed by:",billedDate:"Bill Date:",spacer:"__________________________________________"},messages:{whereConducted:"were deducted during my confinement"},titles:{patientMember:"Patient-Member",relContact:"Relationship/Contact no.",patients:"PATIENT'S",billingStatement:"BILLING STATEMENT"}}},procedures:{titles:{addChargeItem:"Add Charge Item",deleteChargeItem:"Delete Charge Item",editChargeItem:"Edit Charge Item",medicationUsed:"Medication Used",deleteMedicationUsed:"Delete Medication Used",addMedicationUsed:"Add Medication Used",editMedicationUsed:"Edit Medication Used",edit:"Edit Procedure",saved:"Procedure Saved",new:"New Procedure"},labels:{medicationUsed:"Medication Used"},messages:{deleteMedication:"Are you sure you want to delete this medication?",delete:"Are you sure you wish to delete this procedure?",saved:"The procedure record has been saved."},buttons:{addMedication:"Add Medication"}},components:{chargesByTypeTab:{charges:"charges"},customFormManager:{buttons:{addForm:"Add Form"}},sortableColumn:{labels:{selectAll:"(Select All)"}},dateTimePicker:{amHour:"{{hour}} AM",midnight:"Midnight",noon:"Noon",pmHour:"{{hour}} PM"},takePhoto:{how:"How Do You Want To Add A Photo?",takePhoto:"Take photo",uploadPhoto:"Upload Photo",uploadFile:"Upload File",camera:"Camera",photo:"photo",preview:"preview"},quantityConv:{unit:"Unit",conversion:"What does 1 {{name}} contain?"},quantityCalc:{result:"{{targetUnit}} total: {{calculated}}"},patientOrders:{buttons:{newImaging:"New Imaging",newLab:"New Lab",newMedication:"New Medication"},labels:{imagingOrderType:"Imaging",labOrderType:"Lab",medicationOrderType:"Medication",orderType:"Order Type"}},priceList:{charges:"{{pricingType}} charges"}},customForms:{buttons:{addForm:"Add Form"},labels:{formToAdd:"Form To Add"},titles:{addCustomForm:"Add Custom Form"}},diagnosis:{labels:{activeDiagnosis:"Active Diagnosis",date:"Date",diagnosis:"Diagnosis",secondaryDiagnosis:"Secondary Diagnosis"},titles:{addDiagnosis:"Add Diagnosis",editDiagnosis:"Edit Diagnosis"}},allergies:{buttons:{addAllergy:"Add Allergy"},titles:{addAllergy:"Add Allergy",editAllergy:"Edit Allergy"},labels:{allergyName:"Name",patientAllergy:"Patient Allergies"}},operativePlan:{buttons:{addProcedure:"Add Procedure",completePlan:"Complete Plan"},labels:{additionalNotes:"Additional Notes",admissionInstructions:"Instructions Upon Admission",caseComplexity:"Case Complexity",completedStatus:"Completed",droppedStatus:"Dropped",operationDescription:"Operation Description",plannedStatus:"Planned",procedure:"Procedure",status:"Status",surgeon:"Surgeon",surgeryDate:"Surgery Date"},messages:{planSaved:"The operative plan has been saved."},titles:{editTitle:"Edit Operative Plan",newTitle:"New Operative Plan",planSaved:"Plan Saved",procedures:"Procedures"}}}}),define("hospitalrun/locales/es-CO/translations",["exports"],function(e){e.default={dashboard:{title:"Que deseas hacer?"},navigation:{imaging:"Radiografia",inventory:"Inventario",patients:"Pacientes",appointments:"Citas",medication:"Recetas medicas",labs:"Laboratorio",billing:"Facturas",administration:"Administracion",subnav:{requests:"Pedidos",items:"Items",completed:"Completado",newRequest:"New pedido",inventoryReceived:"Inventario recibido",reports:"Reportes",patientListing:"Lista de pacientes",newPatient:"Nuevo paciente",thisWeek:"Esta semana",today:"Hoy",search:"Buscar",addAppointment:"Nueva cita",dispense:"Dispense",returnMedication:"Devolver medicamento",invoices:"Facturas",newInvoice:"Nueva factura",prices:"Precios",priceProfiles:"Perfil de precios",lookupLists:"Lista de busuedas",addressFields:"Campos de dirección",loadDb:"Cargar base de datos",users:"Usuarios",newUser:"Nuevo usuario",userRoles:"Roles"},actions:{logout:"Salir",login:"Ingresar"},about:"Información de HospitalRun" +},user:{plusNewUser:"+ nuevo usuario",usersPageTile:"Listado de usuarios"},admin:{addressOptions:"Opciones de direcciones",lookupLists:"Lista de busqueda",loadDb:"Cargar Base de datos",userRoles:"Roles",users:"Usuarios",address:{address1Label:"Texto direccion 1",address2Label:"Texto direccion 2",address3Label:"Texto direccion 3",address4Label:"Texto direccion 4",include1Label:"Incluir 1",include2Label:"Incluir 2",include3Label:"Incluir 3",include4Label:"Incluir 4",titles:{optionsSaved:"Opciones guardadas"},messages:{addressSaved:"las opciones de dirección han sido guardadas"},newTitle:"Opciones de dirección",editTitle:"Opciones de dirección",addressLabel:"Direcciones"},loaddb:{progressMessage:"Por favor espere mientras la base de datos es cargada.",progressTitle:"Cargando ase de datos",displayAlertTitle:"Seleccione un archivo para cargar",displayAlertMessage:"Por favor seleccione un archivo para ser cargado.",errorDisplayAlertTitle:"Error cargando",errorDisplayAlertMessage:"La base de datos no fue cargada el error fue: {{error}}",editTitle:"Cargar bd"},lookup:{alertImportListTitle:"Seleccione un archivo para importar",alertImportListMessage:"Por favor seleccione un archivo para importar.",alertImportListSaveTitle:"Lista importada",alertImportListSaveMessage:"Lista de busqueda importada.",alertImportListUpdateTitle:"Lista salvada",alertImportListUpdateMessage:"La lista de busqueda ha sido salvada.",pageTitle:"Listas de busqueda",edit:{template:{addTitle:"Adicionar valor",editTitle:"Editar valor",updateButtonTextAdd:"Adicionar",updateButtonTextUpdate:"Actualizar",labelTitle:"Valor"}},anesthesiaTypes:"Tipos de anestesia",anesthesiologists:"Anestesiologo",billingCategories:"Categorias de facturacion",clinicList:"Ubicacion de las clinicas",countryList:"Paises",diagnosisList:"Diagnosticos",cptCodeList:"Codigos CPT",expenseAccountList:"Cuentas de gastos",aisleLocationList:"Ubicacion de inventario de pasillo",warehouseList:"Ubicacciones de inventarios",inventoryTypes:"Tipos de inventarios",imagingPricingTypes:"Tipos de precios de radiografias",labPricingTypes:"Precios de laboratorio",patientStatusList:"Lista de estado de pacientes",physicianList:"Medicos",procedureList:"Procedimientos",procedureLocations:"Ubicacion de los procedimientos",procedurePricingTypes:"Tipos de procedimientos y precios",radiologists:"Radiologo",unitTypes:"Tipos de unidad",vendorList:"Proveedor",visitLocationList:"Lugares de visista",visitTypes:"Tipos de visita",wardPricingTypes:"Tipos de las tarifas"},roles:{capability:{admin:"Administracion",loadDb:"Cargar base de datos",updateConfig:"Actualizar configuracion",appointments:"Citas",addAppointment:"Adicionar cita",billing:"Facturacion",addCharge:"Adicionar cargo (valor)",addPricing:"Adicionar precio",addPricingProfile:"Adicionar perfil de precios",addInvoice:"Adicionar factura",addPayment:"Adicionar pago",deleteInvoice:"Eliminar factura",deletePricing:"Eliminar precio",deletePricingProfile:"Eliminar perfil de precio",editInvoice:"Editar factura",invoices:"Facturas",overrideInvoice:"Sobreescribir factura",pricing:"Precio",patients:"Pacientes",addDiagnosis:"Adicionar diagnostico",addPhoto:"Adicionar foto",addPatient:"Adicionar paciente",addVisit:"Adicionar visita",addVitals:"Adicionar partes vitales",admitPatient:"Admitir paciente",deletePhoto:"Eliminar foto",deletePatient:"Eliminar paciente",deleteAppointment:"Eliminar cita",deleteDiagnosis:"Eliminar diagnostico",deleteProcedure:"Eliminar procedimiento",deleteSocialwork:"Eliminar trabajo social",deleteVitals:"Eliminar organo vital",deleteVisit:"Eliminar visita",dischargePatient:"Descartar paciente",patientReports:"Reportes por paciente",visits:"Visitas",medication:"Medicación",addMedication:"Adicionar medicación",deleteMedication:"Eliminar medicación",fulfillMedication:"Cumplir la medicación",labs:"Laboratorios",addLab:"Adicionar laboratorio",completeLab:"Completar laboratorio",deleteLab:"Eliminar laboratorio",imaging:"Radiografia",addImaging:"Adicionar radiografia",completeImaging:"Completar radiografia",deleteImaging:"Eliminar radiografia",inventory:"Inventario",addInventoryRequest:"Pedido de inventario",addInventoryItem:"Adicionar elemento al inventario",addInventoryPurchase:"Adicionar compra",adjustInventoryLocation:"Ajustar lugar elemento en el inventario",deleteInventoryItem:"Eliminar elemento del inventario",deleteInventoryPurchase:"Eliminar compra del inventario",fulfillInventory:"Cumplimiento de inventario",defineUserRoles:"Roles de usuario"},messages:{roleSaved:"El {{roleName}} rol ha sido salvado."},titles:{roleSaved:"Role salvado"}}},labels:{cptcode:"Codigo CPT",loading:"Cargando",name:"Nombre",patient:"Paciente",quantity:"Cantidada",requestedOn:"Pedido On",date:"Fecha",dateOfBirth:"Fecha de nacimiento",dateOfBirthShort:"FDN",dateRequested:"Fecha de pedido",dateCompleted:"Fecha completada",description:"Descripción",requestedBy:"Pedido por|",fulfill:"Cumplomiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de cumplimiento ahora",actions:"Acciones",action:"Accion",notes:"Notas",edit:"Editar",imageOrders:"Ordenes de radiografias",labOrders:"Ordenes de laboratorio",imagingType:"Tipo de radiografia",result:"Resultado",results:"Resultados",visit:"Visita",requests:"Pedido",completed:"Completado",id:"Id",on:"on",type:"Tipo",sex:"Genero",age:"Edad",username:"Nombre de usuario",email:"Email",role:"Rol",delete:"Eliminar",userCanAddNewValue:"Los usuarios pueden agregar nuevos valores",value:"Valor",lookupType:"Tipo de busqueda",importFile:"Importar archivo",fileLoadSuccessful:"Archivo cargado exitosamente",fileToLoad:"Archivo cargado",startTime:"Hora de inicio",startDate:"Fecha de inicio",endTime:"Hora de finalización",endDate:"Fecha final",docRead:"Leer documento",docWritten:"Documento escrito",displayName:"Nombre para mostrar",password:"Contraseña",editUser:"Editar usuario",newUser:"Nuevo usuario",deleteUser:"Eliminar usuario",medication:"Medicación",status:"Estado",addNewOutpatientVisit:"--Nueva visita a paciente externo--",prescription:"Receta medica",prescriptionDate:"Fecha de la receta medica",billTo:"Facturar a",pullFrom:"Traer de",fulfilled:"Cumplido",deleteRequest:"Eliminar pedido",location:"Ubicacion",provider:"Proveedor",with:"con",allDay:"Todo el dia",physician:"Médico",assisting:"Asistencia",anesthesia:"Anestesia",procedures:"Procedimiento"},messages:{noItemsFound:"Elementos no encontrados.",noHistoryAvailable:"Historia no disponible.",createNewRecord:"Crear un nuevo registro?",createNewUser:"Crear un nuevo usuario?",noUsersFound:"Ningun usuario encontrado.",areYouSureDelete:"Estas seguro de eliminar este usuario {{user}}?",userHasBeenSaved:"El usuario ha sido salvado.",userSaved:"Usuario salvado",onBehalfOf:"a nombre de",newPatientHasToBeCreated:"Un nuevo paciente debe ser creado...Por favor espere..",noNotesAvailable:"No hay notas clínicas adicionales están disponibles para esta visita.",sorry:"Lo sentimos, un error ha ocurrido...",forAuthorizedPersons:"Este informe es sólo para personas autorizadas."},alerts:{pleaseWait:"Por favor espere"},buttons:{complete:"Completado",cancel:"Cancelar",close:"Cerrar",returnButton:"Regresar",barcode:"Codigo de barras",add:"Adicionar",update:"Actualizar",ok:"Ok",fulfill:"Cumplimiento",remove:"Remover",delete:"Eliminar",newUser:"Nuevo usuario",addValue:"Adicionar valor",newNote:"Nueva nota",import:"Importar",loadFile:"Cargar archivo",newRequest:"Nueva solicitud",allRequests:"Todas las solicitudes",dispense:"Repartir",newItem:"+ nuevo elemento",newRequestPlus:"+ nuevo pedido",addVisit:"Adicionar visita",search:"Buscar"},login:{messages:{signIn:"por favor ingrese",error:"Nombre de usuario o clave incorrectos."},labels:{password:"Clave",username:"Nombre de usuario",signIn:"Ingresar"}},inventory:{edit:{cost:"Costo por unidad:",delivered:"Enviado A:",location:"Cambio de ubicación:",prescription:"Recetado por:",pulled:"Pulled From:",quantity:"Quantity at Completion:",reason:"Razón:",returned:"Regresado al paciente:",transferredFrom:"Transferido a:",transferredTo:"Transferido a:"},labels:{action:"Acción",add:"Adicionar",adjust:"Adjustar",adjustmentDate:"Fecha de ajuste",adjustmentFor:"Ajustado para",adjustmentType:"Tipo de ajuste",aisle:"Pasillo",aisleLocation:"Ubicación pasillo",allInventory:"Todo el inventario",billTo:"Facturao a",consumePurchases:"Consume Purchases",consumptionRate:"Tasa de consumo",cost:"Costo",costPerUnit:"Costo por Unidad",crossReference:"Referencia cruzada",currentQuantity:"Cantidad actual",dateCompleted:"Fecha completado",dateEffective:"Gecha efectiva",dateEnd:"Fecha final",dateStart:"Fecha inicial",dateReceived:"Fecha recibido",dateTransferred:"Fecha transferencia",daysLeft:"Dias restantes",deliveryAisle:"Enviado a pasillo",deliveryLocation:"Ubicación del envio",distributionUnit:"Unidad de distribución",deleteItem:"Eliminar elemento",details:"Detalles",editItem:"Editar elemento",expense:"Gastos a",expirationDate:"Fecha de vencimiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de incumplimiento para hoy",gift:"Regalo en especie",giftUsage:"Uso del regalo en especie",giftInKindNo:"N",giftInKindYes:"Y",inventoryConsumed:"Inventario consumido",inventoryItem:"Elemento del inventario",inventoryObsolence:"Obsolescencia de inventario",invoiceItems:"Articulos de factura",invoiceLineItem:"Elemento de la factura linea",invoiceNumber:"Factura numero",item:"Elemento",items:"Elementos",itemNumber:"Numero de elemento",location:"Ubicación",locations:"Ubicaciones",name:"Nombre",markAsConsumed:"Marcar como consumido",newItem:"Nuevo elemento",originalQuantity:"Cantidad original",print:"Imprimir",printBarcode:"Imprimir codigo de barras",printer:"Impresora",pullFrom:"Traido de",purchases:"Compras",purchaseCost:"Costo de compra",purchaseInfo:"Informacion de la compra",quantity:"Cantidad ({{unit}})",quantityAvailable:"Cantidad disponible",quantityOnHand:"Cantidad a la mano",quantityRequested:"Cantidad pedida",rank:"Ranking",reason:"Razón",remove:"Remover",reorderPoint:"Reordenar punto",requestedItems:"Elementos solicitados",salePricePerUnit:"Costo de venta por unidad",save:"Guardar",serialNumber:"Serial/Numero de lote",total:"Total",totalCost:"Costo total",totalReceived:"Total Recivido: {{total}}",transaction:"Transaccion",transactions:"Transacciones",transfer:"Translados",transferFrom:"Translado desde",transferTo:"Translado a ubicación",transferToAisle:"Translado a pasillo",unit:"Unidad",unitCost:"Unidad Costo",vendor:"Proveedor",vendorItemNumber:"Proveedor numero de elemento",xref:"XRef"},messages:{adjust:"Por favor ajust las cantidades en la ubicación adecuada(s) la diferencia de la cuenta es {{difference}}.",createRequest:"Crear un nuevo pedido?",delete:"Estas seguro de eliminar {{name}}?",itemNotFound:"El elemento del inventario {{item}} no se pudo encontrar.
Si desea crear un nuevo elemento, Ingrese la información abajo.
De lo contrario opria cancelar para volver.",loading:"Cargando transacciones ...",purchaseSaved:"La compra de inventario ha sido salvada.",noRequests:"No se encontraron pedidos.",noItems:"No se encontraron elementos.",quantity:"La cantidad total ({{quantity}}) no encaja con la cantidad total en las ubicaciones ({{locationQuantity}}).",removeItem:"Esta seguro de eliminar este elemento de la factura?",removeItemRequest:"Seguro que quiere eliminar este elemento del pedido?",requestFulfilled:"El pedido de inventario ha sido procesado.",requestUpdated:"El pedido de inventario ha sido actualizado.",warning:"Valide los campos requeridos (marcados con *) corrija los errores antes de adicionar."},reports:{rows:{adjustments:"Ajustes",adjustmentsTotal:"Ajustes totales",balanceBegin:"Balance inicial",balanceEnd:"Balance Final",category:"Categoria",consumed:"Consumado",consumedGik:"GiK Consumido",consumedGikTotal:"Total GiK Consumido",consumedPuchases:"Total de lo comprado consumido",consumedPurchasesTotal:"Total de lo comprado consumido",consumedTotal:"Total consumido",errInFinSum:"Error en _generateFinancialSummaryReport: ",errInFindPur:"Error en _findInventoryItemsByPurchase: ",errInFindReq:"Error en _findInventoryItemsByRequest: ",expensesFor:"Gatos para: ",noAccount:"(No Cuenta)",subtotal:"Subtotal: ",subtotalFor:"Subtotal para {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total para {{var}}: ",totalPurchases:"Compras Totales",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} A: {{target}}"},adjustment:"Ajuste detallado",daysSupply:"Dias de inventario restante",expenseDetail:"Gastos detallados",expenseSum:"Resumen de gastos",expiration:"Fecha de expiracion",export:"Exportar reporte",fields:"Campos a incluir",finance:"Resumen de finanzas",generate:"Generar reporte",invLocation:"Inventario por ubicacion",invValuation:"Inventario por valoracion",purchaseDetail:"Compras detalladas",purchaseSum:"Resumen de compras",reportType:"Tipo de reporte",stockTransferDetail:"Detalle de traslado de stock",stockTransferSum:"Resumen traslado de stock",stockUsageDetail:"Detalle de uso de stock",stockUsageSum:"Resumen uso de stock"},titles:{addPurchase:"Adicionar compra",addRequest:"Nuevo pedido",adjustment:"Ajuste",editPurchase:"Editar compra",editRequest:"Editar pedido",inventoryItem:"Nuevo elemento de inventario",inventoryReport:"Reporte de inventario",purchaseSaved:"Compras de inventario guardadas",quickAddTitle:"Nuevo elemento de inventario",removeItem:"Remover elemento",requestFulfilled:"Pedido cumplido",requestUpdated:"Pedido actualizado",transfer:"Trasladar elementos",warning:"Peligro!!!!!"}},imaging:{pageTitle:"Pedido de radriografia",sectionTitle:"Radiografias",buttons:{newButton:"+ new radiografia"},labels:{radiologist:"Radiologo",addNewVisit:"--Adicionar nueva visita--"},messages:{noCompleted:"No de items encontrados."},titles:{completedImaging:"Radiografia completada",editTitle:"Pedido de edicion de radiografia",newTitle:"Nuevo pedido de radiografia"},alerts:{completedTitle:"Pedido de radiografia completado",completedMessage:"El pedido de radiografia ha sido completado.",savedTitle:"Pedido de radiografia salvado",savedMessage:"El pedido de radiografia ha sido guardado."}},medication:{pageTitle:"Pedido de medicación",sectionTitle:"Medication",returnMedication:"Retorno de medicación",buttons:{dispenseMedication:"dispensar medicación",newButton:"+ nuevo pedido",returnMedication:"debolver medicacion"},titles:{completedMedication:"Medicacion completada",editMedicationRequest:"Editar pedido de medicacion",newMedicationRequest:"Nuevo pedido de medicacion"},messages:{createNew:"Crear un nuevo pedido de medicacion?",confirmDeletion:"Estas seguro de eliminar este pedido de medicación?"},labels:{refills:"Recargas",quantityRequested:"Cantidad solicitada",quantityDispensed:"Cantidad dispensada",quantityDistributed:"Cantidad distribuida",quantityToReturn:"Cantidad a devolver",returnLocation:"Retornar a ubicación",returnAisle:"Devolve a pasillo",returnReason:"Razon por la que se devuelve/Nota",adjustmentDate:"Fecha de ajuste",creditToAccount:"Credito a cuenta"},alerts:{returnedTitle:"Medicacion devuelta",returnedMessage:"La medicacion ha sido marcada para devolver.",savedTitle:"Pedido de medicacion guardado",savedMessage:"La elemento de medicación ha sido guardado.",fulfilledTitle:"Pedido de medicación cumplido"}},appointments:{currentScreenTitle:"Listado de citas",editTitle:"Editar cita",newTitle:"Nueva cita",sectionTitle:"Citas",thisWeek:"Citas esta semana",missed:"Citas perdidas",searchTitle:"Buscar citas",todayTitle:"Citas para hoy",messages:{deleteAppointmentMessage:"Esta seguro de eliminar esta cita?",endTimeLaterThanStart:"Seleccione una hora de finalizacion despues de la de inicio."},buttons:{newButton:"+ nueva cita"}},visits:{edit:{buttons:{newAppointment:"Nuevas citas",addDiagnosis:"Adicionar diagnostico",newProcedure:"Nuevo procedimiento",newLab:"New laboratorio",newMedication:"Nueva mediicación",newImaging:"Nueva radiografia"},labels:{diagnosis:"Diagnostico",procedure:"Procedimiento",authoredBy:"Escrito por",labs:"Laboratorios",imaging:"Radiografias",visitInformation:"Informacion de visita"}}},labs:{sectionTitle:"Laboratorios",requestsTitle:"Pedido de laboratorio",editTitle:"Editar pedido de laboratorio",newTitle:"Nuevo pedido de laboratorio",deleteTitle:"Eliminar pedido",completedTitle:"Completar laboratorio",labels:{labType:"Tipo de laboratorio",addNewVisit:"--Adicionar nueva visita--"},messages:{noItemsFound:"No boratorios encontrados.",createNewRecord:"Crear un registro?",confirmDeletion:"Esta seguro de eliminar esta solicitud de laboratorio?",noCompleted:"No elementos completados encontrados."},buttons:{newButton:"+ nuevo laboratorio"},alerts:{requestCompletedTitle:"Pedido de laboratorio competado",requestCompletedMessage:"El pedido de laboratorio ha sido completado.",requestSavedTitle:"Silicitud de laboratorio guardado",requestSavedMessage:"El pedido de laboratorio ha sido guardado."}},common:{actions:"Acciones"},patients:{notes:{onBehalfOfLabel:"A nombre de",onBehalfOfCopy:"a nombre de",pleaseSelectAVisit:"Por favor seleccione una visista",noteLabel:"Nota"}}}}),define("hospitalrun/locales/es/translations",["exports"],function(e){e.default={dashboard:{title:"Que deseas hacer?"},navigation:{imaging:"Radiografia",inventory:"Inventario",patients:"Pacientes",appointments:"Citas",medication:"Recetas medicas",labs:"Laboratorio",billing:"Facturas",administration:"Administracion",subnav:{requests:"Pedidos",items:"Items",completed:"Completado",newRequest:"New pedido",inventoryReceived:"Inventario recibido",reports:"Reportes",patientListing:"Lista de pacientes",newPatient:"Nuevo paciente",thisWeek:"Esta semana",today:"Hoy",search:"Buscar",addAppointment:"Nueva cita",dispense:"Dispense",returnMedication:"Devolver medicamento",invoices:"Facturas",newInvoice:"Nueva factura",prices:"Precios",priceProfiles:"Perfil de precios",lookupLists:"Lista de busuedas",addressFields:"Campos de dirección",loadDb:"Cargar base de datos",users:"Usuarios",newUser:"Nuevo usuario",userRoles:"Roles"},actions:{logout:"Salir",login:"Ingresar"},about:"Información de HospitalRun"},user:{plusNewUser:"+ nuevo usuario",usersPageTile:"Listado de usuarios"},admin:{addressOptions:"Opciones de direcciones",lookupLists:"Lista de busqueda",loadDb:"Cargar Base de datos",userRoles:"Roles",users:"Usuarios",address:{address1Label:"Texto direccion 1",address2Label:"Texto direccion 2",address3Label:"Texto direccion 3",address4Label:"Texto direccion 4",include1Label:"Incluir 1",include2Label:"Incluir 2",include3Label:"Incluir 3",include4Label:"Incluir 4",titles:{optionsSaved:"Opciones guardadas"},messages:{addressSaved:"las opciones de dirección han sido guardadas"},newTitle:"Opciones de dirección",editTitle:"Opciones de dirección",addressLabel:"Direcciones"},loaddb:{progressMessage:"Por favor espere mientras la base de datos es cargada.",progressTitle:"Cargando ase de datos",displayAlertTitle:"Seleccione un archivo para cargar",displayAlertMessage:"Por favor seleccione un archivo para ser cargado.",errorDisplayAlertTitle:"Error cargando",errorDisplayAlertMessage:"La base de datos no fue cargada el error fue: {{error}}",editTitle:"Cargar bd"},lookup:{alertImportListTitle:"Seleccione un archivo para importar",alertImportListMessage:"Por favor seleccione un archivo para importar.",alertImportListSaveTitle:"Lista importada",alertImportListSaveMessage:"Lista de busqueda importada.",alertImportListUpdateTitle:"Lista salvada",alertImportListUpdateMessage:"La lista de busqueda ha sido salvada.",pageTitle:"Listas de busqueda",edit:{template:{addTitle:"Adicionar valor",editTitle:"Editar valor",updateButtonTextAdd:"Adicionar",updateButtonTextUpdate:"Actualizar",labelTitle:"Valor"}},anesthesiaTypes:"Tipos de anestesia",anesthesiologists:"Anestesiologo",billingCategories:"Categorias de facturacion",clinicList:"Ubicacion de las clinicas",countryList:"Paises",diagnosisList:"Diagnosticos",cptCodeList:"Codigos CPT",expenseAccountList:"Cuentas de gastos",aisleLocationList:"Ubicacion de inventario de pasillo",warehouseList:"Ubicacciones de inventarios",inventoryTypes:"Tipos de inventarios",imagingPricingTypes:"Tipos de precios de radiografias",labPricingTypes:"Precios de laboratorio",patientStatusList:"Lista de estado de pacientes",physicianList:"Medicos",procedureList:"Procedimientos",procedureLocations:"Ubicacion de los procedimientos",procedurePricingTypes:"Tipos de procedimientos y precios",radiologists:"Radiologo",unitTypes:"Tipos de unidad",vendorList:"Proveedor",visitLocationList:"Lugares de visista",visitTypes:"Tipos de visita",wardPricingTypes:"Tipos de las tarifas"},roles:{capability:{admin:"Administracion",loadDb:"Cargar base de datos",updateConfig:"Actualizar configuracion",appointments:"Citas",addAppointment:"Adicionar cita",billing:"Facturacion",addCharge:"Adicionar cargo (valor)",addPricing:"Adicionar precio",addPricingProfile:"Adicionar perfil de precios",addInvoice:"Adicionar factura",addPayment:"Adicionar pago",deleteInvoice:"Eliminar factura",deletePricing:"Eliminar precio",deletePricingProfile:"Eliminar perfil de precio",editInvoice:"Editar factura",invoices:"Facturas",overrideInvoice:"Sobreescribir factura",pricing:"Precio",patients:"Pacientes",addDiagnosis:"Adicionar diagnostico",addPhoto:"Adicionar foto",addPatient:"Adicionar paciente",addVisit:"Adicionar visita",addVitals:"Adicionar partes vitales",admitPatient:"Admitir paciente",deletePhoto:"Eliminar foto",deletePatient:"Eliminar paciente",deleteAppointment:"Eliminar cita",deleteDiagnosis:"Eliminar diagnostico",deleteProcedure:"Eliminar procedimiento",deleteSocialwork:"Eliminar trabajo social",deleteVitals:"Eliminar organo vital",deleteVisit:"Eliminar visita",dischargePatient:"Descartar paciente",patientReports:"Reportes por paciente",visits:"Visitas",medication:"Medicación",addMedication:"Adicionar medicación",deleteMedication:"Eliminar medicación",fulfillMedication:"Cumplir la medicación",labs:"Laboratorios",addLab:"Adicionar laboratorio",completeLab:"Completar laboratorio",deleteLab:"Eliminar laboratorio",imaging:"Radiografia",addImaging:"Adicionar radiografia",completeImaging:"Completar radiografia",deleteImaging:"Eliminar radiografia",inventory:"Inventario",addInventoryRequest:"Pedido de inventario",addInventoryItem:"Adicionar elemento al inventario",addInventoryPurchase:"Adicionar compra",adjustInventoryLocation:"Ajustar lugar elemento en el inventario",deleteInventoryItem:"Eliminar elemento del inventario",deleteInventoryPurchase:"Eliminar compra del inventario",fulfillInventory:"Cumplimiento de inventario",defineUserRoles:"Roles de usuario"},messages:{roleSaved:"El {{roleName}} rol ha sido salvado."},titles:{roleSaved:"Role salvado"}}},labels:{cptcode:"Codigo CPT",loading:"Cargando",name:"Nombre",patient:"Paciente",quantity:"Cantidada",requestedOn:"Pedido On",date:"Fecha",dateOfBirth:"Fecha de nacimiento",dateOfBirthShort:"FDN",dateRequested:"Fecha de pedido",dateCompleted:"Fecha completada",description:"Descripción",requestedBy:"Pedido por|",fulfill:"Cumplomiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de cumplimiento ahora",actions:"Acciones",action:"Accion",notes:"Notas",edit:"Editar",imageOrders:"Ordenes de radiografias",labOrders:"Ordenes de laboratorio",imagingType:"Tipo de radiografia",result:"Resultado",results:"Resultados",visit:"Visita",requests:"Pedido",completed:"Completado",id:"Id",on:"on",type:"Tipo",sex:"Genero",age:"Edad",username:"Nombre de usuario",email:"Email",role:"Rol",delete:"Eliminar",userCanAddNewValue:"Los usuarios pueden agregar nuevos valores",value:"Valor",lookupType:"Tipo de busqueda",importFile:"Importar archivo",fileLoadSuccessful:"Archivo cargado exitosamente",fileToLoad:"Archivo cargado",startTime:"Hora de inicio",startDate:"Fecha de inicio",endTime:"Hora de finalización",endDate:"Fecha final",docRead:"Leer documento",docWritten:"Documento escrito",displayName:"Nombre para mostrar",password:"Contraseña",editUser:"Editar usuario",newUser:"Nuevo usuario",deleteUser:"Eliminar usuario",medication:"Medicación",status:"Estado",addNewOutpatientVisit:"--Nueva visita a paciente externo--",prescription:"Receta medica",prescriptionDate:"Fecha de la receta medica",billTo:"Facturar a",pullFrom:"Traer de",fulfilled:"Cumplido",deleteRequest:"Eliminar pedido",location:"Ubicacion",provider:"Proveedor",with:"con",allDay:"Todo el dia",physician:"Médico",assisting:"Asistencia",anesthesia:"Anestesia",procedures:"Procedimiento"},messages:{noItemsFound:"Elementos no encontrados.",noHistoryAvailable:"Historia no disponible.",createNewRecord:"Crear un nuevo registro?",createNewUser:"Crear un nuevo usuario?",noUsersFound:"Ningun usuario encontrado.",areYouSureDelete:"Estas seguro de eliminar este usuario {{user}}?",userHasBeenSaved:"El usuario ha sido salvado.",userSaved:"Usuario salvado",onBehalfOf:"a nombre de",newPatientHasToBeCreated:"Un nuevo paciente debe ser creado...Por favor espere..",noNotesAvailable:"No hay notas clínicas adicionales están disponibles para esta visita.",sorry:"Lo sentimos, un error ha ocurrido...",forAuthorizedPersons:"Este informe es sólo para personas autorizadas."},alerts:{pleaseWait:"Por favor espere"},buttons:{complete:"Completado",cancel:"Cancelar",close:"Cerrar",returnButton:"Regresar",barcode:"Codigo de barras",add:"Adicionar",update:"Actualizar",ok:"Ok",fulfill:"Cumplimiento",remove:"Remover",delete:"Eliminar",newUser:"Nuevo usuario",addValue:"Adicionar valor",newNote:"Nueva nota",import:"Importar",loadFile:"Cargar archivo",newRequest:"Nueva solicitud",allRequests:"Todas las solicitudes",dispense:"Repartir",newItem:"+ nuevo elemento",newRequestPlus:"+ nuevo pedido",addVisit:"Adicionar visita",search:"Buscar"},login:{messages:{signIn:"por favor ingrese",error:"Nombre de usuario o clave incorrectos."},labels:{password:"Clave",username:"Nombre de usuario",signIn:"Ingresar"}},inventory:{edit:{cost:"Costo por unidad:",delivered:"Enviado A:",location:"Cambio de ubicación:",prescription:"Recetado por:",pulled:"Pulled From:",quantity:"Quantity at Completion:",reason:"Razón:",returned:"Regresado al paciente:",transferredFrom:"Transferido a:",transferredTo:"Transferido a:"},labels:{action:"Acción",add:"Adicionar",adjust:"Adjustar",adjustmentDate:"Fecha de ajuste",adjustmentFor:"Ajustado para",adjustmentType:"Tipo de ajuste",aisle:"Pasillo",aisleLocation:"Ubicación pasillo",allInventory:"Todo el inventario",billTo:"Facturao a",consumePurchases:"Consume Purchases",consumptionRate:"Tasa de consumo",cost:"Costo",costPerUnit:"Costo por Unidad",crossReference:"Referencia cruzada",currentQuantity:"Cantidad actual",dateCompleted:"Fecha completado",dateEffective:"Gecha efectiva",dateEnd:"Fecha final",dateStart:"Fecha inicial",dateReceived:"Fecha recibido",dateTranferred:"Fecha transferencia",daysLeft:"Dias restantes",deliveryAisle:"Enviado a pasillo",deliveryLocation:"Ubicación del envio",distributionUnit:"Unidad de distribución",deleteItem:"Eliminar elemento",details:"Detalles",editItem:"Editar elemento",expense:"Gastos a",expirationDate:"Fecha de vencimiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de incumplimiento para hoy",gift:"Regalo en especie",giftUsage:"Uso del regalo en especie",giftInKindNo:"N",giftInKindYes:"Y",inventoryConsumed:"Inventario consumido",inventoryItem:"Elemento del inventario",inventoryObsolence:"Obsolescencia de inventario",invoiceItems:"Articulos de factura",invoiceLineItem:"Elemento de la factura linea",invoiceNumber:"Factura numero",item:"Elemento",items:"Elementos",itemNumber:"Numero de elemento",location:"Ubicación",locations:"Ubicaciones",name:"Nombre",markAsConsumed:"Marcar como consumido",newItem:"Nuevo elemento",originalQuantity:"Cantidad original",print:"Imprimir",printBarcode:"Imprimir codigo de barras",printer:"Impresora",pullFrom:"Traido de",purchases:"Compras",purchaseCost:"Costo de compra",purchaseInfo:"Informacion de la compra",quantity:"Cantidad ({{unit}})",quantityAvailable:"Cantidad disponible",quantityOnHand:"Cantidad a la mano",quantityRequested:"Cantidad pedida",rank:"Ranking",reason:"Razón",remove:"Remover",reorderPoint:"Reordenar punto",requestedItems:"Elementos solicitados",salePricePerUnit:"Costo de venta por unidad",save:"Guardar",serialNumber:"Serial/Numero de lote",total:"Total",totalCost:"Costo total",totalReceived:"Total Recivido: {{total}}",transaction:"Transaccion",transactions:"Transacciones",transfer:"Translados",transferFrom:"Translado desde",transferTo:"Translado a ubicación",transferToAisle:"Translado a pasillo",unit:"Unidad",unitCost:"Unidad Costo",vendor:"Proveedor",vendorItemNumber:"Proveedor numero de elemento",xref:"XRef"},messages:{adjust:"Por favor ajust las cantidades en la ubicación adecuada(s) la diferencia de la cuenta es {{difference}}.",createRequest:"Crear un nuevo pedido?",delete:"Estas seguro de eliminar {{name}}?",itemNotFound:"El elemento del inventario {{item}} no se pudo encontrar.
Si desea crear un nuevo elemento, Ingrese la información abajo.
De lo contrario opria cancelar para volver.",loading:"Cargando transacciones ...",purchaseSaved:"La compra de inventario ha sido salvada.",noRequests:"No se encontraron pedidos.",noItems:"No se encontraron elementos.",quantity:"La cantidad total ({{quantity}}) no encaja con la cantidad total en las ubicaciones ({{locationQuantity}}).",removeItem:"Esta seguro de eliminar este elemento de la factura?",removeItemRequest:"Seguro que quiere eliminar este elemento del pedido?",requestFulfilled:"El pedido de inventario ha sido procesado.",requestUpdated:"El pedido de inventario ha sido actualizado.",warning:"Valide los campos requeridos (marcados con *) corrija los errores antes de adicionar."},reports:{rows:{adjustments:"Ajustes",adjustmentsTotal:"Ajustes totales",balanceBegin:"Balance inicial",balanceEnd:"Balance Final",category:"Categoria",consumed:"Consumado",consumedGik:"GiK Consumido",consumedGikTotal:"Total GiK Consumido",consumedPuchases:"Total de lo comprado consumido",consumedPurchasesTotal:"Total de lo comprado consumido",consumedTotal:"Total consumido",errInFinSum:"Error en _generateFinancialSummaryReport: ",errInFindPur:"Error en _findInventoryItemsByPurchase: ",errInFindReq:"Error en _findInventoryItemsByRequest: ",expensesFor:"Gatos para: ",noAccount:"(No Cuenta)",subtotal:"Subtotal: ",subtotalFor:"Subtotal para {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total para {{var}}: ",totalPurchases:"Compras Totales",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} A: {{target}}"},adjustment:"Ajuste detallado",daysSupply:"Dias de inventario restante",expenseDetail:"Gastos detallados",expenseSum:"Resumen de gastos",expiration:"Fecha de expiracion",export:"Exportar reporte",fields:"Campos a incluir",finance:"Resumen de finanzas",generate:"Generar reporte",invLocation:"Inventario por ubicacion",invValuation:"Inventario por valoracion",purchaseDetail:"Compras detalladas",purchaseSum:"Resumen de compras",reportType:"Tipo de reporte",stockTransferDetail:"Detalle de traslado de stock",stockTransferSum:"Resumen traslado de stock",stockUsageDetail:"Detalle de uso de stock",stockUsageSum:"Resumen uso de stock"},titles:{addPurchase:"Adicionar compra",addRequest:"Nuevo pedido",adjustment:"Ajuste",editPurchase:"Editar compra",editRequest:"Editar pedido",inventoryItem:"Nuevo elemento de inventario",inventoryReport:"Reporte de inventario",purchaseSaved:"Compras de inventario guardadas",quickAddTitle:"Nuevo elemento de inventario",removeItem:"Remover elemento",requestFulfilled:"Pedido cumplido",requestUpdated:"Pedido actualizado",transfer:"Trasladar elementos",warning:"Peligro!!!!!"}},imaging:{pageTitle:"Pedido de radriografia",sectionTitle:"Radiografias",buttons:{newButton:"+ new radiografia"},labels:{radiologist:"Radiologo",addNewVisit:"--Adicionar nueva visita--"},messages:{noCompleted:"No de items encontrados."},titles:{completedImaging:"Radiografia completada", +editTitle:"Pedido de edicion de radiografia",newTitle:"Nuevo pedido de radiografia"},alerts:{completedTitle:"Pedido de radiografia completado",completedMessage:"El pedido de radiografia ha sido completado.",savedTitle:"Pedido de radiografia salvado",savedMessage:"El pedido de radiografia ha sido guardado."}},medication:{pageTitle:"Pedido de medicación",sectionTitle:"Medication",returnMedication:"Retorno de medicación",buttons:{dispenseMedication:"dispensar medicación",newButton:"+ nuevo pedido",returnMedication:"debolver medicacion"},titles:{completedMedication:"Medicacion completada",editMedicationRequest:"Editar pedido de medicacion",newMedicationRequest:"Nuevo pedido de medicacion"},messages:{createNew:"Crear un nuevo pedido de medicacion?",confirmDeletion:"Estas seguro de eliminar este pedido de medicación?"},labels:{refills:"Recargas",quantityRequested:"Cantidad solicitada",quantityDispensed:"Cantidad dispensada",quantityDistributed:"Cantidad distribuida",quantityToReturn:"Cantidad a devolver",returnLocation:"Retornar a ubicación",returnAisle:"Devolve a pasillo",returnReason:"Razon por la que se devuelve/Nota",adjustmentDate:"Fecha de ajuste",creditToAccount:"Credito a cuenta"},alerts:{returnedTitle:"Medicacion devuelta",returnedMessage:"La medicacion ha sido marcada para devolver.",savedTitle:"Pedido de medicacion guardado",savedMessage:"La elemento de medicación ha sido guardado.",fulfilledTitle:"Pedido de medicación cumplido"}},appointments:{currentScreenTitle:"Listado de citas",editTitle:"Editar cita",newTitle:"Nueva cita",sectionTitle:"Citas",thisWeek:"Citas esta semana",missed:"Citas perdidas",searchTitle:"Buscar citas",todayTitle:"Citas para hoy",messages:{deleteAppointmentMessage:"Esta seguro de eliminar esta cita?",endTimeLaterThanStart:"Seleccione una hora de finalizacion despues de la de inicio."},buttons:{newButton:"+ nueva cita"}},visits:{edit:{buttons:{newAppointment:"Nuevas citas",addDiagnosis:"Adicionar diagnostico",newProcedure:"Nuevo procedimiento",newLab:"New laboratorio",newMedication:"Nueva mediicación",newImaging:"Nueva radiografia"},labels:{diagnosis:"Diagnostico",procedure:"Procedimiento",authoredBy:"Escrito por",labs:"Laboratorios",imaging:"Radiografias",visitInformation:"Informacion de visita"}}},labs:{sectionTitle:"Laboratorios",requestsTitle:"Pedido de laboratorio",editTitle:"Editar pedido de laboratorio",newTitle:"Nuevo pedido de laboratorio",deleteTitle:"Eliminar pedido",completedTitle:"Completar laboratorio",labels:{labType:"Tipo de laboratorio",addNewVisit:"--Adicionar nueva visita--"},messages:{noItemsFound:"No boratorios encontrados.",createNewRecord:"Crear un registro?",confirmDeletion:"Esta seguro de eliminar esta solicitud de laboratorio?",noCompleted:"No elementos completados encontrados."},buttons:{newButton:"+ nuevo laboratorio"},alerts:{requestCompletedTitle:"Pedido de laboratorio competado",requestCompletedMessage:"El pedido de laboratorio ha sido completado.",requestSavedTitle:"Silicitud de laboratorio guardado",requestSavedMessage:"El pedido de laboratorio ha sido guardado."}},common:{actions:"Acciones"},patients:{notes:{onBehalfOfLabel:"A nombre de",onBehalfOfCopy:"a nombre de",pleaseSelectAVisit:"Por favor seleccione una visista",noteLabel:"Nota"}}}}),define("hospitalrun/locales/fr/translations",["exports"],function(e){e.default={dashboard:{title:"Que voulez-vous faire?"},navigation:{imaging:"Imagerie",inventory:"Inventaire",patients:"Patients",appointments:"Rendez-vous",medication:"Médicament",labs:"Labos",billing:"Facturation",administration:"Administration",subnav:{requests:"Demandes",items:"Articles",completed:"Traité",newRequest:"Nouvelle demande",inventoryReceived:"Inventaire reçu",reports:"Rapports",patientListing:"Liste des patients",newPatient:"Nouveau patient",thisWeek:"Cette semaine",today:"Aujourd'hui",search:"Rechercher",addAppointment:"Ajouter un rendez-vous",dispense:"Dispenser",returnMedication:"Retourner un Médicament",invoices:"Factures",newInvoice:"Nouvelle facture",prices:"Prix",priceProfiles:"Profils de prix",lookupLists:"Listes de référence",addressFields:"Champs d'adresse",loadDb:"Importer une BD",users:"Utilisateurs",newUser:"Nouvel utilisateur",admittedPatients:"patients admis",missed:"Manqué",userRoles:"Rôles de l'utilisateur"},actions:{logout:"Deconnexion",login:"Connexion"},about:"À propos de HospitalRun"},user:{plusNewUser:"+ nouvel utilisateur",usersPageTile:"Liste des Utilisateurs"},admin:{addressOptions:"Options d'adresse",lookupLists:"Listes de référence",loadDb:"Importer une BD",users:"Utilisateurs",address:{address1Label:"Label de l'adresse 1",address2Label:"Label de l'adresse 2",address3Label:"Label de l'adresse 3",address4Label:"Label de l'adresse 4",include1Label:"Label de l'include 1",include2Label:"Label de l'include 2",include3Label:"Label de l'include 3",include4Label:"Label de l'include 4",titles:{optionsSaved:"Options enregistrées"},messages:{addressSaved:"Les options d'adresse ont été enregistrées"},newTitle:"Options d'adresse",editTitle:"Options d'adresse",addressLabel:"Adresse"},loaddb:{progressMessage:"Veuillez patienter durant le chargement de la base de données.",progressTitle:"Chargement de la base de données en cours",displayAlertTitle:"Sélectionner le fichier à télécharger.",displayAlertMessage:"Veuillez sélectionner le fichier à télécharger.",errorDisplayAlertTitle:"Erreur de chargement",errorDisplayAlertMessage:"La base de données ne pouvait pas être importée. L'erreur etait: {{error}}",editTitle:"Importer une BD"},lookup:{alertImportListTitle:"Sélectionner le fichier à importer",alertImportListMessage:"Veuillez sélectionner le fichier à importer.",alertImportListSaveTitle:"Liste importée",alertImportListSaveMessage:"La liste de référence a été importée.",alertImportListUpdateTitle:"Liste enregistrée",alertImportListUpdateMessage:"La liste de référence a été enregistrée.",pageTitle:"Listes de référence",edit:{template:{addTitle:"Ajouter une valeur",editTitle:"Modifier la valeur",updateButtonTextAdd:"Ajouter",updateButtonTextUpdate:"Mettre à jour",labelTitle:"Valeur"}},anesthesiaTypes:"Types d'Anesthésie",anesthesiologists:"Anesthésiologistes",billingCategories:"Catégories de facturation",clinicList:"Emplacements de la clinique",countryList:"Pays",diagnosisList:"Diagnostics",cptCodeList:"Codes CPT",expenseAccountList:"Comptes de dépense",aisleLocationList:"Emplacements de rayon d'inventaire",warehouseList:"Emplacements d'inventaire",inventoryTypes:"Types d'inventaire",imagingPricingTypes:"Types de prix d'imagerie",labPricingTypes:"Types de prix de labo",patientStatusList:"Liste de statut de patient",physicianList:"Médécins",procedureList:"Procédures",procedureLocations:"Emplacements des procédures",procedurePricingTypes:"Types de prix de procédure",radiologists:"Radiologistes",unitTypes:"Types d'unité",vendorList:"Fournisseur",visitLocationList:"Emplacements de visite",visitTypes:"Types de visite",wardPricingTypes:"Types de prix de service"},roles:{capability:{admin:"Administration",loadDb:"Charger la Base de données",updateConfig:"Mettre à jour les Configurations",appointments:"Rendez-vous",addAppointment:"Ajouter un Rendez-vous",billing:"Facturation",addCharge:"Ajouter une charge",addPricing:"Ajouter un Prix",addPricingProfile:"Ajouter le profil de prix",addInvoice:"Ajouter une facture",addPayment:"Ajouter un paiement",deleteInvoice:"Supprimer une facture",deletePricing:"Supprimer un Prix",deletePricingProfile:"Supprimer le profil de prix",editInvoice:"Modifier la facture",invoices:"Factures",overrideInvoice:"Remplacer la facture",pricing:"Tarification",patients:"Patients",addDiagnosis:"Ajouter un diagnostic",addPhoto:"Ajouter une photo",addPatient:"Ajouter un patient",addVisit:"Ajouter une visite",addVitals:"Ajouter les signes vitaux",admitPatient:"Admettre un patient",deletePhoto:"Supprimer une photo",deletePatient:"Supprimer un patient",deleteAppointment:"Supprimer un rendez-vous",deleteDiagnosis:"Supprimer un diagnostic",deleteProcedure:"Supprimer une procédure",deleteSocialwork:"Supprimer un travail social",deleteVitals:"Supprimer des signes vitaux",deleteVisit:"Supprimer une Visite",dischargePatient:"Liberer un patient",patientReports:"Rapports des patients",visits:"Visites",medication:"Médicament",addMedication:"Ajouter un médicament",deleteMedication:"Supprimer un médicament",fulfillMedication:"Traiter une demande de médicaments",labs:"Test Labo",addLab:"Ajouter un test labo",completeLab:"Completer un test labo",deleteLab:"Supprimer un test labo",imaging:"Imagerie",addImaging:"Ajouter une imagerie",completeImaging:"Completer une imagerie",deleteImaging:"Supprimer une Imagerie",inventory:"Inventaire",addInventoryRequest:"Ajouter une demande d'inventaire",addInventoryItem:"Ajouter un article d'inventaire",addInventoryPurchase:"Ajouter un achat d'inventaire",adjustInventoryLocation:"Ajuster la localisation de l'inventaire",deleteInventoryItem:"Supprimer un article d'inventaire",deleteInventoryPurchase:"Supprimer un achat d'inventaire",fulfillInventory:"Traiter l'inventaire",defineUserRoles:"Rôles d'utilisateur"},messages:{roleSaved:"Le rôle {{roleName}} a été enregistré."},titles:{roleSaved:"Rôle enregistré"}}},labels:{cptcode:"Code CPT",loading:"Chargement",name:"Nom",patient:"Patient",prescriber:"prescripteur",quantity:"Quantité",requestedOn:"Demandé le",date:"Date",dateOfBirth:"Date de naissance",dateOfBirthShort:"DdN",dateRequested:"Date de demande",dateCompleted:"Date de traitement",description:"Description",requestedBy:"Demandé par",fulfill:"Traiter",fulfillRequest:"Traiter la demande",fulfillRequestNow:"Traiter la demande maintenant",actions:"Actions",action:"Action",notes:"Notes",edit:"Modifier",imageOrders:"Demandes d'imagerie",labOrders:"Demandes de labo",imagingType:"Type d'imagerie",result:"Resultat",results:"Resultats",visit:"Visite",requests:"Demandes",completed:"Traité",id:"Id",on:"sur",type:"Type",sex:"Sexe",age:"Age",username:"Nom d'utilisateur",email:"Email",role:"Rôle",delete:"Supprimer",userCanAddNewValue:"Utilisateur peut ajouter de nouvelles valeurs",value:"Valeur",lookupType:"Type de référence",importFile:"Importer un fichier",fileLoadSuccessful:"Téléchargement reussi",fileToLoad:"Téléchargement de fichier",startTime:"Heure de debut",startDate:"Date de debut",endTime:"Heure de fin",endDate:"Date de fin",docRead:"Documents lus",docWritten:"Documents écrits",displayName:"Nom à afficher",password:"Mot de passe",editUser:"Modifier un utilisateur",newUser:"Nouvel utilisateur",deleteUser:"Supprimer un utilisateur",medication:"Médicament",status:"Statut",addNewOutpatientVisit:"--Ajouter une nouvelle consultation externe--",prescription:"Ordonnance",prescriptionDate:"Date de prescription",billTo:"Facturer à",pullFrom:"Tirer de",fulfilled:"Traité",deleteRequest:"Supprimer la demande",location:"Emplacement",provider:"Fournisseur",with:"Avec",allDay:"Toute la journée",physician:"Médecin",assisting:"Assistant",anesthesia:"Anesthésie",procedures:"Procédures"},messages:{noItemsFound:"Aucun article retrouvé.",noHistoryAvailable:"Aucune historique disponible.",createNewRecord:"Créer un nouveau dossier?",createNewUser:"Créer un nouvel utilisateur?",noUsersFound:"Aucun utilisateur retrouvé.",areYouSureDelete:"Êtes-vous sûr de vouloir supprimer l'utilisateur {{user}}?",userHasBeenSaved:"L'utilisateur a été enregistré.",userSaved:"Utilisateur enregistré",onBehalfOf:"de la part de",newPatientHasToBeCreated:"Un nouveau patient doit être crée...Veuillez attendre...",noNotesAvailable:"Aucune note clinique supplémentaire disponible pour cette visite.",sorry:"Désolé, quelque chose a mal tourné ...",forAuthorizedPersons:"Ce rapport est destiné uniquement aux personnes autorisées."},alerts:{pleaseWait:"Veuillez attendre"},buttons:{complete:"Traiter",cancel:"Annuler",close:"Fermer",returnButton:"Retourner",barcode:"Code barre",add:"Ajouter",update:"Mettre à jour",ok:"Ok",fulfill:"Traiter",remove:"Retirer",delete:"Supprimer",newUser:"Nouvel utilisateur",addValue:"Ajouter une valeur",newNote:"Nouvelle note",import:"Importer",loadFile:"Télécharger le fichier",newRequest:"Nouvelle demande",allRequests:"Toutes les demandes",dispense:"Dispenser",newItem:"+ nouvel article",newRequestPlus:"+ nouvelle demande",addVisit:"Ajouter une visite",search:"Rechercher"},login:{messages:{signIn:"veuillez-vous connecter",error:"Nom d'utilisateur ou mot de passe est incorrect."},labels:{password:"Mot de passe",username:"Nom d'utilisateur",signIn:"Connexion"}},inventory:{edit:{cost:"Coût par unité:",delivered:"Livré à:",location:"Emplacement ajusté:",prescription:"Ordonnance pour:",pulled:"Tiré de:",quantity:"Quantité après traitement:",reason:"Motif:",returned:"Retourné par le patient:",transferredFrom:"Transféré de:",transferredTo:"Transféré à:"},labels:{action:"Action",add:"Ajouter",adjust:"Ajuster",adjustmentDate:"Date d'ajustement",adjustmentFor:"Ajustement pour",adjustmentType:"Type d'ajustement",aisle:"Rayon",aisleLocation:"Emplacement du rayon",allInventory:"Toute l'inventaire",billTo:"Facturer à",consumePurchases:"Utiliser les achats",consumptionRate:"Taux d'utilisation",cost:"Coût",costPerUnit:"Coût par unité",crossReference:"Reference",currentQuantity:"Quantité actuelle",dateCompleted:"Date de traitement",dateEffective:"Date d'effet",dateEnd:"Date de fin",dateStart:"Date de debut",dateReceived:"Date de réception",dateTransferred:"Date de transfert",daysLeft:"Nombre de jours restant",deliveryAisle:"Rayon de livraison",deliveryLocation:"Emplacement de livraison",distributionUnit:"Unité de distribution",deleteItem:"Supprimer l'article",details:"Détails",editItem:"Modifier l'article",expense:"Dépenses pour",expirationDate:"Date d'expiration",fulfillRequest:"Traiter la demande",fulfillRequestNow:"Traiter la demande maintenant",gift:"Don en nature",giftUsage:"Utilisation de don en nature",giftInKindNo:"N",giftInKindYes:"O",inventoryConsumed:"Inventaire utilisé",inventoryItem:"Article à inventorier",inventoryObsolence:"Inventory Obsolence",invoiceItems:"Articles de facture",invoiceLineItem:"Article de facture",invoiceNumber:"Numero de facture",item:"Article",items:"Articles",itemNumber:"Numero d'article",location:"Emplacement",locations:"Emplacements",name:"Nom",markAsConsumed:"Marqué comme utilisé",newItem:"Nouvel article",originalQuantity:"Quantité originale",print:"Imprimer",printBarcode:"Imprimer le code barre",printer:"Imprimante",pullFrom:"Tirer de",purchases:"Achats",purchaseCost:"Coût d'achat",purchaseInfo:"Détails de l'achat",quantity:"Quantité ({{unit}})",quantityAvailable:"Quantité disponible",quantityOnHand:"Quantité en main",quantityRequested:"Quantité demandée",rank:"Rang",reason:"Motif",remove:"Retirer",reorderPoint:"Point de commande",requestedItems:"Articles demandés",salePricePerUnit:"Prix de vente unitaire",save:"Enregistrer",serialNumber:"Numéro de série / lot",total:"Total",totalCost:"Coût total",totalReceived:"Total reçu: {{total}}",transaction:"Transaction",transactions:"Transactions",transfer:"Transférer",transferFrom:"Transféré de",transferTo:"Transférer à l'emplacement",transferToAisle:"Transférer à l'emplacement du rayon",unit:"Unité",unitCost:"Coût unitaire",vendor:"Fournisseur",vendorItemNumber:"Numéro d'article fournisseur",xref:"XRef"},messages:{adjust:"Veuillez ajuster les quantités sur le ou les emplacement(s) appropriée(s) pour tenir compte de la différence de {{difference}}.",createRequest:"Créer une nouvelle demande?",delete:"Etes-vous sûr que vous souhaitez supprimer {{name}}?",itemNotFound:"L'article d'inventaire {{item}} ne pouvait pas être retrouvé.
Si vous voulez créer un nouvel article d'inventaire, veuillez saisir les informations ci-dessous.
Sinon, appuyez sur le bouton Annuler pour retourner.",loading:"Chargement des transactions en cours…",purchaseSaved:"Les achats d'inventaire ont été enregistrés avec succès.",noRequests:"Aucune demande retrouvée.",noItems:"Aucun article retrouvé.",quantity:"La quantité totale de ({{quantity}}) ne correspond pas à la quantité totale dans les emplacements ({{locationQuantity}}).",removeItem:"Etes-vous sûr de vouloir retirer cet article de cette facture?",removeItemRequest:"Etes-vous sûr de vouloir supprimer cet article de cette demande?",requestFulfilled:"La demande d'inventaire a été traitée.",requestUpdated:"La demande d'inventaire a été mis à jour.",warning:"Veuillez remplir les champs obligatoires (marqués d'un *) et corriger les erreurs avant d'ajouter."},reports:{rows:{adjustments:"Ajustements",adjustmentsTotal:"Ajustements totaux",balanceBegin:"Solde d'ouverture",balanceEnd:"Solde de clôture",category:"Catégorie",consumed:"Utilisé",consumedGik:"GiK utilisé",consumedGikTotal:"GiK total utilisé",consumedPuchases:"Achats utilisés",consumedPurchasesTotal:"Achats totaux utilisés",consumedTotal:"Total utilisé",errInFinSum:"Erreur dans _generateFinancialSummaryReport: ",errInFindPur:"Erreur dans _findInventoryItemsByPurchase: ",errInFindReq:"Erreur dans _findInventoryItemsByRequest: ",expensesFor:"Dépenses pour: ",noAccount:"(Pas de compte)",subtotal:"Sous-total: ",subtotalFor:"Sous-total pour {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total pour {{var}}: ",totalPurchases:"Achats totaux",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} A: {{target}}"},adjustment:"Ajustement détaillée",daysSupply:"Stock restant (en nombre de jours)",expenseDetail:"Détails des dépenses",expenseSum:"Résumé des dépenses",expiration:"Date d'expiration",export:"Exporter un rapport",fields:"Champs à inclure",finance:"Résumé des finances",generate:"Créer un rapport",invLocation:"Inventaire par emplacement",invValuation:"Valorisation de l'inventaire",purchaseDetail:"Détails de l'achat",purchaseSum:"Résumé de l'achat",reportType:"Type de rapport",stockTransferDetail:"Transfert détaillé du stock",stockTransferSum:"Résumé du transfert du stock",stockUsageDetail:"Utilisation détaillée du stock",stockUsageSum:"Résumé de l'utilisation du stock"},titles:{addPurchase:"Ajouter un achat",addRequest:"Nouvelle demande",adjustment:"Ajustement",editPurchase:"Modifier l'achat",editRequest:"Modifier la demande",inventoryItem:"Nouvel article d'inventaire",inventoryReport:"Rapport d'inventaire",purchaseSaved:"Achats d'inventaire enregistrés",quickAddTitle:"Nouvel article d'inventaire",removeItem:"Retirer l'article",requestFulfilled:"Demande traitée",requestUpdated:"Demande mis à jour",transfer:"Transférer les articles",warning:"Attention!!!!!"}},imaging:{pageTitle:"Demandes d'imagerie",sectionTitle:"Imagerie",buttons:{newButton:"+ nouvelle imagerie"},labels:{radiologist:"Radiologiste",addNewVisit:"--Ajouter une nouvelle visite--"},messages:{noCompleted:"Aucun article traité retrouvé."},titles:{completedImaging:"Imagerie traitée",editTitle:"Modifier la demande d'imagerie",newTitle:"Nouvelle demande d'imagerie"},alerts:{completedTitle:"Demande d'imagerie traitée",completedMessage:"La demande d'imagerie a été traitée.",savedTitle:"Demande d'imagerie enregistrée",savedMessage:"La demande d'imagerie a été enregistrée."}},medication:{pageTitle:"Demandes de médicament",sectionTitle:"Médicament",returnMedication:"Retourner un médicament",buttons:{dispenseMedication:"dispenser un médicament",newButton:"+ nouvelle demande",returnMedication:"retourner un médicament"},titles:{completedMedication:"Médicament traitée",editMedicationRequest:"Modifier une demande de médicament",newMedicationRequest:"Nouvelle demande de médicament"},messages:{createNew:"Créer une nouvelle demande de médicament?",confirmDeletion:"Êtes-vous sûr de vouloir supprimer cette demande de médicaments?"},labels:{refills:"Renouvellements",quantityRequested:"Quantité demandé",quantityDispensed:"Quantité dispensé",quantityDistributed:"Quantité distribué",quantityToReturn:"Quantité à retourner",returnLocation:"Emplacement de retour",returnAisle:"Rayon de retour",returnReason:"Motif/notes du retour",adjustmentDate:"Date d'ajustement",creditToAccount:"Créditer le compte"},alerts:{returnedTitle:"Médicament retourné",returnedMessage:"Le médicament a été marqué comme retourné.",savedTitle:"Demande de médicament enregistrée",savedMessage:"Le dossier de médicament a été enregistré.",fulfilledTitle:"Demande de médicament traitée"}},appointments:{currentScreenTitle:"Liste des rendez-vous",editTitle:"Modifier le rendez-vous",newTitle:"Nouveau rendez-vous",sectionTitle:"Rendez-vous",thisWeek:"Rendez-vous de la semaine",missed:"Rendez-vous manqués",searchTitle:"Rechercher les rendez-vous",todayTitle:"Rendez-vous d'aujourd'hui",messages:{deleteAppointmentMessage:"Etes-vous sûr de vouloir supprimer ce rendez-vous?",endTimeLaterThanStart:"Veuillez sélectionnez une heure de fin plus tard que l'heure de début."},buttons:{newButton:"+ nouveau rendez-vous"}},visits:{edit:{buttons:{newAppointment:"Nouveau rendez-vous",addDiagnosis:"Ajoute un diagnostic",newProcedure:"Nouvelle procédure",newLab:"Nouveau labo",newImaging:"Nouvelle imagerie",newMedication:"Nouveau médicament"},labels:{diagnosis:"Diagnostic",procedure:"Procédure",authoredBy:"Crée par",labs:"Labos",imaging:"Imagerie",visitInformation:"Détails de la visite"}}},labs:{sectionTitle:"Labos",requestsTitle:"Demandes de labo",editTitle:"Modifier la demande de labo",newTitle:"Nouvelle demande de labo",deleteTitle:"Supprimer la demande",completedTitle:"Labos traités",labels:{labType:"Type de labo",addNewVisit:"--Ajouter une nouvelle visite--"},messages:{noItemsFound:"Aucun labo retrouvé.",createNewRecord:"Créer un nouveau dossier?",confirmDeletion:"Etes-vous sûr de vouloir supprimer cette demande de labo?",noCompleted:"Aucun article traité retrouvé."},buttons:{newButton:"+ nouveau labo"},alerts:{requestCompletedTitle:"Demande de labo traitée",requestCompletedMessage:"La demande de labo a été traitée.",requestSavedTitle:"Demande de labo enregistrée",requestSavedMessage:"La demande de labo a été enregistrée."}},common:{actions:"Actions"},patients:{notes:{onBehalfOfLabel:"De la part de",onBehalfOfCopy:"de la part de",pleaseSelectAVisit:"Veuillez sélectionner une visite",noteLabel:"Note"}}}}),define("hospitalrun/locales/pt-BR/translations",["exports"],function(e){e.default={dashboard:{title:"O que você gostaria de fazer?"},errors:{inclusion:"não está na lista",exclusion:"é reservado",invalid:"é inválido",confirmation:"{{attribute}} não corresponde",accepted:"deve ser aceito",empty:"não pode ser vazio",blank:"não pode ser branco",present:"pode ser branco",tooLong:"é muito longo (quantidade máxima de caracteres é {{count}} )",tooShort:"é muito curta (quantidade mínima de caracteres é {{count}})",wrongLength:"o tamanho está errado (são esperados {{count}} caracteres)",notANumber:"não é um número",notAnInteger:"deve ser um número inteiro",greaterThan:"deve ser maior do que {{count}}",greaterThanOrEqualTo:"deve ser maior ou igual à {{count}}",equalTo:"deve ser igual à {{count}}",lessThan:"deve ser menor do que {{count}}",lessThanOrEqualTo:"deve ser menor ou igual à {{count}}",otherThan:"deve ser diferente de {{count}}",odd:"deve ser ímpar",even:"deve ser até",invalidNumber:"número não é valido"},navigation:{imaging:"Imagem",inventory:"Inventário",patients:"Pacientes",appointments:"Compromisso",medication:"Medicação",labs:"Laboratórios",billing:"Faturamento",administration:"Administração",subnav:{actions:"Ações",requests:"Requisições",items:"Itens",completed:"Concluídos",newRequest:"Nova Requisição",inventoryReceived:"Inventário Recebido",reports:"Relatórios",patientListing:"Lista de Pacientes",newPatient:"Novo Paciente",thisWeek:"Essa Semana",today:"Hoje",search:"Pesquisa",addAppointment:"Adicionar Compromisso",dispense:"Dispensar",returnMedication:"Retorno de Medicação",invoices:"Faturas",newInvoice:"Nova Fatura",prices:"Preços",priceProfiles:"Perfis de Preços",lookupLists:"Listas de Pesquisa",addressFields:"Campos de Endereço",loadDB:"Carregar BD",users:"Usuários",newUser:"Novo Usuário",admittedPatients:"Pacientes Admitidos",missed:"Perdidos",userRoles:"Perfis de Usuário",workflow:"Workflow"},actions:{logout:"Sair",login:"Entrar"},about:"Sobre HospitalRun"},user:{plusNewUser:"+ novo usuário",usersPageTile:"Lista de Usuários"},admin:{addressOptions:"Opções de Endereço",lookupLists:"Lista de Pesquisas",loadDb:"Carregar DB",userRoles:"Perfis de Usuários",users:"Usuários",address:{address1Label:"Rótulo Endereço 1",address2Label:"Rótulo Endereço 2",address3Label:"Rótulo Endereço 3",address4Label:"Rótulo Endereço 4",include1Label:"Rótulo Include 1",include2Label:"Rótulo Include 2",include3Label:"Rótulo Include 3",include4Label:"Rótulo Include 4",titles:{optionsSaved:"Opções Salvas"},messages:{addressSaved:"As opções de endereço foram salvas"},newTitle:"Opções de Endereço",editTitle:"Opções de Endereço",addressLabel:"Endereço"},loaddb:{progressMessage:"Por favor aguarde enquanto o seu banco de dados é carregado.",progressTitle:"Carregando Banco de Dados",displayAlertTitle:"Selecione o Arquivo para Carregar",displayAlertMessage:"Por favor Selecione o Arquivo para Carregar.",errorDisplayAlertTitle:"Erro ao carregar",errorDisplayAlertMessage:"O banco de dados não foi carregado. O erro foi: {{error}}",editTitle:"Carregando BD"},lookup:{alertImportListTitle:"Selecione o arquivo para importação",alertImportListMessage:"Por favor Selecione o arquivo para importação.",alertImportListSaveTitle:"Lista Importdada",alertImportListSaveMessage:"A lista de pesquisa foi importada.",alertImportListUpdateTitle:"Lista Salva",alertImportListUpdateMessage:"A lista de pesquisa foi salva.",pageTitle:"Listas de Pesquisa",edit:{template:{addTitle:"Adicionar Valor",editTitle:"Editar Valor",updateButtonTextAdd:"Adicionar",updateButtonTextUpdate:"Atualizar",labelTitle:"Valor"}},anesthesiaTypes:"Tipos de Anestesia",anesthesiologists:"Anestesiologista",billingCategories:"Categorias de Faturamento",clinicList:"Localização de Clínicas",countryList:"Países",diagnosisList:"Diagnósticos",cptCodeList:"Códigos CPT",expenseAccountList:"Contas de Despesas",aisleLocationList:"Localização de Corredores no Inventário",warehouseList:"Locais de Inventário",inventoryTypes:"Tipos de Inventário",imagingPricingTypes:"Tipos de Preço Imagem",labPricingTypes:"Tipos de Preço Laboratório",patientStatusList:"Lista de Situação do Paciente",physicianList:"Médicos",procedureList:"Procedimentos",procedureLocations:"Localização de Procedimentos",procedurePricingTypes:"Tipos de Preço Procedimento",radiologists:"Radiologista",unitTypes:"Tipos de Unidade",vendorList:"Fornecedor",visitLocationList:"Localização dos Visitantes",visitTypes:"Tipos de Visita",wardPricingTypes:"Tipos de Preços Enfermaria"},roles:{capability:{admin:"Administração",loadDb:"Carregar Banco de Dados",updateConfig:"Atualizar Configurações",appointments:"Compromissos",addAppointment:"Adicionar Compromissos",billing:"Faturamentos",addCharge:"Adicionar Cobrança",addPricing:"Adicionar Preço",addPricingProfile:"Adicionar Perfil de Preço",addInvoice:"Adicionar Fatura",addPayment:"Adicionar Pagamentos",deleteInvoice:"Excluir Fatura",deletePricing:"Excluir Preço",deletePricingProfile:"Excluir Perfil de Preço",editInvoice:"Editar Fatura",invoices:"Faturas",overrideInvoice:"Substituir Fatura",pricing:"Preço",patients:"Pacientes",addDiagnosis:"Adicionar Diagnóstico",addPhoto:"Adicionar Foto",addPatient:"Adicionar Paciente",addProcedure:"Adicionar Procedimento",addVisit:"Adicionar Visita",addVitals:"Adicionar Sinais Vitais",admitPatient:"Admitir Paciente",deletePhoto:"Excluir Paciente",deletePatient:"Excluir Paciente",deleteAppointment:"Excluir Compromisso",deleteDiagnosis:"Excluir Diagnóstico",deleteProcedure:"Excluir Procedimento",deleteSocialwork:"Excluir Trabalho Social",deleteVitals:"Excluir Sinais Vitais",deleteVisit:"Excluir Visita",dischargePatient:"Alta do Paciente",patientReports:"Relatório do Paciente",visits:"Visita",medication:"Medicação",addMedication:"Adicionar Medicação",deleteMedication:"Excluir Medicação",fulfillMedication:"Preencher Medicação",labs:"Laboratório",addLab:"Adicionar Laboratório",completeLab:"Laboratório Concluído",deleteLab:"Excluir Laboratório",imaging:"Imagem",addImaging:"Adicionar Imagem",completeImaging:"Imagem Concluída",deleteImaging:"Excluir Imagem",inventory:"Inventário",addInventoryRequest:"Adicionar Requisição de Inventário",addInventoryItem:"Adicionar Item de Inventário",addInventoryPurchase:"Adicionar Compra de Inventário",adjustInventoryLocation:"Ajustar Localização de Inventário",deleteInventoryItem:"Excluir Item de Inventário",fulfillInventory:"Preencher Inventário",defineUserRoles:"Perfis de Usuários"},messages:{roleSaved:"O perfil {{roleName}} foi salvo."},titles:{roleSaved:"Perfil Salvo"}},workflow:{admissionDepositLabel:"Depósito de Admissão é exigido",clinicPrepaymentLabel:"Pagamento Antecipado da Clínica é exigido",followupPrepaymentLabel:"Pagamento Antecipado do Acompanhamento é exigido",outpatientLabLabel:"Pagamento Antecipado do Laboratório Ambulatorial é exigido",outpatientImagingLabel:"Pagamento Antecipado do Ambulatorio de Imagem é exigido",outpatientMedicationLabel:"Pagamento Antecipado do Ambulatorio de Medicação é exigido",titles:{optionsSaved:"Opções Salvas"},messages:{optionsSaved:"As opções de WorkFlow foram salvas"},newTitle:"Opções de Workflow",editTitle:"Opções de Workflow",workflowLabel:"Workflow"}},labels:{cptcode:"Código CPT*",loading:"Carregando",name:"Nome",note:"Note",patient:"Paciente",prescriber:"Médico Responsável pela Prescrição",quantity:"Quantidade",requestedOn:"Solicitado em",date:"Data",dateOfBirth:"Data de Nascimento",dateOfBirthShort:"DtNasc",dateRequested:"Data da Requisição",dateCompleted:"Data da Conclusão",description:"Descrição",requestedBy:"Requisitado por",fulfill:"Preencha",fulfillRequest:"Preencha a Requisição",fulfillRequestNow:"Preencha a Requisição Agora",actions:"Ações",action:"Ação",notes:"Notas",edit:"Editar",imageOrders:"Pedido de Imagem",labOrders:"Pedidos de Laboratório",imagingType:"Tipo de Imagem",result:"Resultado",results:"Resultados",visit:"Visita",requests:"Requisições",completed:"Completo",id:"Id",on:"ligado",type:"Tipo",sex:"Sexo",age:"Idade",search:"Pesquisa",username:"Usuário",email:"Email",role:"Papel",delete:"Excluir",userCanAddNewValue:"O usuário pode adicionar novos valores",value:"Valor",lookupType:"Tipo de Pesquisa",importFile:"Importar Arquivo",fileLoadSuccessful:"Arquivo Carregado com Sucesso",fileToLoad:"Carregar Arquivo",startTime:"Hora Início",startDate:"Data de Início",endTime:"Hora de Término",endDate:"Data de Término",docRead:"Documentos Lidos",docWritten:"Documentos Escritos",displayName:"Nome de Exibição",password:"Senha",editUser:"Editar Usuário",newUser:"Novo Usuário",deleteUser:"Excluir Usuário",medication:"Medicação",status:"Situação",addNewOutpatientVisit:"--Adicionar Nova Visita Ambulatorial--",prescription:"Prescrição",prescriptionDate:"Data da Prescrição",billTo:"Conta Para",pullFrom:"Puxar De",fulfilled:"Preenchido",deleteRequest:"Excluir Requisição",location:"Localização",provider:"Fornecedor",with:"Com",allDay:"Todo Dia",physician:"Médico",assisting:"Ajudante",anesthesia:"Anestesia",procedures:"Procedimentos",number:"Número",billDate:"Data da Conta",balanceDue:"Saldo Devedor",amount:"Quantidade",datePaid:"Data de Pagamento",creditTo:"Crédito Para",invoiceId:"ID da Fatura",lineItems:"Itens de Linha",discount:"Desconto",excess:"Excesso",price:"Preço",total:"Total",expenseTo:"Despesa Para",grandTotal:"Total Geral",remarks:"Observações",payments:"Pagamentos",category:"Categoria",department:"Departamento",address:"Endereço",country:"País"},messages:{noItemsFound:"Nenhum item encontrado",noHistoryAvailable:"Histórico não disponível.",createNewRecord:"Criar uma nova gravação?",createNewUser:"Criar um novo usuário?",noUsersFound:"Nenhum usuário encontrado.",areYouSureDelete:"Você tem certeza que deseja excluir o usuário {{user}}?",userHasBeenSaved:"O usuário foi salvo.",userSaved:"Usuário Salvo",onBehalfOf:"em nome de",newPatientHasToBeCreated:"Um novo paciente precisa ser criado... Por favor aguarde...", +noNotesAvailable:"Nenhuma nota clinica adicional está diponível para essa visita.",sorry:"Desculpe, algo deu errado...",forAuthorizedPersons:"Este relatório é somente para pessoas autorizadas."},alerts:{pleaseWait:"Por Favor Aguarde"},headings:{chargedItems:"Itens Carregados"},buttons:{addItem:"Adicionar Item",complete:"Completo",cancel:"Cancelar",close:"Fechar",returnButton:"Retornar",barcode:"Código de Barras",add:"Adicionar",update:"Atualizar",ok:"Ok",fulfill:"Preencher",remove:"Remover",delete:"Excluir",newUser:"Novo Usuário",addValue:"Adicionar Valor",newNote:"Nova Nota",import:"Importar",loadFile:"Carregar Arquivo",newRequest:"Nova Requisição",allRequests:"Todas as Requisições",dispense:"Dispensar",newItem:"+ novo item",newRequestPlus:"+ nova requisição",addVisit:"Adicionar Visita",search:"Pesquisa",edit:"Editar",addLineItem:"Adicionar Item de Linha"},login:{messages:{signIn:"inscreva-se",error:"Nome de usuário ou senha está incorreta."},labels:{password:"Senha",username:"Usuário",signIn:"Entrar"}},loading:{progressBar:{progress:"{{progressBarValue}}% concluído"},messages:{0:"A velocidade de vôo borboleta superior é de 12 milhas por hora. Alguns meses pode voar 25 milhas por hora!",1:"As corujas são os únicos pássaros que podem ver a cor azul.",2:"Os gatos têm mais de 100 sons vocais; cachorros têm apenas 10.",3:"Os Humanos usam um total de 72 músculos diferentes na fala.",4:"Mais de 1.000 idiomas diferentes são falados no continente africano",5:"Uma eritrofobo é alguém que fica vermelho facilmente.",6:"A fobia mais comum do mundo é a Odinofobia que é o medo da dor.",7:"Seu corpo utiliza 300 músculo para manter o equilíbrio quando você está parado.",8:"Alguns sapos podem ser congelados e depois de serem descongelados continuarem a viver.",9:"Nossos olhos estão sempre do mesmo tamanho de quando nascemos, mas nossas orelhas e nariz nunca param de crescer.",10:"Sua língua é o único músculo em seu corpo qu está ligado apenas em uma extremidade.",11:"Camelos tem três pálpebras para se protegerem das tempestades de areia."}},inventory:{edit:{cost:"Preço por Unidade:",delivered:"Entregue a:",location:"Localização Ajustada:",prescription:"Prescrição para:",pulled:"Retirado de:",quantity:"Quantidade na Conclusão:",reason:"Motivo:",returned:"Devolvido do Paciente:",transferredFrom:"Transferido de:",transferredTo:"Transferido para:"},labels:{action:"Ação",add:"Adicionar",adjust:"Ajustar",adjustmentDate:"Data de Ajuste",adjustmentFor:"Ajuste Para",adjustmentType:"Tipo de Ajuste",aisle:"Corredor",aisleLocation:"Localização do Corredor",allInventory:"Todo Inventário",billTo:"Conta Para",consumePurchases:"Compras para Consumo",consumptionRate:"Taxa de Consumo",cost:"Preço",costPerUnit:"Preço por Unidade",crossReference:"Referência Cruzada",currentQuantity:"Quantidade Atual",dateCompleted:"Data de Conclusao",dateEffective:"Data Efetiva",dateEnd:"Data de Término",dateStart:"Data de Início",dateReceived:"Data Recebida",dateTransferred:"Data Transferida",daysLeft:"Dias Restantes",deliveryAisle:"Corredor de Entrega",deliveryLocation:"Local de Entrega",distributionUnit:"Centro de Distribuição",deleteItem:"Deletar Item",details:"Detalhes",editItem:"Editar Item",expense:"Despesa para",expirationDate:"Data de Expiração",fulfillRequest:"Preencher Requisição",fulfillRequestNow:"Preencher Requisição Agora",gift:"Doação em Espécie",giftUsage:"Uso de Doação em Espécie",giftInKindNo:"N",giftInKindYes:"S",inventoryConsumed:"Inventário Consumido",inventoryItem:"Item de Inventário",inventoryObsolence:"Obsolescência de Inventário",invoiceItems:"Itens da Fatura",invoiceLineItem:"Item de Linha da Fatura",invoiceNumber:"Número da Fatura",item:"Item",items:"Itens",itemNumber:"Número de Item",location:"Localização",locations:"Localizações",name:"Nome",markAsConsumed:"Marcar como Consumido",newItem:"Novo Item",allItems:"Todos os Itens",originalQuantity:"Quantidade Original",print:"Imprimir",printBarcode:"Imprimir Código Barras",printer:"Impressora",pullFrom:"Retirar de",purchases:"Compras",purchaseCost:"Custo da Compra",purchaseInfo:"Informações da Compra",quantity:"Quantity ({{unit}})",quantityAvailable:"Quantity Available",quantityOnHand:"Quantidade on Hand",quantityRequested:"Quantidade Solicitada",rank:"Classificação",reason:"Motivo",remove:"Remover",reorderPoint:"Ponto de Reabastecimento",requestedItems:"Itens Solicitados",salePricePerUnit:"Preço de Venda por Unidade",save:"Salvar",serialNumber:"Lote/Número de Série",total:"Total",totalCost:"Preço Total",totalReceived:"Total Recebido: {{total}}",transaction:"Transação",transactions:"Transações",transfer:"Transferir",transferFrom:"Transferir de",transferTo:"Transferir para Localização",transferToAisle:"Transferir para Localização de Corredor",unit:"Unidade",unitCost:"Preço Unitário",vendor:"Fornecedor",vendorItemNumber:"Número de Item do Fornecedor",xref:"RefX"},messages:{adjust:"Por favor ajustar as quantidades no(s) local(is) apropriado(s) da conta para a diferença de {{difference}}.",createRequest:"Criar uma nova requisição?",delete:"Você tem certeza que deseja excluir {{name}}?",itemNotFound:"O item de inventário {{item}} não pode ser encontrado.
Se você quiser criar um novo item de inventário, preencha as informações abaixo.
Caso o contrário, pressione o botão Cancelar para voltar.",loading:"Carregando transações ...",purchaseSaved:"As compras de inventário foram salvas com sucesso.",noRequests:"Nenhuma requisição encontrada.",noItems:"Nenhum item encontrado.",quantity:"A quantidade total de ({{quantity}}) não corresponde com a quantidade total nas localizações({{locationQuantity}}).",removeItem:"Você tem certeza de que deseja remover este item desta fatura?",removeItemRequest:"Você tem certeza de que deseja remover este item desta requisição?",requestFulfilled:"A requisição de invenário foi preenchida.",requestUpdated:"A requisição de invenário foi atualizada.",warning:"Por favor preencher campos obrigatório (marcado(s) com *) e corrija os erros antes de adicionar."},reports:{rows:{adjustments:"Ajustes",adjustmentsTotal:"Total dos Ajustes",balanceBegin:"Balanço Inicial",balanceEnd:"Balanço Final",category:"Categoria",consumed:"Consumidos",consumedGik:"Doações Consumidas",consumedGikTotal:"Total Doações Consumidas",consumedPuchases:"Compras Consumidas",consumedPurchasesTotal:"Total Compras Consumidas",consumedTotal:"Total Consumido",errInFinSum:"Erro em _generateFinancialSummaryReport: ",errInFindPur:"Erro em _findInventoryItemsByPurchase: ",errInFindReq:"Erro em _findInventoryItemsByRequest: ",expensesFor:"Despesas para: ",noAccount:"(Sem Conta)",subtotal:"Subtotal: ",subtotalFor:"Subtotal para {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total para {{var}}: ",totalPurchases:"Total de Compras",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} Para: {{target}}"},adjustment:"Ajuste Detalhado",daysSupply:"Dias de Abastecimento Deixado no Estoque",expenseDetail:"Despesas Detalhadas",expenseSum:"Sumário de Despesas",expiration:"Data de Expiração",export:"Exportar Relatório",fields:"Campos para Incluir",finance:"Sumário Financeiro",generate:"Gerar Relatório",invLocation:"Inventário por Localização",invValuation:"Valorização do Inventário",purchaseDetail:"Compras Detalhadas",purchaseSum:"Sumário de Compras",reportType:"Tipo de Relatório",stockTransferDetail:"Tranferências de Estoque Detalhadas",stockTransferSum:"Sumário de Tranferências de Estoque",stockUsageDetail:"Uso de Estoque Detalhado",stockUsageSum:"Sumário de Uso de Estoque"},titles:{addPurchase:"Adicionar Compra",addRequest:"Nova Requisição",adjustment:"Ajuste",editPurchase:"Editar Compra",editRequest:"Editar Requisição",inventoryItem:"Novo Item de Inventário",inventoryReport:"Relatório de Inventário",purchaseSaved:"Compras de Invenários Salvas",quickAddTitle:"Novo Item de Inventário",removeItem:"Remover Item",requestFulfilled:"Requisição Preenchida",requestUpdated:"Requisição Atualizada",transfer:"Itens de Transferência",warning:"Atenção!!!!!"}},imaging:{pageTitle:"Requisição de imagens",sectionTitle:"Imagem",buttons:{newButton:"+ nova imagem"},labels:{radiologist:"Radiologista",addNewVisit:"--Adicionar novo visitante--"},messages:{delete:"Você tem certeza que deseja excluir essa requisição de imagem?",noCompleted:"Nenhum item completo encontrado."},titles:{completedImaging:"Imagem completa",editTitle:"Requisição de edição de imagem",newTitle:"Nova requisição de imagem"},alerts:{completedTitle:"Requisição de Imagem Completa",completedMessage:"A requisição de imagem esta completa.",savedTitle:"Requisição de imagem salva",savedMessage:"A requisição de imagem foi salva."}},medication:{pageTitle:"Requisição de Medicação",sectionTitle:"Medicação",returnMedication:"Retorno de Medicação",buttons:{dispenseMedication:"dispensar medicação",newButton:"+ nova requisição",returnMedication:"retorno de medicação"},titles:{completedMedication:"Medicação Concluída",editMedicationRequest:"Editar Requisição de Medicação",newMedicationRequest:"Nova Requisição de Medicação"},messages:{createNew:"Criar uma nova requisição de medicação?",confirmDeletion:"Você tem certeza que deseja excluir essa requisição de medicação?"},labels:{refills:"Recargas",quantityRequested:"Quantidade Requisitada",quantityDispensed:"Quantidade Dispensada",quantityDistributed:"Quantidade Distribuída",quantityToReturn:"Quantidade Retornada",returnLocation:"Localização de Retorno",returnAisle:"Corredor de Retorno",returnReason:"Razão/Notas de Retorno",adjustmentDate:"Data de Ajuste",creditToAccount:"Crédito na Conta"},alerts:{returnedTitle:"Medicação Retornada",returnedMessage:"A medicação foi marcada como retornada.",savedTitle:"Requisição de Medicação foi Salva",savedMessage:"O registro de medicação foi salvo.",fulfilledTitle:"Requisição de Medicação Preenchido"}},appointments:{currentScreenTitle:"Lista de Compromisso",editTitle:"Editar Compromisso",newTitle:"Novo Compromisso",sectionTitle:"Compromissos",thisWeek:"Compromissos dessa Semana",missed:"Compromissos Esquecidos",searchTitle:"Pesquisar Compromissos",todayTitle:"Compromissos de Hoje",messages:{deleteAppointmentMessage:"Você tem certeza que deseja excluir esse compromisso?",endTimeLaterThanStart:"Por favor, selecione um horário de término mais tarde do que a hora de início."},buttons:{newButton:"+ novo compromisso"},labels:{selectedStartingDate:"Mostrar Compromisso em ou após"}},vitals:{messages:{delete:"Você tem certeza que deseja excluir esses sinais vitais?"},labels:{dateRecorded:"Data de Gravação",temperature:"Temperatura",weight:"Peso",height:"Altura",sbp:"PAS",dbp:"PAD",heartRate:"Frequência Cardíaca",respiratoryRate:"Frequência Respiratória"}},visits:{titles:{additionalDiagnoses:"Diagnósticos Adicionais"},messages:{delete:"Você tem certeza que deseja excluir essa visita?"},buttons:{newProcedure:"Novo Procedimento",newLab:"Novo Laboratório",newAppointment:"Novo Compromisso",addDiagnosis:"Adicionar Diagnóstico",newImaging:"Nova Imagem",newMedication:"Nova Medicação",newVitals:"Novos Sinais Vitais"},labels:{diagnosis:"Diagnósticos",procedure:"Procedimentos",authoredBy:"Autorizado Por",labs:"Laboratório",imaging:"Imagem",visitInformation:"Imformação de Visita",examiner:"Examinador",medication:"Medicação",status:"Situação de Visita",admittingDiagnosis:"Diagnósticos de Admisão",finalDiagnosis:"Diagnósticos de Finais/Faturamento",visitType:"Tipo de Visita",vitals:"Sinais Vitais"}},labs:{sectionTitle:"Laboratório",requestsTitle:"Requisições de Laboratório",editTitle:"Editar Requisição de Laboratório",newTitle:"Nova Requisição de Laboratório",deleteTitle:"Excluir Requisição",completedTitle:"Laboratórios Concluídos",labels:{labType:"Tipo de Laboratório",addNewVisit:"--Adicionar Nova Visita--"},messages:{noItemsFound:"Nenhum laboratório encontrado.",createNewRecord:"Criar novo registro?",confirmDeletion:"VOcê tem certeza que deseja excluir essa requisição de laboratório?",noCompleted:"Items concluídos não econtrados."},buttons:{newButton:"+ novo laboratório"},alerts:{requestCompletedTitle:"Requisições de Laboratório Concluída",requestCompletedMessage:"Requisição de laboratório foi concluída.",requestSavedTitle:"Requisição de Laboratório Salva",requestSavedMessage:"A requisição de laboratório foi salva."}},patients:{navigation:{photos:"Fotos",general:"Geral",history:"Histórico",appointments:"Compromissos",visits:"Visitas",medication:"Medicação",imaging:"Imagem",labs:"Laboratórios",socialWork:"Assitência Social"},titles:{expenses:"Despesas",additionalContacts:"Contatos Adicionais",familyInformation:"Informação Familiar",delete:"Excluir Paciente",new:"Novo Paciente",edit:"Editar Paciente",patient:"Relatório de Paciente",patientListing:"Lista de Pacientes",addPhoto:"Adicionar Foto",editPhoto:"Editar Foto",socialWork:"Despesa",familyInfo:"Informação Familiar",deleteFamilyMember:"Excluir Membro Familiar",deleteExpense:"Excluir Despesa",deletePhoto:"Excluir Foto",deleteContact:"Excluir Contato",savedPatient:"Paciente Salvo"},messages:{areYouSureDelete:"Você tem certeza que deseja excluir este(a) {{object}}?",deletePatient:"Você tem certeza que deseja excluir {{firstName}} {{lastName}}?",noPatientsFound:"Nenhum paciente encontrado.",savedPatient:"O registro de paciente para {{displayName}} foi salvo.",notFoundQuickAdd:"O paciente {{patientFullName}} não pode ser encontrato. Se você deseja cadastras um novo paciente, preencha as informações abaixo. Caso contrário clique em Cancelar para voltar.",createNewPatient:"Criar novos registro de paciente?"},buttons:{addExpense:"Adicionar Despesa",addContact:"Adicionar Contato",newLab:"Novo Laboratório",newVisit:"Nova Visita",newMedication:"Nova Medicação",newImaging:"Nova Imagem",addFamilyMember:"Adicionar Membro Familiar",newPhoto:"Nova Foto",newAppointment:"Novo Compromisso",backToPatients:"Voltar para Lista de Pacientes",newPatient:"+ novo paciente"},labels:{primaryDiagnosis:"Diagnósticos Primários",secondaryDiagnosis:"Diagnósticos Secundários",monthlyCost:"Custo Mensal",totalMontlyExpense:"Total de Despesas Mensais",patientType:"Tipo de Paciente",admissionDate:"Data de Admissão",patientDays:"Dias do Paciente",dischargeDate:"Data de Pagamento",discharge:"Pagamento",admit:"Admitir",relationships:"Relação",phone:"Telefone",email:"Email",firstName:"Primeiro Nome",middleName:"Nome do meio",lastName:"Último Nome",sex:"Sexo",dob:"DatNasc",dateOfBirth:"Data de Nascimento",placeOfBirth:"Local de Nascimento",sources:"Fontes",cost:"Custo",civilStatus:"Estado Civil",relationship:"Relação com Paciente",education:"Educação",occupation:"Ocupação",income:"Renda",insurance:"Seguro",dateProcessed:"Data de Processamento",status:"Situação do Paciente",externalPatientId:"ID de Paciente Externo",bloodType:"Tipo Sanguíneo",clinic:"Site(Filial) da Clínica",referredBy:"Indicado Por",referredDate:"Data de Indicação",religion:"Religião",parent:"Responsável Legal"},notes:{newNote:"Nova Nota para",updateNote:"Atualizando Nota de",onBehalfOfLabel:"Em Nome de",onBehalfOfCopy:"em nome de",pleaseSelectAVisit:"Por favor selecione uma visita"}},billing:{alerts:{noInvoiceFound:"Nenhuma fatura encontrada",deleteItem:"Você tem certeza que deseja excluir {{item}}?",noPricingItems:"Nenhum item de preço encontrado.",noPricingProfiles:"Nenhum perfil de preço encontrado."},buttons:{createInvoice:"Criar nova fatura?",addOverride:"Adicionar Substituir"},labels:{externalInvoiceNumber:"Fatura Externa #",paymentProfile:"Perfil de Pagamento",actualCharges:"Cobranças Atuais",insurance:"Seguro Nacional",hmoCom:"HMO/COM",paymentsDeposits:"Pagamentos/Depositos",pricingPanelOverrides:"Substituição e Perfil de Preços",pricingProfile:"Perfil de Preços",discountAmount:"Quantidade de Desconto",discountPercentage:"Porcentagem de Desconto"}},print:{invoice:{labels:{patientName:"NOME DO PACIENTE:",patientId:"PACIENTE #:",patientAge:"IDADE:",patientAddress:"ENDEREÇO:",dateAdmitted:"ADMITIDO:",dateDischarged:"PAGAMENTO:",dischargeNotes:"Notas de Pagamento:",remarks:"Observações:",billedBy:"Faturado por:",billedDate:"Data de Faturamento:",spacer:"__________________________________________"},messages:{whereConducted:"foram deduzidos durante minha internação"},titles:{patientMember:"Paciente-Membro",relContact:"Relações/Contato",patients:"DO PACIENTE",billingStatement:"DECLARAÇÃO DO FATURAMENTO"}}},procedures:{titles:{addChargeItem:"Adicionar Item de Cobrança",deleteChargeItem:"Excluir Item de Cobrança",editChargeItem:"Editar Item de Cobrança",medicationUsed:"Medicação Usada",deleteMedicationUsed:"Excluir Medicação Usada",addMedicationUsed:"Adicionar Medicação Usada",editMedicationUsed:"Editar Medicação Usada",edit:"Editar Procedimento",saved:"Procedimento Salvo",new:"Novo Procedimento"},labels:{medicationUsed:"Medicação Usada"},messages:{deleteMedication:"Você tem certeza que deseja excluir esta medicação?",delete:"Você tem certeza que deseja excluir este procedimento?",saved:"O registro de procedimento foi salvo."},buttons:{addMedication:"Adicionar Medicação"}},components:{chargesByTypeTab:{charges:"cobranças"},takePhoto:{how:"Como você quer adicionar um Foto?",takePhoto:"Tirar um Foto",uploadPhoto:"Upload de Foto",uploadFile:"Upload de Arquivo",camera:"Câmera",photo:"foto",preview:"pré visualização"},quantityConv:{unit:"Unidade",conversion:"O que significa contém 1 {{name}}?"},quantityCalc:{result:"{{targetUnit}} total: {{calculated}}"},priceList:{charges:"cobranças de {{pricingType}}"}}}}),define("hospitalrun/locales/ru/translations",["exports"],function(e){e.default={dashboard:{title:"Что вы хотите сделать?"},labels:{name:"Имя",patient:"Пациент",quantity:"Количество",requestedOn:"Запрошен",dateRequested:"Дата Запроса",dateCompleted:"Дата Выполнения",requestedBy:"Запрошен",fulfill:"Отправить",actions:"Действия",action:"Действие",notes:"Заметки",edit:"Редактировать",imagingType:"Тип визуализации",result:"Результат",results:"Результаты",visit:"Осмотр",requests:"Ожидающие",completed:"Выполненые",id:"Номер",sex:"Пол",age:"Возраст"},messages:{noItemsFound:"Ничего не найдено.",createNewRecord:"Создать новую запись?",forAuthorizedPersons:"Этот отчет предназначен только для уполномоченных лиц."},buttons:{complete:"Готово",cancel:"Отметить",returnButton:"Вернутся",add:"Добавить",update:"Обновить",ok:"Ок"},login:{messages:{signIn:"войдите в систему",error:"Неверное имя пользователя или пароль."},labels:{password:"Пароль",username:"Имя пользователя",signIn:"Войти"}},inventory:{messages:{noRequests:"Запросов не найдено.",createRequest:"Создать новый запрос?"}},imaging:{pageTitle:"Запросы на визуализацию",sectionTitle:"Визуализация",buttons:{newButton:"+ новый запрос"},labels:{radiologist:"Радиолог",addNewVisit:"--Добавить новый тип осмотра--"},messages:{noCompleted:"Не найдено выполненых запросов."},titles:{completedImaging:"Выполненые запросы",editTitle:"Редактировать запрос на визуализацию",newTitle:"Новый запрос на визуализацию"},alerts:{completedTitle:"Визуализация выполнена",completedMessage:"Запрос на визуализацию удовлетворён.",savedTitle:"Запрос сохранён",savedMessage:"Запрос на визуализацию сохранён."}}}}),define("hospitalrun/locales/tr/translations",["exports"],function(e){e.default={dashboard:{title:"Ne yapmak istersiniz?"},labels:{name:"Ad",patient:"Hasta",quantity:"Miktar",requestedOn:"Açık Talep",dateRequested:"Talep Tarihi",dateCompleted:"Bitiş tarihi",requestedBy:"Talep sahibi",fulfill:"Fulfill",actions:"İşlemler",action:"İşlem",notes:"Notlar",edit:"Düzenle",imagingType:"Görüntüleme Tipi",result:"Sonuç",results:"Sonuçlar",visit:"Ziyaret",requests:"Talepler",completed:"Tamamlandı",id:"Id",sex:"Cinsiyet",age:"Yaş"},messages:{noItemsFound:"Hiçbir öğe bulunamadı.",createNewRecord:"Yeni bir kayıt oluştur?",forAuthorizedPersons:"Bu rapor yetkili kişiler içindir."},buttons:{complete:"Bitir",cancel:"Vazgeç",returnButton:"Geri Dön",add:"Ekle",update:"Güncelle",ok:"Tamam"},login:{messages:{signIn:"GİRİŞ YAPIN",error:"Kullanıcı adı veya parola hatalı."},labels:{password:"Parola",username:"Kullanıcı Adı",signIn:"Giriş yap"}},inventory:{messages:{noRequests:"Talep bulunamadı",createRequest:"Yeni talep oluştur?"}},imaging:{pageTitle:"Görüntüleme talepleri",sectionTitle:"Görüntüleme",buttons:{newButton:"+ yeni görüntüleme"},labels:{radiologist:"Radyolog",addNewVisit:"--Yeni Ziyaret Ekle--"},messages:{noCompleted:"Tamamlanmayan öğe bulunamadı."},titles:{completedImaging:"Görüntüleme Tamamlandı",editTitle:"Görüntüleme Talebini Düzenle",newTitle:"Yeni Görüntüleme Talebi"},alerts:{completedTitle:"Görüntüleme Talebi Tamamlandı",completedMessage:"Görüntüleme talebi başarıyla tamamlandı.",savedTitle:"Görüntüleme Talebi Kaydedildi",savedMessage:"Görüntüleme Talebi başarıyla kaydedildi."}}}}),define("hospitalrun/medication/completed/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({showActions:!1,startKey:[]})}),define("hospitalrun/medication/completed/route",["exports","ember-i18n","hospitalrun/medication/index/route"],function(e,t,n){e.default=n.default.extend({modelName:"medication",pageTitle:(0,t.translationMacro)("medication.titles.completedMedication"),searchStatus:"Fulfilled"})}),define("hospitalrun/medication/completed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"wgSAKpsG",block:'{"statements":[["partial","medication/index"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":true}',meta:{moduleName:"hospitalrun/medication/completed/template.hbs"}})}),define("hospitalrun/medication/delete/controller",["exports","ember-i18n","hospitalrun/controllers/abstract-delete-controller","hospitalrun/mixins/patient-submodule"],function(e,t,n,a){e.default=n.default.extend(a.default,{title:(0,t.translationMacro)("labels.delete_request"),actions:{delete:function(){this.deleteChildFromVisit("medication")}}})}),define("hospitalrun/medication/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"TYQrMXNj",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["medication.messages.confirmDeletion"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/medication/delete/template.hbs"}})}),define("hospitalrun/medication/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/add-new-patient","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(n.default,l.default,s.default,i.default,o.default,{medicationController:a.default.inject.controller("medication"),expenseAccountList:a.default.computed.alias("medicationController.expenseAccountList"),canFulfill:function(){return this.currentUserCan("fulfill_medication")}.property(),isFulfilled:function(){var e=this.get("model.status");return"Fulfilled"===e}.property("model.status"),isFulfilling:function(){var e=this.get("canFulfill"),t=this.get("model.isRequested"),n=this.get("model.shouldFulfillRequest"),a=e&&(t||n);return this.get("model").set("isFulfilling",a),a}.property("canFulfill","model.isRequested","model.shouldFulfillRequest"),isFulfilledOrRequested:function(){return this.get("isFulfilled")||this.get("model.isRequested")}.property("isFulfilled","model.isRequested"),prescriptionClass:function(){var e=this.get("model.quantity");if(a.default.isEmpty(e))return"required"}.property("model.quantity"),quantityClass:function(){var e=this.get("model.prescription"),t="col-xs-3",n=this.get("isFulfilling");return(n||a.default.isEmpty(e))&&(t+=" required"),t+" test-quantity-input"}.property("isFulfilling","model.prescription"),quantityLabel:function(){var e=this.get("i18n"),t=e.t("medication.labels.quantityRequested"),n=this.get("isFulfilled"),a=this.get("isFulfilling");return a?t=e.t("medication.labels.quantityDispensed"):n&&(t=e.t("medication.labels.quantityDistributed")),t}.property("isFulfilled"),medicationList:[],updateCapability:"add_medication",afterUpdate:function(){var e=this.get("i18n"),t=void 0,n=void 0,a=this.get("isFulfilled");a?(t=e.t("medication.alerts.fulfilledTitle"),n="The medication request has been fulfilled.",this.set("model.selectPatient",!1)):(t=e.t("medication.alerts.savedTitle"),n=e.t("medication.alerts.savedMessage")),this.saveVisitIfNeeded(t,n)},beforeUpdate:function(){var e=this.get("isFulfilling"),t=this.get("model.isNew");return t||e?new a.default.RSVP.Promise(function(n,l){var s=this.get("model");s.validate().then(function(){s.get("isValid")?t?a.default.isEmpty(s.get("patient"))?(this.addNewPatient(),l({ignore:!0,message:"creating new patient first"})):(s.set("medicationTitle",s.get("inventoryItem.name")),s.set("priceOfMedication",s.get("inventoryItem.price")),s.set("status","Requested"),s.set("requestedBy",s.getUserName()),s.set("requestedDate",new Date),this.addChildToVisit(s,"medication","Pharmacy").then(function(){this.finishBeforeUpdate(e,n)}.bind(this),l)):this.finishBeforeUpdate(e,n):(this.send("showDisabledDialog"),l("invalid model"))}.bind(this)).catch(function(){this.send("showDisabledDialog"),l("invalid model")}.bind(this))}.bind(this)):a.default.RSVP.resolve()},finishBeforeUpdate:function(e,t){if(e){var n=this.get("model.inventoryLocations"),a=this.get("store").createRecord("inv-request",{expenseAccount:this.get("model.expenseAccount"),dateCompleted:new Date,inventoryItem:this.get("model.inventoryItem"),inventoryLocations:n,quantity:this.get("model.quantity"),transactionType:"Fulfillment",patient:this.get("model.patient"),markAsConsumed:!0});this.performFulfillRequest(a,!1,!1,!0).then(function(){this.set("model.status","Fulfilled"),t()}.bind(this))}else t()},showUpdateButton:function(){var e=this.get("isFulfilled");return!e&&this._super()}.property("updateCapability","isFulfilled"),updateButtonText:function(){var e=this.get("i18n");return this.get("model.hideFulfillRequest")?e.t("buttons.dispense"):this.get("isFulfilling")?e.t("labels.fulfill"):this._super()}.property("model.isNew","isFulfilling","model.hideFulfillRequest")})}),define("hospitalrun/medication/edit/route",["exports","ember-i18n","hospitalrun/routes/abstract-edit-route","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/patient-list-route","npm:uuid"],function(e,t,n,a,l,s,i,o){e.default=n.default.extend(l.default,s.default,i.default,{editTitle:(0,t.translationMacro)("medication.titles.editMedicationRequest"),modelName:"medication",newTitle:(0,t.translationMacro)("medication.titles.newMedicationRequest"),database:a.default.inject.service(),getNewData:function(e){var t=this.get("idParam"),n={selectPatient:!0,prescriptionDate:moment().startOf("day").toDate()};return"dispense"===e[t]&&(n.shouldFulfillRequest=!0,n.hideFulfillRequest=!0),n.id=o.default.v4(),a.default.RSVP.resolve(n)},model:function(e){var t=this.get("idParam");return!a.default.isEmpty(t)&&"new"===e[t]||"dispense"===e[t]?this._createNewRecord(e):this._super(e)},setupController:function(e,t){this._super(e,t);var n={key:"Medication",include_docs:!0},l=t.get("inventoryItem.id"),s=t.get("patient");a.default.isEmpty(l)&&this.get("database").queryMainDB(n,"inventory_by_type").then(function(t){var n=t.rows.map(function(e){return e.doc});e.set("medicationList",n)}),a.default.isEmpty(s)&&this._fetchPatientList(e)}})}),define("hospitalrun/medication/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Xm0JjdeG",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],15]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection"],["expenseAccount",["helper",["t"],["labels.billTo"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]]]]],false],["text","\\n "],["append",["helper",["inventory-location-picker"],null,[["label","quantityRequested","locationList","selectedLocations","class"],[["helper",["t"],["labels.pullFrom"],null],["get",["model","quantity"]],["get",["model","inventoryItem","availableLocations"]],["get",["model","inventoryLocations"]],"inventory-location"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.fulfillRequest"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["labels.fulfillRequestNow"],null],"shouldFulfillRequest"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canFulfill"]]],null,1]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,2]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["property","label","rows","class"],["prescription",["helper",["t"],["labels.prescription"],null],"3",["get",["prescriptionClass"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["prescriptionDate",["helper",["t"],["labels.prescriptionDate"],null],"col-sm-4"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["get",["quantityLabel"]],["get",["quantityClass"]]]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["refills",["helper",["t"],["medication.labels.refills"],null],"col-xs-3"]]],false],["text","\\n "],["close-element"],["text","\\n"],["block",["unless"],[["get",["model","hideFulfillRequest"]]],null,3],["block",["if"],[["get",["isFulfilling"]]],null,0]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-format"],[["get",["model","prescriptionDate"]]],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["static-text"],null,[["label","value"],[["helper",["t"],["labels.prescription"],null],["get",["model","prescription"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["static-text"],null,[["label","class"],[["helper",["t"],["labels.prescriptionDate"],null],"col-xs-4"]],5],["text"," "],["append",["helper",["static-text"],null,[["label","class","value"],[["get",["quantityLabel"]],"col-xs-3",["get",["model","quantity"]]]]],false],["text","\\n "],["append",["helper",["static-text"],null,[["label","class","value"],[["helper",["t"],["medication.labels.refills"],null],"col-xs-3",["get",["model","refills"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.prescriber"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","requestedBy"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["inventory-typeahead"],null,[["property","label","content","selection","class"],["inventoryItemTypeAhead",["helper",["t"],["labels.medication"],null],["get",["medicationList"]],["get",["selectedInventoryItem"]],"required test-medication-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.medication"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","medicationName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDescription"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","prompt","selected"],["col-xs-4 required test-add-visit",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["helper",["t"],["labels.addNewOutpatientVisit"],null],["get",["model","visit"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"col-xs-6 required test-patient-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"medication.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["model","selectPatient"]]],null,13],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["if"],[["get",["model","selectPatient"]]],null,12],["block",["if"],[["get",["model","isNew"]]],null,11,10],["text"," "],["close-element"],["text","\\n"],["block",["if"],[["get",["isFulfilledOrRequested"]]],null,9,8],["block",["if"],[["get",["isFulfilledOrRequested"]]],null,7],["block",["if"],[["get",["isFulfilled"]]],null,6,4]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],14]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/medication/edit/template.hbs"}})}),define("hospitalrun/medication/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],canAdd:function(){return this.currentUserCan("add_medication")}.property(),showActions:function(){return this.currentUserCan("fulfill_medication")}.property()})}),define("hospitalrun/medication/index/route",["exports","ember-i18n","hospitalrun/routes/abstract-index-route"],function(e,t,n){e.default=n.default.extend({modelName:"medication",pageTitle:(0,t.translationMacro)("medication.pageTitle"),searchStatus:"Requested",_getStartKeyFromItem:function(e){var t=e.get("prescriptionDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("requestedDateAsTime"),l=this.get("searchStatus");return[l,a,t,n]},_modelQueryParams:function(){var e=this._getMaxPouchId(),t=this.get("maxValue"),n=this._getMinPouchId(),a=this.get("searchStatus");return{options:{startkey:[a,null,null,n],endkey:[a,t,t,e]},mapReduce:"medication_by_status"}}})}),define("hospitalrun/medication/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"xGEaoO6P",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["medication.messages.createNew"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"editItem",["get",["medicationRequest"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.fulfill"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["medicationRequest"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["medicationRequest","prescriptionDate"]]],[["format"],["l h:mm A"]]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","patient","displayName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","medicationName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","quantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","status"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":["medicationRequest"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.prescriber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.medication"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,4],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,3],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model"]]],null,5,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/medication/index/template.hbs"}})}),define("hospitalrun/medication/return/controller",["exports","ember-i18n","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/patient-submodule","hospitalrun/utils/select-values"],function(e,t,n,a,l,s,i,o){e.default=n.default.extend(l.default,s.default,i.default,{medicationController:a.default.inject.controller("medication"),medicationList:[],lookupListsToUpdate:[{name:"aisleLocationList",property:"model.aisleLocation",id:"aisle_location_list"},{name:"expenseAccountList",property:"model.expenseAccount",id:"expense_account_list"},{name:"warehouseList",property:"model.location",id:"warehouse_list"}],patientMedicationList:[],setNewMedicationList:!1,aisleLocationList:a.default.computed.alias("medicationController.aisleLocationList"),expenseAccountList:a.default.computed.alias("medicationController.expenseAccountList"),warehouseList:a.default.computed.alias("medicationController.warehouseList"),updateCapability:"add_medication",medicationChanged:function(){var e=this.get("model.medication");if(a.default.isEmpty(e))this.set("model.inventoryItem");else{var t=e.get("inventoryItem");this.set("model.inventoryItemTypeAhead",t.get("name")+" - "+t.get("friendlyId")),this.set("model.inventoryItem",t)}a.default.run.later(function(){this.get("model").validate().catch(a.default.K)}.bind(this))}.observes("model.medication"),patientVisitsChanged:function(){var e=this.get("patientVisits");a.default.isEmpty(e)||this.set("model.visit",e.get("firstObject"))}.observes("patientVisits"),showPatientMedicationList:function(){var e=this.get("patientMedicationList");return this.get("patientMedication"),!a.default.isEmpty(e)}.property("patientMedicationList","model.patient","model.visit"),patientMedication:function(){var e=this.get("setNewMedicationList"),t=this.get("model.visit");return e?this.set("setNewMedicationList",!1):a.default.isEmpty(t)||t.get("medication").then(function(e){e=e.filterBy("status","Fulfilled"),this.set("model.medication",e.get("firstObject")),this.set("patientMedicationList",e.map(o.default.selectObjectMap)),this.set("setNewMedicationList",!0)}.bind(this)),this.get("patientMedicationList")}.property("setNewMedicationList","model.patient","model.visit"),_finishUpdate:function(){var e=this.get("model.deliveryAisle"),t=this.get("model.deliveryLocation"),n=this.get("model.inventoryItem");this._findOrCreateLocation(n,t,e).then(function(e){this.set("model.adjustPurchases",!0),this.set("model.inventoryLocations",[e]),this.set("model.markAsConsumed",!0),this.get("model.inventoryItem").then(function(){this.send("fulfillRequest",this.get("model"),!1,!0,!0)}.bind(this))}.bind(this))},actions:{doneFulfillRequest:function(){var e=this.get("i18n");this.updateLookupLists(),this.displayAlert(e.t("medication.alerts.returnedTitle"),e.t("medication.alerts.returnedMessage"),"allItems")},update:function(){var e=this.get("model.medication"),t=this.get("model.quantity");a.default.isEmpty(e)?this._finishUpdate():e.reload().then(function(){e.decrementProperty("quantity",t),e.get("quantity")<0&&e.set("quantity",0),e.save().then(this._finishUpdate.bind(this))}.bind(this))}},updateButtonText:(0,t.translationMacro)("medication.returnMedication")})}),define("hospitalrun/medication/return/route",["exports","ember-i18n","hospitalrun/medication/edit/route","ember"],function(e,t,n,a){e.default=n.default.extend({editTitle:(0,t.translationMacro)("medication.returnMedication"),modelName:"inv-request",newTitle:(0,t.translationMacro)("medication.returnMedication"),getNewData:function(){return a.default.RSVP.resolve({dateCompleted:new Date,selectPatient:!0,transactionType:"Return"})}})}),define("hospitalrun/medication/return/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"YZt6viXc",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["inventory-typeahead"],null,[["property","label","content","selection","class","showQuantity"],["inventoryItemTypeAhead",["helper",["t"],["labels.medication"],null],["get",["medicationList"]],["get",["selectedInventoryItem"]],"required test-medication-input",false]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected"],["required",["helper",["t"],["labels.medication"],null],"medication",["get",["patientMedication"]],"selectObject","selectObject.inventoryItem.name",["get",["model","medication"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["showPatientMedicationList"]]],null,1,0],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"col-xs-6"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected"],["col-xs-6",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["get",["model","visit"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["helper",["t"],["medication.labels.quantityToReturn"],null],"col-xs-3 required test-medication-quantity"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["deliveryLocation",["helper",["t"],["medication.labels.returnLocation"],null],["get",["warehouseList"]],["get",["model","location"]],"col-xs-4"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["deliveryAisle",["helper",["t"],["medication.labels.returnAisle"],null],["get",["aisleLocationList"]],["get",["model","aisleLocation"]],"col-xs-4"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["property","label","rows"],["reason",["helper",["t"],["medication.labels.returnReason"],null],"3"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["medication.labels.adjustmentDate"],null],"col-sm-4"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["expenseAccount",["helper",["t"],["medication.labels.creditToAccount"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]],"col-sm-8"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],2]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/medication/return/template.hbs"}})}),define("hospitalrun/medication/route",["exports","ember-i18n","hospitalrun/routes/abstract-module-route","ember"],function(e,t,n,a){e.default=n.default.extend({addCapability:"add_medication",moduleName:"medication",newButtonText:(0,t.translationMacro)("medication.buttons.newButton"),sectionTitle:(0,t.translationMacro)("medication.sectionTitle"),additionalButtons:function(){var e=this.get("i18n"),t=[];if(this.currentUserCan("fulfill_medication")&&t.push({buttonIcon:"octicon octicon-checklist",buttonAction:"dispenseMedication",buttonText:e.t("medication.buttons.dispenseMedication"),class:"btn btn-primary"}),this.currentUserCan(this.get("addCapability"))&&t.push({buttonIcon:"octicon octicon-mail-reply",buttonAction:"returnMedication",buttonText:e.t("medication.buttons.returnMedication"),class:"btn btn-primary"}),!a.default.isEmpty(t))return t}.property(),additionalModels:[{name:"aisleLocationList",findArgs:["lookup","aisle_location_list"]},{name:"expenseAccountList",findArgs:["lookup","expense_account_list"]},{name:"sexList",findArgs:["lookup","sex"]},{name:"warehouseList",findArgs:["lookup","warehouse_list"]}],actions:{dispenseMedication:function(){this.currentUserCan("fulfill_medication")&&this.transitionTo("medication.edit","dispense")},returnMedication:function(){this.currentUserCan(this.get("addCapability"))&&this.transitionTo("medication.return","new")}}})}),define("hospitalrun/medication/search/route",["exports","hospitalrun/routes/abstract-search-route"],function(e,t){e.default=t.default.extend({moduleName:"medication",searchKeys:[{name:"prescription",type:"contains"}],searchModel:"medication"})}),define("hospitalrun/medication/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"T9jkbT1t",block:'{"statements":[["block",["search-listing"],null,[["newButtonText","allButtonText"],[["helper",["t"],["buttons.newRequest"],null],["helper",["t"],["buttons.allRequests"],null]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","medication/index"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/medication/search/template.hbs"}})}),define("hospitalrun/mixins/active-link",["exports","ember-cli-active-link-wrapper/mixins/active-link"],function(e,t){e.default=t.default}),define("hospitalrun/mixins/add-new-patient",["exports","ember","hospitalrun/mixins/patient-id"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{customForms:t.default.inject.service(),addedNewPatient:!1,newPatientId:null,actions:{addedNewPatient:function(e){this.send("closeModal"),this.set("addedNewPatient",!0),this.set("model.patient",e),this.set("newPatientId"),this.send("update")}},addNewPatient:function(){var e=this,n=this.get("i18n");this.displayAlert(n.t("alerts.pleaseWait"),n.t("messages.newPatientHasToBeCreated")),this._getNewPatientId().then(function(n){var a=e.get("model.patientTypeAhead"),l=a.split(" "),s={customForms:t.default.Object.create(),friendlyId:n,patientFullName:a,requestingController:e},i=e.get("customForms");return i.setDefaultCustomForms(["patient","socialwork"],s).then(function(){var t=void 0;l.length>=3?(s.firstName=l[0],s.middleName=l[1],s.lastName=l.splice(2,l.length).join(" ")):2===l.length?(s.firstName=l[0],s.lastName=l[1]):s.firstName=a,t=e.store.createRecord("patient",s),e.send("openModal","patients.quick-add",t)})})},_getNewPatientId:function(){var e=this.get("newPatientId");return t.default.isEmpty(e)?new t.default.RSVP.Promise(function(e,t){this.generateFriendlyId().then(function(t){this.set("newPatientId",t),e(t)}.bind(this),t)}.bind(this)):t.default.RSVP.resolve(e)}})}),define("hospitalrun/mixins/appointment-statuses",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({appointmentStatusList:["Attended","Scheduled","Canceled","Missed"],appointmentStatuses:t.default.computed.map("appointmentStatusList",n.default.selectValuesMap),appointmentStatusesWithEmpty:function(){return n.default.selectValues(this.get("appointmentStatusList"),!0)}.property()})}),define("hospitalrun/mixins/billing-categories",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({defaultBillingCategories:["Hospital Charges"]})}),define("hospitalrun/mixins/blood-types",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({bloodTypes:["A+","A-","AB-","AB+","B+","B-","O+","O-"].map(n.default.selectValuesMap)})}),define("hospitalrun/mixins/can-edit-requested",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({canEdit:function(){var e=this.get("status");return"Requested"===e}.property("status")})}),define("hospitalrun/mixins/charge-actions",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({chargePricingCategory:null,pricingList:null,pricingTypeForObjectType:null,pricingTypes:null,_createNewChargeRecord:function(e,n){return new t.default.RSVP.Promise(function(t,a){this.store.find("pricing",n).then(function(n){var l=this.store.createRecord("proc-charge",{dateCharged:new Date,quantity:e,pricingItem:n});l.save().then(function(e){var n=this.get("model.charges");n.addObject(e),t()}.bind(this),a)}.bind(this),a)}.bind(this),"_createNewChargeRecord with pricingId:"+n)},actions:{addCharge:function(e){var t=this.get("model.charges");t.addObject(e),this.send("update",!0),this.send("closeModal")},deleteCharge:function(e){var t=e.get("chargeToDelete"),n=this.get("model.charges");n.removeObject(t),t.destroyRecord(),this.send("update",!0),this.send("closeModal")},showAddCharge:function(){var e=this.get("store").createRecord("proc-charge",{dateCharged:new Date,quantity:1,pricingCategory:this.get("chargePricingCategory")});this.send("openModal",this.get("chargeRoute"),e)},showEditCharge:function(e){e.set("itemName",e.get("pricingItem.name")),e.set("pricingCategory",this.get("chargePricingCategory")),this.send("openModal",this.get("chargeRoute"),e)},showDeleteCharge:function(e){this.send("openModal","dialog",t.default.Object.create({confirmAction:"deleteCharge",title:"Delete Charge Item",message:"Are you sure you want to delete this charged item?",chargeToDelete:e,updateButtonAction:"confirm",updateButtonText:this.get("i18n").t("buttons.ok")}))},setChargeQuantity:function(e,t){var n=this.get("model");n.set(e,t)}},canAddCharge:function(){return this.currentUserCan("add_charge")}.property(),chargesPricingList:function(){var e=this.get("pricingList"),t=this.get("pricingTypeForObjectType");return e.filter(function(e){return e.type!==t})}.property("pricingList","pricingTypeForObjectType"),chargeRoute:null,findChargeForPricingItem:function(e,t){var n=t.find(function(t){var n=t.get("pricingItem.id");return e.id===n});return n},objectTypeList:function(){var e=this.get("pricingList"),n=this.get("pricingTypeForObjectType"),a=this.get("userCanAddPricingTypes"),l=t.default.Object.create({value:[],userCanAdd:a});return t.default.isEmpty(e)||l.set("value",e.filterBy("pricingType",n)),l}.property("pricingList","pricingTypeForObjectType","pricingTypeValues"),organizeByType:t.default.computed.alias("pricingTypes.organizeByType"),pricingTypeList:function(){var e=this.get("pricingList"),n=this.get("pricingTypeValues"),a=this.get("pricingTypeForObjectType");if(!t.default.isEmpty(n))return n=n.filter(function(n){var l=!1;return t.default.isEmpty(e)||(l=!t.default.isEmpty(e.findBy("pricingType",n))),l&&n!==a}),n=n.sortBy("name")}.property("pricingTypeValues","pricingTypeForObjectType","pricingList"),pricingTypeValues:t.default.computed.alias("pricingTypes.value"),createMultipleRequests:function(e,t,n,a){var l=e.get("firstObject"),s=this.get("model");s.set(t,l),this.addChildToVisit(s,n,a).then(function(l){s.save().then(function(){this._finishCreateMultipleRequests(e,t,n,a,l)}.bind(this))}.bind(this))},_finishCreateMultipleRequests:function(e,n,a,l,s){var i={},o=this.get("model"),r=void 0,d=[],c=this.get("model.patient"),u=[];o.eachAttribute(function(e){i[e]=o.get(e)}),e.forEach(function(e,t){t>0&&(r=this.store.createRecord(l.toLowerCase(),i),r.set(n,e),r.set("patient",c),r.set("visit",s),d.push(r),u.push(r.save()))}.bind(this)),t.default.RSVP.all(u).then(function(){var e=[];d.forEach(function(t){e.push(this.addChildToVisit(t,a,l))}.bind(this)),t.default.RSVP.all(e).then(function(e){this.afterUpdate(e,!0)}.bind(this))}.bind(this))},saveNewPricing:function(e,n,a){return new t.default.RSVP.Promise(function(t,l){var s=void 0,i=this.get("pricingTypeForObjectType");s=this.store.createRecord("pricing",{name:e,category:n,pricingType:i}),s.save().then(function(e){this.get("pricingList").addObject({id:e.get("id"),name:s.get("name")}),this.set(a,s),t()}.bind(this),l)}.bind(this),"saveNewPricing for: "+e)},getSelectedPricing:function(e){var n=this.get(e);return t.default.isEmpty(n)?t.default.RSVP.resolve():new t.default.RSVP.Promise(function(e,a){t.default.isArray(n)?this.store.findByIds("pricing",n).then(e,a):this.store.find("pricing",n.id).then(e,a)}.bind(this))},showAddCharge:function(){var e=this.get("canAddCharge"),t=this.get("organizeByType");return!!e&&!t}.property("canAddCharge","organizeByType"),showEditCharges:function(){var e=this.get("canAddCharge"),t=this.get("organizeByType");return!!e&&t}.property("canAddCharge","organizeByType"),showPricingTypeTabs:function(){var e=this.get("pricingTypeList");return!t.default.isEmpty(e)&&e.get("length")>1}.property("pricingTypeList"),userCanAddPricingTypes:function(){var e=this.get("pricingTypes");return!!t.default.isEmpty(e)||e.get("userCanAdd")}.property("pricingTypes"),updateCharges:function(){var e=this.get("model.charges"),n=this.get("organizeByType"),a=this.get("pricingList");return n?new t.default.RSVP.Promise(function(n,l){var s=[],i=this.get("model");a.forEach(function(n){var a=this.findChargeForPricingItem(n,i.get("charges")),l=i.get(n.id);t.default.isEmpty(l)?a&&(e.removeObject(a),s.push(a.destroyRecord())):a?a.get("quantity")!==l&&(a.set("quantity",l),s.push(a.save())):s.push(this._createNewChargeRecord(l,n.id))}.bind(this)),t.default.RSVP.all(s,"Charges updated for current record: "+this.get("model.id")).then(n,l)}.bind(this),"updateCharges for current record: "+this.get("model.id")):t.default.RSVP.resolve()}})}),define("hospitalrun/mixins/charge-route",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({database:t.default.inject.service(),actions:{deleteCharge:function(e){this.controller.send("deleteCharge",e)}},pricingList:null,afterModel:function(){return new t.default.RSVP.Promise(function(e,t){var n=this.get("database"),a=n.getMaxPouchId("pricing"),l=n.getMinPouchId("pricing"),s=this.get("pricingCategory"),i={startkey:[s,null,null,l],endkey:[s,{},{},a],include_docs:!0};n.queryMainDB(i,"pricing_by_category").then(function(t){var n=t.rows.map(function(e){return e.doc});this.set("pricingList",n),e()}.bind(this)).catch(t)}.bind(this))},setupController:function(e,t){this._super(e,t),e.set("pricingList",this.get("pricingList"))}})}),define("hospitalrun/mixins/custom-field-types",["exports","ember"],function(e,t){var n=t.default.computed;e.default=t.default.Mixin.create({fieldTypeValues:["checkbox","radio","select","text","textarea"],fieldTypes:n(function(){var e=this.get("i18n"),n=this.get("fieldTypeValues");return n.map(function(t){return{id:t,value:e.t("admin.customForms.labels."+t)}}).sort(function(e,n){return t.default.compare(e.value.toString(),n.value.toString())})})})}),define("hospitalrun/mixins/date-format",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_dateFormat:function(e,n){if(t.default.isEmpty(n)&&(n="l"),!t.default.isEmpty(e))return moment(e).format(n)},dateToTime:function(e){if(!t.default.isEmpty(e)&&e.getTime)return e.getTime()}})}),define("hospitalrun/mixins/diagnosis-actions",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({editDiagnosis:function(e){e.set("editController",this),this.send("openModal","diagnosis.edit",e)},actions:{deleteDiagnosis:function(e){var t=this,n=this.get("model.diagnoses");n.removeObject(e),e.set("archived",!0),e.save().then(function(){t.send("closeModal"),t.send("update",!0)})},editDiagnosis:function(e){this.editDiagnosis(e)},showAddDiagnosis:function(){var e=this.get("store").createRecord("diagnosis",{date:new Date});this.editDiagnosis(e)}}})}),define("hospitalrun/mixins/dob-days",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({convertDOBToText:function(e,t,n){var a=new Date,l=0,s=0,i=0;e&&(void 0===e.getFullYear&&(e=moment(e,"l").toDate()),void 0!==e.getFullYear&&(l=a.getFullYear()-e.getFullYear(),(a.getMonth()0?d.t("dates.short",r):d.t("dates.shortOmitYears",r):n?l>1?d.t("dates.longOmitDaysPlural",r):1===l?d.t("dates.longOmitDays",r):d.t("dates.longOmitDaysYears",r):l>1?d.t("dates.longPlural",r):1===l?d.t("dates.long",r):d.t("dates.longOmitYears",r)}})}),define("hospitalrun/mixins/edit-panel-props",["exports","ember"],function(e,t){var n=t.default.computed,a=t.default.isEmpty,l=["actionForUpdateButton","additionalButtons","cancelButtonText","disabledAction","hideCancelButton","showUpdateButton","updateButtonAction","updateButtonIcon","updateButtonText"];e.default=t.default.Mixin.create({additionalButtons:null,cancelButtonText:null,disabledAction:null,hideCancelButton:null,showUpdateButton:null,updateButtonAction:null,updateButtonIcon:null,updateButtonText:null,actionForUpdateButton:n("disabledAction",function(){var e=this.get("disabledAction");return a(e)||e===!1?"updateButtonAction":"disabledAction"}),editPanelProps:n.apply(void 0,l.concat([function(){return this.getProperties(l)}]))})}),define("hospitalrun/mixins/filter-list",["exports","ember"],function(e,t){var n=t.default.isEmpty,a=t.default.String.isHTMLSafe;e.default=t.default.Mixin.create({filteredBy:new t.default.Map,filterList:function(e,t,l){var s=this.get("filteredBy");if(n(t)&&n(s))return e;n(t)||s.set(t,l),this.set("filteredBy",s);var i=e.filter(function(e){var t=!0;return s.forEach(function(l,s){var i=e.get(s);n(l)||(a(l)&&(l=l.toString()),a(i)&&(i=i.toString()),i!==l&&(t=!1))}),t});return i}})}),define("hospitalrun/mixins/fulfill-request",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({actions:{doneFulfillRequest:function(){},fulfillRequest:function(e,t,n,a){this.performFulfillRequest(e,t,n,a)}},performFulfillRequest:function(e,n,a,l){return new t.default.RSVP.Promise(function(s,i){var o=e.get("markAsConsumed"),r=e.get("transactionType");"Request"===r&&(r=null),e.get("inventoryItem").then(function(d){o?(e.set("adjustPurchases",!0),t.default.isEmpty(r)&&e.set("transactionType","Fulfillment"),this._performFulfillment(e,d,a).then(function(){this._finishFulfillRequest(e,d,n,a,l),s()}.bind(this),i)):(e.set("adjustPurchases",!1),t.default.isEmpty(r)&&e.set("transactionType","Transfer"),this._finishFulfillRequest(e,d,n,a,l),s())}.bind(this),i)}.bind(this))},_findQuantity:function(e,t,n,a){var l=void 0,s=[],i=n.get("quantity"),o=parseInt(e.get("quantity")),r=o,d=[],c=0;if(a){var u=t.get("lastObject");l=u.get("costPerUnit"),u.incrementProperty("currentQuantity",o),c+=l*r,d.push({id:u.get("id"),quantity:o}),s.addObject(u)}else{var p=t.any(function(e){var t=e.get("currentQuantity");return!(e.get("expired")||t<=0)&&(l=e.get("costPerUnit"),!!a||(r>t?(c+=l*t,r-=t,d.push({id:e.get("id"),quantity:parseInt(t)}),t=0):(c+=l*r,t-=r,d.push({id:e.get("id"),quantity:parseInt(r)}),r=0),e.set("currentQuantity",t),s.addObject(e),0===r))});if(!p)return"Could not find any purchases that had the required quantity: "+o}return e.set("costPerUnit",(c/o).toFixed(2)),e.set("quantityAtCompletion",i),e.set("purchasesAffected",d),e.set("purchases",s),n.updateQuantity(),!0},_finishFulfillRequest:function(e,n,a,l,s){var i=e.get("inventoryLocations"),o=[],r=e.get("markAsConsumed"),d=[],c=parseInt(e.get("quantity")),u=e.get("purchases");if(l){var p=i.get("firstObject");p.incrementProperty("quantity",c),d.push(p.save()),o.push({name:p.get("locationName"),quantity:c})}else i.reduce(function(t,a){var l=e.get("deliveryLocation"),s=e.get("deliveryAisle"),i=parseInt(a.get("quantity"));if(t>0)return r||(a.set("transferAisleLocation",s),a.set("transferLocation",l)),i>=t?(r?(a.decrementProperty("quantity",t),d.push(a.save())):(a.set("adjustmentQuantity",t),d.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:t}),0):(r?(a.decrementProperty("quantity",i),d.push(a.save())):(a.set("adjustmentQuantity",i),d.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:i}),t-i)}.bind(this),c);e.set("locationsAffected",o),r&&u.forEach(function(e){d.push(e.save())}),t.default.RSVP.all(d,"Preliminary saving done for inventory fulfillment").then(function(){var l=[];l.push(n.save()),e.set("status","Completed"),e.set("completedBy",e.getUserName()),l.push(e.save()),t.default.RSVP.all(l,"All saving done for inventory fulfillment").then(function(){this.send("doneFulfillRequest"),a&&this.send("closeModal"),s||this.transitionTo("inventory.index")}.bind(this))}.bind(this))},_performFulfillment:function(e,n,a){return new t.default.RSVP.Promise(function(t,l){var s=n.get("purchases"),i=n.get("quantity"),o=e.get("quantity");if(a||i>=o){var r=this._findQuantity(e,s,n,a);r===!0?t():l(r)}else l("The quantity on hand, "+i+" is less than the requested quantity of "+o+".")}.bind(this))}})}),define("hospitalrun/mixins/hospitalrun-version",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({version:"0.9.17"})}),define("hospitalrun/mixins/inventory-adjustment-types",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({adjustmentTypes:[{name:"Add",type:"Adjustment (Add)"},{name:"Remove",type:"Adjustment (Remove)"},{name:"Return To Vendor",type:"Return To Vendor"},{name:"Return",type:"Return"},{name:"Write Off",type:"Write Off"}]})}),define("hospitalrun/mixins/inventory-id",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({generateId:function(){var e=1,n=999,a=(new Date).getTime(),l=Math.floor(Math.random()*(n-e+1))+e;return t.default.RSVP.resolve(a.toString(36)+"_"+l.toString(36))}})}),define("hospitalrun/mixins/inventory-locations",["exports","ember","npm:uuid"],function(e,t,n){e.default=t.default.Mixin.create({aisleToFind:null,locationToFind:null,_addQuantityToLocation:function(e,n,a,l){return new t.default.RSVP.Promise(function(t,s){this._findOrCreateLocation(e,a,l).then(function(e){e.incrementProperty("quantity",n),e.save().then(t,s)})}.bind(this))},_findOrCreateLocation:function(e,a,l){return new t.default.RSVP.Promise(function(t,s){var i=this,o=!1,r=e.get("locations");this.set("aisleToFind",l),this.set("locationToFind",a),o=r.find(this.findLocation,this),o?t(o):!function(){var e=i.get("store").createRecord("inv-location",{id:n.default.v4(),aisleLocation:l,location:a,quantity:0});r.addObject(e),e.save().then(function(){t(e)},s)}()}.bind(this))},findLocation:function(e){ +var n=e.get("aisleLocation"),a=this.get("aisleToFind"),l=e.get("location"),s=this.get("locationToFind");if((t.default.isEmpty(n)&&t.default.isEmpty(a)||n===a)&&(t.default.isEmpty(l)&&t.default.isEmpty(s)||l===s))return!0},newPurchaseAdded:function(e,n){return new t.default.RSVP.Promise(function(t,a){var l=n.get("aisleLocation"),s=n.get("location"),i=parseInt(n.get("originalQuantity"));this._addQuantityToLocation(e,i,s,l).then(t,a)}.bind(this))},saveLocation:function(e,t){if(0===e.get("quantity")){var n=t.get("locations");return n.removeObject(e),e.destroyRecord()}return e.save()},transferToLocation:function(e,n){var a=n.get("transferAisleLocation"),l=n.get("transferLocation"),s=parseInt(n.get("adjustmentQuantity"));return new t.default.RSVP.Promise(function(t,i){this._addQuantityToLocation(e,s,l,a).then(function(){n.decrementProperty("quantity",s),n.save().then(t,i)},i)}.bind(this))}})}),define("hospitalrun/mixins/inventory-type-list",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({defaultInventoryTypes:["Medication","Supply"],inventoryTypes:function(){var e=this.get("defaultInventoryTypes"),a=this.get("inventoryTypeList"),l=void 0;return l=t.default.isEmpty(a)?e:a,l=n.default.selectValues(l)}.property("inventoryTypeList","defaultInventoryTypes")})}),define("hospitalrun/mixins/is-update-disabled",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({isUpdateDisabled:function(){return!t.default.isNone(this.get("model.isValid"))&&!this.get("model.isValid")}.property("model.isValid")})}),define("hospitalrun/mixins/location-name",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({getDisplayLocationName:function(e,n){var a=this.formatLocationName(e,n);return t.default.isEmpty(a)&&(a="No Location"),a},formatLocationName:function(e,n){var a="";return t.default.isEmpty(e)||(a+=e,t.default.isEmpty(n)||(a+=" : ")),t.default.isEmpty(n)||(a+=n),a},locationName:function(){var e=this.get("aisleLocation"),t=this.get("location");return this.getDisplayLocationName(t,e)}.property("location","aisleLocation")})}),define("hospitalrun/mixins/medication-details",["exports","ember","ember-data"],function(e,t,n){e.default=t.default.Mixin.create({getMedicationName:function(e){var n=this,a=this.get("medicationTitle");if(!t.default.isEmpty(a))return a;var l=this.get(e);l.then?l.then(function(e){n.set("medicationTitle",e.get("name"))}):this.set("medicationTitle",l.get("name"))},getMedicationPrice:function(e){var n=this,a=this.get("priceOfMedication");if(!t.default.isEmpty(a))return a;var l=this.get(e);l.then?l.then(function(e){n.set("priceOfMedication",e.get("price"))}):this.set("priceOfMedication",l.get("price"))},getMedicationDetails:function(e){var n=this;return new t.default.RSVP.Promise(function(a){var l=n.get("medicationTitle"),s=n.get("priceOfMedication");if(t.default.isEmpty(l)||t.default.isEmpty(s)){var i=n.get(e);i.then?i.then(function(e){a({name:e.get("name"),price:e.get("price")})}):a({name:i.get("name"),price:i.get("price")})}else a({name:l,price:s})})},medicationTitle:n.default.attr("string"),priceOfMedication:n.default.attr("number"),rxNormIdentifier:n.default.attr("string")})}),define("hospitalrun/mixins/modal-helper",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({displayAlert:function(e,n,a){var l=this.get("i18n"),s=t.default.Object.extend({updateButtonText:l.t("buttons.ok")});this.send("openModal","dialog",s.create({title:e,message:n,okAction:a,hideCancelButton:!0,updateButtonAction:"ok"}))},displayConfirm:function(e,n,a,l){t.default.isEmpty(l)&&(l=t.default.Object.create()),l.set("confirmAction",a),l.set("title",e),l.set("message",n),l.set("updateButtonAction","confirm"),l.set("updateButtonText","Ok"),this.send("openModal","dialog",l)}})}),define("hospitalrun/mixins/navigation",["exports","ember"],function(e,t){var n=t.default.String.camelize;e.default=t.default.Mixin.create({navItems:[{title:"Inventory",iconClass:"octicon-package",route:"inventory",capability:"inventory",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"inventory.index",capability:"add_inventory_request"},{title:"Items",iconClass:"octicon-chevron-right",route:"inventory.listing",capability:"inventory"},{title:"Inventory Received",iconClass:"octicon-plus",route:"inventory.batch",subroute:"new",capability:"add_inventory_item"},{title:"Reports",iconClass:"octicon-chevron-right",route:"inventory.reports",capability:"inventory"}]},{title:"Patients",iconClass:"octicon-organization",route:"patients",capability:"patients",subnav:[{title:"Patient Listing",iconClass:"octicon-chevron-right",route:"patients",capability:"patients"},{title:"Admitted Patients",iconClass:"octicon-chevron-right",route:"patients.admitted",capability:"patients"},{title:"Outpatient",iconClass:"octicon-chevron-right",route:"patients.outpatient",capability:"patients"},{title:"New Patient",iconClass:"octicon-plus",route:"patients.edit",subroute:"new",capability:"add_patient"},{title:"Reports",iconClass:"octicon-chevron-right",route:"patients.reports",capability:"patients"}]},{title:"Appointments",iconClass:"octicon-calendar",route:"appointments.index",capability:"appointments",subnav:[{title:"This Week",iconClass:"octicon-chevron-right",route:"appointments.index",capability:"appointments"},{title:"Today",iconClass:"octicon-chevron-right",route:"appointments.today",capability:"appointments"},{title:"Missed",iconClass:"octicon-chevron-right",route:"appointments.missed",capability:"appointments"},{title:"Search",iconClass:"octicon-search",route:"appointments.search",capability:"appointments"},{title:"Add Appointment",iconClass:"octicon-plus",route:"appointments.edit",subroute:"new",capability:"add_appointment"}]},{title:"Imaging",iconClass:"octicon-device-camera",route:"imaging.index",capability:"imaging",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"imaging.index",capability:"imaging"},{title:"Completed",iconClass:"octicon-chevron-right",route:"imaging.completed",capability:"imaging"},{title:"New Request",iconClass:"octicon-plus",route:"imaging.edit",subroute:"new",capability:"add_imaging"}]},{title:"Medication",iconClass:"octicon-file-text",route:"medication.index",capability:"medication",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"medication.index",capability:"medication"},{title:"Completed",iconClass:"octicon-chevron-right",route:"medication.completed",capability:"medication"},{title:"New Request",iconClass:"octicon-plus",route:"medication.edit",subroute:"new",capability:"add_medication"},{title:"Dispense",iconClass:"octicon-checklist",route:"medication.edit",subroute:"dispense",capability:"fulfill_medication"},{title:"Return Medication",iconClass:"octicon-mail-reply",route:"medication.return",subroute:"new",capability:"add_medication"}]},{title:"Labs",iconClass:"octicon-microscope",route:"labs.index",capability:"labs",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"labs.index",capability:"labs"},{title:"Completed",iconClass:"octicon-chevron-right",route:"labs.completed",capability:"labs"},{title:"New Request",iconClass:"octicon-plus",route:"labs.edit",subroute:"new",capability:"add_lab"}]},{title:"Billing",iconClass:"octicon-credit-card",route:"invoices.index",capability:"invoices",subnav:[{title:"Invoices",iconClass:"octicon-chevron-right",route:"invoices.index",capability:"invoices"},{title:"New Invoice",iconClass:"octicon-plus",route:"invoices.edit",subroute:"new",capability:"invoices"},{title:"Prices",iconClass:"octicon-chevron-right",route:"pricing.index",capability:"invoices"},{title:"Price Profiles",iconClass:"octicon-chevron-right",route:"pricing.profiles",capability:"invoices"}]},{title:"Administration",iconClass:"octicon-person",route:"admin.lookup",capability:"admin",subnav:[{title:"Address Fields",iconClass:"octicon-chevron-right",route:"admin.address",capability:"update_config"},{title:"Custom Forms",iconClass:"octicon-chevron-right",route:"admin.custom-forms",capability:"update_config"},{title:"Load DB",iconClass:"octicon-plus",route:"admin.loaddb",capability:"load_db"},{title:"Lookup Lists",iconClass:"octicon-chevron-right",route:"admin.lookup",capability:"update_config"},{title:"Users",iconClass:"octicon-chevron-right",route:"users",capability:"users"},{title:"New User",iconClass:"octicon-plus",route:"users.edit",subroute:"new",capability:"add_user"},{title:"User Roles",iconClass:"octicon-chevron-right",route:"admin.roles",capability:"define_user_roles"},{title:"Workflow",iconClass:"octicon-chevron-right",route:"admin.workflow",capability:"update_config"}]}],localizedNavItems:t.default.computed("navItems.[]",function(){var e=this,a="navigation.",l=function(e,t){return"string"==typeof e?t:e};return this.get("navItems").map(function(s){var i=a+n(s.title).toLowerCase(),o=e.get("i18n").t(i);return t.default.set(s,"localizedTitle",l(o,s.title)),s.subnav=s.subnav.map(function(t){var s=a+"subnav."+n(t.title),i=e.get("i18n").t(s);return t.localizedTitle=l(i,t.title),t}),s})})})}),define("hospitalrun/mixins/number-format",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_calculateTotal:function(e,n){var a=void 0,l=0;return a=t.default.isArray(e)?e:this.get(e),l=a.reduce(function(e,a){return e+=this._getValidNumber(t.default.get(a,n))}.bind(this),0),this._numberFormat(l,!0)},_getValidNumber:function(e){return t.default.isEmpty(e)||isNaN(e)?0:Number(e)},_numberFormat:function(e,n){var a=void 0;if(!t.default.isEmpty(e)){if(isNaN(e))return;return a=Math.round(e)===e?Number(e).toString():this._round100(e).toFixed(2),n?Number(a):a.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},_validNumber:function(e){return!t.default.isEmpty(e)&&!isNaN(e)&&e>0},_round100:function(e){var t=100*e;return Math.round(t)/100}})}),define("hospitalrun/mixins/operative-plan-statuses",["exports","ember"],function(e,t){var n=t.default.computed,a="completed";e.COMPLETED_STATUS=a;var l="dropped";e.DROPPED_STATUS=l;var s="planned";e.PLANNED_STATUS=s;var i=[a,l,s];e.default=t.default.Mixin.create({planStatuses:n(function(){var e=this.get("i18n");return i.map(function(t){return{id:t,value:e.t("operativePlan.labels."+t+"Status")}}).sort(function(e,n){return t.default.compare(e.value.toString(),n.value.toString())})})})}),define("hospitalrun/mixins/pagination-props",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({paginationProps:function(){var e=["disableNextPage","disablePreviousPage","showFirstPageButton","showLastPageButton","showPagination"];return this.getProperties(e)}.property("disableNextPage","disablePreviousPage","showFirstPageButton","showLastPageButton","showPagination")})}),define("hospitalrun/mixins/paging-actions",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({firstPage:"firstPage",lastPage:"lastPage",nextPage:"nextPage",previousPage:"previousPage",actions:{firstPage:function(){this.sendAction("firstPage")},lastPage:function(){this.sendAction("lastPage")},nextPage:function(){this.sendAction("nextPage")},previousPage:function(){this.sendAction("previousPage")}}})}),define("hospitalrun/mixins/patient-appointments",["exports","ember","hospitalrun/mixins/pouchdb"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{getPatientAppointments:function(e){var t=e.get("id"),n=this.get("maxValue");return this.store.query("appointment",{options:{startkey:[t,null,null,"appointment_"],endkey:[t,n,n,n]},mapReduce:"appointments_by_patient"})}})}),define("hospitalrun/mixins/patient-diagnosis",["exports","ember"],function(e,t){var n=t.default.isEmpty;e.default=t.default.Mixin.create({_addDiagnosisToList:function(e,n){t.default.isEmpty(e)||t.default.isEmpty(n.findBy("description",e))&&n.addObject(e)},getDiagnoses:function(e,t,a){var l=this,s=[];if(!n(e)){var i=e.get("diagnoses");return t&&(i=i.filterBy("active",!0)),a||(a=!1),i=i.filterBy("secondaryDiagnosis",a),i.forEach(function(e){l._addDiagnosisToList(e,s)}),s}}})}),define("hospitalrun/mixins/patient-id",["exports","ember"],function(e,t){function n(e,t){return t<1e5&&(t=("00000"+t).slice(-5)),""+e+t}e.sequenceId=n;var a=t.default.inject,l=t.default.isEmpty;e.default=t.default.Mixin.create({idPrefix:null,database:a.service(),config:a.service(),generateFriendlyId:function(){var e=this,t=this.get("config"),a=this.get("database"),s=a.getMaxPouchId("patient"),i=function e(i){var o=void 0,r=void 0;return t.getPatientPrefix().then(function(e){o=i.get("value"),r=n(e,o);var t={startkey:[r,null],endkey:[r,s]};return a.queryMainDB(t,"patient_by_display_id")}).then(function(t){return l(t.rows)?i.get("hasDirtyAttributes")?i.save().then(function(){return r}):r:(i.incrementProperty("value"),e(i))})};return this.store.find("sequence","patient").then(i).catch(function(){var t=e.get("store"),n=t.push(t.normalize("sequence",{id:"patient",value:1}));return i(n)})}})}),define("hospitalrun/mixins/patient-invoices",["exports","ember","hospitalrun/mixins/pouchdb"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{getPatientInvoices:function(e){var t=e.get("id");return this.store.query("invoice",{options:{key:t},mapReduce:"invoice_by_patient"})}})}),define("hospitalrun/mixins/patient-list-route",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({database:t.default.inject.service(),_fetchPatientList:function(e){var t={startkey:"patient_",endkey:"patient_￿",include_docs:!0},n=this.get("database");n.queryMainDB(t).then(function(t){if(t.rows){var n=t.rows.map(function(e){return e.doc});e.set("patientList",n)}})},actions:{returnToPatient:function(){this.controller.send("returnToPatient"),this.controller.send("closeModal")},returnToVisit:function(){this.controller.send("returnToVisit")}},setupController:function(e,t){this._super(e,t),this._fetchPatientList(e)}})}),define("hospitalrun/mixins/patient-name",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({getPatientDisplayId:function(e){var n=t.default.get(e,"externalPatientId"),a=t.default.get(e,"friendlyId"),l=t.default.get(e,"id");return t.default.isEmpty(a)?t.default.isEmpty(n)?l:n:a},getPatientDisplayName:function(e,n){var a=t.default.get(e,"firstName"),l=t.default.get(e,"lastName"),s=t.default.get(e,"middleName"),i=[];return t.default.isEmpty(a)||i.push(a),t.default.isEmpty(s)||n||i.push(s),t.default.isEmpty(l)||i.push(l),i.join(" ")}})}),define("hospitalrun/mixins/patient-notes",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({canAddNote:function(){return this.currentUserCan("add_note")&&(!t.default.isEmpty(this.get("visits"))||!t.default.isEmpty(this.get("model.visits")))},canDeleteNote:function(){return this.currentUserCan("delete_note")},_computeNoteType:function(e){switch(e.get("visitType")){case"Admission":return t.default.isEmpty(e.get("procedures"))?"Pre-op":"Post-op";case"Clinic":case"Followup":return"General";default:return e.get("visitType")}},_setNoteType:function(){var e=this.get("model");null==e.get("noteType")&&e.set("noteType",this._computeNoteType(e.get("visit")))}})}),define("hospitalrun/mixins/patient-submodule",["exports","ember-data","ember","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values"],function(e,t,n,a,l){var s=n.default.isEmpty;e.default=n.default.Mixin.create(a.default,{findPatientVisits:!0,needToUpdateVisit:!1,patientList:null,selectedPatient:null,newVisitAdded:null,actions:{showPatient:function(e){this.transitionToRoute("patients.edit",e)},returnToAllItems:function(){this._cancelUpdate(),this.send("allItems")},returnToPatient:function(){this._cancelUpdate(),this.transitionToRoute("patients.edit",this.get("model.returnToPatient"))},returnToVisit:function(){this._cancelUpdate(),this.transitionToRoute("visits.edit",this.get("model.returnToVisit"))},selectedPatientChanged:function(e){var t=this;n.default.isEmpty(e)?(this.set("model.patient",null),this.patientSelected()):this.store.find("patient",e.id).then(function(e){t.set("model.patient",e),t.patientSelected(e),n.default.run.once(t,function(){this.get("model").validate().catch(n.default.K)})})}},addChildToVisit:function(e,t,a){return new n.default.RSVP.Promise(function(l,s){var i=this.get("model.visit");n.default.isEmpty(i)?i=this.createNewVisit(a).then(function(n){this._finishAddChildToVisit(e,t,n,l,s)}.bind(this),s):this._finishAddChildToVisit(e,t,i,l,s)}.bind(this))},_finishAddChildToVisit:function(e,t,n,a,l){n.get(t).then(function(t){t.addObject(e),this.set("needToUpdateVisit",!0),a(n)}.bind(this),l)},cancelAction:function(){var e=this.get("model.returnToPatient"),t=this.get("model.returnToVisit");return s(t)?s(e)?"returnToAllItems":"returnToPatient":"returnToVisit"}.property("model.returnToPatient","model.returnToVisit"),createNewVisit:function(e){return new n.default.RSVP.Promise(function(t,n){var a=this.get("model"),l=a.get("patient"),s=this.get("store").createRecord("visit",{startDate:new Date,endDate:new Date,outPatient:!0,patient:l,visitType:e});a.set("visit",s),s.save().then(function(){s.reload().then(function(e){this.set("newVisitAdded",e),a.set("visit",e),t(e)}.bind(this),n)}.bind(this),n).catch(function(e){console.log("Error creating new visit"),n(e)}.bind(this))}.bind(this))},deleteChildFromVisit:function(e){var t=this,n=this.get("model");n.set("archived",!0),this.removeChildFromVisit(n,e).then(function(){n.save().then(function(){n.unloadRecord(),t.send("closeModal")})})},patientId:n.default.computed.alias("model.patient.id"),patientSelected:function(){},patientVisits:function(){var e=this.get("model.patient"),a=void 0;return a=!n.default.isEmpty(e)&&this.get("findPatientVisits")?this.getPatientVisits(e):n.default.RSVP.resolve([]),t.default.PromiseArray.create({promise:a})}.property("model.patient.id","newVisitAdded"),patientVisitsForSelect:function(){return t.default.PromiseArray.create({promise:this.get("patientVisits").then(function(e){return e.map(l.default.selectObjectMap)})})}.property("patientVisits.[]"),removeChildFromVisit:function(e,t){return new n.default.RSVP.Promise(function(a,l){var s=[],i=this.get("model.visit");s.addObjects(this.resolveVisitChildren()),n.default.RSVP.all(s,"Resolved visit children before removing "+t).then(function(){i.get(t).then(function(t){t.removeObject(e),i.save().then(a,l)}.bind(this),l)}.bind(this),l)}.bind(this))},resolveVisitChildren:function(){var e=[],t=this.get("model.visit");return n.default.isEmpty(t)||(e.push(t.get("imaging")),e.push(t.get("labs")),e.push(t.get("medication")),e.push(t.get("procedures")),e.push(t.get("vitals"))),e},saveVisitIfNeeded:function(e,t,n){this.get("needToUpdateVisit")?this.get("model.visit").save().then(function(){this.set("needToUpdateVisit",!1),this.displayAlert(e,t,n)}.bind(this)):this.displayAlert(e,t,n)},visitId:n.default.computed.alias("model.visit.id"),visitsController:n.default.computed.alias("controllers.visits")})}),define("hospitalrun/mixins/patient-visits",["exports","ember","hospitalrun/mixins/pouchdb","hospitalrun/utils/visit-statuses"],function(e,t,n,a){var l=t.default.isEmpty;e.default=t.default.Mixin.create(n.default,{getPatientVisits:function(e){var t=this.get("maxValue"),n=e.get("id");return this.store.query("visit",{options:{startkey:[n,null,null,null,"visit_"],endkey:[n,t,t,t,t]},mapReduce:"visit_by_patient",debug:!0})},checkoutVisit:function(e,t){var n=this;return e.set("status",t),e.set("endDate",new Date),e.save().then(function(l){return n.updatePatientVisitFlags(l).then(function(){var l=n.get("i18n"),s={patientName:e.get("patient.displayName")},i=void 0,o=void 0;t===a.default.CHECKED_OUT?(i=l.t("visits.messages.checkedOut",s),o=l.t("visits.titles.checkedOut")):(i=l.t("visits.messages.discharged",s),o=l.t("visits.titles.discharged")),n.displayAlert(o,i)})})},updatePatientVisitFlags:function(e){var n=e.get("patient"),l=n.get("admitted"),s=n.get("checkedIn"),i=this.get("model.status");return i!==a.default.ADMITTED||l?i!==a.default.CHECKED_IN||s?i===a.default.CHECKED_OUT&&s?this._updateUnlessVisitStatusExists(n,a.default.CHECKED_IN,"checkedIn"):i===a.default.DISCHARGED&&l?this._updateUnlessVisitStatusExists(n,a.default.ADMITTED,"admitted"):t.default.RSVP.resolve():(n.set("checkedIn",!0),n.save()):(n.set("admitted",!0),n.save())},_updateUnlessVisitStatusExists:function(e,t,n){return this.getPatientVisits(e).then(function(a){if(l(a.findBy("status",t)))return e.set(n,!1),e.save()})}})}),define("hospitalrun/mixins/payment-profiles",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({paymentProfiles:["Private","Discounted","Free"]})}),define("hospitalrun/mixins/pouch-adapter-utils",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({session:t.default.inject.service(),_pouchError:function(e){return function(n){if(401===n.status){var a=this.get("session");!t.default.isEmpty(a)&&a.get("isAuthenticated")&&a.invalidate()}var l=[n.status,(n.name||n.error)+":",n.message||n.reason].join(" ");t.default.run(null,e,l)}.bind(this)}})}),define("hospitalrun/mixins/pouchdb",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({maxValue:"￿"})}),define("hospitalrun/mixins/progress-dialog",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({progressDialog:null,progressDialogDefaults:{showProgress:!0,hideCancelButton:!0,hideUpdateButton:!0,progressBarValue:0,progressBarStyle:"width: 0%;"},progressInterval:500,progressMessage:null,progressTimer:null,progressTitle:null,scheduleProgress:function(e){return t.default.run.later(this,function(){e.apply(this),this.set("progressTimer",this.scheduleProgress(e))},this.get("progressInterval"))},updateProgressBar:function(){var e=this.get("progressDialog"),n=e.get("progressBarValue");n+=10,n>100&&(n=0),e.set("progressBarValue",n);var a=t.default.String.htmlSafe("width: "+n+"%");e.set("progressBarStyle",a)},closeProgressModal:function(){t.default.run.cancel(this.get("progressTimer")),this.send("closeModal")},showProgressModal:function(){var e=t.default.Object.create(this.get("progressDialogDefaults"));e.progressBarStyle=t.default.String.htmlSafe(e.progressBarStyle),e.set("title",this.get("progressTitle")),e.set("message",this.get("progressMessage")),this.set("progressDialog",e),this.set("progressTimer",this.scheduleProgress(this.get("updateProgressBar"))),this.send("openModal","dialog",e)}})}),define("hospitalrun/mixins/publish-statuses",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({publishStatuses:["Draft","Published","Private","Archived"]})}),define("hospitalrun/mixins/result-validation",["exports","ember","ember-i18n"],function(e,t,n){e.default=t.default.Mixin.create({validations:{result:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes"))return!1;var n=e.get("status"),a=e.get("result");return!("Completed"!==n||!t.default.isEmpty(a))},message:(0,n.translationMacro)("errors.result")}}}})}),define("hospitalrun/mixins/return-to",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({cancelAction:function(){var e=this.get("model.returnTo");return t.default.isEmpty(e)?"allItems":"returnTo"}.property("returnTo")})}),define("hospitalrun/mixins/setup-user-role",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({setupUserRole:function(){var e=this.get("session"),n=e.get("data.authenticated.role");return this.get("store").find("user-role",n.dasherize()).then(function(t){e.set("data.authenticated.userCaps",t.get("capabilities"));var n=e.get("store"),a=e.get("data");return n.persist(a),!0}).catch(t.default.K)}})}),define("hospitalrun/mixins/typeahead",["exports","ember-data","ember"],function(e,t,n){var a=n.default.computed,l=n.default.observer;e.default=n.default.Mixin.create({_mapContentItems:function(){var e=this,a=this.get("content");if(a){var l=a.filter(function(e){return!n.default.isEmpty(e)});return l=a instanceof t.default.RecordArray?l.map(function(t){var n=t.getProperties(e.get("displayKey"));return n[e.get("selectionKey")]=t,n}):l.map(function(t){var n={};return n[e.get("displayKey")]=t,n})}return[]},mappedContent:a("content",function(){return this._mapContentItems()}),contentChanged:l("content.[]",function(){var e=this.get("bloodhound");e&&(e.clear(),e.add(this._mapContentItems()))}),bloodhound:null,displayKey:"value",selectionKey:"value",hint:!0,highlight:!0,lastHint:null,limit:500,minlength:1,selectedItem:!1,inputElement:null,typeAhead:null,setOnBlur:!0,templates:null,selectedAction:null,_getSource:function(){var e=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace(this.get("displayKey")),queryTokenizer:Bloodhound.tokenizers.whitespace,local:this.get("mappedContent")});return e.initialize(),this.set("bloodhound",e),e.ttAdapter()},didInsertElement:function(){var e=this,t=this.$("input");this.set("inputElement",t);var a=t.typeahead({autoselect:!0,hint:this.get("hint"),highlight:this.get("highlight"),minLength:this.get("minlength")},{displayKey:this.get("displayKey"),limit:this.get("limit"),source:this._getSource(),templates:this.get("templates")});this.set("typeAhead",a),a.on("typeahead:selected",function(t,n){e.itemSelected(n[e.get("selectionKey")])}),a.on("typeahead:autocompleted",function(t,n){e.itemSelected(n[e.get("selectionKey")])}),this.get("setOnBlur")&&(t.on("keyup",function(){var t=e.$(".tt-hint"),n=t.val();e.set("lastHint",n),e.set("selectedItem",!1)}),t.on("blur",function(t){var a=e.get("selection"),l=t.target.value.trim();n.default.isEmpty(a)||(a.trim&&(a=a.trim()),e.set("selection",a)),e.get("selectedItem")||!function(){var s=e.get("lastHint"),i=!1;n.default.isEmpty(s)&&(s=l,i=!0),n.default.isEmpty(l)||n.default.isEmpty(s)?n.default.isEmpty(l)&&e.itemSelected():e.get("bloodhound").search(s,function(n){n.length>0?i&&s.toLowerCase()!==n[0][e.get("displayKey")].toLowerCase()||(e.itemSelected(n[0][e.get("selectionKey")]),t.target.value=n[0][e.get("displayKey")],e.get("model").set(e.get("propertyName"),t.target.value)):l!==a&&e.itemSelected()})}()}))},itemSelected:function(e){this.set("selection",e),this.set("selectedItem",!0);var t=this.get("selectedAction");n.default.isEmpty(t)||this.sendAction("selectedAction",e)},willDestroyElement:function(){this.get("inputElement").typeahead("destroy")}})}),define("hospitalrun/mixins/unit-types",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({defaultUnitList:["ampoule","bag","bottle","box","bundle","capsule","case","container","cream","each","gel","nebule","ointment","pack","pair","pallet","patch","pcs","pill","plastic","polyamp","roll","spray","suppository","suspension","set","syrup","tablet","tray","tube","vial"],unitList:function(){var e=this.get("defaultUnitList"),n=this.get("inventoryUnitList");return t.default.isEmpty(n)?e:n}.property("inventoryUnitList","defaultUnitList"),unitListForSelect:t.default.computed.map("unitList",n.default.selectValuesMap)})}),define("hospitalrun/mixins/user-roles",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({userRoles:[{name:"Data Entry",roles:["Data Entry","user"]},{name:"Doctor",roles:["Doctor","user"]},{name:"Finance",roles:["Finance","user"]},{name:"Finance Manager",roles:["Finance Manager","user"]},{name:"Hospital Administrator",roles:["Hospital Administrator","user"]},{name:"Inventory Manager",roles:["Inventory Manager","user"]},{name:"Imaging Technician",roles:["Imaging Technician","user"]},{name:"Lab Technician",roles:["Lab Technician","user"]},{name:"Medical Records Officer",roles:["Medical Records Officer","user"]},{name:"Nurse",roles:["Nurse","user"]},{name:"Nurse Manager",roles:["Nurse Manager","user"]},{name:"Patient Administration",roles:["Patient Administration","user"]},{name:"Pharmacist",roles:["Pharmacist","user"]},{name:"Social Worker",roles:["Social Worker","user"]},{name:"System Administrator",roles:["System Administrator","admin","user"]},{name:"User Administrator",roles:["User Administrator","admin","user"]}]})}),define("hospitalrun/mixins/user-session",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({session:t.default.inject.service(),defaultCapabilities:{admin:["User Administrator","System Administrator"],add_allergy:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],appointments:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_appointment:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_charge:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],add_billing_diagnosis:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],add_diagnosis:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],add_medication:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Pharmacist","System Administrator"],add_operative_plan:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],add_photo:["Data Entry","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_patient:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_pricing:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","System Administrator"],add_pricing_profile:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","System Administrator"],add_lab:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Lab Technician","System Administrator"],add_imaging:["Data Entry","Doctor","Hospital Administrator","Imaging Technician","Medical Records Officer","System Administrator"],add_inventory_request:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","Nurse Manager","Pharmacist","System Administrator"],add_inventory_item:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"],add_inventory_purchase:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"],add_invoice:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],add_payment:["Hospital Administrator","Medical Records Officer","System Administrator"],add_procedure:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","System Administrator"],add_socialwork:["Hospital Administrator","Medical Records Officer","Social Worker","System Administrator"],add_user:["User Administrator","System Administrator"],add_visit:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],add_vitals:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","System Administrator"],admit_patient:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],adjust_inventory_location:["Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"],billing:["Hospital Administrator","Finance","Finance Manager","System Administrator"],complete_imaging:["Imaging Technician","Medical Records Officer","System Administrator"],complete_lab:["Lab Technician","Medical Records Officer","System Administrator"],delete_appointment:["Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],delete_diagnosis:["Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],delete_inventory_item:["Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"], +delete_imaging:["Doctor","Hospital Administrator","Medical Records Officer","System Administrator"],delete_invoice:["Hospital Administrator","System Administrator"],delete_lab:["Doctor","Hospital Administrator","Medical Records Officer","System Administrator"],delete_medication:["Doctor","Hospital Administrator","Medical Records Officer","System Administrator"],delete_photo:["Data Entry","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],delete_patient:["Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],delete_pricing:["Finance","Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],delete_pricing_profile:["Finance","Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],delete_procedure:["Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","System Administrator"],delete_socialwork:["Hospital Administrator","Medical Records Officer","Social Worker","System Administrator"],delete_vitals:["Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","System Administrator"],delete_visit:["Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],delete_user:["User Administrator","System Administrator"],discharge_patient:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],edit_invoice:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],fulfill_inventory:["Hospital Administrator","Inventory Manager","Medical Records Officer","Pharmacist","System Administrator"],fulfill_medication:["Medical Records Officer","Pharmacist","System Administrator"],imaging:["Data Entry","Doctor","Hospital Administrator","Imaging Technician","Medical Records Officer","System Administrator"],invoices:["Hospital Administrator","Finance","Finance Manager","System Administrator"],labs:["Data Entry","Doctor","Hospital Administrator","Lab Technician","Medical Records Officer","System Administrator"],medication:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Pharmacist","System Administrator"],inventory:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","Nurse Manager","Pharmacist","System Administrator"],load_db:["System Administrator"],override_invoice:["Hospital Administrator","System Administrator"],query_db:["System Administrator"],patients:["Data Entry","Doctor","Finance","Finance Manager","Hospital Administrator","Imaging Technician","Lab Technician","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],patient_reports:["Hospital Administrator","Patient Administration","System Administrator"],pricing:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","System Administrator"],visits:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse Manager","Nurse","Patient Administration","Social Worker","System Administrator"],update_config:["System Administrator"],users:["User Administrator","System Administrator"],add_note:["Doctor","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","System Administrator"],delete_note:["Medical Records Officer","Nurse Manager","Patient Administration","System Administrator"],define_user_roles:["System Administrator"]},_getUserSessionVars:function(){var e=this.get("session");if(!t.default.isEmpty(e)&&e.get("isAuthenticated"))return e.get("data.authenticated")},currentUserCan:function(e){var n=this._getUserSessionVars();if(!t.default.isEmpty(n)&&!t.default.isEmpty(n.role)){var a=this.get("session").get("data.authenticated.userCaps");if(!t.default.isEmpty(a))return a.includes(e.camelize());var l=this.get("defaultCapabilities"),s=l[e];if(!t.default.isEmpty(s))return s.includes(n.role)}return!1},getUserName:function(e){var n=void 0,a=this._getUserSessionVars();return t.default.isEmpty(a)||(e?n=a.name:t.default.isEmpty(a.displayName)?t.default.isEmpty(a.name)||(n=a.name):n=a.displayName),n}})}),define("hospitalrun/mixins/visit-types",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({defaultVisitTypes:["Admission","Clinic","Followup","Imaging","Lab","Pharmacy"],_getVisitTypes:function(e){var a=this.get("defaultVisitTypes"),l=this.get("visitTypesList"),s=void 0;return s=t.default.isEmpty(l)?a:l.get("value"),s=n.default.selectValues(s,e)},visitTypes:function(){return this._getVisitTypes()}.property("visitTypesList","defaultVisitTypes").volatile(),visitTypesWithEmpty:function(){return this._getVisitTypes(!0)}.property("visitTypesList","defaultVisitTypes").volatile()})}),define("hospitalrun/models/abstract",["exports","ember-data","ember","ember-validations","ember-pouch","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s){var i=n.default.get,o=n.default.inject,r=n.default.isEmpty;e.default=l.Model.extend(s.default,a.default,{session:o.service(),archived:t.default.attr("boolean"),lastModified:t.default.attr("date"),modifiedBy:t.default.attr(),modifiedFields:t.default.attr(),loadedCustomForms:null,didLoad:function(){var e=this.get("customForms");r(e)||(e=JSON.parse(JSON.stringify(e))),this.set("loadedCustomForms",e)},changedAttributes:function e(){var e=this._super(),t=this.get("customForms"),n=this.get("loadedCustomForms");if(!r(t)){r(n)&&(n={});var a=Object.keys(t);a.forEach(function(a){var l=n[a],s="customForms."+a;r(l)&&(l={});var o=i(t,a),d=Object.keys(o);d.forEach(function(t){var n=i(l,t),a=i(o,t);n!=a&&(e[s+"."+t]=[n,a])})})}return e},save:function(e){var t=void 0,a=this.changedAttributes(),l=new Date,s=this.get("modifiedFields"),i=this.get("session");if(!i||!i.get("isAuthenticated"))return new n.default.RSVP.Promise(function(e,t){n.default.run(null,t,"ERROR you must be logged in to save")});if(this.get("hasDirtyAttributes")&&!this.get("isDeleted")){r(s)&&(s={}),this.set("lastModified",l);for(t in a)s[t]=l;this.set("modifiedFields",s),this.set("modifiedBy",this.getUserName())}return this._super(e).catch(function(t){if(!r(e)&&e.retry)throw t;if(t.name&&t.name.indexOf&&t.name.indexOf("conflict")>-1)return this.rollbackAttributes(),this.reload().then(function(t){for(var l in a)t.set(l,a[l][1]);return n.default.isEmpty(e)&&(e={}),e.retry=!0,t.save(e)});throw t}.bind(this))}})}),define("hospitalrun/models/add-diagnosis",["exports","ember-data","ember-validations","ember-pouch"],function(e,t,n,a){e.default=a.Model.extend(n.default,{diagnosis:t.default.attr("string"),validations:{diagnosis:{presence:!0}}})}),define("hospitalrun/models/allergy",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({name:n.default.attr("string"),icd9CMCode:n.default.attr("string"),icd10Code:n.default.attr("string"),patient:n.default.belongsTo("patient")})}),define("hospitalrun/models/appointment",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/utils/patient-validation"],function(e,t,n,a,l){e.default=t.default.extend({allDay:n.default.attr(),provider:n.default.attr("string"),location:n.default.attr("string"),appointmentType:n.default.attr("string"),startDate:n.default.attr("date"),endDate:n.default.attr("date"),notes:n.default.attr("string"),status:n.default.attr("string",{defaultValue:"Scheduled"}),patient:n.default.belongsTo("patient",{async:!1}),visits:n.default.hasMany("visit"),longDateFormat:"l h:mm A",shortDateFormat:"l",timeFormat:"h:mm A",_getDateSpan:function(e,t,n){var a=e.format(n),l=t.format(n);return a+" - "+l},appointmentDate:function(){var e=this.get("startDate");return e}.property("startDate"),displayStatus:function(){var e=this.get("status");return a.default.isEmpty(e)&&(e="Scheduled"),e}.property("status"),formattedAppointmentDate:function(){var e=this.get("allDay"),t=moment(this.get("endDate")),n="",a="",l=moment(this.get("startDate"));return l.isSame(t,"day")?(a=l.format(this.get("shortDateFormat")),e||(a+=" ",a+=this._getDateSpan(l,t,this.get("timeFormat")))):(n=e?this.get("shortDateFormat"):this.get("longDateFormat"),a=this._getDateSpan(l,t,n)),a}.property("startDate","endDate"),validations:{appointmentDate:{presence:{if:function(e){var t=e.get("appointmentType");return"Admission"!==t}}},patientTypeAhead:l.default.patientTypeAhead,patient:{presence:!0},appointmentType:{presence:!0},location:{presence:!0},startDate:{presence:!0},endDate:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes"))return!1;var t=e.get("allDay"),n=e.get("startDate"),l=e.get("endDate");if(a.default.isEmpty(l)||a.default.isEmpty(n))return!0;if(t){if(l.getTime()l},message:"Invalid quantity"}},dateCompleted:{presence:{message:"Please provide a date"}},transferLocation:{acceptance:{accept:!0,if:function(e){var t=e.get("transferLocation"),n=e.get("transferItem");return!(a.default.isEmpty(n)||!a.default.isEmpty(t))},message:"Please select a location to transfer to"}}}});e.default=s}),define("hospitalrun/models/inv-purchase",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/location-name","hospitalrun/mixins/number-format"],function(e,t,n,a,l,s){function i(){return[]}var o=t.default.extend(l.default,s.default,{purchaseCost:n.default.attr("number"),lotNumber:n.default.attr("string"),dateReceived:n.default.attr("date"),costPerUnit:function(){var e=this.get("purchaseCost"),t=parseInt(this.get("originalQuantity"));return a.default.isEmpty(e)||a.default.isEmpty(t)||0===e||0===t?0:this._numberFormat(e/t,!0)}.property("purchaseCost","originalQuantity"),originalQuantity:n.default.attr("number"),currentQuantity:n.default.attr("number"),expirationDate:n.default.attr("date"),expired:n.default.attr("boolean"),location:n.default.attr("string"),aisleLocation:n.default.attr("string"),giftInKind:n.default.attr("boolean"),inventoryItem:n.default.attr("string"),vendor:n.default.attr("string"),vendorItemNo:n.default.attr("string"),distributionUnit:n.default.attr("string"),invoiceNo:n.default.attr("string"),quantityGroups:n.default.attr({defaultValue:i}),validations:{purchaseCost:{numericality:!0},originalQuantity:{numericality:{greaterThanOrEqualTo:0}},vendor:{presence:!0}}});e.default=o}),define("hospitalrun/models/inv-request",["exports","hospitalrun/models/abstract","hospitalrun/mixins/inventory-adjustment-types","ember-data","ember","hospitalrun/mixins/location-name"],function(e,t,n,a,l,s){var i=t.default.extend(n.default,s.default,{adjustPurchases:a.default.attr("boolean"),completedBy:a.default.attr("string"),costPerUnit:a.default.attr("number"),dateCompleted:a.default.attr("date"),dateRequested:a.default.attr("date"),deliveryAisle:a.default.attr("string"),deliveryLocation:a.default.attr("string"),expenseAccount:a.default.attr("string"),inventoryItem:a.default.belongsTo("inventory",{async:!0}),locationsAffected:a.default.attr(),markAsConsumed:a.default.attr("boolean",{defaultValue:!0}),patient:a.default.belongsTo("patient",{async:!1}),purchasesAffected:a.default.attr(),quantity:a.default.attr("number"),quantityAtCompletion:a.default.attr("number"),reason:a.default.attr("string"),requestedBy:a.default.attr("string"),status:a.default.attr("string"),transactionType:a.default.attr("string"),visit:a.default.belongsTo("visit",{async:!1}),deliveryLocationName:function(){var e=this.get("deliveryAisle"),t=this.get("deliveryLocation");return this.formatLocationName(t,e)}.property("deliveryAisle","deliveryLocation"),deliveryDetails:function(){var e=this.get("deliveryLocationName"),t=this.get("patient");return l.default.isEmpty(t)?e:t.get("displayName")}.property("deliveryAisle","deliveryLocation","patient"),haveReason:function(){return!l.default.isEmpty(this.get("reason"))}.property("reason"),isAdjustment:function(){var e=this.get("adjustmentTypes"),t=this.get("transactionType"),n=e.findBy("type",t);return!l.default.isEmpty(n)}.property("transactionType"),isFulfillment:function(){return"Fulfillment"===this.get("transactionType")}.property("transactionType"),isTransfer:function(){return"Transfer"===this.get("transactionType")}.property("transactionType"),validations:{inventoryItemTypeAhead:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes"))return!1;var t=e.get("inventoryItem.name"),n=e.get("inventoryItemTypeAhead"),a=e.get("requestedItems"),s=e.get("status");if("Requested"===s)return!1;if(l.default.isEmpty(t)||l.default.isEmpty(n))return l.default.isEmpty(a);var i=n.substr(0,t.length);return t!==i},message:"Please select a valid inventory item"}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},if:function(e){var t=e.get("requestedItems");return l.default.isEmpty(t)}},acceptance:{accept:!0,if:function(e){var t=e.get("isNew"),n=parseInt(e.get("quantity")),a=e.get("transactionType"),l=null;return"Return"!==a&&(l=t&&"Request"===a?e.get("inventoryItem.quantity"):e.get("inventoryLocation.quantity"),n>l)},message:"The quantity must be less than or equal to the number of available items."}}}});e.default=i}),define("hospitalrun/models/inventory-batch",["exports","hospitalrun/models/abstract","ember"],function(e,t,n){e.default=t.default.extend({haveInvoiceItems:function(){var e=this.get("invoiceItems");return!n.default.isEmpty(e)},validations:{dateReceived:{presence:!0},inventoryItemTypeAhead:{presence:{unless:function(e){return e.haveInvoiceItems()}}},purchaseCost:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},unless:function(e){return e.haveInvoiceItems()}}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},unless:function(e){return e.haveInvoiceItems()}}},vendor:{presence:!0}}})}),define("hospitalrun/models/inventory",["exports","hospitalrun/models/abstract","ember-data","ember","ember-computed","hospitalrun/mixins/location-name","hospitalrun/utils/item-condition"],function(e,t,n,a,l,s,i){var o=a.default.get,r=a.default.set,d={if:function(e){var t=o(e,"skipSavePurchase");return!t&&o(e,"isNew")}};e.default=t.default.extend(s.default,{crossReference:n.default.attr("string"),description:n.default.attr("string"),distributionUnit:n.default.attr("string"),friendlyId:n.default.attr("string"),inventoryType:n.default.attr("string"),keywords:n.default.attr(),name:n.default.attr("string"),price:n.default.attr("number"),quantity:n.default.attr("number"),rank:n.default.attr("string"),reorderPoint:n.default.attr("number"),locations:n.default.hasMany("inv-location",{async:!1}),purchases:n.default.hasMany("inv-purchase",{async:!1}),estimatedDaysOfStock:14,availableLocations:(0,l.default)("locations.@each.quantity",function(){var e=o(this,"locations").filter(function(e){return o(e,"quantity")>0});return e}),displayLocations:(0,l.default)("availableLocations",function(){var e=this,t=o(this,"availableLocations"),n=[];return t.forEach(function(t){var l=o(t,"aisleLocation"),s=o(t,"location"),i=e.formatLocationName(s,l);a.default.isEmpty(i)||n.push(i)}),n.toString()}),condition:(0,l.default)("rank","estimatedDaysOfStock",function(){var e=o(this,"estimatedDaysOfStock"),t=(0,i.rankToMultiplier)(o(this,"rank"));return(0,i.getCondition)(e,t)}),validations:{distributionUnit:{presence:!0},purchaseCost:{numericality:d},name:{presence:!0},quantity:{numericality:{validateIfNewItem:d,greaterThanOrEqualTo:0}},price:{numericality:{allowBlank:!0}},originalQuantity:{presence:d},reorderPoint:{numericality:{allowBlank:!0}},inventoryType:{presence:!0},vendor:{presence:d}},updateQuantity:function(){var e=o(this,"purchases"),t=e.reduce(function(e,t){var n=0;return t.get("expired")||(n=t.get("currentQuantity")),e+n},0);r(this,"quantity",t)}})}),define("hospitalrun/models/invoice",["exports","hospitalrun/models/abstract","hospitalrun/mixins/date-format","ember-data","ember","hospitalrun/mixins/number-format","hospitalrun/utils/patient-validation"],function(e,t,n,a,l,s,i){var o=l.default.computed,r=l.default.get,d=l.default.set;e.default=t.default.extend(n.default,s.default,{billDate:a.default.attr("date"),externalInvoiceNumber:a.default.attr("string"),paidTotal:a.default.attr("number"),patientInfo:a.default.attr("string"),remarks:a.default.attr("string"),status:a.default.attr("string"),lineItems:a.default.hasMany("billing-line-item",{async:!1}),patient:a.default.belongsTo("patient",{async:!1}),paymentProfile:a.default.belongsTo("price-profile",{async:!1}),payments:a.default.hasMany("payment",{async:!1}),visit:a.default.belongsTo("visit",{async:!1}),addPayment:function(e){var t=r(this,"payments");t.addObject(e),this.paymentAmountChanged()},billDateAsTime:o("billDate",function(){return this.dateToTime(r(this,"billDate"))}),discountTotals:l.default.computed.mapBy("lineItemsByCategory","discount"),discount:l.default.computed.sum("discountTotals"),nationalInsuranceTotals:l.default.computed.mapBy("lineItemsByCategory","nationalInsurance"),nationalInsurance:l.default.computed.sum("nationalInsuranceTotals"),paidFlag:o("status",function(){return"Paid"===r(this,"status")}),remainingBalance:o("patientResponsibility","paidTotal",function(){var e=r(this,"patientResponsibility"),t=r(this,"paidTotal");return this._numberFormat(e-t,!0)}),privateInsuranceTotals:l.default.computed.mapBy("lineItemsByCategory","privateInsurance"),privateInsurance:l.default.computed.sum("privateInsuranceTotals"),lineTotals:l.default.computed.mapBy("lineItems","total"),total:l.default.computed.sum("lineTotals"),displayInvoiceNumber:o("externalInvoiceNumber","id",function(){var e=r(this,"externalInvoiceNumber"),t=r(this,"id");return l.default.isEmpty(e)?t:e}),lineItemsByCategory:o("lineItems.@each.amountOwed",function(){var e=r(this,"lineItems"),t=[];return e.forEach(function(e){var n=r(e,"category"),a=t.findBy("category",n);l.default.isEmpty(a)&&(a={category:n,items:[]},t.push(a)),a.items.push(e)}.bind(this)),t.forEach(function(e){e.amountOwed=this._calculateTotal(e.items,"amountOwed"),e.discount=this._calculateTotal(e.items,"discount"),e.nationalInsurance=this._calculateTotal(e.items,"nationalInsurance"),e.privateInsurance=this._calculateTotal(e.items,"privateInsurance"),e.total=this._calculateTotal(e.items,"total")}.bind(this)),t}),patientIdChanged:function(){if(!l.default.isEmpty(r(this,"patient"))){var e=r(this,"patient.displayName"),t=r(this,"patient.displayPatientId");d(this,"patientInfo",e+" - "+t)}}.observes("patient.displayName","patient.id","patient.displayPatientId"),patientResponsibilityTotals:l.default.computed.mapBy("lineItems","amountOwed"),patientResponsibility:l.default.computed.sum("patientResponsibilityTotals"),paymentAmountChanged:function(){var e=r(this,"payments").filter(function(e){return!r(e,"isNew")});if(0!==e.length){var t=e.reduce(function(e,t){return e+=this._getValidNumber(t.get("amount"))}.bind(this),0);d(this,"paidTotal",this._numberFormat(t,!0));var n=r(this,"remainingBalance");n<=0&&d(this,"status","Paid")}}.observes("payments.[]","payments.@each.amount"),validations:{patientTypeAhead:i.default.patientTypeAhead,patient:{presence:!0},visit:{presence:!0}}})}),define("hospitalrun/models/lab",["exports","hospitalrun/models/abstract","hospitalrun/mixins/can-edit-requested","hospitalrun/mixins/date-format","ember-data","ember","hospitalrun/utils/patient-validation","hospitalrun/mixins/result-validation"],function(e,t,n,a,l,s,i,o){var r=s.default.computed,d=s.default.get;e.default=t.default.extend(n.default,a.default,o.default,{labDate:l.default.attr("date"),notes:l.default.attr("string"),requestedBy:l.default.attr("string"),requestedDate:l.default.attr("date"),result:l.default.attr("string"),status:l.default.attr("string"),charges:l.default.hasMany("proc-charge",{async:!1}),labType:l.default.belongsTo("pricing",{async:!1}),patient:l.default.belongsTo("patient",{async:!1}),visit:l.default.belongsTo("visit",{async:!1}),labDateAsTime:r("labDate",function(){return this.dateToTime(d(this,"labDate"))}),requestedDateAsTime:r("requestedDate",function(){return this.dateToTime(d(this,"requestedDate"))}),validations:{labTypeName:{presence:{if:function(e){if(e.get("isNew"))return!0},message:"Please select a lab type"}},patientTypeAhead:i.default.patientTypeAhead,patient:{presence:!0}}})}),define("hospitalrun/models/line-item-detail",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/number-format"],function(e,t,n,a,l){var s=a.default.computed,i=a.default.get;e.default=t.default.extend(l.default,{department:n.default.attr("string"),expenseAccount:n.default.attr("string"),name:n.default.attr("string"),price:n.default.attr("number"),quantity:n.default.attr("number"),total:n.default.attr("number"),pricingItem:n.default.belongsTo("pricing",{async:!1}),amountOwed:s("price","quantity",function(){var e=i(this,"price"),t=i(this,"quantity"),n=0;return this._validNumber(e)&&this._validNumber(t)&&(n=this._numberFormat(e*t,!0)),n})})}),define("hospitalrun/models/lookup",["exports","ember-pouch","ember-data"],function(e,t,n){e.default=t.Model.extend({_attachments:n.default.attr(),importFile:n.default.attr("boolean",{defaultValue:!1}),value:n.default.attr(""),organizeByType:n.default.attr("boolean"),userCanAdd:n.default.attr("boolean")})}),define("hospitalrun/models/medication",["exports","hospitalrun/models/abstract","hospitalrun/mixins/can-edit-requested","ember-data","hospitalrun/mixins/date-format","ember","hospitalrun/mixins/medication-details"],function(e,t,n,a,l,s,i){e.default=t.default.extend(n.default,l.default,i.default,{inventoryItem:a.default.belongsTo("inventory",{async:!0}),notes:a.default.attr("string"),patient:a.default.belongsTo("patient",{async:!1}),prescription:a.default.attr("string"),prescriptionDate:a.default.attr("date"),quantity:a.default.attr("number"),refills:a.default.attr("number"),requestedDate:a.default.attr("date"),requestedBy:a.default.attr("string"),status:a.default.attr("string"),visit:a.default.belongsTo("visit",{async:!1}),isRequested:function(){var e=this.get("status");return"Requested"===e}.property("status"),medicationName:function(){return this.getMedicationName("inventoryItem")}.property("medicationTitle","inventoryItem"),medicationPrice:function(){return this.getMedicationPrice("inventoryItem")}.property("priceOfMedication","inventoryItem"),prescriptionDateAsTime:function(){return this.dateToTime(this.get("prescriptionDate"))}.property("prescriptionDate"),requestedDateAsTime:function(){return this.dateToTime(this.get("requestedDate"))}.property("requestedDate"),validations:{prescription:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes")||e.get("isFulfilling"))return!1;var t=e.get("prescription"),n=e.get("quantity");return!(!s.default.isEmpty(t)||!s.default.isEmpty(n))},message:"Please enter a prescription or a quantity"}},inventoryItemTypeAhead:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes")||!e.get("isNew"))return!1;var t=e.get("inventoryItem.name"),n=e.get("inventoryItemTypeAhead");if(s.default.isEmpty(t)||s.default.isEmpty(n))return!0;var a=n.substr(0,t.length);return t!==a},message:"Please select a valid medication"}},patientTypeAhead:{presence:{if:function(e){return e.get("selectPatient")}}},quantity:{numericality:{allowBlank:!0,greaterThan:0,messages:{greaterThan:"must be greater than 0"}},presence:{if:function(e){var t=e.get("isFulfilling");return t}},acceptance:{accept:!0,if:function(e){var t=e.get("isFulfilling"),n=parseInt(e.get("quantity")),a=null;return!!t&&(a=e.get("inventoryItem.quantity"),n>a)},message:"The quantity must be less than or equal to the number of available medication."}},refills:{numericality:{allowBlank:!0}}}})}),define("hospitalrun/models/operative-plan",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/operative-plan-statuses"],function(e,t,n,a,l){function s(){return[]}var i=a.default.computed,o=a.default.get,r=a.default.isEmpty;e.default=t.default.extend({additionalNotes:n.default.attr("string"),admissionInstructions:n.default.attr("string"),caseComplexity:n.default.attr("string"),customForms:n.default.attr("custom-forms"),operationDescription:n.default.attr("string"),procedures:n.default.attr("operative-procedures",{defaultValue:s}),status:n.default.attr("string",{defaultValue:l.PLANNED_STATUS}),surgeon:n.default.attr("string"),surgeryDate:n.default.attr("date"),patient:n.default.belongsTo("patient",{async:!1}),isPlanned:i("status",{get:function(){var e=o(this,"status");return e===l.PLANNED_STATUS}}),validations:{procedureDescription:{presence:{if:function(e){return r(o(e,"procedures"))}}}}})}),define("hospitalrun/models/option",["exports","ember-pouch","ember-data"],function(e,t,n){e.default=t.Model.extend({value:n.default.attr("")})}),define("hospitalrun/models/override-price",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({price:n.default.attr("number"),profile:n.default.belongsTo("price-profile",{async:!1}),validations:{profile:{presence:!0},price:{numericality:!0}}})}),define("hospitalrun/models/patient-note",["exports","hospitalrun/models/abstract","ember","ember-data"],function(e,t,n,a){var l=n.default.computed;e.default=t.default.extend({attribution:a.default.attr("string"),content:a.default.attr("string"),createdBy:a.default.attr("string"),date:a.default.attr("date"),noteType:a.default.attr(),patient:a.default.belongsTo("patient",{async:!1}),visit:a.default.belongsTo("visit",{async:!1}),authoredBy:l("attribution","createdBy",function(){if(n.default.isEmpty(this.get("attribution")))return this.get("createdBy");var e=this.get("i18n");return this.get("createdBy")+" "+e.t("patients.notes.onBehalfOfCopy")+" "+this.get("attribution")}),validations:{patient:{presence:!0},visit:{presence:!0},noteType:{presence:!0},content:{presence:!0}}})}),define("hospitalrun/models/patient",["exports","hospitalrun/models/abstract","hospitalrun/mixins/dob-days","hospitalrun/utils/email-validation","ember","ember-data","hospitalrun/mixins/patient-name"],function(e,t,n,a,l,s,i){var o=l.default.computed,r=l.default.get;e.default=t.default.extend(n.default,i.default,{admitted:s.default.attr("boolean",{defaultValue:!1}),additionalContacts:s.default.attr(),address:s.default.attr("string"),address2:s.default.attr("string"),address3:s.default.attr("string"),address4:s.default.attr("string"),bloodType:s.default.attr("string"), +clinic:s.default.attr("string"),country:s.default.attr("string"),checkedIn:s.default.attr("boolean",{defaultValue:!1}),customForms:s.default.attr("custom-forms"),dateOfBirth:s.default.attr("date"),economicClassification:s.default.attr("string"),email:s.default.attr("string"),expenses:s.default.attr(),externalPatientId:s.default.attr("string"),familySupport1:s.default.attr("string"),familySupport2:s.default.attr("string"),familySupport3:s.default.attr("string"),familySupport4:s.default.attr("string"),familySupport5:s.default.attr("string"),friendlyId:s.default.attr("string"),familyInfo:s.default.attr(),firstName:s.default.attr("string"),sex:s.default.attr("string"),occupation:s.default.attr("string"),history:s.default.attr("string"),insurance:s.default.attr("string"),lastName:s.default.attr("string"),livingArrangement:s.default.attr("string"),middleName:s.default.attr("string"),notes:s.default.attr("string"),otherIncome:s.default.attr("string"),patientType:s.default.attr("string"),parent:s.default.attr("string"),phone:s.default.attr("string"),placeOfBirth:s.default.attr("string"),referredDate:s.default.attr("date"),referredBy:s.default.attr("string"),religion:s.default.attr("string"),socialActionTaken:s.default.attr("string"),socialRecommendation:s.default.attr("string"),status:s.default.attr("string"),allergies:s.default.hasMany("allergy",{async:!0}),diagnoses:s.default.hasMany("diagnosis",{async:!1}),operativePlans:s.default.hasMany("operative-plan",{async:!0}),payments:s.default.hasMany("payment",{async:!0}),paymentProfile:s.default.belongsTo("price-profile",{async:!1}),age:o("dateOfBirth",function(){var e=r(this,"dateOfBirth");return this.convertDOBToText(e)}),displayAddress:o("address","address2","address3","address4",function(){var e=this.getProperties("address","address2","address3","address4"),t="";for(var n in e)l.default.isEmpty(e[n])||(l.default.isEmpty(t)||(t+=", "),t+=e[n]);return t}),displayName:o("firstName","lastName","middleName",function(){return this.getPatientDisplayName(this)}),displayPatientId:o("id","externalPatientId","friendlyId",function(){return this.getPatientDisplayId(this)}),shortAge:o("dateOfBirth",function(){var e=r(this,"dateOfBirth");return this.convertDOBToText(e,!0)}),shortDisplayName:o("firstName","lastName",function(){return this.getPatientDisplayName(this,!0)}),validations:{email:{format:{with:a.default.emailRegex,allowBlank:!0,message:"please enter a valid email address"}},friendlyId:{presence:!0},firstName:{presence:!0},lastName:{presence:!0}}})}),define("hospitalrun/models/payment",["exports","hospitalrun/models/abstract","ember-data","ember"],function(e,t,n,a){var l=a.default.computed,s=a.default.get;e.default=t.default.extend({amount:n.default.attr("number"),charityPatient:n.default.attr("boolean"),datePaid:n.default.attr("date"),expenseAccount:n.default.attr("string"),notes:n.default.attr("string"),paymentType:n.default.attr("string"),invoice:n.default.belongsTo("invoice",{async:!1}),canRemovePayment:l("paymentType",function(){return"Deposit"===s(this,"paymentType")}),validations:{amount:{numericality:!0},datePaid:{presence:!0}}})}),define("hospitalrun/models/photo",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({_attachments:n.default.attr(),caption:n.default.attr("string"),coverImage:n.default.attr("boolean"),fileName:n.default.attr("string"),localFile:n.default.attr("boolean"),url:n.default.attr("string"),patient:n.default.belongsTo("patient",{async:!1})})}),define("hospitalrun/models/price-profile",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({name:n.default.attr("string"),discountAmount:n.default.attr("number"),discountPercentage:n.default.attr("number"),validations:{name:{presence:!0},discountAmount:{numericality:{allowBlank:!0}},discountPercentage:{numericality:{allowBlank:!0}}}})}),define("hospitalrun/models/pricing",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({category:n.default.attr("string"),expenseAccount:n.default.attr("string"),name:n.default.attr("string"),price:n.default.attr("number"),pricingType:n.default.attr("string"),pricingOverrides:n.default.hasMany("override-price",{async:!1}),validations:{category:{presence:!0},name:{presence:!0},price:{numericality:!0}}})}),define("hospitalrun/models/proc-charge",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/medication-details"],function(e,t,n,a,l){var s=a.default.computed,i=a.default.get;e.default=t.default.extend(l.default,{quantity:n.default.attr("number"),dateCharged:n.default.attr("date"),medication:n.default.belongsTo("inventory",{async:!1}),pricingItem:n.default.belongsTo("pricing",{async:!1}),medicationCharge:s("medication","newMedicationCharge",function(){var e=i(this,"medication"),t=i(this,"newMedicationCharge");return!a.default.isEmpty(e)||!a.default.isEmpty(t)}),medicationName:s("medication",function(){return this.get("medication.name")}),medicationPrice:s("medication",function(){return this.get("medication.price")}),validations:{itemName:{presence:!0,acceptance:{accept:!0,if:function(e){var t=i(e,"medicationCharge");if(!t||!i(e,"hasDirtyAttributes"))return!1;var n=i(e,"inventoryItem.name"),l=i(e,"itemName");if(a.default.isEmpty(n)||a.default.isEmpty(l))return!0;var s=l.substr(0,n.length);return n!==s},message:"Please select a valid medication"}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"}}}}})}),define("hospitalrun/models/procedure",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({anesthesiaType:n.default.attr("string"),anesthesiologist:n.default.attr("string"),assistant:n.default.attr("string"),description:n.default.attr("string"),cptCode:n.default.attr("string"),location:n.default.attr("string"),notes:n.default.attr("string"),physician:n.default.attr("string"),procedureDate:n.default.attr("date"),timeStarted:n.default.attr("string"),timeEnded:n.default.attr("string"),charges:n.default.hasMany("proc-charge",{async:!1}),visit:n.default.belongsTo("visit",{async:!1}),validations:{description:{presence:!0},oxygenHours:{numericality:{allowBlank:!0}},pacuHours:{numericality:{allowBlank:!0}},physician:{presence:!0},procedureDate:{presence:!0},display_procedureDate:{presence:{message:"Please select a valid date"}}}})}),define("hospitalrun/models/sequence",["exports","ember-pouch","ember-data"],function(e,t,n){e.default=t.Model.extend({prefix:n.default.attr("string"),value:n.default.attr("number")})}),define("hospitalrun/models/social-expense",["exports","ember-data","ember-validations","ember-pouch"],function(e,t,n,a){e.default=a.Model.extend(n.default,{category:t.default.attr("string"),sources:t.default.attr("string"),cost:t.default.attr(),validations:{category:{presence:!0},cost:{numericality:!0}}})}),define("hospitalrun/models/user-role",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({name:n.default.attr("string"),capabilities:n.default.attr()})}),define("hospitalrun/models/user",["exports","ember-data","hospitalrun/utils/email-validation","ember","ember-validations"],function(e,t,n,a,l){var s=a.default.computed,i=t.default.Model.extend(l.default,{derived_key:t.default.attr("string"),deleted:t.default.attr("boolean"),displayName:t.default.attr("string"),email:t.default.attr("string"),iterations:t.default.attr(),name:t.default.attr("string"),password:t.default.attr("string"),password_scheme:t.default.attr("string"),password_sha:t.default.attr("string"),rev:t.default.attr("string"),roles:t.default.attr(),salt:t.default.attr("string"),userPrefix:t.default.attr("string"),displayRole:s("roles",function(){var e=this.get("roles");if(!a.default.isEmpty(e))return e[0]}),validations:{email:{format:{with:n.default.emailRegex,message:"Please, enter a valid email address"}}}});e.default=i}),define("hospitalrun/models/visit",["exports","hospitalrun/models/abstract","ember-data","ember"],function(e,t,n,a){function l(e){if(!e.get("hasDirtyAttributes"))return!1;var t=e.get("startDate"),n=e.get("endDate");return!a.default.isEmpty(n)&&!a.default.isEmpty(t)&&n.getTime()0&&t[0].set("first",!0)})}),t},_updateSocialRecord:function(e,t){var n=this.getWithDefault("model."+t,[]),a=e.get("isNew"),s=this.get("model"),i=e.serialize();if(i.id=e.get("id"),a)n.addObject(l.default.Object.create(i));else{var o=n.findBy("id",i.id);l.default.setProperties(o,i)}s.set(t,n),this.send("update",!0),this.send("closeModal")},_updateSequence:function(e){var t=this,n=this.get("config"),a=e.get("friendlyId");return n.getPatientPrefix().then(function(e){var n=new RegExp("^"+e+"\\d{5}$");if(n.test(a))return t.store.find("sequence","patient").then(function(t){var n=t.get("value"),l=parseInt(a.slice(e.length));if(l>n)return t.set("value",l),t.save()})})},beforeUpdate:function(){var e=this;if(!this.get("model.isNew"))return l.default.RSVP.resolve();var t=this.get("database"),n=this.get("model.friendlyId"),a=this.get("maxValue"),s={startkey:[n,null],endkey:[n,a]};return t.queryMainDB(s,"patient_by_display_id").then(function(t){return l.default.isEmpty(t.rows)?l.default.RSVP.resolve():e.generateFriendlyId().then(function(t){return e.model.set("friendlyId",t),l.default.RSVP.resolve()})})},afterUpdate:function(e){var t=this;this._updateSequence(e).then(function(){t.send("openModal","dialog",l.default.Object.create({title:t.get("i18n").t("patients.titles.savedPatient"),message:t.get("i18n").t("patients.messages.savedPatient",e),updateButtonAction:"returnToPatient",updateButtonText:t.get("i18n").t("patients.buttons.backToPatients"),cancelButtonText:t.get("i18n").t("buttons.close")}))})}})}),define("hospitalrun/patients/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember","hospitalrun/mixins/patient-id","hospitalrun/mixins/patient-visits","hospitalrun/mixins/patient-notes","hospitalrun/mixins/pouchdb","ember-i18n"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(a.default,l.default,i.default,s.default,{ +customForms:n.default.inject.service(),editTitle:(0,o.translationMacro)("patients.titles.edit"),modelName:"patient",newTitle:(0,o.translationMacro)("patients.titles.new"),photos:null,actions:{updateNote:function(e){e.get("visit").save().then(function(){})},appointmentDeleted:function(e){this.controller.send("appointmentDeleted",e)},returnToPatient:function(){this.controller.send("returnToPatient")},deleteContact:function(e){this.controller.send("deleteContact",e)},deleteExpense:function(e){this.controller.send("deleteExpense",e)},deleteFamily:function(e){this.controller.send("deleteFamily",e)},deletePhoto:function(e){this.controller.send("deletePhoto",e)},updateExpense:function(e){this.controller.send("updateExpense",e)},updateFamilyInfo:function(e){this.controller.send("updateFamilyInfo",e)},visitDeleted:function(e){this.controller.send("visitDeleted",e)}},getNewData:function(){var e=this,t=this.get("customForms"),a={customForms:n.default.Object.create()};return t.setDefaultCustomForms(["patient","socialwork"],a).then(function(){return e.generateFriendlyId().then(function(e){return a.friendlyId=e,a})})},setupController:function(e,t){var a=t.get("friendlyId"),l=t.get("externalPatientId"),s=this.get("maxValue"),i=t.get("id");n.default.isEmpty(a)&&!n.default.isEmpty(l)&&t.set("friendlyId",l),this._super(e,t),this.getPatientVisits(t).then(function(e){t.set("visits",e)}),this.store.query("appointment",{options:{startkey:[i,null,null,"appointment_"],endkey:[i,s,s,s]},mapReduce:"appointments_by_patient"}).then(function(e){t.set("appointments",e)}),this.store.query("photo",{options:{key:i},mapReduce:"photo_by_patient"}).then(function(e){var n=[];n.addObjects(e),t.set("photos",n)})}})}),define("hospitalrun/patients/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"u/yTHHia",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],52]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","2"],["flush-element"],["open-element","b",[]],["flush-element"],["append",["helper",["t"],["patients.labels.totalMontlyExpense"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["totalExpenses"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteExpense",["get",["expense"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["expense","category"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["expense","sources"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["expense","cost"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showEditExpense",["get",["expense"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteSocialWork"]]],null,1],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["expense"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteFamily",["get",["info"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","age"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","civilStatus"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","relationship"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","education"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","occupation"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","income"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","insurance"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showEditFamily",["get",["info"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteSocialWork"]]],null,3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["info"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","social"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","h4",[]],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.titles.familyInformation"],null],false],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showEditFamily"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.addFamilyMember"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.age"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.civilStatus"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.relationship"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.education"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.occupation"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.income"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.insurance"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","familyInfo"]]],null,4],["text"," "],["close-element"],["text","\\n "],["open-element","h4",[]],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.titles.expenses"],null],false],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showEditExpense"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.addExpense"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.category"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.sources"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.monthlyCost"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","expenses"]]],null,2],["block",["if"],[["get",["showExpenseTotal"]]],null,0],["text"," "],["close-element"],["text","\\n "],["append",["helper",["custom-form-manager"],null,[["model","formType"],[["get",["model"]],"socialwork"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newLab"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.newLab"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newImaging"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.newImaging"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newMedication"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.newMedication"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteVisit",["get",["visit"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["visit","startDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["visit","endDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","primaryDiagnoses"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","examiner"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","visitType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddVisit"]]],null,10],["block",["if"],[["get",["canDeleteVisit"]]],null,9],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visit"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newVisit"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.newVisit"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteAppointment",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","formattedAppointmentDate"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","provider"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","appointmentType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","displayStatus"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddAppointment"]]],null,14],["block",["if"],[["get",["canDeleteAppointment"]]],null,13],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["appointment"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newAppointment"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.newAppointment"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeletePhoto",["get",["photo"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editPhoto",["get",["photo"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","col-sm-4 col-md-3"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","thumbnail"],["modifier",["action"],[["get",[null]],"editPhoto",["get",["photo"]]]],["flush-element"],["text","\\n "],["append",["helper",["photo-display"],null,[["photo"],[["get",["photo"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","caption"],["flush-element"],["text","\\n "],["append",["unknown",["photo","caption"]],false],["text","\\n "],["open-element","p",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddPhoto"]]],null,18],["block",["if"],[["get",["canDeletePhoto"]]],null,17],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["photo"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPhoto"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.newPhoto"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","photos"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddPhoto"]]],null,20],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["each"],[["get",["model","photos"]]],null,19],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","appointments"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddAppointment"]]],null,16],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["visits.labels.examiner"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","appointments"]]],null,15],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","visits"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddVisit"]]],null,12],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.startDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.endDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["visits.labels.diagnosis"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.provider"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","visits"]]],null,11],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","medication"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddMedication"]]],null,8],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["partial","patients/medication"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","imaging"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddImaging"]]],null,7],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["partial","patients/imaging"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","labs"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddLab"]]],null,6],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["partial","patients/labs"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["canAddSocialWork"]]],null,5]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteContact",["get",["additionalContact"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","phone"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","email"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","relationship"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteContact"]]],null,22],["text"," "],["close-element"],["text","\\n"]],"locals":["additionalContact"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h4",[]],["flush-element"],["append",["helper",["t"],["patients.titles.additionalContacts"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.phone"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.email"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.relationship"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteContact"]]],null,24],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","additionalContacts"]]],null,23],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["helper",["t"],["labels.address"],null],"address",3,"col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["get",["address4Label"]],"address4","col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["get",["address3Label"]],"address3","col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["get",["address2Label"]],"address2","col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["get",["address1Label"]],"address",3,"col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["address1Include"]]],null,30],["block",["if"],[["get",["address2Include"]]],null,29],["block",["if"],[["get",["address3Include"]]],null,28],["block",["if"],[["get",["address4Include"]]],null,27]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddContact"],[["bubbles","on"],[false,"click"]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.addContact"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["messages.noHistoryAvailable"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["date-format"],[["get",["medication","prescriptionDate"]]],null],false],["text",": "],["append",["unknown",["medication","medicationName"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["medication","status"]],"Fulfilled"],null]],null,34]],"locals":["medication"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.medication"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","medication"]]],null,35],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","labDate"]]],null],false],["text",": "],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["lab","status"]],"Completed"],null]],null,37]],"locals":["lab"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.labOrders"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","labs"]]],null,38],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","imagingDate"]]],null],false],["text",": "],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["imaging","status"]],"Completed"],null]],null,40]],"locals":["imaging"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.imageOrders"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","imaging"]]],null,41],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editProcedure",["get",["procedure"]]]],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["text","\\n "],["append",["helper",["date-format"],[["get",["procedure","procedureDate"]]],null],false],["text",":\\n "],["append",["unknown",["procedure","description"]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["procedure"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.procedures"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","procedures"]]],null,43],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","patient-history-item"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","patient-history-heading clickable"],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","ph-visit-date"],["flush-element"],["append",["unknown",["visit","visitDate"]],false],["close-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","ph-visit-type"],["flush-element"],["append",["unknown",["visit","visitType"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["visit","procedures"]]],null,44],["block",["if"],[["get",["visit","hasCompletedImaging"]]],null,42],["block",["if"],[["get",["visit","hasCompletedLabs"]]],null,39],["block",["if"],[["get",["visit","hasCompletedMedication"]]],null,36],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visit"]},{"statements":[["block",["each"],[["get",["model","visits"]]],null,45]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading clearfix"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPatientNote"],[["bubbles","on"],[false,"click"]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.newNote"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane active"],["static-attr","id","history"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddNote"]]],null,47],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n"],["block",["if"],[["get",["model","visits"]]],null,46,33],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#social"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","social-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.socialWork"],null],false],["close-element"],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","patientProcedures","disablePatientLink","store","allowAddAllergy","allowAddDiagnosis","allowAddOperativePlan","diagnosisList"],[["get",["model"]],["get",["patientProcedures"]],true,["get",["store"]],true,true,true,["get",["diagnosisList"]]]]],false],["text","\\n "],["open-element","ul",[]],["static-attr","class","nav nav-pills tab-nav"],["static-attr","role","tablist"],["flush-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["static-attr","class","active"],["flush-element"],["open-element","a",[]],["static-attr","href","#history"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","history-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.history"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#general"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","general-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.general"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#photos"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","photos-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.photos"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#appointments"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","appointments-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.appointments"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#visits"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","visits-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.visits"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#medication"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","medication-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.medication"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#imaging"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","imaging-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.imaging"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#labs"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","labs-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.labs"],null],false],["close-element"],["close-element"],["text","\\n"],["block",["if"],[["get",["canAddSocialWork"]]],null,49],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["isNewOrDeleted"]]],null,50],["text"," "],["open-element","div",[]],["static-attr","class","tab-content"],["flush-element"],["text","\\n"],["block",["unless"],[["get",["isNewOrDeleted"]]],null,48],["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["dynamic-attr","class",["concat",["tab-pane ",["helper",["if"],[["get",["isNewOrDeleted"]],"active"],null]]]],["static-attr","id","general"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-12 col-sm-6"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["firstName",["helper",["t"],["patients.labels.firstName"],null],"form-input-group required test-first-name"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["middleName",["helper",["t"],["patients.labels.middleName"],null],"form-input-group test-middle-name"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["lastName",["helper",["t"],["patients.labels.lastName"],null],"form-input-group required test-last-name"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","class","list","selection"],["sex",["helper",["t"],["patients.labels.sex"],null],"form-input-group",["get",["sexList"]],["get",["model","sex"]]]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class","maxDate"],["dateOfBirth",["helper",["t"],["patients.labels.dateOfBirth"],null],"form-input-group ","now"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-input-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.age"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","age"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["placeOfBirth",["helper",["t"],["patients.labels.placeOfBirth"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["occupation",["helper",["t"],["patients.labels.occupation"],null],"form-input-group"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-input-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["patients.labels.patientType"],null],false],["close-element"],["text","\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["append",["helper",["ext-radio"],null,[["content","value","showInline"],[["get",["patientTypes"]],["get",["model","patientType"]],true]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-12 col-sm-6"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["status",["helper",["t"],["patients.labels.status"],null],["get",["statusList"]],["get",["model","status"]],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["externalPatientId",["helper",["t"],["patients.labels.externalPatientId"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["prompt","label","property","content","class"],[" ",["helper",["t"],["patients.labels.bloodType"],null],"bloodType",["get",["bloodTypes"]],"form-input-group"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["clinic",["helper",["t"],["patients.labels.clinic"],null],["get",["clinicList"]],["get",["model","clinic"]],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["referredBy",["helper",["t"],["patients.labels.referredBy"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["referredDate",["helper",["t"],["patients.labels.referredDate"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["religion",["helper",["t"],["patients.labels.religion"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["parent",["helper",["t"],["patients.labels.parent"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["label","property","content","optionValuePath","optionLabelPath","prompt","class"],[["helper",["t"],["billing.labels.paymentProfile"],null],"paymentProfile",["get",["pricingProfiles"]],"selectObject","selectObject.name"," ","form-input-group"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddContact"]]],null,32],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["phone",["helper",["t"],["patients.labels.phone"],null],"col-xs-12 col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","type","label","class"],["email","email",["helper",["t"],["labels.email"],null],"col-xs-12 col-sm-6"]]],false],["text","\\n"],["block",["if"],[["get",["haveAddressOptions"]]],null,31,26],["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["country",["helper",["t"],["labels.country"],null],["get",["countryList"]],["get",["model","country"]],"col-xs-12 col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveAdditionalContacts"]]],null,25],["text"," "],["close-element"],["text","\\n "],["append",["helper",["custom-form-manager"],null,[["model","formType"],[["get",["model"]],"patient"]]],false],["text","\\n "],["close-element"],["text","\\n"],["block",["unless"],[["get",["isNewOrDeleted"]]],null,21],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton","bubbles"],[["get",["model"]],false,false]],51]],"locals":[]}],"hasPartials":true}', +meta:{moduleName:"hospitalrun/patients/edit/template.hbs"}})}),define("hospitalrun/patients/imaging/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"b0VbAwnT",block:'{"statements":[["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.dateProcessed"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.result"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientImaging"]]],null,3],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteImaging",["get",["imaging"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["labels.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editImaging",["get",["imaging"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddImaging"]]],null,1],["block",["if"],[["get",["canDeleteImaging"]]],null,0]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editImaging",["get",["imaging"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","requestedDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","imagingDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","result"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","notes"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["imaging","canEdit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["imaging"]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/imaging/template.hbs"}})}),define("hospitalrun/patients/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/patient-visits","hospitalrun/utils/visit-statuses"],function(e,t,n,a){e.default=t.default.extend(n.default,{addPermission:"add_patient",deletePermission:"delete_patient",canAdmitPatient:function(){return this.currentUserCan("admit_patient")}.property(),canDischargePatient:function(){return this.currentUserCan("discharge_patient")}.property(),startKey:[],actions:{checkInPatient:function(e){this.send("createNewVisit",e)},checkoutPatient:function(e){this.editPatientVisitWithStatus(e,a.default.CHECKED_IN)},dischargePatient:function(e){this.editPatientVisitWithStatus(e,a.default.ADMITTED)}},editPatientVisitWithStatus:function(e,t){var n=this;this.getPatientVisits(e).then(function(e){var a=e.findBy("status",t);a&&(a.set("endDate",new Date),n.transitionToRoute("visits.edit",a))})}})}),define("hospitalrun/patients/index/route",["exports","hospitalrun/routes/abstract-index-route","ember","ember-i18n","hospitalrun/mixins/user-session"],function(e,t,n,a,l){var s=n.default.computed;e.default=t.default.extend(l.default,{modelName:"patient",newButtonAction:s(function(){return this.currentUserCan("add_patient")?"newItem":null}),newButtonText:(0,a.translationMacro)("patients.buttons.newPatient"),pageTitle:(0,a.translationMacro)("patients.titles.patientListing"),_getStartKeyFromItem:function(e){var t=e.get("displayPatientId"),n=this._getPouchIdFromItem(e);return[t,n]},_modelQueryParams:function(){return{mapReduce:"patient_by_display_id"}}})}),define("hospitalrun/patients/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"XNP6TQZC",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],21]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["patients.messages.createNewPatient"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["static-attr","data-test-selector","no-patients-found"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["patients.messages.noPatientsFound"],null],false],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default success admit"],["modifier",["action"],[["get",[null]],"checkInPatient",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-in"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["visits.buttons.checkIn"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAdmitPatient"]]],null,3]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default info"],["modifier",["action"],[["get",[null]],"checkoutPatient",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-out"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["visits.buttons.checkOut"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canDischargePatient"]]],null,5]],"locals":[]},{"statements":[["block",["if"],[["get",["patient","checkedIn"]]],null,6,4]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default info"],["modifier",["action"],[["get",[null]],"dischargePatient",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-out"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["visits.buttons.discharge"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canDischargePatient"]]],null,8]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editItem",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAdd"]]],null,10],["block",["if"],[["get",["patient","admitted"]]],null,9,7],["block",["if"],[["get",["canDelete"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["patient"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","displayPatientId"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","firstName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","lastName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","sex"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["patient","dateOfBirth"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","status"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,11],["text"," "],["close-element"],["text","\\n"]],"locals":["patient"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.status"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.dob"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.sex"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.lastName"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.firstName"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.id"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","thead",[]],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["id",["get",["sortDesc"]],["get",["sortKey"]]]],19],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["firstName",["get",["sortDesc"]],["get",["sortKey"]]]],18],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["lastName",["get",["sortDesc"]],["get",["sortKey"]]]],17],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["sex",["get",["sortDesc"]],["get",["sortKey"]]]],16],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["dateOfBirth",["get",["sortDesc"]],["get",["sortKey"]]]],15],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["status",["get",["sortDesc"]],["get",["sortKey"]]]],14],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,13],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tbody",[]],["flush-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,12],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,20,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/index/template.hbs"}})}),define("hospitalrun/patients/labs/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"NZjGsEXR",block:'{"statements":[["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.dateProcessed"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.result"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientLabs"]]],null,3],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteLab",["get",["lab"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["labels.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editLab",["get",["lab"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddLab"]]],null,1],["block",["if"],[["get",["canDeleteLab"]]],null,0]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editLab",["get",["lab"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["lab","requestedDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["lab","labDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","result"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","notes"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["lab","canEdit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["lab"]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/labs/template.hbs"}})}),define("hospitalrun/patients/medication/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"s3chlZL2",block:'{"statements":[["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.prescription"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientMedications"]]],null,3],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteMedication",["get",["medication"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["labels.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editMedication",["get",["medication"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddMedication"]]],null,1],["block",["if"],[["get",["canDeleteMedication"]]],null,0]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editMedication",["get",["medication"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["medication","prescriptionDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","medicationName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","prescription"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["medication","canEdit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["medication"]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/medication/template.hbs"}})}),define("hospitalrun/patients/notes/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/is-update-disabled","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/patient-notes","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s,i){e.default=t.default.extend(a.default,i.default,l.default,s.default,{cancelAction:"closeModal",updateAction:"updateNote",moduleController:n.default.inject.controller("patients"),physicianList:n.default.computed.alias("moduleController.physicianList"),lookupListsToUpdate:[{name:"physicianList",property:"model.attribution",id:"physician_list"}],title:function(){return this.get("model.isNew")?this.get("i18n").t("patients.notes.newNote")+" "+this.get("model.patient.displayName"):this.get("i18n").t("patients.notes.newNote")+" "+moment(this.get("model.date")).format("MM/DD/YYYY")+" for "+this.get("model.patient.displayName")}.property("model.patient.displayName"),updateCapability:"add_note",beforeUpdate:function(){return this.set("model.date",new Date),this.set("model.createdBy",this.getUserName()),n.default.RSVP.Promise.resolve()},afterUpdate:function(){this.send(this.get("updateAction"),this.get("model")),this.send(this.get("cancelAction"))},actions:{changeVisit:function(){var e=$('select[name="note-visits"]').get(0),t=e.selectedIndex,n=this.get("patientVisitsForSelect"),a=t-1,l=n[a].selectObject;this.get("model").set("visit",l),this._setNoteType()}}})}),define("hospitalrun/patients/notes/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"lvlxvqfb",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","hideUpdateButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["hideCancelButton"]],["get",["hideUpdateButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],2]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","option",[]],["dynamic-attr","value",["concat",[["unknown",["item","selectObject"]]]]],["dynamic-attr","selected",["helper",["is-equal"],[["get",["item","selectObject"]],["get",["model","visit"]]],null],null],["flush-element"],["text","\\n "],["append",["unknown",["item","selectObject","visitDescription"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["item"]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["helper",["t"],["labels.note"],null],"content",3,"test-note-content required form-input-group"]]],false],["text","\\n\\n "],["open-element","select",[]],["static-attr","name","note-visits"],["static-attr","class","form-control"],["modifier",["action"],[["get",[null]],"changeVisit"],[["on"],["change"]]],["flush-element"],["text","\\n "],["open-element","option",[]],["dynamic-attr","selected",["helper",["is-not"],[["get",["model","visit"]]],null],null],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.notes.pleaseSelectAVisit"],null],false],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientVisitsForSelect"]]],null,0],["text"," "],["close-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["attribution",["helper",["t"],["patients.notes.onBehalfOfLabel"],null],["get",["physicianList"]],["get",["attribution"]],"form-input-group test-note-attribution"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/notes/template.hbs"}})}),define("hospitalrun/patients/operative-plan/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/operative-plan-statuses","hospitalrun/mixins/patient-submodule"],function(e,t,n,a,l){var s=n.default.computed,i=n.default.computed.alias,o=n.default.get,r=n.default.inject,d=n.default.isEmpty,c=n.default.RSVP,u=n.default.set;e.default=t.default.extend(a.default,l.default,{newPlan:!1,updateCapability:"add_operative_plan",patientsController:r.controller("patients"),physicianList:i("patientsController.physicianList"),procedureList:i("patientsController.procedureList"),additionalButtons:s("model.{isNew,status}",function(){var e=o(this,"i18n"),t=o(this,"model.isNew"),n=o(this,"model.status");if(!t&&n!==a.COMPLETED_STATUS)return[{class:"btn btn-primary on-white",buttonAction:"completePlan",buttonIcon:"octicon octicon-check",buttonText:e.t("operativePlan.buttons.completePlan")}]}),afterUpdate:function(){var e=o(this,"newPlan");if(e){var t=o(this,"model.patient");t.save().then(this._finishAfterUpdate.bind(this))}else this._finishAfterUpdate()},beforeUpdate:function(){return this._addProcedure(),u(this,"newPlan",o(this,"model.isNew")),c.resolve()},haveProcedures:s("model.procedures.[]",{get:function(){return!d(o(this,"model.procedures"))}}),_addProcedure:function(){var e=o(this,"model"),t=o(e,"procedures"),n=o(e,"procedureDescription");d(n)||(t.addObject({description:n}),u(e,"procedureDescription",null))},_finishAfterUpdate:function(){var e=o(this,"i18n"),t=e.t("operativePlan.messages.planSaved"),n=e.t("operativePlan.titles.planSaved");this.displayAlert(n,t)},actions:{addProcedure:function(){this._addProcedure()},completePlan:function(){var e=o(this,"model");u(e,"status",a.COMPLETED_STATUS),this.send("update")},deleteProcedure:function(e){var t=o(this,"model"),n=o(t,"procedures");n.removeObject(e),t.validate()}}})}),define("hospitalrun/patients/operative-plan/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({customForms:n.default.inject.service(),editTitle:(0,a.translationMacro)("operativePlan.titles.editTitle"),modelName:"operative-plan",newTitle:(0,a.translationMacro)("operativePlan.titles.newTitle"),getNewData:function(){var e=this.get("customForms"),t={customForms:n.default.Object.create()};return e.setDefaultCustomForms(["operativePlan"],t)}})}),define("hospitalrun/patients/operative-plan/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"JecYWoOk",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["procedure","description"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteProcedure",["get",["procedure"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["procedure"]},{"statements":[["text"," "],["open-element","h4",[]],["flush-element"],["append",["helper",["t"],["operativePlan.titles.procedures"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["operativePlan.labels.procedure"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","procedures"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","disablePatientLink"],[["get",["model","patient"]],true]]],false],["text","\\n "],["append",["helper",["em-text"],null,[["property","label"],["operationDescription",["helper",["t"],["operativePlan.labels.operationDescription"],null]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["className","property","label","list","selection","hint"],[["helper",["concat"],[["helper",["if"],[["helper",["not-eq"],[["get",["haveProcedures"]],true],null],"required "],null],"procedure-description col-sm-10"],null],"procedureDescription",["helper",["t"],["operativePlan.labels.procedure"],null],["get",["procedureList"]],["get",["procedureDescription"]],false]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["text"," "],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class"," form-control-static"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"addProcedure"]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["operativePlan.buttons.addProcedure"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveProcedures"]]],null,1],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["surgeryDate",["helper",["t"],["operativePlan.labels.surgeryDate"],null],"form-input-group col-sm-4"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["className","property","label","list","selection"],["col-sm-4","surgeon",["helper",["t"],["operativePlan.labels.surgeon"],null],["get",["physicianList"]],["get",["model","surgeon"]]]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["prompt","label","property","content","class"],[" ",["helper",["t"],["operativePlan.labels.status"],null],"status",["get",["planStatuses"]],"form-input-group col-sm-2"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["caseComplexity",["helper",["t"],["operativePlan.labels.caseComplexity"],null],"col-sm-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["property","label"],["admissionInstructions",["helper",["t"],["operativePlan.labels.admissionInstructions"],null]]]],false],["text","\\n "],["append",["helper",["em-text"],null,[["property","label"],["additionalNotes",["helper",["t"],["operativePlan.labels.additionalNotes"],null]]]],false],["text","\\n "],["append",["helper",["custom-form-manager"],null,[["model","formType"],[["get",["model"]],"operativePlan"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],2]],"locals":[]}],"hasPartials":false}', +meta:{moduleName:"hospitalrun/patients/operative-plan/template.hbs"}})});define("hospitalrun/patients/outpatient/controller",["exports","ember","hospitalrun/mixins/filter-list","hospitalrun/mixins/modal-helper","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values","hospitalrun/mixins/user-session","hospitalrun/utils/visit-statuses","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s,i,o,r){var d=t.default.computed,c=t.default.isEmpty;e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,i.default,r.default,{addPermission:"add_patient",deletePermission:"delete_patient",filterValue:null,filterBy:null,queryParams:["visitDate","visitLocation"],sortByDesc:null,sortByKey:null,visitLocation:null,visitDate:null,canAddVisit:d(function(){return this.currentUserCan("add_visit")}),hasAppointmentLabels:d(function(){var e=this.get("i18n");return[e.t("visits.labels.haveAppointment"),e.t("visits.labels.noAppointment")]}),doneOrdersValues:d(function(){var e=this.get("i18n");return[e.t("visits.labels.ordersNotDone"),e.t("visits.labels.haveDoneOrders")]}),locationList:t.default.computed.map("patientController.locationList.value",s.default.selectValuesMap).volatile(),patientNames:d.map("model",function(e){return e.get("patient.shortDisplayName")}),patientController:t.default.inject.controller("patients"),sexList:d.alias("patientController.sexList.value"),visitTypesList:d.alias("patientController.visitTypesList"),visitTypesValues:d.map("visitTypes",function(e){return e.value}),checkedInVisits:d.filter("model.@each.status",function(e){return"Admission"!==e.get("visitType")&&e.get("status")===o.default.CHECKED_IN}),filteredVisits:d("checkedInVisits","filterBy","filterValue","visitLocation",function(){var e=this.get("filterBy"),t=this.get("filterValue"),n=this.get("filteredBy"),a=this.get("visitLocation"),l=this.get("checkedInVisits");return c(a)?n.delete("location"):n.set("location",a),this.filterList(l,e,t)}),sortedVisits:d("filteredVisits","sortByKey","sortByDesc",function(){var e=this.get("filteredVisits"),n=this.get("sortByDesc"),a=this.get("sortByKey");return t.default.isEmpty(e)||t.default.isEmpty(a)?e:e=e.toArray().sort(function(e,l){var s=e.get(a),i=l.get(a);return"orderType"===a&&(s=s.toString(),i=i.toString()),n?t.default.compare(i,s):t.default.compare(s,i)})}),startKey:[],actions:{checkOut:function(e){var t=this.get("i18n"),n={patientName:e.get("patient.displayName")},a=t.t("visits.messages.checkOut",n);this.displayConfirm(t.t("visits.titles.checkOut"),a,"finishCheckOut",e)},editVisit:function(e){this.get("canAddVisit")&&(e.set("returnTo","patients.outpatient"),this.transitionToRoute("visits.edit",e))},filter:function(e,t){this.set("filterBy",e),this.set("filterValue",t)},finishCheckOut:function(e){this.checkoutVisit(e,o.default.CHECKED_OUT)},search:function(){var e=this.get("model.selectedVisitDate"),t=this.get("model.selectedLocation");c(e)||this.set("visitDate",e.getTime()),c(t)?this.set("visitLocation",null):this.set("visitLocation",t)},sortByKey:function(e,t){this.setProperties({sortByDesc:t,sortByKey:e})},patientCheckIn:function(){this.transitionToRoute("visits.edit","checkin").then(function(e){var t={outPatient:!0,visitType:null,returnTo:"patients.outpatient"};e.currentModel.setProperties(t)})}}})});define("hospitalrun/patients/outpatient/route",["exports","hospitalrun/routes/abstract-index-route","hospitalrun/mixins/date-format","ember","ember-i18n"],function(e,t,n,a,l){var s=a.default.computed,i=a.default.isEmpty;e.default=t.default.extend(n.default,{database:a.default.inject.service(),modelName:"visit",newButtonAction:"patientCheckIn",newButtonText:(0,l.translationMacro)("patients.buttons.patientCheckIn"),selectedVisitDate:null,showingTodaysPatients:!0,pageTitle:s("showingTodaysPatients","selectedVisitDate",function(){var e=this.get("i18n"),t=this.get("showingTodaysPatients");if(t)return e.t("patients.titles.todaysOutpatients");var n=this._dateFormat(this.get("selectedVisitDate"));return e.t("patients.titles.outpatientsForDate",{visitDate:n})}),queryParams:{visitDate:{refreshModel:!0},visitLocation:{refreshModel:!1}},_getStartKeyFromItem:function(e){var t=e.get("displayPatientId");return[t,"patient_"+e.get("id")]},_modelQueryParams:function(e){var t=this.get("database"),n=t.getMaxPouchId("visit"),a=t.getMinPouchId("visit"),l=e.visitDate;l=i(l)?moment():moment(parseInt(l)),l.isSame(moment(),"day")?this.set("showingTodaysPatients",!0):(this.set("showingTodaysPatients",!1),this.set("selectedVisitDate",l.toDate()));var s=l.endOf("day").valueOf(),o=l.startOf("day").valueOf();return{mapReduce:"visit_by_date",options:{endkey:[s,s,n],startkey:[o,null,a]}}},model:function(e){var t=this;return this._super(e).then(function(n){var a=new Date;return i(e.visitDate)||a.setTime(e.visitDate),n.set("selectedVisitDate",a),n.set("display_selectedVisitDate",t._dateFormat(a)),n.set("selectedLocation",e.visitLocation),n})},actions:{finishCheckOut:function(e){this.controller.send("finishCheckOut",e)},patientCheckIn:function(){this.controller.send("patientCheckIn")}}})}),define("hospitalrun/patients/outpatient/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"UnoRIh+j",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],11]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","displayPatientId"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","shortDisplayName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","sex"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","shortAge"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","visitType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["date-format"],[["get",["visit","startDate"]]],[["format"],["h:mm A"]]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-center"],["flush-element"],["append",["unknown",["visit","hasAppointmentLabel"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","examiner"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-center"],["flush-element"],["append",["unknown",["visit","hasDoneOrders"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"checkOut",["get",["visit"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["visits.buttons.checkOut"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visit"]},{"statements":[["text"," "],["append",["helper",["t"],["visits.labels.ordersDone"],null],false],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.examiner"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.appointment"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.checkInTime"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.visitType"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.age"],null],false]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["patients.labels.sex"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["labels.name"],null],false],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.id"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["selectedVisitDate",["helper",["t"],["visits.labels.visitDate"],null],"col-sm-3 outpatient-date"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content","prompt"],["col-sm-3 form-input-group outpatient-location","selectedLocation",["helper",["t"],["labels.location"],null],["get",["locationList"]]," "]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["close-element"],["text","\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"search"]],["flush-element"],["append",["helper",["t"],["buttons.search"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-info"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],10],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table outpatient-list"],["flush-element"],["text","\\n "],["open-element","thead",[]],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["patient.displayPatientId",["get",["sortByDesc"]],["get",["sortByKey"]]]],9],["text","\\n"],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterType","filterValues"],["patient.shortDisplayName",["get",["sortByDesc"]],["get",["sortByKey"]],"patient.shortDisplayName",["get",["filteredBy"]],"typeahead",["get",["patientNames"]]]],8],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["patient.sex",["get",["sortByDesc"]],["get",["sortByKey"]],"patient.sex",["get",["filteredBy"]],["get",["sexList"]]]],7],["text"," "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["patient.dateOfBirth",["get",["sortByDesc"]],["get",["sortByKey"]]]],6],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["visitType",["get",["sortByDesc"]],["get",["sortByKey"]],"visitType",["get",["filteredBy"]],["get",["visitTypesValues"]]]],5],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["startDate",["get",["sortByDesc"]],["get",["sortByKey"]]]],4],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["hasAppointmentLabel",["get",["sortByDesc"]],["get",["sortByKey"]],"hasAppointmentLabel",["get",["filteredBy"]],["get",["hasAppointmentLabels"]]]],3],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["examiner",["get",["sortByDesc"]],["get",["sortByKey"]]]],2],["text","\\n"],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["hasDoneOrders",["get",["sortByDesc"]],["get",["sortByKey"]],"hasDoneOrders",["get",["filteredBy"]],["get",["doneOrdersValues"]]]],1],["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tbody",[]],["flush-element"],["text","\\n"],["block",["each"],[["get",["sortedVisits"]]],null,0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/outpatient/template.hbs"}})}),define("hospitalrun/patients/photo/controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({patientsEdit:t.default.inject.controller("patients/edit"),title:function(){var e=this.get("model.isNew");return e?this.get("i18n").t("patients.titles.addPhoto"):this.get("i18n").t("patients.titles.editPhoto")}.property("model.isNew"),updateButtonText:function(){var e=this.get("model.isNew");return e?this.get("i18n").t("buttons.add"):this.get("i18n").t("buttons.update")}.property("model.isNew"),updateButtonAction:"update",showUpdateButton:!0,editController:t.default.computed.alias("patientsEdit"),actions:{cancel:function(){this.send("closeModal")},update:function(){var e=this.get("model.caption"),t=this.get("model.isNew"),n=this.get("model.photoFile");t?this.get("editController").send("addPhoto",n,e):this.get("editController").send("updatePhoto",this.get("model"))}}})}),define("hospitalrun/patients/photo/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"c+xb//yl",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","hideUpdateButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["hideCancelButton"]],["get",["hideUpdateButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","thumbnail"],["flush-element"],["text","\\n "],["open-element","img",[]],["dynamic-attr","alt",["unknown",["model","caption"]],null],["dynamic-attr","src",["unknown",["model","url"]],null],["static-attr","class","img-responsive"],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["take-photo"],null,[["photoFile"],[["get",["model","photoFile"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,1,0],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label"],["caption","Caption"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],2]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/photo/template.hbs"}})}),define("hospitalrun/patients/quick-add/controller",["exports","ember","hospitalrun/controllers/abstract-edit-controller","ember-i18n"],function(e,t,n,a){e.default=n.default.extend({sexList:t.default.computed.alias("model.requestingController.sexList"),title:(0,a.translationMacro)("patients.titles.new"),updateCapability:"add_patient",actions:{cancel:function(){this.send("closeModal")}},afterUpdate:function(e){var t=this.get("model.requestingController");t.send("addedNewPatient",e)}})}),define("hospitalrun/patients/quick-add/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"CI80Vogk",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["hideCancelButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["friendlyId","Id","required col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["firstName","First Name","required col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["middleName","Middle Name","col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["lastName","Last Name","required col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["sex","Sex",["get",["sexList"]],["get",["model","sex"]],"col-sm-6 form-input-group"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","maxDate","class"],["dateOfBirth","Date of Birth","now","col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["phone",["helper",["t"],["patients.labels.phone"],null],"col-xs-12 col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["helper",["t"],["labels.address"],null],"address",3,"col-xs-12 col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-warning"],["static-attr","role","alert"],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.messages.notFoundQuickAdd",["get",["model"]]],null],false],["text","\\n "],["close-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/quick-add/template.hbs"}})}),define("hospitalrun/patients/reports/controller",["exports","ember","hospitalrun/controllers/abstract-report-controller","hospitalrun/mixins/patient-diagnosis","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s,i){e.default=n.default.extend(a.default,l.default,i.default,{patientsController:t.default.inject.controller("patients"),clinicList:t.default.computed.map("patientsController.clinicList.value",s.default.selectValuesMap),diagnosisList:t.default.computed.alias("patientsController.diagnosisList"),physicianList:t.default.computed.map("patientsController.physicianList.value",s.default.selectValuesMap),locationList:t.default.computed.map("patientsController.locationList.value",s.default.selectValuesMap),statusList:t.default.computed.map("patientsController.statusList.value",s.default.selectValuesMap),visitTypesList:t.default.computed.alias("patientsController.visitTypesList"),reportType:"detailedAdmissions",patientDetails:{},admissionReportColumns:t.default.computed(function(){var e=this.get("i18n");return{sex:{label:e.t("labels.sex"),include:!0,property:"sex"},total:{label:e.t("labels.total"),include:!0,property:"total",format:"_numberFormat"}}}),admissionDetailReportColumns:t.default.computed(function(){var e=this.get("i18n");return{id:{label:e.t("labels.id"),include:!0,property:"patientId"},name:{label:e.t("labels.name"),include:!0,property:"patientName"},admissionDate:{label:e.t("patients.labels.admissionDate"),include:!0,property:"admissionDate",format:"_dateTimeFormat"},dischargeDate:{label:e.t("patients.labels.dischargeDate"),include:!1,property:"dischargeDate",format:"_dateTimeFormat"},patientDays:{label:e.t("patients.labels.patientDays"),include:!1,property:"patientDays",format:"_numberFormat"}}}),diagnosticReportColumns:t.default.computed(function(){var e=this.get("i18n");return{type:{label:e.t("labels.type"),include:!0,property:"type"},total:{label:e.t("labels.total"),include:!0,property:"total",format:"_numberFormat"}}}),procedureDetailReportColumns:t.default.computed(function(){var e=this.get("i18n");return{id:{label:e.t("labels.id"),include:!0,property:"patient.displayPatientId"},name:{label:e.t("labels.name"),include:!0,property:"patient.displayName"},procedure:{label:e.t("visits.labels.procedure"),include:!0,property:"procedure"},procedureDate:{label:e.t("visits.labels.procedureDate"),include:!0,property:"procedureDate",format:"_dateTimeFormat"}}}),reportColumns:t.default.computed(function(){var e=this.get("i18n");return{visitDate:{label:e.t("visits.labels.visitDate"),include:!0,property:"visitDate"},visitType:{label:e.t("visits.labels.visitType"),include:!0,property:"visitType"},visitLocation:{label:e.t("labels.location"),include:!1,property:"location"},examiner:{label:e.t("visits.labels.examiner"),include:!0,property:"examiner"},name:{label:e.t("labels.name"),include:!0,property:"patient.displayName"},id:{label:e.t("labels.id"),include:!0,property:"patient.displayPatientId"},sex:{label:e.t("patients.labels.sex"),include:!0,property:"patient.sex"},dateOfBirth:{label:e.t("patients.labels.dateOfBirth"),include:!0,property:"patient.dateOfBirth",format:"_dateFormat"},age:{label:e.t("labels.age"),include:!1,property:"patient.age"},primaryDiagnosis:{label:e.t("patients.labels.primaryDiagnosis"),include:!1,property:"primaryDiagnosis"},secondaryDiagnoses:{label:e.t("patients.labels.secondaryDiagnosis"),include:!1,property:"additionalDiagnoses",format:"_diagnosisListToString"},procedures:{label:e.t("labels.procedures"),include:!1,property:"resolvedProcedures",format:"_procedureListToString"},contacts:{label:e.t("patients.labels.contacts"),include:!1,property:"patient",format:"_contactListToString"},referredBy:{label:e.t("patients.labels.referredBy"),include:!1,property:"patient.referredBy"},referredDate:{label:e.t("patients.labels.referredDate"),include:!1,property:"patient.referredDate",format:"_dateFormat"}}}),statusReportColumns:t.default.computed(function(){var e=this.get("i18n");return{id:{label:e.t("labels.id"),include:!0,property:"patient.displayPatientId"},name:{label:e.t("labels.name"),include:!0,property:"patient.displayName"},status:{label:e.t("labels.status"),include:!0,property:"patient.status"},primaryDiagnosis:{label:e.t("patients.labels.primaryDiagnosis"),include:!0,property:"patient",format:"_formatPrimaryDiagnosis"},secondaryDiagnoses:{label:e.t("patients.labels.secondaryDiagnosis"),include:!0,property:"patient",format:"_formatSecondaryDiagnosis"}}}),reportTypes:t.default.computed(function(){var e=this.get("i18n");return[{name:e.t("patients.titles.admissionsDetail"),value:"detailedAdmissions"},{name:e.t("patients.titles.admissionsSummary"),value:"admissions"},{name:e.t("patients.titles.diagnosticTesting"),value:"diagnostic"},{name:e.t("patients.titles.dischargesDetail"),value:"detailedDischarges"},{name:e.t("patients.titles.dischargesSummary"),value:"discharges"},{name:e.t("patients.titles.proceduresDetail"),value:"detailedProcedures"},{name:e.t("patients.titles.proceduresSummary"),value:"procedures"},{name:e.t("patients.titles.patientStatus"),value:"status"},{name:e.t("patients.titles.totalPatientDays"),value:"patientDays"},{name:e.t("patients.titles.totalPatientDaysDetailed"),value:"detailedPatientDays"},{name:e.t("patients.titles.visit"),value:"visit"}]}),isDischargeReport:function(){var e=this.get("reportType");return e.toLowerCase().indexOf("discharges")>-1}.property("reportType"),isStatusReport:function(){var e=this.get("reportType");return"status"===e}.property("reportType"),isVisitReport:function(){var e=this.get("reportType");return"visit"===e}.property("reportType"),_addContactToList:function(e,n,a,l){var s=[];t.default.isEmpty(n)&&t.default.isEmpty(e)||(t.default.isEmpty(e)||s.push(e),t.default.isEmpty(n)||s.push(n),l.push(a+s.join(", ")))},_addReportRow:function(e,n,a,l){if(t.default.isEmpty(l)&&!t.default.isEmpty(e.patient)){var s=null;s=e.get?e.get("patient.id"):e.patient.get("id"),t.default.isEmpty(s)||(l={action:"viewPatient",model:s})}this._super(e,n,a,l)},_addRowsByType:function(e,t,n,a){var l=this._totalByType(e,t,n);l.forEach(function(e){this._addReportRow(e,!0,a)}.bind(this))},_addPatientProcedureRows:function(e,n){e.forEach(function(e){t.default.isEmpty(e.records)?this._addReportRow({procedure:"Total for "+e.type+": "+e.total},!0,n):e.records.forEach(function(t,a){this._addReportRow({patient:t.get("patient"),procedure:t.get("description"),procedureDate:t.get("procedureDate")},!1,n),a+1===e.records.length&&this._addReportRow({procedure:"Total for "+e.type+": "+e.total},!0,n)}.bind(this))}.bind(this))},_contactListToString:function(e){var n=e.get("additionalContacts"),a=void 0,l=[],s=e.get("email"),i=e.get("phone");return this._addContactToList(i,s,"Primary: ",l),t.default.isEmpty(n)||n.forEach(function(e){a="",t.default.isEmpty(e.name)||t.default.isEmpty(e.relationship)||(t.default.isEmpty(e.name)||(a+=e.name),t.default.isEmpty(e.relationship)||(t.default.isEmpty(a)||(a+=" - "),a+=e.relationship),a+=": "),this._addContactToList(e.phone,e.email,a,l)}.bind(this)),l.join(";\n")},_dateTimeFormat:function(e){return this._dateFormat(e,"l h:mm A")},_diagnosisListToString:function(e){return this._listToString(e,"diagnosis","date")},_findDiagnosticsByDate:function(){var e=this.get("endDate"),n=this.get("startDate"),a={options:{},mapReduce:"imaging_by_status"},l=this.get("maxValue");return new t.default.RSVP.Promise(function(s,i){a.options.startkey=["Completed",null,n.getTime(),null],t.default.isEmpty(e)||(e=moment(e).endOf("day").toDate(),a.options.endkey=["Completed",l,e.getTime(),l]),this.store.query("imaging",a).then(function(e){var t={imaging:e};a.mapReduce="lab_by_status",this.store.query("lab",a).then(function(e){t.labs=e,s(t)},i)}.bind(this),i)}.bind(this))},_findPatientsByStatus:function(){var e=this.get("status"),n={options:{key:e},mapReduce:"patient_by_status"};return new t.default.RSVP.Promise(function(e,t){this.store.query("patient",n).then(e,t)}.bind(this))},_findProceduresByDate:function(){var e=this.get("endDate"),n=this.get("startDate"),a={options:{},mapReduce:"procedure_by_date"},l=this.get("maxValue");return new t.default.RSVP.Promise(function(s,i){a.options.startkey=[n.getTime(),null],t.default.isEmpty(e)||(e=moment(e).endOf("day").toDate(),a.options.endkey=[e.getTime(),l]),this.store.query("procedure",a).then(s,i)}.bind(this))},_findVisitsByDate:function(){var e=this.get("endDate"),n=this.get("startDate"),a={options:{},mapReduce:"visit_by_date"},l=this.get("isDischargeReport"),s=this.get("maxValue");return l&&(a.mapReduce="visit_by_discharge_date"),new t.default.RSVP.Promise(function(l,i){var o=this.get("isDischargeReport");a.options.startkey=[n.getTime(),null],t.default.isEmpty(e)||(e=moment(e).endOf("day").toDate(),o?a.options.endkey=[e.getTime(),s]:a.options.endkey=[e.getTime(),s,s]),this.store.query("visit",a).then(l,i)}.bind(this))},_filterByLike:function(e,n,a){return e.filter(function(e){var n=e.get("field");if(t.default.isEmpty(n))return!1;if(t.default.isArray(n)){var l=n.find(function(e){return this._haveLikeValue(e,a)}.bind(this));return!t.default.isEmpty(l)}return this._haveLikeValue(n,a)})},_filterInPatientVisit:function(e){var n=e.get("outPatient"),a=e.get("status");return!n&&!t.default.isEmpty(a)},_finishVisitReport:function(e){var t=this._totalByType(e,"visitType","total");t.forEach(function(e){"total"===e.type?this._addReportRow({visitDate:"Total visits: "+e.total}):(e.records.forEach(function(e){this._addReportRow(e)}.bind(this)),this._addReportRow({visitDate:"Total for "+e.type+": "+e.total}))}.bind(this)),this._finishReport()},_formatPrimaryDiagnosis:function(e){var t=this.getDiagnoses(e,!0,!1);return this._diagnosisListToString(t)},_formatSecondaryDiagnosis:function(e){var t=this.getDiagnoses(e,!0,!0);return this._diagnosisListToString(t)},_generateAdmissionOrDischargeReport:function(e,n){var a=this,l=!1,s=void 0,i={},o=this.get("i18n").t("patients.labels.sexNotEntered");n.indexOf("detailed")>-1?(l=!0,s=this.get("admissionDetailReportColumns"),s.patientDays.include=!1,"detailedDischarges"===n?s.dischargeDate.include=!0:s.dischargeDate.include=!1):s=this.get("admissionReportColumns"),e=e.filter(this._filterInPatientVisit),e.forEach(function(e){if(!this.get("isDischargeReport")||!t.default.isEmpty(e.get("endDate"))){var n={patient:e.get("patient"),patientId:e.get("patient.displayPatientId"),patientName:e.get("patient.displayName"),admissionDate:e.get("startDate"),dischargeDate:e.get("endDate")},a=e.get("patient.sex");a||(a=o);var l=i[a];l||(l={count:0,rows:[]},i[a]=l),l.count++,l.rows.push(n)}}.bind(this));var r=0,d=function(e){a._addReportRow(e,!1,s)};for(var c in i)l?(i[c].rows.forEach(d),this._addReportRow({patientId:c+" Total: "+i[c].count},!0,s)):this._addReportRow({sex:c,total:i[c].count},!0,s),r+=i[c].count;this._addReportRow({patientId:"Grand Total: "+r},!0,s),this._finishReport(s)},_generateDiagnosticReport:function(){this._findDiagnosticsByDate().then(function(e){var t=this.get("diagnosticReportColumns");this._addRowsByType(e.imaging,"imagingType.name","Total for imaging: ",t),this._addRowsByType(e.labs,"labType.name","Total for labs: ",t),this._finishReport(t)}.bind(this),function(e){this._notifyReportError("Error in _generateDiagnosticReport: "+e)}.bind(this))},_generatePatientDaysReport:function(e,n){e=e.filter(this._filterInPatientVisit);var a=0===n.indexOf("detailed"),l=this.get("endDate"),s=void 0,i=moment(this.get("startDate")).startOf("day");a?(s=this.get("admissionDetailReportColumns"),s.patientDays.include=!0,s.dischargeDate.include=!0):s={total:{label:"Total",include:!0,property:"total",format:"_numberFormat"}},l=t.default.isEmpty(l)?moment().endOf("day"):moment(l).endOf("day");var o=e.reduce(function(e,n){var o=n.get("endDate"),r=moment(n.get("startDate")).startOf("day");o=t.default.isEmpty(o)?moment().endOf("day"):moment(o).endOf("day"),r.isBefore(i)&&(r=i),o.isAfter(l)&&(o=l);var d=o.diff(r,"days",!0);return a&&this._addReportRow({patient:n.get("patient"),patientId:n.get("patient.displayPatientId"),patientName:n.get("patient.displayName"),admissionDate:n.get("startDate"),dischargeDate:n.get("endDate"),patientDays:d},!1,s),e+=d}.bind(this),0);a?this._addReportRow({patientDays:"Total: "+this._numberFormat(o)},!0,s):this._addReportRow({total:o},!1,s),this._finishReport(s)},_generateProcedureReport:function(e){this._findProceduresByDate().then(function(n){var a=void 0;if(n=n.filter(function(e){var n=e.get("visit");return!t.default.isEmpty(n)&&!t.default.isEmpty(n.get("patient.id"))&&n.get("patient.archived")!==!0}),0===e.indexOf("detailed")){a=this.get("procedureDetailReportColumns"),n.forEach(function(e){e.set("patient",e.get("visit.patient"))});var l=this._totalByType(n,"description","all procedures");this._addPatientProcedureRows(l,a),this._finishReport(a)}else a=this.get("diagnosticReportColumns"),this._addRowsByType(n,"description","Total procedures: ",a),this._finishReport(a)}.bind(this),function(e){this._notifyReportError("Error in _generateProcedureReport: "+e); +}.bind(this))},_generateStatusReport:function(){this._findPatientsByStatus().then(function(e){var t=this.get("statusReportColumns"),n=e.sortBy("lastName","firstName");this._getPatientVisits(n).then(function(e){e.forEach(function(e){this._addReportRow({patient:e},!1,t)}.bind(this)),this._finishReport(t)}.bind(this)).catch(function(e){this._notifyReportError("Error in _generateStatusReport: "+e)}.bind(this))}.bind(this)).catch(function(e){this._notifyReportError("Error in _generateStatusReport: "+e)}.bind(this))},_generateVisitReport:function(e){var n=this,a=this.get("reportColumns"),l=this.getProperties("examiner","visitDate","visitType","location","clinic","primaryDiagnosis","secondaryDiagnosis");for(var s in l)if(!t.default.isEmpty(l[s]))switch(s){case"diagnosis":e=this._filterByLike(e,"diagnosisList",l[s]);break;default:e=e.filterBy(s,l[s])}a.procedures.include?!function(){var a={};e.forEach(function(e){a[e.get("id")]=e.get("procedures")}),t.default.RSVP.hash(a).then(function(t){e.forEach(function(e){e.set("resolvedProcedures",t[e.get("id")])}),this._finishVisitReport(e)}.bind(n))}():this._finishVisitReport(e)},_getPatientVisits:function(e){return new t.default.RSVP.Promise(function(n,a){var l={};e.forEach(function(e){l[e.get("id")]=this.getPatientVisits(e)}.bind(this)),t.default.RSVP.hash(l).then(function(t){e.forEach(function(e){e.set("visits",t[e.get("id")])}),n(e)},a)}.bind(this))},_haveLikeValue:function(e,t){return e.toLowerCase().indexOf(t.toLowerCase())>-1},_listToString:function(e,n,a){var l=[];return t.default.isEmpty(e)||(l=e.map(function(e){return t.default.get(e,n)+" ( "+this._dateFormat(t.default.get(e,a))+")"}.bind(this))),l.join(",\n")},_totalByType:function(e,n,a){var l=0,s=[];return e.forEach(function(e){var a=e.get(n),i=void 0;t.default.isEmpty(a)||(i=s.find(function(e){var t=e.type;return t.trim().toLowerCase()===a.toLowerCase()}),t.default.isEmpty(i)&&(i={type:a.trim(),total:0,records:[]},s.push(i)),i.total++,i.records.push(e),l++)}),s=s.sortBy("type"),s.push({type:a,total:l}),s},_procedureListToString:function(e){return this._listToString(e,"description","procedureDate")},_validateDates:function(){var e=void 0,n=this.get("endDate"),a=!0,l=this.get("reportType"),s=this.get("startDate");return"status"===l||(t.default.isEmpty(s)?(e="Please enter a start date.",a=!1):!t.default.isEmpty(n)&&n.getTime()0&&this.set("firstKey",this._getStartKeyFromItem(e.get("firstObject"))),e.get("length")>i){var n=e.popObject();this.set("nextStartKey",this._getStartKeyFromItem(n))}else this.set("nextStartKey");t(e)}.bind(this),a)}.bind(this))},queryParams:{sortDesc:{refreshModel:!0},sortKey:{refreshModel:!0},startKey:{refreshModel:!0}},setupController:function(e,t){var a=this.getProperties("firstKey","nextStartKey");e.setProperties(a);var l={currentScreenTitle:this.get("pageTitle")};this.get("hideNewButton")?l.newButtonAction=null:n.default.isEmpty(this.get("newButtonAction"))||(l.newButtonAction=this.get("newButtonAction")),n.default.isEmpty(this.get("newButtonText"))||(l.newButtonText=this.get("newButtonText")),this.send("setSectionHeader",l),this.closeProgressModal(),this._super(e,t)}})}),define("hospitalrun/routes/abstract-module-route",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember","hospitalrun/mixins/user-session"],function(e,t,n,a){function l(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0),e.set("searchText",this.get("searchText")),this.controllerFor("navigation").closeProgressModal();var n=this.controllerFor(this.get("moduleName")),l="Search Results for "+a.default.Handlebars.Utils.escapeExpression(this.get("searchText"))+"";n.set("currentScreenTitle",l.htmlSafe())}})}),define("hospitalrun/routes/application",["exports","ember-simple-auth/mixins/application-route-mixin","ember","hospitalrun/mixins/setup-user-role"],function(e,t,n,a){var l=n.default.inject,s=n.default.Route,i=s.extend(t.default,a.default,{database:l.service(),config:l.service(),session:l.service(),shouldSetupUserRole:!0,actions:{closeModal:function(){this.disconnectOutlet({parentView:"application",outlet:"modal"})},openModal:function(e,t){t&&this.controllerFor(e).set("model",t),this.renderModal(e)},updateModal:function(e,t){this.controllerFor(e).set("model",t)}},model:function(e,t){var n=this.get("session"),a=n&&n.get("isAuthenticated");return this.get("config").setup().then(function(e){if("finishgauth"!==t.targetName&&"login"!==t.targetName){if(this.set("shouldSetupUserRole",!0),a)return this.get("database").setup(e).catch(function(){n.invalidate()})}else"finishgauth"===t.targetName&&this.set("shouldSetupUserRole",!1)}.bind(this))},afterModel:function(){this.controllerFor("navigation").set("allowSearch",!1),$("#apploading").remove()},renderModal:function(e){this.render(e,{into:"application",outlet:"modal"})},sessionAuthenticated:function(){this.get("shouldSetupUserRole")===!0&&this.setupUserRole(),this._super()}});e.default=i}),define("hospitalrun/routes/index",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember"],function(e,t,n){e.default=n.default.Route.extend(t.default,{afterModel:function(){this.controllerFor("navigation").set("allowSearch",!1)}})}),define("hospitalrun/routes/login",["exports","ember","ember-simple-auth/mixins/unauthenticated-route-mixin"],function(e,t,n){e.default=t.default.Route.extend(n.default,{config:t.default.inject.service(),beforeModel:function(e){return this.get("session").get("isAuthenticated")?void this._super(e):this.get("config").useGoogleAuth().then(function(e){e&&window.location.replace("/auth/google")})}})}),define("hospitalrun/serializers/application",["exports","ember-pouch"],function(e,t){e.default=t.Serializer.extend()}),define("hospitalrun/serializers/user",["exports","ember-data"],function(e,t){var n=t.default.JSONSerializer.extend({attrs:{rev:"_rev"},primaryKey:"_id",isNewSerializerAPI:!0,normalizeArrayResponse:function(e,t,n,a,l){var s=n.rows.map(function(e){return e.doc}.bind(this));return this._super(e,t,s,a,l)},normalizeSaveResponse:function(e,t,n){return{data:{id:n.id,type:"user",attrs:{rev:n.rev}}}}});e.default=n}),define("hospitalrun/services/ajax",["exports","ember-ajax/services/ajax"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/services/config",["exports","ember"],function(e,t){var n=t.default.inject,a=t.default.run;e.default=t.default.Service.extend({configDB:null,database:n.service(),session:n.service(),sessionData:t.default.computed.alias("session.data"),setup:function(){var e=this.replicateConfigDB.bind(this),t=this.loadConfig.bind(this),n=this.createDB();return this.set("configDB",n),this.setCurrentUser(),e(n).then(t)},createDB:function(){return new PouchDB("config")},replicateConfigDB:function(e){var n=new t.default.RSVP.Promise(function(t){var n=document.location.protocol+"//"+document.location.host+"/db/config";e.replicate.from(n).then(t).catch(t)});return n},loadConfig:function(){var e=this.get("configDB"),n={include_docs:!0,keys:["config_consumer_key","config_consumer_secret","config_disable_offline_sync","config_oauth_token","config_token_secret","config_use_google_auth"]};return new t.default.RSVP.Promise(function(t,a){e.allDocs(n,function(e,n){e&&(console.log("Could not get configDB configs:",e),a(e));for(var l={},s=0;s-1){d=n;var u=n.split("/");r=u.pop(),n=u.join("/"),n+="/"}if(d.indexOf(".")===-1)if(e.type){var p=e.type.split("/");d+="."+p.pop()}else d+=".png";this.fileExists(d).then(function(u){if(u&&(d=n+i.getTime()+r),t.default.isEmpty(o)&&s("Local filesystem unavailable, please use Google Chrome browser"),t.default.isEmpty(r)&&!t.default.isEmpty(e.type)){var p=e.type.split("/");p.length>1&&(d+="."+p[1])}o.mkdir(n,!1,function(){o.write(d,{data:e,type:e.type},function(e){c.saveFileLink(d,a),l(e)},function(e){s(e)})},function(e){s(e)})}.bind(this))}.bind(this))},deleteFile:function(e,n){return new t.default.RSVP.Promise(function(t,a){var l=this.get("filer"),s=this.get("config");try{l.rm(e,function(){s.removeFileLink(n),t()},a)}catch(e){a(e)}}.bind(this))},downloadIfNeeded:function(e){var n=t.default.get(e,"fileName");this.fileExists(n).then(function(t){t||this._downloadFileFromServer(e)}.bind(this))},fileExists:function(e){return new t.default.RSVP.Promise(function(t){var n=this.get("filer");n.fs.root.getFile(e,{},function(){t(!0)},function(){t(!1)})}.bind(this))},fileToDataURL:function(e){return new t.default.RSVP.Promise(function(t){var n=new FileReader;n.onloadend=function(e){t(e.target.result)},n.readAsDataURL(e)})},fileToString:function(e){return new t.default.RSVP.Promise(function(t){var n=new FileReader;n.onloadend=function(e){t(e.target.result)},n.readAsText(e)})},isFileSystemEnabled:function(){var e=this.get("filer");return!t.default.isEmpty(e)}.property("filer"),pathToFileSystemURL:function(e){return new t.default.RSVP.Promise(function(t){var n=this.get("filer");n.fs.root.getFile(e,{},function(e){t(e.toURL())},function(){t()})}.bind(this))}})}),define("hospitalrun/services/i18n",["exports","ember-i18n/services/i18n"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/services/keyboard",["exports","ember-keyboard/services/keyboard"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/services/session",["exports","ember-simple-auth/services/session"],function(e,t){e.default=t.default}),define("hospitalrun/services/validations",["exports","ember"],function(e,t){var n=t.default.set;e.default=t.default.Service.extend({init:function(){n(this,"cache",{})}})}),define("hospitalrun/serviceworkers/pouchdb-sync",["exports"],function(e){function t(){if(!d&&r.config_disable_offline_sync!==!0){var e={ajax:{headers:{},timeout:3e4}};r.config_consumer_secret&&r.config_token_secret&&r.config_consumer_key&&r.config_oauth_token&&(e.ajax.headers["x-oauth-consumer-secret"]=r.config_consumer_secret,e.ajax.headers["x-oauth-consumer-key"]=r.config_consumer_key,e.ajax.headers["x-oauth-token-secret"]=r.config_token_secret,e.ajax.headers["x-oauth-token"]=r.config_oauth_token);var t=self.location.protocol+"//"+self.location.host+"/db/main",n=new PouchDB(t,e);d=u.sync(n,{live:!0,retry:!0}).on("change",function(e){logDebug("local sync change",e)}).on("paused",function(){logDebug("local sync paused")}).on("active",function(){logDebug("local sync active")}).on("denied",function(e){logDebug("local sync denied:",e)}).on("complete",function(e){logDebug("local sync complete:",e)}).on("error",function(e){logDebug("local sync error:",e)})}}function n(){return new Promise(function(e,t){r?e():c.allDocs({include_docs:!0}).then(function(t){r={},t.rows.forEach(function(e){r[e.id]=e.doc.value}),e()},t)})}function a(e,a,l,s){return n().then(t).catch(function(e){logDebug("Error setting up remote sync",JSON.stringify(e,null,2))}),logDebug("Looking for couchdb response for:",e.url),new Promise(function(t,n){var r=performance.now();toolbox.networkOnly(e,a,l).then(function(a){if(a){var l=performance.now()-r;t(a),i(l,e.url)}else logDebug("Network first returned no response, get data from local pouch db."),o(s,e,t,n)}).catch(function(a){logDebug("Network first returned err, get data from local pouch db:",a),o(s,e,t,n)})})}function l(e){return new Response(JSON.stringify(e),{status:200,statusText:"OK"})}function s(e){var t={};if(e.indexOf("?")>0)for(var n=e.split("?"),a=decodeURIComponent(n[1]).split("&"),l=0;l()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}}),define("hospitalrun/utils/get-cmd-key",["exports","ember-keyboard/utils/get-cmd-key"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/i18n/compile-template",["exports","ember-i18n/utils/i18n/compile-template"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/i18n/missing-message",["exports","ember-i18n/utils/i18n/missing-message"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/item-condition",["exports","ember"],function(e,t){function n(){var e=arguments.length<=0||void 0===arguments[0]?"B":arguments[0],n=t.default.A(l).findBy("rank",e);return n.value}function a(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];return e*=t,e>=14?"good":e<7?"bad":"average"}e.rankToMultiplier=n,e.getCondition=a;var l=[{rank:"A",value:.5},{rank:"B",value:1},{rank:"C",value:2}]}),define("hospitalrun/utils/listener-name",["exports","ember-keyboard/utils/listener-name"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/patient-validation",["exports","ember"],function(e,t){e.default={patientTypeAhead:{acceptance:{accept:!0,if:function(e){if(!e.get("selectPatient"))return!1;if(!e.get("hasDirtyAttributes"))return!1;var n=e.get("patient.displayName"),a=e.get("patientTypeAhead");if(t.default.isEmpty(n)||t.default.isEmpty(a))return!0;var l=a.substr(0,n.length).toLowerCase();return 0!==n.toLowerCase().indexOf(l)},message:"Please select a patient"}}}}),define("hospitalrun/utils/pouch-views",["exports","ember"],function(e,t){function n(e,t){return t.query(e,{limit:0}).catch(function(e){console.log("index error: "+JSON.stringify(e,null,2))})}function a(e,t){var n={_id:"_design/"+e.name,version:e.version,views:{}};return t&&(n._rev=t),n.views[e.name]={map:e.function.toString()},e.sort&&(n.lists={sort:e.sort}),n}function l(e,a,l,s){return a.get("_design/"+e.name).then(function(i){return i.version!==e.version?o(e,a,i._rev,l,s):l?n(e.name,a):t.default.RSVP.resolve()},function(){return o(e,a,null,l,s)})}function s(e,t,n){var a="function(head, req) {function keysEqual(keyA, keyB) {for (var i= 0; i < keyA.length; i++) {if (keyA[i] !== keyB[i]) {return false;}}return true;}";return t&&(a+='function getCompareDate(dateString) {if (!dateString || dateString === "") {return 0;}return new Date(dateString).getTime();}'),a+='function compareStrings(aString, bString) {if (!aString) {aString = "";}if (!bString) {bString = "";}if (aString < bString) {return -1;} else if (aString > bString) {return 1;} else {return 0;}}var row,rows=[],startingPosition = 0;while(row = getRow()) {rows.push(row);}',n&&(a+="rows = rows.filter("+n+");"),a+="rows.sort("+e+');if (req.query.sortDesc) {rows = rows.reverse();}if (req.query.sortStartKey) {var startKey = JSON.parse(req.query.sortStartKey);for (var i=0; i 0) {rows = rows.slice(startingPosition);}send(JSON.stringify({"rows" : rows}));}'}function i(e,t){return"function(doc) {\n var doctype, uidx;\n if (doc._id && (uidx = doc._id.indexOf('_')) > 0 && !doc.data.archived) {\n doctype = doc._id.substring(0, uidx);\n if (doctype === '"+e+"') {\n "+t+"\n }\n }\n }"}function o(e,t,l,s,i){var o=a(e,l);return s&&console.log("WARNING: The view "+e.name+" is out of date. Please update the pouch dump "+i+" to the latest version of "+e.name),t.put(o).then(function(){return n(e.name,t)},function(e){console.log("ERR updating design doc:",JSON.stringify(e,null,2))})}function r(e){return"var "+e+" = doc.data."+e+";\n if ("+e+" && "+e+' !== "") {\n '+e+" = new Date("+e+");\n if ("+e+".getTime) {\n "+e+" = "+e+".getTime();\n }\n }"}var d="if (doc.data.friendlyId) {\n emit([doc.data.friendlyId, doc._id]);\n } else if (doc.data.externalPatientId) {\n emit([doc.data.externalPatientId, doc._id]);\n } else {\n emit([doc._id, doc._id]);\n }",c=s(function(e,t){var n="";switch(req.query&&req.query.sortKey&&(n=req.query.sortKey),n){case"firstName":case"sex":case"lastName":case"status":return compareStrings(e.doc.data[n],t.doc.data[n]);case"dateOfBirth":return getCompareDate(e.doc.data.dateOfBirth)-getCompareDate(t.doc.data.dateOfBirth);default:return 0}}.toString(),!0),u=[{name:"appointments_by_date",function:i("appointment",r("endDate")+"\n "+r("startDate")+"\n emit([startDate, endDate, doc._id]);"),sort:s(function(e,t){function n(e){return e&&""!==e?e:"Scheduled"}var a="";switch(req.query&&req.query.sortKey&&(a=req.query.sortKey),a){case"appointmentType":case"location":case"provider":return compareStrings(e.doc.data[a],t.doc.data[a]);case"date":var l=getCompareDate(e.doc.data.startDate)-getCompareDate(t.doc.data.startDate);return 0===l?getCompareDate(e.doc.data.endDate)-getCompareDate(t.doc.data.endDate):l;case"status":var s=n(e.doc.data[a]),i=n(t.doc.data[a]);return compareStrings(s,i);default:return 0}}.toString(),!0,function(e){var t=null,n=!0;if(req.query&&req.query.filterBy&&(t=JSON.parse(req.query.filterBy)),!t)return!0;for(var a=0;a0)!function(){var o=e.rows.map(function(e){return s.getEmberId(e.id)});l.findRecord(n,a,o).then(function(e){var n=a.modelName.camelize().pluralize(),l=[];o.forEach(function(t){var a=e[n].findBy("id",t);l.push(a)}),e[n]=l,t(e)},i)}();else{var o={};o[a.modelName]=[],t(o)}})},_doesStartKeyContainSpecialCharacters:function(e){var n=!1,a=this.get("maxValue");return!t.default.isEmpty(e)&&t.default.isArray(e)&&e.forEach(function(e){null!==e&&e!==a||(n=!0)}),n},_startChangesToStoreListener:function(){var e=this.get("db");e&&(this.changes=e.changes({since:"now",live:!0,returnDocs:!1}).on("change",s(this,"onChange")).on("error",t.default.K),e.changesListener=this.changes)},generateIdForRecord:function(){return l.default.v4()},query:function(e,n,a,l){for(var s=this,i=!1,o=0;o0}),_canModifyValue:function(e,t){switch(t){case"inventory_types":if("Medication"===e)return!1;break;case"lab_pricing_types":if("Lab Procedure"===e)return!1;break;case"imaging_pricing_types":if("Imaging Procedure"===e)return!1;break;case"visit_types":if("Admission"===e)return!1;if("Imaging"===e)return!1;if("Lab"===e)return!1;if("Pharmacy"===e)return!1}return!0},_sortValues:function(e,n){return t.default.compare(e.toLowerCase(),n.toLowerCase())},activateKeyboard:t.default.on("init",function(){this.set("keyboardActivated",!0)}),updateListKeyboard:t.default.on((0,o.keyDown)("ctrl+KeyS"),(0,o.keyDown)("cmd+KeyS"),function(e){this.send("updateList"),e.preventDefault()}),actions:{addValue:function(){this.send("openModal","admin.lookup.edit",t.default.Object.create({isNew:!0}))},confirmDeleteValue:function(e){var n=this.get("i18n"),a=n.t("admin.lookup.titles.deleteLookupValue"),l=n.t("admin.lookup.messages.deleteLookupValue",{value:e});this.displayConfirm(a,l,"deleteValue",t.default.Object.create({valueToDelete:e}))},deleteValue:function(e){var t=this.get("lookupTypeList"),n=t.get("value"),a=e.get("valueToDelete");n.removeObject(a.toString()),t.save()},editValue:function(e){t.default.isEmpty(e)||this.send("openModal","admin.lookup.edit",t.default.Object.create({isNew:!1,originalValue:e.toString(),value:e.toString()}))},importList:function(){var e=this.get("fileSystem"),t=this.get("importFile"),n=this.get("lookupTypeList");t&&t.type?e.fileToDataURL(t).then(function(e){var a=e.split(",");n.setProperties({_attachments:{file:{content_type:t.type,data:a[1]}},importFile:!0}),n.save().then(function(){this.displayAlert(this.get("i18n").t("admin.lookup.alertImportListSaveTitle"),this.get("i18n").t("admin.lookup.alertImportListSaveMessage"),"refreshLookupLists"),this.set("importFile"),this.set("model.importFileName")}.bind(this))}.bind(this)):this.displayAlert(this.get("i18n").t("admin.lookup.alertImportListTitle"),this.get("i18n").t("admin.lookup.alertImportListMessage"))},updateList:function(){var e=this.get("lookupTypeList");e.save().then(function(){this.displayAlert(this.get("i18n").t("admin.lookup.alertImportListUpdateTitle"),this.get("i18n").t("admin.lookup.alertImportListUpdateMessage"))}.bind(this))},updateValue:function(e){var t=!1,n=this.get("lookupTypeList"),a=n.get("value"),l=e.get("value");if(e.get("isNew"))t=!0;else{var s=e.get("originalValue");l!==s&&(a.removeObject(s),t=!0)}t&&(a.addObject(l),a=a.sort(this._sortValues),n.set("value",a),n.save())}}})}),define("hospitalrun/admin/lookup/edit/controller",["exports","ember","hospitalrun/mixins/is-update-disabled"],function(e,t,n){e.default=t.default.Controller.extend(n.default,{editController:t.default.inject.controller("admin/lookup"),showUpdateButton:!0,updateButtonAction:"update",updateButtonText:function(){var e=this.get("i18n");return this.get("model.isNew")?e.t("buttons.add"):e.t("buttons.update")}.property("model.isNew"),actions:{cancel:function(){this.send("closeModal")},update:function(){t.default.isEmpty(this.get("model.value"))||(this.get("editController").send("updateValue",this.get("model")),this.send("closeModal"))}}})}),define("hospitalrun/admin/lookup/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"2fhdRW7b",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["helper",["t"],[["helper",["if"],[["get",["model","isNew"]],"admin.lookup.edit.template.addTitle","admin.lookup.edit.template.editTitle"],null]],null],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["helper",["t"],["admin.lookup.edit.template.labelTitle"],null],"value","lookup-type-value"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton","action"],[["get",["model"]],false,"update"]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/lookup/edit/template.hbs"}})}),define("hospitalrun/admin/lookup/route",["exports","hospitalrun/routes/abstract-index-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({hideNewButton:!0,pageTitle:(0,n.translationMacro)("admin.lookup.pageTitle"),model:function(){return this.store.findAll("lookup")},afterModel:function(e){e.set("lookupType","anesthesia_types")},actions:{deleteValue:function(e){this.controller.send("deleteValue",e)},refreshLookupLists:function(){this.refresh()}}})}),define("hospitalrun/admin/lookup/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Kwt+t5YD",block:'{"statements":[["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],6],["text"," "],["close-element"],["text","\\n"],["close-element"],["text","\\n"],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["unknown",["lookupTitle"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["canEditValues"]]],null,5],["text"," "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEditValues"]]],null,2],["block",["em-form"],null,[["model","submitButton"],[["get",["lookupTypeList"]],false]],1],["text"," "],["close-element"],["text","\\n"],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],["Organize Pricing By Type","organizeByType","col-sm-4"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-4"],["flush-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["labels.userCanAddNewValue"],null],"userCanAdd"]]],false],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"updateList"]],["flush-element"],["append",["helper",["t"],["buttons.update"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["showOrganizeByType"]]],null,0],["text"," "],["open-element","div",[]],["static-attr","class","col-sm-4"],["flush-element"],["text","\\n "],["append",["helper",["file-upload"],null,[["label","property","selectedFile"],[["helper",["t"],["labels.importFile"],null],"importFileName",["get",["importFile"]]]]],false],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"importList"]],["flush-element"],["append",["helper",["t"],["buttons.import"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"addValue"]],["flush-element"],["append",["helper",["t"],["buttons.addValue"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editValue",["get",["lookupTypeValue","value"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.edit"],null],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"confirmDeleteValue",["get",["lookupTypeValue","value"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["labels.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","lookup-type-value"],["flush-element"],["append",["unknown",["lookupTypeValue","value"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["lookupTypeValue","canModify"]]],null,3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["lookupTypeValue"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.value"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["lookupTypeValues"]]],null,4],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected"],["col-xs-3 lookup-type form-input-group",["helper",["t"],["labels.lookupType"],null],"lookupType",["get",["lookupTypes"]],"value","name",["get",["model","lookupType"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/lookup/template.hbs"}})}),define("hospitalrun/admin/query/controller",["exports","ember","hospitalrun/mixins/edit-panel-props","hospitalrun/utils/select-values"],function(e,t,n,a){e.default=t.default.Controller.extend(n.default,{hideCancelButton:!0,showUpdateButton:!0,updateButtonAction:"query",updateButtonText:"Query",objectTypeList:["appointment","imaging","inv-location","inv-purchase","inv-request","inventory","invoice","lab","medication","patient","photo","procedure","visit","vital"],objectTypes:t.default.computed.map("objectTypeList",a.default.selectValuesMap),actions:{query:function e(){var n=this.get("fieldName"),a=this.get("objectType"),l=this.get("queryValue"),e={containsValue:{value:l,keys:[n]}};this.store.query(a,e).then(function(e){var n=this;t.default.isEmpty(e)?(this.set("errorMessage","Query returned no results."),this.set("haveError",!0),this.set("showQueryResults",!1)):!function(){var a=void 0,l=["id"],s=[];e.get("firstObject").eachAttribute(function(e){l.push(e)}),e.forEach(function(e){var n=[];l.forEach(function(l){a=e.get(l),t.default.isEmpty(a)||n.push({name:l,value:a})}),s.push(n)}),n.set("resultRows",s),n.set("haveError",!1),n.set("showQueryResults",!0)}()}.bind(this),function(e){this.set("errorMessage",e),this.set("haveError",!0),this.set("showQueryResults",!1)}.bind(this))}}})}),define("hospitalrun/admin/query/route",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember","hospitalrun/mixins/user-session"],function(e,t,n,a){e.default=n.default.Route.extend(a.default,t.default,{beforeModel:function(){this.currentUserCan("query_db")||this.transitionTo("application")}})}),define("hospitalrun/admin/query/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"jNp4d1tp",block:'{"statements":[["text","\\n"],["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["unknown",["name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["value"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["result"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["text","Field"],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["text","Value"],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["resultRow"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":["resultRow"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","Query Results"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["each"],[["get",["resultRows"]]],null,1],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["static-attr","role","alert"],["flush-element"],["append",["unknown",["errorMessage"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","selected"],["col-xs-3","Object Type","objectType",["get",["objectTypes"]],["get",["objectType"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-input"],null,[["label","property"],["Field Name","fieldName"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["label","property"],["Query Value","queryValue"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],4],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveError"]]],null,3],["block",["if"],[["get",["showQueryResults"]]],null,2]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/query/template.hbs"}})}),define("hospitalrun/admin/roles/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/user-roles","hospitalrun/mixins/user-session"],function(e,t,n,a,l){e.default=t.default.extend(a.default,l.default,{currentRole:"",disabledAction:!1,hideCancelButton:!0,updateCapability:"define_user_roles",filteredRoles:n.default.computed.filter("userRoles",function(e){return"System Administrator"!==e.name}),availableCapabilities:[{name:"admin",capabilities:["admin","loadDb","updateConfig","defineUserRoles"]},{name:"appointments",capabilities:["appointments","addAppointment"]},{name:"billing",capabilities:["billing","addBillingDiagnosis","addCharge","addPricing","addPricingProfile","addInvoice","addPayment","deleteInvoice","deletePricing","deletePricingProfile","editInvoice","invoices","overrideInvoice","pricing"]},{name:"patients",capabilities:["patients","addDiagnosis","addNote","addPhoto","addPatient","addProcedure","addSocialwork","addVisit","addVitals","admitPatient","deleteNote","deletePhoto","deletePatient","deleteAppointment","deleteDiagnosis","deleteProcedure","deleteSocialwork","deleteVitals","deleteVisit","dischargePatient","patientReports","visits"]},{name:"medication",capabilities:["medication","addMedication","deleteMedication","fulfillMedication"]},{name:"labs",capabilities:["labs","addLab","completeLab","deleteLab"]},{name:"imaging",capabilities:["imaging","addImaging","completeImaging","deleteImaging"]},{name:"inventory",capabilities:["inventory","addInventoryRequest","addInventoryItem","addInventoryPurchase","adjustInventoryLocation","deleteInventoryItem","fulfillInventory"]}],missingCapablities:n.default.computed("availableCapabilities","defaultCapabilities",function(){var e=this.get("availableCapabilities"),t=Object.keys(e),n=Object.keys(this.get("defaultCapabilities")),a=[];return n.forEach(function(n){var l=!1;t.forEach(function(t){var a=e[t];a.capabilities.includes(n.camelize())&&(l=!0)}),l||a.push(n+" - "+n.camelize())}),a}),capabilitySections:n.default.computed.map("availableCapabilities",function(e){var t=this,n=[];return e.capabilities.forEach(function(e){n.push({key:e,name:t.get("i18n").t("admin.roles.capability."+e)})}),{name:this.get("i18n").t("admin.roles.capability."+e.name),capabilities:n}}),actions:{selectRole:function(e){var t=this,n=this.get("model").findBy("id",e.dasherize());this.set("currentRole",e),this.set("roleToUpdate",n);try{n?!function(){var e=n.get("capabilities");t.get("availableCapabilities").forEach(function(n){n.capabilities.forEach(function(n){e.includes(n)?t.set(n,!0):t.set(n,!1)})})}():!function(){var n=t.get("defaultCapabilities");Object.keys(n).forEach(function(a){var l=n[a];l.includes(e)?(console.log("Role has capability: "+a),t.set(a.camelize(),!0)):t.set(a.camelize(),!1)})}()}catch(e){console.log("ex setting role:",e)}},update:function(){var e=this,t=this.get("currentRole"),a=this.get("roleToUpdate");n.default.isEmpty(a)&&(a=this.get("store").createRecord("user-role",{id:t.dasherize(),name:t}));var l=[];this.get("availableCapabilities").forEach(function(t){t.capabilities.forEach(function(t){e.get(t)===!0&&l.push(t)})}),a.set("capabilities",l),a.save().then(function(){e.displayAlert(e.get("i18n").t("admin.roles.titles.roleSaved"),e.get("i18n").t("admin.roles.messages.roleSaved",{roleName:t}))})}}})}),define("hospitalrun/admin/roles/route",["exports","hospitalrun/routes/abstract-edit-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({hideNewButton:!0,newTitle:(0,n.translationMacro)("admin.userRoles"),editTitle:(0,n.translationMacro)("admin.userRoles"),model:function(){return this.get("store").findAll("user-role")}})}),define("hospitalrun/admin/roles/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"2aNV3BOq",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["capability","name"]],["get",["capability","key"]],["helper",["concat"],["checkbox"," checkbox-",["get",["capability","key"]]],null]]]],false],["text","\\n"]],"locals":["capability"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["unknown",["capabilitySection","name"]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","detail-section-content"],["flush-element"],["text","\\n"],["block",["each"],[["get",["capabilitySection","capabilities"]]],null,0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["capabilitySection"]},{"statements":[["text"," "],["open-element","option",[]],["dynamic-attr","value",["concat",[["unknown",["userRole","name"]]]]],["dynamic-attr","selected",["helper",["eq"],[["get",["selectedRole"]],["get",["userRole","name"]]],null],null],["flush-element"],["text","\\n "],["append",["unknown",["userRole","name"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["userRole"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group has-success"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.role"],null],false],["close-element"],["text","\\n "],["open-element","select",[]],["dynamic-attr","onchange",["helper",["action"],[["get",[null]],"selectRole"],[["value"],["target.value"]]],null],["static-attr","class","form-control role-select"],["flush-element"],["text","\\n "],["open-element","option",[]],["static-attr","disabled",""],["dynamic-attr","selected",["helper",["is-not"],[["get",["selectedRole"]]],null],null],["flush-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["filteredRoles"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["capabilitySections"]]],null,1]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/admin/roles/template.hbs"}})}),define("hospitalrun/admin/route",["exports","hospitalrun/routes/abstract-module-route"],function(e,t){e.default=t.default.extend({addCapability:"add_user",allowSearch:!1,moduleName:"admin",sectionTitle:"Admin",editPath:function(){return"users.edit"}.property(),deletePath:function(){return"users.delete"}.property()})}),define("hospitalrun/admin/visit-forms/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/visit-types"],function(e,t,n,a){var l=n.default.computed;e.default=t.default.extend(a.default,{hideCancelButton:!0,updateCapability:"update_config",visitTypesList:l.alias("model.visitTypesList"),visitFormsForEditing:l("model.visitForms","visitTypes",function(){var e=this.get("model.visitForms"),t=this.get("visitTypes"),n=t.map(function(t){return e[t.value]||(e[t.value]="initial"),{type:t.value,form:e[t.value]}});return n}),visitTemplateIds:["initial","followup"],visitTemplates:l(function(){var e=this.get("i18n"),t=this.get("visitTemplateIds");return t.map(function(t){return{id:t,value:e.t("admin.visitForms.labels."+t)}})}),afterUpdate:function(){this.displayAlert(this.get("i18n").t("admin.address.titles.optionsSaved"),this.get("i18n").t("admin.address.messages.addressSaved"))},actions:{selectForm:function(e,t){var n=this.get("model.visitForms");n[e]=t.target.value}}})}),define("hospitalrun/admin/visit-forms/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({hideNewButton:!0,editTitle:(0,a.translationMacro)("admin.visitForms.titles.visitForms"),newTitle:n.default.computed.alias("editTitle"),model:function(){var e=this.get("store"),t={visitFormsOption:e.find("option","visit_forms"),visitTypes:e.find("lookup","visit_types")};return new n.default.RSVP.Promise(function(e,a){n.default.RSVP.hashSettled(t).then(function(t){var a=n.default.Object.create();"fulfilled"===t.visitTypes.state&&a.set("visitTypesList",t.visitTypes.value),"fulfilled"===t.visitFormsOption.state?a.set("visitForms",t.visitFormsOption.value):a.set("visitForms",{}),e(a)},a)})}})}),define("hospitalrun/admin/visit-forms/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Wi/FzQog",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","option",[]],["dynamic-attr","value",["concat",[["unknown",["visitTemplate","id"]]]]],["dynamic-attr","selected",["helper",["eq"],[["get",["visitForm","form"]],["get",["visitTemplate","id"]]],null],null],["flush-element"],["text","\\n "],["append",["unknown",["visitTemplate","value"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visitTemplate"]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visitForm","type"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","select",[]],["dynamic-attr","onchange",["helper",["action"],[["get",[null]],"selectForm",["get",["visitForm","type"]]],null],null],["static-attr","class","form-control role-select"],["flush-element"],["text","\\n"],["block",["each"],[["get",["visitTemplates"]]],null,1],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visitForm"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["admin.visitForms.labels.visitType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["admin.visitForms.labels.form"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["visitFormsForEditing"]]],null,2],["text"," "],["close-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/visit-forms/template.hbs"}})}),define("hospitalrun/admin/workflow/controller",["exports","hospitalrun/controllers/abstract-edit-controller"],function(e,t){e.default=t.default.extend({hideCancelButton:!0,updateCapability:"update_config",afterUpdate:function(){this.displayAlert(this.get("i18n").t("admin.workflow.titles.optionsSaved"),this.get("i18n").t("admin.workflow.messages.optionsSaved"))}})}),define("hospitalrun/admin/workflow/route",["exports","hospitalrun/routes/abstract-edit-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({hideNewButton:!0,editTitle:(0,n.translationMacro)("admin.workflow.editTitle"),model:function(){var e=this.get("store");return e.find("option","workflow_options").catch(function(){return e.push(e.normalize("option",{id:"workflow_options",value:{admissionDeposit:!1,clinicPrepayment:!1,followupPrepayment:!1,outpatientLabPrepayment:!1,outpatientImagingPrepayment:!1,outpatientMedicationPrepayment:!1}}))})}})}),define("hospitalrun/admin/workflow/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Mr+Jr99y",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.admissionDepositLabel"],null],"value.admissionDeposit"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.clinicPrepaymentLabel"],null],"value.clinicPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.followupPrepaymentLabel"],null],"value.followupPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.outpatientLabLabel"],null],"value.outpatientLabPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.outpatientImagingLabel"],null],"value.outpatientImagingPrepayment"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["admin.workflow.outpatientMedicationLabel"],null],"value.outpatientMedicationPrepayment"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/admin/workflow/template.hbs"}})}),define("hospitalrun/app",["exports","ember","hospitalrun/resolver","ember-load-initializers","hospitalrun/config/environment"],function(e,t,n,a,l){var s=void 0;t.default.MODEL_FACTORY_INJECTIONS=!0,s=t.default.Application.extend({modulePrefix:l.default.modulePrefix,podModulePrefix:l.default.podModulePrefix,Resolver:n.default}),(0,a.default)(s,l.default.modulePrefix),e.default=s}),define("hospitalrun/appointments/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller"],function(e,t){e.default=t.default.extend({title:"Delete Appointment",afterDeleteAction:function(){var e=this.get("model.deleteFromPatient");return e?"appointmentDeleted":"closeModal"}.property("model.deleteFromPatient")})}),define("hospitalrun/appointments/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"k7CkZQLv",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["appointments.messages.deleteAppointmentMessage"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/appointments/delete/template.hbs"}})}),define("hospitalrun/appointments/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/appointment-statuses","ember","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s){e.default=t.default.extend(n.default,l.default,s.default,{appointmentsController:a.default.inject.controller("appointments"),findPatientVisits:!1,locationList:a.default.computed.alias("appointmentsController.locationList"),lookupListsToUpdate:[{name:"physicianList",property:"model.provider",id:"physician_list"},{name:"locationList",property:"model.location",id:"visit_location_list"}],physicianList:a.default.computed.alias("appointmentsController.physicianList"),showTime:function(){var e=this.get("model.allDay"),t=this.get("isAdmissionAppointment");return!e&&t}.property("model.allDay","isAdmissionAppointment"),visitTypesList:a.default.computed.alias("appointmentsController.visitTypesList"),cancelAction:function(){var e=this.get("model.returnTo");return a.default.isEmpty(e)?this._super():"returnTo"}.property("model.returnTo"),isAdmissionAppointment:function(){var e=this.get("model"),t=e.get("appointmentType"),n="Admission"===t;return n}.property("model.appointmentType"),updateCapability:"add_appointment",afterUpdate:function(){this.send(this.get("cancelAction"))},actions:{appointmentTypeChanged:function(e){var t=this.get("model");t.set("appointmentType",e);var n=this.get("isAdmissionAppointment");t.set("allDay",n)}}})}),define("hospitalrun/appointments/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember","hospitalrun/mixins/patient-list-route","ember-i18n"],function(e,t,n,a,l){e.default=t.default.extend(a.default,{editTitle:(0,l.translationMacro)("appointments.editTitle"),modelName:"appointment",newTitle:(0,l.translationMacro)("appointments.newTitle"),getNewData:function(){return n.default.RSVP.resolve({appointmentType:"Admission",allDay:!0,selectPatient:!0,startDate:new Date})}})}),define("hospitalrun/appointments/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"T3iCZyRj",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["date-time-picker"],null,[["datePickerClass","label","model"],["required test-appointment-date",["helper",["t"],["labels.date"],null],["get",["model"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-picker"],null,[["property","label","showTime","class"],["startDate",["helper",["t"],["labels.startDate"],null],["get",["showTime"]],"col-sm-4 required test-appointment-start"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","showTime","class"],["endDate",["helper",["t"],["labels.endDate"],null],["get",["showTime"]],"col-sm-4 required test-appointment-end"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"appointments.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required test-patient-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","selectPatient"]]],null,3,2],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["if"],[["get",["isAdmissionAppointment"]]],null,1,0],["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["helper",["t"],["labels.allDay"],null],"allDay","col-sm-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-input-group col-sm-6 required test-appointment-type"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["static-attr","for","startTime"],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["append",["helper",["select-list"],null,[["content","optionLabelPath","optionValuePath","value","class","id","action"],[["get",["visitTypes"]],"value","id",["get",["model","appointmentType"]],"form-control","appointmentType",["helper",["action"],[["get",[null]],"appointmentTypeChanged"],null]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["className","property","label","list","selection"],["col-sm-6 test-appointment-with","provider",["helper",["t"],["labels.with"],null],["get",["physicianList"]],["get",["model","provider"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["className","property","label","list","selection"],["col-sm-6 required test-appointment-location","location",["helper",["t"],["labels.location"],null],["get",["locationList"]],["get",["model","location"]]]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content"],["form-input-group col-sm-3 test-appointment-status","status",["helper",["t"],["labels.status"],null],["get",["appointmentStatuses"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["label","property","rows"],[["helper",["t"],["labels.notes"],null],"notes",3]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],4]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/appointments/edit/template.hbs"}})}),define("hospitalrun/appointments/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],canAddVisit:function(){return this.currentUserCan("add_visit")}.property(),canEdit:function(){return this.currentUserCan("add_appointment")}.property(),canDelete:function(){return this.currentUserCan("delete_appointment")}.property(),sortProperties:["startDate","endDate"],sortAscending:!0})}),define("hospitalrun/appointments/index/route",["exports","hospitalrun/routes/abstract-index-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({editReturn:"appointments.index",modelName:"appointment",pageTitle:(0,n.translationMacro)("appointments.thisWeek"),_getStartKeyFromItem:function(e){var t=e.get("endDate"),n=this._getPouchIdFromItem(e),a=e.get("startDate");return t&&""!==t&&(t=new Date(t),t.getTime&&(t=t.getTime())),a&&""!==a&&(a=new Date(a),a.getTime&&(a=a.getTime())),[a,t,n]},_modelQueryParams:function(){var e=moment().endOf("week").toDate().getTime(),t=moment().startOf("week").toDate().getTime(),n=this._getMaxPouchId();return{options:{startkey:[t,null,null],endkey:[e,e,n]},mapReduce:"appointments_by_date"}},actions:{editAppointment:function(e){e.set("returnTo",this.get("editReturn")),this.send("editItem",e)}}})}),define("hospitalrun/appointments/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"om9IAHIz",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","appointments/item"],["text","\\n"]],"locals":["appointment"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.provider"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/index/template.hbs"}})}),define("hospitalrun/appointments/item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"tgFrtDZJ",block:'{"statements":[["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","appointment-date"],["flush-element"],["text","\\n "],["append",["unknown",["appointment","formattedAppointmentDate"]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","patient","displayName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","appointmentType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","provider"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","appointment-status"],["flush-element"],["append",["unknown",["appointment","displayStatus"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEdit"]]],null,3],["block",["if"],[["get",["canAddVisit"]]],null,2],["block",["if"],[["get",["canDelete"]]],null,0],["text"," "],["close-element"],["text","\\n"],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"checkIn",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-in"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["visits.buttons.checkIn"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["appointment","displayStatus"]],"Scheduled"],null]],null,1]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/appointments/item/template.hbs"}})}),define("hospitalrun/appointments/missed/controller",["exports","hospitalrun/appointments/index/controller"],function(e,t){e.default=t.default.extend({startKey:[]})}),define("hospitalrun/appointments/missed/route",["exports","hospitalrun/appointments/index/route","ember-i18n"],function(e,t,n){e.default=t.default.extend({editReturn:"appointments.missed",modelName:"appointment",pageTitle:(0,n.translationMacro)("appointments.missed"),_modelQueryParams:function(){var e=this._super.apply(this,arguments);return e.filterBy=[{name:"status",value:"Missed"}],e}})}),define("hospitalrun/appointments/missed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"I2CynOk8",block:'{"statements":[["partial","appointments/index"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/missed/template.hbs"}})}),define("hospitalrun/appointments/route",["exports","hospitalrun/routes/abstract-module-route","hospitalrun/mixins/user-session","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{addCapability:"add_appointment",allowSearch:!1,currentScreenTitle:(0,a.translationMacro)("appointments.currentScreenTitle"),editTitle:(0,a.translationMacro)("appointments.editTitle"),newTitle:(0,a.translationMacro)("appointments.newTitle"),moduleName:"appointments",newButtonText:(0,a.translationMacro)("appointments.buttons.newButton"),sectionTitle:(0,a.translationMacro)("appointments.sectionTitle"),actions:{checkIn:function(e){var t=e.get("patient"),n=e.getProperties("startDate","endDate","location","patient");n.visitType=e.get("appointmentType"),n.examiner=e.get("provider"),n.appointment=e,n.hidePatientSelection=!0,n.patient=t,n.returnTo="appointments",this.transitionTo("visits.edit","checkin").then(function(e){e.currentModel.setProperties(n),e.controller.getPatientDiagnoses(t)}.bind(this))}},additionalModels:[{name:"physicianList",findArgs:["lookup","physician_list"]},{name:"locationList",findArgs:["lookup","visit_location_list"]},{name:"visitTypesList",findArgs:["lookup","visit_types"]}]})}),define("hospitalrun/appointments/search/controller",["exports","hospitalrun/appointments/index/controller","hospitalrun/mixins/appointment-statuses","ember","hospitalrun/utils/select-values","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s){e.default=t.default.extend(n.default,s.default,{appointmentsController:a.default.inject.controller("appointments"),appointmentType:null,physicians:a.default.computed.alias("appointmentsController.physicianList.value"),physicianList:function(){return l.default.selectValues(this.get("physicians"),!0)}.property("physicians"),provider:null,queryParams:["appointmentType","provider","status","startKey","startDate"],selectedProvider:null,selectedStatus:null,sortProperties:null,startDate:null,startKey:[],status:null,visitTypesList:a.default.computed.alias("appointmentsController.visitTypesList"),actions:{search:function(){var e=this.get("model.selectedAppointmentType"),t={startKey:[],previousStartKey:null,previousStartKeys:[]},n=this.get("model.selectedProvider"),l=this.get("model.selectedStatus"),s=this.get("model.selectedStartingDate");a.default.isEmpty(e)?t.appointmentType=null:t.appointmentType=e,a.default.isEmpty(n)?t.provider=null:t.provider=n,a.default.isEmpty(l)?t.status=null:t.status=l,a.default.isEmpty(s)||(t.startDate=s.getTime()),a.default.isEmpty(t)||this.setProperties(t)}}})}),define("hospitalrun/appointments/search/route",["exports","hospitalrun/appointments/index/route","hospitalrun/mixins/date-format","ember","ember-i18n"],function(e,t,n,a,l){e.default=t.default.extend(n.default,{editReturn:"appointments.search",filterParams:["appointmentType","provider","status"],modelName:"appointment",pageTitle:(0,l.translationMacro)("appointments.searchTitle"),queryParams:{appointmentType:{refreshModel:!0},provider:{refreshModel:!0},status:{refreshModel:!0},startDate:{refreshModel:!0},startKey:{refreshModel:!0}},_modelQueryParams:function(e){var t=e.startDate,n=this.get("maxValue");t=a.default.isEmpty(t)?moment():moment(parseInt(t));var l=t.startOf("day").toDate().getTime(),s={startkey:[l,null,"appointment_"],endkey:[n,n,"appointment_"+n]};return{options:s,mapReduce:"appointments_by_date"}},model:function(e){return this._super(e).then(function(t){t.setProperties({selectedAppointmentType:e.appointmentType,selectedProvider:e.provider,selectedStatus:e.status});var n=e.startDate;return n=new Date,a.default.isEmpty(e.startDate)||n.setTime(e.startDate),t.set("selectedStartingDate",n),t.set("display_selectedStartingDate",this._dateFormat(n)),t}.bind(this))}})}),define("hospitalrun/appointments/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"jVMV4UgE",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],7]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","appointments/item"],["text","\\n"]],"locals":["appointment"]},{"statements":[["append",["helper",["t"],["labels.status"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.with"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.location"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.type"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.date"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["selectedStartingDate",["helper",["t"],["appointments.labels.selectedStartingDate"],null],"col-sm-3"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content"],["col-sm-3","selectedStatus",["helper",["t"],["labels.status"],null],["get",["appointmentStatusesWithEmpty"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content"],["col-sm-3",["helper",["t"],["labels.type"],null],"selectedAppointmentType",["get",["visitTypesWithEmpty"]]]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content"],["col-sm-3","selectedProvider",["helper",["t"],["labels.with"],null],["get",["physicianList"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-info"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],6],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"search"]],["flush-element"],["append",["helper",["t"],["buttons.search"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["date",["get",["sortDesc"]],["get",["sortKey"]]]],5],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["appointmentType",["get",["sortDesc"]],["get",["sortKey"]]]],4],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["location",["get",["sortDesc"]],["get",["sortKey"]]]],3],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["provider",["get",["sortDesc"]],["get",["sortKey"]]]],2],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["status",["get",["sortDesc"]],["get",["sortKey"]]]],1],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/search/template.hbs"}})}),define("hospitalrun/appointments/today/controller",["exports","hospitalrun/appointments/index/controller"],function(e,t){e.default=t.default.extend({startKey:[]})}),define("hospitalrun/appointments/today/route",["exports","hospitalrun/appointments/index/route","ember-i18n"],function(e,t,n){e.default=t.default.extend({editReturn:"appointments.today",modelName:"appointment",pageTitle:(0,n.translationMacro)("appointments.todayTitle"),_modelQueryParams:function(){var e=moment().endOf("day").toDate().getTime(),t=this.get("maxValue"),n=moment().startOf("day").toDate().getTime();return{options:{startkey:[n,null,"appointment_"],endkey:[e,e,"appointment_"+t]},mapReduce:"appointments_by_date"}}})}),define("hospitalrun/appointments/today/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"NpXWri4D",block:'{"statements":[["partial","appointments/index"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":true}',meta:{moduleName:"hospitalrun/appointments/today/template.hbs"}})}),define("hospitalrun/authenticators/custom",["exports","ember","ember-simple-auth/authenticators/base"],function(e,t,n){e.default=n.default.extend({config:t.default.inject.service(),database:t.default.inject.service(),serverEndpoint:"/db/_session", -useGoogleAuth:!1,_absolutizeExpirationTime:function(e){if(!t.default.isEmpty(e))return new Date((new Date).getTime()+1e3*(e-5)).getTime()},_checkUser:function(e){var n=this;return new t.default.RSVP.Promise(function(t,a){n._makeRequest("POST",{name:e.name},"/chkuser").then(function(n){n.error&&a(n),e.displayName=n.displayName,e.role=n.role,e.prefix=n.prefix,t(e)},function(){t(e)})})},_getPromise:function(e,n){return new t.default.RSVP.Promise(function(a,l){this._makeRequest(e,n).then(function(e){t.default.run(function(){a(e)})},function(e){t.default.run(function(){l(e.responseJSON||e.responseText)})})}.bind(this))},_makeRequest:function(e,n,a){return a||(a=this.serverEndpoint),t.default.$.ajax({url:a,type:e,data:n,dataType:"json",contentType:"application/x-www-form-urlencoded",xhrFields:{withCredentials:!0}})},authenticate:function(e){var n=this;if(e.google_auth){var a=function(){n.useGoogleAuth=!0;var a={google_auth:!0,consumer_key:e.params.k,consumer_secret:e.params.s1,token:e.params.t,token_secret:e.params.s2,name:e.params.i};return{v:new t.default.RSVP.Promise(function(e,t){n._checkUser(a).then(function(t){e(t),n.get("config").setCurrentUser(t.name)},t)})}}();if("object"==typeof a)return a.v}return new t.default.RSVP.Promise(function(t,a){var l={name:e.identification,password:e.password};n._makeRequest("POST",l).then(function(e){e.name=l.name,e.expires_at=n._absolutizeExpirationTime(600),n._checkUser(e).then(function(e){n.get("config").setCurrentUser(e.name);var l=n.get("database");l.setup({}).then(function(){t(e)},a)},a)},function(e){a(e.responseJSON||e.responseText)})})},invalidate:function(){return this.useGoogleAuth?t.default.RSVP.resolve():this._getPromise("DELETE")},restore:function(e){var n=this;return new t.default.RSVP.Promise(function(a,l){var s=(new Date).getTime();!t.default.isEmpty(e.expires_at)&&e.expires_at0;){var l=a.splice(0,t).map(this._mapCheckboxValues.bind(this));e.push(l)}return e}.property("content","checkboxesPerRow"),actions:{checkboxChanged:function(e,n){var a=this.get("property"),l="model."+a,s=this.get(l);t.default.isArray(s)||(s=[]),n&&!s.includes(e)?s.addObject(e):!n&&s.includes(e)&&s.removeObject(e),this.set(l,s),this.set("selection",s),this.get("model").validate().catch(t.default.K)}}})}),define("hospitalrun/components/control-within-label",["exports","ember-rapid-forms/components/control-within-label"],function(e,t){e.default=t.default}),define("hospitalrun/components/custom-form-manager",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){var a=t.default.computed,l=t.default.isEmpty;e.default=t.default.Component.extend(n.default,{customForms:t.default.inject.service(),formType:null,formsForType:null,model:null,openModalAction:"openModal",didReceiveAttrs:function(){var e=this;this._super.apply(this,arguments);var t=this.get("customForms"),n=this.get("formType");t.getCustomForms([n]).then(function(t){var n=e.get("isDestroyed");n||e.set("formsForType",t)})},formsForSelect:a("formsForType","usedForms",function(){var e=this.get("formsForType"),t=this.get("usedForms");if(!l(e)){var n=e.filter(function(e){return!t.includes(e.get("id"))});return n=n.map(function(e){return{id:e.get("id"),value:e.get("name")}})}}),formsToDisplay:a("formsForType","model.customForms",function(){var e=this.get("formsForType"),t=this.get("model.customForms");if(!l(t)&&!l(e))return Object.keys(t).map(function(t){return{form:e.findBy("id",t),propertyPrefix:"customForms."+t+"."}})}),usedForms:a("model.customForms",function(){var e=this.get("model.customForms");return l(e)?[]:Object.keys(e)}),showAddButton:a("formsForSelect",function(){var e=this.get("formsForSelect");return!l(e)}),actions:{addForm:function(){var e=this.get("model"),n=this.get("formsForSelect");this.sendAction("openModalAction","custom-form-add",t.default.Object.create({modelToAddTo:e,customForms:n}))}}})}),define("hospitalrun/components/custom-form",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){var a=t.default.computed,l=t.default.isEmpty;e.default=t.default.Component.extend(n.default,{classNames:"detail-section-content",propertyPrefix:"",fieldsByRow:a("form","form.fields.[]","form.columns",function(){var e=this,n=[],a=this.get("form"),s=this.get("form.fields");return l(a)||l(s)||!function(){var a=e.getWithDefault("form.columns",1),l=[],i=0,o=Math.floor(12/a);s.forEach(function(e){var s=e.get("classNames");s||(s="");var r=e.get("colSpan")||1;(i===a||i+r>a)&&(n.push(l.slice()),l=[],i=0),s+=" col-sm-"+o*r,e.set("displayClassNames",s),"radio"===e.get("type")&&e.set("mappedValues",e.get("values").map(function(e){return t.default.get(e,"label")})),l.push(e),i+=r}),i>0&&n.push(l)}(),n})})}),define("hospitalrun/components/date-input",["exports","ember","ember-rapid-forms/components/html-input"],function(e,t,n){e.default=n.default.extend({_picker:null,_shouldSetDate:function(e,n){return n&&(t.default.isEmpty(e)||t.default.isEmpty(n.getDate())||e.getTime&&n.getDate().getTime()!==e.getTime())},currentDateChangedValue:function(){var e=this.get("currentDate"),n=this.get("_picker");!t.default.isEmpty(e)&&this._shouldSetDate(e,n)&&n.setDate(e)},format:function(){var e=this.get("showTime");return e?"l h:mm A":"l"}.property("mainComponent.showTime"),showTimeChanged:function(){var e=this.get("_picker");e&&(e.destroy(),this.didInsertElement())}.observes("mainComponent.showTime"),dateSet:function(){var e=this.get("currentDate"),n=this.get("_picker");if(this._shouldSetDate(e,n)){var a=n.getDate(),l=this.get("mainComponent"),s=l.get("dateSetAction");this.set("currentDate",a),t.default.isEmpty(s)||l.sendAction("dateSetAction",a)}},didInsertElement:function(){var e=this.get("currentDate"),n=this.$("input"),a=null,l=this.getProperties("format","yearRange","showTime");l.onSelect=this.dateSet.bind(this),t.default.isEmpty(this.get("minDate"))||(l.minDate=this.get("minDate"),"now"===l.minDate&&(l.minDate=new Date)),t.default.isEmpty(this.get("maxDate"))||(l.maxDate=this.get("maxDate"),"now"===l.maxDate&&(l.maxDate=new Date)),l.field=n[0],a=new Pikaday(l),t.default.run.next(this,function(){a.setDate(e)}),this.set("_picker",a)},didReceiveAttrs:function(){this._super.apply(this,arguments);var e=this.get("mainComponent.originalPropery"),n="display_"+e;this.currentDate=t.default.computed.alias("mainComponent.model."+e),this.minDate=t.default.computed.alias("mainComponent.minDate"),this.maxDate=t.default.computed.alias("mainComponent.maxDate"),this.showTime=t.default.computed.alias("mainComponent.showTime"),this.yearRange=t.default.computed.alias("mainComponent.yearRange"),this.addObserver("mainComponent.model."+e,this,this.currentDateChangedValue),t.default.Binding.from("mainComponent.model.errors."+e).to("mainComponent.model.errors."+n).connect(this)},willDestroyElement:function(){var e=this.get("_picker");e&&e.destroy(),this.set("_picker",null)}})}),define("hospitalrun/components/date-picker",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default.extend({dateSetAction:null,htmlComponent:"date-input",minDate:null,maxDate:null,originalPropery:null,showTime:!1,yearRange:10,didReceiveAttrs:function(e){var t=this.get("property"),n="display_"+t;this.set("property",n),this.set("originalPropery",t),this._super(e)}})}),define("hospitalrun/components/date-time-picker",["exports","ember"],function(e,t){var n=t.default.computed,a=t.default.isEmpty;e.default=t.default.Component.extend({i18n:t.default.inject.service(),dateTimePickerDate:null,datePickerClass:"",endDate:t.default.computed.alias("model.endDate"),endHour:null,endMinute:null,label:"",startDate:t.default.computed.alias("model.startDate"),startHour:null,startMinute:null,didReceiveAttrs:function(){var e=moment(this.get("endDate")),t=moment(this.get("startDate"));a(e)&&(e=t),this.set("endHour",e.hour()),this.set("endMinute",e.minute()),this.set("startHour",t.hour()),this.set("startMinute",t.minute()),this.set("dateTimePickerDate",t.toDate()),this._updateDates()},hourList:n(function(){var e=void 0,t=[],n=this.get("i18n");for(e=0;e<24;e++){var a=void 0,l={hour:e%12};a=0===e?n.t("components.dateTimePicker.midnight"):12===e?n.t("components.dateTimePicker.noon"):e<12?n.t("components.dateTimePicker.amHour",l):n.t("components.dateTimePicker.pmHour",l),t.push({name:a,value:e})}return t}),isAllDay:n("model.allDay",function(){var e=this.get("model.allDay");return e&&(this.set("startHour",0),this.set("startMinute",0),this.set("endHour",23),this.set("endMinute",59),this._updateDates()),e}),minuteList:n(function(){var e=void 0,t=[];for(e=0;e<60;e++)t.push({name:String("00"+e).slice(-2),value:e});return t}),actions:{dateChanged:function(){this._updateDates()},endHourChanged:function(e){this.set("endHour",e),this._updateDates()},endMinuteChanged:function(e){this.set("endMinute",e),this._updateDates()},startHourChanged:function(e){this.set("startHour",e),this._updateDates()},startMinuteChanged:function(e){this.set("startMinute",e),this._updateDates()}},endTimeHasError:n("model.isValid",function(){var e=this.get("model.errors.endDate");return e.length>0}),_updateDates:function(){var e=this;t.default.run.once(this,function(){var n=["start","end"];n.forEach(function(n){var a=n+"Date",l=e.get(a),s=e.get("dateTimePickerDate"),i=e.get(n+"Hour"),o=e.get(n+"Minute");t.default.isEmpty(s)||(l=moment(s),l.hour(i),l.minute(o),e.set(a,l.toDate()))});var a=e.get("model");a.validate().catch(t.default.K)})}})}),define("hospitalrun/components/edit-panel",["exports","ember"],function(e,t){e.default=t.default.Component.extend({editPanelProps:null,cancelAction:"cancel",actions:{cancel:function(){this.sendAction("cancelAction")},disabledAction:function(){this.sendAction("editPanelProps.disabledAction")},fireButtonAction:function(e){this.set(e,e),this.sendAction(e)},updateButtonAction:function(){this.sendAction("editPanelProps.updateButtonAction")}}})}),define("hospitalrun/components/em-checkbox",["exports","ember-rapid-forms/components/em-checkbox"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-custom-input",["exports","ember-rapid-forms/components/em-custom-input"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-control-help",["exports","ember-rapid-forms/components/em-form-control-help"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-group",["exports","ember-rapid-forms/components/em-form-group"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-label",["exports","ember-rapid-forms/components/em-form-label"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form-submit",["exports","ember-rapid-forms/components/em-form-submit"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-form",["exports","ember-rapid-forms/components/em-form"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-input",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-select",["exports","ember-rapid-forms/components/em-select"],function(e,t){e.default=t.default}),define("hospitalrun/components/em-text",["exports","ember-rapid-forms/components/em-text"],function(e,t){e.default=t.default}),define("hospitalrun/components/erf-html-checkbox",["exports","ember-rapid-forms/components/html-checkbox"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-custom-input",["exports","ember-rapid-forms/components/html-custom-input"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-input",["exports","ember-rapid-forms/components/html-input"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-select",["exports","ember-rapid-forms/components/html-select"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/erf-html-text",["exports","ember-rapid-forms/components/html-text"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/components/ext-radio",["exports","ember"],function(e,t){e.default=t.default.Component.extend({includeOtherOption:!1,otherOptionLabel:null,showInline:!1,haveLabel:function(){var e=this.get("content.firstObject");return!t.default.isEmpty(e.label)}.property("content"),radioClass:function(){return this.get("showInline")?"radio-inline":"radio"}.property("showInline")})}),define("hospitalrun/components/file-upload",["exports","hospitalrun/components/image-upload"],function(e,t){e.default=t.default.extend({resizeFile:!1})}),define("hospitalrun/components/form-group-control",["exports","ember-rapid-forms/components/form-group-control"],function(e,t){e.default=t.default}),define("hospitalrun/components/form-group",["exports","ember-rapid-forms/components/form-group"],function(e,t){e.default=t.default}),define("hospitalrun/components/icd10-pcs-typeahead",["exports","hospitalrun/components/icd10-typeahead"],function(e,t){e.default=t.default.extend()}),define("hospitalrun/components/icd10-typeahead",["exports","hospitalrun/components/type-ahead"],function(e,t){e.default=t.default.extend({class:"scrollable-typeahead",minlength:2,selectionKey:"id",setOnBlur:!0,templates:{header:''},_sourceQuery:function(e,t){this.bloodhound.get(e,function(n){t(n);var a=this.$(".query-results");a.html(""+e+" returned "+n.length+" results")}.bind(this))},_getSource:function(){return this._sourceQuery.bind(this)}})}),define("hospitalrun/components/image-upload",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default.extend({fileInputEl:null,resizeFile:!0,selectedFile:null,type:"file",_fileChanged:function(){var e=this,t=this.get("fileInputEl"),n=this.get("resizeFile");n?!function(){window.URL=window.URL||window.webkitURL;var n=window.URL.createObjectURL(t.files[0]),a=new Image;a.src=n,a.onload=function(){window.URL.revokeObjectURL(n),this.set("selectedFile",this._resizeImage(a))}.bind(e)}():this.set("selectedFile",t.files[0])},_resizeImage:function(e){var t=document.createElement("canvas"),n=e.height,a=e.width,l=1024,s=1024;a>n?a>s&&(n=Math.round(n*=s/a),a=s):n>l&&(a=Math.round(a*=l/n),n=l),t.width=a,t.height=n;var i=t.getContext("2d");i.drawImage(e,0,0,a,n);for(var o=t.toDataURL("image/png"),r=atob(o.split(",")[1]),d=[],c=0;c=l&&(s=a),o},0),s>-1?a.get("length")>s+1&&(a=a.slice(0,s+1),this.set("calculatedLocationPickers",a)):a.addObject(t.default.Object.create()),this._setupLocationPickers(a,n)),a.forEach(function(e){i.addObject(e.get("selectedLocation"))}),this.set("componentSelectedLocations",i)},_setup:function(){t.default.Binding.from("selectedLocations").to("componentSelectedLocations").connect(this)}.on("init"),_setupLocationPickers:function(e,a,l){e.reduce(function(e,t){var a=t.get("selectedLocation");return t.set("subLocationList",e.map(n.default.selectObjectMap)),e.includes(a)&&!l||t.set("selectedLocation",e.get("firstObject")),t.set("label","And"),e.filter(function(e){return t.get("selectedLocation.id")!==e.get("id")})},a);var s=e.get("firstObject");t.default.isEmpty(s)||s.set("label",this.get("label")),this.set("calculatedLocationPickers",e)},locationPickers:function(){var e=this.get("locationList"),n=[],a=this.get("quantityRequested");if(!t.default.isEmpty(e)&&!t.default.isEmpty(a))return this.set("doingSetup",!0),e.reduce(function(e,l){return e0)return"have-inventory-items"}.property("content"),mappedContent:function(){var e=this.get("content"),t=[];return e&&(t=e.map(this._mapInventoryItems.bind(this))),t}.property("content"),contentChanged:function(){var e=this.get("bloodhound"),t=this.get("content");e&&(e.clear(),e.add(t.map(this._mapInventoryItems.bind(this))))}.observes("content.[]")})}),define("hospitalrun/components/item-listing",["exports","ember","hospitalrun/mixins/paging-actions"],function(e,t,n){e.default=t.default.Component.extend(n.default,{classNames:["panel","panel-primary"]})}),define("hospitalrun/components/loading-message",["exports","ember","ember-i18n"],function(e,t,n){e.default=t.default.Component.extend({tagName:"span",showLoadingMessages:!1,loadingMessages:[(0,n.translationMacro)("loading.messages.0"),(0,n.translationMacro)("loading.messages.1"),(0,n.translationMacro)("loading.messages.2"),(0,n.translationMacro)("loading.messages.3"),(0,n.translationMacro)("loading.messages.4"),(0,n.translationMacro)("loading.messages.5"),(0,n.translationMacro)("loading.messages.6"),(0,n.translationMacro)("loading.messages.7"),(0,n.translationMacro)("loading.messages.8"),(0,n.translationMacro)("loading.messages.9"),(0,n.translationMacro)("loading.messages.10"),(0,n.translationMacro)("loading.messages.11")],_setRandomMessage:function(){var e=this.get("loadingMessages"),n=Math.floor(Math.random()*e.length);this.set("message",e[n]),this.set("timer",t.default.run.later(this,this._setRandomMessage,1e3))},didInsertElement:function(){this._setRandomMessage()},willDestroyElement:function(){var e=this.get("timer");t.default.isEmpty(e)||t.default.run.cancel(e)}})}),define("hospitalrun/components/location-select",["exports","ember"],function(e,t){e.default=t.default.Component.extend({locationPicker:null,_setup:function(){this.locationChange=this.currentLocationChanged.bind(this)}.on("init"),currentLocationChanged:function(e){this.get("locationPicker").set("selectedLocation",e),t.default.run.once(this,function(){this.get("parentView").locationChange()})}})}),define("hospitalrun/components/medication-allergy",["exports","ember"],function(e,t){var n=t.default.computed;e.default=t.default.Component.extend({classNames:"ps-info-group long-form",store:t.default.inject.service(),i18n:t.default.inject.service(),patient:null,displayModal:!1,currentAllergy:!1,buttonConfirmText:n("currentAllergy",function(){var e=this.get("i18n"),t=this.get("currentAllergy");return t?e.t("buttons.update"):e.t("buttons.add")}),additionalButtons:n("currentAllergy",function(){var e=this.get("currentAllergy"),t=this.get("i18n").t("buttons.delete");if(e)return[{class:"btn btn-default warning",buttonAction:"deleteAllergy",buttonIcon:"octicon octicon-x",buttonText:t}]}),modalTitle:t.default.computed("currentAllergy",function(){var e=this.get("currentAllergy"),t=this.get("i18n");return e?t.t("allergies.titles.editAllergy"):t.t("allergies.titles.addAllergy")}),closeAllergyModal:function(){this.set("currentAllergy",!1),this.set("displayModal",!1)},actions:{cancel:function(){this.closeAllergyModal()},closeModal:function(){this.closeAllergyModal()},editAllergy:function(e){this.set("currentAllergy",e),this.set("displayModal",!0)},createNewAllergy:function(){this.set("displayModal",!0)},updateAllergy:function(){var e=this,t=this.get("patient"),n=this.get("currentAllergy");n?n.save().then(function(){e.closeAllergyModal()}):(n=this.get("store").createRecord("allergy",{name:this.get("name")}),n.save().then(function(){t.get("allergies").pushObject(n),t.save().then(function(){e.set("name",""),e.closeAllergyModal()})}))},deleteAllergy:function(){var e=this,t=this.get("currentAllergy"),n=this.get("patient"),a=n.get("allergies");t.destroyRecord().then(function(){a.removeObject(t),n.save().then(function(){e.closeAllergyModal()})})}}})}),define("hospitalrun/components/modal-dialog",["exports","ember"],function(e,t){e.default=t.default.Component.extend({i18n:t.default.inject.service(),cancelAction:"cancel",closeModalAction:"closeModal",hideCancelButton:!1,hideUpdateButton:!1,isUpdateDisabled:!1,title:"",updateButtonAction:"",updateButtonClass:"",updateButtonText:"",cancelButtonText:"",cancelBtnText:function(){var e=this.get("cancelButtonText");return t.default.isEmpty(e)?this.get("i18n").t("buttons.cancel"):e}.property("cancelButtonText"),actions:{cancelAction:function(){this.sendAction("cancelAction")},fireButtonAction:function(e){this.set(e,e),this.sendAction(e)},updateAction:function(){this.sendAction("updateButtonAction")}},didInsertElement:function(){var e=this.$(".modal").modal();e.on("hidden.bs.modal",function(){this.sendAction("closeModalAction")}.bind(this))},willDestroyElement:function(){var e=this.$(".modal");e.off("hidden.bs.modal"),e.modal("hide"),$("body").removeClass("modal-open"),$(".modal-backdrop").remove()}})}),define("hospitalrun/components/nav-menu",["exports","ember","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.Component.extend(n.default,{tagName:"div",classNames:["primary-nav-item"],nav:null,show:function(){return this._setupSubNav(),this.currentUserCan(this.get("nav").capability)}.property("nav","session.data.authenticated.userCaps"),isShowing:!1,_setup:function(){var e=this.get("nav");e.closeSubnav=function(){this.set("isShowing",!1)}.bind(this),this._setupSubNav()}.on("init"),_setupSubNav:function(){var e=this,t=this.get("nav");t.subnav.forEach(function(t){t.show=e.currentUserCan(t.capability)})},callNavAction:"navAction",callCloseSettings:"closeSettings",actions:{toggleContent:function(){this.set("isShowing",!this.get("isShowing")),this.sendAction("callNavAction",this.nav)},resetNav:function(){this.sendAction("callCloseSettings")}}})}),define("hospitalrun/components/nav-paging",["exports","ember","hospitalrun/mixins/paging-actions"],function(e,t,n){e.default=t.default.Component.extend(n.default,{classNames:["paging-buttons"],paginationProps:null})}),define("hospitalrun/components/number-input",["exports","ember-rapid-forms/components/em-input"],function(e,t){e.default=t.default.extend({sanitizeFunction:function(e){return e.replace(new RegExp(/([^0-9|.]+)/g),"")},focusOut:function(){return this._sanitizeValue(),this._super()},keyUp:function(){return this._sanitizeValue(),this._super()},_sanitizeValue:function(){var e=this.get("model"),t=this.get("property"),n=e.get(t),a=this.get("sanitizeFunction")(n);e.set(t,a)}})}),define("hospitalrun/components/patient-orders",["exports","ember","hospitalrun/mixins/filter-list","hospitalrun/mixins/user-session"],function(e,t,n,a){var l=t.default.computed;e.default=t.default.Component.extend(n.default,a.default,{editImagingAction:"editImaging",editLabAction:"editLab",editMedicationAction:"editMedication",filterBy:null,filterValue:null,newImagingAction:"newImaging",newLabAction:"newLab",newMedicationAction:"newMedication",showDeleteImagingAction:"showDeleteImaging",showDeleteLabAction:"showDeleteLab",showDeleteMedicationAction:"showDeleteMedication",sortKey:null,sortDesc:!1,orderTypeFilters:t.default.computed(function(){var e=this.get("i18n");return[e.t("components.patientOrders.labels.imagingOrderType").toString(),e.t("components.patientOrders.labels.labOrderType").toString(),e.t("components.patientOrders.labels.medicationOrderType").toString()]}),canAddImaging:t.default.computed(function(){return this.currentUserCan("add_imaging")}),canAddLab:t.default.computed(function(){return this.currentUserCan("add_lab")}),canAddMedication:t.default.computed(function(){return this.currentUserCan("add_medication")}),canDeleteImaging:t.default.computed(function(){return this.currentUserCan("delete_imaging")}),canDeleteLab:t.default.computed(function(){return this.currentUserCan("delete_lab")}),canDeleteMedication:t.default.computed(function(){return this.currentUserCan("delete_medication")}),filteredList:l("orderList.[]","filterBy","filterValue",function(){var e=this.get("filterBy"),t=this.get("filterValue"),n=this.get("orderList");return n=this.filterList(n,e,t)}),orderList:l("visit.imaging.[]","visit.labs.[]","visit.medication.[]",function(){var e=this,n=this.get("i18n"),a=this.get("visit.imaging"),l=this.get("visit.labs"),s=this.get("visit.medication"),i=new t.default.A;return i.addObjects(a.map(function(t){return t.set("orderType",n.t("components.patientOrders.labels.imagingOrderType")),t.set("name",t.get("imagingType.name")),t.set("dateProcessed",t.get("imagingDate")),e._setPermissions(t,"canAddImaging","canDeleteImaging"),t})),i.addObjects(l.map(function(t){return t.set("orderType",n.t("components.patientOrders.labels.labOrderType")),t.set("name",t.get("labType.name")),t.set("dateProcessed",t.get("labDate")),e._setPermissions(t,"canAddLab","canDeleteLab"),t})),i.addObjects(s.map(function(t){return t.set("orderType",n.t("components.patientOrders.labels.medicationOrderType")),t.set("name",t.get("medicationName")),t.set("dateProcessed",t.get("prescriptionDate")),t.set("result",""),t.set("notes",t.get("prescription")),e._setPermissions(t,"canAddMedication","canDeleteMedication"),t})),i}),sortedOrders:t.default.computed("filteredList","sortKey","sortDesc",function(){var e=this.get("filteredList"),n=this.get("sortDesc"),a=this.get("sortKey");return t.default.isEmpty(e)||t.default.isEmpty(a)?e:e=e.sort(function(e,l){var s=e.get(a),i=l.get(a);return"orderType"===a&&(s=s.toString(),i=i.toString()),n?t.default.compare(i,s):t.default.compare(s,i)})}),i18n:t.default.inject.service(),visit:null,_setPermissions:function(e,t,n){e.get("canEdit")&&(this.get(t)&&e.set("canEdit",!0),this.get(n)&&e.set("canDelete",!0))},actions:{filter:function(e,t){this.setProperties({filterBy:e,filterValue:t})},newImaging:function(){this.sendAction("newImagingAction")},newLab:function(){this.sendAction("newLabAction")},newMedication:function(){this.sendAction("newMedicationAction")},editOrder:function(e){var t=e.get("constructor.modelName").capitalize();this.sendAction("edit"+t+"Action",e)},showDeleteOrder:function(e){var t=e.get("constructor.modelName").capitalize();this.sendAction("showDelete"+t+"Action",e)},sortByKey:function(e,t){this.setProperties({sortKey:e,sortDesc:t})}}})}),define("hospitalrun/components/patient-summary",["exports","ember","hospitalrun/mixins/patient-diagnosis"],function(e,t,n){var a=t.default.computed,l=t.default.isEmpty,s=["diganosisContainer","hideInActiveDiagnoses","patient.diagnoses.@each.active","patient.diagnoses.@each.secondaryDiagnosis","visit.diagnoses.@each.secondaryDiagnosis"];e.default=t.default.Component.extend(n.default,{classNames:["patient-summary"],canAddDiagnosis:!1,disablePatientLink:!1,diagnosisList:null,editDiagnosisAction:"editDiagnosis",editProcedureAction:"editProcedure",hideInActiveDiagnoses:!0,patient:null,patientProcedures:null,showAddDiagnosisAction:"showAddDiagnosis",showPatientAction:"showPatient",visit:null,diagnosisContainer:a("patient","visit",function(){var e=this.get("visit");return l(e)&&(e=this.get("patient")),e}),havePrimaryDiagnoses:a("primaryDiagnoses.length",function(){var e=this.get("primaryDiagnoses.length");return e>0}),haveProcedures:a("patientProcedures.length",function(){var e=this.get("patientProcedures.length");return e>0}),haveSecondaryDiagnoses:a("secondaryDiagnoses.length",function(){var e=this.get("secondaryDiagnoses.length");return e>0}),primaryDiagnoses:a.apply(void 0,s.concat([function(){var e=this.get("diagnosisContainer"),t=this.get("hideInActiveDiagnoses");return this.getDiagnoses(e,t,!1)}])),secondaryDiagnoses:a.apply(void 0,s.concat([function(){var e=this.get("diagnosisContainer"),t=this.get("hideInActiveDiagnoses");return this.getDiagnoses(e,t,!0)}])),shouldLinkToPatient:a("disablePatientLink",function(){var e=this.get("disablePatientLink");return!e}),showPrimaryDiagnoses:a("canAddDiagnosis","havePrimaryDiagnoses",function(){return this.get("canAddDiagnosis")||this.get("havePrimaryDiagnoses"); -}),hasAllergies:t.default.computed("patient.allergies.[]",function(){return t.default.computed.notEmpty("patient.allergies")}),actions:{linkToPatient:function(){var e=this.get("shouldLinkToPatient");if(e){var t=this.get("patient"),n=this.get("returnTo"),a=this.get("returnToContext");t.set("returnTo",n),t.set("returnToContext",a),this.sendAction("showPatientAction",this.get("patient"))}},editDiagnosis:function(e){this.sendAction("editDiagnosisAction",e)},editProcedure:function(e){e.set("returnToVisit"),e.set("returnToPatient",this.get("patient.id")),e.set("patient",this.get("patient")),this.sendAction("editProcedureAction",e)},showAddDiagnosis:function(){this.sendAction("showAddDiagnosisAction")}}})}),define("hospitalrun/components/patient-typeahead",["exports","ember","hospitalrun/mixins/patient-name","hospitalrun/components/type-ahead"],function(e,t,n,a){e.default=a.default.extend(n.default,{displayKey:"name",selectedAction:"selectedPatientChanged",setOnBlur:!0,_mapPatient:function(e){var t={};return t.name=this.getPatientDisplayName(e)+" - "+this.getPatientDisplayId(e),t[this.get("selectionKey")]=e,t},contentChanged:function(){var e=this.get("bloodhound"),n=this.get("content");e&&(e.clear(),t.default.isEmpty(n)||e.add(n.map(this._mapPatient.bind(this))))}.observes("content.[]"),mappedContent:function(){var e=this.get("content"),t=[];return e&&(t=e.map(this._mapPatient.bind(this))),t}.property("content")})}),define("hospitalrun/components/photo-display",["exports","ember"],function(e,t){e.default=t.default.Component.extend({computedPhotoUrl:null,filesystem:t.default.inject.service(),isFileSystemEnabled:t.default.computed.alias("filesystem.isFileSystemEnabled"),fileName:t.default.computed.alias("photo.fileName"),photo:null,url:t.default.computed.alias("photo.url"),photoUrl:function(){var e=this.get("computedPhotoUrl"),n=this.get("fileName"),a=this.get("filesystem"),l=this.get("isFileSystemEnabled"),s=this.get("url");return t.default.isEmpty(e)?(l&&a.pathToFileSystemURL(n).then(function(e){t.default.isEmpty(e)||this.set("computedPhotoUrl",e)}.bind(this)),s):e}.property("computedPhotoUrl","fileName","url")})}),define("hospitalrun/components/price-list",["exports","ember","hospitalrun/mixins/charge-actions"],function(e,t,n){e.default=t.default.Component.extend(n.default,{attributeBindings:["tabId:id","role"],charges:t.default.computed.alias("model.charges"),classNameBindings:["active"],classNames:["tab-pane"],index:null,model:null,pricingList:null,pricingType:null,role:"tab",setChargeQuantityAction:"setChargeQuantity",active:function(){var e=this.get("index");return 0===e}.property(),pricingListByType:function(){var e=this.get("pricingList"),n=this.get("pricingType"),a=[];if(!t.default.isEmpty(e)){e=e.filterBy("pricingType",n),e=e.map(function(e){var t=this.findChargeForPricingItem(e,this.get("charges"));return t&&this.sendAction("setChargeQuantityAction",e.id,t.get("quantity")),e}.bind(this));for(var l=0,s=e,i=s.length;l1&&!t.default.isEmpty(e)&&!isNaN(e)}.property("calculated"),currentQuantityGroups:function(){var e=void 0,n=this.get("quantityGroups"),a=this.get("targetUnit");if(e=n.get("firstObject"),!t.default.isEmpty(e)){var l=e.unit;t.default.isEmpty(l)?this.set("quantityGroups.firstObject.unit",a):this.updateCurrentUnit(l,0)}return n}.property("quantityGroups","targetUnit"),calculateTotal:function(){var e=this.get("quantityGroups"),n=!1,a=e.get("lastObject"),l=this.get("targetUnit");if(n=e.every(function(e){var n=e.quantity,a=e.unit;return!t.default.isEmpty(n)&&!t.default.isEmpty(a)&&!isNaN(n)}),n&&a.unit===l){var s=e.reduce(function(e,t){return e*parseInt(t.quantity)},1);this.set("calculated",s)}else this.set("calculated")},updateCurrentUnit:function(e,n){var a=this.get("targetUnit"),l=this.get("quantityGroups"),s=l.length;t.default.isEmpty(a)||(e===a?n0&&(this.set("selectedCamera",a[0].id),this.cameraChange(a[0].id))},_gotStream:function(e){if(this.isDestroyed)this._stopStream(e);else{var t=this.get("video");this.set("stream",e),t.src=window.URL.createObjectURL(e),t.play()}},_photoSourceChanged:function(e){var t=this.$(".camera"),n=this.$(".fileupload"),a=this.get("setupCamera");if(this.set("photoSource",e),e===l)n.show(),t.hide();else if(n.hide(),t.show(),!a){var s=this.$("canvas").get(0),i=this.$("img").get(0),o=this.$("video").get(0);this.setProperties({canvas:s,photo:i,video:o}),"undefined"==typeof MediaStreamTrack||"undefined"===MediaStreamTrack.getSources?navigator.getUserMedia&&(navigator.getUserMedia({audio:!1,video:!0},this._gotStream.bind(this),this._errorCallback),this._setupCanPlayListener(o)):(MediaStreamTrack.getSources(this._gotSources.bind(this)),this._setupCanPlayListener(o)),this.set("setupCamera",!0)}},_setupCanPlayListener:function(e){e.removeEventListener("canplay",this._setupVideo.bind(this),!1),e.addEventListener("canplay",this._setupVideo.bind(this),!1)},_setupVideo:function(){var e=this.get("canvas"),t=this.get("height"),n=this.get("video"),a=this.get("width");t=n.videoHeight/(n.videoWidth/a),n.setAttribute("width",a),n.setAttribute("height",t),e.setAttribute("width",a),e.setAttribute("height",t),this.setProperties({height:t,width:a})},_setup:function(){this.cameraChange=this._cameraChange.bind(this),this.photoSourceChange=this._photoSourceChanged.bind(this);var e=a;this.get("canCaptureVideo")||(e=l),this.set("photoSource",e)}.on("init"),_stopStream:function(e){var a=e||this.get("stream");if(!t.default.isEmpty(a))if("undefined"==typeof a.active)a.stop();else{var l=a.getTracks(),s=n(l,1),i=s[0];i.stop()}},actions:{takePhoto:function(){var e=this.get("canvas"),t=this.get("height"),n=this.get("video"),a=this.get("width");e.width=a,e.height=t,e.getContext("2d").drawImage(n,0,0,a,t);for(var l=e.toDataURL("image/png"),s=atob(l.split(",")[1]),i=[],o=0;o1}.property("photoSource","videoSources"),willDestroyElement:function(){this._stopStream()}})}),define("hospitalrun/components/text-search",["exports","ember"],function(e,t){e.default=t.default.TextField.extend(t.default.TargetActionSupport,{change:function(){this.triggerAction({action:"search"})},didInsertElement:function(){this.$().focus()}})}),define("hospitalrun/components/type-ahead",["exports","ember-rapid-forms/components/em-input","hospitalrun/mixins/typeahead"],function(e,t,n){e.default=t.default.extend(n.default)}),define("hospitalrun/components/typeahead-filter",["exports","ember","hospitalrun/mixins/typeahead"],function(e,t,n){e.default=t.default.Component.extend(n.default,{classNames:["input-group"],selectedAction:"filter",setOnBlur:!1,actions:{clearFilter:function(){var e=this.$(".tt-input");e.val(""),this.sendAction("selectedAction")}}})}),define("hospitalrun/controllers/abstract-delete-controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({afterDeleteAction:"closeModal",showUpdateButton:!0,updateButtonText:"Delete",updateButtonAction:"delete",isUpdateDisabled:!1,actions:{cancel:function(){this.send("closeModal")},delete:function(){var e=this.get("model");e.set("archived",!0),e.save().then(function(){e.unloadRecord(),this.send(this.get("afterDeleteAction"),e)}.bind(this))}}})}),define("hospitalrun/controllers/abstract-edit-controller",["exports","ember","hospitalrun/mixins/edit-panel-props","hospitalrun/mixins/is-update-disabled","hospitalrun/mixins/modal-helper","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s){e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,{cancelAction:"allItems",cancelButtonText:function(){var e=this.get("i18n"),t=this.get("model.hasDirtyAttributes");return t?e.t("buttons.cancel"):e.t("buttons.returnButton")}.property("model.hasDirtyAttributes"),disabledAction:function(){var e=this.get("model");e.validate&&e.validate().catch(t.default.K);var n=e.get("isValid");if(!n)return"showDisabledDialog"}.property("model.isValid"),isNewOrDeleted:function(){return this.get("model.isNew")||this.get("model.isDeleted")}.property("model.isNew","model.isDeleted"),lookupListsToUpdate:null,showUpdateButton:function(){var e=this.get("updateCapability");return this.currentUserCan(e)}.property("updateCapability"),updateButtonAction:"update",updateButtonText:function(){var e=this.get("i18n");return this.get("model.isNew")?e.t("buttons.add"):e.t("buttons.update")}.property("model.isNew"),updateCapability:null,_addValueToLookupList:function(e,n,a,l){var s=e.get("value");t.default.isArray(s)||(s=[]),s.includes(n)||(s.push(n),s.sort(),e.set("value",s),a.includes(e)||a.push(e),this.set(l,e))},_cancelUpdate:function(){var e=this.get("model");e.rollbackAttributes()},actions:{cancel:function(){this._cancelUpdate(),this.send(this.get("cancelAction"))},returnTo:function e(){this._cancelUpdate();var e=this.get("model.returnTo"),n=this.get("model.returnToContext");t.default.isEmpty(n)?this.transitionToRoute(e):this.transitionToRoute(e,n)},showDisabledDialog:function(){var e=this.get("i18n");this.displayAlert(e.t("alerts.warningExclamation"),e.t("messages.requiredFieldsCorrectErrors"))},update:function(e){var t=this;try{this.beforeUpdate().then(function(){t.saveModel(e)}).catch(function(e){if(!e.ignore){var n=t.get("i18n");t.displayAlert(n.t("alerts.errorExclamation"),n.t("messages.saveActionException",{message:JSON.stringify(e)}))}})}catch(e){var n=this.get("i18n");this.displayAlert(n.t("alerts.errorExclamation"),n.t("messages.saveActionException",{message:JSON.stringify(e)}))}}},afterUpdate:function(){},beforeUpdate:function(){return t.default.RSVP.Promise.resolve()},saveModel:function(e){this.get("model").save().then(function(t){this.updateLookupLists(),e||this.afterUpdate(t)}.bind(this))},updateLookupLists:function(){var e=this.get("lookupListsToUpdate"),n=t.default.A();t.default.isEmpty(e)||(e.forEach(function(e){var a=this.get(e.property),l=this.get(e.name),s=this.get("store");t.default.isEmpty(a)||(l||(l=s.push(s.normalize("lookup",{id:e.id,value:[],userCanAdd:!0}))),t.default.isArray(a)?a.forEach(function(t){this._addValueToLookupList(l,t,n,e.name)}.bind(this)):this._addValueToLookupList(l,a,n,e.name))}.bind(this)),n.forEach(function(e){e.save()}))}})}),define("hospitalrun/controllers/abstract-paged-controller",["exports","ember","hospitalrun/mixins/pagination-props","hospitalrun/mixins/progress-dialog","hospitalrun/mixins/user-session"],function(e,t,n,a,l){e.default=t.default.Controller.extend(n.default,a.default,l.default,{addPermission:null,deletePermission:null,nextStartKey:null,previousStartKey:null,previousStartKeys:[],progressMessage:"Loading Records. Please wait...",progressTitle:"Loading",queryParams:["startKey","sortKey","sortDesc"],sortDesc:!1,sortKey:null,canAdd:function(){return this.currentUserCan(this.get("addPermission"))}.property(),canDelete:function(){return this.currentUserCan(this.get("deletePermission"))}.property(),canEdit:function(){return this.currentUserCan(this.get("addPermission"))}.property(),showActions:function(){return this.get("canAdd")||this.get("canEdit")||this.get("canDelete")}.property("canAdd","canEdit","canDelete"),disablePreviousPage:function(){return t.default.isEmpty(this.get("previousStartKey"))}.property("previousStartKey"),disableNextPage:function(){return t.default.isEmpty(this.get("nextStartKey"))}.property("nextStartKey"),showPagination:function(){return!t.default.isEmpty(this.get("previousStartKey"))||!t.default.isEmpty(this.get("nextStartKey"))}.property("nextStartKey","previousStartKey"),hasRecords:t.default.computed("model.length",{get:function(){var e=this.get("model");return!t.default.isEmpty(e)&&e.get("length")>0}}),actions:{nextPage:function(){var e=this.get("nextStartKey"),t=this.get("previousStartKeys"),n=this.get("firstKey");this.set("previousStartKey",n),t.push(n),this.set("startKey",e),this.showProgressModal()},previousPage:function(){var e=this.get("previousStartKey"),t=this.get("previousStartKeys");t.pop(),this.set("startKey",e),this.set("previousStartKey",t.pop()),this.set("previousStartKeys",t),this.showProgressModal()},sortByKey:function(e,t){this.setProperties({previousStartKey:null,previousStartKeys:[],nextStartKey:null,sortDesc:t,sortKey:e,startKey:null,firstKey:null}),this.showProgressModal()}}})}),define("hospitalrun/controllers/abstract-report-controller",["exports","ember","hospitalrun/mixins/date-format","hospitalrun/mixins/modal-helper","hospitalrun/mixins/number-format","hospitalrun/mixins/pagination-props","hospitalrun/mixins/pouchdb","hospitalrun/mixins/progress-dialog"],function(e,t,n,a,l,s,i,o){e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,i.default,o.default,{defaultErrorMessage:"An error was encountered while generating the requested report. Please let your system administrator know that you have encountered an error.",offset:0,limit:25,progressMessage:"Please wait while your report is generated.",progressTitle:"Generating Report",reportColumns:null,reportHeaders:null,reportRows:[],reportTitle:null,reportType:null,reportTypes:null,showFirstPageButton:!0,showLastPageButton:!0,showReportResults:!1,_addReportRow:function(e,n,a,l){var s=void 0,i=this.get("reportRows"),o=[];t.default.isEmpty(a)&&(a=this.get("reportColumns"));for(var r in a)a[r].include&&(s=t.default.get(e,a[r].property),t.default.isEmpty(s)?o.push(""):"_numberFormat"===a[r].format?n?o.push(s):o.push(this._numberFormat(s)):!n&&a[r].format?o.push(this[a[r].format](s)):o.push(s));l?i.addObject({rowAction:l,row:o}):i.addObject(o)},_finishReport:function(e){this.set("showReportResults",!0),this.set("offset",0),this._setReportHeaders(e),this._setReportTitle(),this._generateExport(),this.closeProgressModal()},_generateExport:function(){var e=[],t=this.get("reportHeaders"),n=[t];n.addObjects(this.get("reportRows")),n.forEach(function(t){var n=void 0;n=t.row?t.row:t,n=n.map(function(e){return e?e.replace?e.replace('"','""'):e:""}),e.push('"'+n.join('","')+'"')});var a=e.join("\r\n"),l="data:application/csv;charset=utf-8,"+encodeURIComponent(a);this.set("csvExport",l)},_notifyReportError:function(e){var t=this.get("i18n");throw this.closeProgressModal(),this.displayAlert(t.t("alerts.reportError"),t.t("messages.reportError")),new Error(e)},_setReportHeaders:function(e){var n=[];t.default.isEmpty(e)&&(e=this.get("reportColumns"));for(var a in e)e[a].include&&n.push(e[a].label);this.set("reportHeaders",n)},_setReportTitle:function(){var e=this.get("endDate"),n="",a="",l=this.get("reportType"),s=this.get("reportTypes"),i=this.get("startDate");t.default.isEmpty(e)||(n=moment(e).format("l"));var o=s.findBy("value",l);t.default.isEmpty(i)?this.set("reportTitle",this.get("i18n").t("inventory.reports.titleSingleDate",{name:o.name,date:n})):(a=moment(i).format("l"),this.set("reportTitle",this.get("i18n").t("inventory.reports.titleDateRange",{name:o.name,startDate:a,endDate:n})))},actions:{firstPage:function(){this.set("offset",0)},nextPage:function(){var e=this.get("limit");this.incrementProperty("offset",e)},previousPage:function(){var e=this.get("limit");this.decrementProperty("offset",e)},lastPage:function(){var e=this.get("reportRows.length"),t=this.get("limit"),n=parseInt(e/t);this.set("offset",n*t)}},currentReportRows:function(){var e=this.get("limit"),t=this.get("offset"),n=this.get("reportRows");return n.slice(t,t+e)}.property("reportRows.[]","offset","limit"),disablePreviousPage:function(){return 0===this.get("offset")}.property("offset"),disableNextPage:function(){var e=this.get("limit"),t=this.get("reportRows.length"),n=this.get("offset");return n+e>=t}.property("offset","limit","reportRows.length"),showPagination:function(){var e=this.get("reportRows.length"),t=this.get("limit");return e>t}.property("reportRows.length")})}),define("hospitalrun/controllers/application",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({filesystem:t.default.inject.service(),session:t.default.inject.service(),_setup:function(){var e=this.get("filesystem");e.setup()}.on("init")})}),define("hospitalrun/controllers/index",["exports","ember","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.Controller.extend(n.default,{indexLinks:["Appointments","Labs","Imaging","Inventory","Medication","Patients","Users"],setupPermissions:function(){var e=this.get("defaultCapabilities");for(var t in e)this.currentUserCan(t)&&this.set("userCan_"+t,!0)}.on("init"),activeLinks:function(){var e=[],t=this.get("indexLinks");return t.forEach(function(t){var n=t.toLowerCase();this.currentUserCan(n)&&e.push({action:n,text:t})}.bind(this)),e}.property("indexLinks")})}),define("hospitalrun/controllers/login",["exports","ember"],function(e,t){var n=t.default.Controller.extend({session:t.default.inject.service(),errorMessage:null,identification:null,password:null,actions:{authenticate:function(){var e=this,t=this.getProperties("identification","password"),n=t.identification,a=t.password;this.get("session").authenticate("authenticator:custom",{identification:n,password:a}).catch(function(t){e.set("errorMessage",t.reason)})}}});e.default=n}),define("hospitalrun/controllers/navigation",["exports","ember","hospitalrun/mixins/hospitalrun-version","hospitalrun/mixins/modal-helper","hospitalrun/mixins/progress-dialog","hospitalrun/mixins/user-session","hospitalrun/mixins/navigation"],function(e,t,n,a,l,s,i){e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,i.default,{ajax:t.default.inject.service(),application:t.default.inject.controller(),allowSearch:!1,config:t.default.inject.service(),currentSearchText:null,currentRouteName:t.default.computed.alias("application.currentRouteName"),progressTitle:"Searching",searchRoute:null,session:t.default.inject.service(),syncStatus:"",currentOpenNav:null,actions:{about:function(){var e=this,n=this.get("version");this.get("ajax").request("/serverinfo").then(function(a){var l="Version: "+n;t.default.isEmpty(a)||(l+=" Site Info: "+a),e.displayAlert(e.get("i18n").t("navigation.about"),l)})},invalidateSession:function(){var e=this.get("session");e.get("isAuthenticated")&&e.invalidate()},search:function(){if(this.allowSearch&&this.searchRoute){var e=this.get("currentRouteName"),t=this.get("currentSearchText"),n=this.get("searchText");t===n&&e.indexOf(".search")!==-1||(this.set("searchText",""),this.set("progressMessage","Searching for "+n+". Please wait..."),this.showProgressModal(),this.transitionToRoute(this.searchRoute+"/"+n))}},navAction:function(e){this.currentOpenNav&&this.currentOpenNav.route!==e.route&&this.currentOpenNav.closeSubnav(),this.currentOpenNav=e,this.transitionToRoute(e.route),this.set("isShowingSettings",!1)},toggleSettings:function(){this.toggleProperty("isShowingSettings")},closeSettings:function(){this.set("isShowingSettings",!1)}}})}),define("hospitalrun/custom-form-add/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember"],function(e,t,n){var a=n.default.computed,l=n.default.isEmpty;e.default=t.default.extend({updateAction:"addForm",actions:{addForm:function(){var e=this.get("model.modelToAddTo"),t=e.get("customForms"),a=this.get("model.selectedForm");l(t)&&(t=n.default.Object.create(),e.set("customForms",t)),t.set(a,n.default.Object.create()),e.notifyPropertyChange("customForms"),this.send("closeModal")}},isUpdateDisabled:a("model.selectedForm",function(){return l(this.get("model.selectedForm"))})})}),define("hospitalrun/custom-form-add/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"jaecxfpb",block:'{"statements":[["block",["modal-dialog"],null,[["cancelAction","isUpdateDisabled","title","updateButtonAction","updateButtonText"],["closeModal",["get",["isUpdateDisabled"]],["helper",["t"],["customForms.titles.addCustomForm"],null],"addForm",["helper",["t"],["customForms.buttons.addForm"],null]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-select"],null,[["label","property","content","prompt"],[["helper",["t"],["customForms.labels.formToAdd"],null],"selectedForm",["get",["model","customForms"]]," "]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/custom-form-add/template.hbs"}})}),define("hospitalrun/diagnosis/edit/controller",["exports","ember","hospitalrun/controllers/abstract-edit-controller"],function(e,t,n){var a=t.default.computed;e.default=n.default.extend({updateCapability:"add_diagnosis",editController:t.default.computed.alias("model.editController"),diagnosisList:t.default.computed.alias("editController.diagnosisList"),newDiagnosis:!1,lookupListsToUpdate:[{name:"diagnosisList",property:"model.diagnosis",id:"diagnosis_list"}],additionalButtons:a("model.isNew",function(){var e=this.get("i18n"),t=this.get("model.isNew");if(!t)return[{class:"btn btn-default warning",buttonAction:"deleteDiagnosis",buttonIcon:"octicon octicon-x",buttonText:e.t("buttons.delete")}]}),canDeleteDiagnosis:a(function(){return this.currentUserCan("delete_diagnosis")}),title:a("model.isNew",function(){var e=this.get("i18n"),t=this.get("model.isNew");return t?e.t("diagnosis.titles.addDiagnosis"):e.t("diagnosis.titles.editDiagnosis")}),afterUpdate:function(e){var t=this.get("newDiagnosis");t?this.get("editController").send("addDiagnosis",e):this.send("closeModal")},beforeUpdate:function(){var e=this.get("model");return this.set("newDiagnosis",e.get("isNew")),t.default.RSVP.Promise.resolve()},actions:{cancel:function(){this.send("closeModal")},deleteDiagnosis:function(){var e=this.get("model");this.get("editController").send("deleteDiagnosis",e)}}})}),define("hospitalrun/diagnosis/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"BW/Gub9/",block:'{"statements":[["block",["modal-dialog"],null,[["additionalButtons","hideCancelButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["additionalButtons"]],["get",["hideCancelButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["helper",["t"],["diagnosis.labels.activeDiagnosis"],null],"active","col-sm-4"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["diagnosis.labels.diagnosis"],null],false],["close-element"],["text","\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","diagnosis"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","hint","class"],["diagnosis",["helper",["t"],["diagnosis.labels.diagnosis"],null],["get",["diagnosisList"]],false,"diagnosis-text required"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,2,1],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["date",["helper",["t"],["diagnosis.labels.date"],null],"col-sm-4 required"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["helper",["t"],["diagnosis.labels.secondaryDiagnosis"],null],"secondaryDiagnosis","col-sm-4"]]],false],["text","\\n"],["block",["unless"],[["get",["model","isNew"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],3]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/diagnosis/edit/template.hbs"}})}),define("hospitalrun/dialog/controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({showUpdateButton:!0,isUpdateDisabled:!1,actions:{cancel:function(){this.send("closeModal")},confirm:function(){var e=this.getWithDefault("model.confirmAction","model.confirm");this.send(e,this.get("model")),this.send("closeModal"); -},ok:function(){var e=this.get("model.okAction");t.default.isEmpty(e)||this.send(e,this.get("model")),this.send("closeModal")}}})}),define("hospitalrun/dialog/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"zQVnRxTE",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","hideUpdateButton","isUpdateDisabled","title","updateButtonAction","updateButtonText","cancelButtonText"],[["get",["model","hideCancelButton"]],["get",["model","hideUpdateButton"]],["get",["model","isUpdateDisabled"]],["get",["model","title"]],["get",["model","updateButtonAction"]],["get",["model","updateButtonText"]],["get",["model","cancelButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","progress"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","progress-bar progress-bar-striped active"],["static-attr","role","progressbar"],["dynamic-attr","aria-valuenow",["unknown",["model","progressBarValue"]],null],["static-attr","aria-valuemin","0"],["static-attr","aria-valuemax","100"],["dynamic-attr","style",["unknown",["model","progressBarStyle"]],null],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","sr-only"],["flush-element"],["append",["helper",["t"],["loading.progressBar.progress"],[["progressBarValue"],[["get",["model","progressBarValue"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","showProgress"]]],null,0],["text"," "],["append",["unknown",["model","message"]],false],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/dialog/template.hbs"}})}),define("hospitalrun/finishgauth/route",["exports","ember","hospitalrun/mixins/setup-user-role"],function(e,t,n){e.default=t.default.Route.extend(n.default,{config:t.default.inject.service(),database:t.default.inject.service(),session:t.default.inject.service(),model:function(e){var t=this;if(e.k&&e.s1&&e.s2&&e.t){var n=function(){t.get("session").authenticate("authenticator:custom",{google_auth:!0,params:e});var n={config_consumer_key:e.k,config_consumer_secret:e.s1,config_oauth_token:e.t,config_token_secret:e.s2};return{v:t.get("config").saveOauthConfigs(n).then(function(){var e=this;return n.config_use_google_auth=!0,this.get("database").setup(n).then(function(){return e.setupUserRole()})}.bind(t))}}();if("object"==typeof n)return n.v}}})}),define("hospitalrun/helpers/and",["exports","ember","ember-truth-helpers/helpers/and"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.andHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.andHelper)),e.default=a}),define("hospitalrun/helpers/app-version",["exports","ember","hospitalrun/config/environment"],function(e,t,n){function a(){return l}e.appVersion=a;var l=n.default.APP.version;e.default=t.default.Helper.helper(a)}),define("hospitalrun/helpers/date-format",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e,a){if(!t.default.isEmpty(e[0])){var l="l",s=n(e,1),i=s[0];return a&&a.format&&(l=a.format),moment(i).format(l)}})}),define("hospitalrun/helpers/eq",["exports","ember","ember-truth-helpers/helpers/equal"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.equalHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.equalHelper)),e.default=a}),define("hospitalrun/helpers/gt",["exports","ember","ember-truth-helpers/helpers/gt"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.gtHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.gtHelper)),e.default=a}),define("hospitalrun/helpers/gte",["exports","ember","ember-truth-helpers/helpers/gte"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.gteHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.gteHelper)),e.default=a}),define("hospitalrun/helpers/html-line-break",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,1),l=a[0];return null!==l&&"undefined"!=typeof l?t.default.String.htmlSafe(l.replace(/\n/g,"
")):null})}),define("hospitalrun/helpers/is-array",["exports","ember","ember-truth-helpers/helpers/is-array"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.isArrayHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.isArrayHelper)),e.default=a}),define("hospitalrun/helpers/is-equal-array",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,2),l=a[0],s=a[1];return!(!t.default.isArray(l)||!t.default.isArray(s)||l.get("length")!==s.get("length"))&&l.every(function(e){return s.includes(e)})})}),define("hospitalrun/helpers/is-equal-by-path",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,3),l=a[0],s=a[1],i=a[2];return i?t.default.get(l,i)===s:l===s})}),define("hospitalrun/helpers/is-equal",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var t=n(e,2),a=t[0],l=t[1];return a===l})}),define("hospitalrun/helpers/is-not",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var t=n(e,1),a=t[0];return!a})}),define("hospitalrun/helpers/lt",["exports","ember","ember-truth-helpers/helpers/lt"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.ltHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.ltHelper)),e.default=a}),define("hospitalrun/helpers/lte",["exports","ember","ember-truth-helpers/helpers/lte"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.lteHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.lteHelper)),e.default=a}),define("hospitalrun/helpers/not-eq",["exports","ember","ember-truth-helpers/helpers/not-equal"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.notEqualHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.notEqualHelper)),e.default=a}),define("hospitalrun/helpers/not",["exports","ember","ember-truth-helpers/helpers/not"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.notHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.notHelper)),e.default=a}),define("hospitalrun/helpers/number-format",["exports","ember","hospitalrun/mixins/number-format"],function(e,t,n){var a=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),l=t.default.Object.extend(n.default);e.default=t.default.Helper.helper(function(e){var t=a(e,1),n=t[0],s=new l;return s._numberFormat(n)})}),define("hospitalrun/helpers/or",["exports","ember","ember-truth-helpers/helpers/or"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.orHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.orHelper)),e.default=a}),define("hospitalrun/helpers/pluralize",["exports","ember-inflector/lib/helpers/pluralize"],function(e,t){e.default=t.default}),define("hospitalrun/helpers/read-path",["exports","ember"],function(e,t){var n=function(){function e(e,t){var n=[],a=!0,l=!1,s=void 0;try{for(var i,o=e[Symbol.iterator]();!(a=(i=o.next()).done)&&(n.push(i.value),!t||n.length!==t);a=!0);}catch(e){l=!0,s=e}finally{try{!a&&o.return&&o.return()}finally{if(l)throw s}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=t.default.Helper.helper(function(e){var a=n(e,2),l=a[0],s=a[1];return t.default.isEmpty(s)?l:t.default.get(l,s)})}),define("hospitalrun/helpers/singularize",["exports","ember-inflector/lib/helpers/singularize"],function(e,t){e.default=t.default}),define("hospitalrun/helpers/t",["exports","ember-i18n/helper"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/helpers/xor",["exports","ember","ember-truth-helpers/helpers/xor"],function(e,t,n){var a=null;t.default.Helper?a=t.default.Helper.helper(n.xorHelper):t.default.HTMLBars.makeBoundHelper&&(a=t.default.HTMLBars.makeBoundHelper(n.xorHelper)),e.default=a}),define("hospitalrun/imaging/charge/controller",["exports","hospitalrun/procedures/charge/controller","ember"],function(e,t,n){e.default=t.default.extend({cancelAction:"closeModal",newPricingItem:!1,requestingController:n.default.inject.controllers("imaging/edit"),pricingList:n.default.computed.alias("requestingController.chargesPricingList")})}),define("hospitalrun/imaging/charge/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"bkPMKXlR",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","procedures/charge"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/imaging/charge/template.hbs"}})}),define("hospitalrun/imaging/completed/completed-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr"})}),define("hospitalrun/imaging/completed/completed-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"mAPPy+fo",block:'{"statements":[["open-element","td",[]],["static-attr","class","requested-date"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","requestedDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","imaging-date"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","imagingDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["imaging","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","display-name"],["flush-element"],["append",["unknown",["imaging","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","type"],["flush-element"],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","results"],["flush-element"],["append",["unknown",["imaging","result"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["imaging","notes"]],false],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/completed/completed-list-item/template.hbs"}})}),define("hospitalrun/imaging/completed/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({startKey:[],showActions:!1})}),define("hospitalrun/imaging/completed/route",["exports","ember-i18n","hospitalrun/imaging/index/route"],function(e,t,n){e.default=n.default.extend({pageTitle:(0,t.translationMacro)("imaging.titles.completedImaging"),searchStatus:"Completed"})}),define("hospitalrun/imaging/completed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"Rfh3vstr",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["imaging.messages.noCompleted"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["imaging/completed/completed-list-item"],null,[["imaging"],[["get",["imaging"]]]]],false],["text","\\n"]],"locals":["imaging"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table imaging-completed-table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateCompleted"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.results"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,1],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model"]]],null,2,0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/completed/template.hbs"}})}),define("hospitalrun/imaging/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller","hospitalrun/mixins/patient-submodule"],function(e,t,n){e.default=t.default.extend(n.default,{title:"Delete Request",actions:{delete:function(){this.deleteChildFromVisit("imaging")}}})}),define("hospitalrun/imaging/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"9b0/J8uA",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["imaging.messages.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/delete/template.hbs"}})}),define("hospitalrun/imaging/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/charge-actions","ember","hospitalrun/mixins/patient-submodule"],function(e,t,n,a,l){e.default=t.default.extend(n.default,l.default,{imagingController:a.default.inject.controller("imaging"),chargePricingCategory:"Imaging",chargeRoute:"imaging.charge",selectedImagingType:null,canComplete:function(){var e=this.get("model.isNew"),t=this.get("model.imagingTypeName"),n=this.get("selectedImagingType");return(!e||!(a.default.isEmpty(t)||a.default.isArray(n)&&n.length>1))&&this.currentUserCan("complete_imaging")}.property("selectedImagingType.[]","model.imagingTypeName"),actions:{completeImaging:function(){this.set("model.status","Completed"),this.get("model").validate().then(function(){this.get("model.isValid")&&(this.set("model.imagingDate",new Date),this.send("update"))}.bind(this)).catch(a.default.K)},update:function(){var e=this;this.get("model.isNew")?!function(){var t=e.get("model"),n=e.get("selectedImagingType");a.default.isEmpty(e.get("model.status"))&&e.set("model.status","Requested"),e.set("model.requestedBy",t.getUserName()),e.set("model.requestedDate",new Date),a.default.isEmpty(n)?e.saveNewPricing(e.get("model.imagingTypeName"),"Imaging","model.imagingType").then(function(){this.addChildToVisit(t,"imaging","Imaging").then(function(){this.saveModel()}.bind(this))}.bind(e)):e.getSelectedPricing("selectedImagingType").then(function(e){a.default.isArray(e)?this.createMultipleRequests(e,"imagingType","imaging","Imaging"):(this.set("model.imagingType",e),this.addChildToVisit(t,"imaging","Imaging").then(function(){this.saveModel()}.bind(this)))}.bind(e))}():this.saveModel()}},additionalButtons:function(){var e=this.get("i18n"),t=this.get("canComplete"),n=this.get("model.isValid");if(n&&t)return[{buttonAction:"completeImaging",buttonIcon:"glyphicon glyphicon-ok",class:"btn btn-primary on-white",buttonText:e.t("buttons.complete")}]}.property("canComplete","model.isValid"),lookupListsToUpdate:[{name:"radiologistList",property:"model.radiologist",id:"radiologists"}],pricingTypeForObjectType:"Imaging Procedure",pricingTypes:a.default.computed.alias("imagingController.imagingPricingTypes"),pricingList:null,radiologistList:a.default.computed.alias("imagingController.radiologistList"),updateCapability:"add_imaging",afterUpdate:function(e,t){var n=this.get("i18n");this.updateLookupLists();var a=void 0,l=void 0,s=void 0;"Completed"===this.get("model.status")?(l=n.t("imaging.alerts.completedTitle"),s=n.t("imaging.alerts.completedMessage")):(l=n.t("imaging.alerts.savedTitle"),s=n.t("imaging.alerts.savedMessage")),t&&(a=this.get("cancelAction")),this.saveVisitIfNeeded(l,s,a),this.set("model.selectPatient",!1)}})}),define("hospitalrun/imaging/edit/route",["exports","ember-i18n","hospitalrun/routes/abstract-edit-route","hospitalrun/mixins/charge-route","ember","hospitalrun/mixins/patient-list-route"],function(e,t,n,a,l,s){e.default=n.default.extend(a.default,s.default,{editTitle:(0,t.translationMacro)("imaging.titles.editTitle"),modelName:"imaging",newTitle:(0,t.translationMacro)("imaging.titles.editTitle"),pricingCategory:"Imaging",actions:{returnToAllItems:function(){this.controller.send("returnToAllItems")}},getNewData:function(){return l.default.RSVP.resolve({selectPatient:!0,requestDate:moment().startOf("day").toDate()})}})}),define("hospitalrun/imaging/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"FpG92j1s",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","prompt","class"],["radiologist",["helper",["t"],["imaging.labels.radiologist"],null],["get",["radiologistList"]]," ","radiologist-input"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["result",["helper",["t"],["labels.result"],null],"result-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDate"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-9"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","imagingType","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-12"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","requestedBy"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","prompt","selected"],["col-xs-3 required",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["helper",["t"],["imaging.labels.addNewVisit"],null],["get",["model","visit"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["checkbox-or-typeahead"],null,[["property","label","list","selection","optionLabelPath","typeAheadType","className","prompt","model","class"],["imagingTypeName",["helper",["t"],["labels.imagingType"],null],["get",["objectTypeList"]],["get",["selectedImagingType"]],"name","pricing","required"," ",["get",["model"]],"imaging-type-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"imaging.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required patient-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","selectPatient"]]],null,4,3],["block",["if"],[["get",["model","isNew"]]],null,2,1],["block",["if"],[["get",["canComplete"]]],null,0],["text"," "],["append",["helper",["em-text"],null,[["property","label","rows"],["notes",["helper",["t"],["labels.notes"],null],3]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],5]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/edit/template.hbs"}})}),define("hospitalrun/imaging/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],addPermission:"add_imaging"})}),define("hospitalrun/imaging/index/imaging-edit-button/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"button",classNames:["btn","btn-default","neutral"]})}),define("hospitalrun/imaging/index/imaging-edit-button/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"fgj2GO/M",block:'{"statements":[["block",["link-to"],["imaging.edit",["get",["imaging"]]],null,0],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["append",["helper",["t"],["labels.edit"],null],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/index/imaging-edit-button/template.hbs"}})}),define("hospitalrun/imaging/index/requested-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr",classNames:["clickable"],click:function(){this.sendAction("action",this.imaging)}})}),define("hospitalrun/imaging/index/requested-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"JWG9328s",block:'{"statements":[["open-element","td",[]],["static-attr","class","date"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","requestedDate"]]],[["format"],["l h:mm A"]]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["imaging","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","patient"],["flush-element"],["append",["unknown",["imaging","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","type"],["flush-element"],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["imaging","notes"]],false],["close-element"],["text","\\n\\n"],["block",["if"],[["get",["showActions"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["imaging/index/imaging-edit-button"],null,[["imaging"],[["get",["imaging"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEdit"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/imaging/index/requested-list-item/template.hbs"}})}),define("hospitalrun/imaging/index/route",["exports","ember-i18n","hospitalrun/routes/abstract-index-route"],function(e,t,n){e.default=n.default.extend({modelName:"imaging",pageTitle:(0,t.translationMacro)("imaging.pageTitle"),searchStatus:"Requested",_getStartKeyFromItem:function(e){var t=e.get("imagingDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("requestedDateAsTime"),l=this.get("searchStatus");return[l,a,t,n]},_modelQueryParams:function(){var e=this._getMaxPouchId(),t=this.get("maxValue"),n=this._getMinPouchId(),a=this.get("searchStatus");return{options:{startkey:[a,null,null,n],endkey:[a,t,t,e]},mapReduce:"imaging_by_status"}}})}),define("hospitalrun/imaging/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"bA1O68vE",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["messages.createNewRecord"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["imaging/index/requested-list-item"],null,[["imaging","action","showActions","canEdit"],[["get",["imaging"]],"editItem",["get",["showActions"]],["get",["canEdit"]]]]],false],["text","\\n"]],"locals":["imaging"]},{"statements":[["text"," "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,3],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,4,1]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/imaging/index/template.hbs"}})}),define("hospitalrun/imaging/route",["exports","ember-i18n","hospitalrun/routes/abstract-module-route"],function(e,t,n){e.default=n.default.extend({addCapability:"add_imaging",additionalModels:[{name:"imagingPricingTypes",findArgs:["lookup","imaging_pricing_types"]},{name:"radiologistList",findArgs:["lookup","radiologists"]}],allowSearch:!1,moduleName:"imaging",newButtonText:(0,t.translationMacro)("imaging.buttons.newButton"),sectionTitle:(0,t.translationMacro)("imaging.sectionTitle")})}),define("hospitalrun/initializers/app-version",["exports","ember-cli-app-version/initializer-factory","hospitalrun/config/environment"],function(e,t,n){var a=n.default.APP,l=a.name,s=a.version;e.default={name:"App Version",initialize:(0,t.default)(l,s)}}),define("hospitalrun/initializers/container-debug-adapter",["exports","ember-resolver/container-debug-adapter"],function(e,t){e.default={name:"container-debug-adapter",initialize:function(){var e=arguments[1]||arguments[0];e.register("container-debug-adapter:main",t.default),e.inject("container-debug-adapter:main","namespace","application:main")}}}),define("hospitalrun/initializers/data-adapter",["exports","ember"],function(e,t){e.default={name:"data-adapter",before:"store",initialize:t.default.K}}),define("hospitalrun/initializers/ember-data",["exports","ember-data/setup-container","ember-data/-private/core"],function(e,t,n){e.default={name:"ember-data",initialize:t.default}}),define("hospitalrun/initializers/ember-i18n",["exports","ember-i18n/initializers/ember-i18n"],function(e,t){e.default=t.default}),define("hospitalrun/initializers/ember-keyboard-first-responder-inputs",["exports","ember-keyboard/initializers/ember-keyboard-first-responder-inputs"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"initialize",{enumerable:!0,get:function(){return t.initialize}})}),define("hospitalrun/initializers/ember-simple-auth",["exports","ember","hospitalrun/config/environment","ember-simple-auth/configuration","ember-simple-auth/initializers/setup-session","ember-simple-auth/initializers/setup-session-service"],function(e,t,n,a,l,s){e.default={name:"ember-simple-auth",initialize:function(e){var t=n.default["ember-simple-auth"]||{};t.baseURL=n.default.baseURL,a.default.load(t),(0,l.default)(e),(0,s.default)(e)}}}),define("hospitalrun/initializers/export-application-global",["exports","ember","hospitalrun/config/environment"],function(e,t,n){function a(){var e=arguments[1]||arguments[0];if(n.default.exportApplicationGlobal!==!1){var a;if("undefined"!=typeof window)a=window;else if("undefined"!=typeof global)a=global;else{if("undefined"==typeof self)return;a=self}var l,s=n.default.exportApplicationGlobal;l="string"==typeof s?s:t.default.String.classify(n.default.modulePrefix),a[l]||(a[l]=e,e.reopen({willDestroy:function(){this._super.apply(this,arguments),delete a[l]}}))}}e.initialize=a,e.default={name:"export-application-global",initialize:a}}),define("hospitalrun/initializers/i18n",["exports"],function(e){e.default={name:"i18n",after:"ember-i18n",initialize:function(e){e.inject("route","i18n","service:i18n"),e.inject("controller","i18n","service:i18n"),e.inject("mixin","i18n","service:i18n"),e.inject("model","i18n","service:i18n")}}}),define("hospitalrun/initializers/injectStore",["exports","ember"],function(e,t){e.default={name:"injectStore",before:"store",initialize:t.default.K}}),define("hospitalrun/initializers/store",["exports","ember"],function(e,t){e.default={name:"store",after:"ember-data",initialize:t.default.K}}),define("hospitalrun/initializers/transforms",["exports","ember"],function(e,t){e.default={name:"transforms",before:"store",initialize:t.default.K}}),define("hospitalrun/initializers/truth-helpers",["exports","ember","ember-truth-helpers/utils/register-helper","ember-truth-helpers/helpers/and","ember-truth-helpers/helpers/or","ember-truth-helpers/helpers/equal","ember-truth-helpers/helpers/not","ember-truth-helpers/helpers/is-array","ember-truth-helpers/helpers/not-equal","ember-truth-helpers/helpers/gt","ember-truth-helpers/helpers/gte","ember-truth-helpers/helpers/lt","ember-truth-helpers/helpers/lte"],function(e,t,n,a,l,s,i,o,r,d,c,u,p){function m(){t.default.Helper||((0,n.registerHelper)("and",a.andHelper),(0,n.registerHelper)("or",l.orHelper),(0,n.registerHelper)("eq",s.equalHelper),(0,n.registerHelper)("not",i.notHelper),(0,n.registerHelper)("is-array",o.isArrayHelper),(0,n.registerHelper)("not-eq",r.notEqualHelper),(0,n.registerHelper)("gt",d.gtHelper),(0,n.registerHelper)("gte",c.gteHelper),(0,n.registerHelper)("lt",u.ltHelper),(0,n.registerHelper)("lte",p.lteHelper))}e.initialize=m,e.default={name:"truth-helpers",initialize:m}}),define("hospitalrun/instance-initializers/ember-data",["exports","ember-data/-private/instance-initializers/initialize-store-service"],function(e,t){e.default={name:"ember-data",initialize:t.default}}),define("hospitalrun/instance-initializers/ember-i18n",["exports","ember-i18n/instance-initializers/ember-i18n"],function(e,t){e.default=t.default}),define("hospitalrun/instance-initializers/ember-simple-auth",["exports","ember-simple-auth/instance-initializers/setup-session-restoration"],function(e,t){e.default={name:"ember-simple-auth",initialize:function(e){(0,t.default)(e)}}}),define("hospitalrun/inventory/adjust/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/inventory-adjustment-types","ember","ember-i18n"],function(e,t,n,a,l){e.default=t.default.extend(n.default,{inventoryController:a.default.inject.controller("inventory"),expenseAccountList:a.default.computed.alias("inventoryController.expenseAccountList"),title:(0,l.translationMacro)("inventory.titles.adjustment"),transactionTypeChanged:function(){a.default.run.once(this,function(){this.get("model").validate().catch(a.default.K)})}.observes("transactionType"),updateButtonText:function(){return this.get("model.transactionType")}.property("model.transactionType"),updateButtonAction:"adjust",updateCapability:"adjust_inventory_location",actions:{cancel:function(){this.send("closeModal")},adjust:function(){this.send("adjustItems",this.get("model"),!0)}}})}),define("hospitalrun/inventory/adjust/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"9dBN/TFf",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.item"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","adjustmentItem","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.adjustmentFor"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","locationName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.currentQuantity"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath"],["col-sm-4",["helper",["t"],["inventory.labels.adjustmentType"],null],"transactionType",["get",["adjustmentTypes"]],"type","name"]]],false],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["adjustmentQuantity",["helper",["t"],["labels.quantity"],null],"col-sm-3 required"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["label","property","rows"],[["helper",["t"],["inventory.labels.reason"],null],"reason",3]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["inventory.labels.adjustmentDate"],null],"col-sm-4 required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["expenseAccount",["helper",["t"],["inventory.labels.expense"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]],"col-sm-8"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/adjust/template.hbs"}})}),define("hospitalrun/inventory/barcode/controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({selectedPrinter:null,barcodeUri:function(){var e=this.get("model.id"),n=this.get("model.name");return t.default.$(document).JsBarcode(e,{width:1,height:20,fontSize:10,displayValue:n,returnUri:!0})}.property("model.id","model.name"),printers:function(){return dymo.label.framework.getTapePrinters()}.property(),havePrinters:function(){var e=this.get("printers");return e.length>0}.property("printers"),singlePrinter:function(){var e=this.get("printers");return 1===e.length}.property("printers"),actions:{print:function(){var e=this.get("barcodeUri"),n=this.get("selectedPrinter");n||(n=this.get("printers")[0].name),t.default.$.get("/dymo/BarcodeAsImage.label",function(t){var a=dymo.label.framework.openLabelXml(t),l=e.substr("data:image/png;base64,".length);a.setObjectText("Image",l),a.print(n)},"text")}}})}),define("hospitalrun/inventory/barcode/route",["exports","ember"],function(e,t){e.default=t.default.Route.extend({model:function(e){return this.store.find("inventory",e.inventory_id)}})}),define("hospitalrun/inventory/barcode/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"PD6MlfyD",block:'{"statements":[["open-element","div",[]],["static-attr","class","panel panel-default"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","img",[]],["dynamic-attr","src",["unknown",["barcodeUri"]],null],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["close-element"],["text","\\n\\n"],["block",["if"],[["get",["havePrinters"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","label",[]],["static-attr","for","printerSelect"],["flush-element"],["append",["helper",["t"],["inventory.labels.printer"],null],false],["close-element"],["text","\\n "],["append",["helper",["select-list"],null,[["content","optionLabelPath","optionValuePath","value","class","action","id"],[["get",["printers"]],"name","name",["get",["selectedPrinter"]],"form-control",["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["selectedPrinter"]]],null]],null],"printerSelect"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["helper",["t"],["inventory.labels.printBarcode"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n"],["block",["unless"],[["get",["singlePrinter"]]],null,0],["text"," "],["close-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"print"]],["flush-element"],["open-element","span",[]],["static-attr","class"," glyphicon glyphicon-print"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.labels.print"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/barcode/template.hbs"}})}),define("hospitalrun/inventory/batch/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/inventory-id","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-selection","ember","ember-i18n"],function(e,t,n,a,l,s,i){e.default=t.default.extend(n.default,a.default,l.default,{doingUpdate:!1,inventoryController:s.default.inject.controller("inventory"),inventoryItems:null,warehouseList:s.default.computed.alias("inventoryController.warehouseList"),aisleLocationList:s.default.computed.alias("inventoryController.aisleLocationList"),vendorList:s.default.computed.alias("inventoryController.vendorList"),purchaseAttributes:["expirationDate","inventoryItem","lotNumber","purchaseCost","quantity","vendorItemNo"],inventoryList:function(){var e=this.get("inventoryItems");if(!s.default.isEmpty(e)){var t=e.map(function(e){return e.doc});return t}}.property("inventoryItems.[]"),lookupListsToUpdate:[{name:"aisleLocationList",property:"model.aisleLocation",id:"aisle_location_list"},{name:"vendorList",property:"model.vendor",id:"vendor_list"},{name:"warehouseList",property:"model.location",id:"warehouse_list"}],showDistributionUnit:function(){return this._haveValidInventoryItem()}.property("model.inventoryItemTypeAhead","model.inventoryItem"),showInvoiceItems:function(){var e=this.get("model.invoiceItems");return!s.default.isEmpty(e)}.property("model.invoiceItems.[]"),totalReceived:function(){var e=this.get("model.invoiceItems"),t=0;s.default.isEmpty("invoiceItems")||(t=e.reduce(function(e,t){return e+Number(t.get("purchaseCost"))},t));var n=this.get("model.purchaseCost");return this.get("model.isValid")&&!s.default.isEmpty(n)&&(t+=Number(n)),t}.property("model.invoiceItems.[].purchaseCost","model.isValid","model.purchaseCost"),updateButtonText:(0,i.translationMacro)("inventory.labels.save"),updateCapability:"add_inventory_item",_addNewInventoryItem:function(){this.generateId().then(function(e){var t=this.store.createRecord("inventory",{id:e,name:this.get("model.inventoryItemTypeAhead"),quantity:0,skipSavePurchase:!0});this.send("openModal","inventory.quick-add",t)}.bind(this))},_addInventoryItem:function(){var e=this.get("model"),t=this.get("model.inventoryItemTypeAhead"),n=this.get("model.purchaseCost"),a=this.get("model.quantity");return e.validate().then(function(){if(!this.get("model.isValid")||s.default.isEmpty(t)||s.default.isEmpty(a)||s.default.isEmpty(n))throw Error("invalid");return this._haveValidInventoryItem()?void this._addInvoiceItem():(this._addNewInventoryItem(),!0)}.bind(this)).catch(function(){this.displayAlert(this.get("i18n").t("inventory.titles.warning"),this.get("i18n").t("inventory.messages.warning"))}.bind(this))},_addInvoiceItem:function(){var e=this.get("model"),t=e.get("invoiceItems"),n=e.getProperties(this.get("purchaseAttributes")),a=s.default.Object.create(n);t.addObject(a),e.set("expirationDate"),e.set("inventoryItem"),e.set("inventoryItemTypeAhead"),e.set("lotNumber"),e.set("purchaseCost"),e.set("quantity"),e.set("selectedInventoryItem"),e.set("vendorItemNo")},_findInventoryItem:function(e){var t=this.get("model.invoiceItems"),n=e.get("inventoryItem");if(!s.default.isEmpty(n)){var a=t.find(function(e){return e.get("inventoryItem.id")===n},this);if(!s.default.isEmpty(a))return a.get("inventoryItem")}},_haveValidInventoryItem:function(){var e=this.get("model.inventoryItemTypeAhead"),t=this.get("model.inventoryItem");if(s.default.isEmpty(e)||s.default.isEmpty(t))return!1;var n=t.get("name"),a=e.substr(0,n.length);return a===n},_savePurchases:function(){var e=this.get("model"),t=e.getProperties(["dateReceived","vendor","invoiceNo","location","aisleLocation","giftInKind"]),n=e.get("invoiceItems"),a=void 0,l=[];n.forEach(function(e){var n=e.get("inventoryItem"),s=e.get("quantity");a=this.store.createRecord("inv-purchase",t),a.setProperties(e.getProperties(this.get("purchaseAttributes"))),a.setProperties({distributionUnit:n.get("distributionUnit"),currentQuantity:s,originalQuantity:s,inventoryItem:n.get("id")}),l.push(a.save())}.bind(this)),s.default.RSVP.all(l).then(function(e){var t=[],n=[];e.forEach(function(e){var t=this._findInventoryItem(e),a=t.get("purchases");a.addObject(e),n.push(this.newPurchaseAdded(t,e))}.bind(this)),s.default.RSVP.all(t).then(function(){e.forEach(function(e){var n=this._findInventoryItem(e);n.updateQuantity(),t.push(n.save())}.bind(this)),s.default.RSVP.all(t).then(function(){this.updateLookupLists(),this.displayAlert(this.get("i18n").t("inventory.titles.purchaseSaved"),this.get("i18n").t("inventory.messages.purchaseSaved"),"allItems")}.bind(this))}.bind(this))}.bind(this))},actions:{addInventoryItem:function(){this._addInventoryItem()},addedNewInventoryItem:function(e){this.set("model.inventoryItem",e),this._addInvoiceItem(),this.send("closeModal"),this.get("doingUpdate")&&this._savePurchases()},removeItem:function(e){var t=this.get("model.invoiceItems"),n=e.itemToRemove;t.removeObject(n),this.send("closeModal")},showRemoveItem:function(e){var t=this.get("i18n").t("inventory.messages.removeItem"),n=s.default.Object.create({itemToRemove:e}),a=this.get("i18n").t("inventory.titles.removeItem");this.displayConfirm(a,t,"removeItem",n)},update:function(){this.set("doingUpdate",!0),this._addInventoryItem().then(function(e){e||this._savePurchases()}.bind(this))}}})});define("hospitalrun/inventory/batch/route",["exports","hospitalrun/inventory/request/route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({editTitle:(0,a.translationMacro)("navigation.subnav.inventoryReceived"),modelName:"inventory-batch",newTitle:(0,a.translationMacro)("navigation.subnav.inventoryReceived"),getNewData:function(){return n.default.RSVP.resolve({invoiceItems:[],dateReceived:new Date})},actions:{addedNewInventoryItem:function(e){this.controller.send("addedNewInventoryItem",e)}}})});define("hospitalrun/inventory/batch/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"JqV/PD7b",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["append",["unknown",["invoiceItem","inventoryItem","name"]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","quantity"]]]]],false],["text","\\n "],["open-element","span",[]],["static-attr","class","input-group-addon"],["flush-element"],["text","\\n "],["append",["unknown",["invoiceItem","inventoryItem","distributionUnit"]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","purchaseCost"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","vendorItemNo"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["invoiceItem","lotNumber"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-2"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","minDate","model"],["expirationDate","now",["get",["invoiceItem"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-sm-1"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showRemoveItem",["get",["invoiceItem"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["inventory.labels.remove"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["invoiceItem"]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.invoiceItems"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.cost"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.itemNumber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.serialNumber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.expirationDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","invoiceItems"]]],null,0],["text"," "],["close-element"],["text","\\n "],["open-element","h4",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.totalReceived"],[["total"],[["get",["totalReceived"]]]]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","inventoryItem","distributionUnit"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateReceived",["helper",["t"],["inventory.labels.dateReceived"],null],"col-sm-4 required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["vendor",["helper",["t"],["inventory.labels.vendor"],null],["get",["vendorList"]],["get",["model","vendor"]],"col-sm-4 required test-vendor"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["invoiceNo",["helper",["t"],["inventory.labels.invoiceNumber"],null],"col-sm-4 test-invoice-number"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["location",["helper",["t"],["inventory.labels.location"],null],["get",["warehouseList"]],["get",["model","location"]],"col-sm-5"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["aisleLocation",["helper",["t"],["inventory.labels.aisleLocation"],null],["get",["aisleLocationList"]],["get",["model","aisleLocation"]],"col-sm-5"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","col-sm-2 checkbox-label-space"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-check"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label sr-only"],["flush-element"],["append",["helper",["t"],["inventory.labels.gift"],null],false],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["inventory.labels.gift"],null],"giftInKind"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["helper",["t"],["inventory.labels.invoiceLineItem"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["inventory-typeahead"],null,[["class","property","label","content","selection","showQuantity"],["col-sm-7 required test-inv-item","inventoryItemTypeAhead",["helper",["t"],["inventory.labels.inventoryItem"],null],["get",["inventoryList"]],["get",["selectedInventoryItem"]],false]]],false],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["helper",["t"],["labels.quantity"],null],"col-sm-2 required test-inv-quantity"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-1"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.unit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showDistributionUnit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["purchaseCost",["helper",["t"],["inventory.labels.purchaseCost"],null],"col-sm-2 required test-inv-cost"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["vendorItemNo",["helper",["t"],["inventory.labels.vendorItemNumber"],null],"col-sm-4"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["lotNumber",["helper",["t"],["inventory.labels.serialNumber"],null],"col-sm-4"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","minDate","class"],["expirationDate",["helper",["t"],["inventory.labels.expirationDate"],null],"now","col-sm-2"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-2"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["text"," "],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"addInventoryItem"]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.labels.add"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["model","invoiceItems"]]],null,1]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],3]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/batch/template.hbs"}})}),define("hospitalrun/inventory/delete/controller",["exports","ember-i18n","hospitalrun/controllers/abstract-delete-controller"],function(e,t,n){e.default=n.default.extend({title:(0,t.translationMacro)("inventory.labels.deleteItem")})}),define("hospitalrun/inventory/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"sUGbE9jt",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text"," \\n "],["append",["helper",["t"],["inventory.messages.delete"],[["name"],[["get",["model","name"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/inventory/delete/template.hbs"}})}),define("hospitalrun/inventory/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-type-list","hospitalrun/mixins/return-to","hospitalrun/mixins/unit-types","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(a.default,l.default,s.default,i.default,o.default,{inventory:n.default.inject.controller(),savingNewItem:!1,canAddPurchase:function(){return this.currentUserCan("add_inventory_purchase")}.property(),canAdjustLocation:function(){return this.currentUserCan("adjust_inventory_location")},warehouseList:n.default.computed.alias("inventory.warehouseList"),aisleLocationList:n.default.computed.alias("inventory.aisleLocationList"),inventoryTypeList:n.default.computed.alias("inventory.inventoryTypeList.value"),inventoryUnitList:n.default.computed.alias("inventory.inventoryUnitList.value"),vendorList:n.default.computed.alias("inventory.vendorList"),database:n.default.inject.service(),lookupListsToUpdate:[{name:"aisleLocationList",property:"model.aisleLocation",id:"aisle_location_list"},{name:"vendorList",property:"model.vendor",id:"vendor_list"},{name:"warehouseList",property:"model.location",id:"warehouse_list"}],canEditQuantity:function(){return this.get("model.isNew")}.property("model.isNew"),haveTransactions:function(){var e=this.get("transactions");return null!==e}.property("transactions.[]"),locationQuantityTotal:function(){var e=this.get("model.locations"),t=e.reduce(function(e,t){return e+parseInt(t.get("quantity"))},0);return t}.property("model.locations"),quantityDiscrepency:function(){var e=this.get("locationQuantityTotal"),t=this.get("model.quantity");return!n.default.isEmpty(e)&&!n.default.isEmpty(t)&&e!==t}.property("locationQuantityTotal","model.quantity"),quantityDifferential:function(){var e=this.get("locationQuantityTotal"),t=this.get("model.quantity");return Math.abs(e-t)}.property("locationQuantityTotal","model.quantity"),originalQuantityUpdated:function(){var e=this.get("model.isNew"),t=this.get("model.originalQuantity");e&&!n.default.isEmpty(t)&&this.set("model.quantity",t)}.observes("model.isNew","model.originalQuantity"),showTransactions:function(){var e=this.get("transactions");return!n.default.isEmpty(e)}.property("transactions.[]"),transactions:null,updateCapability:"add_inventory_item",actions:{adjustItems:function(e){var t=parseInt(e.get("adjustmentQuantity")),n=this.get("model"),a=e.get("transactionType"),l=this.get("store").createRecord("inv-request",{adjustPurchases:!0,dateCompleted:e.get("dateCompleted"),expenseAccount:e.get("expenseAccount"),inventoryItem:n,quantity:t,transactionType:a,reason:e.get("reason"),deliveryAisle:e.get("aisleLocation"),deliveryLocation:e.get("location")});l.set("inventoryLocations",[e]);var s=!1;"Adjustment (Add)"!==a&&"Return"!==a||(s=!0),l.set("markAsConsumed",!0),l.get("inventoryItem").then(function(){this.send("fulfillRequest",l,!0,s,!0)}.bind(this))},editNewItem:function(){this.send("editItem",this.get("model.id"))},showAdjustment:function(e){e.setProperties({dateCompleted:new Date,adjustmentItem:this.get("model"),adjustmentQuantity:"",reason:"",transferItem:null,transactionType:"Adjustment (Add)"}),this.send("openModal","inventory.adjust",e)},showTransfer:function(e){e.set("adjustmentQuantity"),e.set("transferItem",this.get("model")),e.set("dateCompleted",new Date),this.send("openModal","inventory.transfer",e)},transferItems:function(e){var t=this.get("model"),n=this.get("store").createRecord("inv-request",{adjustPurchases:!1,dateCompleted:e.get("dateCompleted"),inventoryItem:t,quantity:e.get("adjustmentQuantity"),deliveryAisle:e.get("transferAisleLocation"),deliveryLocation:e.get("transferLocation"),transactionType:"Transfer"});this.transferToLocation(t,e).then(function(){e.setProperties({transferItem:null,transferLocation:null,transferAisleLocation:null,adjustmentQuantity:null}),n.set("locationsAffected",[{name:e.get("locationName"),quantity:n.get("quantity")}]),n.get("inventoryItem").then(function(){this._saveRequest(n)}.bind(this))}.bind(this))},updatePurchase:function(e,t){t&&(this.get("model").updateQuantity(),this.send("update",!0)),this.send("closeModal")}},_completeBeforeUpdate:function(e,t,a){var l=null,s=e.get("prefix"),i=[],o=this.get("model"),r=o.getProperties("aisleLocation","dateReceived","purchaseCost","lotNumber","expirationDate","giftInKind","invoiceNo","location","originalQuantity","quantityGroups","vendor","vendorItemNo"),d=this.get("model.originalQuantity");if(!n.default.isEmpty(d)){r.currentQuantity=d,r.inventoryItem=this.get("model.id");var c=this.get("store").createRecord("inv-purchase",r);i.push(c.save()),this.get("model.purchases").addObject(c),i.push(this.newPurchaseAdded(this.get("model"),c))}e.incrementProperty("value",1),l=e.get("value"),s+=l<1e5?String("00000"+l).slice(-5):l,o.set("friendlyId",s),i.push(e.save()),n.default.RSVP.all(i,"All before update done for inventory item").then(function(){t()},function(e){a(e)})},_findSequence:function(e,t,a){var l=new n.default.RSVP.Promise(function(t){this._checkNextSequence(t,e,0)}.bind(this));l.then(function(n){var l=this.get("store"),s=l.push(l.normalize("sequence",{id:"inventory_"+e,prefix:e.toLowerCase().substr(0,n),value:0}));this._completeBeforeUpdate(s,t,a)}.bind(this))},_findSequenceByPrefix:function(e,t){var n=this.get("database"),a={key:e.toLowerCase().substr(0,t)};return n.queryMainDB(a,"sequence_by_prefix")},_checkNextSequence:function(e,t,a){a++,this._findSequenceByPrefix(t,a).then(function(l){n.default.isEmpty(l.rows)?e(a):this._checkNextSequence(e,t,a)}.bind(this),function(){e(a)})},_saveRequest:function(e){e.set("status","Completed"),e.set("completedBy",e.getUserName()),e.save().then(function(){this.send("update",!0),this.send("closeModal"),this.getTransactions()}.bind(this))},getTransactions:function(){var e=this.get("model.id");this.set("transactions",null),this.store.query("inv-request",{options:{endkey:[e,"Completed",0],startkey:[e,"Completed",9999999999999],descending:!0},mapReduce:"inventory_request_by_item"}).then(function(e){this.set("transactions",e)}.bind(this))},beforeUpdate:function(){var e=this;if(!this.get("model.isNew"))return n.default.RSVP.Promise.resolve();var t=function(){var t=e.get("model"),a=t.get("inventoryType");return{v:new n.default.RSVP.Promise(function(e,n){t.validate().then(function(){t.get("isValid")?(this.set("savingNewItem",!0),this.store.find("sequence","inventory_"+a).then(function(t){this._completeBeforeUpdate(t,e,n)}.bind(this),function(){this._findSequence(a,e,n)}.bind(this))):(this.send("showDisabledDialog"),n("invalid model"))}.bind(this)).catch(function(){this.send("showDisabledDialog")}.bind(this))}.bind(e))}}();return"object"==typeof t?t.v:void 0},afterUpdate:function(){var e=null;this.get("savingNewItem")&&(e="editNewItem",this.set("savingNewItem",!1)),this.displayAlert("Inventory Item Saved","The inventory item has been saved.",e)}})}),define("hospitalrun/inventory/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n","hospitalrun/mixins/inventory-id"],function(e,t,n,a,l){e.default=t.default.extend(l.default,{editTitle:(0,a.translationMacro)("inventory.labels.editItem"),modelName:"inventory",newTitle:(0,a.translationMacro)("inventory.labels.newItem"),actions:{adjustItems:function(e){this.controller.send("adjustItems",e)},doneFulfillRequest:function(){this.controller.getTransactions()},editNewItem:function(){this.controller.send("editNewItem")},transferItems:function(e){this.controller.send("transferItems",e)},updatePurchase:function(e,t){this.controller.send("updatePurchase",e,t)}},getNewData:function(){return n.default.RSVP.resolve({dateReceived:new Date,quantityGroups:[]})},setupController:function(e,t){this._super(e,t),e.getTransactions()}})}),define("hospitalrun/inventory/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"dewSrZbs",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],27]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","4"],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-refresh glyphicon-refresh-animate"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.messages.loading"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["unknown",["location","name"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n"]],"locals":["location"]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.transferredFrom"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["transaction","locationsAffected"]]],null,1],["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.transferredTo"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.delivered"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.prescription"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["unknown",["location","name"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n"]],"locals":["location"]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.cost"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","costPerUnit"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.quantity"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","quantityAtCompletion"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.pulled"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["transaction","locationsAffected"]]],null,5],["block",["if"],[["get",["transaction","patient"]]],null,4,3]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.location"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.returned"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","deliveryDetails"]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["inventory.edit.reason"],null],false],["close-element"],["text"," "],["append",["unknown",["transaction","reason"]],false],["open-element","br",[]],["flush-element"],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["transaction","haveReason"]]],null,9],["block",["if"],[["get",["transaction","patient"]]],null,8,7]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["transaction","dateCompleted"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["transaction","quantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["transaction","transactionType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["transaction","expenseAccount"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["transaction","isAdjustment"]]],null,10],["block",["if"],[["get",["transaction","isFulfillment"]]],null,6],["block",["if"],[["get",["transaction","isTransfer"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["transaction"]},{"statements":[["block",["each"],[["get",["transactions"]]],null,11]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.transactions"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.dateCompleted"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.transaction"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.expense"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.details"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveTransactions"]]],null,12,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary neutral"],["modifier",["action"],[["get",[null]],"showAdjustment",["get",["location"]]]],["flush-element"],["append",["helper",["t"],["inventory.labels.adjust"],null],false],["close-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary neutral"],["modifier",["action"],[["get",[null]],"showTransfer",["get",["location"]]]],["flush-element"],["append",["helper",["t"],["inventory.labels.transfer"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["location","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["location","aisleLocation"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["location","quantity"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canAdjustLocation"]]],null,14],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["location","quantity"]]],null,15]],"locals":["location"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.locations"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.aisleLocation"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canAdjustLocation"]]],null,17],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","locations"]]],null,16],["text"," "],["close-element"],["text","\\n"],["block",["if"],[["get",["showTransactions"]]],null,13]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["inventory.labels.giftInKindNo"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["inventory.labels.giftInKindYes"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["dynamic-attr","class",["helper",["if"],[["get",["purchase","expired"]],"warning"],null],null],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["purchase","dateReceived"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","purchaseCost"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","costPerUnit"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","originalQuantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","currentQuantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["purchase","giftInKind"]]],null,20,19],["text"," "],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","lotNumber"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["purchase","expirationDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","vendor"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["purchase","invoiceNo"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["purchase"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPurchase",["get",["model"]]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["inventory.titles.addPurchase"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger alert-dismissible"],["static-attr","role","alert"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","close"],["static-attr","data-dismiss","alert"],["flush-element"],["open-element","span",[]],["static-attr","aria-hidden","true"],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["open-element","span",[]],["static-attr","class","sr-only"],["flush-element"],["append",["helper",["t"],["buttons.close"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["inventory.messages.quantity"],[["quantity","locationQuantity"],[["get",["model","quantity"]],["get",["locationQuantityTotal"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["inventory.messages.adjust"],[["difference"],[["get",["quantityDifferential"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["quantityDiscrepency"]]],null,23],["text"," "],["open-element","h3",[]],["flush-element"],["text","\\n "],["append",["helper",["t"],["inventory.labels.purchases"],null],false],["text","\\n"],["block",["if"],[["get",["canAddPurchase"]]],null,22],["text"," "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.dateReceived"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.purchaseCost"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.costPerUnit"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.originalQuantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.currentQuantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.gift"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.serialNumber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.expirationDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.vendor"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.invoiceNumber"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","purchases"]]],null,21],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.purchaseInfo"],null],false],["close-element"],["text","\\n "],["partial","inv-purchase"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["partial","inventory-basic"],["text","\\n"],["block",["if"],[["get",["model","isNew"]]],null,25,24],["block",["unless"],[["get",["model","isNew"]]],null,18]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],26]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/inventory/edit/template.hbs"}})}),define("hospitalrun/inventory/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],canAdd:function(){return this.currentUserCan("add_inventory_request")}.property(),canFulfill:function(){return this.currentUserCan("fulfill_inventory")}.property()})}),define("hospitalrun/inventory/index/route",["exports","hospitalrun/routes/abstract-index-route","hospitalrun/mixins/user-session","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{modelName:"inv-request",newButtonAction:function(){return this.currentUserCan("add_inventory_request")?"newRequest":null}.property(),newButtonText:(0,a.translationMacro)("buttons.newRequestPlus"),pageTitle:(0,a.translationMacro)("navigation.subnav.requests"),_getStartKeyFromItem:function(e){var t=this._getPouchIdFromItem(e);return["Requested",null,t]},_modelQueryParams:function(){var e=this.get("maxValue");return{options:{startkey:["Requested",null,null],endkey:["Requested",e,e]},mapReduce:"inventory_request_by_status"}},actions:{fulfill:function(e){e.set("dateCompleted",new Date),this.transitionTo("inventory.request",e)}}})}),define("hospitalrun/inventory/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"kh9OXcNN",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newRequest"]],["flush-element"],["text"," "],["append",["helper",["t"],["inventory.messages.createRequest"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["inventory.messages.noRequests"],null],false],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"fulfill",["get",["request"]]]],["flush-element"],["append",["helper",["t"],["labels.fulfill"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["request","inventoryItem","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["request","quantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["request","dateRequested"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["request","requestedBy"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canFulfill"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":["request"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedOn"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canFulfill"]]],null,4],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,3],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,5,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/index/template.hbs"}})}),define("hospitalrun/inventory/listing/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{canAddItem:function(){return this.currentUserCan("add_inventory_item")}.property(),canAddPurchase:function(){return this.currentUserCan("add_inventory_purchase")}.property(),canDeleteItem:function(){return this.currentUserCan("delete_inventory_item")}.property(),startKey:[]})}),define("hospitalrun/inventory/listing/route",["exports","hospitalrun/routes/abstract-index-route","hospitalrun/mixins/user-session","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{modelName:"inventory",newButtonAction:function(){return this.currentUserCan("add_inventory_item")?"newItem":null}.property(),newButtonText:(0,a.translationMacro)("buttons.newItem"),pageTitle:(0,a.translationMacro)("inventory.labels.items"),_modelQueryParams:function(){return{mapReduce:"inventory_by_name"}},_getStartKeyFromItem:function(e){var t=this._getPouchIdFromItem(e);return[e.get("name"),t]}})}),define("hospitalrun/inventory/listing/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"lA3sUJLz",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],14]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["messages.createNewRecord"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAddItem"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["buttons.barcode"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["inventory"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editItem",["get",["inventory"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"showAddPurchase",["get",["inventory"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["buttons.add"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["inventory"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","friendlyId"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","inventoryType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","quantity"]],false],["text"," "],["append",["unknown",["inventory","distributionUnit"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","displayLocations"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["inventory","crossReference"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddPurchase"]]],null,5],["block",["if"],[["get",["canAddItem"]]],null,4],["block",["if"],[["get",["canDeleteItem"]]],null,3],["text"," "],["block",["link-to"],["inventory.barcode",["get",["inventory"]]],[["class","bubbles"],["btn btn-default neutral",false]],2],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["inventory","isNew"]]],null,6]],"locals":["inventory"]},{"statements":[["append",["helper",["t"],["inventory.labels.xref"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.quantity"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.type"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.name"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.id"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["friendlyId",["get",["sortDesc"]],["get",["sortKey"]]]],12],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["name",["get",["sortDesc"]],["get",["sortKey"]]]],11],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["inventoryType",["get",["sortDesc"]],["get",["sortKey"]]]],10],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["quantity",["get",["sortDesc"]],["get",["sortKey"]]]],9],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.location"],null],false],["close-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["crossReference",["get",["sortDesc"]],["get",["sortKey"]]]],8],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,7],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,13,1]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/inventory/listing/template.hbs"}})}),define("hospitalrun/inventory/purchase/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/unit-types"],function(e,t,n,a){e.default=t.default.extend(a.default,{inventoryController:n.default.inject.controller("inventory"),cancelAction:"closeModal",canEditQuantity:function(){var e=this.get("model.originalQuantity"),t=this.get("model.currentQuantity");return!(t-1)return e.name.split(":")[1]})},_addLocationColumn:function(e){var t=this;if(!n.default.isEmpty(e)){var a=function(){var n=[];return e.forEach(function(e){var t=void 0;t=0===e.name.indexOf("From:")?e.name:this._getWarehouseLocationName(e.name),n.includes(t)||n.push(t)}.bind(t)),{v:n}}();if("object"==typeof a)return a.v}},_addReportRow:function(e,t,a,l){!n.default.isEmpty(l)||n.default.isEmpty(e.inventoryItem)||n.default.isEmpty(e.inventoryItem.id)||(l={action:"viewInventory",model:e.inventoryItem.id}),this._super(e,t,a,l)},_addTotalsRow:function(e,t,n){n>0&&this._addReportRow({totalCost:e+this._numberFormat(t),quantity:e+this._numberFormat(n),unitCost:e+this._numberFormat(t/n)},!0)},_adjustLocation:function(e,t,a,l){var s=e.findBy("name",t);n.default.isEmpty(s)&&(s={name:t,quantity:0},e.push(s)),l?s.quantity+=a:s.quantity-=a},_adjustPurchase:function(e,t,a,l){var s=e.findBy("id",t);if(!n.default.isEmpty(s)){var i=s.calculatedQuantity;l?i+=a:i-=a,s.calculatedQuantity=i}},_calculateCosts:function(e,t){return n.default.isEmpty(e)||e.forEach(function(e){var n=this._calculateCostPerUnit(e),a=e.calculatedQuantity;t.quantity+=e.calculatedQuantity,t.totalCost+=a*n}.bind(this)),0===t.totalCost||0===t.quantity?t.unitCost=0:t.unitCost=t.totalCost/t.quantity,t},_calculateUsage:function(e,t){return n.default.isEmpty(e)||e.forEach(function(e){var n=this._calculateCostPerUnit(e),a=e.calculatedQuantity;t.quantity-=e.calculatedQuantity,t.totalCost-=a*n}.bind(this)),0===t.totalCost||0===t.quantity?t.unitCost=0:t.unitCost=t.totalCost/t.quantity,t},_calculateCostPerUnit:function(e){var t=e.purchaseCost,a=parseInt(e.originalQuantity);return n.default.isEmpty(t)||n.default.isEmpty(a)?0:Number((t/a).toFixed(2))},_findInventoryItems:function(e,t,a,l){n.default.isEmpty(a)&&(a={});var s=this.get("database");return new n.default.RSVP.Promise(function(i,o){s.queryMainDB(e,t).then(function(e){var t=Object.keys(a),r=[];n.default.isEmpty(e.rows)||e.rows.forEach(function(e){e.doc.inventoryItem&&!t.includes(e.doc.inventoryItem)&&(r.push(s.getPouchId(e.doc.inventoryItem,"inventory")),t.push(e.doc.inventoryItem))}),this._getInventoryItems(r,a).then(function(t){e.rows.forEach(function(e){var a=t[e.doc.inventoryItem];if(!n.default.isEmpty(a)&&("purchaseObjects"!==l||a.purchases.includes(e.doc.id))){var s=a[l];n.default.isEmpty(s)&&(s=[]),s.push(e.doc),a[l]=s}}),i(t)},o)}.bind(this),o)}.bind(this))},_findInventoryItemsByPurchase:function(e,t){return this._findInventoryItems({startkey:[e.startTime,"invPurchase_"],endkey:[e.endTime,"invPurchase_￿"],include_docs:!0},"inventory_purchase_by_date_received",t,"purchaseObjects")},_findInventoryItemsByRequest:function(e,t){return this._findInventoryItems({startkey:["Completed",e.startTime,"invRequest_"],endkey:["Completed",e.endTime,"invRequest_￿"],include_docs:!0},"inventory_request_by_status",t,"requestObjects")},_finishExpenseReport:function(e){var t=this.get("expenseCategories"),a=this.get("expenseMap"),l=this.get("i18n");t.forEach(function(t){var s=0,i=void 0,o=void 0;this._addReportRow({inventoryItem:{name:l.t("inventory.reports.rows.expensesFor")+t}}),a[t].expenseAccounts.forEach(function(a){"detailedExpense"===e&&a.reportRows.forEach(function(e){this._addReportRow(e)}.bind(this)),i=n.default.isEmpty(a.name)?l.t("inventory.reports.rows.noAccount"):a.name,o=l.t("inventory.reports.rows.subtotalFor",{category:t,account:i}),this._addReportRow({totalCost:o+this._numberFormat(a.total)},!0),s+=a.total}.bind(this)),o=l.t("inventory.reports.rows.totalFor",{var:t}),this._addReportRow({totalCost:o+this._numberFormat(s)},!0),this.incrementProperty("grandCost",s)}.bind(this)),this._addReportRow({totalCost:l.t("inventory.reports.rows.total")+this._numberFormat(this.get("grandCost"))},!0)},_finishLocationReport:function(){var e="",t=0,n=this.get("locationSummary"),a="",l=0,s=this.get("i18n");n=n.sortBy("name"),n.forEach(function(n){a=this._getWarehouseLocationName(n.name);var i=s.t("inventory.reports.rows.totalFor",{var:e});if(e!==a&&(this._addTotalsRow(i,t,l),l=0,t=0,e=a),this._includeLocation(a))for(var o in n.items)n.items[o].quantity>0&&(this._addReportRow({giftInKind:n.items[o].giftInKind,inventoryItem:n.items[o].item,quantity:n.items[o].quantity,locations:[{name:n.name}],totalCost:n.items[o].totalCost,unitCost:n.items[o].unitCost}),l+=this._getValidNumber(n.items[o].quantity),t+=this._getValidNumber(n.items[o].totalCost),this.incrementProperty("grandCost",this._getValidNumber(n.items[o].totalCost)),this.incrementProperty("grandQuantity",this._getValidNumber(n.items[o].quantity)))}.bind(this)),l>0&&this._addTotalsRow(s.t("inventory.reports.rows.totalFor",{var:a}),t,l)},_generateExpirationReport:function(){var e=0,t=this.get("database"),a=this.get("reportRows"),l=this._getDateQueryParams();t.queryMainDB({startkey:[l.startTime,"invPurchase_"],endkey:[l.endTime,"invPurchase_￿"],include_docs:!0},"inventory_purchase_by_expiration_date").then(function(l){var s=[],i=[];l.rows.forEach(function(e){e.doc.currentQuantity>0&&!n.default.isEmpty(e.doc.expirationDate)&&(s.push(e.doc),i.push(t.getPouchId(e.doc.inventoryItem,"inventory")))}.bind(this)),this._getInventoryItems(i).then(function(t){var n=this.get("i18n");s.forEach(function(n){var l=n.currentQuantity,s=new Date(n.expirationDate),i=t[n.inventoryItem];i&&this._includeLocation(n.location)&&(a.addObject([i.friendlyId,i.name,l,i.distributionUnit,moment(s).format("l"),this.formatLocationName(n.location,n.aisleLocation)]),e+=l)}.bind(this)),a.addObject(["","",n.t("inventory.reports.rows.total")+e,"",""]),this.set("showReportResults",!0),this.set("reportHeaders",[n.t("labels.id"),n.t("labels.name"),n.t("inventory.labels.currentQuantity"),n.t("inventory.labels.distributionUnit"),n.t("inventory.labels.expirationDate"),n.t("inventory.labels.location")]),this._generateExport(),this._setReportTitle(),this.closeProgressModal()}.bind(this))}.bind(this))},_generateFinancialSummaryReport:function(){var e=this._getDateQueryParams();this._calculateBeginningBalance(e).then(function(t){this._generateSummaries(e).then(function(e){var n=this._numberFormat(t+e),a=this.get("i18n");t+e<0?this.get("reportRows").addObject([a.t("inventory.reports.rows.balanceEnd"),"","("+n+")"]):this.get("reportRows").addObject([a.t("inventory.reports.rows.balanceEnd"),"",n]),this.set("showReportResults",!0),this.set("reportHeaders",[a.t("inventory.reports.rows.category"),a.t("labels.type"),a.t("inventory.labels.total")]),this._generateExport(),this._setReportTitle(),this.closeProgressModal()}.bind(this),function(e){this._notifyReportError(this.get("i18n").t("inventory.reports.rows.errInFinSum")+e)}.bind(this))}.bind(this))},_generateSummaries:function(e){return new n.default.RSVP.Promise(function(t,a){var l=0,s=this.get("i18n");this._findInventoryItemsByRequest(e,{}).then(function(i){this._findInventoryItemsByPurchase(e,i).then(function(e){var a={},i={},o={},r={};if(this.adjustmentTypes.forEach(function(e){r[e.type]=[]}),Object.keys(e).forEach(function(t){if(!n.default.isEmpty(t)&&!n.default.isEmpty(e[t])){var l=e[t];n.default.isEmpty(l.purchaseObjects)||l.purchaseObjects.forEach(function(e){a[l.inventoryType]=this._getValidNumber(a[l.inventoryType])+this._getValidNumber(e.purchaseCost)}.bind(this)),n.default.isEmpty(l.requestObjects)||l.requestObjects.forEach(function(e){e.adjustPurchases&&("Fulfillment"===e.transactionType?e.giftInKind?o[l.inventoryType]=this._getValidNumber(o[l.inventoryType])+this._getValidNumber(e.quantity*e.costPerUnit):i[l.inventoryType]=this._getValidNumber(i[l.inventoryType])+this._getValidNumber(e.quantity*e.costPerUnit):r[e.transactionType][l.inventoryType]=this._getValidNumber(r[e.transactionType][l.inventoryType])+this._getValidNumber(e.quantity*e.costPerUnit))}.bind(this))}}.bind(this)),Object.keys(a).length>0){var d=0;this.get("reportRows").addObject([s.t("inventory.labels.purchases"),"",""]),Object.keys(a).forEach(function(e){var t=this._getValidNumber(a[e]);d+=t,this.get("reportRows").addObject(["",e,this._numberFormat(t)])}.bind(this)),this.get("reportRows").addObject([s.t("inventory.reports.rows.totalPurchases"),"",this._numberFormat(d)]),l+=d}if(Object.keys(i).length>0||Object.keys(o).length>0){this.get("reportRows").addObject([s.t("inventory.reports.rows.consumed"),"",""]);var c=0;if(Object.keys(i).length>0){this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedPuchases"),"",""]);var u=0;Object.keys(i).forEach(function(e){var t=this._getValidNumber(i[e]);u+=t,this.get("reportRows").addObject(["",e,"("+this._numberFormat(t)+")"])}.bind(this)),c+=u,this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedPurchasesTotal"),"","("+this._numberFormat(u)+")"])}if(Object.keys(o).length>0){this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedGik"),"",""]);var p=0;Object.keys(o).forEach(function(e){var t=this._getValidNumber(o[e]);p+=t,this.get("reportRows").addObject(["",e,"("+this._numberFormat(t)+")"])}.bind(this)),c+=p,this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedGikTotal"),"","("+this._numberFormat(p)+")"])}this.get("reportRows").addObject([s.t("inventory.reports.rows.consumedTotal"),"","("+this._numberFormat(c)+")"]),l-=c}var m=0;this.get("reportRows").addObject([s.t("inventory.reports.rows.adjustments"),"",""]),Object.keys(r).forEach(function(e){Object.keys(r[e]).length>0&&(this.get("reportRows").addObject([e,"",""]),Object.keys(r[e]).forEach(function(t){var n=this._getValidNumber(r[e][t]);"Adjustment (Add)"===e||"Return"===e?(m+=n,this.get("reportRows").addObject(["",t,this._numberFormat(n)])):(m-=n,this.get("reportRows").addObject(["",t,"("+this._numberFormat(n)+")"]))}.bind(this)))}.bind(this)),m<0?this.get("reportRows").addObject([s.t("inventory.reports.rows.adjustmentsTotal"),"","("+this._numberFormat(m)+")"]):this.get("reportRows").addObject([s.t("inventory.reports.rows.adjustmentsTotal"),"",this._numberFormat(m)]),l+=m,t(l)}.bind(this),a)}.bind(this),a)}.bind(this))},_calculateBeginningBalance:function(e){return new n.default.RSVP.Promise(function(t,a){var l={startTime:null,endTime:e.startTime},s=0,i=this.get("i18n");this._findInventoryItemsByRequest(l,{}).then(function(e){this._findInventoryItemsByPurchase(l,e).then(function(e){Object.keys(e).forEach(function(t){if(!n.default.isEmpty(t)&&!n.default.isEmpty(e[t])){var a=e[t],l=a.purchaseObjects,i=a.requestObjects,o={inventoryItem:a,quantity:0,unitCost:0,totalCost:0};n.default.isEmpty(l)||l.forEach(function(e){var t=e.originalQuantity;e.calculatedQuantity=t}),n.default.isEmpty(i)||i.forEach(function(e){var t=e.adjustPurchases,a=!1,s=e.purchasesAffected,i=e.transactionType;a="Adjustment (Add)"===i||"Return"===i,t&&(n.default.isEmpty(s)||n.default.isEmpty(l)||s.forEach(function(e){this._adjustPurchase(l,e.id,e.quantity,a)}.bind(this)))}.bind(this)),n.default.isEmpty(l)||(o=this._calculateCosts(l,o),s+=this._getValidNumber(o.totalCost))}}.bind(this)),s<0?this.get("reportRows").addObject([i.t("inventory.reports.rows.balanceBegin"),"","("+this._numberFormat(s)+")"]):this.get("reportRows").addObject([i.t("inventory.reports.rows.balanceBegin"),"",this._numberFormat(s)]),t(s)}.bind(this),a)}.bind(this),a)}.bind(this))},_generateInventoryReport:function(){this.set("grandCost",0),this.set("grandQuantity",0),this.set("locationSummary",[]);var e=void 0,t=this.get("locationSummary"),a=this.get("reportType"),l=this._getDateQueryParams(),s=this.get("i18n");if("daysLeft"===a){var i=this.get("endDate"),o=this.get("startDate");if(n.default.isEmpty(i)||n.default.isEmpty(o))return void this.closeProgressModal();e=moment(i).diff(o,"days")}this._findInventoryItemsByRequest(l,{}).then(function(i){this._findInventoryItemsByPurchase(l,i).then(function(l){switch(Object.keys(l).forEach(function(i){if(!n.default.isEmpty(l[i])){var o=l[i],r=o.purchaseObjects,d=o.requestObjects,c={giftInKind:"N",inventoryItem:o,quantity:0,unitCost:0,totalCost:0,locations:[],vendors:[]};n.default.isEmpty(r)||r.forEach(function(e){var t=this.getDisplayLocationName(e.location,e.aisleLocation),a=e.originalQuantity;e.calculatedQuantity=a,e.giftInKind===!0&&(c.giftInKind="Y"),n.default.isEmpty(e.vendor)||c.vendors.includes(e.vendor)||c.vendors.push(e.vendor),this._adjustLocation(c.locations,t,a,!0)}.bind(this)),n.default.isEmpty(d)||d.forEach(function(e){var t=e.adjustPurchases,a=e.transactionType,l=!1,s=e.locationsAffected,i=e.purchasesAffected;if(l="Adjustment (Add)"===a||"Return"===a,t)n.default.isEmpty(i)||n.default.isEmpty(r)||i.forEach(function(e){this._adjustPurchase(r,e.id,e.quantity,l)}.bind(this));else if("Transfer"===a){var o=this.getDisplayLocationName(e.deliveryLocation,e.deliveryAisle);this._adjustLocation(c.locations,o,e.quantity,!0)}s.forEach(function(e){this._adjustLocation(c.locations,e.name,e.quantity,l)}.bind(this))}.bind(this));var u=0,p=0;switch(a){case"byLocation":c.locations.forEach(function(e){var a=t.findBy("name",this._getWarehouseLocationName(e.name));n.default.isEmpty(a)?(a=n.default.copy(e),a.items={},t.push(a)):a.quantity+=this._getValidNumber(e.quantity);var l=this._calculateCosts(r,{quantity:0,totalCost:0});a.items[o.id]={item:o,quantity:this._getValidNumber(e.quantity),giftInKind:c.giftInKind,totalCost:this._getValidNumber(l.unitCost)*this._getValidNumber(e.quantity),unitCost:this._getValidNumber(l.unitCost)}}.bind(this));break;case"daysLeft":if(!n.default.isEmpty(d)&&this._hasIncludedLocation(c.locations)){var m=d.reduce(function(e,t){return"Fulfillment"===t.transactionType?e+=this._getValidNumber(t.quantity):e}.bind(this),0);c.quantity=this._getValidNumber(o.quantity),m>0?(c.consumedPerDay=this._numberFormat(m/e,!0),c.daysLeft=this._numberFormat(c.quantity/c.consumedPerDay)):(0===m?c.consumedPerDay="0":c.consumedPerDay="?"+m,c.daysLeft="?"),this._addReportRow(c)}break;case"detailedAdjustment":case"detailedTransfer":case"detailedUsage":case"detailedExpense":case"summaryExpense":n.default.isEmpty(d)||(d.forEach(function(e){var t=this;this._includeTransaction(a,e.transactionType)&&this._hasIncludedLocation(e.locationsAffected)&&!function(){var n=t.getDisplayLocationName(e.deliveryLocation,e.deliveryAisle),l=[],i=t._getValidNumber(e.quantity),o=t._getValidNumber(e.quantity)*t._getValidNumber(e.costPerUnit);l=e.locationsAffected.map(function(e){return"detailedTransfer"===a?{name:s.t("inventory.reports.rows.transfer2",{source:e.name,target:n}).toString()}:{name:s.t("inventory.reports.rows.transfer1",{quantity:i,location:e.name}).toString()}}.bind(t));var r={date:moment(new Date(e.dateCompleted)).format("l"),expenseAccount:e.expenseAccount,giftInKind:c.giftInKind,inventoryItem:c.inventoryItem,quantity:e.quantity,transactionType:e.transactionType,locations:l,unitCost:e.costPerUnit,totalCost:o};"detailedExpense"===a||"summaryExpense"===a?t._updateExpenseMap(e,r):(t._addReportRow(r),p+=t._getValidNumber(e.quantity),u+=t._getValidNumber(o))}()}.bind(this)),"detailedExpense"!==a&&"summaryExpense"!==a&&(this._addTotalsRow(s.t("inventory.reports.rows.subtotal"),u,p),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",p)));break;case"summaryTransfer":case"summaryUsage":!n.default.isEmpty(d)&&this._hasIncludedLocation(c.locations)&&(c.quantity=d.reduce(function(e,t){if(this._includeTransaction(a,t.transactionType)){var n=this._getValidNumber(t.quantity)*this._getValidNumber(t.costPerUnit);return u+=n,e+=this._getValidNumber(t.quantity)}return e}.bind(this),0),c.quantity>0&&(c.totalCost=u,c.unitCost=u/c.quantity,this._addReportRow(c),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",c.quantity)));break;case"detailedPurchase":n.default.isEmpty(r)||(r.forEach(function(e){if(this._includeLocation(e.location)){var t="N";e.giftInKind===!0&&(t="Y"),this._addReportRow({date:moment(new Date(e.dateReceived)).format("l"),giftInKind:t,inventoryItem:c.inventoryItem,quantity:e.originalQuantity,unitCost:e.costPerUnit,totalCost:e.purchaseCost,locations:[{name:this.getDisplayLocationName(e.location,e.aisleLocation)}]}),u+=this._getValidNumber(e.purchaseCost),p+=this._getValidNumber(e.originalQuantity)}}.bind(this)),this._addTotalsRow(s.t("inventory.reports.rows.subtotal"),u,p),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",p));break;case"summaryPurchase":n.default.isEmpty(r)||(c.locations=[],c.quantity=r.reduce(function(e,t){u+=this._getValidNumber(t.purchaseCost);var n=this.getDisplayLocationName(t.location,t.aisleLocation);return c.locations.findBy("name",n)||c.locations.push({name:this.getDisplayLocationName(t.location,t.aisleLocation)}),e+=this._getValidNumber(t.originalQuantity)}.bind(this),0),this._hasIncludedLocation(c.locations)&&(c.unitCost=u/c.quantity,c.totalCost=u,this._addReportRow(c),this.incrementProperty("grandCost",u),this.incrementProperty("grandQuantity",c.quantity)));break;case"valuation":!n.default.isEmpty(r)&&this._hasIncludedLocation(c.locations)&&(this._calculateCosts(r,c),this.incrementProperty("grandCost",this._getValidNumber(c.totalCost)),this.incrementProperty("grandQuantity",this._getValidNumber(c.quantity)),this._addReportRow(c))}}}.bind(this)),a){case"detailedExpense":case"summaryExpense":this._finishExpenseReport(a);break;case"byLocation":this._finishLocationReport(),this._addTotalsRow(s.t("inventory.reports.rows.total"),this.get("grandCost"),this.get("grandQuantity"));break;default:this._addTotalsRow(s.t("inventory.reports.rows.total"),this.get("grandCost"),this.get("grandQuantity"))}this._finishReport()}.bind(this),function(e){this._notifyReportError(s.t("inventory.reports.rows.errInFindPur")+e)}.bind(this))}.bind(this),function(e){this._notifyReportError(s.t("inventory.reports.rows.errInFindPur")+e)}.bind(this))},_getDateQueryParams:function(){var e=this.get("endDate"),t=this.get("maxValue"),a=this.get("startDate"),l=void 0;return n.default.isEmpty(e)||(t=moment(e).endOf("day").toDate().getTime()),n.default.isEmpty(a)||(l=moment(a).startOf("day").toDate().getTime()),{endTime:t,startTime:l}},_getInventoryItems:function(e,t){var a=this.get("database");return new n.default.RSVP.Promise(function(l,s){n.default.isEmpty(t)&&(t={}),a.queryMainDB({keys:e,include_docs:!0}).then(function(e){e.rows.forEach(function(e){e.doc&&e.doc.archived!==!0&&(t[e.doc.id]=e.doc)}),l(t)},s)})},_getWarehouseLocationName:function(e){var t="";return t=e.indexOf(":")>-1?e.split(":")[0].trim():e},_hasIncludedLocation:function(e){var t=!1;return e.forEach(function(e){var n=this._getWarehouseLocationName(e.name);this._includeLocation(n)&&(t=!0)}.bind(this)),t},_includeLocation:function(e){var t=this.get("filterLocation");return n.default.isEmpty(t)||e===t},_includeTransaction:function(e,t){var n=0===e.indexOf("detailed"),a=void 0;if("detailedExpense"===e||"summaryExpense"===e)return!0;switch(t){case"Fulfillment":a=n?"detailedUsage":"summaryUsage";break;case"Transfer":a=n?"detailedTransfer":"summaryTransfer";break;default:a=n?"detailedAdjustment":"summaryAdjustment"}return e===a},_updateExpenseMap:function(e,t){var a=void 0,l=this.get("expenseMap"),s="Y"===t.giftInKind,i=!0;switch(e.transactionType){case"Fulfillment":case"Return":a=s?l["Gift In Kind Usage"]:l["Inventory Consumed"],"Return"===e.transactionType&&(i=!1);break;case"Adjustment (Add)":case"Adjustment (Remove)":case"Return To Vendor":case"Write Off":a=l["Inventory Obsolence"],"Adjustment (Add)"===e.transactionType&&(i=!1)}if(!n.default.isEmpty(a)){var o=a.expenseAccounts.findBy("name",e.expenseAccount);n.default.isEmpty(o)&&(o={name:e.expenseAccount,total:0,reportRows:[]},a.expenseAccounts.push(o)),o.reportRows.push(t);var r=this._getValidNumber(e.quantity)*this._getValidNumber(e.costPerUnit);i?(a.total+=r,o.total+=r):(a.total=a.total-r,o.total=o.total-r,t.totalCost=t.totalCost*-1)}},actions:{generateReport:function(){var e=this,t=this.get("endDate"),a=this.get("reportRows"),l=this.get("reportType"),s=this.get("startDate");if(!n.default.isEmpty(s)||!n.default.isEmpty(t))switch(a.clear(),this.showProgressModal(),l){case"expiration":this._generateExpirationReport();break;case"summaryFinance":this._generateFinancialSummaryReport();break;case"detailedExpense":case"summaryExpense":var i=function(){var t=e.get("expenseCategories"),n={};return t.forEach(function(e){n[e]={total:0,expenseAccounts:[]}}),e.set("expenseMap",n),e._generateInventoryReport(),"break"}();if("break"===i)break;default:this._generateInventoryReport()}},viewInventory:function(e){this.store.find("inventory",e).then(function(e){e.set("returnTo","inventory.reports"),this.transitionToRoute("inventory.edit",e)}.bind(this))}}})}),define("hospitalrun/inventory/reports/route",["exports","hospitalrun/routes/abstract-index-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({pageTitle:(0,a.translationMacro)("inventory.titles.inventoryReport"),model:function(){return n.default.RSVP.resolve(n.default.Object.create({}))}})}),define("hospitalrun/inventory/reports/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"g8+aEF0m",block:'{"statements":[["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",[null]],false]],11],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"generateReport"]],["flush-element"],["append",["helper",["t"],["inventory.reports.generate"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["close-element"],["text","\\n"],["block",["if"],[["get",["showReportResults"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["text","\\n "],["append",["get",["reportHeader"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["reportHeader"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-primary"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["append",["unknown",["reportTitle"]],false],["append",["helper",["nav-paging"],null,[["paginationProps"],[["get",["paginationProps"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n"],["block",["each"],[["get",["reportHeaders"]]],null,0],["text"," "],["close-element"],["text","\\n "],["partial","report-rows"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-footer"],["flush-element"],["text","\\n "],["open-element","a",[]],["dynamic-attr","href",["unknown",["csvExport"]],null],["static-attr","target","_blank"],["dynamic-attr","download",["concat",[["unknown",["reportTitle"]],".csv"]]],["static-attr","class","btn btn-default"],["flush-element"],["append",["helper",["t"],["inventory.reports.export"],null],false],["close-element"],["text","\\n\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","transactionType","label"]],"reportColumns.transactionType.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","expenseAccount","label"]],"reportColumns.expenseAccount.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","consumedPerDay","label"]],"reportColumns.consumedPerDay.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","daysLeft","label"]],"reportColumns.daysLeft.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","total","label"]],"reportColumns.total.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","unitcost","label"]],"reportColumns.unitcost.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","date","label"]],"reportColumns.date.include","col-xs-2"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.reports.fields"],null],false],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n"],["block",["if"],[["get",["includeDate"]]],null,6],["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","id","label"]],"reportColumns.id.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","name","label"]],"reportColumns.name.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","description","label"]],"reportColumns.description.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","type","label"]],"reportColumns.type.include","col-xs-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","quantity","label"]],"reportColumns.quantity.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","unit","label"]],"reportColumns.unit.include","col-xs-2"]]],false],["text","\\n"],["block",["if"],[["get",["includeCostFields"]]],null,5],["block",["if"],[["get",["includeDaysLeft"]]],null,4],["text"," "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","price","label"]],"reportColumns.price.include","col-xs-2"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","reorder","label"]],"reportColumns.reorder.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","gift","label"]],"reportColumns.gift.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","locations","label"]],"reportColumns.locations.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","aisle","label"]],"reportColumns.aisle.include","col-xs-2"]]],false],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","xref","label"]],"reportColumns.xref.include","col-xs-2"]]],false],["text","\\n\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-1"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property","class"],[["get",["reportColumns","vendor","label"]],"reportColumns.vendor.include","col-xs-2"]]],false],["text","\\n"],["block",["if"],[["get",["includeExpenseAccount"]]],null,3],["block",["if"],[["get",["includeTransactionType"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-picker"],null,[["property","label","class"],["startDate",["helper",["t"],["inventory.labels.dateStart"],null],"col-sm-4 test-start-date"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["endDate",["helper",["t"],["inventory.labels.dateEnd"],null],"col-sm-4 test-end-date"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-picker"],null,[["property","label","class"],["endDate",["helper",["t"],["inventory.labels.dateEffective"],null],"col-sm-4"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-select"],null,[["class","label","property","content","prompt"],["col-xs-6",["helper",["t"],["inventory.labels.location"],null],"filterLocation",["get",["warehouseList"]]," "]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-6"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["static-attr","for","report-type"],["flush-element"],["append",["helper",["t"],["inventory.reports.reportType"],null],false],["close-element"],["text","\\n "],["append",["helper",["select-list"],null,[["action","class","content","id","optionValuePath","optionLabelPath","value"],[["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["reportType"]]],null]],null],"form-control",["get",["reportTypes"]],"report-type","value","name",["get",["reportType"]]]]],false],["text","\\n "],["close-element"],["text","\\n"],["block",["unless"],[["get",["hideLocationFilter"]]],null,10],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["if"],[["get",["showEffectiveDate"]]],null,9,8],["text"," "],["close-element"],["text","\\n"],["block",["if"],[["get",["useFieldPicker"]]],null,7],["text","\\n"]],"locals":[]}],"hasPartials":true}', -meta:{moduleName:"hospitalrun/inventory/reports/template.hbs"}})}),define("hospitalrun/inventory/request/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-selection","ember"],function(e,t,n,a,l,s){e.default=t.default.extend(n.default,a.default,l.default,{inventoryController:s.default.inject.controller("inventory"),inventoryItems:null,cancelAction:"allRequests",warehouseList:s.default.computed.alias("inventoryController.warehouseList"),aisleLocationList:s.default.computed.alias("inventoryController.aisleLocationList"),expenseAccountList:s.default.computed.alias("inventoryController.expenseAccountList"),inventoryList:function(){var e=this.get("inventoryItems");if(!s.default.isEmpty(e)){var t=e.map(function(e){return e.doc});return t}}.property("inventoryItems.[]"),lookupListsToUpdate:[{name:"expenseAccountList",property:"model.expenseAccount",id:"expense_account_list"},{name:"aisleLocationList",property:"model.deliveryAisle",id:"aisle_location_list"},{name:"warehouseList",property:"model.deliveryLocation",id:"warehouse_list"}],canFulfill:function(){var e=this.get("model.requestedItems");return s.default.isEmpty(e)&&this.currentUserCan("fulfill_inventory")}.property("model.requestedItems.[]"),isFulfilling:function(){var e=this.get("canFulfill"),t=this.get("isRequested"),n=this.get("model.shouldFulfillRequest"),a=e&&(t||n);return a?s.default.isEmpty(this.get("model.dateCompleted"))&&this.set("model.dateCompleted",new Date):this.set("model.dateCompleted"),a}.property("isRequested","model.shouldFulfillRequest"),isRequested:function(){var e=this.get("model.status");return"Requested"===e}.property("model.status"),quantityLabel:function(){var e=this.get("selectedInventoryItem");return s.default.isEmpty(e)?this.get("i18n").t("labels.quantity").toString():this.get("i18n").t("inventory.labels.quantity",{unit:e.distributionUnit}).toString()}.property("selectedInventoryItem"),showRequestedItems:function(){var e=this.get("model.requestedItems");return!s.default.isEmpty(e)}.property("model.requestedItems.[]"),updateViaFulfillRequest:!1,updateButtonText:function(){return this.get("isFulfilling")?this.get("i18n").t("buttons.fulfill"):this._super()}.property("model.isNew","isFulfilling"),updateCapability:"add_inventory_request",actions:{addInventoryItem:function(){var e=this.get("model"),t=e.get("inventoryItem"),n=e.get("requestedItems"),a=e.get("quantity");e.validate().then(function(){if(e.get("isValid")&&!s.default.isEmpty(t)&&!s.default.isEmpty(a)){var l=s.default.Object.create({item:t.get("content"),quantity:a});n.addObject(l),e.set("inventoryItem"),e.set("inventoryItemTypeAhead"),e.set("quantity"),this.set("selectedInventoryItem")}}.bind(this)).catch(s.default.K)},allRequests:function(){this.transitionToRoute("inventory.index")},removeItem:function(e){var t=this.get("model.requestedItems"),n=e.itemToRemove;t.removeObject(n),this.send("closeModal")},showRemoveItem:function(e){var t=this.get("i18n").t("inventory.messages.removeItemRequest"),n=s.default.Object.create({itemToRemove:e}),a=this.get("i18n").t("inventory.titles.removeItem");this.displayConfirm(a,t,"removeItem",n)},update:function(e){this.beforeUpdate().then(function(){var t=this,n=this.get("updateViaFulfillRequest");if(n)this.updateLookupLists(),this.performFulfillRequest(this.get("model"),!1,!1,!0).then(this.afterUpdate.bind(this));else{var a=this.get("model.isNew"),l=this.get("model.requestedItems");a&&!s.default.isEmpty(l)?!function(){var e=t.get("model"),n=e.getProperties(["dateRequested","deliveryAisle","deliveryLocation","expenseAccount","requestedBy","status"]),a=[],i=[],o=[];s.default.isEmpty(t.get("model.inventoryItem"))||s.default.isEmpty(t.get("model.quantity"))||o.push(e.save()),l.forEach(function(e){n.inventoryItem=e.get("item"),n.quantity=e.get("quantity");var t=this.get("store").createRecord("inv-request",n);a.push(t.get("inventoryItem")),i.push(t)}.bind(t)),s.default.RSVP.all(a,"Get inventory items for inventory requests").then(function(){i.forEach(function(e){o.push(e.save())}),s.default.RSVP.all(o,"Save batch inventory requests").then(function(){this.updateLookupLists(),this.afterUpdate()}.bind(this))}.bind(t))}():this.get("model").save().then(function(t){this.updateLookupLists(),e||this.afterUpdate(t)}.bind(this))}}.bind(this))}},afterUpdate:function(){var e=this.get("updateViaFulfillRequest");e?this.displayAlert(this.get("i18n").t("inventory.titles.requestFulfilled"),this.get("i18n").t("inventory.messages.requestFulfilled"),"allRequests"):this.displayAlert(this.get("i18n").t("inventory.titles.requestUpdated"),this.get("i18n").t("inventory.messages.requestUpdated"))},beforeUpdate:function(){return this.get("isFulfilling")?this.set("updateViaFulfillRequest",!0):this.set("updateViaFulfillRequest",!1),this.get("model.isNew")&&(this.set("model.dateRequested",new Date),this.set("model.requestedBy",this.get("model").getUserName()),this.get("isFulfilling")||this.set("model.status","Requested")),s.default.RSVP.resolve()}})}),define("hospitalrun/inventory/request/route",["exports","hospitalrun/routes/abstract-edit-route","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({editTitle:(0,a.translationMacro)("inventory.titles.editRequest"),modelName:"inv-request",newTitle:(0,a.translationMacro)("inventory.titles.addRequest"),database:n.default.inject.service(),getNewData:function(){return n.default.RSVP.resolve({transactionType:"Request",requestedItems:[]})},actions:{allRequests:function(e){this.controller.send("allRequests",e)},removeItem:function(e){this.controller.send("removeItem",e)}},setupController:function(e,t){this._super(e,t);var n={startkey:"inventory_",endkey:"inventory_￿",include_docs:!0};this.get("database").queryMainDB(n).then(function(t){e.set("inventoryItems",t.rows)})}})}),define("hospitalrun/inventory/request/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"8TndVg8b",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],7]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["labels.dateCompleted"],null],"col-sm-4"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["inventory-location-picker"],null,[["label","quantityRequested","locationList","selectedLocations"],[["helper",["t"],["inventory.labels.pullFrom"],null],["get",["model","quantity"]],["get",["model","inventoryItem","availableLocations"]],["get",["model","inventoryLocations"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label sr-only"],["flush-element"],["append",["helper",["t"],["inventory.labels.consumePurchases"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["inventory.labels.markAsConsumed"],null],"markAsConsumed"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label sr-only"],["flush-element"],["append",["helper",["t"],["inventory.labels.fulfillRequest"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["inventory.labels.fulfillRequest"],null],"shouldFulfillRequest"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["append",["unknown",["requestedItem","item","name"]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["requestedItem","quantity"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group-addon"],["flush-element"],["append",["unknown",["requestedItem","item","distributionUnit"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showRemoveItem",["get",["requestedItem"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.remove"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["requestedItem"]},{"statements":[["text"," "],["open-element","h3",[]],["flush-element"],["append",["helper",["t"],["inventory.labels.requestedItems"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","requestedItems"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["inventory-typeahead"],null,[["class","property","label","content","selection"],["col-sm-8 test-inv-item","inventoryItemTypeAhead",["helper",["t"],["inventory.labels.inventoryItem"],null],["get",["inventoryList"]],["get",["selectedInventoryItem"]]]]],false],["text","\\n\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["get",["quantityLabel"]],"col-sm-3 test-inv-quantity"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-1"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["close-element"],["text","\\n "],["open-element","h4",[]],["static-attr","class","form-control-static"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-plus"],["modifier",["action"],[["get",[null]],"addInventoryItem"]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["showRequestedItems"]]],null,3],["block",["if"],[["get",["canFulfill"]]],null,1]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.item"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","inventoryItem","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.quantityRequested"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.quantityOnHand"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","inventoryItem","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["isRequested"]]],null,5,4],["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["deliveryLocation",["helper",["t"],["inventory.labels.deliveryLocation"],null],["get",["warehouseList"]],["get",["model","deliveryLocation"]],"test-delivery-location"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["deliveryAisle",["helper",["t"],["inventory.labels.deliveryAisle"],null],["get",["aisleLocationList"]],["get",["model","deliveryAisle"]],"test-delivery-aisle"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["expenseAccount",["helper",["t"],["inventory.labels.billTo"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]],"test-bill-to"]]],false],["text","\\n"],["block",["if"],[["get",["isFulfilling"]]],null,0]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],6]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/request/template.hbs"}})}),define("hospitalrun/inventory/route",["exports","hospitalrun/routes/abstract-module-route","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-id","hospitalrun/mixins/inventory-locations"],function(e,t,n,a,l){e.default=t.default.extend(n.default,a.default,l.default,{addCapability:"add_inventory_item",additionalButtons:function(){if(this.currentUserCan(this.get("addCapability")))return[{buttonAction:"newInventoryBatch",buttonText:"+ inventory received",class:"btn btn-primary"}]}.property(),additionalModels:[{name:"aisleLocationList",findArgs:["lookup","aisle_location_list"]},{name:"expenseAccountList",findArgs:["lookup","expense_account_list"]},{name:"inventoryTypeList",findArgs:["lookup","inventory_types"]},{name:"inventoryUnitList",findArgs:["lookup","unit_types"]},{name:"warehouseList",findArgs:["lookup","warehouse_list"]},{name:"vendorList",findArgs:["lookup","vendor_list"]}],currentItem:null,moduleName:"inventory",newButtonText:"+ new request",sectionTitle:"Inventory",actions:{addPurchase:function(e){var t=this.get("currentItem"),n=t.get("purchases");n.addObject(e),this.newPurchaseAdded(t,e).then(function(){t.updateQuantity(),t.save().then(function(){this.send("closeModal")}.bind(this))}.bind(this))},newInventoryBatch:function(){this.currentUserCan(this.get("addCapability"))&&this.transitionTo("inventory.batch","new")},newRequest:function(){this.transitionTo("inventory.request","new")},allItems:function(){this.transitionTo("inventory.listing")},showAddPurchase:function(e){var t=this.get("store").createRecord("inv-purchase",{dateReceived:new Date,distributionUnit:e.get("distributionUnit"),inventoryItem:e.get("id")});this.set("currentItem",e),this.send("openModal","inventory.purchase.edit",t)}}})}),define("hospitalrun/inventory/search/controller",["exports","hospitalrun/inventory/listing/controller"],function(e,t){e.default=t.default.extend()}),define("hospitalrun/inventory/search/route",["exports","hospitalrun/routes/abstract-search-route"],function(e,t){e.default=t.default.extend({moduleName:"inventory",searchKeys:[{name:"crossReference",type:"contains"},{name:"description",type:"fuzzy"},{name:"friendlyId",type:"contains"},{name:"name",type:"fuzzy"}],searchModel:"inventory"})}),define("hospitalrun/inventory/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"MRgLDxZL",block:'{"statements":[["block",["search-listing"],null,[["newButtonText","allButtonText"],[["helper",["t"],["inventory.labels.newItem"],null],["helper",["t"],["inventory.labels.allInventory"],null]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","inventory/listing"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/inventory/search/template.hbs"}})}),define("hospitalrun/inventory/transfer/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","ember-i18n"],function(e,t,n,a){e.default=t.default.extend({inventoryController:n.default.inject.controller("inventory"),warehouseList:n.default.computed.alias("inventoryController.warehouseList"),aisleLocationList:n.default.computed.alias("inventoryController.aisleLocationList"),lookupListsToUpdate:[{name:"aisleLocationList",property:"model.transferAisleLocation",id:"aisle_location_list"},{name:"warehouseList",property:"model.transferLocation",id:"warehouse_list"}],title:(0,a.translationMacro)("inventory.titles.transfer"),updateButtonText:(0,a.translationMacro)("inventory.labels.transfer"),updateButtonAction:"transfer",updateCapability:"adjust_inventory_location",actions:{cancel:function(){this.send("closeModal")},transfer:function(){this.updateLookupLists(),this.send("transferItems",this.get("model"),!0)}}})}),define("hospitalrun/inventory/transfer/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"agZXzn11",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.item"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","transferItem","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.transferFrom"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","locationName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["inventory.labels.quantityAvailable"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","quantity"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["class","property","label","list","selection"],["required","transferLocation",["helper",["t"],["inventory.labels.transferTo"],null],["get",["warehouseList"]],["get",["model","transferLocation"]]]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection"],["transferAisleLocation",["helper",["t"],["inventory.labels.transferToAisle"],null],["get",["aisleLocationList"]],["get",["model","transferAisleLocation"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["adjustmentQuantity",["helper",["t"],["labels.quantity"],null],"col-sm-3 required"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["inventory.labels.dateTransferred"],null],"col-sm-4 required"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/inventory/transfer/template.hbs"}})}),define("hospitalrun/invoices/add-line-item/controller",["exports","hospitalrun/mixins/billing-categories","ember","hospitalrun/mixins/is-update-disabled"],function(e,t,n,a){e.default=n.default.Controller.extend(t.default,a.default,{invoiceController:n.default.inject.controller("invoices"),billingCategoryList:n.default.computed.alias("invoiceController.billingCategoryList"),editController:n.default.inject.controller("invoices/edit"),title:"Add Line Item",updateButtonText:"Add",updateButtonAction:"add",showUpdateButton:!0,actions:{cancel:function(){this.send("closeModal")},add:function(){this.get("model").save().then(function(e){this.get("editController").send("addLineItem",e)}.bind(this))}},billingCategories:function(){var e=this.get("defaultBillingCategories"),t=this.get("billingCategoryList");return n.default.isEmpty(t)?n.default.Object.create({value:e}):t}.property("billingCategoryList","defaultBillingCategories")})}),define("hospitalrun/invoices/add-line-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"n6Aw1U4J",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-input"],null,[["property","label","class"],["name",["helper",["t"],["labels.name"],null],"required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","className","label","list","selection"],["category","required",["helper",["t"],["labels.category"],null],["get",["billingCategories"]],["get",["model","category"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/add-line-item/template.hbs"}})}),define("hospitalrun/invoices/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller"],function(e,t){e.default=t.default.extend({title:"Delete Invoice"})}),define("hospitalrun/invoices/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"eXEh2gJn",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[],"locals":[]},{"statements":[["text"," "],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0],["text","\\n "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["billing.alerts.deleteItem"],[["item"],[["get",["model","displayInvoiceNumber"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/delete/template.hbs"}})}),define("hospitalrun/invoices/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/number-format","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/publish-statuses","hospitalrun/utils/select-values","npm:uuid"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(a.default,l.default,s.default,{invoiceController:n.default.inject.controller("invoices"),expenseAccountList:n.default.computed.alias("invoiceController.expenseAccountList.value"),patientList:n.default.computed.alias("invoiceController.patientList"),pharmacyCharges:[],pricingProfiles:n.default.computed.map("invoiceController.pricingProfiles",i.default.selectObjectMap),supplyCharges:[],updateCapability:"add_invoice",wardCharges:[],additionalButtons:function(){var e=[],t=this.get("model.isValid"),n=this.get("model.status");return t&&"Draft"===n&&e.push({class:"btn btn-default default",buttonAction:"finalizeInvoice",buttonIcon:"glyphicon glyphicon-ok",buttonText:"Invoice Ready"}),e.push({class:"btn btn-default neutral",buttonAction:"printInvoice",buttonIcon:"glyphicon glyphicon-print",buttonText:"Print"}),e}.property("model.isValid","model.status"),canAddCharge:function(){return this.currentUserCan("add_charge")}.property(),canAddPayment:function(){return this.currentUserCan("add_payment")}.property(),pharmacyExpenseAccount:function(){var e=this.get("expenseAccountList");if(!n.default.isEmpty(e)){var t=e.find(function(e){if(e.toLowerCase().indexOf("pharmacy")>-1)return!0});return t}}.property("expenseAccountList.value"),actions:{addItemCharge:function(e){var t=e.get("details"),n=this.store.createRecord("line-item-detail",{id:o.default.v4()});t.addObject(n)},addLineItem:function(e){var t=this.get("model.lineItems");t.addObject(e),this.send("update",!0),this.send("closeModal")},deleteCharge:function(e){this._deleteObject(e.itemToDelete,e.deleteFrom)},deleteLineItem:function(e){this._deleteObject(e.itemToDelete,this.get("model.lineItems"))},finalizeInvoice:function(){var e=this.get("model"),t=e.get("payments"),a=[];e.get("patient.payments").then(function(l){l.forEach(function(l){var s=l.get("invoice");n.default.isEmpty(s)&&(l.set("invoice",e),a.push(l.save()),t.addObject(l))}.bind(this)),n.default.RSVP.all(a).then(function(){this.set("model.status","Billed"),this.send("update")}.bind(this))}.bind(this))},printInvoice:function(){this.transitionToRoute("print.invoice",this.get("model"))},removePayment:function(e){var t=this.get("model.payments"),n=e.itemToRemove;n.set("invoice"),t.removeObject(e.itemToRemove),this.send("update",!0),this.send("closeModal")},showAddLineItem:function(){var e=this.store.createRecord("billing-line-item",{id:o.default.v4()});this.send("openModal","invoices.add-line-item",e)},showDeleteItem:function(e,t){this.showDeleteModal(e,n.default.Object.create({confirmAction:"deleteCharge",deleteFrom:t,title:"Delete Charge"}))},showDeleteLineItem:function(e){this.showDeleteModal(e,n.default.Object.create({confirmAction:"deleteLineItem",title:"Delete Line Item"}))},showDeleteModal:function(e,t){t=n.default.merge(t,n.default.Object.create({message:"Are you sure you want to delete "+e.get("name")+"?",itemToDelete:e,updateButtonAction:"confirm",updateButtonText:this.get("i18n").t("buttons.ok")})),this.send("openModal","dialog",t)},showRemovePayment:function(e){var t="Are you sure you want to remove this payment from this invoice?",a=n.default.Object.create({itemToRemove:e}),l="Remove Payment";this.displayConfirm(l,t,"removePayment",a)},toggleDetails:function(e){e.toggleProperty("showDetails")}},changePaymentProfile:function(){var e=this.get("model.patient"),t=this.get("model.paymentProfile");!n.default.isEmpty(e)&&n.default.isEmpty(t)&&this.set("model.paymentProfile",e.get("paymentProfile"))}.observes("model.patient"),paymentProfileChanged:function(){var e=this._getValidNumber(this.get("model.paymentProfile.discountPercentage")),t=this.get("model.originalPaymentProfileId"),a=this.get("model.paymentProfile.id");if(a!==t){var l=this.get("model.lineItems");l.forEach(function(t){var l=t.get("details"),s=0;if(l.forEach(function(e){var t=e.get("pricingItem.pricingOverrides");if(!n.default.isEmpty(t)){var l=t.findBy("profile.id",a);n.default.isEmpty(l)||n.default.set(e,"price",l.get("price"))}}.bind(this)),e>0){var i=t.get("total");s=this._numberFormat(e/100*i,!0),t.set("discount",s)}}.bind(this)),this.set("model.originalPaymentProfileId",a)}}.observes("model.paymentProfile"),visitChanged:function(){var e=this.get("model.visit"),t=this.get("model.lineItems");if(!n.default.isEmpty(e)&&n.default.isEmpty(t)){this.set("model.originalPaymentProfileId");var a=this.resolveVisitChildren();n.default.RSVP.allSettled(a,"Resolved visit children before generating invoice").then(function(t){var a=this,l=this._resolveVisitDescendents(t,"charges");n.default.isEmpty(l)?(this._generateLineItems(e,t),this.paymentProfileChanged()):!function(){var s="Reloaded charges before generating invoice";n.default.RSVP.allSettled(l,s).then(function(a){var l=[];a.forEach(function(e){if(!n.default.isEmpty(e.value)){var t=e.value.get("pricingItem");n.default.isEmpty(t)||l.push(t.reload())}}),s="Reloaded pricing items before generating invoice",n.default.RSVP.allSettled(l,s).then(function(){this._generateLineItems(e,t),this.paymentProfileChanged()}.bind(this))}.bind(a))}()}.bind(this),function(e){console.log("Error resolving visit children",e)})}}.observes("model.visit"),_addPharmacyCharge:function(e,t){var n=this;return e.getMedicationDetails(t).then(function(t){var a=e.get("quantity"),l=n.get("pharmacyCharges"),s=n.get("pharmacyExpenseAccount"),i=n.store.createRecord("line-item-detail",{id:o.default.v4(),name:t.name,quantity:a,price:t.price,department:"Pharmacy",expenseAccount:s});l.addObject(i)})},_addSupplyCharge:function(e,t){var n=this.get("supplyCharges"),a=this._createChargeItem(e,t);n.addObject(a)},_createChargeItem:function(e,t){var n=this.store.createRecord("line-item-detail",{id:o.default.v4(),name:e.get("pricingItem.name"),expenseAccount:e.get("pricingItem.expenseAccount"),quantity:e.get("quantity"),price:e.get("pricingItem.price"),department:t,pricingItem:e.get("pricingItem")});return n},_deleteObject:function(e,t){t.removeObject(e),e.get("isNew")||e.destroyRecord(),this.send("update",!0),this.send("closeModal")},_mapWardCharge:function(e){return this._createChargeItem(e,"Ward")},_completeBeforeUpdate:function(e,t,n){var a="inv",l=void 0;e.incrementProperty("value",1),l=e.get("value"),a+=l<1e5?String("00000"+l).slice(-5):l,this.set("model.id",a),e.save().then(t,n)},_generateLineItems:function(e,t){var a=this,l=e.get("endDate"),s=t[0].value,i=t[1].value,r=void 0,d=void 0,c=this.get("model.lineItems"),u=t[2].value,p=t[3].value,m=e.get("startDate"),f=e.get("charges"); -if(this.setProperties({pharmacyCharges:[],supplyCharges:[],wardCharges:[]}),!n.default.isEmpty(l)&&!n.default.isEmpty(m)){l=moment(l),m=moment(m);var h=l.diff(m,"days");h>1&&(r=this.store.createRecord("line-item-detail",{id:o.default.v4(),name:"Days",quantity:h}),d=this.store.createRecord("billing-line-item",{id:o.default.v4(),category:"Hospital Charges",name:"Room/Accomodation"}),d.get("details").addObject(r),c.addObject(d))}var g=[];u.forEach(function(e){g.push(this._addPharmacyCharge(e,"inventoryItem"))}.bind(this)),this.set("wardCharges",f.map(this._mapWardCharge.bind(this))),p.forEach(function(e){var t=e.get("charges");t.forEach(function(e){e.get("medicationCharge")?g.push(this._addPharmacyCharge(e,"medication")):this._addSupplyCharge(e,"O.R.")}.bind(this))}.bind(this)),i.forEach(function(e){n.default.isEmpty(e.get("labType"))||this._addSupplyCharge(n.default.Object.create({pricingItem:e.get("labType"),quantity:1}),"Lab"),e.get("charges").forEach(function(e){this._addSupplyCharge(e,"Lab")}.bind(this))}.bind(this)),s.forEach(function(e){n.default.isEmpty(e.get("imagingType"))||this._addSupplyCharge(n.default.Object.create({pricingItem:e.get("imagingType"),quantity:1}),"Imaging"),e.get("charges").forEach(function(e){this._addSupplyCharge(e,"Imaging")}.bind(this))}.bind(this)),n.default.RSVP.all(g).then(function(){d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Pharmacy",category:"Hospital Charges"}),d.get("details").addObjects(a.get("pharmacyCharges")),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"X-ray/Lab/Supplies",category:"Hospital Charges"}),d.get("details").addObjects(a.get("supplyCharges")),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Ward Items",category:"Hospital Charges"}),d.get("details").addObjects(a.get("wardCharges")),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Physical Therapy",category:"Hospital Charges"}),c.addObject(d),d=a.store.createRecord("billing-line-item",{id:o.default.v4(),name:"Others/Misc",category:"Hospital Charges"}),c.addObject(d),a.send("update",!0)})},_resolveVisitDescendents:function(e,t){var a=[];return e.forEach(function(e){n.default.isEmpty(e.value)||e.value.forEach(function(e){var l=e.get(t);n.default.isEmpty(l)||l.forEach(function(e){a.push(e.reload())})})}),a},beforeUpdate:function(){return new n.default.RSVP.Promise(function(e,t){var a=this.get("model.lineItems"),l=[];a.forEach(function(e){e.get("details").forEach(function(e){l.push(e.save())}.bind(this)),l.push(e.save())}.bind(this)),n.default.RSVP.all(l,"Saved invoice children before saving invoice").then(function(){this.get("model.isNew")?this.store.find("sequence","invoice").then(function(n){this._completeBeforeUpdate(n,e,t)}.bind(this),function(){var n=this.get("store"),a=n.push(n.normalize("sequence",{id:"invoice",value:0}));this._completeBeforeUpdate(a,e,t)}.bind(this)):e()}.bind(this),t)}.bind(this))},afterUpdate:function(){var e="The invoice record has been saved.";this.displayAlert("Invoice Saved",e)}})}),define("hospitalrun/invoices/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember"],function(e,t,n){e.default=t.default.extend({editTitle:"Edit Invoice",modelName:"invoice",newTitle:"New Invoice",actions:{deleteCharge:function(e){this.controller.send("deleteCharge",e)},deleteLineItem:function(e){this.controller.send("deleteLineItem",e)},removePayment:function(e){this.controller.send("removePayment",e)}},afterModel:function(e){return new n.default.RSVP.Promise(function(t,a){var l=e.get("lineItems"),s=[];l.forEach(function(e){s.push(e.reload())}),n.default.RSVP.all(s,"Reload billing line items for invoice").then(function(e){var l=[];e.forEach(function(e){e.get("details").forEach(function(e){l.push(e.reload())})}),n.default.RSVP.all(l,"Reload billing line item details for invoice").then(t,a)},a)})},getNewData:function(){return n.default.RSVP.resolve({billDate:new Date,status:"Draft"})},setupController:function(e,t){t.set("originalPaymentProfileId",t.get("paymentProfile.id")),this._super(e,t);var a=t.get("lineItems"),l=[];a.forEach(function(e){e.get("details").forEach(function(e){var t=e.get("pricingItem");n.default.isEmpty(t)||l.push(t.reload())})})}})}),define("hospitalrun/invoices/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"HLQLw+RK",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],17]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showRemovePayment",["get",["payment"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.remove"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showEditPayment",["get",["payment"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["payment","canRemovePayment"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"showEditPayment",["get",["payment"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["payment","datePaid"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["payment","amount"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["payment","paymentType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["payment","notes"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canAddPayment"]]],null,1],["text"," "],["close-element"],["text","\\n"]],"locals":["payment"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPayment",["get",["model"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["admin.roles.capability.addPayment"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteItem",["get",["detail"]],["get",["item","details"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","2"],["static-attr","class","col-xs-6 input-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["detail","name"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["detail","quantity"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["detail","price"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["select-list"],null,[["class","content","value","action"],["form-control",["get",["expenseAccountList"]],["get",["detail","expenseAccount"]],["helper",["action"],[["get",[null]],["helper",["mut"],[["get",["detail","expenseAccount"]]],null]],null]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["text","\\n "],["append",["helper",["number-format"],[["get",["detail","amountOwed"]]],null],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,4],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["detail"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary"],["modifier",["action"],[["get",[null]],"addItemCharge",["get",["item"]]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["admin.roles.capability.addCharge"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","colspan","2"],["static-attr","class","col-xs-6"],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["t"],["labels.price"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["t"],["labels.expense_to"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,6],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["item","details"]]],null,5]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteLineItem",["get",["item"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-5"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","input-group"],["flush-element"],["text","\\n "],["open-element","span",[]],["dynamic-attr","class",["concat",["input-group-addon glyphicon\\n ",["helper",["if"],[["get",["item","showDetails"]],"glyphicon-minus","glyphicon-plus"],null]]]],["modifier",["action"],[["get",[null]],"toggleDetails",["get",["item"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["input"],null,[["class","value"],["form-control",["get",["item","name"]]]]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["text","\\n "],["append",["helper",["number-format"],[["get",["item","total"]]],null],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control text-right",["get",["item","discount"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control text-right",["get",["item","nationalInsurance"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["append",["helper",["input"],null,[["class","value"],["form-control text-right",["get",["item","privateInsurance"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["item","amountOwed"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-2"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,8],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["item","showDetails"]]],null,7]],"locals":["item"]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-12"],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["unknown",["categoryGroup","category"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["categoryGroup","items"]]],null,9],["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["text"," "],["append",["unknown",["categoryGroup","category"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","total"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","discount"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","nationalInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","privateInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["categoryGroup","amountOwed"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["categoryGroup"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddLineItem"],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.addLineItem"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDescription"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"col-xs-4 required invoice-patient"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected","prompt"],["col-xs-4 required invoice-visit",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["get",["model","visit"]],"Please select a visit"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group col-xs-2"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.invoiceId"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","id"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"invoices.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["model","isNew"]]],null,15],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["unless"],[["get",["model","isNew"]]],null,14],["text"," "],["append",["helper",["date-picker"],null,[["property","label","class"],["billDate",["helper",["t"],["labels.billDate"],null],"col-xs-2"]]],false],["text","\\n"],["block",["if"],[["get",["model","isNew"]]],null,13,12],["text"," "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["externalInvoiceNumber",["helper",["t"],["billing.labels.externalInvoiceNumber"],null],"col-xs-3 external-invoice-no"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["label","property","content","optionValuePath","optionLabelPath","class","prompt","selected"],[["helper",["t"],["billing.labels.paymentProfile"],null],"paymentProfile",["get",["pricingProfiles"]],"selectObject","selectObject.name","col-xs-3"," ",["get",["model","paymentProfile"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],16],["text"," "],["open-element","form",[]],["static-attr","class","form-inline"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.lineItems"],null],false],["text","\\n"],["block",["if"],[["get",["canAddCharge"]]],null,11],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-5"],["flush-element"],["append",["helper",["t"],["labels.description"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["billing.labels.actualCharges"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["labels.discount"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["billing.labels.insurance"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["billing.labels.hmoCom"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-1 text-right"],["flush-element"],["append",["helper",["t"],["labels.excess"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2 text-right"],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","lineItemsByCategory"]]],null,10],["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","total"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","discount"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","nationalInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","privateInsurance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","patientResponsibility"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["billing.labels.paymentsDeposits"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","4"],["flush-element"],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["text","-"],["append",["helper",["number-format"],[["get",["model","paidTotal"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","strong",[]],["flush-element"],["append",["helper",["t"],["labels.grandTotal"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","4"],["flush-element"],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","text-right"],["flush-element"],["append",["helper",["number-format"],[["get",["model","remainingBalance"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.remarks"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["append",["helper",["textarea"],null,[["class","value"],["form-control",["get",["model","remarks"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","h3",[]],["static-attr","class","panel-title"],["flush-element"],["text","\\n "],["append",["helper",["t"],["labels.payments"],null],false],["text","\\n"],["block",["if"],[["get",["canAddPayment"]]],null,3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.amount"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","payments"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/edit/template.hbs"}})}),define("hospitalrun/invoices/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({addPermission:"add_invoice",deletePermission:"delete_invoice",canAddPayment:function(){return this.currentUserCan("add_payment")}.property(),startKey:[],queryParams:["startKey","status"]})}),define("hospitalrun/invoices/index/route",["exports","hospitalrun/routes/abstract-index-route","ember"],function(e,t,n){e.default=t.default.extend({modelName:"invoice",pageTitle:"Invoice Listing",_getStartKeyFromItem:function(e){var t=e.get("billDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("status");return[a,t,n]},_modelQueryParams:function(e){var t=void 0,a=this._getMaxPouchId(),l=this.get("maxValue"),s=this._getMinPouchId(),i=e.status;return n.default.isEmpty(i)&&(i="Billed"),this.set("pageTitle",i+" Invoices"),t={options:{startkey:[i,null,s],endkey:[i,l,a]},mapReduce:"invoice_by_status"},"All"===i&&(delete t.options.startkey,delete t.options.endkey),t},queryParams:{startKey:{refreshModel:!0},status:{refreshModel:!0}}})}),define("hospitalrun/invoices/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"+thqAl2P",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],9]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["billing.alerts.noInvoiceFound"],null],false],["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["billing.buttons.createInvoice"],null],false],["close-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["invoice"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editItem",["get",["invoice"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["buttons.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showAddPayment",["get",["invoice"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["admin.roles.capability.addPayment"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddPayment"]]],null,3],["block",["if"],[["get",["canAdd"]]],null,2],["block",["if"],[["get",["canDelete"]]],null,1]],"locals":[]},{"statements":[["block",["if"],[["get",["showActions"]]],null,4]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["invoice"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","invoice-number"],["flush-element"],["append",["unknown",["invoice","displayInvoiceNumber"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["invoice","billDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","patient","displayName"]],false],["text"," - "],["append",["unknown",["invoice","patient","displayPatientId"]],false],["text"," "],["open-element","br",[]],["flush-element"],["close-element"],["append",["unknown",["invoice","visit","primaryDiagnoses"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","total"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["invoice","remainingBalance"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["unless"],[["get",["invoice","paidFlag"]]],null,5],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["invoice"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.number"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.billDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.total"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.balanceDue"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,7],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,6],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,8,0]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/invoices/index/template.hbs"}})}),define("hospitalrun/invoices/payment/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/patient-submodule"],function(e,t,n,a){e.default=t.default.extend(a.default,{cancelAction:"closeModal",findPatientVisits:!1,invoiceController:n.default.inject.controller("invoices"),newPayment:!1,expenseAccountList:n.default.computed.alias("invoiceController.expenseAccountList"),patientList:n.default.computed.alias("invoiceController.patientList"),_finishUpdate:function(e,t){this.send("closeModal"),this.displayAlert(t,e)},currentPatient:function(){var e=this.get("model.paymentType");return"Deposit"===e?this.get("model.patient"):this.get("model.invoice.patient")}.property("model.patient","model.paymentType","model.invoice.patient"),title:function(){var e=this.get("model.isNew"),t=this.get("model.paymentType");return e?"Add "+t:"Edit "+t}.property("model.isNew","model.paymentType"),selectPatient:function(){var e=this.get("model.isNew"),t=this.get("model.paymentType");return e&&"Deposit"===t}.property("model.isNew","model.paymentType"),beforeUpdate:function(){this.get("model.isNew")?this.set("newPayment",!0):this.set("newPayment",!1);var e=this.get("currentPatient");return this.set("model.charityPatient","Charity"===e.get("patientType")),n.default.RSVP.resolve()},afterUpdate:function(){this.get("model").save().then(function(e){var t=this;this.get("newPayment")?!function(){var n=t.get("currentPatient");n.get("payments").then(function(t){t.addObject(e),n.save().then(function(){var t=this;if("Deposit"===e.get("paymentType")){var a="A deposit of "+e.get("amount")+" was added for patient "+n.get("displayName");this._finishUpdate(a,"Deposit Added")}else!function(){var n=t.get("model.invoice");n.addPayment(e),n.save().then(function(){var t="A payment of "+e.get("amount")+" was added to invoice "+n.get("id");this._finishUpdate(t,"Payment Added")}.bind(t))}()}.bind(this))}.bind(t))}():this.send("closeModal")}.bind(this))}})}),define("hospitalrun/invoices/payment/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"R4hTidw9",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText","updateButtonClass"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]],"update-payment-btn"]],4]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","invoice","patient","displayName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required payment-patient"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["selectPatient"]]],null,1,0]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,2],["text"," "],["append",["helper",["number-input"],null,[["property","label","class"],["amount",["helper",["t"],["labels.amount"],null],"required payment-amount"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","maxDate","class"],["datePaid",["helper",["t"],["labels.datePaid"],null],"now","required"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection"],["expenseAccount",["helper",["t"],["labels.creditTo"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]]]]],false],["text","\\n "],["append",["helper",["em-text"],null,[["property","label"],["notes",["helper",["t"],["labels.notes"],null]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],3]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/invoices/payment/template.hbs"}})}),define("hospitalrun/invoices/route",["exports","hospitalrun/routes/abstract-module-route","hospitalrun/mixins/modal-helper","hospitalrun/mixins/patient-list-route"],function(e,t,n,a){e.default=t.default.extend(n.default,a.default,{addCapability:"add_invoice",currentScreenTitle:"Invoices",editTitle:"Edit Invoice",newTitle:"New Invoice",moduleName:"invoices",newButtonText:"+ new invoice",sectionTitle:"Invoices",additionalButtons:function(){if(this.currentUserCan("add_payment"))return[{class:"btn btn-default",buttonText:"+ add deposit",buttonAction:"showAddDeposit"}]}.property(),additionalModels:[{name:"billingCategoryList",findArgs:["lookup","billing_categories"]},{name:"expenseAccountList",findArgs:["lookup","expense_account_list"]},{name:"pricingProfiles",findArgs:["price-profile"]}],actions:{showAddDeposit:function(){var e=this.store.createRecord("payment",{paymentType:"Deposit",datePaid:new Date});this.send("openModal","invoices.payment",e)},showAddPayment:function(e){var t=this.store.createRecord("payment",{invoice:e,paymentType:"Payment",datePaid:new Date});this.send("openModal","invoices.payment",t)},showEditPayment:function(e){this.currentUserCan("add_payment")&&this.send("openModal","invoices.payment",e)}},subActions:function(){var e=[{text:"Billed",linkTo:"invoices.index",statusQuery:"Billed"}];return this.currentUserCan("add_invoice")&&(e.push({text:"Drafts",linkTo:"invoices.index",statusQuery:"Draft"}),e.push({text:"All Invoices",linkTo:"invoices.index",statusQuery:"All"})),e.push({text:"Paid",linkTo:"invoices.index",statusQuery:"Paid"}),e}.property()})}),define("hospitalrun/invoices/search/route",["exports","hospitalrun/routes/abstract-search-route"],function(e,t){e.default=t.default.extend({moduleName:"invoices",searchKeys:[{name:"externalInvoiceNumber",type:"contains"},{name:"patientInfo",type:"contains"}],searchModel:"invoice"})}),define("hospitalrun/invoices/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"7Stx2dsU",block:'{"statements":[["block",["search-listing"],null,[["newButtonText","allButtonText"],["New Invoice","All Invoices"]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","invoices/index"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/invoices/search/template.hbs"}})}),define("hospitalrun/labs/charge/controller",["exports","hospitalrun/procedures/charge/controller","ember"],function(e,t,n){e.default=t.default.extend({labsEdit:n.default.inject.controller("labs/edit"),cancelAction:"closeModal",newPricingItem:!1,requestingController:n.default.computed.alias("controllers.labs/edit"),pricingList:n.default.computed.alias("controllers.labs/edit.chargesPricingList")})}),define("hospitalrun/labs/charge/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"8qHLvc50",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","procedures/charge"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/labs/charge/template.hbs"}})}),define("hospitalrun/labs/completed/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({startKey:[],showActions:!1})}),define("hospitalrun/labs/completed/labs-completed-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr"})}),define("hospitalrun/labs/completed/labs-completed-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"53/ixka0",block:'{"statements":[["open-element","td",[]],["static-attr","class","requested-date"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","requestedDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","lab-date"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","labDate"]]],null],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","patient"],["flush-element"],["append",["unknown",["lab","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["lab","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","lab-type"],["flush-element"],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","result"],["flush-element"],["append",["unknown",["lab","result"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["lab","notes"]],false],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/completed/labs-completed-list-item/template.hbs"}})}),define("hospitalrun/labs/completed/route",["exports","hospitalrun/labs/index/route","ember-i18n"],function(e,t,n){e.default=t.default.extend({pageTitle:(0,n.translationMacro)("labs.completedTitle"),searchStatus:"Completed"})}),define("hospitalrun/labs/completed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"hCs/6AmP",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["labs.messages.noCompleted"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["labs/completed/labs-completed-list-item"],null,[["lab"],[["get",["lab"]]]]],false],["text","\\n"]],"locals":["lab"]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateCompleted"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.results"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,1],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model"]]],null,2,0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/completed/template.hbs"}})}),define("hospitalrun/labs/delete/controller",["exports","hospitalrun/controllers/abstract-delete-controller","hospitalrun/mixins/patient-submodule","ember-i18n"],function(e,t,n,a){e.default=t.default.extend(n.default,{title:(0,a.translationMacro)("labs.deleteTitle"),actions:{delete:function(){this.deleteChildFromVisit("labs")}}})}),define("hospitalrun/labs/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"+OJQ5Cwg",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["labs.messages.confirmDeletion"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/delete/template.hbs"}})}),define("hospitalrun/labs/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/charge-actions","ember","hospitalrun/mixins/patient-submodule"],function(e,t,n,a,l){e.default=t.default.extend(n.default,l.default,{labsController:a.default.inject.controller("labs"),chargePricingCategory:"Lab",chargeRoute:"labs.charge",selectedLabType:null,canComplete:function(){var e=this.get("model.isNew"),t=this.get("model.labTypeName"),n=this.get("selectedLabType");return(!e||!(a.default.isEmpty(t)||a.default.isArray(n)&&n.length>1))&&this.currentUserCan("complete_lab")}.property("selectedLabType.[]","model.labTypeName"),actions:{completeLab:function(){this.set("model.status","Completed"),this.get("model").validate().then(function(){this.get("model.isValid")&&(this.set("model.labDate",new Date),this.send("update"))}.bind(this)).catch(a.default.K)},update:function(){var e=this;this.get("model.isNew")?!function(){var t=e.get("model"),n=e.get("selectedLabType");a.default.isEmpty(e.get("model.status"))&&e.set("model.status","Requested"),e.set("model.requestedBy",t.getUserName()),e.set("model.requestedDate",new Date),a.default.isEmpty(n)?e.saveNewPricing(e.get("model.labTypeName"),"Lab","model.labType").then(function(){this.addChildToVisit(t,"labs","Lab").then(function(){this.saveModel()}.bind(this))}.bind(e)):e.getSelectedPricing("selectedLabType").then(function(e){a.default.isArray(e)?this.createMultipleRequests(e,"labType","labs","Lab"):(this.set("model.labType",e),this.addChildToVisit(t,"labs","Lab").then(function(){this.saveModel()}.bind(this)))}.bind(e))}():this.saveModel()}},additionalButtons:function(){var e=this.get("canComplete"),t=this.get("model.isValid"),n=this.get("i18n");if(t&&e)return[{buttonAction:"completeLab",buttonIcon:"glyphicon glyphicon-ok",class:"btn btn-primary on-white",buttonText:n.t("buttons.complete")}]}.property("canComplete","model.isValid"),pricingTypeForObjectType:"Lab Procedure",pricingTypes:a.default.computed.alias("labsController.labPricingTypes"),pricingList:null,updateCapability:"add_lab",afterUpdate:function(e,t){var n=this.get("i18n"),a=void 0,l=void 0,s=void 0;"Completed"===this.get("model.status")?(s=n.t("labs.alerts.requestCompletedTitle"),l=n.t("labs.alerts.requestCompletedMessage")):(s=n.t("labs.alerts.requestSavedTitle"),l=n.t("labs.alerts.requestSavedMessage")),t&&(a=this.get("cancelAction")),this.saveVisitIfNeeded(s,l,a),this.set("model.selectPatient",!1)}})}),define("hospitalrun/labs/edit/route",["exports","ember","hospitalrun/routes/abstract-edit-route","hospitalrun/mixins/charge-route","hospitalrun/mixins/patient-list-route","ember-i18n"],function(e,t,n,a,l,s){e.default=n.default.extend(a.default,l.default,{editTitle:(0,s.translationMacro)("labs.editTitle"),modelName:"lab",newTitle:(0,s.translationMacro)("labs.newTitle"),pricingCategory:"Lab",actions:{returnToAllItems:function(){this.controller.send("returnToAllItems")}},getNewData:function(){return t.default.RSVP.resolve({selectPatient:!0,requestDate:moment().startOf("day").toDate()})}})}),define("hospitalrun/labs/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"zksQIuZ7",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["em-input"],null,[["property","label","class"],["result",["helper",["t"],["labels.result"],null],"test-result-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDate"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-6"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","labType","name"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-xs-9"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","requestedBy"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","prompt","selected"],["col-xs-3 required test-visit-type",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["helper",["t"],["labs.labels.addNewVisit"],null],["get",["model","visit"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["checkbox-or-typeahead"],null,[["property","label","list","selection","optionLabelPath","typeAheadType","className","prompt","model"],["labTypeName",["helper",["t"],["labs.labels.labType"],null],["get",["objectTypeList"]],["get",["selectedLabType"]],"name","pricing","required test-lab-type"," ",["get",["model"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"labs.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"required test-patient-name"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","selectPatient"]]],null,4,3],["block",["if"],[["get",["model","isNew"]]],null,2,1],["block",["if"],[["get",["canComplete"]]],null,0],["text"," "],["append",["helper",["em-text"],null,[["property","label","rows"],["notes",["helper",["t"],["labels.notes"],null],3]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],5]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/edit/template.hbs"}})}),define("hospitalrun/labs/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],addPermission:"add_lab"})}),define("hospitalrun/labs/index/labs-edit-button/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"button",classNames:["btn","btn-default","neutral"]})}),define("hospitalrun/labs/index/labs-edit-button/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"D+D+/RzO",block:'{"statements":[["block",["link-to"],["labs.edit",["get",["lab"]]],null,0],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["append",["helper",["t"],["labels.edit"],null],false]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/index/labs-edit-button/template.hbs"}})}),define("hospitalrun/labs/index/labs-list-item/component",["exports","ember"],function(e,t){e.default=t.default.Component.extend({tagName:"tr",classNames:["clickable"],click:function(){this.sendAction("action",this.lab)}})}),define("hospitalrun/labs/index/labs-list-item/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"lUoTUBbz",block:'{"statements":[["open-element","td",[]],["static-attr","class","requested-date"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","requestedDate"]]],[["format"],["l h:mm A"]]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","patient"],["flush-element"],["append",["unknown",["lab","patient","displayName"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","requested-by"],["flush-element"],["append",["unknown",["lab","requestedBy"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","lab-type"],["flush-element"],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n"],["open-element","td",[]],["static-attr","class","notes"],["flush-element"],["append",["unknown",["lab","notes"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["labs/index/labs-edit-button"],null,[["lab"],[["get",["lab"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canEdit"]]],null,0],["text"," "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/index/labs-list-item/template.hbs"}})}),define("hospitalrun/labs/index/route",["exports","hospitalrun/routes/abstract-index-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({modelName:"lab",pageTitle:(0,n.translationMacro)("labs.requestsTitle"),searchStatus:"Requested",_getStartKeyFromItem:function(e){var t=e.get("labDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("requestedDateAsTime"),l=this.get("searchStatus");return[l,a,t,n]},_modelQueryParams:function(){var e=this._getMaxPouchId(),t=this.get("maxValue"),n=this._getMinPouchId(),a=this.get("searchStatus");return{options:{startkey:[a,null,null,n],endkey:[a,t,t,e]},mapReduce:"lab_by_status"}}})}),define("hospitalrun/labs/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"6Iu3UI4u",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],5]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["labs.messages.createNewRecord"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["labs.messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["labs/index/labs-list-item"],null,[["lab","action","showActions","canEdit"],[["get",["lab"]],"editItem",["get",["showActions"]],["get",["canEdit"]]]]],false],["text","\\n"]],"locals":["lab"]},{"statements":[["text"," "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["static-attr","class","col-xs-2"],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,3],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,4,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/labs/index/template.hbs"}})}),define("hospitalrun/labs/route",["exports","hospitalrun/routes/abstract-module-route","ember-i18n"],function(e,t,n){e.default=t.default.extend({addCapability:"add_lab",additionalModels:[{name:"labPricingTypes",findArgs:["lookup","lab_pricing_types"]}],allowSearch:!1,moduleName:"labs",newButtonText:(0,n.translationMacro)("labs.buttons.newButton"),sectionTitle:(0,n.translationMacro)("labs.sectionTitle")})}),define("hospitalrun/locales/de/translations",["exports"],function(e){e.default={dashboard:{title:"Was möchten Sie tun?"},navigation:{imaging:"Bildgebung",inventory:"Inventar",patients:"Patienten",appointments:"Termine",medication:"Medikation",labs:"Labore",billing:"Abrechnung",administration:"Administration",subnav:{requests:"Anfragen",items:"Einheiten",completed:"Erledigt",newRequest:"Neue Anfrage",inventoryReceived:"Eingeganges Inventar",reports:"Berichte",patientListing:"Patietenliste",newPatient:"Neuer Patient",thisWeek:"Diese Woche",today:"Heute",search:"Suche",addAppointment:"Termin eintragen",dispense:"Verabreichen",returnMedication:"Medikamente zurückgeben",invoices:"Rechnungen",newInvoice:"Neue Rechnung",prices:"Kosten",priceProfiles:"Preisprofile",lookupLists:"Nachschlagelisten",addressFields:"Adressfelder",loadDb:"Datenbank laden",users:"Benutzer",newUser:"Neuer Benutzer"},actions:{logout:"Abmelden",login:"Anmelden"},about:"Über HospitalRun"},user:{plusNewUser:"+ Neuer Benutzer",usersPageTile:"Benutzerliste"},admin:{addressOptions:"Adressoptionen",lookupLists:"Nachschlagelisten",loadDb:"Datenbank laden",users:"Benutzer",address:{address1Label:"Adresse 1 Kennzeichen",address2Label:"Adresse 2 Kennzeichen",address3Label:"Adresse 3 Kennzeichen",address4Label:"Adresse 4 Kennzeichen",include1Label:"Einbezug 1 Kennzeichen",include2Label:"Einbezug 2 Kennzeichen",include3Label:"Einbezug 3 Kennzeichen",include4Label:"Einbezug 4 Kennzeichen",titles:{optionsSaved:"Optionen gespeichert"},messages:{addressSaved:"Die Adressoptionen wurden gespeichert"}},lookup:{anesthesiaTypes:"Anästhesiearten",anesthesiologists:"Anästhesiologe",billingCategories:"Abrechnungskategorien",clinicList:"Kliniken",countryList:"Länder",diagnosisList:"Diagnosen",cptCodeList:"CPT Codes",expenseAccountList:"Ausgabekonten",aisleLocationList:"Gänge-Verzeichnis",warehouseList:"Warenhaus",inventoryTypes:"Inventartypen",imagingPricingTypes:"Bildgebungs-Preiskategorien",labPricingTypes:"Labor-Preiskategorien",patientStatusList:"Patientenstatus",physicianList:"Ärzte",procedureList:"Abläufe",procedureLocations:"Ablaufs-Orte",procedurePricingTypes:"Ablaufs-Preiskategorien",radiologists:"Radiologen",unitTypes:"Einheiten",vendorList:"Anbieter",visitLocationList:"Einsatzorte",visitTypes:"Besuchsarten",wardPricingTypes:"Krankenstations-Preistypen"}},labels:{name:"Name",patient:"Patient",quantity:"Anzahl",requestedOn:"Angefragt am",dateRequested:"Anfragedatum",dateCompleted:"Abschlussdatum",requestedBy:"Angefragt von",fulfill:"Ausführen",actions:"Aktionen",action:"Aktion",notes:"Notizen",edit:"Bearbeiten",imagingType:"Bildgebungsart",result:"Ergebnis",results:"Ergebnisse",visit:"Besuch",requests:"Anfragen",completed:"Erledigt",id:"Id-Nr",sex:"Geschlecht",age:"Alter",username:"Username",email:"E-Mail",role:"Rolle",delete:"Entfernen",userCanAddNewValue:"Benutzer kann neue Werte hinzufügen",value:"Wert",lookupType:"Nachschlagebereich",importFile:"Datei importieren",fileLoadSuccessful:"Datei erfolgreich geladen",fileToLoad:"Datei laden",startTime:"Startzeit",endTime:"Endzeit",docRead:"Dokument gelesen",docWritten:"Dokument geschrieben",displayName:"Angezeigter Name",password:"Passwort",editUser:"Benutzer bearbeiten",newUser:"Neuer Benutzer",deleteUser:"Benutzer löschen"},messages:{noItemsFound:"Keine Einträge gefunden.",createNewRecord:"Neuen Eintrag erstellen?",createNewUser:"Neuen Benutzer hinzufügen?",noUsersFound:"Keine Benutzer gefunden.",areYouSureDelete:"Wollen Sie den Benutzer {{user}} sicher löschen?",userHasBeenSaved:"Der Benutzer wurde gespeichert.",userSaved:"Benutzer gespeichert",forAuthorizedPersons:"Dieser Bericht ist nur für autorisierte Personen."},buttons:{complete:"Abschließen",cancel:"Abbrechen",returnButton:"Zurück",add:"Hinzufügen",update:"Aktualisieren",ok:"Okay",delete:"Entfernen",newUser:"Neuer Benutzer",addValue:"Wert hinzufügen",import:"Importieren",loadFile:"Datei laden"},login:{messages:{signIn:"Bitte anmelden",error:"Benutzername oder Passwort falsch."},labels:{password:"Passwort",username:"Benutzername",signIn:"Anmelden"}},inventory:{messages:{noRequests:"Keine Anfragen gefunden.",createRequest:"Neue Anfrage erstellen?"}},imaging:{pageTitle:"Anfrage zur Bildgebung",sectionTitle:"Bildgebung",buttons:{newButton:"+ Neue Bildgebung"},labels:{radiologist:"Radiologe",addNewVisit:"--Neuen Besuch hinzufügen--"},messages:{noCompleted:"Keine erledigten Einträge gefunden."},titles:{completedImaging:"Erledigte Bildgebung",editTitle:"Bildgebungs-Anfrage bearbeiten",newTitle:"Neue Bildgebungs-Anfrage"},alerts:{completedTitle:"Bildgebungs-Anfrage gestellt",completedMessage:"Die Anfrage zur Bildgebung wurde abgeschlossen.",savedTitle:"Bildgebungs-Anfrage gespeichert",savedMessage:"Die Anfrage zur Bildgebung wurde gespeichert." -}}}}),define("hospitalrun/locales/en/config",["exports"],function(e){e.default={}}),define("hospitalrun/locales/en/translations",["exports"],function(e){e.default={dashboard:{title:"What would you like to do?"},errors:{inclusion:"is not included in the list",exclusion:"is reserved",invalid:"is invalid",confirmation:"doesn't match {{attribute}}",accepted:"must be accepted",empty:"can't be empty",blank:"can't be blank",present:"must be blank",tooLong:"is too long (maximum is {{count}} characters)",tooShort:"is too short (minimum is {{count}} characters)",wrongLength:"is the wrong length (should be {{count}} characters)",notANumber:"is not a number",notAnInteger:"must be an integer",greaterThan:"must be greater than {{count}}",greaterThanOrEqualTo:"must be greater than or equal to {{count}}",equalTo:"must be equal to {{count}}",lessThan:"must be less than {{count}}",lessThanOrEqualTo:"must be less than or equal to {{count}}",otherThan:"must be other than {{count}}",odd:"must be odd",even:"must be even",invalidNumber:"not a valid number",result:"Please enter a result before completing"},dates:{long:"{{years}} year {{months}} months {{days}} days",longPlural:"{{years}} years {{months}} months {{days}} days",longOmitYears:"{{months}} months {{days}} days",longOmitDays:"{{years}} year {{months}} months",longOmitDaysPlural:"{{years}} years {{months}} months",longOmitDaysYears:"{{months}} months",shortOmitYears:"{{months}}m {{days}}d",short:"{{years}}y {{months}}m {{days}}d"},navigation:{imaging:"Imaging",inventory:"Inventory",patients:"Patients",appointments:"Appointments",medication:"Medication",labs:"Labs",billing:"Billing",administration:"Administration",subnav:{actions:"Actions",requests:"Requests",items:"Items",completed:"Completed",newRequest:"New Request",inventoryReceived:"Inventory Received",reports:"Reports",patientListing:"Patient Listing",newPatient:"New Patient",thisWeek:"This Week",today:"Today",search:"Search",addAppointment:"Add Appointment",dispense:"Dispense",returnMedication:"Return Medication",invoices:"Invoices",newInvoice:"New Invoice",prices:"Prices",priceProfiles:"Price Profiles",lookupLists:"Lookup Lists",addressFields:"Address Fields",loadDB:"Load DB",users:"Users",newUser:"New User",admittedPatients:"Admitted Patients",missed:"Missed",userRoles:"User Roles",workflow:"Workflow",outpatient:"Outpatient",customForms:"Custom Forms"},actions:{logout:"Logout",login:"Login"},about:"About HospitalRun"},user:{plusNewUser:"+ new user",usersPageTile:"User Listing"},admin:{addressOptions:"Address Options",lookupLists:"Lookup Lists",loadDb:"Load DB",userRoles:"User Roles",users:"Users",address:{address1Label:"Address 1 Label",address2Label:"Address 2 Label",address3Label:"Address 3 Label",address4Label:"Address 4 Label",include1Label:"Include 1 Label",include2Label:"Include 2 Label",include3Label:"Include 3 Label",include4Label:"Include 4 Label",titles:{optionsSaved:"Options Saved"},messages:{addressSaved:"The address options have been saved"},newTitle:"Address Options",editTitle:"Address Options",addressLabel:"Address"},customForms:{buttons:{addField:"Add Field",moveDown:"Move Down",moveUp:"Move Up",newForm:"+ new form",preview:"Preview"},labels:{alwaysInclude:"Always Include",checkbox:"Checkbox",columns:"Columns",colSpan:"Number of Columns To Span",customForm:"Custom Form",formName:"Form Name",formType:"Form Type",includeOtherOption:"Include Other Option",label:"Label",newForm:"New Form",otherOptionLabel:"Other Option Label",patientFormType:"Patient",property:"Property",radio:"Radio",select:"Dropdown",socialworkFormType:"Social Work",text:"Text",textarea:"Large Text",visitFormType:"Visit"},messages:{deleteForm:"Are you sure you want to delete this custom form?",formSaved:"The {{name}} form has been saved."},titles:{customForms:"Custom Forms",deleteForm:"Delete Custom Form",editCustomForm:"Edit Custom Form",fields:"Fields",formSaved:"Form Saved",checkboxValues:"Checkbox Values",dropDownValues:"Dropdown Values",newCustomForm:"New Custom Form",radioValues:"Radio Values"}},loaddb:{progressMessage:"Please wait while your database is loaded.",progressTitle:"Loading Database",displayAlertTitle:"Select File To Load",displayAlertMessage:"Please select file to load.",errorDisplayAlertTitle:"Error Loading",errorDisplayAlertMessage:"The database could not be imported. The error was: {{error}}",editTitle:"Load DB"},lookup:{alertImportListTitle:"Select File To Import",alertImportListMessage:"Please select file to import.",alertImportListSaveTitle:"List Imported",alertImportListSaveMessage:"The lookup list has been imported.",alertImportListUpdateTitle:"List Saved",alertImportListUpdateMessage:"The lookup list has been saved.",pageTitle:"Lookup Lists",edit:{template:{addTitle:"Add Value",editTitle:"Edit Value",updateButtonTextAdd:"Add",updateButtonTextUpdate:"Update",labelTitle:"Value"}},anesthesiaTypes:"Anesthesia Types",anesthesiologists:"Anesthesiologists",billingCategories:"Billing Categories",clinicList:"Clinic Locations",countryList:"Countries",diagnosisList:"Diagnoses",cptCodeList:"CPT Codes",expenseAccountList:"Expense Accounts",aisleLocationList:"Inventory Aisle Locations",warehouseList:"Inventory Locations",inventoryTypes:"Inventory Types",imagingPricingTypes:"Imaging Pricing Types",labPricingTypes:"Lab Pricing Types",patientStatusList:"Patient Status List",physicianList:"Physicians",procedureList:"Procedures",procedureLocations:"Procedures Locations",procedurePricingTypes:"Procedure Pricing Types",radiologists:"Radiologists",unitTypes:"Unit Types",vendorList:"Vendor",visitLocationList:"Visit Locations",visitTypes:"Visit Types",wardPricingTypes:"Ward Pricing Types",messages:{deleteLookupValue:"Are you sure you want to delete the {{value}} value?"},titles:{deleteLookupValue:"Delete Value"}},roles:{capability:{admin:"Administration",loadDb:"Load Database",updateConfig:"Update Configurations",appointments:"Appointments",addAppointment:"Add Appointment",billing:"Billing",addCharge:"Add Charge",addPricing:"Add Pricing",addPricingProfile:"Add Pricing Profile",addInvoice:"Add Invoice",addPayment:"Add Payment",deleteInvoice:"Delete Invoice",deletePricing:"Delete Pricing",deletePricingProfile:"Delete Pricing Profile",editInvoice:"Edit Invoice",invoices:"Invoices",overrideInvoice:"Override Invoice",pricing:"Pricing",patients:"Patients",addDiagnosis:"Add Diagnosis",addPhoto:"Add Photo",addPatient:"Add Patient",addProcedure:"Add Procedure",addVisit:"Add Visit",addVitals:"Add Vitals",admitPatient:"Admit Patient",deletePhoto:"Delete Photo",deletePatient:"Delete Patient",deleteAppointment:"Delete Appointment",deleteDiagnosis:"Delete Diagnosis",deleteProcedure:"Delete Procedure",deleteSocialwork:"Delete Social Work",deleteVitals:"Delete Vitals",deleteVisit:"Delete Visit",dischargePatient:"Discharge Patient",patientReports:"Patient Reports",visits:"Visits",medication:"Medication",addMedication:"Add Medication",deleteMedication:"Delete Medication",fulfillMedication:"Fulfill Medication",labs:"Labs",addLab:"Add Lab",completeLab:"Complete Lab",deleteLab:"Delete Lab",imaging:"Imaging",addImaging:"Add Imaging",completeImaging:"Complete Imaging",deleteImaging:"Delete Imaging",inventory:"Inventory",addInventoryRequest:"Add Inventory Request",addInventoryItem:"Add Inventory Item",addInventoryPurchase:"Add Inventory Purchase",adjustInventoryLocation:"Adjust Inventory Location",deleteInventoryItem:"Delete Inventory Item",fulfillInventory:"Fulfill Inventory",defineUserRoles:"Define User Roles",addBillingDiagnosis:"Add Billing Diagnosis",addNote:"Add Note",addSocialwork:"Add Social Work",deleteNote:"Delete Note"},messages:{roleSaved:"The {{roleName}} role has been saved."},titles:{roleSaved:"Role Saved"}},visitForms:{labels:{followup:"Followup",form:"Form",initial:"Initial",visitType:"Visit Type"},titles:{visitForms:"Visit Forms"}},workflow:{admissionDepositLabel:"Admission deposit required",clinicPrepaymentLabel:"Clinic prepayment required",followupPrepaymentLabel:"Followup prepayment required",outpatientLabLabel:"Outpatient Lab prepayment required",outpatientImagingLabel:"Outpatient Imaging prepayment required",outpatientMedicationLabel:"Outpatient Medication prepayment required",titles:{optionsSaved:"Options Saved"},messages:{optionsSaved:"The workflow options have been saved"},newTitle:"Workflow Options",editTitle:"Workflow Options",workflowLabel:"Workflow"}},labels:{cptcode:"CPT Code",loading:"Loading",name:"Name",note:"Note",patient:"Patient",prescriber:"Prescriber",quantity:"Quantity",requestedOn:"Requested On",date:"Date",dateOfBirth:"Date of Birth",dateOfBirthShort:"DoB",dateRequested:"Date Requested",dateCompleted:"Date Completed",description:"Description",requestedBy:"Requested By",fulfill:"Fulfill",fulfillRequest:"Fulfill Request",fulfillRequestNow:"Fulfill Request Now",actions:"Actions",action:"Action",notes:"Notes",edit:"Edit",imageOrders:"Image Orders",labOrders:"Lab Orders",imagingType:"Imaging Type",result:"Result",results:"Results",visit:"Visit",requests:"Requests",completed:"Completed",id:"Id",on:"on",type:"Type",sex:"Sex",age:"Age",search:"Search",username:"Username",email:"Email",role:"Role",delete:"Delete",userCanAddNewValue:"User Can Add New Values",value:"Value",lookupType:"Lookup Type",importFile:"Import File",fileLoadSuccessful:"File To Load Successful",fileToLoad:"File Load",fileName:"File Name",startTime:"Start Time",startDate:"Start Date",endTime:"End Time",endDate:"End Date",docRead:"Docs Read",docWritten:"Docs Written",displayName:"Display Name",password:"Password",editUser:"Edit User",newUser:"New User",deleteUser:"Delete User",medication:"Medication",status:"Status",addNewOutpatientVisit:"--Add New Outpatient Visit--",prescription:"Prescription",prescriptionDate:"Prescription Date",billTo:"Bill To",pullFrom:"Pull From",fulfilled:"Fulfilled",deleteRequest:"Delete Request",location:"Location",provider:"Provider",with:"With",allDay:"All Day",physician:"Physician",assisting:"Assisting",anesthesia:"Anesthesia",procedures:"Procedures",number:"Number",billDate:"Bill Date",balanceDue:"Balance Due",amount:"Amount",datePaid:"Date Paid",creditTo:"Credit To",invoiceId:"Invoice ID",lineItems:"Line Items",discount:"Discount",excess:"Excess",price:"Price",total:"Total",expenseTo:"Expense To",grandTotal:"Grand Total",remarks:"Remarks",payments:"Payments",category:"Category",department:"Department",address:"Address",country:"Country"},messages:{noItemsFound:"No items found.",noHistoryAvailable:"No history available.",createNewRecord:"Create a new record?",createNewUser:"Create a new user?",noUsersFound:"No users found.",areYouSureDelete:"Are you sure you wish to delete the user {{user}}?",userHasBeenSaved:"The user has been saved.",userSaved:"User Saved",onBehalfOf:"on behalf of",newPatientHasToBeCreated:"A new patient needs to be created...Please wait..",noNotesAvailable:"No additional clinical notes are available for this visit.",sorry:"Sorry, something went wrong...",forAuthorizedPersons:"This report is for authorized persons only.",requiredFieldsCorrectErrors:"Please fill in required fields (marked with *) and correct the errors before saving.",saveActionException:"An error occurred while attempting to save: {{message}}",reportError:"An error was encountered while generating the requested report. Please let your system administrator know that you have encountered an error."},alerts:{pleaseWait:"Please Wait",warningExclamation:"Warning!!!!",errorExclamation:"Error!!!!",reportError:"Error Generating Report"},headings:{chargedItems:"Charged Items"},buttons:{addItem:"Add Item",complete:"Complete",cancel:"Cancel",close:"Close",returnButton:"Return",barcode:"Barcode",add:"Add",update:"Update",ok:"Ok",fulfill:"Fulfill",remove:"Remove",delete:"Delete",newUser:"New User",addValue:"Add Value",newNote:"New Note",import:"Import",loadFile:"Load File",newRequest:"New Request",allRequests:"All Requests",dispense:"Dispense",newItem:"+ new item",newRequestPlus:"+ new request",addVisit:"Add Visit",search:"Search",edit:"Edit",addLineItem:"Add Line Item",showFewer:"Show Fewer",showAll:"Show All"},login:{messages:{signIn:"please sign in",error:"Username or password is incorrect."},labels:{password:"Password",username:"Username",signIn:"Sign in"}},loading:{progressBar:{progress:"{{progressBarValue}}% Complete"},messages:{0:"The top butterfly flight speed is 12 miles per hour. Some moths can fly 25 miles per hour!",1:"Owls are the only birds that can see the color blue.",2:"Cats have over 100 vocal sounds; dogs only have 10.",3:"Humans use a total of 72 different muscles in speech.",4:"More than 1,000 different languages are spoken on the continent of Africa.",5:"An erythrophobe is someone who blushes easily.",6:"The most common phobia in the world is odynophobia which is the fear of pain.",7:"Your body uses 300 muscles to balance itself when you are standing still.",8:"Certain frogs can be frozen solid then thawed, and continue living.",9:"Our eyes are always the same size from birth, but our nose and ears never stop growing.",10:"Your tongue is the only muscle in your body that is attached at only one end.",11:"Camels have three eyelids to protect themselves from blowing sand."}},inventory:{edit:{cost:"Cost Per Unit:",delivered:"Delievered To:",location:"Location Adjusted:",prescription:"Prescription For:",pulled:"Pulled From:",quantity:"Quantity at Completion:",reason:"Reason:",returned:"Returned from Patient:",transferredFrom:"Transferred From:",transferredTo:"Transferred To:"},labels:{action:"Action",add:"Add",adjust:"Adjust",adjustmentDate:"Adjustment Date",adjustmentFor:"Adjustment For",adjustmentType:"Adjustment Type",aisle:"Aisle",aisleLocation:"Aisle Location",allInventory:"All Inventory",availableQuantity:"{{quantity}} available",billTo:"Bill To",consumePurchases:"Consume Purchases",consumptionRate:"Consumption Rate",cost:"Cost",costPerUnit:"Cost per Unit",crossReference:"Cross Reference",currentQuantity:"Current Quantity",dateCompleted:"Date Completed",dateEffective:"Effective Date",dateEnd:"End Date",dateStart:"Start Date",dateReceived:"Date Received",dateTransferred:"Date Transferred",daysLeft:"Days Left",deliveryAisle:"Delivery Aisle",deliveryLocation:"Delivery Location",distributionUnit:"Distribution Unit",deleteItem:"Delete Item",details:"Details",editItem:"Edit Item",expense:"Expense To",expirationDate:"Expiration Date",fulfillRequest:"Fulfill Request",fulfillRequestNow:"Fulfill Request Now",gift:"Gift in Kind",giftUsage:"Gift in Kind Usage",giftInKindNo:"N",giftInKindYes:"Y",inventoryConsumed:"Inventory Consumed",inventoryItem:"Inventory Item",inventoryObsolence:"Inventory Obsolence",invoiceItems:"Invoice Items",invoiceLineItem:"Invoice Line Item",invoiceNumber:"Invoice Number",item:"Item",items:"Items",itemNumber:"Item Number",location:"Location",locations:"Locations",name:"Name",markAsConsumed:"Mark as Consumed",newItem:"New Item",allItems:"All Items",originalQuantity:"Original Quantity",print:"Print",printBarcode:"Print Barcode",printer:"Printer",pullFrom:"Pull From",purchases:"Purchases",purchaseCost:"Purchase Cost",purchaseInfo:"Purchase Information",quantity:"Quantity ({{unit}})",quantityAvailable:"Quantity Available",quantityOnHand:"Quantity on Hand",quantityRequested:"Quantity Requested",rank:"Rank",reason:"Reason",remove:"Remove",reorderPoint:"Reorder Point",requestedItems:"Requested Items",salePricePerUnit:"Sale Price per Unit",save:"Save",serialNumber:"Serial/Lot Number",total:"Total",totalCost:"Total Cost",totalReceived:"Total Received: {{total}}",transaction:"Transaction",transactions:"Transactions",transfer:"Transfer",transferFrom:"Transfer From",transferTo:"Transfer To Location",transferToAisle:"Transfer to Aisle Location",unit:"Unit",unitCost:"Unit Cost",vendor:"Vendor",vendorItemNumber:"Vendor Item Number",xref:"XRef"},messages:{adjust:"Please adjust the quantities on the appropriate location(s) to account for the difference of {{difference}}.",createRequest:"Create a new request?",delete:"Are you sure you wish to delete {{name}}?",itemNotFound:"The inventory item {{item}} could not be found.
If you would like to create a new inventory item, fill in the information below.
Otherwise, press the Cancel button to return.",loading:"Loading transactions ...",purchaseSaved:"The inventory purchases have been successfully saved.",noRequests:"No requests found.",noItems:"No items found.",quantity:"The total quantity of ({{quantity}}) does not match the total quantity in the locations ({{locationQuantity}}).",removeItem:"Are you sure you want to remove this item from this invoice?",removeItemRequest:"Are you sure you want to remove this item from this request?",requestFulfilled:"The inventory request has been fulfilled.",requestUpdated:"The inventory request has been updated.",warning:"Please fill in required fields (marked with *) and correct the errors before adding."},reports:{rows:{adjustments:"Adjustments",adjustmentsTotal:"Total Adjustments",balanceBegin:"Beginning Balance",balanceEnd:"Ending Balance",category:"Category",consumed:"Consumed",consumedGik:"GiK Consumed",consumedGikTotal:"Total GiK Consumed",consumedPuchases:"Purchases Consumed",consumedPurchasesTotal:"Total Purchases Consumed",consumedTotal:"Total Consumed",errInFinSum:"Error in _generateFinancialSummaryReport: ",errInFindPur:"Error in _findInventoryItemsByPurchase: ",errInFindReq:"Error in _findInventoryItemsByRequest: ",expensesFor:"Expenses For: ",noAccount:"(No Account)",subtotal:"Subtotal: ",subtotalFor:"Subtotal for {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total for {{var}}: ",totalPurchases:"Total Purchases",transfer1:"{{quantity}} from {{location}}",trasnfer2:"From: {{source}} To: {{target}}"},adjustment:"Detailed Adjustment",daysSupply:"Days Supply Left In Stock",expenseDetail:"Detailed Expenses",expenseSum:"Summary Expenses",expiration:"Expiration Date",export:"Export Report",fields:"Fields to Include",finance:"Finance Summary",generate:"Generate Report",invLocation:"Inventory By Location",invValuation:"Inventory Valuation",purchaseDetail:"Detailed Purchase",purchaseSum:"Summary Purchase",reportType:"Report Type",stockTransferDetail:"Detailed Stock Transfer",stockTransferSum:"Summary Stock Transfer",stockUsageDetail:"Detailed Stock Usage",stockUsageSum:"Summary Stock Usage",titleSingleDate:"{{name}} Report {{date}}",titleDateRange:"{{name}} Report {{startDate}} - {{endDate}}"},titles:{addPurchase:"Add Purchase",addRequest:"New Request",adjustment:"Adjustment",editPurchase:"Edit Purchase",editRequest:"Edit Request",inventoryItem:"New Inventory Item",inventoryReport:"Inventory Report",purchaseSaved:"Inventory Purchases Saved",quickAddTitle:"New Inventory Item",removeItem:"Remove Item",requestFulfilled:"Request Fulfilled",requestUpdated:"Request Updated",transfer:"Transfer Items",warning:"Warning!!!!!"}},imaging:{pageTitle:"Imaging Requests",sectionTitle:"Imaging",buttons:{newButton:"+ new imaging"},labels:{radiologist:"Radiologist",addNewVisit:"--Add New Visit--"},messages:{delete:"Are you sure you wish to delete this imaging request?",noCompleted:"No completed items found."},titles:{completedImaging:"Completed Imaging",editTitle:"Edit Imaging Request",newTitle:"New Imaging Request"},alerts:{completedTitle:"Imaging Request Completed",completedMessage:"The imaging request has been completed.",savedTitle:"Imaging Request Saved",savedMessage:"The imaging request has been saved."}},medication:{pageTitle:"Medication Requests",sectionTitle:"Medication",returnMedication:"Return Medication",buttons:{dispenseMedication:"dispense medication",newButton:"+ new request",returnMedication:"return medication"},titles:{completedMedication:"Completed Medication",editMedicationRequest:"Edit Medication Request",newMedicationRequest:"New Medication Request"},messages:{createNew:"Create a new medication request?",confirmDeletion:"Are you sure you wish to delete this medication request?"},labels:{refills:"Refills",quantityRequested:"Quantity Requested",quantityDispensed:"Quantity Dispensed",quantityDistributed:"Quantity Distributed",quantityToReturn:"Quantity To Return",returnLocation:"Return Location",returnAisle:"Return Aisle",returnReason:"Return Reason/Notes",adjustmentDate:"Adjustment Date",creditToAccount:"Credit To Account"},alerts:{returnedTitle:"Medication Returned",returnedMessage:"The medication has been marked as returned.",savedTitle:"Medication Request Saved",savedMessage:"The medication record has been saved.",fulfilledTitle:"Medication Request Fulfilled"}},appointments:{currentScreenTitle:"Appointment List",editTitle:"Edit Appointment",newTitle:"New Appointment",sectionTitle:"Appointments",thisWeek:"Appointments This Week",missed:"Missed Appointments",searchTitle:"Search Appointments",todayTitle:"Today's Appointments",messages:{deleteAppointmentMessage:"Are you sure you wish to delete this appointment?",endTimeLaterThanStart:"Please select an end time later than the start time."},buttons:{newButton:"+ new appointment"},labels:{selectedStartingDate:"Show Appointments On Or After"}},vitals:{messages:{delete:"Are you sure you wish to delete these vitals?"},labels:{dateRecorded:"Date Recorded",temperature:"Temperature",weight:"Weight",height:"Height",sbp:"SBP",dbp:"DBP",heartRate:"Heart Rate",respiratoryRate:"Respiratory Rate"}},visits:{titles:{additionalDiagnoses:"Additional Diagnoses",checkedIn:"Patient Checked In",checkOut:"Patient Check Out",checkedOut:"Patient Checked Out",discharged:"Patient Discharged",editVisit:"Edit Visit",newVisit:"New Visit",patientCheckIn:"Patient Check In",visitSaved:"Visit Saved"},messages:{delete:"Are you sure you wish to delete this visit?",checkOut:"Are you sure you wish to check out {{patientName}}?",checkedOut:"{{patientName}} has been checked out.",discharged:"{{patientName}} has been discharged.",patientCheckedIn:"{{patientName}} has been checked in.",patientCreatedAndCheckedIn:"{{patientName}} has been created and checked in.",visitAndPatientSaved:"The visit and patient records have been saved.",visitSaved:"The visit record has been saved."},buttons:{newProcedure:"New Procedure",newAppointment:"New Appointment",addDiagnosis:"Add Diagnosis",newVitals:"New Vitals",checkIn:"Check In",checkOut:"Check Out",discharge:"Discharge"},labels:{diagnosis:"Diagnosis",procedure:"Procedure",procedureDate:"Procedure Date",authoredBy:"Authored By",visitInformation:"Visit Information",examiner:"Examiner",status:"Visit Status",finalDiagnosis:"Final/Billing Diagnosis",visitDate:"Visit Date",visitType:"Visit Type",patientToCheckIn:"Patient To Check In",checkInTime:"Check In",checkOutTime:"Check Out",appointment:"Appointment",haveAppointment:"Y",noAppointment:"N",ordersDone:"Orders Done",haveDoneOrders:"Y",ordersNotDone:"N",reasonForVisit:"Reason For Visit",statusAdmitted:"Admitted",statusDischarged:"Discharged",statusCheckedIn:"Checked In",statusCheckedOut:"Checked Out",createNewPatient:"Create New Patient"},navigation:{charges:"Charges",notes:"Notes",orders:"Orders",procedures:"Procedures",vitals:"Vitals"}},labs:{sectionTitle:"Labs",requestsTitle:"Lab Requests",editTitle:"Edit Lab Request",newTitle:"New Lab Request",deleteTitle:"Delete Request",completedTitle:"Completed Labs",labels:{labType:"Lab Type",addNewVisit:"--Add New Visit--"},messages:{noItemsFound:"No labs found.",createNewRecord:"Create a new record?",confirmDeletion:"Are you sure you wish to delete this lab request?",noCompleted:"No completed items found."},buttons:{newButton:"+ new lab"},alerts:{requestCompletedTitle:"Lab Request Completed",requestCompletedMessage:"The lab request has been completed.",requestSavedTitle:"Lab Request Saved",requestSavedMessage:"The lab request has been saved."}},patients:{navigation:{photos:"Photos",general:"General",history:"History",appointments:"Appointments",visits:"Visits",medication:"Medication",imaging:"Imaging",labs:"Labs",socialWork:"Social Work"},titles:{addContact:"Add Contact",admittedPatients:"Admitted Patients",expenses:"Expenses",additionalContacts:"Additional Contacts",familyInformation:"Family Information",delete:"Delete Patient",new:"New Patient",edit:"Edit Patient",patient:"Patient Report",patientListing:"Patient Listing",patientReport:"Patient Report",addPhoto:"Add Photo",editPhoto:"Edit Photo",socialWork:"Expense",familyInfo:"Family Info",deleteFamilyMember:"Delete Family Member",deleteExpense:"Delete Expense",deletePhoto:"Delete Photo",deleteContact:"Delete Contact",savedPatient:"Patient Saved",todaysOutpatients:"Todays' Outpatients",admissionsDetail:"Admissions Detail",admissionsSummary:"Admissions Summary",diagnosticTesting:"Diagnostic Testing",dischargesDetail:"Discharges Detail",dischargesSummary:"Discharges Summary",proceduresDetail:"Procedures Detail",proceduresSummary:"Procedures Summary",patientStatus:"Patient Status",totalPatientDays:"Total Patient Days",totalPatientDaysDetailed:"Total Patient Days (Detailed)",visit:"Visit",deletePatientRecord:"Delete Patient Record",outpatientsForDate:"Outpatients for {{visitDate}}"},messages:{areYouSureDelete:"Are you sure you want to delete this {{object}}?",deletePatient:"Are you sure you wish to delete {{firstName}} {{lastName}}?",noPatientsFound:"No patients found.",savedPatient:"The patient record for {{displayName}} has been saved.",notFoundQuickAdd:"The patient {{patientFullName}} could not be found. If you would like to create a new patient, fill in the information below. Otherwise press the Cancel button to return.",createNewPatient:"Create a new patient record?",deletingPatient:"Deleting patient and all associated records"},buttons:{addExpense:"Add Expense",addContact:"Add Contact",newLab:"New Lab",newVisit:"New Visit",newMedication:"New Medication",newImaging:"New Imaging",addFamilyMember:"Add Family Member",newPhoto:"New Photo",newAppointment:"New Appointment",backToPatients:"Back to Patient List",newPatient:"+ new patient",patientCheckIn:"Patient Check In"},labels:{primaryDiagnosis:"Primary Diagnoses",secondaryDiagnosis:"Secondary Diagnoses",monthlyCost:"Monthly Cost",totalMontlyExpense:"Total Monthly Expenses",patientType:"Patient Type",admissionDate:"Admission Date",patientDays:"Patient Days",dischargeDate:"Discharge Date",admit:"Admit",relationships:"Relationships",phone:"Phone",email:"Email",firstName:"First Name",middleName:"Middle Name",lastName:"Last Name",sex:"Sex",dob:"DOB",dateOfBirth:"Date Of Birth",placeOfBirth:"Place Of Birth",sources:"Sources",cost:"Cost",civilStatus:"Civil Status",relationship:"Relationship To Patient",education:"Education",occupation:"Occupation",income:"Income",insurance:"Insurance",dateProcessed:"Date Processed",status:"Patient Status",externalPatientId:"External Patient Id",bloodType:"Blood Type",clinic:"Clinic Site",referredBy:"Referred By",referredDate:"Referred Date",religion:"Religion",parent:"Parent/Guardian",contacts:"Contacts",sexNotEntered:"Sex Not Entered"},notes:{newNote:"New Note for",updateNote:"Updating Note from",onBehalfOfLabel:"On Behalf Of",onBehalfOfCopy:"on behalf of",pleaseSelectAVisit:"Please select a visit"}},billing:{alerts:{noInvoiceFound:"No invoices found",deleteItem:"Are you sure you wish to delete {{item}}?",noPricingItems:"No pricing items found.",noPricingProfiles:"No pricing profiles found."},buttons:{createInvoice:"Create an invoice?",addOverride:"Add Override"},labels:{externalInvoiceNumber:"External Invoice #",paymentProfile:"Payment Profile",actualCharges:"Actual Charges",insurance:"National Insurance",hmoCom:"HMO/COM",paymentsDeposits:"Payments/Deposits",pricingPanelOverrides:"Pricing profile overrides",pricingProfile:"Pricing Profile",discountAmount:"Discount Amount",discountPercentage:"Discount Percentage"}},print:{invoice:{labels:{patientName:"NAME OF PATIENT:",patientId:"PATIENT #:",patientAge:"AGE:",patientAddress:"ADDRESS:",dateAdmitted:"ADMITTED:",dateDischarged:"DISCHARGE:",dischargeNotes:"Discharge Notes:",remarks:"Remarks:",billedBy:"Billed by:",billedDate:"Bill Date:",spacer:"__________________________________________"},messages:{whereConducted:"were deducted during my confinement"},titles:{patientMember:"Patient-Member",relContact:"Relationship/Contact no.",patients:"PATIENT'S",billingStatement:"BILLING STATEMENT"}}},procedures:{titles:{addChargeItem:"Add Charge Item",deleteChargeItem:"Delete Charge Item",editChargeItem:"Edit Charge Item",medicationUsed:"Medication Used",deleteMedicationUsed:"Delete Medication Used",addMedicationUsed:"Add Medication Used",editMedicationUsed:"Edit Medication Used",edit:"Edit Procedure",saved:"Procedure Saved",new:"New Procedure"},labels:{medicationUsed:"Medication Used"},messages:{deleteMedication:"Are you sure you want to delete this medication?",delete:"Are you sure you wish to delete this procedure?",saved:"The procedure record has been saved."},buttons:{addMedication:"Add Medication"}},components:{chargesByTypeTab:{charges:"charges"},customFormManager:{buttons:{addForm:"Add Form"}},sortableColumn:{labels:{selectAll:"(Select All)"}},dateTimePicker:{amHour:"{{hour}} AM",midnight:"Midnight",noon:"Noon",pmHour:"{{hour}} PM"},takePhoto:{how:"How Do You Want To Add A Photo?",takePhoto:"Take photo",uploadPhoto:"Upload Photo",uploadFile:"Upload File",camera:"Camera",photo:"photo",preview:"preview"},quantityConv:{unit:"Unit",conversion:"What does 1 {{name}} contain?"},quantityCalc:{result:"{{targetUnit}} total: {{calculated}}"},patientOrders:{buttons:{newImaging:"New Imaging",newLab:"New Lab",newMedication:"New Medication"},labels:{imagingOrderType:"Imaging",labOrderType:"Lab",medicationOrderType:"Medication",orderType:"Order Type"}},priceList:{charges:"{{pricingType}} charges"}},customForms:{buttons:{addForm:"Add Form"},labels:{formToAdd:"Form To Add"},titles:{addCustomForm:"Add Custom Form"}},diagnosis:{labels:{activeDiagnosis:"Active Diagnosis",date:"Date",diagnosis:"Diagnosis",secondaryDiagnosis:"Secondary Diagnosis"},titles:{addDiagnosis:"Add Diagnosis",editDiagnosis:"Edit Diagnosis"}},allergies:{buttons:{addAllergy:"Add Allergy"},titles:{addAllergy:"Add Allergy",editAllergy:"Edit Allergy"},labels:{allergyName:"Name",patientAllergy:"Patient Allergies"}}}}),define("hospitalrun/locales/es-CO/translations",["exports"],function(e){e.default={dashboard:{title:"Que deseas hacer?"},navigation:{imaging:"Radiografia",inventory:"Inventario",patients:"Pacientes",appointments:"Citas",medication:"Recetas medicas",labs:"Laboratorio",billing:"Facturas",administration:"Administracion",subnav:{requests:"Pedidos",items:"Items",completed:"Completado",newRequest:"New pedido",inventoryReceived:"Inventario recibido",reports:"Reportes",patientListing:"Lista de pacientes",newPatient:"Nuevo paciente",thisWeek:"Esta semana",today:"Hoy",search:"Buscar",addAppointment:"Nueva cita",dispense:"Dispense",returnMedication:"Devolver medicamento",invoices:"Facturas",newInvoice:"Nueva factura",prices:"Precios",priceProfiles:"Perfil de precios",lookupLists:"Lista de busuedas",addressFields:"Campos de dirección",loadDb:"Cargar base de datos",users:"Usuarios",newUser:"Nuevo usuario",userRoles:"Roles"},actions:{logout:"Salir",login:"Ingresar"},about:"Información de HospitalRun"},user:{plusNewUser:"+ nuevo usuario",usersPageTile:"Listado de usuarios"},admin:{addressOptions:"Opciones de direcciones",lookupLists:"Lista de busqueda",loadDb:"Cargar Base de datos",userRoles:"Roles",users:"Usuarios",address:{address1Label:"Texto direccion 1",address2Label:"Texto direccion 2",address3Label:"Texto direccion 3",address4Label:"Texto direccion 4",include1Label:"Incluir 1",include2Label:"Incluir 2",include3Label:"Incluir 3",include4Label:"Incluir 4",titles:{optionsSaved:"Opciones guardadas"},messages:{addressSaved:"las opciones de dirección han sido guardadas"},newTitle:"Opciones de dirección",editTitle:"Opciones de dirección",addressLabel:"Direcciones"},loaddb:{progressMessage:"Por favor espere mientras la base de datos es cargada.",progressTitle:"Cargando ase de datos",displayAlertTitle:"Seleccione un archivo para cargar", -displayAlertMessage:"Por favor seleccione un archivo para ser cargado.",errorDisplayAlertTitle:"Error cargando",errorDisplayAlertMessage:"La base de datos no fue cargada el error fue: {{error}}",editTitle:"Cargar bd"},lookup:{alertImportListTitle:"Seleccione un archivo para importar",alertImportListMessage:"Por favor seleccione un archivo para importar.",alertImportListSaveTitle:"Lista importada",alertImportListSaveMessage:"Lista de busqueda importada.",alertImportListUpdateTitle:"Lista salvada",alertImportListUpdateMessage:"La lista de busqueda ha sido salvada.",pageTitle:"Listas de busqueda",edit:{template:{addTitle:"Adicionar valor",editTitle:"Editar valor",updateButtonTextAdd:"Adicionar",updateButtonTextUpdate:"Actualizar",labelTitle:"Valor"}},anesthesiaTypes:"Tipos de anestesia",anesthesiologists:"Anestesiologo",billingCategories:"Categorias de facturacion",clinicList:"Ubicacion de las clinicas",countryList:"Paises",diagnosisList:"Diagnosticos",cptCodeList:"Codigos CPT",expenseAccountList:"Cuentas de gastos",aisleLocationList:"Ubicacion de inventario de pasillo",warehouseList:"Ubicacciones de inventarios",inventoryTypes:"Tipos de inventarios",imagingPricingTypes:"Tipos de precios de radiografias",labPricingTypes:"Precios de laboratorio",patientStatusList:"Lista de estado de pacientes",physicianList:"Medicos",procedureList:"Procedimientos",procedureLocations:"Ubicacion de los procedimientos",procedurePricingTypes:"Tipos de procedimientos y precios",radiologists:"Radiologo",unitTypes:"Tipos de unidad",vendorList:"Proveedor",visitLocationList:"Lugares de visista",visitTypes:"Tipos de visita",wardPricingTypes:"Tipos de las tarifas"},roles:{capability:{admin:"Administracion",loadDb:"Cargar base de datos",updateConfig:"Actualizar configuracion",appointments:"Citas",addAppointment:"Adicionar cita",billing:"Facturacion",addCharge:"Adicionar cargo (valor)",addPricing:"Adicionar precio",addPricingProfile:"Adicionar perfil de precios",addInvoice:"Adicionar factura",addPayment:"Adicionar pago",deleteInvoice:"Eliminar factura",deletePricing:"Eliminar precio",deletePricingProfile:"Eliminar perfil de precio",editInvoice:"Editar factura",invoices:"Facturas",overrideInvoice:"Sobreescribir factura",pricing:"Precio",patients:"Pacientes",addDiagnosis:"Adicionar diagnostico",addPhoto:"Adicionar foto",addPatient:"Adicionar paciente",addVisit:"Adicionar visita",addVitals:"Adicionar partes vitales",admitPatient:"Admitir paciente",deletePhoto:"Eliminar foto",deletePatient:"Eliminar paciente",deleteAppointment:"Eliminar cita",deleteDiagnosis:"Eliminar diagnostico",deleteProcedure:"Eliminar procedimiento",deleteSocialwork:"Eliminar trabajo social",deleteVitals:"Eliminar organo vital",deleteVisit:"Eliminar visita",dischargePatient:"Descartar paciente",patientReports:"Reportes por paciente",visits:"Visitas",medication:"Medicación",addMedication:"Adicionar medicación",deleteMedication:"Eliminar medicación",fulfillMedication:"Cumplir la medicación",labs:"Laboratorios",addLab:"Adicionar laboratorio",completeLab:"Completar laboratorio",deleteLab:"Eliminar laboratorio",imaging:"Radiografia",addImaging:"Adicionar radiografia",completeImaging:"Completar radiografia",deleteImaging:"Eliminar radiografia",inventory:"Inventario",addInventoryRequest:"Pedido de inventario",addInventoryItem:"Adicionar elemento al inventario",addInventoryPurchase:"Adicionar compra",adjustInventoryLocation:"Ajustar lugar elemento en el inventario",deleteInventoryItem:"Eliminar elemento del inventario",deleteInventoryPurchase:"Eliminar compra del inventario",fulfillInventory:"Cumplimiento de inventario",defineUserRoles:"Roles de usuario"},messages:{roleSaved:"El {{roleName}} rol ha sido salvado."},titles:{roleSaved:"Role salvado"}}},labels:{cptcode:"Codigo CPT",loading:"Cargando",name:"Nombre",patient:"Paciente",quantity:"Cantidada",requestedOn:"Pedido On",date:"Fecha",dateOfBirth:"Fecha de nacimiento",dateOfBirthShort:"FDN",dateRequested:"Fecha de pedido",dateCompleted:"Fecha completada",description:"Descripción",requestedBy:"Pedido por|",fulfill:"Cumplomiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de cumplimiento ahora",actions:"Acciones",action:"Accion",notes:"Notas",edit:"Editar",imageOrders:"Ordenes de radiografias",labOrders:"Ordenes de laboratorio",imagingType:"Tipo de radiografia",result:"Resultado",results:"Resultados",visit:"Visita",requests:"Pedido",completed:"Completado",id:"Id",on:"on",type:"Tipo",sex:"Genero",age:"Edad",username:"Nombre de usuario",email:"Email",role:"Rol",delete:"Eliminar",userCanAddNewValue:"Los usuarios pueden agregar nuevos valores",value:"Valor",lookupType:"Tipo de busqueda",importFile:"Importar archivo",fileLoadSuccessful:"Archivo cargado exitosamente",fileToLoad:"Archivo cargado",startTime:"Hora de inicio",startDate:"Fecha de inicio",endTime:"Hora de finalización",endDate:"Fecha final",docRead:"Leer documento",docWritten:"Documento escrito",displayName:"Nombre para mostrar",password:"Contraseña",editUser:"Editar usuario",newUser:"Nuevo usuario",deleteUser:"Eliminar usuario",medication:"Medicación",status:"Estado",addNewOutpatientVisit:"--Nueva visita a paciente externo--",prescription:"Receta medica",prescriptionDate:"Fecha de la receta medica",billTo:"Facturar a",pullFrom:"Traer de",fulfilled:"Cumplido",deleteRequest:"Eliminar pedido",location:"Ubicacion",provider:"Proveedor",with:"con",allDay:"Todo el dia",physician:"Médico",assisting:"Asistencia",anesthesia:"Anestesia",procedures:"Procedimiento"},messages:{noItemsFound:"Elementos no encontrados.",noHistoryAvailable:"Historia no disponible.",createNewRecord:"Crear un nuevo registro?",createNewUser:"Crear un nuevo usuario?",noUsersFound:"Ningun usuario encontrado.",areYouSureDelete:"Estas seguro de eliminar este usuario {{user}}?",userHasBeenSaved:"El usuario ha sido salvado.",userSaved:"Usuario salvado",onBehalfOf:"a nombre de",newPatientHasToBeCreated:"Un nuevo paciente debe ser creado...Por favor espere..",noNotesAvailable:"No hay notas clínicas adicionales están disponibles para esta visita.",sorry:"Lo sentimos, un error ha ocurrido...",forAuthorizedPersons:"Este informe es sólo para personas autorizadas."},alerts:{pleaseWait:"Por favor espere"},buttons:{complete:"Completado",cancel:"Cancelar",close:"Cerrar",returnButton:"Regresar",barcode:"Codigo de barras",add:"Adicionar",update:"Actualizar",ok:"Ok",fulfill:"Cumplimiento",remove:"Remover",delete:"Eliminar",newUser:"Nuevo usuario",addValue:"Adicionar valor",newNote:"Nueva nota",import:"Importar",loadFile:"Cargar archivo",newRequest:"Nueva solicitud",allRequests:"Todas las solicitudes",dispense:"Repartir",newItem:"+ nuevo elemento",newRequestPlus:"+ nuevo pedido",addVisit:"Adicionar visita",search:"Buscar"},login:{messages:{signIn:"por favor ingrese",error:"Nombre de usuario o clave incorrectos."},labels:{password:"Clave",username:"Nombre de usuario",signIn:"Ingresar"}},inventory:{edit:{cost:"Costo por unidad:",delivered:"Enviado A:",location:"Cambio de ubicación:",prescription:"Recetado por:",pulled:"Pulled From:",quantity:"Quantity at Completion:",reason:"Razón:",returned:"Regresado al paciente:",transferredFrom:"Transferido a:",transferredTo:"Transferido a:"},labels:{action:"Acción",add:"Adicionar",adjust:"Adjustar",adjustmentDate:"Fecha de ajuste",adjustmentFor:"Ajustado para",adjustmentType:"Tipo de ajuste",aisle:"Pasillo",aisleLocation:"Ubicación pasillo",allInventory:"Todo el inventario",billTo:"Facturao a",consumePurchases:"Consume Purchases",consumptionRate:"Tasa de consumo",cost:"Costo",costPerUnit:"Costo por Unidad",crossReference:"Referencia cruzada",currentQuantity:"Cantidad actual",dateCompleted:"Fecha completado",dateEffective:"Gecha efectiva",dateEnd:"Fecha final",dateStart:"Fecha inicial",dateReceived:"Fecha recibido",dateTransferred:"Fecha transferencia",daysLeft:"Dias restantes",deliveryAisle:"Enviado a pasillo",deliveryLocation:"Ubicación del envio",distributionUnit:"Unidad de distribución",deleteItem:"Eliminar elemento",details:"Detalles",editItem:"Editar elemento",expense:"Gastos a",expirationDate:"Fecha de vencimiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de incumplimiento para hoy",gift:"Regalo en especie",giftUsage:"Uso del regalo en especie",giftInKindNo:"N",giftInKindYes:"Y",inventoryConsumed:"Inventario consumido",inventoryItem:"Elemento del inventario",inventoryObsolence:"Obsolescencia de inventario",invoiceItems:"Articulos de factura",invoiceLineItem:"Elemento de la factura linea",invoiceNumber:"Factura numero",item:"Elemento",items:"Elementos",itemNumber:"Numero de elemento",location:"Ubicación",locations:"Ubicaciones",name:"Nombre",markAsConsumed:"Marcar como consumido",newItem:"Nuevo elemento",originalQuantity:"Cantidad original",print:"Imprimir",printBarcode:"Imprimir codigo de barras",printer:"Impresora",pullFrom:"Traido de",purchases:"Compras",purchaseCost:"Costo de compra",purchaseInfo:"Informacion de la compra",quantity:"Cantidad ({{unit}})",quantityAvailable:"Cantidad disponible",quantityOnHand:"Cantidad a la mano",quantityRequested:"Cantidad pedida",rank:"Ranking",reason:"Razón",remove:"Remover",reorderPoint:"Reordenar punto",requestedItems:"Elementos solicitados",salePricePerUnit:"Costo de venta por unidad",save:"Guardar",serialNumber:"Serial/Numero de lote",total:"Total",totalCost:"Costo total",totalReceived:"Total Recivido: {{total}}",transaction:"Transaccion",transactions:"Transacciones",transfer:"Translados",transferFrom:"Translado desde",transferTo:"Translado a ubicación",transferToAisle:"Translado a pasillo",unit:"Unidad",unitCost:"Unidad Costo",vendor:"Proveedor",vendorItemNumber:"Proveedor numero de elemento",xref:"XRef"},messages:{adjust:"Por favor ajust las cantidades en la ubicación adecuada(s) la diferencia de la cuenta es {{difference}}.",createRequest:"Crear un nuevo pedido?",delete:"Estas seguro de eliminar {{name}}?",itemNotFound:"El elemento del inventario {{item}} no se pudo encontrar.
Si desea crear un nuevo elemento, Ingrese la información abajo.
De lo contrario opria cancelar para volver.",loading:"Cargando transacciones ...",purchaseSaved:"La compra de inventario ha sido salvada.",noRequests:"No se encontraron pedidos.",noItems:"No se encontraron elementos.",quantity:"La cantidad total ({{quantity}}) no encaja con la cantidad total en las ubicaciones ({{locationQuantity}}).",removeItem:"Esta seguro de eliminar este elemento de la factura?",removeItemRequest:"Seguro que quiere eliminar este elemento del pedido?",requestFulfilled:"El pedido de inventario ha sido procesado.",requestUpdated:"El pedido de inventario ha sido actualizado.",warning:"Valide los campos requeridos (marcados con *) corrija los errores antes de adicionar."},reports:{rows:{adjustments:"Ajustes",adjustmentsTotal:"Ajustes totales",balanceBegin:"Balance inicial",balanceEnd:"Balance Final",category:"Categoria",consumed:"Consumado",consumedGik:"GiK Consumido",consumedGikTotal:"Total GiK Consumido",consumedPuchases:"Total de lo comprado consumido",consumedPurchasesTotal:"Total de lo comprado consumido",consumedTotal:"Total consumido",errInFinSum:"Error en _generateFinancialSummaryReport: ",errInFindPur:"Error en _findInventoryItemsByPurchase: ",errInFindReq:"Error en _findInventoryItemsByRequest: ",expensesFor:"Gatos para: ",noAccount:"(No Cuenta)",subtotal:"Subtotal: ",subtotalFor:"Subtotal para {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total para {{var}}: ",totalPurchases:"Compras Totales",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} A: {{target}}"},adjustment:"Ajuste detallado",daysSupply:"Dias de inventario restante",expenseDetail:"Gastos detallados",expenseSum:"Resumen de gastos",expiration:"Fecha de expiracion",export:"Exportar reporte",fields:"Campos a incluir",finance:"Resumen de finanzas",generate:"Generar reporte",invLocation:"Inventario por ubicacion",invValuation:"Inventario por valoracion",purchaseDetail:"Compras detalladas",purchaseSum:"Resumen de compras",reportType:"Tipo de reporte",stockTransferDetail:"Detalle de traslado de stock",stockTransferSum:"Resumen traslado de stock",stockUsageDetail:"Detalle de uso de stock",stockUsageSum:"Resumen uso de stock"},titles:{addPurchase:"Adicionar compra",addRequest:"Nuevo pedido",adjustment:"Ajuste",editPurchase:"Editar compra",editRequest:"Editar pedido",inventoryItem:"Nuevo elemento de inventario",inventoryReport:"Reporte de inventario",purchaseSaved:"Compras de inventario guardadas",quickAddTitle:"Nuevo elemento de inventario",removeItem:"Remover elemento",requestFulfilled:"Pedido cumplido",requestUpdated:"Pedido actualizado",transfer:"Trasladar elementos",warning:"Peligro!!!!!"}},imaging:{pageTitle:"Pedido de radriografia",sectionTitle:"Radiografias",buttons:{newButton:"+ new radiografia"},labels:{radiologist:"Radiologo",addNewVisit:"--Adicionar nueva visita--"},messages:{noCompleted:"No de items encontrados."},titles:{completedImaging:"Radiografia completada",editTitle:"Pedido de edicion de radiografia",newTitle:"Nuevo pedido de radiografia"},alerts:{completedTitle:"Pedido de radiografia completado",completedMessage:"El pedido de radiografia ha sido completado.",savedTitle:"Pedido de radiografia salvado",savedMessage:"El pedido de radiografia ha sido guardado."}},medication:{pageTitle:"Pedido de medicación",sectionTitle:"Medication",returnMedication:"Retorno de medicación",buttons:{dispenseMedication:"dispensar medicación",newButton:"+ nuevo pedido",returnMedication:"debolver medicacion"},titles:{completedMedication:"Medicacion completada",editMedicationRequest:"Editar pedido de medicacion",newMedicationRequest:"Nuevo pedido de medicacion"},messages:{createNew:"Crear un nuevo pedido de medicacion?",confirmDeletion:"Estas seguro de eliminar este pedido de medicación?"},labels:{refills:"Recargas",quantityRequested:"Cantidad solicitada",quantityDispensed:"Cantidad dispensada",quantityDistributed:"Cantidad distribuida",quantityToReturn:"Cantidad a devolver",returnLocation:"Retornar a ubicación",returnAisle:"Devolve a pasillo",returnReason:"Razon por la que se devuelve/Nota",adjustmentDate:"Fecha de ajuste",creditToAccount:"Credito a cuenta"},alerts:{returnedTitle:"Medicacion devuelta",returnedMessage:"La medicacion ha sido marcada para devolver.",savedTitle:"Pedido de medicacion guardado",savedMessage:"La elemento de medicación ha sido guardado.",fulfilledTitle:"Pedido de medicación cumplido"}},appointments:{currentScreenTitle:"Listado de citas",editTitle:"Editar cita",newTitle:"Nueva cita",sectionTitle:"Citas",thisWeek:"Citas esta semana",missed:"Citas perdidas",searchTitle:"Buscar citas",todayTitle:"Citas para hoy",messages:{deleteAppointmentMessage:"Esta seguro de eliminar esta cita?",endTimeLaterThanStart:"Seleccione una hora de finalizacion despues de la de inicio."},buttons:{newButton:"+ nueva cita"}},visits:{edit:{buttons:{newAppointment:"Nuevas citas",addDiagnosis:"Adicionar diagnostico",newProcedure:"Nuevo procedimiento",newLab:"New laboratorio",newMedication:"Nueva mediicación",newImaging:"Nueva radiografia"},labels:{diagnosis:"Diagnostico",procedure:"Procedimiento",authoredBy:"Escrito por",labs:"Laboratorios",imaging:"Radiografias",visitInformation:"Informacion de visita"}}},labs:{sectionTitle:"Laboratorios",requestsTitle:"Pedido de laboratorio",editTitle:"Editar pedido de laboratorio",newTitle:"Nuevo pedido de laboratorio",deleteTitle:"Eliminar pedido",completedTitle:"Completar laboratorio",labels:{labType:"Tipo de laboratorio",addNewVisit:"--Adicionar nueva visita--"},messages:{noItemsFound:"No boratorios encontrados.",createNewRecord:"Crear un registro?",confirmDeletion:"Esta seguro de eliminar esta solicitud de laboratorio?",noCompleted:"No elementos completados encontrados."},buttons:{newButton:"+ nuevo laboratorio"},alerts:{requestCompletedTitle:"Pedido de laboratorio competado",requestCompletedMessage:"El pedido de laboratorio ha sido completado.",requestSavedTitle:"Silicitud de laboratorio guardado",requestSavedMessage:"El pedido de laboratorio ha sido guardado."}},common:{actions:"Acciones"},patients:{notes:{onBehalfOfLabel:"A nombre de",onBehalfOfCopy:"a nombre de",pleaseSelectAVisit:"Por favor seleccione una visista",noteLabel:"Nota"}}}}),define("hospitalrun/locales/es/translations",["exports"],function(e){e.default={dashboard:{title:"Que deseas hacer?"},navigation:{imaging:"Radiografia",inventory:"Inventario",patients:"Pacientes",appointments:"Citas",medication:"Recetas medicas",labs:"Laboratorio",billing:"Facturas",administration:"Administracion",subnav:{requests:"Pedidos",items:"Items",completed:"Completado",newRequest:"New pedido",inventoryReceived:"Inventario recibido",reports:"Reportes",patientListing:"Lista de pacientes",newPatient:"Nuevo paciente",thisWeek:"Esta semana",today:"Hoy",search:"Buscar",addAppointment:"Nueva cita",dispense:"Dispense",returnMedication:"Devolver medicamento",invoices:"Facturas",newInvoice:"Nueva factura",prices:"Precios",priceProfiles:"Perfil de precios",lookupLists:"Lista de busuedas",addressFields:"Campos de dirección",loadDb:"Cargar base de datos",users:"Usuarios",newUser:"Nuevo usuario",userRoles:"Roles"},actions:{logout:"Salir",login:"Ingresar"},about:"Información de HospitalRun"},user:{plusNewUser:"+ nuevo usuario",usersPageTile:"Listado de usuarios"},admin:{addressOptions:"Opciones de direcciones",lookupLists:"Lista de busqueda",loadDb:"Cargar Base de datos",userRoles:"Roles",users:"Usuarios",address:{address1Label:"Texto direccion 1",address2Label:"Texto direccion 2",address3Label:"Texto direccion 3",address4Label:"Texto direccion 4",include1Label:"Incluir 1",include2Label:"Incluir 2",include3Label:"Incluir 3",include4Label:"Incluir 4",titles:{optionsSaved:"Opciones guardadas"},messages:{addressSaved:"las opciones de dirección han sido guardadas"},newTitle:"Opciones de dirección",editTitle:"Opciones de dirección",addressLabel:"Direcciones"},loaddb:{progressMessage:"Por favor espere mientras la base de datos es cargada.",progressTitle:"Cargando ase de datos",displayAlertTitle:"Seleccione un archivo para cargar",displayAlertMessage:"Por favor seleccione un archivo para ser cargado.",errorDisplayAlertTitle:"Error cargando",errorDisplayAlertMessage:"La base de datos no fue cargada el error fue: {{error}}",editTitle:"Cargar bd"},lookup:{alertImportListTitle:"Seleccione un archivo para importar",alertImportListMessage:"Por favor seleccione un archivo para importar.",alertImportListSaveTitle:"Lista importada",alertImportListSaveMessage:"Lista de busqueda importada.",alertImportListUpdateTitle:"Lista salvada",alertImportListUpdateMessage:"La lista de busqueda ha sido salvada.",pageTitle:"Listas de busqueda",edit:{template:{addTitle:"Adicionar valor",editTitle:"Editar valor",updateButtonTextAdd:"Adicionar",updateButtonTextUpdate:"Actualizar",labelTitle:"Valor"}},anesthesiaTypes:"Tipos de anestesia",anesthesiologists:"Anestesiologo",billingCategories:"Categorias de facturacion",clinicList:"Ubicacion de las clinicas",countryList:"Paises",diagnosisList:"Diagnosticos",cptCodeList:"Codigos CPT",expenseAccountList:"Cuentas de gastos",aisleLocationList:"Ubicacion de inventario de pasillo",warehouseList:"Ubicacciones de inventarios",inventoryTypes:"Tipos de inventarios",imagingPricingTypes:"Tipos de precios de radiografias",labPricingTypes:"Precios de laboratorio",patientStatusList:"Lista de estado de pacientes",physicianList:"Medicos",procedureList:"Procedimientos",procedureLocations:"Ubicacion de los procedimientos",procedurePricingTypes:"Tipos de procedimientos y precios",radiologists:"Radiologo",unitTypes:"Tipos de unidad",vendorList:"Proveedor",visitLocationList:"Lugares de visista",visitTypes:"Tipos de visita",wardPricingTypes:"Tipos de las tarifas"},roles:{capability:{admin:"Administracion",loadDb:"Cargar base de datos",updateConfig:"Actualizar configuracion",appointments:"Citas",addAppointment:"Adicionar cita",billing:"Facturacion",addCharge:"Adicionar cargo (valor)",addPricing:"Adicionar precio",addPricingProfile:"Adicionar perfil de precios",addInvoice:"Adicionar factura",addPayment:"Adicionar pago",deleteInvoice:"Eliminar factura",deletePricing:"Eliminar precio",deletePricingProfile:"Eliminar perfil de precio",editInvoice:"Editar factura",invoices:"Facturas",overrideInvoice:"Sobreescribir factura",pricing:"Precio",patients:"Pacientes",addDiagnosis:"Adicionar diagnostico",addPhoto:"Adicionar foto",addPatient:"Adicionar paciente",addVisit:"Adicionar visita",addVitals:"Adicionar partes vitales",admitPatient:"Admitir paciente",deletePhoto:"Eliminar foto",deletePatient:"Eliminar paciente",deleteAppointment:"Eliminar cita",deleteDiagnosis:"Eliminar diagnostico",deleteProcedure:"Eliminar procedimiento",deleteSocialwork:"Eliminar trabajo social",deleteVitals:"Eliminar organo vital",deleteVisit:"Eliminar visita",dischargePatient:"Descartar paciente",patientReports:"Reportes por paciente",visits:"Visitas",medication:"Medicación",addMedication:"Adicionar medicación",deleteMedication:"Eliminar medicación",fulfillMedication:"Cumplir la medicación",labs:"Laboratorios",addLab:"Adicionar laboratorio",completeLab:"Completar laboratorio",deleteLab:"Eliminar laboratorio",imaging:"Radiografia",addImaging:"Adicionar radiografia",completeImaging:"Completar radiografia",deleteImaging:"Eliminar radiografia",inventory:"Inventario",addInventoryRequest:"Pedido de inventario",addInventoryItem:"Adicionar elemento al inventario",addInventoryPurchase:"Adicionar compra",adjustInventoryLocation:"Ajustar lugar elemento en el inventario",deleteInventoryItem:"Eliminar elemento del inventario",deleteInventoryPurchase:"Eliminar compra del inventario",fulfillInventory:"Cumplimiento de inventario",defineUserRoles:"Roles de usuario"},messages:{roleSaved:"El {{roleName}} rol ha sido salvado."},titles:{roleSaved:"Role salvado"}}},labels:{cptcode:"Codigo CPT",loading:"Cargando",name:"Nombre",patient:"Paciente",quantity:"Cantidada",requestedOn:"Pedido On",date:"Fecha",dateOfBirth:"Fecha de nacimiento",dateOfBirthShort:"FDN",dateRequested:"Fecha de pedido",dateCompleted:"Fecha completada",description:"Descripción",requestedBy:"Pedido por|",fulfill:"Cumplomiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de cumplimiento ahora",actions:"Acciones",action:"Accion",notes:"Notas",edit:"Editar",imageOrders:"Ordenes de radiografias",labOrders:"Ordenes de laboratorio",imagingType:"Tipo de radiografia",result:"Resultado",results:"Resultados",visit:"Visita",requests:"Pedido",completed:"Completado",id:"Id",on:"on",type:"Tipo",sex:"Genero",age:"Edad",username:"Nombre de usuario",email:"Email",role:"Rol",delete:"Eliminar",userCanAddNewValue:"Los usuarios pueden agregar nuevos valores",value:"Valor",lookupType:"Tipo de busqueda",importFile:"Importar archivo",fileLoadSuccessful:"Archivo cargado exitosamente",fileToLoad:"Archivo cargado",startTime:"Hora de inicio",startDate:"Fecha de inicio",endTime:"Hora de finalización",endDate:"Fecha final",docRead:"Leer documento",docWritten:"Documento escrito",displayName:"Nombre para mostrar",password:"Contraseña",editUser:"Editar usuario",newUser:"Nuevo usuario",deleteUser:"Eliminar usuario",medication:"Medicación",status:"Estado",addNewOutpatientVisit:"--Nueva visita a paciente externo--",prescription:"Receta medica",prescriptionDate:"Fecha de la receta medica",billTo:"Facturar a",pullFrom:"Traer de",fulfilled:"Cumplido",deleteRequest:"Eliminar pedido",location:"Ubicacion",provider:"Proveedor",with:"con",allDay:"Todo el dia",physician:"Médico",assisting:"Asistencia",anesthesia:"Anestesia",procedures:"Procedimiento"},messages:{noItemsFound:"Elementos no encontrados.",noHistoryAvailable:"Historia no disponible.",createNewRecord:"Crear un nuevo registro?",createNewUser:"Crear un nuevo usuario?",noUsersFound:"Ningun usuario encontrado.",areYouSureDelete:"Estas seguro de eliminar este usuario {{user}}?",userHasBeenSaved:"El usuario ha sido salvado.",userSaved:"Usuario salvado",onBehalfOf:"a nombre de",newPatientHasToBeCreated:"Un nuevo paciente debe ser creado...Por favor espere..",noNotesAvailable:"No hay notas clínicas adicionales están disponibles para esta visita.",sorry:"Lo sentimos, un error ha ocurrido...",forAuthorizedPersons:"Este informe es sólo para personas autorizadas."},alerts:{pleaseWait:"Por favor espere"},buttons:{complete:"Completado",cancel:"Cancelar",close:"Cerrar",returnButton:"Regresar",barcode:"Codigo de barras",add:"Adicionar",update:"Actualizar",ok:"Ok",fulfill:"Cumplimiento",remove:"Remover",delete:"Eliminar",newUser:"Nuevo usuario",addValue:"Adicionar valor",newNote:"Nueva nota",import:"Importar",loadFile:"Cargar archivo",newRequest:"Nueva solicitud",allRequests:"Todas las solicitudes",dispense:"Repartir",newItem:"+ nuevo elemento",newRequestPlus:"+ nuevo pedido",addVisit:"Adicionar visita",search:"Buscar"},login:{messages:{signIn:"por favor ingrese",error:"Nombre de usuario o clave incorrectos."},labels:{password:"Clave",username:"Nombre de usuario",signIn:"Ingresar"}},inventory:{edit:{cost:"Costo por unidad:",delivered:"Enviado A:",location:"Cambio de ubicación:",prescription:"Recetado por:",pulled:"Pulled From:",quantity:"Quantity at Completion:",reason:"Razón:",returned:"Regresado al paciente:",transferredFrom:"Transferido a:",transferredTo:"Transferido a:"},labels:{action:"Acción",add:"Adicionar",adjust:"Adjustar",adjustmentDate:"Fecha de ajuste",adjustmentFor:"Ajustado para",adjustmentType:"Tipo de ajuste",aisle:"Pasillo",aisleLocation:"Ubicación pasillo",allInventory:"Todo el inventario",billTo:"Facturao a",consumePurchases:"Consume Purchases",consumptionRate:"Tasa de consumo",cost:"Costo",costPerUnit:"Costo por Unidad",crossReference:"Referencia cruzada",currentQuantity:"Cantidad actual",dateCompleted:"Fecha completado",dateEffective:"Gecha efectiva",dateEnd:"Fecha final",dateStart:"Fecha inicial",dateReceived:"Fecha recibido",dateTranferred:"Fecha transferencia",daysLeft:"Dias restantes",deliveryAisle:"Enviado a pasillo",deliveryLocation:"Ubicación del envio",distributionUnit:"Unidad de distribución",deleteItem:"Eliminar elemento",details:"Detalles",editItem:"Editar elemento",expense:"Gastos a",expirationDate:"Fecha de vencimiento",fulfillRequest:"Pedido de cumplimiento",fulfillRequestNow:"Pedido de incumplimiento para hoy",gift:"Regalo en especie",giftUsage:"Uso del regalo en especie",giftInKindNo:"N",giftInKindYes:"Y",inventoryConsumed:"Inventario consumido",inventoryItem:"Elemento del inventario",inventoryObsolence:"Obsolescencia de inventario",invoiceItems:"Articulos de factura",invoiceLineItem:"Elemento de la factura linea",invoiceNumber:"Factura numero",item:"Elemento",items:"Elementos",itemNumber:"Numero de elemento",location:"Ubicación",locations:"Ubicaciones",name:"Nombre",markAsConsumed:"Marcar como consumido",newItem:"Nuevo elemento",originalQuantity:"Cantidad original",print:"Imprimir",printBarcode:"Imprimir codigo de barras",printer:"Impresora",pullFrom:"Traido de",purchases:"Compras",purchaseCost:"Costo de compra",purchaseInfo:"Informacion de la compra",quantity:"Cantidad ({{unit}})",quantityAvailable:"Cantidad disponible",quantityOnHand:"Cantidad a la mano",quantityRequested:"Cantidad pedida",rank:"Ranking",reason:"Razón",remove:"Remover",reorderPoint:"Reordenar punto",requestedItems:"Elementos solicitados",salePricePerUnit:"Costo de venta por unidad",save:"Guardar",serialNumber:"Serial/Numero de lote",total:"Total",totalCost:"Costo total",totalReceived:"Total Recivido: {{total}}",transaction:"Transaccion",transactions:"Transacciones",transfer:"Translados",transferFrom:"Translado desde",transferTo:"Translado a ubicación",transferToAisle:"Translado a pasillo",unit:"Unidad",unitCost:"Unidad Costo",vendor:"Proveedor",vendorItemNumber:"Proveedor numero de elemento",xref:"XRef"},messages:{adjust:"Por favor ajust las cantidades en la ubicación adecuada(s) la diferencia de la cuenta es {{difference}}.",createRequest:"Crear un nuevo pedido?",delete:"Estas seguro de eliminar {{name}}?",itemNotFound:"El elemento del inventario {{item}} no se pudo encontrar.
Si desea crear un nuevo elemento, Ingrese la información abajo.
De lo contrario opria cancelar para volver.",loading:"Cargando transacciones ...",purchaseSaved:"La compra de inventario ha sido salvada.",noRequests:"No se encontraron pedidos.",noItems:"No se encontraron elementos.",quantity:"La cantidad total ({{quantity}}) no encaja con la cantidad total en las ubicaciones ({{locationQuantity}}).",removeItem:"Esta seguro de eliminar este elemento de la factura?",removeItemRequest:"Seguro que quiere eliminar este elemento del pedido?",requestFulfilled:"El pedido de inventario ha sido procesado.",requestUpdated:"El pedido de inventario ha sido actualizado.",warning:"Valide los campos requeridos (marcados con *) corrija los errores antes de adicionar."},reports:{rows:{adjustments:"Ajustes",adjustmentsTotal:"Ajustes totales",balanceBegin:"Balance inicial",balanceEnd:"Balance Final",category:"Categoria",consumed:"Consumado",consumedGik:"GiK Consumido",consumedGikTotal:"Total GiK Consumido",consumedPuchases:"Total de lo comprado consumido",consumedPurchasesTotal:"Total de lo comprado consumido",consumedTotal:"Total consumido",errInFinSum:"Error en _generateFinancialSummaryReport: ",errInFindPur:"Error en _findInventoryItemsByPurchase: ",errInFindReq:"Error en _findInventoryItemsByRequest: ",expensesFor:"Gatos para: ",noAccount:"(No Cuenta)",subtotal:"Subtotal: ",subtotalFor:"Subtotal para {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total para {{var}}: ",totalPurchases:"Compras Totales",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} A: {{target}}"},adjustment:"Ajuste detallado",daysSupply:"Dias de inventario restante",expenseDetail:"Gastos detallados",expenseSum:"Resumen de gastos",expiration:"Fecha de expiracion",export:"Exportar reporte",fields:"Campos a incluir",finance:"Resumen de finanzas",generate:"Generar reporte",invLocation:"Inventario por ubicacion",invValuation:"Inventario por valoracion",purchaseDetail:"Compras detalladas",purchaseSum:"Resumen de compras",reportType:"Tipo de reporte",stockTransferDetail:"Detalle de traslado de stock",stockTransferSum:"Resumen traslado de stock",stockUsageDetail:"Detalle de uso de stock",stockUsageSum:"Resumen uso de stock"},titles:{addPurchase:"Adicionar compra",addRequest:"Nuevo pedido",adjustment:"Ajuste",editPurchase:"Editar compra",editRequest:"Editar pedido",inventoryItem:"Nuevo elemento de inventario",inventoryReport:"Reporte de inventario",purchaseSaved:"Compras de inventario guardadas",quickAddTitle:"Nuevo elemento de inventario",removeItem:"Remover elemento",requestFulfilled:"Pedido cumplido",requestUpdated:"Pedido actualizado",transfer:"Trasladar elementos",warning:"Peligro!!!!!"}},imaging:{pageTitle:"Pedido de radriografia",sectionTitle:"Radiografias",buttons:{newButton:"+ new radiografia"},labels:{radiologist:"Radiologo",addNewVisit:"--Adicionar nueva visita--"},messages:{noCompleted:"No de items encontrados."},titles:{completedImaging:"Radiografia completada",editTitle:"Pedido de edicion de radiografia",newTitle:"Nuevo pedido de radiografia"},alerts:{completedTitle:"Pedido de radiografia completado",completedMessage:"El pedido de radiografia ha sido completado.",savedTitle:"Pedido de radiografia salvado",savedMessage:"El pedido de radiografia ha sido guardado."}},medication:{pageTitle:"Pedido de medicación",sectionTitle:"Medication",returnMedication:"Retorno de medicación",buttons:{dispenseMedication:"dispensar medicación",newButton:"+ nuevo pedido",returnMedication:"debolver medicacion"},titles:{completedMedication:"Medicacion completada",editMedicationRequest:"Editar pedido de medicacion",newMedicationRequest:"Nuevo pedido de medicacion"},messages:{createNew:"Crear un nuevo pedido de medicacion?",confirmDeletion:"Estas seguro de eliminar este pedido de medicación?"},labels:{ -refills:"Recargas",quantityRequested:"Cantidad solicitada",quantityDispensed:"Cantidad dispensada",quantityDistributed:"Cantidad distribuida",quantityToReturn:"Cantidad a devolver",returnLocation:"Retornar a ubicación",returnAisle:"Devolve a pasillo",returnReason:"Razon por la que se devuelve/Nota",adjustmentDate:"Fecha de ajuste",creditToAccount:"Credito a cuenta"},alerts:{returnedTitle:"Medicacion devuelta",returnedMessage:"La medicacion ha sido marcada para devolver.",savedTitle:"Pedido de medicacion guardado",savedMessage:"La elemento de medicación ha sido guardado.",fulfilledTitle:"Pedido de medicación cumplido"}},appointments:{currentScreenTitle:"Listado de citas",editTitle:"Editar cita",newTitle:"Nueva cita",sectionTitle:"Citas",thisWeek:"Citas esta semana",missed:"Citas perdidas",searchTitle:"Buscar citas",todayTitle:"Citas para hoy",messages:{deleteAppointmentMessage:"Esta seguro de eliminar esta cita?",endTimeLaterThanStart:"Seleccione una hora de finalizacion despues de la de inicio."},buttons:{newButton:"+ nueva cita"}},visits:{edit:{buttons:{newAppointment:"Nuevas citas",addDiagnosis:"Adicionar diagnostico",newProcedure:"Nuevo procedimiento",newLab:"New laboratorio",newMedication:"Nueva mediicación",newImaging:"Nueva radiografia"},labels:{diagnosis:"Diagnostico",procedure:"Procedimiento",authoredBy:"Escrito por",labs:"Laboratorios",imaging:"Radiografias",visitInformation:"Informacion de visita"}}},labs:{sectionTitle:"Laboratorios",requestsTitle:"Pedido de laboratorio",editTitle:"Editar pedido de laboratorio",newTitle:"Nuevo pedido de laboratorio",deleteTitle:"Eliminar pedido",completedTitle:"Completar laboratorio",labels:{labType:"Tipo de laboratorio",addNewVisit:"--Adicionar nueva visita--"},messages:{noItemsFound:"No boratorios encontrados.",createNewRecord:"Crear un registro?",confirmDeletion:"Esta seguro de eliminar esta solicitud de laboratorio?",noCompleted:"No elementos completados encontrados."},buttons:{newButton:"+ nuevo laboratorio"},alerts:{requestCompletedTitle:"Pedido de laboratorio competado",requestCompletedMessage:"El pedido de laboratorio ha sido completado.",requestSavedTitle:"Silicitud de laboratorio guardado",requestSavedMessage:"El pedido de laboratorio ha sido guardado."}},common:{actions:"Acciones"},patients:{notes:{onBehalfOfLabel:"A nombre de",onBehalfOfCopy:"a nombre de",pleaseSelectAVisit:"Por favor seleccione una visista",noteLabel:"Nota"}}}}),define("hospitalrun/locales/fr/translations",["exports"],function(e){e.default={dashboard:{title:"Que voulez-vous faire?"},navigation:{imaging:"Imagerie",inventory:"Inventaire",patients:"Patients",appointments:"Rendez-vous",medication:"Médicament",labs:"Labos",billing:"Facturation",administration:"Administration",subnav:{requests:"Demandes",items:"Articles",completed:"Traité",newRequest:"Nouvelle demande",inventoryReceived:"Inventaire reçu",reports:"Rapports",patientListing:"Liste des patients",newPatient:"Nouveau patient",thisWeek:"Cette semaine",today:"Aujourd'hui",search:"Rechercher",addAppointment:"Ajouter un rendez-vous",dispense:"Dispenser",returnMedication:"Retourner un Médicament",invoices:"Factures",newInvoice:"Nouvelle facture",prices:"Prix",priceProfiles:"Profils de prix",lookupLists:"Listes de référence",addressFields:"Champs d'adresse",loadDb:"Importer une BD",users:"Utilisateurs",newUser:"Nouvel utilisateur",admittedPatients:"patients admis",missed:"Manqué",userRoles:"Rôles de l'utilisateur"},actions:{logout:"Deconnexion",login:"Connexion"},about:"À propos de HospitalRun"},user:{plusNewUser:"+ nouvel utilisateur",usersPageTile:"Liste des Utilisateurs"},admin:{addressOptions:"Options d'adresse",lookupLists:"Listes de référence",loadDb:"Importer une BD",users:"Utilisateurs",address:{address1Label:"Label de l'adresse 1",address2Label:"Label de l'adresse 2",address3Label:"Label de l'adresse 3",address4Label:"Label de l'adresse 4",include1Label:"Label de l'include 1",include2Label:"Label de l'include 2",include3Label:"Label de l'include 3",include4Label:"Label de l'include 4",titles:{optionsSaved:"Options enregistrées"},messages:{addressSaved:"Les options d'adresse ont été enregistrées"},newTitle:"Options d'adresse",editTitle:"Options d'adresse",addressLabel:"Adresse"},loaddb:{progressMessage:"Veuillez patienter durant le chargement de la base de données.",progressTitle:"Chargement de la base de données en cours",displayAlertTitle:"Sélectionner le fichier à télécharger.",displayAlertMessage:"Veuillez sélectionner le fichier à télécharger.",errorDisplayAlertTitle:"Erreur de chargement",errorDisplayAlertMessage:"La base de données ne pouvait pas être importée. L'erreur etait: {{error}}",editTitle:"Importer une BD"},lookup:{alertImportListTitle:"Sélectionner le fichier à importer",alertImportListMessage:"Veuillez sélectionner le fichier à importer.",alertImportListSaveTitle:"Liste importée",alertImportListSaveMessage:"La liste de référence a été importée.",alertImportListUpdateTitle:"Liste enregistrée",alertImportListUpdateMessage:"La liste de référence a été enregistrée.",pageTitle:"Listes de référence",edit:{template:{addTitle:"Ajouter une valeur",editTitle:"Modifier la valeur",updateButtonTextAdd:"Ajouter",updateButtonTextUpdate:"Mettre à jour",labelTitle:"Valeur"}},anesthesiaTypes:"Types d'Anesthésie",anesthesiologists:"Anesthésiologistes",billingCategories:"Catégories de facturation",clinicList:"Emplacements de la clinique",countryList:"Pays",diagnosisList:"Diagnostics",cptCodeList:"Codes CPT",expenseAccountList:"Comptes de dépense",aisleLocationList:"Emplacements de rayon d'inventaire",warehouseList:"Emplacements d'inventaire",inventoryTypes:"Types d'inventaire",imagingPricingTypes:"Types de prix d'imagerie",labPricingTypes:"Types de prix de labo",patientStatusList:"Liste de statut de patient",physicianList:"Médécins",procedureList:"Procédures",procedureLocations:"Emplacements des procédures",procedurePricingTypes:"Types de prix de procédure",radiologists:"Radiologistes",unitTypes:"Types d'unité",vendorList:"Fournisseur",visitLocationList:"Emplacements de visite",visitTypes:"Types de visite",wardPricingTypes:"Types de prix de service"},roles:{capability:{admin:"Administration",loadDb:"Charger la Base de données",updateConfig:"Mettre à jour les Configurations",appointments:"Rendez-vous",addAppointment:"Ajouter un Rendez-vous",billing:"Facturation",addCharge:"Ajouter une charge",addPricing:"Ajouter un Prix",addPricingProfile:"Ajouter le profil de prix",addInvoice:"Ajouter une facture",addPayment:"Ajouter un paiement",deleteInvoice:"Supprimer une facture",deletePricing:"Supprimer un Prix",deletePricingProfile:"Supprimer le profil de prix",editInvoice:"Modifier la facture",invoices:"Factures",overrideInvoice:"Remplacer la facture",pricing:"Tarification",patients:"Patients",addDiagnosis:"Ajouter un diagnostic",addPhoto:"Ajouter une photo",addPatient:"Ajouter un patient",addVisit:"Ajouter une visite",addVitals:"Ajouter les signes vitaux",admitPatient:"Admettre un patient",deletePhoto:"Supprimer une photo",deletePatient:"Supprimer un patient",deleteAppointment:"Supprimer un rendez-vous",deleteDiagnosis:"Supprimer un diagnostic",deleteProcedure:"Supprimer une procédure",deleteSocialwork:"Supprimer un travail social",deleteVitals:"Supprimer des signes vitaux",deleteVisit:"Supprimer une Visite",dischargePatient:"Liberer un patient",patientReports:"Rapports des patients",visits:"Visites",medication:"Médicament",addMedication:"Ajouter un médicament",deleteMedication:"Supprimer un médicament",fulfillMedication:"Traiter une demande de médicaments",labs:"Test Labo",addLab:"Ajouter un test labo",completeLab:"Completer un test labo",deleteLab:"Supprimer un test labo",imaging:"Imagerie",addImaging:"Ajouter une imagerie",completeImaging:"Completer une imagerie",deleteImaging:"Supprimer une Imagerie",inventory:"Inventaire",addInventoryRequest:"Ajouter une demande d'inventaire",addInventoryItem:"Ajouter un article d'inventaire",addInventoryPurchase:"Ajouter un achat d'inventaire",adjustInventoryLocation:"Ajuster la localisation de l'inventaire",deleteInventoryItem:"Supprimer un article d'inventaire",deleteInventoryPurchase:"Supprimer un achat d'inventaire",fulfillInventory:"Traiter l'inventaire",defineUserRoles:"Rôles d'utilisateur"},messages:{roleSaved:"Le rôle {{roleName}} a été enregistré."},titles:{roleSaved:"Rôle enregistré"}}},labels:{cptcode:"Code CPT",loading:"Chargement",name:"Nom",patient:"Patient",prescriber:"prescripteur",quantity:"Quantité",requestedOn:"Demandé le",date:"Date",dateOfBirth:"Date de naissance",dateOfBirthShort:"DdN",dateRequested:"Date de demande",dateCompleted:"Date de traitement",description:"Description",requestedBy:"Demandé par",fulfill:"Traiter",fulfillRequest:"Traiter la demande",fulfillRequestNow:"Traiter la demande maintenant",actions:"Actions",action:"Action",notes:"Notes",edit:"Modifier",imageOrders:"Demandes d'imagerie",labOrders:"Demandes de labo",imagingType:"Type d'imagerie",result:"Resultat",results:"Resultats",visit:"Visite",requests:"Demandes",completed:"Traité",id:"Id",on:"sur",type:"Type",sex:"Sexe",age:"Age",username:"Nom d'utilisateur",email:"Email",role:"Rôle",delete:"Supprimer",userCanAddNewValue:"Utilisateur peut ajouter de nouvelles valeurs",value:"Valeur",lookupType:"Type de référence",importFile:"Importer un fichier",fileLoadSuccessful:"Téléchargement reussi",fileToLoad:"Téléchargement de fichier",startTime:"Heure de debut",startDate:"Date de debut",endTime:"Heure de fin",endDate:"Date de fin",docRead:"Documents lus",docWritten:"Documents écrits",displayName:"Nom à afficher",password:"Mot de passe",editUser:"Modifier un utilisateur",newUser:"Nouvel utilisateur",deleteUser:"Supprimer un utilisateur",medication:"Médicament",status:"Statut",addNewOutpatientVisit:"--Ajouter une nouvelle consultation externe--",prescription:"Ordonnance",prescriptionDate:"Date de prescription",billTo:"Facturer à",pullFrom:"Tirer de",fulfilled:"Traité",deleteRequest:"Supprimer la demande",location:"Emplacement",provider:"Fournisseur",with:"Avec",allDay:"Toute la journée",physician:"Médecin",assisting:"Assistant",anesthesia:"Anesthésie",procedures:"Procédures"},messages:{noItemsFound:"Aucun article retrouvé.",noHistoryAvailable:"Aucune historique disponible.",createNewRecord:"Créer un nouveau dossier?",createNewUser:"Créer un nouvel utilisateur?",noUsersFound:"Aucun utilisateur retrouvé.",areYouSureDelete:"Êtes-vous sûr de vouloir supprimer l'utilisateur {{user}}?",userHasBeenSaved:"L'utilisateur a été enregistré.",userSaved:"Utilisateur enregistré",onBehalfOf:"de la part de",newPatientHasToBeCreated:"Un nouveau patient doit être crée...Veuillez attendre...",noNotesAvailable:"Aucune note clinique supplémentaire disponible pour cette visite.",sorry:"Désolé, quelque chose a mal tourné ...",forAuthorizedPersons:"Ce rapport est destiné uniquement aux personnes autorisées."},alerts:{pleaseWait:"Veuillez attendre"},buttons:{complete:"Traiter",cancel:"Annuler",close:"Fermer",returnButton:"Retourner",barcode:"Code barre",add:"Ajouter",update:"Mettre à jour",ok:"Ok",fulfill:"Traiter",remove:"Retirer",delete:"Supprimer",newUser:"Nouvel utilisateur",addValue:"Ajouter une valeur",newNote:"Nouvelle note",import:"Importer",loadFile:"Télécharger le fichier",newRequest:"Nouvelle demande",allRequests:"Toutes les demandes",dispense:"Dispenser",newItem:"+ nouvel article",newRequestPlus:"+ nouvelle demande",addVisit:"Ajouter une visite",search:"Rechercher"},login:{messages:{signIn:"veuillez-vous connecter",error:"Nom d'utilisateur ou mot de passe est incorrect."},labels:{password:"Mot de passe",username:"Nom d'utilisateur",signIn:"Connexion"}},inventory:{edit:{cost:"Coût par unité:",delivered:"Livré à:",location:"Emplacement ajusté:",prescription:"Ordonnance pour:",pulled:"Tiré de:",quantity:"Quantité après traitement:",reason:"Motif:",returned:"Retourné par le patient:",transferredFrom:"Transféré de:",transferredTo:"Transféré à:"},labels:{action:"Action",add:"Ajouter",adjust:"Ajuster",adjustmentDate:"Date d'ajustement",adjustmentFor:"Ajustement pour",adjustmentType:"Type d'ajustement",aisle:"Rayon",aisleLocation:"Emplacement du rayon",allInventory:"Toute l'inventaire",billTo:"Facturer à",consumePurchases:"Utiliser les achats",consumptionRate:"Taux d'utilisation",cost:"Coût",costPerUnit:"Coût par unité",crossReference:"Reference",currentQuantity:"Quantité actuelle",dateCompleted:"Date de traitement",dateEffective:"Date d'effet",dateEnd:"Date de fin",dateStart:"Date de debut",dateReceived:"Date de réception",dateTransferred:"Date de transfert",daysLeft:"Nombre de jours restant",deliveryAisle:"Rayon de livraison",deliveryLocation:"Emplacement de livraison",distributionUnit:"Unité de distribution",deleteItem:"Supprimer l'article",details:"Détails",editItem:"Modifier l'article",expense:"Dépenses pour",expirationDate:"Date d'expiration",fulfillRequest:"Traiter la demande",fulfillRequestNow:"Traiter la demande maintenant",gift:"Don en nature",giftUsage:"Utilisation de don en nature",giftInKindNo:"N",giftInKindYes:"O",inventoryConsumed:"Inventaire utilisé",inventoryItem:"Article à inventorier",inventoryObsolence:"Inventory Obsolence",invoiceItems:"Articles de facture",invoiceLineItem:"Article de facture",invoiceNumber:"Numero de facture",item:"Article",items:"Articles",itemNumber:"Numero d'article",location:"Emplacement",locations:"Emplacements",name:"Nom",markAsConsumed:"Marqué comme utilisé",newItem:"Nouvel article",originalQuantity:"Quantité originale",print:"Imprimer",printBarcode:"Imprimer le code barre",printer:"Imprimante",pullFrom:"Tirer de",purchases:"Achats",purchaseCost:"Coût d'achat",purchaseInfo:"Détails de l'achat",quantity:"Quantité ({{unit}})",quantityAvailable:"Quantité disponible",quantityOnHand:"Quantité en main",quantityRequested:"Quantité demandée",rank:"Rang",reason:"Motif",remove:"Retirer",reorderPoint:"Point de commande",requestedItems:"Articles demandés",salePricePerUnit:"Prix de vente unitaire",save:"Enregistrer",serialNumber:"Numéro de série / lot",total:"Total",totalCost:"Coût total",totalReceived:"Total reçu: {{total}}",transaction:"Transaction",transactions:"Transactions",transfer:"Transférer",transferFrom:"Transféré de",transferTo:"Transférer à l'emplacement",transferToAisle:"Transférer à l'emplacement du rayon",unit:"Unité",unitCost:"Coût unitaire",vendor:"Fournisseur",vendorItemNumber:"Numéro d'article fournisseur",xref:"XRef"},messages:{adjust:"Veuillez ajuster les quantités sur le ou les emplacement(s) appropriée(s) pour tenir compte de la différence de {{difference}}.",createRequest:"Créer une nouvelle demande?",delete:"Etes-vous sûr que vous souhaitez supprimer {{name}}?",itemNotFound:"L'article d'inventaire {{item}} ne pouvait pas être retrouvé.
Si vous voulez créer un nouvel article d'inventaire, veuillez saisir les informations ci-dessous.
Sinon, appuyez sur le bouton Annuler pour retourner.",loading:"Chargement des transactions en cours…",purchaseSaved:"Les achats d'inventaire ont été enregistrés avec succès.",noRequests:"Aucune demande retrouvée.",noItems:"Aucun article retrouvé.",quantity:"La quantité totale de ({{quantity}}) ne correspond pas à la quantité totale dans les emplacements ({{locationQuantity}}).",removeItem:"Etes-vous sûr de vouloir retirer cet article de cette facture?",removeItemRequest:"Etes-vous sûr de vouloir supprimer cet article de cette demande?",requestFulfilled:"La demande d'inventaire a été traitée.",requestUpdated:"La demande d'inventaire a été mis à jour.",warning:"Veuillez remplir les champs obligatoires (marqués d'un *) et corriger les erreurs avant d'ajouter."},reports:{rows:{adjustments:"Ajustements",adjustmentsTotal:"Ajustements totaux",balanceBegin:"Solde d'ouverture",balanceEnd:"Solde de clôture",category:"Catégorie",consumed:"Utilisé",consumedGik:"GiK utilisé",consumedGikTotal:"GiK total utilisé",consumedPuchases:"Achats utilisés",consumedPurchasesTotal:"Achats totaux utilisés",consumedTotal:"Total utilisé",errInFinSum:"Erreur dans _generateFinancialSummaryReport: ",errInFindPur:"Erreur dans _findInventoryItemsByPurchase: ",errInFindReq:"Erreur dans _findInventoryItemsByRequest: ",expensesFor:"Dépenses pour: ",noAccount:"(Pas de compte)",subtotal:"Sous-total: ",subtotalFor:"Sous-total pour {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total pour {{var}}: ",totalPurchases:"Achats totaux",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} A: {{target}}"},adjustment:"Ajustement détaillée",daysSupply:"Stock restant (en nombre de jours)",expenseDetail:"Détails des dépenses",expenseSum:"Résumé des dépenses",expiration:"Date d'expiration",export:"Exporter un rapport",fields:"Champs à inclure",finance:"Résumé des finances",generate:"Créer un rapport",invLocation:"Inventaire par emplacement",invValuation:"Valorisation de l'inventaire",purchaseDetail:"Détails de l'achat",purchaseSum:"Résumé de l'achat",reportType:"Type de rapport",stockTransferDetail:"Transfert détaillé du stock",stockTransferSum:"Résumé du transfert du stock",stockUsageDetail:"Utilisation détaillée du stock",stockUsageSum:"Résumé de l'utilisation du stock"},titles:{addPurchase:"Ajouter un achat",addRequest:"Nouvelle demande",adjustment:"Ajustement",editPurchase:"Modifier l'achat",editRequest:"Modifier la demande",inventoryItem:"Nouvel article d'inventaire",inventoryReport:"Rapport d'inventaire",purchaseSaved:"Achats d'inventaire enregistrés",quickAddTitle:"Nouvel article d'inventaire",removeItem:"Retirer l'article",requestFulfilled:"Demande traitée",requestUpdated:"Demande mis à jour",transfer:"Transférer les articles",warning:"Attention!!!!!"}},imaging:{pageTitle:"Demandes d'imagerie",sectionTitle:"Imagerie",buttons:{newButton:"+ nouvelle imagerie"},labels:{radiologist:"Radiologiste",addNewVisit:"--Ajouter une nouvelle visite--"},messages:{noCompleted:"Aucun article traité retrouvé."},titles:{completedImaging:"Imagerie traitée",editTitle:"Modifier la demande d'imagerie",newTitle:"Nouvelle demande d'imagerie"},alerts:{completedTitle:"Demande d'imagerie traitée",completedMessage:"La demande d'imagerie a été traitée.",savedTitle:"Demande d'imagerie enregistrée",savedMessage:"La demande d'imagerie a été enregistrée."}},medication:{pageTitle:"Demandes de médicament",sectionTitle:"Médicament",returnMedication:"Retourner un médicament",buttons:{dispenseMedication:"dispenser un médicament",newButton:"+ nouvelle demande",returnMedication:"retourner un médicament"},titles:{completedMedication:"Médicament traitée",editMedicationRequest:"Modifier une demande de médicament",newMedicationRequest:"Nouvelle demande de médicament"},messages:{createNew:"Créer une nouvelle demande de médicament?",confirmDeletion:"Êtes-vous sûr de vouloir supprimer cette demande de médicaments?"},labels:{refills:"Renouvellements",quantityRequested:"Quantité demandé",quantityDispensed:"Quantité dispensé",quantityDistributed:"Quantité distribué",quantityToReturn:"Quantité à retourner",returnLocation:"Emplacement de retour",returnAisle:"Rayon de retour",returnReason:"Motif/notes du retour",adjustmentDate:"Date d'ajustement",creditToAccount:"Créditer le compte"},alerts:{returnedTitle:"Médicament retourné",returnedMessage:"Le médicament a été marqué comme retourné.",savedTitle:"Demande de médicament enregistrée",savedMessage:"Le dossier de médicament a été enregistré.",fulfilledTitle:"Demande de médicament traitée"}},appointments:{currentScreenTitle:"Liste des rendez-vous",editTitle:"Modifier le rendez-vous",newTitle:"Nouveau rendez-vous",sectionTitle:"Rendez-vous",thisWeek:"Rendez-vous de la semaine",missed:"Rendez-vous manqués",searchTitle:"Rechercher les rendez-vous",todayTitle:"Rendez-vous d'aujourd'hui",messages:{deleteAppointmentMessage:"Etes-vous sûr de vouloir supprimer ce rendez-vous?",endTimeLaterThanStart:"Veuillez sélectionnez une heure de fin plus tard que l'heure de début."},buttons:{newButton:"+ nouveau rendez-vous"}},visits:{edit:{buttons:{newAppointment:"Nouveau rendez-vous",addDiagnosis:"Ajoute un diagnostic",newProcedure:"Nouvelle procédure",newLab:"Nouveau labo",newImaging:"Nouvelle imagerie",newMedication:"Nouveau médicament"},labels:{diagnosis:"Diagnostic",procedure:"Procédure",authoredBy:"Crée par",labs:"Labos",imaging:"Imagerie",visitInformation:"Détails de la visite"}}},labs:{sectionTitle:"Labos",requestsTitle:"Demandes de labo",editTitle:"Modifier la demande de labo",newTitle:"Nouvelle demande de labo",deleteTitle:"Supprimer la demande",completedTitle:"Labos traités",labels:{labType:"Type de labo",addNewVisit:"--Ajouter une nouvelle visite--"},messages:{noItemsFound:"Aucun labo retrouvé.",createNewRecord:"Créer un nouveau dossier?",confirmDeletion:"Etes-vous sûr de vouloir supprimer cette demande de labo?",noCompleted:"Aucun article traité retrouvé."},buttons:{newButton:"+ nouveau labo"},alerts:{requestCompletedTitle:"Demande de labo traitée",requestCompletedMessage:"La demande de labo a été traitée.",requestSavedTitle:"Demande de labo enregistrée",requestSavedMessage:"La demande de labo a été enregistrée."}},common:{actions:"Actions"},patients:{notes:{onBehalfOfLabel:"De la part de",onBehalfOfCopy:"de la part de",pleaseSelectAVisit:"Veuillez sélectionner une visite",noteLabel:"Note"}}}}),define("hospitalrun/locales/pt-BR/translations",["exports"],function(e){e.default={dashboard:{title:"O que você gostaria de fazer?"},errors:{inclusion:"não está na lista",exclusion:"é reservado",invalid:"é inválido",confirmation:"{{attribute}} não corresponde",accepted:"deve ser aceito",empty:"não pode ser vazio",blank:"não pode ser branco",present:"pode ser branco",tooLong:"é muito longo (quantidade máxima de caracteres é {{count}} )",tooShort:"é muito curta (quantidade mínima de caracteres é {{count}})",wrongLength:"o tamanho está errado (são esperados {{count}} caracteres)",notANumber:"não é um número",notAnInteger:"deve ser um número inteiro",greaterThan:"deve ser maior do que {{count}}",greaterThanOrEqualTo:"deve ser maior ou igual à {{count}}",equalTo:"deve ser igual à {{count}}",lessThan:"deve ser menor do que {{count}}",lessThanOrEqualTo:"deve ser menor ou igual à {{count}}",otherThan:"deve ser diferente de {{count}}",odd:"deve ser ímpar",even:"deve ser até",invalidNumber:"número não é valido"},navigation:{imaging:"Imagem",inventory:"Inventário",patients:"Pacientes",appointments:"Compromisso",medication:"Medicação",labs:"Laboratórios",billing:"Faturamento",administration:"Administração",subnav:{actions:"Ações",requests:"Requisições",items:"Itens",completed:"Concluídos",newRequest:"Nova Requisição",inventoryReceived:"Inventário Recebido",reports:"Relatórios",patientListing:"Lista de Pacientes",newPatient:"Novo Paciente",thisWeek:"Essa Semana",today:"Hoje",search:"Pesquisa",addAppointment:"Adicionar Compromisso",dispense:"Dispensar",returnMedication:"Retorno de Medicação",invoices:"Faturas",newInvoice:"Nova Fatura",prices:"Preços",priceProfiles:"Perfis de Preços",lookupLists:"Listas de Pesquisa",addressFields:"Campos de Endereço",loadDB:"Carregar BD",users:"Usuários",newUser:"Novo Usuário",admittedPatients:"Pacientes Admitidos",missed:"Perdidos",userRoles:"Perfis de Usuário",workflow:"Workflow"},actions:{logout:"Sair",login:"Entrar"},about:"Sobre HospitalRun"},user:{plusNewUser:"+ novo usuário",usersPageTile:"Lista de Usuários"},admin:{addressOptions:"Opções de Endereço",lookupLists:"Lista de Pesquisas",loadDb:"Carregar DB",userRoles:"Perfis de Usuários",users:"Usuários",address:{address1Label:"Rótulo Endereço 1",address2Label:"Rótulo Endereço 2",address3Label:"Rótulo Endereço 3",address4Label:"Rótulo Endereço 4",include1Label:"Rótulo Include 1",include2Label:"Rótulo Include 2",include3Label:"Rótulo Include 3",include4Label:"Rótulo Include 4",titles:{optionsSaved:"Opções Salvas"},messages:{addressSaved:"As opções de endereço foram salvas"},newTitle:"Opções de Endereço",editTitle:"Opções de Endereço",addressLabel:"Endereço"},loaddb:{progressMessage:"Por favor aguarde enquanto o seu banco de dados é carregado.",progressTitle:"Carregando Banco de Dados",displayAlertTitle:"Selecione o Arquivo para Carregar",displayAlertMessage:"Por favor Selecione o Arquivo para Carregar.",errorDisplayAlertTitle:"Erro ao carregar",errorDisplayAlertMessage:"O banco de dados não foi carregado. O erro foi: {{error}}",editTitle:"Carregando BD"},lookup:{alertImportListTitle:"Selecione o arquivo para importação",alertImportListMessage:"Por favor Selecione o arquivo para importação.",alertImportListSaveTitle:"Lista Importdada",alertImportListSaveMessage:"A lista de pesquisa foi importada.",alertImportListUpdateTitle:"Lista Salva",alertImportListUpdateMessage:"A lista de pesquisa foi salva.",pageTitle:"Listas de Pesquisa",edit:{template:{addTitle:"Adicionar Valor",editTitle:"Editar Valor",updateButtonTextAdd:"Adicionar",updateButtonTextUpdate:"Atualizar",labelTitle:"Valor"}},anesthesiaTypes:"Tipos de Anestesia",anesthesiologists:"Anestesiologista",billingCategories:"Categorias de Faturamento",clinicList:"Localização de Clínicas",countryList:"Países",diagnosisList:"Diagnósticos",cptCodeList:"Códigos CPT",expenseAccountList:"Contas de Despesas",aisleLocationList:"Localização de Corredores no Inventário",warehouseList:"Locais de Inventário",inventoryTypes:"Tipos de Inventário",imagingPricingTypes:"Tipos de Preço Imagem",labPricingTypes:"Tipos de Preço Laboratório",patientStatusList:"Lista de Situação do Paciente",physicianList:"Médicos",procedureList:"Procedimentos",procedureLocations:"Localização de Procedimentos",procedurePricingTypes:"Tipos de Preço Procedimento",radiologists:"Radiologista",unitTypes:"Tipos de Unidade",vendorList:"Fornecedor",visitLocationList:"Localização dos Visitantes",visitTypes:"Tipos de Visita",wardPricingTypes:"Tipos de Preços Enfermaria"},roles:{capability:{admin:"Administração",loadDb:"Carregar Banco de Dados",updateConfig:"Atualizar Configurações",appointments:"Compromissos",addAppointment:"Adicionar Compromissos",billing:"Faturamentos",addCharge:"Adicionar Cobrança",addPricing:"Adicionar Preço",addPricingProfile:"Adicionar Perfil de Preço",addInvoice:"Adicionar Fatura",addPayment:"Adicionar Pagamentos",deleteInvoice:"Excluir Fatura",deletePricing:"Excluir Preço",deletePricingProfile:"Excluir Perfil de Preço",editInvoice:"Editar Fatura",invoices:"Faturas",overrideInvoice:"Substituir Fatura",pricing:"Preço",patients:"Pacientes",addDiagnosis:"Adicionar Diagnóstico",addPhoto:"Adicionar Foto",addPatient:"Adicionar Paciente",addProcedure:"Adicionar Procedimento",addVisit:"Adicionar Visita",addVitals:"Adicionar Sinais Vitais",admitPatient:"Admitir Paciente",deletePhoto:"Excluir Paciente",deletePatient:"Excluir Paciente",deleteAppointment:"Excluir Compromisso",deleteDiagnosis:"Excluir Diagnóstico",deleteProcedure:"Excluir Procedimento",deleteSocialwork:"Excluir Trabalho Social",deleteVitals:"Excluir Sinais Vitais",deleteVisit:"Excluir Visita",dischargePatient:"Alta do Paciente",patientReports:"Relatório do Paciente",visits:"Visita",medication:"Medicação",addMedication:"Adicionar Medicação",deleteMedication:"Excluir Medicação",fulfillMedication:"Preencher Medicação",labs:"Laboratório",addLab:"Adicionar Laboratório",completeLab:"Laboratório Concluído",deleteLab:"Excluir Laboratório",imaging:"Imagem",addImaging:"Adicionar Imagem",completeImaging:"Imagem Concluída",deleteImaging:"Excluir Imagem",inventory:"Inventário",addInventoryRequest:"Adicionar Requisição de Inventário",addInventoryItem:"Adicionar Item de Inventário",addInventoryPurchase:"Adicionar Compra de Inventário",adjustInventoryLocation:"Ajustar Localização de Inventário",deleteInventoryItem:"Excluir Item de Inventário",fulfillInventory:"Preencher Inventário",defineUserRoles:"Perfis de Usuários"},messages:{roleSaved:"O perfil {{roleName}} foi salvo."},titles:{roleSaved:"Perfil Salvo"}},workflow:{admissionDepositLabel:"Depósito de Admissão é exigido",clinicPrepaymentLabel:"Pagamento Antecipado da Clínica é exigido",followupPrepaymentLabel:"Pagamento Antecipado do Acompanhamento é exigido",outpatientLabLabel:"Pagamento Antecipado do Laboratório Ambulatorial é exigido",outpatientImagingLabel:"Pagamento Antecipado do Ambulatorio de Imagem é exigido",outpatientMedicationLabel:"Pagamento Antecipado do Ambulatorio de Medicação é exigido",titles:{optionsSaved:"Opções Salvas"},messages:{optionsSaved:"As opções de WorkFlow foram salvas"},newTitle:"Opções de Workflow",editTitle:"Opções de Workflow",workflowLabel:"Workflow"}},labels:{cptcode:"Código CPT*",loading:"Carregando",name:"Nome",note:"Note",patient:"Paciente",prescriber:"Médico Responsável pela Prescrição",quantity:"Quantidade",requestedOn:"Solicitado em",date:"Data",dateOfBirth:"Data de Nascimento",dateOfBirthShort:"DtNasc",dateRequested:"Data da Requisição",dateCompleted:"Data da Conclusão",description:"Descrição",requestedBy:"Requisitado por",fulfill:"Preencha",fulfillRequest:"Preencha a Requisição",fulfillRequestNow:"Preencha a Requisição Agora",actions:"Ações",action:"Ação",notes:"Notas",edit:"Editar",imageOrders:"Pedido de Imagem",labOrders:"Pedidos de Laboratório",imagingType:"Tipo de Imagem",result:"Resultado",results:"Resultados",visit:"Visita",requests:"Requisições",completed:"Completo",id:"Id",on:"ligado",type:"Tipo",sex:"Sexo",age:"Idade",search:"Pesquisa",username:"Usuário",email:"Email",role:"Papel",delete:"Excluir",userCanAddNewValue:"O usuário pode adicionar novos valores",value:"Valor",lookupType:"Tipo de Pesquisa",importFile:"Importar Arquivo",fileLoadSuccessful:"Arquivo Carregado com Sucesso",fileToLoad:"Carregar Arquivo",startTime:"Hora Início",startDate:"Data de Início",endTime:"Hora de Término",endDate:"Data de Término",docRead:"Documentos Lidos",docWritten:"Documentos Escritos",displayName:"Nome de Exibição",password:"Senha",editUser:"Editar Usuário",newUser:"Novo Usuário",deleteUser:"Excluir Usuário",medication:"Medicação",status:"Situação",addNewOutpatientVisit:"--Adicionar Nova Visita Ambulatorial--",prescription:"Prescrição",prescriptionDate:"Data da Prescrição",billTo:"Conta Para",pullFrom:"Puxar De",fulfilled:"Preenchido",deleteRequest:"Excluir Requisição",location:"Localização",provider:"Fornecedor",with:"Com",allDay:"Todo Dia",physician:"Médico",assisting:"Ajudante",anesthesia:"Anestesia",procedures:"Procedimentos",number:"Número",billDate:"Data da Conta",balanceDue:"Saldo Devedor",amount:"Quantidade",datePaid:"Data de Pagamento",creditTo:"Crédito Para",invoiceId:"ID da Fatura",lineItems:"Itens de Linha",discount:"Desconto",excess:"Excesso",price:"Preço",total:"Total",expenseTo:"Despesa Para",grandTotal:"Total Geral",remarks:"Observações",payments:"Pagamentos",category:"Categoria",department:"Departamento",address:"Endereço",country:"País"},messages:{noItemsFound:"Nenhum item encontrado",noHistoryAvailable:"Histórico não disponível.",createNewRecord:"Criar uma nova gravação?",createNewUser:"Criar um novo usuário?",noUsersFound:"Nenhum usuário encontrado.",areYouSureDelete:"Você tem certeza que deseja excluir o usuário {{user}}?",userHasBeenSaved:"O usuário foi salvo.",userSaved:"Usuário Salvo",onBehalfOf:"em nome de",newPatientHasToBeCreated:"Um novo paciente precisa ser criado... Por favor aguarde...",noNotesAvailable:"Nenhuma nota clinica adicional está diponível para essa visita.",sorry:"Desculpe, algo deu errado...",forAuthorizedPersons:"Este relatório é somente para pessoas autorizadas."},alerts:{pleaseWait:"Por Favor Aguarde"},headings:{chargedItems:"Itens Carregados"},buttons:{addItem:"Adicionar Item",complete:"Completo",cancel:"Cancelar",close:"Fechar",returnButton:"Retornar",barcode:"Código de Barras",add:"Adicionar",update:"Atualizar",ok:"Ok",fulfill:"Preencher",remove:"Remover",delete:"Excluir",newUser:"Novo Usuário",addValue:"Adicionar Valor",newNote:"Nova Nota",import:"Importar",loadFile:"Carregar Arquivo",newRequest:"Nova Requisição",allRequests:"Todas as Requisições",dispense:"Dispensar",newItem:"+ novo item",newRequestPlus:"+ nova requisição",addVisit:"Adicionar Visita", -search:"Pesquisa",edit:"Editar",addLineItem:"Adicionar Item de Linha"},login:{messages:{signIn:"inscreva-se",error:"Nome de usuário ou senha está incorreta."},labels:{password:"Senha",username:"Usuário",signIn:"Entrar"}},loading:{progressBar:{progress:"{{progressBarValue}}% concluído"},messages:{0:"A velocidade de vôo borboleta superior é de 12 milhas por hora. Alguns meses pode voar 25 milhas por hora!",1:"As corujas são os únicos pássaros que podem ver a cor azul.",2:"Os gatos têm mais de 100 sons vocais; cachorros têm apenas 10.",3:"Os Humanos usam um total de 72 músculos diferentes na fala.",4:"Mais de 1.000 idiomas diferentes são falados no continente africano",5:"Uma eritrofobo é alguém que fica vermelho facilmente.",6:"A fobia mais comum do mundo é a Odinofobia que é o medo da dor.",7:"Seu corpo utiliza 300 músculo para manter o equilíbrio quando você está parado.",8:"Alguns sapos podem ser congelados e depois de serem descongelados continuarem a viver.",9:"Nossos olhos estão sempre do mesmo tamanho de quando nascemos, mas nossas orelhas e nariz nunca param de crescer.",10:"Sua língua é o único músculo em seu corpo qu está ligado apenas em uma extremidade.",11:"Camelos tem três pálpebras para se protegerem das tempestades de areia."}},inventory:{edit:{cost:"Preço por Unidade:",delivered:"Entregue a:",location:"Localização Ajustada:",prescription:"Prescrição para:",pulled:"Retirado de:",quantity:"Quantidade na Conclusão:",reason:"Motivo:",returned:"Devolvido do Paciente:",transferredFrom:"Transferido de:",transferredTo:"Transferido para:"},labels:{action:"Ação",add:"Adicionar",adjust:"Ajustar",adjustmentDate:"Data de Ajuste",adjustmentFor:"Ajuste Para",adjustmentType:"Tipo de Ajuste",aisle:"Corredor",aisleLocation:"Localização do Corredor",allInventory:"Todo Inventário",billTo:"Conta Para",consumePurchases:"Compras para Consumo",consumptionRate:"Taxa de Consumo",cost:"Preço",costPerUnit:"Preço por Unidade",crossReference:"Referência Cruzada",currentQuantity:"Quantidade Atual",dateCompleted:"Data de Conclusao",dateEffective:"Data Efetiva",dateEnd:"Data de Término",dateStart:"Data de Início",dateReceived:"Data Recebida",dateTransferred:"Data Transferida",daysLeft:"Dias Restantes",deliveryAisle:"Corredor de Entrega",deliveryLocation:"Local de Entrega",distributionUnit:"Centro de Distribuição",deleteItem:"Deletar Item",details:"Detalhes",editItem:"Editar Item",expense:"Despesa para",expirationDate:"Data de Expiração",fulfillRequest:"Preencher Requisição",fulfillRequestNow:"Preencher Requisição Agora",gift:"Doação em Espécie",giftUsage:"Uso de Doação em Espécie",giftInKindNo:"N",giftInKindYes:"S",inventoryConsumed:"Inventário Consumido",inventoryItem:"Item de Inventário",inventoryObsolence:"Obsolescência de Inventário",invoiceItems:"Itens da Fatura",invoiceLineItem:"Item de Linha da Fatura",invoiceNumber:"Número da Fatura",item:"Item",items:"Itens",itemNumber:"Número de Item",location:"Localização",locations:"Localizações",name:"Nome",markAsConsumed:"Marcar como Consumido",newItem:"Novo Item",allItems:"Todos os Itens",originalQuantity:"Quantidade Original",print:"Imprimir",printBarcode:"Imprimir Código Barras",printer:"Impressora",pullFrom:"Retirar de",purchases:"Compras",purchaseCost:"Custo da Compra",purchaseInfo:"Informações da Compra",quantity:"Quantity ({{unit}})",quantityAvailable:"Quantity Available",quantityOnHand:"Quantidade on Hand",quantityRequested:"Quantidade Solicitada",rank:"Classificação",reason:"Motivo",remove:"Remover",reorderPoint:"Ponto de Reabastecimento",requestedItems:"Itens Solicitados",salePricePerUnit:"Preço de Venda por Unidade",save:"Salvar",serialNumber:"Lote/Número de Série",total:"Total",totalCost:"Preço Total",totalReceived:"Total Recebido: {{total}}",transaction:"Transação",transactions:"Transações",transfer:"Transferir",transferFrom:"Transferir de",transferTo:"Transferir para Localização",transferToAisle:"Transferir para Localização de Corredor",unit:"Unidade",unitCost:"Preço Unitário",vendor:"Fornecedor",vendorItemNumber:"Número de Item do Fornecedor",xref:"RefX"},messages:{adjust:"Por favor ajustar as quantidades no(s) local(is) apropriado(s) da conta para a diferença de {{difference}}.",createRequest:"Criar uma nova requisição?",delete:"Você tem certeza que deseja excluir {{name}}?",itemNotFound:"O item de inventário {{item}} não pode ser encontrado.
Se você quiser criar um novo item de inventário, preencha as informações abaixo.
Caso o contrário, pressione o botão Cancelar para voltar.",loading:"Carregando transações ...",purchaseSaved:"As compras de inventário foram salvas com sucesso.",noRequests:"Nenhuma requisição encontrada.",noItems:"Nenhum item encontrado.",quantity:"A quantidade total de ({{quantity}}) não corresponde com a quantidade total nas localizações({{locationQuantity}}).",removeItem:"Você tem certeza de que deseja remover este item desta fatura?",removeItemRequest:"Você tem certeza de que deseja remover este item desta requisição?",requestFulfilled:"A requisição de invenário foi preenchida.",requestUpdated:"A requisição de invenário foi atualizada.",warning:"Por favor preencher campos obrigatório (marcado(s) com *) e corrija os erros antes de adicionar."},reports:{rows:{adjustments:"Ajustes",adjustmentsTotal:"Total dos Ajustes",balanceBegin:"Balanço Inicial",balanceEnd:"Balanço Final",category:"Categoria",consumed:"Consumidos",consumedGik:"Doações Consumidas",consumedGikTotal:"Total Doações Consumidas",consumedPuchases:"Compras Consumidas",consumedPurchasesTotal:"Total Compras Consumidas",consumedTotal:"Total Consumido",errInFinSum:"Erro em _generateFinancialSummaryReport: ",errInFindPur:"Erro em _findInventoryItemsByPurchase: ",errInFindReq:"Erro em _findInventoryItemsByRequest: ",expensesFor:"Despesas para: ",noAccount:"(Sem Conta)",subtotal:"Subtotal: ",subtotalFor:"Subtotal para {{category}} - {{account}}: ",total:"Total: ",totalFor:"Total para {{var}}: ",totalPurchases:"Total de Compras",transfer1:"{{quantity}} de {{location}}",trasnfer2:"De: {{source}} Para: {{target}}"},adjustment:"Ajuste Detalhado",daysSupply:"Dias de Abastecimento Deixado no Estoque",expenseDetail:"Despesas Detalhadas",expenseSum:"Sumário de Despesas",expiration:"Data de Expiração",export:"Exportar Relatório",fields:"Campos para Incluir",finance:"Sumário Financeiro",generate:"Gerar Relatório",invLocation:"Inventário por Localização",invValuation:"Valorização do Inventário",purchaseDetail:"Compras Detalhadas",purchaseSum:"Sumário de Compras",reportType:"Tipo de Relatório",stockTransferDetail:"Tranferências de Estoque Detalhadas",stockTransferSum:"Sumário de Tranferências de Estoque",stockUsageDetail:"Uso de Estoque Detalhado",stockUsageSum:"Sumário de Uso de Estoque"},titles:{addPurchase:"Adicionar Compra",addRequest:"Nova Requisição",adjustment:"Ajuste",editPurchase:"Editar Compra",editRequest:"Editar Requisição",inventoryItem:"Novo Item de Inventário",inventoryReport:"Relatório de Inventário",purchaseSaved:"Compras de Invenários Salvas",quickAddTitle:"Novo Item de Inventário",removeItem:"Remover Item",requestFulfilled:"Requisição Preenchida",requestUpdated:"Requisição Atualizada",transfer:"Itens de Transferência",warning:"Atenção!!!!!"}},imaging:{pageTitle:"Requisição de imagens",sectionTitle:"Imagem",buttons:{newButton:"+ nova imagem"},labels:{radiologist:"Radiologista",addNewVisit:"--Adicionar novo visitante--"},messages:{delete:"Você tem certeza que deseja excluir essa requisição de imagem?",noCompleted:"Nenhum item completo encontrado."},titles:{completedImaging:"Imagem completa",editTitle:"Requisição de edição de imagem",newTitle:"Nova requisição de imagem"},alerts:{completedTitle:"Requisição de Imagem Completa",completedMessage:"A requisição de imagem esta completa.",savedTitle:"Requisição de imagem salva",savedMessage:"A requisição de imagem foi salva."}},medication:{pageTitle:"Requisição de Medicação",sectionTitle:"Medicação",returnMedication:"Retorno de Medicação",buttons:{dispenseMedication:"dispensar medicação",newButton:"+ nova requisição",returnMedication:"retorno de medicação"},titles:{completedMedication:"Medicação Concluída",editMedicationRequest:"Editar Requisição de Medicação",newMedicationRequest:"Nova Requisição de Medicação"},messages:{createNew:"Criar uma nova requisição de medicação?",confirmDeletion:"Você tem certeza que deseja excluir essa requisição de medicação?"},labels:{refills:"Recargas",quantityRequested:"Quantidade Requisitada",quantityDispensed:"Quantidade Dispensada",quantityDistributed:"Quantidade Distribuída",quantityToReturn:"Quantidade Retornada",returnLocation:"Localização de Retorno",returnAisle:"Corredor de Retorno",returnReason:"Razão/Notas de Retorno",adjustmentDate:"Data de Ajuste",creditToAccount:"Crédito na Conta"},alerts:{returnedTitle:"Medicação Retornada",returnedMessage:"A medicação foi marcada como retornada.",savedTitle:"Requisição de Medicação foi Salva",savedMessage:"O registro de medicação foi salvo.",fulfilledTitle:"Requisição de Medicação Preenchido"}},appointments:{currentScreenTitle:"Lista de Compromisso",editTitle:"Editar Compromisso",newTitle:"Novo Compromisso",sectionTitle:"Compromissos",thisWeek:"Compromissos dessa Semana",missed:"Compromissos Esquecidos",searchTitle:"Pesquisar Compromissos",todayTitle:"Compromissos de Hoje",messages:{deleteAppointmentMessage:"Você tem certeza que deseja excluir esse compromisso?",endTimeLaterThanStart:"Por favor, selecione um horário de término mais tarde do que a hora de início."},buttons:{newButton:"+ novo compromisso"},labels:{selectedStartingDate:"Mostrar Compromisso em ou após"}},vitals:{messages:{delete:"Você tem certeza que deseja excluir esses sinais vitais?"},labels:{dateRecorded:"Data de Gravação",temperature:"Temperatura",weight:"Peso",height:"Altura",sbp:"PAS",dbp:"PAD",heartRate:"Frequência Cardíaca",respiratoryRate:"Frequência Respiratória"}},visits:{titles:{additionalDiagnoses:"Diagnósticos Adicionais"},messages:{delete:"Você tem certeza que deseja excluir essa visita?"},buttons:{newProcedure:"Novo Procedimento",newLab:"Novo Laboratório",newAppointment:"Novo Compromisso",addDiagnosis:"Adicionar Diagnóstico",newImaging:"Nova Imagem",newMedication:"Nova Medicação",newVitals:"Novos Sinais Vitais"},labels:{diagnosis:"Diagnósticos",procedure:"Procedimentos",authoredBy:"Autorizado Por",labs:"Laboratório",imaging:"Imagem",visitInformation:"Imformação de Visita",examiner:"Examinador",medication:"Medicação",status:"Situação de Visita",admittingDiagnosis:"Diagnósticos de Admisão",finalDiagnosis:"Diagnósticos de Finais/Faturamento",visitType:"Tipo de Visita",vitals:"Sinais Vitais"}},labs:{sectionTitle:"Laboratório",requestsTitle:"Requisições de Laboratório",editTitle:"Editar Requisição de Laboratório",newTitle:"Nova Requisição de Laboratório",deleteTitle:"Excluir Requisição",completedTitle:"Laboratórios Concluídos",labels:{labType:"Tipo de Laboratório",addNewVisit:"--Adicionar Nova Visita--"},messages:{noItemsFound:"Nenhum laboratório encontrado.",createNewRecord:"Criar novo registro?",confirmDeletion:"VOcê tem certeza que deseja excluir essa requisição de laboratório?",noCompleted:"Items concluídos não econtrados."},buttons:{newButton:"+ novo laboratório"},alerts:{requestCompletedTitle:"Requisições de Laboratório Concluída",requestCompletedMessage:"Requisição de laboratório foi concluída.",requestSavedTitle:"Requisição de Laboratório Salva",requestSavedMessage:"A requisição de laboratório foi salva."}},patients:{navigation:{photos:"Fotos",general:"Geral",history:"Histórico",appointments:"Compromissos",visits:"Visitas",medication:"Medicação",imaging:"Imagem",labs:"Laboratórios",socialWork:"Assitência Social"},titles:{expenses:"Despesas",additionalContacts:"Contatos Adicionais",familyInformation:"Informação Familiar",delete:"Excluir Paciente",new:"Novo Paciente",edit:"Editar Paciente",patient:"Relatório de Paciente",patientListing:"Lista de Pacientes",addPhoto:"Adicionar Foto",editPhoto:"Editar Foto",socialWork:"Despesa",familyInfo:"Informação Familiar",deleteFamilyMember:"Excluir Membro Familiar",deleteExpense:"Excluir Despesa",deletePhoto:"Excluir Foto",deleteContact:"Excluir Contato",savedPatient:"Paciente Salvo"},messages:{areYouSureDelete:"Você tem certeza que deseja excluir este(a) {{object}}?",deletePatient:"Você tem certeza que deseja excluir {{firstName}} {{lastName}}?",noPatientsFound:"Nenhum paciente encontrado.",savedPatient:"O registro de paciente para {{displayName}} foi salvo.",notFoundQuickAdd:"O paciente {{patientFullName}} não pode ser encontrato. Se você deseja cadastras um novo paciente, preencha as informações abaixo. Caso contrário clique em Cancelar para voltar.",createNewPatient:"Criar novos registro de paciente?"},buttons:{addExpense:"Adicionar Despesa",addContact:"Adicionar Contato",newLab:"Novo Laboratório",newVisit:"Nova Visita",newMedication:"Nova Medicação",newImaging:"Nova Imagem",addFamilyMember:"Adicionar Membro Familiar",newPhoto:"Nova Foto",newAppointment:"Novo Compromisso",backToPatients:"Voltar para Lista de Pacientes",newPatient:"+ novo paciente"},labels:{primaryDiagnosis:"Diagnósticos Primários",secondaryDiagnosis:"Diagnósticos Secundários",monthlyCost:"Custo Mensal",totalMontlyExpense:"Total de Despesas Mensais",patientType:"Tipo de Paciente",admissionDate:"Data de Admissão",patientDays:"Dias do Paciente",dischargeDate:"Data de Pagamento",discharge:"Pagamento",admit:"Admitir",relationships:"Relação",phone:"Telefone",email:"Email",firstName:"Primeiro Nome",middleName:"Nome do meio",lastName:"Último Nome",sex:"Sexo",dob:"DatNasc",dateOfBirth:"Data de Nascimento",placeOfBirth:"Local de Nascimento",sources:"Fontes",cost:"Custo",civilStatus:"Estado Civil",relationship:"Relação com Paciente",education:"Educação",occupation:"Ocupação",income:"Renda",insurance:"Seguro",dateProcessed:"Data de Processamento",status:"Situação do Paciente",externalPatientId:"ID de Paciente Externo",bloodType:"Tipo Sanguíneo",clinic:"Site(Filial) da Clínica",referredBy:"Indicado Por",referredDate:"Data de Indicação",religion:"Religião",parent:"Responsável Legal"},notes:{newNote:"Nova Nota para",updateNote:"Atualizando Nota de",onBehalfOfLabel:"Em Nome de",onBehalfOfCopy:"em nome de",pleaseSelectAVisit:"Por favor selecione uma visita"}},billing:{alerts:{noInvoiceFound:"Nenhuma fatura encontrada",deleteItem:"Você tem certeza que deseja excluir {{item}}?",noPricingItems:"Nenhum item de preço encontrado.",noPricingProfiles:"Nenhum perfil de preço encontrado."},buttons:{createInvoice:"Criar nova fatura?",addOverride:"Adicionar Substituir"},labels:{externalInvoiceNumber:"Fatura Externa #",paymentProfile:"Perfil de Pagamento",actualCharges:"Cobranças Atuais",insurance:"Seguro Nacional",hmoCom:"HMO/COM",paymentsDeposits:"Pagamentos/Depositos",pricingPanelOverrides:"Substituição e Perfil de Preços",pricingProfile:"Perfil de Preços",discountAmount:"Quantidade de Desconto",discountPercentage:"Porcentagem de Desconto"}},print:{invoice:{labels:{patientName:"NOME DO PACIENTE:",patientId:"PACIENTE #:",patientAge:"IDADE:",patientAddress:"ENDEREÇO:",dateAdmitted:"ADMITIDO:",dateDischarged:"PAGAMENTO:",dischargeNotes:"Notas de Pagamento:",remarks:"Observações:",billedBy:"Faturado por:",billedDate:"Data de Faturamento:",spacer:"__________________________________________"},messages:{whereConducted:"foram deduzidos durante minha internação"},titles:{patientMember:"Paciente-Membro",relContact:"Relações/Contato",patients:"DO PACIENTE",billingStatement:"DECLARAÇÃO DO FATURAMENTO"}}},procedures:{titles:{addChargeItem:"Adicionar Item de Cobrança",deleteChargeItem:"Excluir Item de Cobrança",editChargeItem:"Editar Item de Cobrança",medicationUsed:"Medicação Usada",deleteMedicationUsed:"Excluir Medicação Usada",addMedicationUsed:"Adicionar Medicação Usada",editMedicationUsed:"Editar Medicação Usada",edit:"Editar Procedimento",saved:"Procedimento Salvo",new:"Novo Procedimento"},labels:{medicationUsed:"Medicação Usada"},messages:{deleteMedication:"Você tem certeza que deseja excluir esta medicação?",delete:"Você tem certeza que deseja excluir este procedimento?",saved:"O registro de procedimento foi salvo."},buttons:{addMedication:"Adicionar Medicação"}},components:{chargesByTypeTab:{charges:"cobranças"},takePhoto:{how:"Como você quer adicionar um Foto?",takePhoto:"Tirar um Foto",uploadPhoto:"Upload de Foto",uploadFile:"Upload de Arquivo",camera:"Câmera",photo:"foto",preview:"pré visualização"},quantityConv:{unit:"Unidade",conversion:"O que significa contém 1 {{name}}?"},quantityCalc:{result:"{{targetUnit}} total: {{calculated}}"},priceList:{charges:"cobranças de {{pricingType}}"}}}}),define("hospitalrun/locales/ru/translations",["exports"],function(e){e.default={dashboard:{title:"Что вы хотите сделать?"},labels:{name:"Имя",patient:"Пациент",quantity:"Количество",requestedOn:"Запрошен",dateRequested:"Дата Запроса",dateCompleted:"Дата Выполнения",requestedBy:"Запрошен",fulfill:"Отправить",actions:"Действия",action:"Действие",notes:"Заметки",edit:"Редактировать",imagingType:"Тип визуализации",result:"Результат",results:"Результаты",visit:"Осмотр",requests:"Ожидающие",completed:"Выполненые",id:"Номер",sex:"Пол",age:"Возраст"},messages:{noItemsFound:"Ничего не найдено.",createNewRecord:"Создать новую запись?",forAuthorizedPersons:"Этот отчет предназначен только для уполномоченных лиц."},buttons:{complete:"Готово",cancel:"Отметить",returnButton:"Вернутся",add:"Добавить",update:"Обновить",ok:"Ок"},login:{messages:{signIn:"войдите в систему",error:"Неверное имя пользователя или пароль."},labels:{password:"Пароль",username:"Имя пользователя",signIn:"Войти"}},inventory:{messages:{noRequests:"Запросов не найдено.",createRequest:"Создать новый запрос?"}},imaging:{pageTitle:"Запросы на визуализацию",sectionTitle:"Визуализация",buttons:{newButton:"+ новый запрос"},labels:{radiologist:"Радиолог",addNewVisit:"--Добавить новый тип осмотра--"},messages:{noCompleted:"Не найдено выполненых запросов."},titles:{completedImaging:"Выполненые запросы",editTitle:"Редактировать запрос на визуализацию",newTitle:"Новый запрос на визуализацию"},alerts:{completedTitle:"Визуализация выполнена",completedMessage:"Запрос на визуализацию удовлетворён.",savedTitle:"Запрос сохранён",savedMessage:"Запрос на визуализацию сохранён."}}}}),define("hospitalrun/locales/tr/translations",["exports"],function(e){e.default={dashboard:{title:"Ne yapmak istersiniz?"},labels:{name:"Ad",patient:"Hasta",quantity:"Miktar",requestedOn:"Açık Talep",dateRequested:"Talep Tarihi",dateCompleted:"Bitiş tarihi",requestedBy:"Talep sahibi",fulfill:"Fulfill",actions:"İşlemler",action:"İşlem",notes:"Notlar",edit:"Düzenle",imagingType:"Görüntüleme Tipi",result:"Sonuç",results:"Sonuçlar",visit:"Ziyaret",requests:"Talepler",completed:"Tamamlandı",id:"Id",sex:"Cinsiyet",age:"Yaş"},messages:{noItemsFound:"Hiçbir öğe bulunamadı.",createNewRecord:"Yeni bir kayıt oluştur?",forAuthorizedPersons:"Bu rapor yetkili kişiler içindir."},buttons:{complete:"Bitir",cancel:"Vazgeç",returnButton:"Geri Dön",add:"Ekle",update:"Güncelle",ok:"Tamam"},login:{messages:{signIn:"GİRİŞ YAPIN",error:"Kullanıcı adı veya parola hatalı."},labels:{password:"Parola",username:"Kullanıcı Adı",signIn:"Giriş yap"}},inventory:{messages:{noRequests:"Talep bulunamadı",createRequest:"Yeni talep oluştur?"}},imaging:{pageTitle:"Görüntüleme talepleri",sectionTitle:"Görüntüleme",buttons:{newButton:"+ yeni görüntüleme"},labels:{radiologist:"Radyolog",addNewVisit:"--Yeni Ziyaret Ekle--"},messages:{noCompleted:"Tamamlanmayan öğe bulunamadı."},titles:{completedImaging:"Görüntüleme Tamamlandı",editTitle:"Görüntüleme Talebini Düzenle",newTitle:"Yeni Görüntüleme Talebi"},alerts:{completedTitle:"Görüntüleme Talebi Tamamlandı",completedMessage:"Görüntüleme talebi başarıyla tamamlandı.",savedTitle:"Görüntüleme Talebi Kaydedildi",savedMessage:"Görüntüleme Talebi başarıyla kaydedildi."}}}}),define("hospitalrun/medication/completed/controller",["exports","hospitalrun/controllers/abstract-paged-controller"],function(e,t){e.default=t.default.extend({showActions:!1,startKey:[]})}),define("hospitalrun/medication/completed/route",["exports","ember-i18n","hospitalrun/medication/index/route"],function(e,t,n){e.default=n.default.extend({modelName:"medication",pageTitle:(0,t.translationMacro)("medication.titles.completedMedication"),searchStatus:"Fulfilled"})}),define("hospitalrun/medication/completed/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"wgSAKpsG",block:'{"statements":[["partial","medication/index"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":true}',meta:{moduleName:"hospitalrun/medication/completed/template.hbs"}})}),define("hospitalrun/medication/delete/controller",["exports","ember-i18n","hospitalrun/controllers/abstract-delete-controller","hospitalrun/mixins/patient-submodule"],function(e,t,n,a){e.default=n.default.extend(a.default,{title:(0,t.translationMacro)("labels.delete_request"),actions:{delete:function(){this.deleteChildFromVisit("medication")}}})}),define("hospitalrun/medication/delete/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"TYQrMXNj",block:'{"statements":[["block",["modal-dialog"],null,[["isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-danger"],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-warning-sign"],["flush-element"],["close-element"],["text","\\n "],["append",["helper",["t"],["medication.messages.confirmDeletion"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/medication/delete/template.hbs"}})}),define("hospitalrun/medication/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","hospitalrun/mixins/add-new-patient","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-selection","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s,i,o,r){e.default=t.default.extend(n.default,i.default,l.default,s.default,o.default,r.default,{medicationController:a.default.inject.controller("medication"),expenseAccountList:a.default.computed.alias("medicationController.expenseAccountList"),canFulfill:function(){return this.currentUserCan("fulfill_medication")}.property(),isFulfilled:function(){var e=this.get("model.status");return"Fulfilled"===e}.property("model.status"),isFulfilling:function(){var e=this.get("canFulfill"),t=this.get("model.isRequested"),n=this.get("model.shouldFulfillRequest"),a=e&&(t||n);return this.get("model").set("isFulfilling",a),a}.property("canFulfill","model.isRequested","model.shouldFulfillRequest"),isFulfilledOrRequested:function(){return this.get("isFulfilled")||this.get("model.isRequested")}.property("isFulfilled","model.isRequested"),prescriptionClass:function(){var e=this.get("model.quantity");if(a.default.isEmpty(e))return"required"}.property("model.quantity"),quantityClass:function(){var e=this.get("model.prescription"),t="col-xs-3",n=this.get("isFulfilling");return(n||a.default.isEmpty(e))&&(t+=" required"),t+" test-quantity-input"}.property("isFulfilling","model.prescription"),quantityLabel:function(){var e=this.get("i18n"),t=e.t("medication.labels.quantityRequested"),n=this.get("isFulfilled"),a=this.get("isFulfilling");return a?t=e.t("medication.labels.quantityDispensed"):n&&(t=e.t("medication.labels.quantityDistributed")),t}.property("isFulfilled"),medicationList:[],updateCapability:"add_medication",afterUpdate:function(){var e=this.get("i18n"),t=void 0,n=void 0,a=this.get("isFulfilled");a?(t=e.t("medication.alerts.fulfilledTitle"),n="The medication request has been fulfilled.",this.set("model.selectPatient",!1)):(t=e.t("medication.alerts.savedTitle"),n=e.t("medication.alerts.savedMessage")),this.saveVisitIfNeeded(t,n)},beforeUpdate:function(){var e=this.get("isFulfilling"),t=this.get("model.isNew");return t||e?new a.default.RSVP.Promise(function(n,l){var s=this.get("model");s.validate().then(function(){s.get("isValid")?t?a.default.isEmpty(s.get("patient"))?(this.addNewPatient(),l({ignore:!0,message:"creating new patient first"})):(s.set("medicationTitle",s.get("inventoryItem.name")),s.set("priceOfMedication",s.get("inventoryItem.price")),s.set("status","Requested"),s.set("requestedBy",s.getUserName()),s.set("requestedDate",new Date),this.addChildToVisit(s,"medication","Pharmacy").then(function(){this.finishBeforeUpdate(e,n)}.bind(this),l)):this.finishBeforeUpdate(e,n):(this.send("showDisabledDialog"),l("invalid model"))}.bind(this)).catch(function(){this.send("showDisabledDialog"),l("invalid model")}.bind(this))}.bind(this)):a.default.RSVP.resolve()},finishBeforeUpdate:function(e,t){if(e){var n=this.get("model.inventoryLocations"),a=this.get("store").createRecord("inv-request",{expenseAccount:this.get("model.expenseAccount"),dateCompleted:new Date,inventoryItem:this.get("model.inventoryItem"),inventoryLocations:n,quantity:this.get("model.quantity"),transactionType:"Fulfillment",patient:this.get("model.patient"),markAsConsumed:!0});this.performFulfillRequest(a,!1,!1,!0).then(function(){this.set("model.status","Fulfilled"),t()}.bind(this))}else t()},showUpdateButton:function(){var e=this.get("isFulfilled");return!e&&this._super()}.property("updateCapability","isFulfilled"),updateButtonText:function(){var e=this.get("i18n");return this.get("model.hideFulfillRequest")?e.t("buttons.dispense"):this.get("isFulfilling")?e.t("labels.fulfill"):this._super()}.property("model.isNew","isFulfilling","model.hideFulfillRequest")})}),define("hospitalrun/medication/edit/route",["exports","ember-i18n","hospitalrun/routes/abstract-edit-route","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/patient-list-route","npm:uuid"],function(e,t,n,a,l,s,i,o){e.default=n.default.extend(l.default,s.default,i.default,{editTitle:(0,t.translationMacro)("medication.titles.editMedicationRequest"),modelName:"medication",newTitle:(0,t.translationMacro)("medication.titles.newMedicationRequest"),database:a.default.inject.service(),getNewData:function(e){var t=this.get("idParam"),n={selectPatient:!0,prescriptionDate:moment().startOf("day").toDate()};return"dispense"===e[t]&&(n.shouldFulfillRequest=!0,n.hideFulfillRequest=!0),n.id=o.default.v4(),a.default.RSVP.resolve(n)},model:function(e){var t=this.get("idParam");return!a.default.isEmpty(t)&&"new"===e[t]||"dispense"===e[t]?this._createNewRecord(e):this._super(e)},setupController:function(e,t){this._super(e,t);var n={key:"Medication",include_docs:!0},l=t.get("inventoryItem.id"),s=t.get("patient");a.default.isEmpty(l)&&this.get("database").queryMainDB(n,"inventory_by_type").then(function(t){var n=t.rows.map(function(e){return e.doc});e.set("medicationList",n)}),a.default.isEmpty(s)&&this._fetchPatientList(e)}})}),define("hospitalrun/medication/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"MX52huxX",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],16]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection"],["expenseAccount",["helper",["t"],["labels.billTo"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]]]]],false],["text","\\n "],["append",["helper",["inventory-location-picker"],null,[["label","quantityRequested","locationList","selectedLocations"],[["helper",["t"],["labels.pullFrom"],null],["get",["model","quantity"]],["get",["model","inventoryItem","availableLocations"]],["get",["model","inventoryLocations"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.fulfillRequest"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-checkbox"],null,[["label","property"],[["helper",["t"],["labels.fulfillRequestNow"],null],"shouldFulfillRequest"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canFulfill"]]],null,1]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,2]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["property","label","rows","class"],["prescription",["helper",["t"],["labels.prescription"],null],"3",["get",["prescriptionClass"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["prescriptionDate",["helper",["t"],["labels.prescriptionDate"],null],"col-sm-4"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["get",["quantityLabel"]],["get",["quantityClass"]]]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["refills",["helper",["t"],["medication.labels.refills"],null],"col-xs-3"]]],false],["text","\\n "],["close-element"],["text","\\n"],["block",["unless"],[["get",["model","hideFulfillRequest"]]],null,3],["block",["if"],[["get",["isFulfilling"]]],null,0]],"locals":[]},{"statements":[["text"," "],["append",["helper",["date-format"],[["get",["model","prescriptionDate"]]],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["static-text"],null,[["label","value"],[["helper",["t"],["labels.prescription"],null],["get",["model","prescription"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["static-text"],null,[["label","class"],[["helper",["t"],["labels.prescriptionDate"],null],"col-xs-4"]],5],["text"," "],["append",["helper",["static-text"],null,[["label","class","value"],[["get",["quantityLabel"]],"col-xs-3",["get",["model","quantity"]]]]],false],["text","\\n "],["append",["helper",["static-text"],null,[["label","class","value"],[["helper",["t"],["medication.labels.refills"],null],"col-xs-3",["get",["model","refills"]]]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.prescriber"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","requestedBy"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["inventory-typeahead"],null,[["property","label","content","selection","class"],["inventoryItemTypeAhead",["helper",["t"],["labels.medication"],null],["get",["medicationList"]],["get",["selectedInventoryItem"]],"required test-medication-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.medication"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","medicationName"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-12"],["flush-element"],["text","\\n "],["append",["helper",["medication-allergy"],null,[["patient"],[["get",["model","patient"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","form-group col-xs-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["labels.visit"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","visit","visitDescription"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","prompt","selected"],["col-xs-4 required test-add-visit",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["helper",["t"],["labels.addNewOutpatientVisit"],null],["get",["model","visit"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"col-xs-6 required test-patient-input"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","returnTo","returnToContext","disablePatientLink"],[["get",["model","patient"]],"medication.edit",["get",["model","id"]],["get",["model","isNew"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["model","selectPatient"]]],null,14],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["if"],[["get",["model","selectPatient"]]],null,13],["block",["if"],[["get",["model","isNew"]]],null,12,11],["text"," "],["close-element"],["text","\\n"],["block",["if"],[["get",["model","patient","allergies"]]],null,10],["block",["if"],[["get",["isFulfilledOrRequested"]]],null,9,8],["block",["if"],[["get",["isFulfilledOrRequested"]]],null,7],["block",["if"],[["get",["isFulfilled"]]],null,6,4]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],15]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/medication/edit/template.hbs"}})}),define("hospitalrun/medication/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/user-session"],function(e,t,n){e.default=t.default.extend(n.default,{startKey:[],canAdd:function(){return this.currentUserCan("add_medication")}.property(),showActions:function(){return this.currentUserCan("fulfill_medication")}.property()})}),define("hospitalrun/medication/index/route",["exports","ember-i18n","hospitalrun/routes/abstract-index-route"],function(e,t,n){e.default=n.default.extend({modelName:"medication",pageTitle:(0,t.translationMacro)("medication.pageTitle"),searchStatus:"Requested",_getStartKeyFromItem:function(e){var t=e.get("prescriptionDateAsTime"),n=this._getPouchIdFromItem(e),a=e.get("requestedDateAsTime"),l=this.get("searchStatus");return[l,a,t,n]},_modelQueryParams:function(){var e=this._getMaxPouchId(),t=this.get("maxValue"),n=this._getMinPouchId(),a=this.get("searchStatus");return{options:{startkey:[a,null,null,n],endkey:[a,t,t,e]},mapReduce:"medication_by_status"}}})}),define("hospitalrun/medication/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"xGEaoO6P",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],6]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["medication.messages.createNew"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["messages.noItemsFound"],null],false],["text"," "],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"editItem",["get",["medicationRequest"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.fulfill"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["medicationRequest"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["medicationRequest","prescriptionDate"]]],[["format"],["l h:mm A"]]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","patient","displayName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","medicationName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","quantity"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medicationRequest","status"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":["medicationRequest"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.patient"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.prescriber"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.medication"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.quantity"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,4],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,3],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model"]]],null,5,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/medication/index/template.hbs"}})}),define("hospitalrun/medication/return/controller",["exports","ember-i18n","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-selection","hospitalrun/mixins/patient-submodule","hospitalrun/utils/select-values"],function(e,t,n,a,l,s,i,o,r){e.default=n.default.extend(l.default,s.default,i.default,o.default,{medicationController:a.default.inject.controller("medication"),medicationList:[],lookupListsToUpdate:[{name:"aisleLocationList",property:"model.aisleLocation",id:"aisle_location_list"},{name:"expenseAccountList",property:"model.expenseAccount",id:"expense_account_list"},{name:"warehouseList",property:"model.location",id:"warehouse_list"}],patientMedicationList:[],setNewMedicationList:!1,aisleLocationList:a.default.computed.alias("medicationController.aisleLocationList"),expenseAccountList:a.default.computed.alias("medicationController.expenseAccountList"),warehouseList:a.default.computed.alias("medicationController.warehouseList"),updateCapability:"add_medication",medicationChanged:function(){var e=this.get("model.medication");if(a.default.isEmpty(e))this.set("model.inventoryItem");else{var t=e.get("inventoryItem");this.set("model.inventoryItemTypeAhead",t.get("name")+" - "+t.get("friendlyId")),this.set("model.inventoryItem",t)}a.default.run.later(function(){this.get("model").validate().catch(a.default.K)}.bind(this))}.observes("model.medication"),patientVisitsChanged:function(){var e=this.get("patientVisits");a.default.isEmpty(e)||this.set("model.visit",e.get("firstObject"))}.observes("patientVisits"),showPatientMedicationList:function(){var e=this.get("patientMedicationList");return this.get("patientMedication"),!a.default.isEmpty(e)}.property("patientMedicationList","model.patient","model.visit"),patientMedication:function(){var e=this.get("setNewMedicationList"),t=this.get("model.visit");return e?this.set("setNewMedicationList",!1):a.default.isEmpty(t)||t.get("medication").then(function(e){e=e.filterBy("status","Fulfilled"),this.set("model.medication",e.get("firstObject")),this.set("patientMedicationList",e.map(r.default.selectObjectMap)),this.set("setNewMedicationList",!0)}.bind(this)),this.get("patientMedicationList")}.property("setNewMedicationList","model.patient","model.visit"),_finishUpdate:function(){var e=this.get("model.deliveryAisle"),t=this.get("model.deliveryLocation"),n=this.get("model.inventoryItem");this._findOrCreateLocation(n,t,e).then(function(e){this.set("model.adjustPurchases",!0),this.set("model.inventoryLocations",[e]),this.set("model.markAsConsumed",!0),this.get("model.inventoryItem").then(function(){this.send("fulfillRequest",this.get("model"),!1,!0,!0)}.bind(this))}.bind(this))},actions:{doneFulfillRequest:function(){var e=this.get("i18n");this.updateLookupLists(),this.displayAlert(e.t("medication.alerts.returnedTitle"),e.t("medication.alerts.returnedMessage"),"allItems")},update:function(){var e=this.get("model.medication"),t=this.get("model.quantity");a.default.isEmpty(e)?this._finishUpdate():e.reload().then(function(){e.decrementProperty("quantity",t),e.get("quantity")<0&&e.set("quantity",0),e.save().then(this._finishUpdate.bind(this))}.bind(this))}},updateButtonText:(0,t.translationMacro)("medication.returnMedication")})}),define("hospitalrun/medication/return/route",["exports","ember-i18n","hospitalrun/medication/edit/route","ember"],function(e,t,n,a){e.default=n.default.extend({editTitle:(0,t.translationMacro)("medication.returnMedication"),modelName:"inv-request",newTitle:(0,t.translationMacro)("medication.returnMedication"),getNewData:function(){return a.default.RSVP.resolve({dateCompleted:new Date,selectPatient:!0,transactionType:"Return"})}})}),define("hospitalrun/medication/return/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"YZt6viXc",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["append",["helper",["inventory-typeahead"],null,[["property","label","content","selection","class","showQuantity"],["inventoryItemTypeAhead",["helper",["t"],["labels.medication"],null],["get",["medicationList"]],["get",["selectedInventoryItem"]],"required test-medication-input",false]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected"],["required",["helper",["t"],["labels.medication"],null],"medication",["get",["patientMedication"]],"selectObject","selectObject.inventoryItem.name",["get",["model","medication"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["showPatientMedicationList"]]],null,1,0],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["patient-typeahead"],null,[["property","label","content","selection","class"],["patientTypeAhead",["helper",["t"],["labels.patient"],null],["get",["patientList"]],["get",["selectedPatient"]],"col-xs-6"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","label","property","content","optionValuePath","optionLabelPath","selected"],["col-xs-6",["helper",["t"],["labels.visit"],null],"visit",["get",["patientVisitsForSelect"]],"selectObject","selectObject.visitDescription",["get",["model","visit"]]]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["number-input"],null,[["property","label","class"],["quantity",["helper",["t"],["medication.labels.quantityToReturn"],null],"col-xs-3 required test-medication-quantity"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["deliveryLocation",["helper",["t"],["medication.labels.returnLocation"],null],["get",["warehouseList"]],["get",["model","location"]],"col-xs-4"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["deliveryAisle",["helper",["t"],["medication.labels.returnAisle"],null],["get",["aisleLocationList"]],["get",["model","aisleLocation"]],"col-xs-4"]]],false],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-text"],null,[["property","label","rows"],["reason",["helper",["t"],["medication.labels.returnReason"],null],"3"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["dateCompleted",["helper",["t"],["medication.labels.adjustmentDate"],null],"col-sm-4"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["expenseAccount",["helper",["t"],["medication.labels.creditToAccount"],null],["get",["expenseAccountList"]],["get",["model","expenseAccount"]],"col-sm-8"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],2]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/medication/return/template.hbs"}})}),define("hospitalrun/medication/route",["exports","ember-i18n","hospitalrun/routes/abstract-module-route","ember"],function(e,t,n,a){e.default=n.default.extend({addCapability:"add_medication",moduleName:"medication",newButtonText:(0,t.translationMacro)("medication.buttons.newButton"),sectionTitle:(0,t.translationMacro)("medication.sectionTitle"),additionalButtons:function(){var e=this.get("i18n"),t=[];if(this.currentUserCan("fulfill_medication")&&t.push({buttonIcon:"octicon octicon-checklist",buttonAction:"dispenseMedication",buttonText:e.t("medication.buttons.dispenseMedication"),class:"btn btn-primary"}),this.currentUserCan(this.get("addCapability"))&&t.push({buttonIcon:"octicon octicon-mail-reply",buttonAction:"returnMedication",buttonText:e.t("medication.buttons.returnMedication"),class:"btn btn-primary"}),!a.default.isEmpty(t))return t}.property(),additionalModels:[{name:"aisleLocationList",findArgs:["lookup","aisle_location_list"]},{name:"expenseAccountList",findArgs:["lookup","expense_account_list"]},{name:"sexList",findArgs:["lookup","sex"]},{name:"warehouseList",findArgs:["lookup","warehouse_list"]}],actions:{dispenseMedication:function(){this.currentUserCan("fulfill_medication")&&this.transitionTo("medication.edit","dispense")},returnMedication:function(){this.currentUserCan(this.get("addCapability"))&&this.transitionTo("medication.return","new")}}})}),define("hospitalrun/medication/search/route",["exports","hospitalrun/routes/abstract-search-route"],function(e,t){e.default=t.default.extend({moduleName:"medication",searchKeys:[{name:"prescription",type:"contains"}],searchModel:"medication"})}),define("hospitalrun/medication/search/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"T9jkbT1t",block:'{"statements":[["block",["search-listing"],null,[["newButtonText","allButtonText"],[["helper",["t"],["buttons.newRequest"],null],["helper",["t"],["buttons.allRequests"],null]]],0]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["partial","medication/index"],["text","\\n"]],"locals":[]}],"hasPartials":true}',meta:{moduleName:"hospitalrun/medication/search/template.hbs"}})}),define("hospitalrun/mixins/active-link",["exports","ember-cli-active-link-wrapper/mixins/active-link"],function(e,t){e.default=t.default}),define("hospitalrun/mixins/add-new-patient",["exports","ember","hospitalrun/mixins/patient-id"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{customForms:t.default.inject.service(),addedNewPatient:!1,newPatientId:null,actions:{addedNewPatient:function(e){this.send("closeModal"),this.set("addedNewPatient",!0),this.set("model.patient",e),this.set("newPatientId"),this.send("update")}},addNewPatient:function(){var e=this,n=this.get("i18n");this.displayAlert(n.t("alerts.pleaseWait"),n.t("messages.newPatientHasToBeCreated")),this._getNewPatientId().then(function(n){var a=e.get("model.patientTypeAhead"),l=a.split(" "),s={customForms:t.default.Object.create(),friendlyId:n,patientFullName:a,requestingController:e},i=e.get("customForms");return i.setDefaultCustomForms(["patient","socialwork"],s).then(function(){var t=void 0;l.length>=3?(s.firstName=l[0],s.middleName=l[1],s.lastName=l.splice(2,l.length).join(" ")):2===l.length?(s.firstName=l[0],s.lastName=l[1]):s.firstName=a,t=e.store.createRecord("patient",s),e.send("openModal","patients.quick-add",t)})})},_getNewPatientId:function(){var e=this.get("newPatientId");return t.default.isEmpty(e)?new t.default.RSVP.Promise(function(e,t){this.generateFriendlyId().then(function(t){this.set("newPatientId",t),e(t)}.bind(this),t)}.bind(this)):t.default.RSVP.resolve(e)}})}),define("hospitalrun/mixins/appointment-statuses",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({appointmentStatusList:["Attended","Scheduled","Canceled","Missed"],appointmentStatuses:t.default.computed.map("appointmentStatusList",n.default.selectValuesMap),appointmentStatusesWithEmpty:function(){return n.default.selectValues(this.get("appointmentStatusList"),!0)}.property()})}),define("hospitalrun/mixins/billing-categories",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({defaultBillingCategories:["Hospital Charges"]})}),define("hospitalrun/mixins/blood-types",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({bloodTypes:["A+","A-","AB-","AB+","B+","B-","O+","O-"].map(n.default.selectValuesMap)})}),define("hospitalrun/mixins/can-edit-requested",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({canEdit:function(){var e=this.get("status");return"Requested"===e}.property("status")})}),define("hospitalrun/mixins/charge-actions",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({chargePricingCategory:null,pricingList:null,pricingTypeForObjectType:null,pricingTypes:null,_createNewChargeRecord:function(e,n){return new t.default.RSVP.Promise(function(t,a){this.store.find("pricing",n).then(function(n){var l=this.store.createRecord("proc-charge",{dateCharged:new Date,quantity:e,pricingItem:n});l.save().then(function(e){var n=this.get("model.charges");n.addObject(e),t()}.bind(this),a)}.bind(this),a)}.bind(this),"_createNewChargeRecord with pricingId:"+n)},actions:{addCharge:function(e){var t=this.get("model.charges");t.addObject(e),this.send("update",!0),this.send("closeModal")},deleteCharge:function(e){var t=e.get("chargeToDelete"),n=this.get("model.charges");n.removeObject(t),t.destroyRecord(),this.send("update",!0),this.send("closeModal")},showAddCharge:function(){var e=this.get("store").createRecord("proc-charge",{dateCharged:new Date,quantity:1,pricingCategory:this.get("chargePricingCategory")});this.send("openModal",this.get("chargeRoute"),e)},showEditCharge:function(e){e.set("itemName",e.get("pricingItem.name")),e.set("pricingCategory",this.get("chargePricingCategory")),this.send("openModal",this.get("chargeRoute"),e)},showDeleteCharge:function(e){this.send("openModal","dialog",t.default.Object.create({confirmAction:"deleteCharge",title:"Delete Charge Item",message:"Are you sure you want to delete this charged item?",chargeToDelete:e,updateButtonAction:"confirm",updateButtonText:this.get("i18n").t("buttons.ok")}))},setChargeQuantity:function(e,t){var n=this.get("model");n.set(e,t)}},canAddCharge:function(){return this.currentUserCan("add_charge")}.property(),chargesPricingList:function(){var e=this.get("pricingList"),t=this.get("pricingTypeForObjectType");return e.filter(function(e){return e.type!==t})}.property("pricingList","pricingTypeForObjectType"),chargeRoute:null,findChargeForPricingItem:function(e,t){var n=t.find(function(t){var n=t.get("pricingItem.id");return e.id===n});return n},objectTypeList:function(){var e=this.get("pricingList"),n=this.get("pricingTypeForObjectType"),a=this.get("userCanAddPricingTypes"),l=t.default.Object.create({value:[],userCanAdd:a});return t.default.isEmpty(e)||l.set("value",e.filterBy("pricingType",n)),l}.property("pricingList","pricingTypeForObjectType","pricingTypeValues"),organizeByType:t.default.computed.alias("pricingTypes.organizeByType"),pricingTypeList:function(){var e=this.get("pricingList"),n=this.get("pricingTypeValues"),a=this.get("pricingTypeForObjectType");if(!t.default.isEmpty(n))return n=n.filter(function(n){var l=!1;return t.default.isEmpty(e)||(l=!t.default.isEmpty(e.findBy("pricingType",n))),l&&n!==a}),n=n.sortBy("name")}.property("pricingTypeValues","pricingTypeForObjectType","pricingList"),pricingTypeValues:t.default.computed.alias("pricingTypes.value"),createMultipleRequests:function(e,t,n,a){var l=e.get("firstObject"),s=this.get("model");s.set(t,l),this.addChildToVisit(s,n,a).then(function(l){s.save().then(function(){this._finishCreateMultipleRequests(e,t,n,a,l)}.bind(this))}.bind(this))},_finishCreateMultipleRequests:function(e,n,a,l,s){var i={},o=this.get("model"),r=void 0,d=[],c=this.get("model.patient"),u=[];o.eachAttribute(function(e){i[e]=o.get(e)}),e.forEach(function(e,t){t>0&&(r=this.store.createRecord(l.toLowerCase(),i),r.set(n,e),r.set("patient",c),r.set("visit",s),d.push(r),u.push(r.save()))}.bind(this)),t.default.RSVP.all(u).then(function(){var e=[];d.forEach(function(t){e.push(this.addChildToVisit(t,a,l))}.bind(this)),t.default.RSVP.all(e).then(function(e){this.afterUpdate(e,!0)}.bind(this))}.bind(this))},saveNewPricing:function(e,n,a){return new t.default.RSVP.Promise(function(t,l){var s=void 0,i=this.get("pricingTypeForObjectType");s=this.store.createRecord("pricing",{name:e,category:n,pricingType:i}),s.save().then(function(e){this.get("pricingList").addObject({id:e.get("id"),name:s.get("name")}),this.set(a,s),t()}.bind(this),l)}.bind(this),"saveNewPricing for: "+e)},getSelectedPricing:function(e){var n=this.get(e);return t.default.isEmpty(n)?t.default.RSVP.resolve():new t.default.RSVP.Promise(function(e,a){t.default.isArray(n)?this.store.findByIds("pricing",n).then(e,a):this.store.find("pricing",n.id).then(e,a)}.bind(this))},showAddCharge:function(){var e=this.get("canAddCharge"),t=this.get("organizeByType");return!!e&&!t}.property("canAddCharge","organizeByType"),showEditCharges:function(){var e=this.get("canAddCharge"),t=this.get("organizeByType");return!!e&&t}.property("canAddCharge","organizeByType"),showPricingTypeTabs:function(){var e=this.get("pricingTypeList");return!t.default.isEmpty(e)&&e.get("length")>1}.property("pricingTypeList"),userCanAddPricingTypes:function(){var e=this.get("pricingTypes");return!!t.default.isEmpty(e)||e.get("userCanAdd")}.property("pricingTypes"),updateCharges:function(){var e=this.get("model.charges"),n=this.get("organizeByType"),a=this.get("pricingList");return n?new t.default.RSVP.Promise(function(n,l){var s=[],i=this.get("model");a.forEach(function(n){var a=this.findChargeForPricingItem(n,i.get("charges")),l=i.get(n.id);t.default.isEmpty(l)?a&&(e.removeObject(a),s.push(a.destroyRecord())):a?a.get("quantity")!==l&&(a.set("quantity",l),s.push(a.save())):s.push(this._createNewChargeRecord(l,n.id))}.bind(this)),t.default.RSVP.all(s,"Charges updated for current record: "+this.get("model.id")).then(n,l)}.bind(this),"updateCharges for current record: "+this.get("model.id")):t.default.RSVP.resolve()}})}),define("hospitalrun/mixins/charge-route",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({database:t.default.inject.service(),actions:{deleteCharge:function(e){this.controller.send("deleteCharge",e)}},pricingList:null,afterModel:function(){return new t.default.RSVP.Promise(function(e,t){var n=this.get("database"),a=n.getMaxPouchId("pricing"),l=n.getMinPouchId("pricing"),s=this.get("pricingCategory"),i={startkey:[s,null,null,l],endkey:[s,{},{},a],include_docs:!0};n.queryMainDB(i,"pricing_by_category").then(function(t){var n=t.rows.map(function(e){return e.doc});this.set("pricingList",n),e()}.bind(this)).catch(t)}.bind(this))},setupController:function(e,t){this._super(e,t),e.set("pricingList",this.get("pricingList"))}})}),define("hospitalrun/mixins/custom-field-types",["exports","ember"],function(e,t){var n=t.default.computed;e.default=t.default.Mixin.create({fieldTypeValues:["checkbox","radio","select","text","textarea"],fieldTypes:n(function(){var e=this.get("i18n"),n=this.get("fieldTypeValues");return n.map(function(t){return{id:t,value:e.t("admin.customForms.labels."+t)}}).sort(function(e,n){return t.default.compare(e.value.toString(),n.value.toString())})})})}),define("hospitalrun/mixins/date-format",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_dateFormat:function(e,n){if(t.default.isEmpty(n)&&(n="l"),!t.default.isEmpty(e))return moment(e).format(n)},dateToTime:function(e){if(!t.default.isEmpty(e)&&e.getTime)return e.getTime()}})}),define("hospitalrun/mixins/diagnosis-actions",["exports","ember"],function(e,t){var n=t.default.computed;e.default=t.default.Mixin.create({canAddDiagnosis:n(function(){return this.currentUserCan("add_diagnosis")}),editDiagnosis:function(e){e.set("editController",this),this.send("openModal","diagnosis.edit",e)},actions:{deleteDiagnosis:function(e){var t=this,n=this.get("model.diagnoses");n.removeObject(e),e.set("archived",!0),e.save().then(function(){t.send("closeModal"),t.send("update",!0)})},editDiagnosis:function(e){this.editDiagnosis(e)},showAddDiagnosis:function(){var e=this.get("store").createRecord("diagnosis",{date:new Date});this.editDiagnosis(e)}}})}),define("hospitalrun/mixins/dob-days",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({convertDOBToText:function(e,t,n){var a=new Date,l=0,s=0,i=0;e&&(void 0===e.getFullYear&&(e=moment(e,"l").toDate()),void 0!==e.getFullYear&&(l=a.getFullYear()-e.getFullYear(),(a.getMonth()0?d.t("dates.short",r):d.t("dates.shortOmitYears",r):n?l>1?d.t("dates.longOmitDaysPlural",r):1===l?d.t("dates.longOmitDays",r):d.t("dates.longOmitDaysYears",r):l>1?d.t("dates.longPlural",r):1===l?d.t("dates.long",r):d.t("dates.longOmitYears",r)}})}),define("hospitalrun/mixins/edit-panel-props",["exports","ember"],function(e,t){var n=t.default.computed,a=t.default.isEmpty,l=["actionForUpdateButton","additionalButtons","cancelButtonText","disabledAction","hideCancelButton","showUpdateButton","updateButtonAction","updateButtonIcon","updateButtonText"];e.default=t.default.Mixin.create({additionalButtons:null,cancelButtonText:null,disabledAction:null,hideCancelButton:null,showUpdateButton:null,updateButtonAction:null,updateButtonIcon:null,updateButtonText:null,actionForUpdateButton:n("disabledAction",function(){var e=this.get("disabledAction");return a(e)||e===!1?"updateButtonAction":"disabledAction"}),editPanelProps:n.apply(void 0,l.concat([function(){return this.getProperties(l)}]))})}),define("hospitalrun/mixins/filter-list",["exports","ember"],function(e,t){var n=t.default.isEmpty,a=t.default.String.isHTMLSafe;e.default=t.default.Mixin.create({filteredBy:new t.default.Map,filterList:function(e,t,l){var s=this.get("filteredBy");if(n(t)&&n(s))return e;n(t)||s.set(t,l),this.set("filteredBy",s);var i=e.filter(function(e){var t=!0;return s.forEach(function(l,s){var i=e.get(s);n(l)||(a(l)&&(l=l.toString()),a(i)&&(i=i.toString()),i!==l&&(t=!1))}),t});return i}})}),define("hospitalrun/mixins/fulfill-request",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({actions:{doneFulfillRequest:function(){},fulfillRequest:function(e,t,n,a){this.performFulfillRequest(e,t,n,a)}},performFulfillRequest:function(e,n,a,l){return new t.default.RSVP.Promise(function(s,i){var o=e.get("markAsConsumed"),r=e.get("transactionType");"Request"===r&&(r=null),e.get("inventoryItem").then(function(d){o?(e.set("adjustPurchases",!0),t.default.isEmpty(r)&&e.set("transactionType","Fulfillment"),this._performFulfillment(e,d,a).then(function(){this._finishFulfillRequest(e,d,n,a,l),s()}.bind(this),i)):(e.set("adjustPurchases",!1),t.default.isEmpty(r)&&e.set("transactionType","Transfer"),this._finishFulfillRequest(e,d,n,a,l),s())}.bind(this),i)}.bind(this))},_findQuantity:function(e,t,n,a){var l=void 0,s=[],i=n.get("quantity"),o=parseInt(e.get("quantity")),r=o,d=[],c=0;if(a){var u=t.get("lastObject");l=u.get("costPerUnit"),u.incrementProperty("currentQuantity",o),c+=l*r,d.push({id:u.get("id"),quantity:o}),s.addObject(u)}else{var p=t.any(function(e){var t=e.get("currentQuantity");return!(e.get("expired")||t<=0)&&(l=e.get("costPerUnit"),!!a||(r>t?(c+=l*t,r-=t,d.push({id:e.get("id"),quantity:parseInt(t)}),t=0):(c+=l*r,t-=r,d.push({id:e.get("id"),quantity:parseInt(r)}),r=0),e.set("currentQuantity",t),s.addObject(e),0===r))});if(!p)return"Could not find any purchases that had the required quantity: "+o}return e.set("costPerUnit",(c/o).toFixed(2)),e.set("quantityAtCompletion",i),e.set("purchasesAffected",d),e.set("purchases",s),n.updateQuantity(),!0},_finishFulfillRequest:function(e,n,a,l,s){var i=e.get("inventoryLocations"),o=[],r=e.get("markAsConsumed"),d=[],c=parseInt(e.get("quantity")),u=e.get("purchases");if(l){var p=i.get("firstObject");p.incrementProperty("quantity",c),d.push(p.save()),o.push({name:p.get("locationName"),quantity:c})}else i.reduce(function(t,a){var l=e.get("deliveryLocation"),s=e.get("deliveryAisle"),i=parseInt(a.get("quantity"));if(t>0)return r||(a.set("transferAisleLocation",s),a.set("transferLocation",l)),i>=t?(r?(a.decrementProperty("quantity",t),d.push(a.save())):(a.set("adjustmentQuantity",t),d.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:t}),0):(r?(a.decrementProperty("quantity",i),d.push(a.save())):(a.set("adjustmentQuantity",i),d.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:i}),t-i)}.bind(this),c);e.set("locationsAffected",o),r&&u.forEach(function(e){d.push(e.save())}),t.default.RSVP.all(d,"Preliminary saving done for inventory fulfillment").then(function(){var l=[];l.push(n.save()),e.set("status","Completed"),e.set("completedBy",e.getUserName()),l.push(e.save()),t.default.RSVP.all(l,"All saving done for inventory fulfillment").then(function(){this.send("doneFulfillRequest"),a&&this.send("closeModal"),s||this.transitionTo("inventory.index")}.bind(this))}.bind(this))},_performFulfillment:function(e,n,a){return new t.default.RSVP.Promise(function(t,l){var s=n.get("purchases"),i=n.get("quantity"),o=e.get("quantity");if(a||i>=o){var r=this._findQuantity(e,s,n,a);r===!0?t():l(r)}else l("The quantity on hand, "+i+" is less than the requested quantity of "+o+".")}.bind(this))}})}),define("hospitalrun/mixins/hospitalrun-version",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({version:"0.9.17"})}),define("hospitalrun/mixins/inventory-adjustment-types",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({adjustmentTypes:[{name:"Add",type:"Adjustment (Add)"},{name:"Remove",type:"Adjustment (Remove)"},{name:"Return To Vendor",type:"Return To Vendor"},{name:"Return",type:"Return"},{name:"Write Off",type:"Write Off"}]})}),define("hospitalrun/mixins/inventory-id",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({generateId:function(){var e=1,n=999,a=(new Date).getTime(),l=Math.floor(Math.random()*(n-e+1))+e;return t.default.RSVP.resolve(a.toString(36)+"_"+l.toString(36))}})}),define("hospitalrun/mixins/inventory-locations",["exports","ember","npm:uuid"],function(e,t,n){e.default=t.default.Mixin.create({aisleToFind:null,locationToFind:null,_addQuantityToLocation:function(e,n,a,l){return new t.default.RSVP.Promise(function(t,s){this._findOrCreateLocation(e,a,l).then(function(e){e.incrementProperty("quantity",n),e.save().then(t,s)})}.bind(this))},_findOrCreateLocation:function(e,a,l){return new t.default.RSVP.Promise(function(t,s){var i=this,o=!1,r=e.get("locations");this.set("aisleToFind",l),this.set("locationToFind",a),o=r.find(this.findLocation,this),o?t(o):!function(){var e=i.get("store").createRecord("inv-location",{ -id:n.default.v4(),aisleLocation:l,location:a,quantity:0});r.addObject(e),e.save().then(function(){t(e)},s)}()}.bind(this))},findLocation:function(e){var n=e.get("aisleLocation"),a=this.get("aisleToFind"),l=e.get("location"),s=this.get("locationToFind");if((t.default.isEmpty(n)&&t.default.isEmpty(a)||n===a)&&(t.default.isEmpty(l)&&t.default.isEmpty(s)||l===s))return!0},newPurchaseAdded:function(e,n){return new t.default.RSVP.Promise(function(t,a){var l=n.get("aisleLocation"),s=n.get("location"),i=parseInt(n.get("originalQuantity"));this._addQuantityToLocation(e,i,s,l).then(t,a)}.bind(this))},saveLocation:function(e,t){if(0===e.get("quantity")){var n=t.get("locations");return n.removeObject(e),e.destroyRecord()}return e.save()},transferToLocation:function(e,n){var a=n.get("transferAisleLocation"),l=n.get("transferLocation"),s=parseInt(n.get("adjustmentQuantity"));return new t.default.RSVP.Promise(function(t,i){this._addQuantityToLocation(e,s,l,a).then(function(){n.decrementProperty("quantity",s),n.save().then(t,i)},i)}.bind(this))}})}),define("hospitalrun/mixins/inventory-selection",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({selectedInventoryItem:null,inventoryItemChanged:function(){var e=this.get("selectedInventoryItem")||this.get("model.selectedInventoryItem");t.default.isEmpty(e)||this.store.find("inventory",e.id).then(function(e){var n=this.get("model");n.set("inventoryItem",e),t.default.run.once(this,function(){n.validate().catch(t.default.K)})}.bind(this))}.observes("selectedInventoryItem","model.selectedInventoryItem")})}),define("hospitalrun/mixins/inventory-type-list",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({defaultInventoryTypes:["Medication","Supply"],inventoryTypes:function(){var e=this.get("defaultInventoryTypes"),a=this.get("inventoryTypeList"),l=void 0;return l=t.default.isEmpty(a)?e:a,l=n.default.selectValues(l)}.property("inventoryTypeList","defaultInventoryTypes")})}),define("hospitalrun/mixins/is-update-disabled",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({isUpdateDisabled:function(){return!t.default.isNone(this.get("model.isValid"))&&!this.get("model.isValid")}.property("model.isValid")})}),define("hospitalrun/mixins/location-name",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({getDisplayLocationName:function(e,n){var a=this.formatLocationName(e,n);return t.default.isEmpty(a)&&(a="No Location"),a},formatLocationName:function(e,n){var a="";return t.default.isEmpty(e)||(a+=e,t.default.isEmpty(n)||(a+=" : ")),t.default.isEmpty(n)||(a+=n),a},locationName:function(){var e=this.get("aisleLocation"),t=this.get("location");return this.getDisplayLocationName(t,e)}.property("location","aisleLocation")})}),define("hospitalrun/mixins/medication-details",["exports","ember","ember-data"],function(e,t,n){e.default=t.default.Mixin.create({getMedicationName:function(e){var n=this,a=this.get("medicationTitle");if(!t.default.isEmpty(a))return a;var l=this.get(e);l.then?l.then(function(e){n.set("medicationTitle",e.get("name"))}):this.set("medicationTitle",l.get("name"))},getMedicationPrice:function(e){var n=this,a=this.get("priceOfMedication");if(!t.default.isEmpty(a))return a;var l=this.get(e);l.then?l.then(function(e){n.set("priceOfMedication",e.get("price"))}):this.set("priceOfMedication",l.get("price"))},getMedicationDetails:function(e){var n=this;return new t.default.RSVP.Promise(function(a){var l=n.get("medicationTitle"),s=n.get("priceOfMedication");if(t.default.isEmpty(l)||t.default.isEmpty(s)){var i=n.get(e);i.then?i.then(function(e){a({name:e.get("name"),price:e.get("price")})}):a({name:i.get("name"),price:i.get("price")})}else a({name:l,price:s})})},medicationTitle:n.default.attr("string"),priceOfMedication:n.default.attr("number"),rxNormIdentifier:n.default.attr("string")})}),define("hospitalrun/mixins/modal-helper",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({displayAlert:function(e,n,a){var l=this.get("i18n"),s=t.default.Object.extend({updateButtonText:l.t("buttons.ok")});this.send("openModal","dialog",s.create({title:e,message:n,okAction:a,hideCancelButton:!0,updateButtonAction:"ok"}))},displayConfirm:function(e,n,a,l){t.default.isEmpty(l)&&(l=t.default.Object.create()),l.set("confirmAction",a),l.set("title",e),l.set("message",n),l.set("updateButtonAction","confirm"),l.set("updateButtonText","Ok"),this.send("openModal","dialog",l)}})}),define("hospitalrun/mixins/navigation",["exports","ember"],function(e,t){var n=t.default.String.camelize;e.default=t.default.Mixin.create({navItems:[{title:"Inventory",iconClass:"octicon-package",route:"inventory",capability:"inventory",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"inventory.index",capability:"add_inventory_request"},{title:"Items",iconClass:"octicon-chevron-right",route:"inventory.listing",capability:"inventory"},{title:"Inventory Received",iconClass:"octicon-plus",route:"inventory.batch",subroute:"new",capability:"add_inventory_item"},{title:"Reports",iconClass:"octicon-chevron-right",route:"inventory.reports",capability:"inventory"}]},{title:"Patients",iconClass:"octicon-organization",route:"patients",capability:"patients",subnav:[{title:"Patient Listing",iconClass:"octicon-chevron-right",route:"patients",capability:"patients"},{title:"Admitted Patients",iconClass:"octicon-chevron-right",route:"patients.admitted",capability:"patients"},{title:"Outpatient",iconClass:"octicon-chevron-right",route:"patients.outpatient",capability:"patients"},{title:"New Patient",iconClass:"octicon-plus",route:"patients.edit",subroute:"new",capability:"add_patient"},{title:"Reports",iconClass:"octicon-chevron-right",route:"patients.reports",capability:"patients"}]},{title:"Appointments",iconClass:"octicon-calendar",route:"appointments.index",capability:"appointments",subnav:[{title:"This Week",iconClass:"octicon-chevron-right",route:"appointments.index",capability:"appointments"},{title:"Today",iconClass:"octicon-chevron-right",route:"appointments.today",capability:"appointments"},{title:"Missed",iconClass:"octicon-chevron-right",route:"appointments.missed",capability:"appointments"},{title:"Search",iconClass:"octicon-search",route:"appointments.search",capability:"appointments"},{title:"Add Appointment",iconClass:"octicon-plus",route:"appointments.edit",subroute:"new",capability:"add_appointment"}]},{title:"Imaging",iconClass:"octicon-device-camera",route:"imaging.index",capability:"imaging",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"imaging.index",capability:"imaging"},{title:"Completed",iconClass:"octicon-chevron-right",route:"imaging.completed",capability:"imaging"},{title:"New Request",iconClass:"octicon-plus",route:"imaging.edit",subroute:"new",capability:"add_imaging"}]},{title:"Medication",iconClass:"octicon-file-text",route:"medication.index",capability:"medication",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"medication.index",capability:"medication"},{title:"Completed",iconClass:"octicon-chevron-right",route:"medication.completed",capability:"medication"},{title:"New Request",iconClass:"octicon-plus",route:"medication.edit",subroute:"new",capability:"add_medication"},{title:"Dispense",iconClass:"octicon-checklist",route:"medication.edit",subroute:"dispense",capability:"fulfill_medication"},{title:"Return Medication",iconClass:"octicon-mail-reply",route:"medication.return",subroute:"new",capability:"add_medication"}]},{title:"Labs",iconClass:"octicon-microscope",route:"labs.index",capability:"labs",subnav:[{title:"Requests",iconClass:"octicon-chevron-right",route:"labs.index",capability:"labs"},{title:"Completed",iconClass:"octicon-chevron-right",route:"labs.completed",capability:"labs"},{title:"New Request",iconClass:"octicon-plus",route:"labs.edit",subroute:"new",capability:"add_lab"}]},{title:"Billing",iconClass:"octicon-credit-card",route:"invoices.index",capability:"invoices",subnav:[{title:"Invoices",iconClass:"octicon-chevron-right",route:"invoices.index",capability:"invoices"},{title:"New Invoice",iconClass:"octicon-plus",route:"invoices.edit",subroute:"new",capability:"invoices"},{title:"Prices",iconClass:"octicon-chevron-right",route:"pricing.index",capability:"invoices"},{title:"Price Profiles",iconClass:"octicon-chevron-right",route:"pricing.profiles",capability:"invoices"}]},{title:"Administration",iconClass:"octicon-person",route:"admin.lookup",capability:"admin",subnav:[{title:"Address Fields",iconClass:"octicon-chevron-right",route:"admin.address",capability:"update_config"},{title:"Custom Forms",iconClass:"octicon-chevron-right",route:"admin.custom-forms",capability:"update_config"},{title:"Load DB",iconClass:"octicon-plus",route:"admin.loaddb",capability:"load_db"},{title:"Lookup Lists",iconClass:"octicon-chevron-right",route:"admin.lookup",capability:"update_config"},{title:"Users",iconClass:"octicon-chevron-right",route:"users",capability:"users"},{title:"New User",iconClass:"octicon-plus",route:"users.edit",subroute:"new",capability:"add_user"},{title:"User Roles",iconClass:"octicon-chevron-right",route:"admin.roles",capability:"define_user_roles"},{title:"Workflow",iconClass:"octicon-chevron-right",route:"admin.workflow",capability:"update_config"}]}],localizedNavItems:t.default.computed("navItems.[]",function(){var e=this,a="navigation.",l=function(e,t){return"string"==typeof e?t:e};return this.get("navItems").map(function(s){var i=a+n(s.title).toLowerCase(),o=e.get("i18n").t(i);return t.default.set(s,"localizedTitle",l(o,s.title)),s.subnav=s.subnav.map(function(t){var s=a+"subnav."+n(t.title),i=e.get("i18n").t(s);return t.localizedTitle=l(i,t.title),t}),s})})})}),define("hospitalrun/mixins/number-format",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_calculateTotal:function(e,n){var a=void 0,l=0;return a=t.default.isArray(e)?e:this.get(e),l=a.reduce(function(e,a){return e+=this._getValidNumber(t.default.get(a,n))}.bind(this),0),this._numberFormat(l,!0)},_getValidNumber:function(e){return t.default.isEmpty(e)||isNaN(e)?0:Number(e)},_numberFormat:function(e,n){var a=void 0;if(!t.default.isEmpty(e)){if(isNaN(e))return;return a=Math.round(e)===e?Number(e).toString():this._round100(e).toFixed(2),n?Number(a):a.replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,")}},_validNumber:function(e){return!t.default.isEmpty(e)&&!isNaN(e)&&e>0},_round100:function(e){var t=100*e;return Math.round(t)/100}})}),define("hospitalrun/mixins/pagination-props",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({paginationProps:function(){var e=["disableNextPage","disablePreviousPage","showFirstPageButton","showLastPageButton","showPagination"];return this.getProperties(e)}.property("disableNextPage","disablePreviousPage","showFirstPageButton","showLastPageButton","showPagination")})}),define("hospitalrun/mixins/paging-actions",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({firstPage:"firstPage",lastPage:"lastPage",nextPage:"nextPage",previousPage:"previousPage",actions:{firstPage:function(){this.sendAction("firstPage")},lastPage:function(){this.sendAction("lastPage")},nextPage:function(){this.sendAction("nextPage")},previousPage:function(){this.sendAction("previousPage")}}})}),define("hospitalrun/mixins/patient-appointments",["exports","ember","hospitalrun/mixins/pouchdb"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{getPatientAppointments:function(e){var t=e.get("id"),n=this.get("maxValue");return this.store.query("appointment",{options:{startkey:[t,null,null,"appointment_"],endkey:[t,n,n,n]},mapReduce:"appointments_by_patient"})}})}),define("hospitalrun/mixins/patient-diagnosis",["exports","ember"],function(e,t){var n=t.default.isEmpty;e.default=t.default.Mixin.create({_addDiagnosisToList:function(e,n){t.default.isEmpty(e)||t.default.isEmpty(n.findBy("description",e))&&n.addObject(e)},getDiagnoses:function(e,t,a){var l=this,s=[];if(!n(e)){var i=e.get("diagnoses");return t&&(i=i.filterBy("active",!0)),a||(a=!1),i=i.filterBy("secondaryDiagnosis",a),i.forEach(function(e){l._addDiagnosisToList(e,s)}),s}}})}),define("hospitalrun/mixins/patient-id",["exports","ember"],function(e,t){function n(e,t){return t<1e5&&(t=("00000"+t).slice(-5)),""+e+t}e.sequenceId=n;var a=t.default.inject,l=t.default.isEmpty;e.default=t.default.Mixin.create({idPrefix:null,database:a.service(),config:a.service(),generateFriendlyId:function(){var e=this,t=this.get("config"),a=this.get("database"),s=a.getMaxPouchId("patient"),i=function e(i){var o=void 0,r=void 0;return t.getPatientPrefix().then(function(e){o=i.get("value"),r=n(e,o);var t={startkey:[r,null],endkey:[r,s]};return a.queryMainDB(t,"patient_by_display_id")}).then(function(t){return l(t.rows)?i.get("hasDirtyAttributes")?i.save().then(function(){return r}):r:(i.incrementProperty("value"),e(i))})};return this.store.find("sequence","patient").then(i).catch(function(){var t=e.get("store"),n=t.push(t.normalize("sequence",{id:"patient",value:1}));return i(n)})}})}),define("hospitalrun/mixins/patient-invoices",["exports","ember","hospitalrun/mixins/pouchdb"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{getPatientInvoices:function(e){var t=e.get("id");return this.store.query("invoice",{options:{key:t},mapReduce:"invoice_by_patient"})}})}),define("hospitalrun/mixins/patient-list-route",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({database:t.default.inject.service(),_fetchPatientList:function(e){var t={startkey:"patient_",endkey:"patient_￿",include_docs:!0},n=this.get("database");n.queryMainDB(t).then(function(t){if(t.rows){var n=t.rows.map(function(e){return e.doc});e.set("patientList",n)}})},actions:{returnToPatient:function(){this.controller.send("returnToPatient"),this.controller.send("closeModal")},returnToVisit:function(){this.controller.send("returnToVisit")}},setupController:function(e,t){this._super(e,t),this._fetchPatientList(e)}})}),define("hospitalrun/mixins/patient-name",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({getPatientDisplayId:function(e){var n=t.default.get(e,"externalPatientId"),a=t.default.get(e,"friendlyId"),l=t.default.get(e,"id");return t.default.isEmpty(a)?t.default.isEmpty(n)?l:n:a},getPatientDisplayName:function(e,n){var a=t.default.get(e,"firstName"),l=t.default.get(e,"lastName"),s=t.default.get(e,"middleName"),i=[];return t.default.isEmpty(a)||i.push(a),t.default.isEmpty(s)||n||i.push(s),t.default.isEmpty(l)||i.push(l),i.join(" ")}})}),define("hospitalrun/mixins/patient-notes",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({canAddNote:function(){return this.currentUserCan("add_note")&&(!t.default.isEmpty(this.get("visits"))||!t.default.isEmpty(this.get("model.visits")))},canDeleteNote:function(){return this.currentUserCan("delete_note")},_computeNoteType:function(e){switch(e.get("visitType")){case"Admission":return t.default.isEmpty(e.get("procedures"))?"Pre-op":"Post-op";case"Clinic":case"Followup":return"General";default:return e.get("visitType")}},_setNoteType:function(){var e=this.get("model");null==e.get("noteType")&&e.set("noteType",this._computeNoteType(e.get("visit")))}})}),define("hospitalrun/mixins/patient-submodule",["exports","ember-data","ember","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values"],function(e,t,n,a,l){var s=n.default.isEmpty;e.default=n.default.Mixin.create(a.default,{findPatientVisits:!0,needToUpdateVisit:!1,patientList:null,selectedPatient:null,newVisitAdded:null,actions:{showPatient:function(e){this.transitionToRoute("patients.edit",e)},returnToAllItems:function(){this._cancelUpdate(),this.send("allItems")},returnToPatient:function(){this._cancelUpdate(),this.transitionToRoute("patients.edit",this.get("model.returnToPatient"))},returnToVisit:function(){this._cancelUpdate(),this.transitionToRoute("visits.edit",this.get("model.returnToVisit"))},selectedPatientChanged:function(e){var t=this;n.default.isEmpty(e)?(this.set("model.patient",null),this.patientSelected()):this.store.find("patient",e.id).then(function(e){t.set("model.patient",e),t.patientSelected(e),n.default.run.once(t,function(){this.get("model").validate().catch(n.default.K)})})}},addChildToVisit:function(e,t,a){return new n.default.RSVP.Promise(function(l,s){var i=this.get("model.visit");n.default.isEmpty(i)?i=this.createNewVisit(a).then(function(n){this._finishAddChildToVisit(e,t,n,l,s)}.bind(this),s):this._finishAddChildToVisit(e,t,i,l,s)}.bind(this))},_finishAddChildToVisit:function(e,t,n,a,l){n.get(t).then(function(t){t.addObject(e),this.set("needToUpdateVisit",!0),a(n)}.bind(this),l)},cancelAction:function(){var e=this.get("model.returnToPatient"),t=this.get("model.returnToVisit");return s(t)?s(e)?"returnToAllItems":"returnToPatient":"returnToVisit"}.property("model.returnToPatient","model.returnToVisit"),createNewVisit:function(e){return new n.default.RSVP.Promise(function(t,n){var a=this.get("model"),l=a.get("patient"),s=this.get("store").createRecord("visit",{startDate:new Date,endDate:new Date,outPatient:!0,patient:l,visitType:e});a.set("visit",s),s.save().then(function(){s.reload().then(function(e){this.set("newVisitAdded",e),a.set("visit",e),t(e)}.bind(this),n)}.bind(this),n).catch(function(e){console.log("Error creating new visit"),n(e)}.bind(this))}.bind(this))},deleteChildFromVisit:function(e){var t=this,n=this.get("model");n.set("archived",!0),this.removeChildFromVisit(n,e).then(function(){n.save().then(function(){n.unloadRecord(),t.send("closeModal")})})},patientId:n.default.computed.alias("model.patient.id"),patientSelected:function(){},patientVisits:function(){var e=this.get("model.patient"),a=void 0;return a=!n.default.isEmpty(e)&&this.get("findPatientVisits")?this.getPatientVisits(e):n.default.RSVP.resolve([]),t.default.PromiseArray.create({promise:a})}.property("model.patient.id","newVisitAdded"),patientVisitsForSelect:function(){return t.default.PromiseArray.create({promise:this.get("patientVisits").then(function(e){return e.map(l.default.selectObjectMap)})})}.property("patientVisits.[]"),removeChildFromVisit:function(e,t){return new n.default.RSVP.Promise(function(a,l){var s=[],i=this.get("model.visit");s.addObjects(this.resolveVisitChildren()),n.default.RSVP.all(s,"Resolved visit children before removing "+t).then(function(){i.get(t).then(function(t){t.removeObject(e),i.save().then(a,l)}.bind(this),l)}.bind(this),l)}.bind(this))},resolveVisitChildren:function(){var e=[],t=this.get("model.visit");return n.default.isEmpty(t)||(e.push(t.get("imaging")),e.push(t.get("labs")),e.push(t.get("medication")),e.push(t.get("procedures")),e.push(t.get("vitals"))),e},saveVisitIfNeeded:function(e,t,n){this.get("needToUpdateVisit")?this.get("model.visit").save().then(function(){this.set("needToUpdateVisit",!1),this.displayAlert(e,t,n)}.bind(this)):this.displayAlert(e,t,n)},visitId:n.default.computed.alias("model.visit.id"),visitsController:n.default.computed.alias("controllers.visits")})}),define("hospitalrun/mixins/patient-visits",["exports","ember","hospitalrun/mixins/pouchdb","hospitalrun/utils/visit-statuses"],function(e,t,n,a){var l=t.default.isEmpty;e.default=t.default.Mixin.create(n.default,{getPatientVisits:function(e){var t=this.get("maxValue"),n=e.get("id");return this.store.query("visit",{options:{startkey:[n,null,null,null,"visit_"],endkey:[n,t,t,t,t]},mapReduce:"visit_by_patient",debug:!0})},checkoutVisit:function(e,t){var n=this;return e.set("status",t),e.set("endDate",new Date),e.save().then(function(l){return n.updatePatientVisitFlags(l).then(function(){var l=n.get("i18n"),s={patientName:e.get("patient.displayName")},i=void 0,o=void 0;t===a.default.CHECKED_OUT?(i=l.t("visits.messages.checkedOut",s),o=l.t("visits.titles.checkedOut")):(i=l.t("visits.messages.discharged",s),o=l.t("visits.titles.discharged")),n.displayAlert(o,i)})})},updatePatientVisitFlags:function(e){var n=e.get("patient"),l=n.get("admitted"),s=n.get("checkedIn"),i=this.get("model.status");return i!==a.default.ADMITTED||l?i!==a.default.CHECKED_IN||s?i===a.default.CHECKED_OUT&&s?this._updateUnlessVisitStatusExists(n,a.default.CHECKED_IN,"checkedIn"):i===a.default.DISCHARGED&&l?this._updateUnlessVisitStatusExists(n,a.default.ADMITTED,"admitted"):t.default.RSVP.resolve():(n.set("checkedIn",!0),n.save()):(n.set("admitted",!0),n.save())},_updateUnlessVisitStatusExists:function(e,t,n){return this.getPatientVisits(e).then(function(a){if(l(a.findBy("status",t)))return e.set(n,!1),e.save()})}})}),define("hospitalrun/mixins/payment-profiles",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({paymentProfiles:["Private","Discounted","Free"]})}),define("hospitalrun/mixins/pouch-adapter-utils",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({session:t.default.inject.service(),_pouchError:function(e){return function(n){if(401===n.status){var a=this.get("session");!t.default.isEmpty(a)&&a.get("isAuthenticated")&&a.invalidate()}var l=[n.status,(n.name||n.error)+":",n.message||n.reason].join(" ");t.default.run(null,e,l)}.bind(this)}})}),define("hospitalrun/mixins/pouchdb",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({maxValue:"￿"})}),define("hospitalrun/mixins/progress-dialog",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({progressDialog:null,progressDialogDefaults:{showProgress:!0,hideCancelButton:!0,hideUpdateButton:!0,progressBarValue:0,progressBarStyle:"width: 0%;"},progressInterval:500,progressMessage:null,progressTimer:null,progressTitle:null,scheduleProgress:function(e){return t.default.run.later(this,function(){e.apply(this),this.set("progressTimer",this.scheduleProgress(e))},this.get("progressInterval"))},updateProgressBar:function(){var e=this.get("progressDialog"),n=e.get("progressBarValue");n+=10,n>100&&(n=0),e.set("progressBarValue",n);var a=t.default.String.htmlSafe("width: "+n+"%");e.set("progressBarStyle",a)},closeProgressModal:function(){t.default.run.cancel(this.get("progressTimer")),this.send("closeModal")},showProgressModal:function(){var e=t.default.Object.create(this.get("progressDialogDefaults"));e.progressBarStyle=t.default.String.htmlSafe(e.progressBarStyle),e.set("title",this.get("progressTitle")),e.set("message",this.get("progressMessage")),this.set("progressDialog",e),this.set("progressTimer",this.scheduleProgress(this.get("updateProgressBar"))),this.send("openModal","dialog",e)}})}),define("hospitalrun/mixins/publish-statuses",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({publishStatuses:["Draft","Published","Private","Archived"]})}),define("hospitalrun/mixins/result-validation",["exports","ember","ember-i18n"],function(e,t,n){e.default=t.default.Mixin.create({validations:{result:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes"))return!1;var n=e.get("status"),a=e.get("result");return!("Completed"!==n||!t.default.isEmpty(a))},message:(0,n.translationMacro)("errors.result")}}}})}),define("hospitalrun/mixins/return-to",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({cancelAction:function(){var e=this.get("model.returnTo");return t.default.isEmpty(e)?"allItems":"returnTo"}.property("returnTo")})}),define("hospitalrun/mixins/setup-user-role",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({setupUserRole:function(){var e=this.get("session"),n=e.get("data.authenticated.role");return this.get("store").find("user-role",n.dasherize()).then(function(t){e.set("data.authenticated.userCaps",t.get("capabilities"));var n=e.get("store"),a=e.get("data");return n.persist(a),!0}).catch(t.default.K)}})}),define("hospitalrun/mixins/typeahead",["exports","ember-data","ember"],function(e,t,n){var a=n.default.computed,l=n.default.observer;e.default=n.default.Mixin.create({_mapContentItems:function(){var e=this,a=this.get("content");if(a){var l=a.filter(function(e){return!n.default.isEmpty(e)});return l=a instanceof t.default.RecordArray?l.map(function(t){var n=t.getProperties(e.get("displayKey"));return n[e.get("selectionKey")]=t,n}):l.map(function(t){var n={};return n[e.get("displayKey")]=t,n})}return[]},mappedContent:a("content",function(){return this._mapContentItems()}),contentChanged:l("content.[]",function(){var e=this.get("bloodhound");e&&(e.clear(),e.add(this._mapContentItems()))}),bloodhound:null,displayKey:"value",selectionKey:"value",hint:!0,highlight:!0,lastHint:null,limit:500,minlength:1,selectedItem:!1,inputElement:null,typeAhead:null,setOnBlur:!0,templates:null,selectedAction:null,_getSource:function(){var e=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace(this.get("displayKey")),queryTokenizer:Bloodhound.tokenizers.whitespace,local:this.get("mappedContent")});return e.initialize(),this.set("bloodhound",e),e.ttAdapter()},didInsertElement:function(){var e=this,t=this.$("input");this.set("inputElement",t);var a=t.typeahead({autoselect:!0,hint:this.get("hint"),highlight:this.get("highlight"),minLength:this.get("minlength")},{displayKey:this.get("displayKey"),limit:this.get("limit"),source:this._getSource(),templates:this.get("templates")});this.set("typeAhead",a),a.on("typeahead:selected",function(t,n){e.itemSelected(n[e.get("selectionKey")])}),a.on("typeahead:autocompleted",function(t,n){e.itemSelected(n[e.get("selectionKey")])}),this.get("setOnBlur")&&(t.on("keyup",function(){var t=e.$(".tt-hint"),n=t.val();e.set("lastHint",n),e.set("selectedItem",!1)}),t.on("blur",function(t){var a=e.get("selection"),l=t.target.value.trim();n.default.isEmpty(a)||(a.trim&&(a=a.trim()),e.set("selection",a)),e.get("selectedItem")||!function(){var s=e.get("lastHint"),i=!1;n.default.isEmpty(s)&&(s=l,i=!0),n.default.isEmpty(l)||n.default.isEmpty(s)?n.default.isEmpty(l)&&e.itemSelected():e.get("bloodhound").search(s,function(n){n.length>0?i&&s.toLowerCase()!==n[0][e.get("displayKey")].toLowerCase()||(e.itemSelected(n[0][e.get("selectionKey")]),t.target.value=n[0][e.get("displayKey")],e.get("model").set(e.get("propertyName"),t.target.value)):l!==a&&e.itemSelected()})}()}))},itemSelected:function(e){this.set("selection",e),this.set("selectedItem",!0);var t=this.get("selectedAction");n.default.isEmpty(t)||this.sendAction("selectedAction",e)},willDestroyElement:function(){this.get("inputElement").typeahead("destroy")}})}),define("hospitalrun/mixins/unit-types",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({defaultUnitList:["ampoule","bag","bottle","box","bundle","capsule","case","container","cream","each","gel","nebule","ointment","pack","pair","pallet","patch","pcs","pill","plastic","polyamp","roll","spray","suppository","suspension","set","syrup","tablet","tray","tube","vial"],unitList:function(){var e=this.get("defaultUnitList"),n=this.get("inventoryUnitList");return t.default.isEmpty(n)?e:n}.property("inventoryUnitList","defaultUnitList"),unitListForSelect:t.default.computed.map("unitList",n.default.selectValuesMap)})}),define("hospitalrun/mixins/user-roles",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({userRoles:[{name:"Data Entry",roles:["Data Entry","user"]},{name:"Doctor",roles:["Doctor","user"]},{name:"Finance",roles:["Finance","user"]},{name:"Finance Manager",roles:["Finance Manager","user"]},{name:"Hospital Administrator",roles:["Hospital Administrator","user"]},{name:"Inventory Manager",roles:["Inventory Manager","user"]},{name:"Imaging Technician",roles:["Imaging Technician","user"]},{name:"Lab Technician",roles:["Lab Technician","user"]},{name:"Medical Records Officer",roles:["Medical Records Officer","user"]},{name:"Nurse",roles:["Nurse","user"]},{name:"Nurse Manager",roles:["Nurse Manager","user"]},{name:"Patient Administration",roles:["Patient Administration","user"]},{name:"Pharmacist",roles:["Pharmacist","user"]},{name:"Social Worker",roles:["Social Worker","user"]},{name:"System Administrator",roles:["System Administrator","admin","user"]},{name:"User Administrator",roles:["User Administrator","admin","user"]}]})}),define("hospitalrun/mixins/user-session",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({session:t.default.inject.service(),defaultCapabilities:{admin:["User Administrator","System Administrator"],appointments:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_appointment:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_charge:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],add_billing_diagnosis:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],add_diagnosis:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],add_medication:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Pharmacist","System Administrator"],add_photo:["Data Entry","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_patient:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],add_pricing:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","System Administrator"],add_pricing_profile:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","System Administrator"],add_lab:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Lab Technician","System Administrator"],add_imaging:["Data Entry","Doctor","Hospital Administrator","Imaging Technician","Medical Records Officer","System Administrator"],add_inventory_request:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","Nurse Manager","Pharmacist","System Administrator"],add_inventory_item:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"],add_inventory_purchase:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"],add_invoice:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],add_payment:["Hospital Administrator","Medical Records Officer","System Administrator"],add_procedure:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","System Administrator"],add_socialwork:["Hospital Administrator","Medical Records Officer","Social Worker","System Administrator"],add_user:["User Administrator","System Administrator"],add_visit:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],add_vitals:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","System Administrator"],admit_patient:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],adjust_inventory_location:["Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"],billing:["Hospital Administrator","Finance","Finance Manager","System Administrator"],complete_imaging:["Imaging Technician","Medical Records Officer","System Administrator"],complete_lab:["Lab Technician","Medical Records Officer","System Administrator"],delete_appointment:["Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],delete_diagnosis:["Doctor","Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],delete_inventory_item:["Hospital Administrator","Inventory Manager","Medical Records Officer","System Administrator"], -delete_imaging:["Doctor","Hospital Administrator","Medical Records Officer","System Administrator"],delete_invoice:["Hospital Administrator","System Administrator"],delete_lab:["Doctor","Hospital Administrator","Medical Records Officer","System Administrator"],delete_medication:["Doctor","Hospital Administrator","Medical Records Officer","System Administrator"],delete_photo:["Data Entry","Hospital Administrator","Medical Records Officer","Patient Administration","Social Worker","System Administrator"],delete_patient:["Hospital Administrator","Medical Records Officer","Patient Administration","System Administrator"],delete_pricing:["Finance","Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],delete_pricing_profile:["Finance","Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],delete_procedure:["Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","System Administrator"],delete_socialwork:["Hospital Administrator","Medical Records Officer","Social Worker","System Administrator"],delete_vitals:["Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","System Administrator"],delete_visit:["Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],delete_user:["User Administrator","System Administrator"],discharge_patient:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],edit_invoice:["Data Entry","Hospital Administrator","Medical Records Officer","System Administrator"],fulfill_inventory:["Hospital Administrator","Inventory Manager","Medical Records Officer","Pharmacist","System Administrator"],fulfill_medication:["Medical Records Officer","Pharmacist","System Administrator"],imaging:["Data Entry","Doctor","Hospital Administrator","Imaging Technician","Medical Records Officer","System Administrator"],invoices:["Hospital Administrator","Finance","Finance Manager","System Administrator"],labs:["Data Entry","Doctor","Hospital Administrator","Lab Technician","Medical Records Officer","System Administrator"],medication:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Pharmacist","System Administrator"],inventory:["Data Entry","Hospital Administrator","Inventory Manager","Medical Records Officer","Nurse Manager","Pharmacist","System Administrator"],load_db:["System Administrator"],override_invoice:["Hospital Administrator","System Administrator"],query_db:["System Administrator"],patients:["Data Entry","Doctor","Finance","Finance Manager","Hospital Administrator","Imaging Technician","Lab Technician","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","Social Worker","System Administrator"],patient_reports:["Hospital Administrator","Patient Administration","System Administrator"],pricing:["Data Entry","Finance","Hospital Administrator","Medical Records Officer","System Administrator"],visits:["Data Entry","Doctor","Hospital Administrator","Medical Records Officer","Nurse Manager","Nurse","Patient Administration","Social Worker","System Administrator"],update_config:["System Administrator"],users:["User Administrator","System Administrator"],add_note:["Doctor","Medical Records Officer","Nurse","Nurse Manager","Patient Administration","System Administrator"],delete_note:["Medical Records Officer","Nurse Manager","Patient Administration","System Administrator"],define_user_roles:["System Administrator"]},_getUserSessionVars:function(){var e=this.get("session");if(!t.default.isEmpty(e)&&e.get("isAuthenticated"))return e.get("data.authenticated")},currentUserCan:function(e){var n=this._getUserSessionVars();if(!t.default.isEmpty(n)&&!t.default.isEmpty(n.role)){var a=this.get("session").get("data.authenticated.userCaps");if(!t.default.isEmpty(a))return a.includes(e.camelize());var l=this.get("defaultCapabilities"),s=l[e];if(!t.default.isEmpty(s))return s.includes(n.role)}return!1},getUserName:function(e){var n=void 0,a=this._getUserSessionVars();return t.default.isEmpty(a)||(e?n=a.name:t.default.isEmpty(a.displayName)?t.default.isEmpty(a.name)||(n=a.name):n=a.displayName),n}})}),define("hospitalrun/mixins/visit-types",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({defaultVisitTypes:["Admission","Clinic","Followup","Imaging","Lab","Pharmacy"],_getVisitTypes:function(e){var a=this.get("defaultVisitTypes"),l=this.get("visitTypesList"),s=void 0;return s=t.default.isEmpty(l)?a:l.get("value"),s=n.default.selectValues(s,e)},visitTypes:function(){return this._getVisitTypes()}.property("visitTypesList","defaultVisitTypes").volatile(),visitTypesWithEmpty:function(){return this._getVisitTypes(!0)}.property("visitTypesList","defaultVisitTypes").volatile()})}),define("hospitalrun/models/abstract",["exports","ember-data","ember","ember-validations","ember-pouch","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s){var i=n.default.get,o=n.default.inject,r=n.default.isEmpty;e.default=l.Model.extend(s.default,a.default,{session:o.service(),archived:t.default.attr("boolean"),lastModified:t.default.attr("date"),modifiedBy:t.default.attr(),modifiedFields:t.default.attr(),loadedCustomForms:null,didLoad:function(){var e=this.get("customForms");r(e)||(e=JSON.parse(JSON.stringify(e))),this.set("loadedCustomForms",e)},changedAttributes:function e(){var e=this._super(),t=this.get("customForms"),n=this.get("loadedCustomForms");if(!r(t)){r(n)&&(n={});var a=Object.keys(t);a.forEach(function(a){var l=n[a],s="customForms."+a;r(l)&&(l={});var o=i(t,a),d=Object.keys(o);d.forEach(function(t){var n=i(l,t),a=i(o,t);n!=a&&(e[s+"."+t]=[n,a])})})}return e},save:function(e){var t=void 0,a=this.changedAttributes(),l=new Date,s=this.get("modifiedFields"),i=this.get("session");if(!i||!i.get("isAuthenticated"))return new n.default.RSVP.Promise(function(e,t){n.default.run(null,t,"ERROR you must be logged in to save")});if(this.get("hasDirtyAttributes")&&!this.get("isDeleted")){r(s)&&(s={}),this.set("lastModified",l);for(t in a)s[t]=l;this.set("modifiedFields",s),this.set("modifiedBy",this.getUserName())}return this._super(e).catch(function(t){if(!r(e)&&e.retry)throw t;if(t.name&&t.name.indexOf&&t.name.indexOf("conflict")>-1)return this.rollbackAttributes(),this.reload().then(function(t){for(var l in a)t.set(l,a[l][1]);return n.default.isEmpty(e)&&(e={}),e.retry=!0,t.save(e)});throw t}.bind(this))}})}),define("hospitalrun/models/add-diagnosis",["exports","ember-data","ember-validations","ember-pouch"],function(e,t,n,a){e.default=a.Model.extend(n.default,{diagnosis:t.default.attr("string"),validations:{diagnosis:{presence:!0}}})}),define("hospitalrun/models/allergy",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({patient:n.default.belongsTo("patient"),name:n.default.attr("string"),icd9CMCode:n.default.attr("string"),icd10Code:n.default.attr("string")})}),define("hospitalrun/models/appointment",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/utils/patient-validation"],function(e,t,n,a,l){e.default=t.default.extend({allDay:n.default.attr(),patient:n.default.belongsTo("patient",{async:!1}),visits:n.default.hasMany("visit"),provider:n.default.attr("string"),location:n.default.attr("string"),appointmentType:n.default.attr("string"),startDate:n.default.attr("date"),endDate:n.default.attr("date"),notes:n.default.attr("string"),status:n.default.attr("string",{defaultValue:"Scheduled"}),longDateFormat:"l h:mm A",shortDateFormat:"l",timeFormat:"h:mm A",_getDateSpan:function(e,t,n){var a=e.format(n),l=t.format(n);return a+" - "+l},appointmentDate:function(){var e=this.get("startDate");return e}.property("startDate"),displayStatus:function(){var e=this.get("status");return a.default.isEmpty(e)&&(e="Scheduled"),e}.property("status"),formattedAppointmentDate:function(){var e=this.get("allDay"),t=moment(this.get("endDate")),n="",a="",l=moment(this.get("startDate"));return l.isSame(t,"day")?(a=l.format(this.get("shortDateFormat")),e||(a+=" ",a+=this._getDateSpan(l,t,this.get("timeFormat")))):(n=e?this.get("shortDateFormat"):this.get("longDateFormat"),a=this._getDateSpan(l,t,n)),a}.property("startDate","endDate"),validations:{appointmentDate:{presence:{if:function(e){var t=e.get("appointmentType");return"Admission"!==t}}},patientTypeAhead:l.default.patientTypeAhead,patient:{presence:!0},appointmentType:{presence:!0},location:{presence:!0},startDate:{presence:!0},endDate:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes"))return!1;var t=e.get("allDay"),n=e.get("startDate"),l=e.get("endDate");if(a.default.isEmpty(l)||a.default.isEmpty(n))return!0;if(t){if(l.getTime()l},message:"Invalid quantity"}},dateCompleted:{presence:{message:"Please provide a date"}},transferLocation:{acceptance:{accept:!0,if:function(e){var t=e.get("transferLocation"),n=e.get("transferItem");return!(a.default.isEmpty(n)||!a.default.isEmpty(t))},message:"Please select a location to transfer to"}}}});e.default=s}),define("hospitalrun/models/inv-purchase",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/location-name","hospitalrun/mixins/number-format"],function(e,t,n,a,l,s){function i(){return[]}var o=t.default.extend(l.default,s.default,{purchaseCost:n.default.attr("number"),lotNumber:n.default.attr("string"),dateReceived:n.default.attr("date"),costPerUnit:function(){var e=this.get("purchaseCost"),t=parseInt(this.get("originalQuantity"));return a.default.isEmpty(e)||a.default.isEmpty(t)||0===e||0===t?0:this._numberFormat(e/t,!0)}.property("purchaseCost","originalQuantity"),originalQuantity:n.default.attr("number"),currentQuantity:n.default.attr("number"),expirationDate:n.default.attr("date"),expired:n.default.attr("boolean"),location:n.default.attr("string"),aisleLocation:n.default.attr("string"),giftInKind:n.default.attr("boolean"),inventoryItem:n.default.attr("string"),vendor:n.default.attr("string"),vendorItemNo:n.default.attr("string"),distributionUnit:n.default.attr("string"),invoiceNo:n.default.attr("string"),quantityGroups:n.default.attr({defaultValue:i}),validations:{purchaseCost:{numericality:!0},originalQuantity:{numericality:{greaterThanOrEqualTo:0}},vendor:{presence:!0}}});e.default=o}),define("hospitalrun/models/inv-request",["exports","hospitalrun/models/abstract","hospitalrun/mixins/inventory-adjustment-types","ember-data","ember","hospitalrun/mixins/location-name"],function(e,t,n,a,l,s){var i=t.default.extend(n.default,s.default,{adjustPurchases:a.default.attr("boolean"),completedBy:a.default.attr("string"),costPerUnit:a.default.attr("number"),dateCompleted:a.default.attr("date"),dateRequested:a.default.attr("date"),deliveryAisle:a.default.attr("string"),deliveryLocation:a.default.attr("string"),expenseAccount:a.default.attr("string"),inventoryItem:a.default.belongsTo("inventory",{async:!0}),locationsAffected:a.default.attr(),markAsConsumed:a.default.attr("boolean",{defaultValue:!0}),patient:a.default.belongsTo("patient",{async:!1}),purchasesAffected:a.default.attr(),quantity:a.default.attr("number"),quantityAtCompletion:a.default.attr("number"),reason:a.default.attr("string"),requestedBy:a.default.attr("string"),status:a.default.attr("string"),transactionType:a.default.attr("string"),visit:a.default.belongsTo("visit",{async:!1}),deliveryLocationName:function(){var e=this.get("deliveryAisle"),t=this.get("deliveryLocation");return this.formatLocationName(t,e)}.property("deliveryAisle","deliveryLocation"),deliveryDetails:function(){var e=this.get("deliveryLocationName"),t=this.get("patient");return l.default.isEmpty(t)?e:t.get("displayName")}.property("deliveryAisle","deliveryLocation","patient"),haveReason:function(){return!l.default.isEmpty(this.get("reason"))}.property("reason"),isAdjustment:function(){var e=this.get("adjustmentTypes"),t=this.get("transactionType"),n=e.findBy("type",t);return!l.default.isEmpty(n)}.property("transactionType"),isFulfillment:function(){return"Fulfillment"===this.get("transactionType")}.property("transactionType"),isTransfer:function(){return"Transfer"===this.get("transactionType")}.property("transactionType"),validations:{inventoryItemTypeAhead:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes"))return!1;var t=e.get("inventoryItem.name"),n=e.get("inventoryItemTypeAhead"),a=e.get("requestedItems"),s=e.get("status");if("Requested"===s)return!1;if(l.default.isEmpty(t)||l.default.isEmpty(n))return l.default.isEmpty(a);var i=n.substr(0,t.length);return t!==i},message:"Please select a valid inventory item"}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},if:function(e){var t=e.get("requestedItems");return l.default.isEmpty(t)}},acceptance:{accept:!0,if:function(e){var t=e.get("isNew"),n=parseInt(e.get("quantity")),a=e.get("transactionType"),l=null;return"Return"!==a&&(l=t&&"Request"===a?e.get("inventoryItem.quantity"):e.get("inventoryLocation.quantity"),n>l)},message:"The quantity must be less than or equal to the number of available items."}}}});e.default=i}),define("hospitalrun/models/inventory-batch",["exports","hospitalrun/models/abstract","ember"],function(e,t,n){e.default=t.default.extend({haveInvoiceItems:function(){var e=this.get("invoiceItems");return!n.default.isEmpty(e)},validations:{dateReceived:{presence:!0},inventoryItemTypeAhead:{presence:{unless:function(e){return e.haveInvoiceItems()}}},purchaseCost:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},unless:function(e){return e.haveInvoiceItems()}}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},unless:function(e){return e.haveInvoiceItems()}}},vendor:{presence:!0}}})}),define("hospitalrun/models/inventory",["exports","hospitalrun/models/abstract","ember-data","ember","ember-computed","hospitalrun/mixins/location-name","hospitalrun/utils/item-condition"],function(e,t,n,a,l,s,i){var o={if:function(e){var t=e.get("skipSavePurchase");return!t&&e.get("isNew")}};e.default=t.default.extend(s.default,{purchases:n.default.hasMany("inv-purchase",{async:!1}),locations:n.default.hasMany("inv-location",{async:!1}),description:n.default.attr("string"),friendlyId:n.default.attr("string"),keywords:n.default.attr(),name:n.default.attr("string"),quantity:n.default.attr("number"),crossReference:n.default.attr("string"),inventoryType:n.default.attr("string"),price:n.default.attr("number"),reorderPoint:n.default.attr("number"),distributionUnit:n.default.attr("string"),rank:n.default.attr("string"),estimatedDaysOfStock:14,availableLocations:(0,l.default)("locations.@each.quantity",function(){var e=this.get("locations").filter(function(e){return e.get("quantity")>0});return e}),displayLocations:(0,l.default)("availableLocations",function(){var e=this,t=this.get("availableLocations"),n=[];return t.forEach(function(t){var l=t.get("aisleLocation"),s=t.get("location"),i=e.formatLocationName(s,l);a.default.isEmpty(i)||n.push(i)}),n.toString()}),condition:(0,l.default)("rank","estimatedDaysOfStock",function(){var e=this.get("estimatedDaysOfStock"),t=(0,i.rankToMultiplier)(this.get("rank"));return(0,i.getCondition)(e,t)}),validations:{distributionUnit:{presence:!0},purchaseCost:{numericality:o},name:{presence:!0},quantity:{numericality:{validateIfNewItem:o,greaterThanOrEqualTo:0}},price:{numericality:{allowBlank:!0}},originalQuantity:{presence:o},reorderPoint:{numericality:{allowBlank:!0}},inventoryType:{presence:!0},vendor:{presence:o}},updateQuantity:function(){var e=this.get("purchases"),t=e.reduce(function(e,t){var n=0;return t.get("expired")||(n=t.get("currentQuantity")),e+n},0);this.set("quantity",t)}})}),define("hospitalrun/models/invoice",["exports","hospitalrun/models/abstract","hospitalrun/mixins/date-format","ember-data","ember","hospitalrun/mixins/number-format","hospitalrun/utils/patient-validation"],function(e,t,n,a,l,s,i){e.default=t.default.extend(n.default,s.default,{externalInvoiceNumber:a.default.attr("string"),patient:a.default.belongsTo("patient",{async:!1}),patientInfo:a.default.attr("string"),visit:a.default.belongsTo("visit",{async:!1}),status:a.default.attr("string"),remarks:a.default.attr("string"),billDate:a.default.attr("date"),paidTotal:a.default.attr("number"),paymentProfile:a.default.belongsTo("price-profile",{async:!1}),payments:a.default.hasMany("payment",{async:!1}),lineItems:a.default.hasMany("billing-line-item",{async:!1}),addPayment:function(e){var t=this.get("payments");t.addObject(e),this.paymentAmountChanged()},billDateAsTime:function(){return this.dateToTime(this.get("billDate"))}.property("billDate"),discountTotals:l.default.computed.mapBy("lineItemsByCategory","discount"),discount:l.default.computed.sum("discountTotals"),nationalInsuranceTotals:l.default.computed.mapBy("lineItemsByCategory","nationalInsurance"),nationalInsurance:l.default.computed.sum("nationalInsuranceTotals"),paidFlag:function(){return"Paid"===this.get("status")}.property("status"),remainingBalance:function(){var e=this.get("patientResponsibility"),t=this.get("paidTotal");return this._numberFormat(e-t,!0)}.property("patientResponsibility","paidTotal"),privateInsuranceTotals:l.default.computed.mapBy("lineItemsByCategory","privateInsurance"),privateInsurance:l.default.computed.sum("privateInsuranceTotals"),lineTotals:l.default.computed.mapBy("lineItems","total"),total:l.default.computed.sum("lineTotals"),displayInvoiceNumber:function(){var e=this.get("externalInvoiceNumber"),t=this.get("id");return l.default.isEmpty(e)?t:e}.property("externalInvoiceNumber","id"),lineItemsByCategory:function(){var e=this.get("lineItems"),t=[];return e.forEach(function(e){var n=e.get("category"),a=t.findBy("category",n);l.default.isEmpty(a)&&(a={category:n,items:[]},t.push(a)),a.items.push(e)}.bind(this)),t.forEach(function(e){e.amountOwed=this._calculateTotal(e.items,"amountOwed"),e.discount=this._calculateTotal(e.items,"discount"),e.nationalInsurance=this._calculateTotal(e.items,"nationalInsurance"),e.privateInsurance=this._calculateTotal(e.items,"privateInsurance"),e.total=this._calculateTotal(e.items,"total")}.bind(this)),t}.property("lineItems.@each.amountOwed"),patientIdChanged:function(){if(!l.default.isEmpty(this.get("patient"))){var e=this.get("patient.displayName"),t=this.get("patient.displayPatientId");this.set("patientInfo",e+" - "+t)}}.observes("patient.displayName","patient.id","patient.displayPatientId"),patientResponsibilityTotals:l.default.computed.mapBy("lineItems","amountOwed"),patientResponsibility:l.default.computed.sum("patientResponsibilityTotals"),paymentAmountChanged:function(){var e=this.get("payments").filter(function(e){return!e.get("isNew")});if(0!==e.length){var t=e.reduce(function(e,t){return e+=this._getValidNumber(t.get("amount"))}.bind(this),0);this.set("paidTotal",this._numberFormat(t,!0));var n=this.get("remainingBalance");n<=0&&this.set("status","Paid")}}.observes("payments.[]","payments.@each.amount"),validations:{patientTypeAhead:i.default.patientTypeAhead,patient:{presence:!0},visit:{presence:!0}}})}),define("hospitalrun/models/lab",["exports","hospitalrun/models/abstract","hospitalrun/mixins/can-edit-requested","hospitalrun/mixins/date-format","ember-data","hospitalrun/utils/patient-validation","hospitalrun/mixins/result-validation"],function(e,t,n,a,l,s,i){e.default=t.default.extend(n.default,a.default,i.default,{charges:l.default.hasMany("proc-charge",{async:!1}),labDate:l.default.attr("date"),labType:l.default.belongsTo("pricing",{async:!1}),notes:l.default.attr("string"),patient:l.default.belongsTo("patient",{async:!1}),requestedBy:l.default.attr("string"),requestedDate:l.default.attr("date"),result:l.default.attr("string"),status:l.default.attr("string"),visit:l.default.belongsTo("visit",{async:!1}),labDateAsTime:function(){return this.dateToTime(this.get("labDate"))}.property("labDate"),requestedDateAsTime:function(){return this.dateToTime(this.get("requestedDate"))}.property("requestedDate"),validations:{labTypeName:{presence:{if:function(e){if(e.get("isNew"))return!0},message:"Please select a lab type"}},patientTypeAhead:s.default.patientTypeAhead,patient:{presence:!0}}})}),define("hospitalrun/models/line-item-detail",["exports","hospitalrun/models/abstract","ember-data","hospitalrun/mixins/number-format"],function(e,t,n,a){e.default=t.default.extend(a.default,{department:n.default.attr("string"),expenseAccount:n.default.attr("string"),name:n.default.attr("string"),price:n.default.attr("number"),pricingItem:n.default.belongsTo("pricing",{async:!1}),quantity:n.default.attr("number"),total:n.default.attr("number"),amountOwed:function(){var e=this.get("price"),t=this.get("quantity"),n=0;return this._validNumber(e)&&this._validNumber(t)&&(n=this._numberFormat(e*t,!0)),n}.property("price","quantity")})}),define("hospitalrun/models/lookup",["exports","ember-pouch","ember-data"],function(e,t,n){e.default=t.Model.extend({_attachments:n.default.attr(),importFile:n.default.attr("boolean",{defaultValue:!1}),value:n.default.attr(""),organizeByType:n.default.attr("boolean"),userCanAdd:n.default.attr("boolean")})}),define("hospitalrun/models/medication",["exports","hospitalrun/models/abstract","hospitalrun/mixins/can-edit-requested","ember-data","hospitalrun/mixins/date-format","ember","hospitalrun/mixins/medication-details"],function(e,t,n,a,l,s,i){e.default=t.default.extend(n.default,l.default,i.default,{inventoryItem:a.default.belongsTo("inventory",{async:!0}),notes:a.default.attr("string"),patient:a.default.belongsTo("patient",{async:!1}),prescription:a.default.attr("string"),prescriptionDate:a.default.attr("date"),quantity:a.default.attr("number"),refills:a.default.attr("number"),requestedDate:a.default.attr("date"),requestedBy:a.default.attr("string"),status:a.default.attr("string"),visit:a.default.belongsTo("visit",{async:!1}),isRequested:function(){var e=this.get("status");return"Requested"===e}.property("status"),medicationName:function(){return this.getMedicationName("inventoryItem")}.property("medicationTitle","inventoryItem"),medicationPrice:function(){return this.getMedicationPrice("inventoryItem")}.property("priceOfMedication","inventoryItem"),prescriptionDateAsTime:function(){return this.dateToTime(this.get("prescriptionDate"))}.property("prescriptionDate"),requestedDateAsTime:function(){return this.dateToTime(this.get("requestedDate"))}.property("requestedDate"),validations:{prescription:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes")||e.get("isFulfilling"))return!1;var t=e.get("prescription"),n=e.get("quantity");return!(!s.default.isEmpty(t)||!s.default.isEmpty(n))},message:"Please enter a prescription or a quantity"}},inventoryItemTypeAhead:{acceptance:{accept:!0,if:function(e){if(!e.get("hasDirtyAttributes")||!e.get("isNew"))return!1;var t=e.get("inventoryItem.name"),n=e.get("inventoryItemTypeAhead");if(s.default.isEmpty(t)||s.default.isEmpty(n))return!0;var a=n.substr(0,t.length);return t!==a},message:"Please select a valid medication"}},patientTypeAhead:{presence:{if:function(e){return e.get("selectPatient")}}},quantity:{numericality:{allowBlank:!0,greaterThan:0,messages:{greaterThan:"must be greater than 0"}},presence:{if:function(e){var t=e.get("isFulfilling");return t}},acceptance:{accept:!0,if:function(e){var t=e.get("isFulfilling"),n=parseInt(e.get("quantity")),a=null;return!!t&&(a=e.get("inventoryItem.quantity"),n>a)},message:"The quantity must be less than or equal to the number of available medication."}},refills:{numericality:{allowBlank:!0}}}})}),define("hospitalrun/models/option",["exports","ember-pouch","ember-data"],function(e,t,n){e.default=t.Model.extend({value:n.default.attr("")})}),define("hospitalrun/models/override-price",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({profile:n.default.belongsTo("price-profile",{async:!1}),price:n.default.attr("number"),validations:{profile:{presence:!0},price:{numericality:!0}}})}),define("hospitalrun/models/patient-note",["exports","hospitalrun/models/abstract","ember","ember-data"],function(e,t,n,a){e.default=t.default.extend({authoredBy:function(){if(n.default.isEmpty(this.get("attribution")))return this.get("createdBy");var e=this.get("i18n");return this.get("createdBy")+" "+e.t("patients.notes.onBehalfOfCopy")+" "+this.get("attribution")}.property("attribution","createdBy"),attribution:a.default.attr("string"),content:a.default.attr("string"),createdBy:a.default.attr("string"),date:a.default.attr("date"),noteType:a.default.attr(),patient:a.default.belongsTo("patient",{async:!1}),visit:a.default.belongsTo("visit",{async:!1}),validations:{patient:{presence:!0},visit:{presence:!0},noteType:{presence:!0},content:{presence:!0}}})}),define("hospitalrun/models/patient",["exports","hospitalrun/models/abstract","hospitalrun/mixins/dob-days","hospitalrun/utils/email-validation","ember","ember-data","hospitalrun/mixins/patient-name"],function(e,t,n,a,l,s,i){var o=l.default.computed;e.default=t.default.extend(n.default,i.default,{admitted:s.default.attr("boolean",{defaultValue:!1}),additionalContacts:s.default.attr(),address:s.default.attr("string"),address2:s.default.attr("string"),address3:s.default.attr("string"),address4:s.default.attr("string"),allergies:s.default.hasMany("allergy",{async:!0}),bloodType:s.default.attr("string"),clinic:s.default.attr("string"),country:s.default.attr("string"),checkedIn:s.default.attr("boolean",{defaultValue:!1}),customForms:s.default.attr("custom-forms"),dateOfBirth:s.default.attr("date"),diagnoses:s.default.hasMany("diagnosis",{async:!1}),economicClassification:s.default.attr("string"),email:s.default.attr("string"),expenses:s.default.attr(),externalPatientId:s.default.attr("string"),familySupport1:s.default.attr("string"),familySupport2:s.default.attr("string"),familySupport3:s.default.attr("string"),familySupport4:s.default.attr("string"),familySupport5:s.default.attr("string"),friendlyId:s.default.attr("string"),familyInfo:s.default.attr(),firstName:s.default.attr("string"),sex:s.default.attr("string"),occupation:s.default.attr("string"),history:s.default.attr("string"),insurance:s.default.attr("string"),lastName:s.default.attr("string"),livingArrangement:s.default.attr("string"),middleName:s.default.attr("string"),notes:s.default.attr("string"),otherIncome:s.default.attr("string"), -payments:s.default.hasMany("payment",{async:!0}),patientType:s.default.attr("string"),parent:s.default.attr("string"),paymentProfile:s.default.belongsTo("price-profile",{async:!1}),phone:s.default.attr("string"),placeOfBirth:s.default.attr("string"),referredDate:s.default.attr("date"),referredBy:s.default.attr("string"),religion:s.default.attr("string"),socialActionTaken:s.default.attr("string"),socialRecommendation:s.default.attr("string"),status:s.default.attr("string"),age:function(){var e=this.get("dateOfBirth");return this.convertDOBToText(e)}.property("dateOfBirth"),displayAddress:function(){var e=this.getProperties("address","address2","address3","address4"),t="";for(var n in e)l.default.isEmpty(e[n])||(l.default.isEmpty(t)||(t+=", "),t+=e[n]);return t}.property("address","address2","address3","address4"),displayName:function(){return this.getPatientDisplayName(this)}.property("firstName","lastName","middleName"),displayPatientId:function(){return this.getPatientDisplayId(this)}.property("id","externalPatientId","friendlyId"),shortAge:function(){var e=this.get("dateOfBirth");return this.convertDOBToText(e,!0)}.property("dateOfBirth"),shortDisplayName:o("firstName","lastName",function(){return this.getPatientDisplayName(this,!0)}),validations:{email:{format:{with:a.default.emailRegex,allowBlank:!0,message:"please enter a valid email address"}},friendlyId:{presence:!0},firstName:{presence:!0},lastName:{presence:!0}}})}),define("hospitalrun/models/payment",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({amount:n.default.attr("number"),charityPatient:n.default.attr("boolean"),expenseAccount:n.default.attr("string"),invoice:n.default.belongsTo("invoice",{async:!1}),datePaid:n.default.attr("date"),paymentType:n.default.attr("string"),notes:n.default.attr("string"),canRemovePayment:function(){return"Deposit"===this.get("paymentType")}.property("paymentType"),validations:{amount:{numericality:!0},datePaid:{presence:!0}}})}),define("hospitalrun/models/photo",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({_attachments:n.default.attr(),coverImage:n.default.attr("boolean"),fileName:n.default.attr("string"),localFile:n.default.attr("boolean"),patient:n.default.belongsTo("patient",{async:!1}),caption:n.default.attr("string"),url:n.default.attr("string")})}),define("hospitalrun/models/price-profile",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({name:n.default.attr("string"),discountAmount:n.default.attr("number"),discountPercentage:n.default.attr("number"),validations:{name:{presence:!0},discountAmount:{numericality:{allowBlank:!0}},discountPercentage:{numericality:{allowBlank:!0}}}})}),define("hospitalrun/models/pricing",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({category:n.default.attr("string"),expenseAccount:n.default.attr("string"),name:n.default.attr("string"),price:n.default.attr("number"),pricingType:n.default.attr("string"),pricingOverrides:n.default.hasMany("override-price",{async:!1}),validations:{category:{presence:!0},name:{presence:!0},price:{numericality:!0}}})}),define("hospitalrun/models/proc-charge",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/medication-details"],function(e,t,n,a,l){e.default=t.default.extend(l.default,{medication:n.default.belongsTo("inventory",{async:!1}),pricingItem:n.default.belongsTo("pricing",{async:!1}),quantity:n.default.attr("number"),dateCharged:n.default.attr("date"),medicationCharge:function(){var e=this.get("medication"),t=this.get("newMedicationCharge");return!a.default.isEmpty(e)||!a.default.isEmpty(t)}.property("medication","newMedicationCharge"),medicationName:function(){return this.get("medication.name")}.property("medication"),medicationPrice:function(){return this.get("medication.price")}.property("medication"),validations:{itemName:{presence:!0,acceptance:{accept:!0,if:function(e){var t=e.get("medicationCharge");if(!t||!e.get("hasDirtyAttributes"))return!1;var n=e.get("inventoryItem.name"),l=e.get("itemName");if(a.default.isEmpty(n)||a.default.isEmpty(l))return!0;var s=l.substr(0,n.length);return n!==s},message:"Please select a valid medication"}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"}}}}})}),define("hospitalrun/models/procedure",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({anesthesiaType:n.default.attr("string"),anesthesiologist:n.default.attr("string"),assistant:n.default.attr("string"),description:n.default.attr("string"),charges:n.default.hasMany("proc-charge",{async:!1}),cptCode:n.default.attr("string"),location:n.default.attr("string"),notes:n.default.attr("string"),physician:n.default.attr("string"),procedureDate:n.default.attr("date"),timeStarted:n.default.attr("string"),timeEnded:n.default.attr("string"),visit:n.default.belongsTo("visit",{async:!1}),validations:{description:{presence:!0},oxygenHours:{numericality:{allowBlank:!0}},pacuHours:{numericality:{allowBlank:!0}},physician:{presence:!0},procedureDate:{presence:!0},display_procedureDate:{presence:{message:"Please select a valid date"}}}})}),define("hospitalrun/models/sequence",["exports","ember-pouch","ember-data"],function(e,t,n){e.default=t.Model.extend({prefix:n.default.attr("string"),value:n.default.attr("number")})}),define("hospitalrun/models/social-expense",["exports","ember-data","ember-validations","ember-pouch"],function(e,t,n,a){e.default=a.Model.extend(n.default,{category:t.default.attr("string"),sources:t.default.attr("string"),cost:t.default.attr(),validations:{category:{presence:!0},cost:{numericality:!0}}})}),define("hospitalrun/models/user-role",["exports","hospitalrun/models/abstract","ember-data"],function(e,t,n){e.default=t.default.extend({name:n.default.attr("string"),capabilities:n.default.attr()})}),define("hospitalrun/models/user",["exports","ember-data","hospitalrun/utils/email-validation","ember","ember-validations"],function(e,t,n,a,l){var s=t.default.Model.extend(l.default,{derived_key:t.default.attr("string"),deleted:t.default.attr("boolean"),displayName:t.default.attr("string"),email:t.default.attr("string"),iterations:t.default.attr(),name:t.default.attr("string"),password:t.default.attr("string"),password_scheme:t.default.attr("string"),password_sha:t.default.attr("string"),rev:t.default.attr("string"),roles:t.default.attr(),salt:t.default.attr("string"),userPrefix:t.default.attr("string"),displayRole:function(){var e=this.get("roles");if(!a.default.isEmpty(e))return e[0]}.property("roles"),validations:{email:{format:{with:n.default.emailRegex,message:"please enter a valid email address"}}}});e.default=s}),define("hospitalrun/models/visit",["exports","hospitalrun/models/abstract","ember-data","ember"],function(e,t,n,a){function l(e){if(!e.get("hasDirtyAttributes"))return!1;var t=e.get("startDate"),n=e.get("endDate");return!a.default.isEmpty(n)&&!a.default.isEmpty(t)&&n.getTime()0&&t[0].set("first",!0)})}),t},_updateSocialRecord:function(e,t){var n=this.getWithDefault("model."+t,[]),a=e.get("isNew"),s=this.get("model"),i=e.serialize();if(i.id=e.get("id"),a)n.addObject(l.default.Object.create(i));else{var o=n.findBy("id",i.id);l.default.setProperties(o,i)}s.set(t,n),this.send("update",!0),this.send("closeModal")},_updateSequence:function(e){var t=this,n=this.get("config"),a=e.get("friendlyId");return n.getPatientPrefix().then(function(e){var n=new RegExp("^"+e+"\\d{5}$");if(n.test(a))return t.store.find("sequence","patient").then(function(t){var n=t.get("value"),l=parseInt(a.slice(e.length));if(l>n)return t.set("value",l),t.save()})})},beforeUpdate:function(){var e=this;if(!this.get("model.isNew"))return l.default.RSVP.resolve();var t=this.get("database"),n=this.get("model.friendlyId"),a=this.get("maxValue"),s={startkey:[n,null],endkey:[n,a]};return t.queryMainDB(s,"patient_by_display_id").then(function(t){return l.default.isEmpty(t.rows)?l.default.RSVP.resolve():e.generateFriendlyId().then(function(t){return e.model.set("friendlyId",t),l.default.RSVP.resolve()})})},afterUpdate:function(e){var t=this;this._updateSequence(e).then(function(){t.send("openModal","dialog",l.default.Object.create({title:t.get("i18n").t("patients.titles.savedPatient"),message:t.get("i18n").t("patients.messages.savedPatient",e),updateButtonAction:"returnToPatient",updateButtonText:t.get("i18n").t("patients.buttons.backToPatients"),cancelButtonText:t.get("i18n").t("buttons.close")}))})}})}),define("hospitalrun/patients/edit/route",["exports","hospitalrun/routes/abstract-edit-route","ember","hospitalrun/mixins/patient-id","hospitalrun/mixins/patient-visits","hospitalrun/mixins/patient-notes","hospitalrun/mixins/pouchdb","ember-i18n"],function(e,t,n,a,l,s,i,o){e.default=t.default.extend(a.default,l.default,i.default,s.default,{customForms:n.default.inject.service(),editTitle:(0,o.translationMacro)("patients.titles.edit"),modelName:"patient",newTitle:(0,o.translationMacro)("patients.titles.new"),photos:null,actions:{updateNote:function(e){e.get("visit").save().then(function(){})},appointmentDeleted:function(e){this.controller.send("appointmentDeleted",e)},returnToPatient:function(){this.controller.send("returnToPatient")},deleteContact:function(e){this.controller.send("deleteContact",e)},deleteExpense:function(e){this.controller.send("deleteExpense",e)},deleteFamily:function(e){this.controller.send("deleteFamily",e)},deletePhoto:function(e){this.controller.send("deletePhoto",e)},updateExpense:function(e){this.controller.send("updateExpense",e)},updateFamilyInfo:function(e){this.controller.send("updateFamilyInfo",e)},visitDeleted:function(e){this.controller.send("visitDeleted",e)}},getNewData:function(){var e=this,t=this.get("customForms"),a={customForms:n.default.Object.create()};return t.setDefaultCustomForms(["patient","socialwork"],a).then(function(){return e.generateFriendlyId().then(function(e){return a.friendlyId=e,a})})},setupController:function(e,t){var a=t.get("friendlyId"),l=t.get("externalPatientId"),s=this.get("maxValue"),i=t.get("id");n.default.isEmpty(a)&&!n.default.isEmpty(l)&&t.set("friendlyId",l),this._super(e,t),this.getPatientVisits(t).then(function(e){ -t.set("visits",e)}),this.store.query("appointment",{options:{startkey:[i,null,null,"appointment_"],endkey:[i,s,s,s]},mapReduce:"appointments_by_patient"}).then(function(e){t.set("appointments",e)}),this.store.query("photo",{options:{key:i},mapReduce:"photo_by_patient"}).then(function(e){var n=[];n.addObjects(e),t.set("photos",n)})}})}),define("hospitalrun/patients/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"kTvHR5pd",block:'{"statements":[["block",["edit-panel"],null,[["editPanelProps"],[["get",["editPanelProps"]]]],52]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","colspan","2"],["flush-element"],["open-element","b",[]],["flush-element"],["append",["helper",["t"],["patients.labels.totalMontlyExpense"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["totalExpenses"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteExpense",["get",["expense"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["expense","category"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["expense","sources"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["expense","cost"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showEditExpense",["get",["expense"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteSocialWork"]]],null,1],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["expense"]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteFamily",["get",["info"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","age"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","civilStatus"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","relationship"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","education"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","occupation"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","income"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["info","insurance"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"showEditFamily",["get",["info"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteSocialWork"]]],null,3],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["info"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","social"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","h4",[]],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.titles.familyInformation"],null],false],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showEditFamily"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.addFamilyMember"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.age"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.civilStatus"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.relationship"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.education"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.occupation"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.income"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.insurance"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","familyInfo"]]],null,4],["text"," "],["close-element"],["text","\\n "],["open-element","h4",[]],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.titles.expenses"],null],false],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showEditExpense"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.addExpense"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.category"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.sources"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.monthlyCost"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","expenses"]]],null,2],["block",["if"],[["get",["showExpenseTotal"]]],null,0],["text"," "],["close-element"],["text","\\n "],["append",["helper",["custom-form-manager"],null,[["model","formType"],[["get",["model"]],"socialwork"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newLab"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.newLab"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newImaging"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.newImaging"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newMedication"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.newMedication"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteVisit",["get",["visit"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["visit","startDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["visit","endDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","primaryDiagnoses"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","examiner"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["visit","visitType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddVisit"]]],null,10],["block",["if"],[["get",["canDeleteVisit"]]],null,9],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visit"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newVisit"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["patients.buttons.newVisit"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteAppointment",["get",["appointment"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editAppointment",["get",["appointment"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","formattedAppointmentDate"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","provider"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","location"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","appointmentType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["appointment","displayStatus"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddAppointment"]]],null,14],["block",["if"],[["get",["canDeleteAppointment"]]],null,13],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["appointment"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"newAppointment"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.newAppointment"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeletePhoto",["get",["photo"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editPhoto",["get",["photo"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","col-sm-4 col-md-3"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","thumbnail"],["modifier",["action"],[["get",[null]],"editPhoto",["get",["photo"]]]],["flush-element"],["text","\\n "],["append",["helper",["photo-display"],null,[["photo"],[["get",["photo"]]]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","caption"],["flush-element"],["text","\\n "],["append",["unknown",["photo","caption"]],false],["text","\\n "],["open-element","p",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddPhoto"]]],null,18],["block",["if"],[["get",["canDeletePhoto"]]],null,17],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["photo"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPhoto"],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.newPhoto"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","photos"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddPhoto"]]],null,20],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n"],["block",["each"],[["get",["model","photos"]]],null,19],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","appointments"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddAppointment"]]],null,16],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["visits.labels.examiner"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","appointments"]]],null,15],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","visits"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddVisit"]]],null,12],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.startDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.endDate"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["visits.labels.diagnosis"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.provider"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.location"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.type"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","visits"]]],null,11],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","medication"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddMedication"]]],null,8],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["partial","patients/medication"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","imaging"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddImaging"]]],null,7],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["partial","patients/imaging"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane"],["static-attr","id","labs"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddLab"]]],null,6],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["partial","patients/labs"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["canAddSocialWork"]]],null,5]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteContact",["get",["additionalContact"]]],[["bubbles"],[false]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.delete"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","phone"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","email"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["additionalContact","relationship"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteContact"]]],null,22],["text"," "],["close-element"],["text","\\n"]],"locals":["additionalContact"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.action"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h4",[]],["flush-element"],["append",["helper",["t"],["patients.titles.additionalContacts"],null],false],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.phone"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.email"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.relationship"],null],false],["close-element"],["text","\\n"],["block",["if"],[["get",["canDeleteContact"]]],null,24],["text"," "],["close-element"],["text","\\n"],["block",["each"],[["get",["model","additionalContacts"]]],null,23],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["helper",["t"],["labels.address"],null],"address",3,"col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["get",["address4Label"]],"address4","col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["get",["address3Label"]],"address3","col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-input"],null,[["label","property","class"],[["get",["address2Label"]],"address2","col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["get",["address1Label"]],"address",3,"col-xs-12 col-sm-6"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["address1Include"]]],null,30],["block",["if"],[["get",["address2Include"]]],null,29],["block",["if"],[["get",["address3Include"]]],null,28],["block",["if"],[["get",["address4Include"]]],null,27]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddContact"],[["bubbles","on"],[false,"click"]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["patients.buttons.addContact"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["messages.noHistoryAvailable"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["date-format"],[["get",["medication","prescriptionDate"]]],null],false],["text",": "],["append",["unknown",["medication","medicationName"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["medication","status"]],"Fulfilled"],null]],null,34]],"locals":["medication"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.medication"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","medication"]]],null,35],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["date-format"],[["get",["lab","labDate"]]],null],false],["text",": "],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["lab","status"]],"Completed"],null]],null,37]],"locals":["lab"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.labOrders"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","labs"]]],null,38],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","imagingDate"]]],null],false],["text",": "],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["helper",["eq"],[["get",["imaging","status"]],"Completed"],null]],null,40]],"locals":["imaging"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.imageOrders"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","imaging"]]],null,41],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editProcedure",["get",["procedure"]]]],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["text","\\n "],["append",["helper",["date-format"],[["get",["procedure","procedureDate"]]],null],false],["text",":\\n "],["append",["unknown",["procedure","description"]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["procedure"]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","ph-note-item"],["flush-element"],["text","\\n "],["open-element","h5",[]],["static-attr","class","ph-note-heading"],["flush-element"],["append",["helper",["t"],["labels.procedures"],null],false],["close-element"],["text","\\n"],["block",["each"],[["get",["visit","procedures"]]],null,43],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","patient-history-item"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","patient-history-heading clickable"],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","ph-visit-date"],["flush-element"],["append",["unknown",["visit","visitDate"]],false],["close-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","ph-visit-type"],["flush-element"],["append",["unknown",["visit","visitType"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["visit","procedures"]]],null,44],["block",["if"],[["get",["visit","hasCompletedImaging"]]],null,42],["block",["if"],[["get",["visit","hasCompletedLabs"]]],null,39],["block",["if"],[["get",["visit","hasCompletedMedication"]]],null,36],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visit"]},{"statements":[["block",["each"],[["get",["model","visits"]]],null,45]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel-heading clearfix"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-primary align-right"],["modifier",["action"],[["get",[null]],"showAddPatientNote"],[["bubbles","on"],[false,"click"]]],["flush-element"],["text","\\n "],["open-element","span",[]],["static-attr","class","octicon octicon-plus"],["flush-element"],["close-element"],["append",["helper",["t"],["buttons.newNote"],null],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["static-attr","class","tab-pane active"],["static-attr","id","history"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddNote"]]],null,47],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n"],["block",["if"],[["get",["model","visits"]]],null,46,33],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#social"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","social-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.socialWork"],null],false],["close-element"],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["patient-summary"],null,[["patient","patientProcedures","disablePatientLink","store","canAddDiagnosis","diagnosisList"],[["get",["model"]],["get",["patientProcedures"]],true,["get",["store"]],["get",["canAddDiagnosis"]],["get",["diagnosisList"]]]]],false],["text","\\n "],["open-element","ul",[]],["static-attr","class","nav nav-pills tab-nav"],["static-attr","role","tablist"],["flush-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["static-attr","class","active"],["flush-element"],["open-element","a",[]],["static-attr","href","#history"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","history-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.history"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#general"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","general-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.general"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#photos"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","photos-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.photos"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#appointments"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","appointments-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.appointments"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#visits"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","visits-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.visits"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#medication"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","medication-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.medication"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#imaging"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","imaging-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.imaging"],null],false],["close-element"],["close-element"],["text","\\n "],["open-element","li",[]],["static-attr","role","presentation"],["flush-element"],["open-element","a",[]],["static-attr","href","#labs"],["static-attr","role","tab"],["static-attr","data-toggle","pill"],["static-attr","data-test-selector","labs-tab"],["flush-element"],["append",["helper",["t"],["patients.navigation.labs"],null],false],["close-element"],["close-element"],["text","\\n"],["block",["if"],[["get",["canAddSocialWork"]]],null,49],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["unless"],[["get",["isNewOrDeleted"]]],null,50],["text"," "],["open-element","div",[]],["static-attr","class","tab-content"],["flush-element"],["text","\\n"],["block",["unless"],[["get",["isNewOrDeleted"]]],null,48],["text"," "],["open-element","div",[]],["static-attr","role","tabpanel"],["dynamic-attr","class",["concat",["tab-pane ",["helper",["if"],[["get",["isNewOrDeleted"]],"active"],null]]]],["static-attr","id","general"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-12 col-sm-6"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["firstName",["helper",["t"],["patients.labels.firstName"],null],"form-input-group required test-first-name"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["middleName",["helper",["t"],["patients.labels.middleName"],null],"form-input-group test-middle-name"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["lastName",["helper",["t"],["patients.labels.lastName"],null],"form-input-group required test-last-name"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","class","list","selection"],["sex",["helper",["t"],["patients.labels.sex"],null],"form-input-group",["get",["sexList"]],["get",["model","sex"]]]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class","maxDate"],["dateOfBirth",["helper",["t"],["patients.labels.dateOfBirth"],null],"form-input-group ","now"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-input-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["append",["helper",["t"],["labels.age"],null],false],["close-element"],["text","\\n "],["open-element","p",[]],["static-attr","class","form-control-static"],["flush-element"],["append",["unknown",["model","age"]],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["placeOfBirth",["helper",["t"],["patients.labels.placeOfBirth"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["occupation",["helper",["t"],["patients.labels.occupation"],null],"form-input-group"]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-input-group"],["flush-element"],["text","\\n "],["open-element","label",[]],["flush-element"],["append",["helper",["t"],["patients.labels.patientType"],null],false],["close-element"],["text","\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["append",["helper",["ext-radio"],null,[["content","value","showInline"],[["get",["patientTypes"]],["get",["model","patientType"]],true]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","col-xs-12 col-sm-6"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["status",["helper",["t"],["patients.labels.status"],null],["get",["statusList"]],["get",["model","status"]],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["externalPatientId",["helper",["t"],["patients.labels.externalPatientId"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["prompt","label","property","content","class"],[" ",["helper",["t"],["patients.labels.bloodType"],null],"bloodType",["get",["bloodTypes"]],"form-input-group"]]],false],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["clinic",["helper",["t"],["patients.labels.clinic"],null],["get",["clinicList"]],["get",["model","clinic"]],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["referredBy",["helper",["t"],["patients.labels.referredBy"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["referredDate",["helper",["t"],["patients.labels.referredDate"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["religion",["helper",["t"],["patients.labels.religion"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["parent",["helper",["t"],["patients.labels.parent"],null],"form-input-group"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["label","property","content","optionValuePath","optionLabelPath","prompt","class"],[["helper",["t"],["billing.labels.paymentProfile"],null],"paymentProfile",["get",["pricingProfiles"]],"selectObject","selectObject.name"," ","form-input-group"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel detail-section"],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAddContact"]]],null,32],["text"," "],["open-element","div",[]],["static-attr","class","panel-body detail-section-content"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["phone",["helper",["t"],["patients.labels.phone"],null],"col-xs-12 col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","type","label","class"],["email","email",["helper",["t"],["labels.email"],null],"col-xs-12 col-sm-6"]]],false],["text","\\n"],["block",["if"],[["get",["haveAddressOptions"]]],null,31,26],["text"," "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["country",["helper",["t"],["labels.country"],null],["get",["countryList"]],["get",["model","country"]],"col-xs-12 col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["if"],[["get",["haveAdditionalContacts"]]],null,25],["text"," "],["close-element"],["text","\\n "],["append",["helper",["custom-form-manager"],null,[["model","formType"],[["get",["model"]],"patient"]]],false],["text","\\n "],["close-element"],["text","\\n"],["block",["unless"],[["get",["isNewOrDeleted"]]],null,21],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton","bubbles"],[["get",["model"]],false,false]],51]],"locals":[]}],"hasPartials":true}', -meta:{moduleName:"hospitalrun/patients/edit/template.hbs"}})}),define("hospitalrun/patients/imaging/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"b0VbAwnT",block:'{"statements":[["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.imagingType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.dateProcessed"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.result"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientImaging"]]],null,3],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteImaging",["get",["imaging"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["labels.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editImaging",["get",["imaging"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddImaging"]]],null,1],["block",["if"],[["get",["canDeleteImaging"]]],null,0]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editImaging",["get",["imaging"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","requestedDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","imagingType","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["imaging","imagingDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","result"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","notes"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["imaging","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["imaging","canEdit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["imaging"]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/imaging/template.hbs"}})}),define("hospitalrun/patients/index/controller",["exports","hospitalrun/controllers/abstract-paged-controller","hospitalrun/mixins/patient-visits","hospitalrun/utils/visit-statuses"],function(e,t,n,a){e.default=t.default.extend(n.default,{addPermission:"add_patient",deletePermission:"delete_patient",canAdmitPatient:function(){return this.currentUserCan("admit_patient")}.property(),canDischargePatient:function(){return this.currentUserCan("discharge_patient")}.property(),startKey:[],actions:{checkInPatient:function(e){this.send("createNewVisit",e)},checkoutPatient:function(e){this.editPatientVisitWithStatus(e,a.default.CHECKED_IN)},dischargePatient:function(e){this.editPatientVisitWithStatus(e,a.default.ADMITTED)}},editPatientVisitWithStatus:function(e,t){var n=this;this.getPatientVisits(e).then(function(e){var a=e.findBy("status",t);a&&(a.set("endDate",new Date),n.transitionToRoute("visits.edit",a))})}})}),define("hospitalrun/patients/index/route",["exports","hospitalrun/routes/abstract-index-route","ember","ember-i18n","hospitalrun/mixins/user-session"],function(e,t,n,a,l){var s=n.default.computed;e.default=t.default.extend(l.default,{modelName:"patient",newButtonAction:s(function(){return this.currentUserCan("add_patient")?"newItem":null}),newButtonText:(0,a.translationMacro)("patients.buttons.newPatient"),pageTitle:(0,a.translationMacro)("patients.titles.patientListing"),_getStartKeyFromItem:function(e){var t=e.get("displayPatientId"),n=this._getPouchIdFromItem(e);return[t,n]},_modelQueryParams:function(){return{mapReduce:"patient_by_display_id"}}})}),define("hospitalrun/patients/index/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"XNP6TQZC",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],21]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","a",[]],["static-attr","href","#"],["modifier",["action"],[["get",[null]],"newItem"]],["flush-element"],["append",["helper",["t"],["patients.messages.createNewPatient"],null],false],["close-element"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-info"],["static-attr","data-test-selector","no-patients-found"],["flush-element"],["text","\\n "],["open-element","p",[]],["flush-element"],["append",["helper",["t"],["patients.messages.noPatientsFound"],null],false],["block",["if"],[["get",["canAdd"]]],null,0],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"deleteItem",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["buttons.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default success admit"],["modifier",["action"],[["get",[null]],"checkInPatient",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-in"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["visits.buttons.checkIn"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAdmitPatient"]]],null,3]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default info"],["modifier",["action"],[["get",[null]],"checkoutPatient",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-out"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["visits.buttons.checkOut"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canDischargePatient"]]],null,5]],"locals":[]},{"statements":[["block",["if"],[["get",["patient","checkedIn"]]],null,6,4]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default info"],["modifier",["action"],[["get",[null]],"dischargePatient",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","glyphicon glyphicon-log-out"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["visits.buttons.discharge"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canDischargePatient"]]],null,8]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editItem",["get",["patient"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["canAdd"]]],null,10],["block",["if"],[["get",["patient","admitted"]]],null,9,7],["block",["if"],[["get",["canDelete"]]],null,2],["text"," "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editItem",["get",["patient"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","displayPatientId"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","firstName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","lastName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","sex"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["patient","dateOfBirth"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["patient","status"]],false],["close-element"],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,11],["text"," "],["close-element"],["text","\\n"]],"locals":["patient"]},{"statements":[["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.status"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.dob"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.sex"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.lastName"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["patients.labels.firstName"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.id"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","thead",[]],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["id",["get",["sortDesc"]],["get",["sortKey"]]]],19],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["firstName",["get",["sortDesc"]],["get",["sortKey"]]]],18],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["lastName",["get",["sortDesc"]],["get",["sortKey"]]]],17],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["sex",["get",["sortDesc"]],["get",["sortKey"]]]],16],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["dateOfBirth",["get",["sortDesc"]],["get",["sortKey"]]]],15],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["status",["get",["sortDesc"]],["get",["sortKey"]]]],14],["text","\\n"],["block",["if"],[["get",["showActions"]]],null,13],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tbody",[]],["flush-element"],["text","\\n"],["block",["each"],[["get",["model"]]],null,12],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["hasRecords"]]],null,20,1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/index/template.hbs"}})}),define("hospitalrun/patients/labs/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"NZjGsEXR",block:'{"statements":[["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.dateRequested"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labs.labels.labType"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["patients.labels.dateProcessed"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.result"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.notes"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientLabs"]]],null,3],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteLab",["get",["lab"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["text"," "],["append",["helper",["t"],["labels.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editLab",["get",["lab"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddLab"]]],null,1],["block",["if"],[["get",["canDeleteLab"]]],null,0]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editLab",["get",["lab"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["lab","requestedDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","labType","name"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["lab","labDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","result"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","notes"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["lab","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["lab","canEdit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["lab"]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/labs/template.hbs"}})}),define("hospitalrun/patients/medication/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"s3chlZL2",block:'{"statements":[["open-element","table",[]],["static-attr","class","table"],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.date"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.name"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.status"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.prescription"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.requestedBy"],null],false],["close-element"],["text","\\n "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientMedications"]]],null,3],["close-element"],["text","\\n"]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default warning"],["modifier",["action"],[["get",[null]],"showDeleteMedication",["get",["medication"]]],[["bubbles"],[false]]],["flush-element"],["open-element","span",[]],["static-attr","class","octicon octicon-x"],["flush-element"],["close-element"],["append",["helper",["t"],["labels.delete"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","button",[]],["static-attr","type","button"],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"editMedication",["get",["medication"]]]],["flush-element"],["append",["helper",["t"],["labels.edit"],null],false],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["canAddMedication"]]],null,1],["block",["if"],[["get",["canDeleteMedication"]]],null,0]],"locals":[]},{"statements":[["text"," "],["open-element","tr",[]],["modifier",["action"],[["get",[null]],"editMedication",["get",["medication"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["helper",["date-format"],[["get",["medication","prescriptionDate"]]],null],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","medicationName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","status"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","prescription"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["append",["unknown",["medication","requestedBy"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["flush-element"],["text","\\n"],["block",["if"],[["get",["medication","canEdit"]]],null,2],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["medication"]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/medication/template.hbs"}})}),define("hospitalrun/patients/notes/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/is-update-disabled","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/patient-notes","hospitalrun/mixins/user-session"],function(e,t,n,a,l,s,i){e.default=t.default.extend(a.default,i.default,l.default,s.default,{cancelAction:"closeModal",updateAction:"updateNote",moduleController:n.default.inject.controller("patients"),physicianList:n.default.computed.alias("moduleController.physicianList"),lookupListsToUpdate:[{name:"physicianList",property:"model.attribution",id:"physician_list"}],title:function(){return this.get("model.isNew")?this.get("i18n").t("patients.notes.newNote")+" "+this.get("model.patient.displayName"):this.get("i18n").t("patients.notes.newNote")+" "+moment(this.get("model.date")).format("MM/DD/YYYY")+" for "+this.get("model.patient.displayName")}.property("model.patient.displayName"),updateCapability:"add_note",beforeUpdate:function(){return this.set("model.date",new Date),this.set("model.createdBy",this.getUserName()),n.default.RSVP.Promise.resolve()},afterUpdate:function(){this.send(this.get("updateAction"),this.get("model")),this.send(this.get("cancelAction"))},actions:{changeVisit:function(){var e=$('select[name="note-visits"]').get(0),t=e.selectedIndex,n=this.get("patientVisitsForSelect"),a=t-1,l=n[a].selectObject;this.get("model").set("visit",l),this._setNoteType()}}})}),define("hospitalrun/patients/notes/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"lvlxvqfb",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","hideUpdateButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["hideCancelButton"]],["get",["hideUpdateButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],2]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","option",[]],["dynamic-attr","value",["concat",[["unknown",["item","selectObject"]]]]],["dynamic-attr","selected",["helper",["is-equal"],[["get",["item","selectObject"]],["get",["model","visit"]]],null],null],["flush-element"],["text","\\n "],["append",["unknown",["item","selectObject","visitDescription"]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":["item"]},{"statements":[["text"," "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["helper",["t"],["labels.note"],null],"content",3,"test-note-content required form-input-group"]]],false],["text","\\n\\n "],["open-element","select",[]],["static-attr","name","note-visits"],["static-attr","class","form-control"],["modifier",["action"],[["get",[null]],"changeVisit"],[["on"],["change"]]],["flush-element"],["text","\\n "],["open-element","option",[]],["dynamic-attr","selected",["helper",["is-not"],[["get",["model","visit"]]],null],null],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.notes.pleaseSelectAVisit"],null],false],["text","\\n "],["close-element"],["text","\\n"],["block",["each"],[["get",["patientVisitsForSelect"]]],null,0],["text"," "],["close-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","className"],["attribution",["helper",["t"],["patients.notes.onBehalfOfLabel"],null],["get",["physicianList"]],["get",["attribution"]],"form-input-group test-note-attribution"]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],1]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/notes/template.hbs"}})}),define("hospitalrun/patients/outpatient/controller",["exports","ember","hospitalrun/mixins/filter-list","hospitalrun/mixins/modal-helper","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values","hospitalrun/mixins/user-session","hospitalrun/utils/visit-statuses","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s,i,o,r){var d=t.default.computed,c=t.default.isEmpty;e.default=t.default.Controller.extend(n.default,a.default,l.default,s.default,i.default,r.default,{addPermission:"add_patient",deletePermission:"delete_patient",filterValue:null,filterBy:null,queryParams:["visitDate","visitLocation"],sortByDesc:null,sortByKey:null,visitLocation:null,visitDate:null,canAddVisit:d(function(){return this.currentUserCan("add_visit")}),hasAppointmentLabels:d(function(){var e=this.get("i18n");return[e.t("visits.labels.haveAppointment"),e.t("visits.labels.noAppointment")]}),doneOrdersValues:d(function(){var e=this.get("i18n");return[e.t("visits.labels.ordersNotDone"),e.t("visits.labels.haveDoneOrders")]}),locationList:t.default.computed.map("patientController.locationList.value",s.default.selectValuesMap).volatile(),patientNames:d.map("model",function(e){return e.get("patient.shortDisplayName")}),patientController:t.default.inject.controller("patients"),sexList:d.alias("patientController.sexList.value"),visitTypesList:d.alias("patientController.visitTypesList"),visitTypesValues:d.map("visitTypes",function(e){return e.value}),checkedInVisits:d.filter("model.@each.status",function(e){return"Admission"!==e.get("visitType")&&e.get("status")===o.default.CHECKED_IN}),filteredVisits:d("checkedInVisits","filterBy","filterValue","visitLocation",function(){var e=this.get("filterBy"),t=this.get("filterValue"),n=this.get("filteredBy"),a=this.get("visitLocation"),l=this.get("checkedInVisits");return c(a)?n.delete("location"):n.set("location",a),this.filterList(l,e,t)}),sortedVisits:d("filteredVisits","sortByKey","sortByDesc",function(){var e=this.get("filteredVisits"),n=this.get("sortByDesc"),a=this.get("sortByKey");return t.default.isEmpty(e)||t.default.isEmpty(a)?e:e=e.toArray().sort(function(e,l){var s=e.get(a),i=l.get(a);return"orderType"===a&&(s=s.toString(),i=i.toString()),n?t.default.compare(i,s):t.default.compare(s,i)})}),startKey:[],actions:{checkOut:function(e){var t=this.get("i18n"),n={patientName:e.get("patient.displayName")},a=t.t("visits.messages.checkOut",n);this.displayConfirm(t.t("visits.titles.checkOut"),a,"finishCheckOut",e)},editVisit:function(e){this.get("canAddVisit")&&(e.set("returnTo","patients.outpatient"),this.transitionToRoute("visits.edit",e))},filter:function(e,t){this.set("filterBy",e),this.set("filterValue",t)},finishCheckOut:function(e){this.checkoutVisit(e,o.default.CHECKED_OUT)},search:function(){var e=this.get("model.selectedVisitDate"),t=this.get("model.selectedLocation");c(e)||this.set("visitDate",e.getTime()),c(t)?this.set("visitLocation",null):this.set("visitLocation",t)},sortByKey:function(e,t){this.setProperties({sortByDesc:t,sortByKey:e})},patientCheckIn:function(){this.transitionToRoute("visits.edit","checkin").then(function(e){var t={outPatient:!0,visitType:null,returnTo:"patients.outpatient"};e.currentModel.setProperties(t)})}}})}),define("hospitalrun/patients/outpatient/route",["exports","hospitalrun/routes/abstract-index-route","hospitalrun/mixins/date-format","ember","ember-i18n"],function(e,t,n,a,l){var s=a.default.computed,i=a.default.isEmpty;e.default=t.default.extend(n.default,{database:a.default.inject.service(),modelName:"visit",newButtonAction:"patientCheckIn",newButtonText:(0,l.translationMacro)("patients.buttons.patientCheckIn"),selectedVisitDate:null,showingTodaysPatients:!0,pageTitle:s("showingTodaysPatients","selectedVisitDate",function(){var e=this.get("i18n"),t=this.get("showingTodaysPatients");if(t)return e.t("patients.titles.todaysOutpatients");var n=this._dateFormat(this.get("selectedVisitDate"));return e.t("patients.titles.outpatientsForDate",{visitDate:n})}),queryParams:{visitDate:{refreshModel:!0},visitLocation:{refreshModel:!1}},_getStartKeyFromItem:function(e){var t=e.get("displayPatientId");return[t,"patient_"+e.get("id")]},_modelQueryParams:function(e){var t=this.get("database"),n=t.getMaxPouchId("visit"),a=t.getMinPouchId("visit"),l=e.visitDate;l=i(l)?moment():moment(parseInt(l)),l.isSame(moment(),"day")?this.set("showingTodaysPatients",!0):(this.set("showingTodaysPatients",!1),this.set("selectedVisitDate",l.toDate()));var s=l.endOf("day").valueOf(),o=l.startOf("day").valueOf();return{mapReduce:"visit_by_date",options:{endkey:[s,s,n],startkey:[o,null,a]}}},model:function(e){var t=this;return this._super(e).then(function(n){var a=new Date;return i(e.visitDate)||a.setTime(e.visitDate),n.set("selectedVisitDate",a),n.set("display_selectedVisitDate",t._dateFormat(a)),n.set("selectedLocation",e.visitLocation),n})},actions:{finishCheckOut:function(e){this.controller.send("finishCheckOut",e)},patientCheckIn:function(){this.controller.send("patientCheckIn")}}})}),define("hospitalrun/patients/outpatient/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"UnoRIh+j",block:'{"statements":[["block",["item-listing"],null,[["paginationProps"],[["get",["paginationProps"]]]],11]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","tr",[]],["static-attr","class","clickable"],["modifier",["action"],[["get",[null]],"editVisit",["get",["visit"]]]],["flush-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","displayPatientId"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","shortDisplayName"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","sex"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","patient","shortAge"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","visitType"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["helper",["date-format"],[["get",["visit","startDate"]]],[["format"],["h:mm A"]]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-center"],["flush-element"],["append",["unknown",["visit","hasAppointmentLabel"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["append",["unknown",["visit","examiner"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1 text-center"],["flush-element"],["append",["unknown",["visit","hasDoneOrders"]],false],["close-element"],["text","\\n "],["open-element","td",[]],["static-attr","class","col-xs-1"],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default neutral"],["modifier",["action"],[["get",[null]],"checkOut",["get",["visit"]]],[["bubbles"],[false]]],["flush-element"],["append",["helper",["t"],["visits.buttons.checkOut"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":["visit"]},{"statements":[["text"," "],["append",["helper",["t"],["visits.labels.ordersDone"],null],false],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.examiner"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.appointment"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.checkInTime"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["visits.labels.visitType"],null],false]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.age"],null],false]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["patients.labels.sex"],null],false],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["t"],["labels.name"],null],false],["text","\\n"]],"locals":[]},{"statements":[["append",["helper",["t"],["labels.id"],null],false]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","class"],["selectedVisitDate",["helper",["t"],["visits.labels.visitDate"],null],"col-sm-3 outpatient-date"]]],false],["text","\\n "],["append",["helper",["em-select"],null,[["class","property","label","content","prompt"],["col-sm-3 form-input-group outpatient-location","selectedLocation",["helper",["t"],["labels.location"],null],["get",["locationList"]]," "]]],false],["text","\\n "],["open-element","div",[]],["static-attr","class","form-group col-sm-3"],["flush-element"],["text","\\n "],["open-element","label",[]],["static-attr","class","control-label"],["flush-element"],["close-element"],["text","\\n "],["open-element","div",[]],["flush-element"],["text","\\n "],["open-element","button",[]],["static-attr","class","btn btn-default"],["modifier",["action"],[["get",[null]],"search"]],["flush-element"],["append",["helper",["t"],["buttons.search"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","panel panel-info"],["flush-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","panel-body"],["flush-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],10],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","table",[]],["static-attr","class","table outpatient-list"],["flush-element"],["text","\\n "],["open-element","thead",[]],["flush-element"],["text","\\n "],["open-element","tr",[]],["static-attr","class","table-header"],["flush-element"],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["patient.displayPatientId",["get",["sortByDesc"]],["get",["sortByKey"]]]],9],["text","\\n"],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterType","filterValues"],["patient.shortDisplayName",["get",["sortByDesc"]],["get",["sortByKey"]],"patient.shortDisplayName",["get",["filteredBy"]],"typeahead",["get",["patientNames"]]]],8],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["patient.sex",["get",["sortByDesc"]],["get",["sortByKey"]],"patient.sex",["get",["filteredBy"]],["get",["sexList"]]]],7],["text"," "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["patient.dateOfBirth",["get",["sortByDesc"]],["get",["sortByKey"]]]],6],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["visitType",["get",["sortByDesc"]],["get",["sortByKey"]],"visitType",["get",["filteredBy"]],["get",["visitTypesValues"]]]],5],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["startDate",["get",["sortByDesc"]],["get",["sortByKey"]]]],4],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["hasAppointmentLabel",["get",["sortByDesc"]],["get",["sortByKey"]],"hasAppointmentLabel",["get",["filteredBy"]],["get",["hasAppointmentLabels"]]]],3],["text","\\n "],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey"],["examiner",["get",["sortByDesc"]],["get",["sortByKey"]]]],2],["text","\\n"],["block",["sortable-column"],null,[["sortBy","sortDesc","sortKey","filterBy","filteredBy","filterValues"],["hasDoneOrders",["get",["sortByDesc"]],["get",["sortByKey"]],"hasDoneOrders",["get",["filteredBy"]],["get",["doneOrdersValues"]]]],1],["text"," "],["open-element","th",[]],["flush-element"],["append",["helper",["t"],["labels.actions"],null],false],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["close-element"],["text","\\n "],["open-element","tbody",[]],["flush-element"],["text","\\n"],["block",["each"],[["get",["sortedVisits"]]],null,0],["text"," "],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]}],"hasPartials":false}', -meta:{moduleName:"hospitalrun/patients/outpatient/template.hbs"}})}),define("hospitalrun/patients/photo/controller",["exports","ember"],function(e,t){e.default=t.default.Controller.extend({patientsEdit:t.default.inject.controller("patients/edit"),title:function(){var e=this.get("model.isNew");return e?this.get("i18n").t("patients.titles.addPhoto"):this.get("i18n").t("patients.titles.editPhoto")}.property("model.isNew"),updateButtonText:function(){var e=this.get("model.isNew");return e?this.get("i18n").t("buttons.add"):this.get("i18n").t("buttons.update")}.property("model.isNew"),updateButtonAction:"update",showUpdateButton:!0,editController:t.default.computed.alias("patientsEdit"),actions:{cancel:function(){this.send("closeModal")},update:function(){var e=this.get("model.caption"),t=this.get("model.isNew"),n=this.get("model.photoFile");t?this.get("editController").send("addPhoto",n,e):this.get("editController").send("updatePhoto",this.get("model"))}}})});define("hospitalrun/patients/photo/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"c+xb//yl",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","hideUpdateButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["hideCancelButton"]],["get",["hideUpdateButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],3]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","thumbnail"],["flush-element"],["text","\\n "],["open-element","img",[]],["dynamic-attr","alt",["unknown",["model","caption"]],null],["dynamic-attr","src",["unknown",["model","url"]],null],["static-attr","class","img-responsive"],["flush-element"],["close-element"],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["append",["helper",["take-photo"],null,[["photoFile"],[["get",["model","photoFile"]]]]],false],["text","\\n"]],"locals":[]},{"statements":[["block",["if"],[["get",["model","isNew"]]],null,1,0],["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label"],["caption","Caption"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],2]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/photo/template.hbs"}})});define("hospitalrun/patients/quick-add/controller",["exports","ember","hospitalrun/controllers/abstract-edit-controller","ember-i18n"],function(e,t,n,a){e.default=n.default.extend({sexList:t.default.computed.alias("model.requestingController.sexList"),title:(0,a.translationMacro)("patients.titles.new"),updateCapability:"add_patient",actions:{cancel:function(){this.send("closeModal")}},afterUpdate:function(e){var t=this.get("model.requestingController");t.send("addedNewPatient",e)}})}),define("hospitalrun/patients/quick-add/template",["exports"],function(e){e.default=Ember.HTMLBars.template({id:"CI80Vogk",block:'{"statements":[["block",["modal-dialog"],null,[["hideCancelButton","isUpdateDisabled","title","updateButtonAction","updateButtonText"],[["get",["hideCancelButton"]],["get",["isUpdateDisabled"]],["get",["title"]],["get",["updateButtonAction"]],["get",["updateButtonText"]]]],1]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["friendlyId","Id","required col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["firstName","First Name","required col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["middleName","Middle Name","col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["lastName","Last Name","required col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["select-or-typeahead"],null,[["property","label","list","selection","class"],["sex","Sex",["get",["sexList"]],["get",["model","sex"]],"col-sm-6 form-input-group"]]],false],["text","\\n "],["append",["helper",["date-picker"],null,[["property","label","maxDate","class"],["dateOfBirth","Date of Birth","now","col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n "],["open-element","div",[]],["static-attr","class","row"],["flush-element"],["text","\\n "],["append",["helper",["em-input"],null,[["property","label","class"],["phone",["helper",["t"],["patients.labels.phone"],null],"col-xs-12 col-sm-6"]]],false],["text","\\n "],["append",["helper",["em-text"],null,[["label","property","rows","class"],[["helper",["t"],["labels.address"],null],"address",3,"col-xs-12 col-sm-6"]]],false],["text","\\n "],["close-element"],["text","\\n"]],"locals":[]},{"statements":[["text"," "],["open-element","div",[]],["static-attr","class","alert alert-warning"],["static-attr","role","alert"],["flush-element"],["text","\\n "],["append",["helper",["t"],["patients.messages.notFoundQuickAdd",["get",["model"]]],null],false],["text","\\n "],["close-element"],["text","\\n"],["block",["em-form"],null,[["model","submitButton"],[["get",["model"]],false]],0]],"locals":[]}],"hasPartials":false}',meta:{moduleName:"hospitalrun/patients/quick-add/template.hbs"}})}),define("hospitalrun/patients/reports/controller",["exports","ember","hospitalrun/controllers/abstract-report-controller","hospitalrun/mixins/patient-diagnosis","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values","hospitalrun/mixins/visit-types"],function(e,t,n,a,l,s,i){e.default=n.default.extend(a.default,l.default,i.default,{patientsController:t.default.inject.controller("patients"),clinicList:t.default.computed.map("patientsController.clinicList.value",s.default.selectValuesMap),diagnosisList:t.default.computed.alias("patientsController.diagnosisList"),physicianList:t.default.computed.map("patientsController.physicianList.value",s.default.selectValuesMap),locationList:t.default.computed.map("patientsController.locationList.value",s.default.selectValuesMap),statusList:t.default.computed.map("patientsController.statusList.value",s.default.selectValuesMap),visitTypesList:t.default.computed.alias("patientsController.visitTypesList"),reportType:"detailedAdmissions",patientDetails:{},admissionReportColumns:t.default.computed(function(){var e=this.get("i18n");return{sex:{label:e.t("labels.sex"),include:!0,property:"sex"},total:{label:e.t("labels.total"),include:!0,property:"total",format:"_numberFormat"}}}),admissionDetailReportColumns:t.default.computed(function(){var e=this.get("i18n");return{id:{label:e.t("labels.id"),include:!0,property:"patientId"},name:{label:e.t("labels.name"),include:!0,property:"patientName"},admissionDate:{label:e.t("patients.labels.admissionDate"),include:!0,property:"admissionDate",format:"_dateTimeFormat"},dischargeDate:{label:e.t("patients.labels.dischargeDate"),include:!1,property:"dischargeDate",format:"_dateTimeFormat"},patientDays:{label:e.t("patients.labels.patientDays"),include:!1,property:"patientDays",format:"_numberFormat"}}}),diagnosticReportColumns:t.default.computed(function(){var e=this.get("i18n");return{type:{label:e.t("labels.type"),include:!0,property:"type"},total:{label:e.t("labels.total"),include:!0,property:"total",format:"_numberFormat"}}}),procedureDetailReportColumns:t.default.computed(function(){var e=this.get("i18n");return{id:{label:e.t("labels.id"),include:!0,property:"patient.displayPatientId"},name:{label:e.t("labels.name"),include:!0,property:"patient.displayName"},procedure:{label:e.t("visits.labels.procedure"),include:!0,property:"procedure"},procedureDate:{label:e.t("visits.labels.procedureDate"),include:!0,property:"procedureDate",format:"_dateTimeFormat"}}}),reportColumns:t.default.computed(function(){var e=this.get("i18n");return{visitDate:{label:e.t("visits.labels.visitDate"),include:!0,property:"visitDate"},visitType:{label:e.t("visits.labels.visitType"),include:!0,property:"visitType"},visitLocation:{label:e.t("labels.location"),include:!1,property:"location"},examiner:{label:e.t("visits.labels.examiner"),include:!0,property:"examiner"},name:{label:e.t("labels.name"),include:!0,property:"patient.displayName"},id:{label:e.t("labels.id"),include:!0,property:"patient.displayPatientId"},sex:{label:e.t("patients.labels.sex"),include:!0,property:"patient.sex"},dateOfBirth:{label:e.t("patients.labels.dateOfBirth"),include:!0,property:"patient.dateOfBirth",format:"_dateFormat"},age:{label:e.t("labels.age"),include:!1,property:"patient.age"},primaryDiagnosis:{label:e.t("patients.labels.primaryDiagnosis"),include:!1,property:"primaryDiagnosis"},secondaryDiagnoses:{label:e.t("patients.labels.secondaryDiagnosis"),include:!1,property:"additionalDiagnoses",format:"_diagnosisListToString"},procedures:{label:e.t("labels.procedures"),include:!1,property:"resolvedProcedures",format:"_procedureListToString"},contacts:{label:e.t("patients.labels.contacts"),include:!1,property:"patient",format:"_contactListToString"},referredBy:{label:e.t("patients.labels.referredBy"),include:!1,property:"patient.referredBy"},referredDate:{label:e.t("patients.labels.referredDate"),include:!1,property:"patient.referredDate",format:"_dateFormat"}}}),statusReportColumns:t.default.computed(function(){var e=this.get("i18n");return{id:{label:e.t("labels.id"),include:!0,property:"patient.displayPatientId"},name:{label:e.t("labels.name"),include:!0,property:"patient.displayName"},status:{label:e.t("labels.status"),include:!0,property:"patient.status"},primaryDiagnosis:{label:e.t("patients.labels.primaryDiagnosis"),include:!0,property:"patient",format:"_formatPrimaryDiagnosis"},secondaryDiagnoses:{label:e.t("patients.labels.secondaryDiagnosis"),include:!0,property:"patient",format:"_formatSecondaryDiagnosis"}}}),reportTypes:t.default.computed(function(){var e=this.get("i18n");return[{name:e.t("patients.titles.admissionsDetail"),value:"detailedAdmissions"},{name:e.t("patients.titles.admissionsSummary"),value:"admissions"},{name:e.t("patients.titles.diagnosticTesting"),value:"diagnostic"},{name:e.t("patients.titles.dischargesDetail"),value:"detailedDischarges"},{name:e.t("patients.titles.dischargesSummary"),value:"discharges"},{name:e.t("patients.titles.proceduresDetail"),value:"detailedProcedures"},{name:e.t("patients.titles.proceduresSummary"),value:"procedures"},{name:e.t("patients.titles.patientStatus"),value:"status"},{name:e.t("patients.titles.totalPatientDays"),value:"patientDays"},{name:e.t("patients.titles.totalPatientDaysDetailed"),value:"detailedPatientDays"},{name:e.t("patients.titles.visit"),value:"visit"}]}),isDischargeReport:function(){var e=this.get("reportType");return e.toLowerCase().indexOf("discharges")>-1}.property("reportType"),isStatusReport:function(){var e=this.get("reportType");return"status"===e}.property("reportType"),isVisitReport:function(){var e=this.get("reportType");return"visit"===e}.property("reportType"),_addContactToList:function(e,n,a,l){var s=[];t.default.isEmpty(n)&&t.default.isEmpty(e)||(t.default.isEmpty(e)||s.push(e),t.default.isEmpty(n)||s.push(n),l.push(a+s.join(", ")))},_addReportRow:function(e,n,a,l){if(t.default.isEmpty(l)&&!t.default.isEmpty(e.patient)){var s=null;s=e.get?e.get("patient.id"):e.patient.get("id"),t.default.isEmpty(s)||(l={action:"viewPatient",model:s})}this._super(e,n,a,l)},_addRowsByType:function(e,t,n,a){var l=this._totalByType(e,t,n);l.forEach(function(e){this._addReportRow(e,!0,a)}.bind(this))},_addPatientProcedureRows:function(e,n){e.forEach(function(e){t.default.isEmpty(e.records)?this._addReportRow({procedure:"Total for "+e.type+": "+e.total},!0,n):e.records.forEach(function(t,a){this._addReportRow({patient:t.get("patient"),procedure:t.get("description"),procedureDate:t.get("procedureDate")},!1,n),a+1===e.records.length&&this._addReportRow({procedure:"Total for "+e.type+": "+e.total},!0,n)}.bind(this))}.bind(this))},_contactListToString:function(e){var n=e.get("additionalContacts"),a=void 0,l=[],s=e.get("email"),i=e.get("phone");return this._addContactToList(i,s,"Primary: ",l),t.default.isEmpty(n)||n.forEach(function(e){a="",t.default.isEmpty(e.name)||t.default.isEmpty(e.relationship)||(t.default.isEmpty(e.name)||(a+=e.name),t.default.isEmpty(e.relationship)||(t.default.isEmpty(a)||(a+=" - "),a+=e.relationship),a+=": "),this._addContactToList(e.phone,e.email,a,l)}.bind(this)),l.join(";\n")},_dateTimeFormat:function(e){return this._dateFormat(e,"l h:mm A")},_diagnosisListToString:function(e){return this._listToString(e,"diagnosis","date")},_findDiagnosticsByDate:function(){var e=this.get("endDate"),n=this.get("startDate"),a={options:{},mapReduce:"imaging_by_status"},l=this.get("maxValue");return new t.default.RSVP.Promise(function(s,i){a.options.startkey=["Completed",null,n.getTime(),null],t.default.isEmpty(e)||(e=moment(e).endOf("day").toDate(),a.options.endkey=["Completed",l,e.getTime(),l]),this.store.query("imaging",a).then(function(e){var t={imaging:e};a.mapReduce="lab_by_status",this.store.query("lab",a).then(function(e){t.labs=e,s(t)},i)}.bind(this),i)}.bind(this))},_findPatientsByStatus:function(){var e=this.get("status"),n={options:{key:e},mapReduce:"patient_by_status"};return new t.default.RSVP.Promise(function(e,t){this.store.query("patient",n).then(e,t)}.bind(this))},_findProceduresByDate:function(){var e=this.get("endDate"),n=this.get("startDate"),a={options:{},mapReduce:"procedure_by_date"},l=this.get("maxValue");return new t.default.RSVP.Promise(function(s,i){a.options.startkey=[n.getTime(),null],t.default.isEmpty(e)||(e=moment(e).endOf("day").toDate(),a.options.endkey=[e.getTime(),l]),this.store.query("procedure",a).then(s,i)}.bind(this))},_findVisitsByDate:function(){var e=this.get("endDate"),n=this.get("startDate"),a={options:{},mapReduce:"visit_by_date"},l=this.get("isDischargeReport"),s=this.get("maxValue");return l&&(a.mapReduce="visit_by_discharge_date"),new t.default.RSVP.Promise(function(l,i){var o=this.get("isDischargeReport");a.options.startkey=[n.getTime(),null],t.default.isEmpty(e)||(e=moment(e).endOf("day").toDate(),o?a.options.endkey=[e.getTime(),s]:a.options.endkey=[e.getTime(),s,s]),this.store.query("visit",a).then(l,i)}.bind(this))},_filterByLike:function(e,n,a){return e.filter(function(e){var n=e.get("field");if(t.default.isEmpty(n))return!1;if(t.default.isArray(n)){var l=n.find(function(e){return this._haveLikeValue(e,a)}.bind(this));return!t.default.isEmpty(l)}return this._haveLikeValue(n,a)})},_filterInPatientVisit:function(e){var n=e.get("outPatient"),a=e.get("status");return!n&&!t.default.isEmpty(a)},_finishVisitReport:function(e){var t=this._totalByType(e,"visitType","total");t.forEach(function(e){"total"===e.type?this._addReportRow({visitDate:"Total visits: "+e.total}):(e.records.forEach(function(e){this._addReportRow(e)}.bind(this)),this._addReportRow({visitDate:"Total for "+e.type+": "+e.total}))}.bind(this)),this._finishReport()},_formatPrimaryDiagnosis:function(e){var t=this.getDiagnoses(e,!0,!1);return this._diagnosisListToString(t)},_formatSecondaryDiagnosis:function(e){var t=this.getDiagnoses(e,!0,!0);return this._diagnosisListToString(t)},_generateAdmissionOrDischargeReport:function(e,n){var a=this,l=!1,s=void 0,i={},o=this.get("i18n").t("patients.labels.sexNotEntered");n.indexOf("detailed")>-1?(l=!0,s=this.get("admissionDetailReportColumns"),s.patientDays.include=!1,"detailedDischarges"===n?s.dischargeDate.include=!0:s.dischargeDate.include=!1):s=this.get("admissionReportColumns"),e=e.filter(this._filterInPatientVisit),e.forEach(function(e){if(!this.get("isDischargeReport")||!t.default.isEmpty(e.get("endDate"))){var n={patient:e.get("patient"),patientId:e.get("patient.displayPatientId"),patientName:e.get("patient.displayName"),admissionDate:e.get("startDate"),dischargeDate:e.get("endDate")},a=e.get("patient.sex");a||(a=o);var l=i[a];l||(l={count:0,rows:[]},i[a]=l),l.count++,l.rows.push(n)}}.bind(this));var r=0,d=function(e){a._addReportRow(e,!1,s)};for(var c in i)l?(i[c].rows.forEach(d),this._addReportRow({patientId:c+" Total: "+i[c].count},!0,s)):this._addReportRow({sex:c,total:i[c].count},!0,s),r+=i[c].count;this._addReportRow({patientId:"Grand Total: "+r},!0,s),this._finishReport(s)},_generateDiagnosticReport:function(){this._findDiagnosticsByDate().then(function(e){var t=this.get("diagnosticReportColumns");this._addRowsByType(e.imaging,"imagingType.name","Total for imaging: ",t),this._addRowsByType(e.labs,"labType.name","Total for labs: ",t),this._finishReport(t)}.bind(this),function(e){this._notifyReportError("Error in _generateDiagnosticReport: "+e)}.bind(this))},_generatePatientDaysReport:function(e,n){e=e.filter(this._filterInPatientVisit);var a=0===n.indexOf("detailed"),l=this.get("endDate"),s=void 0,i=moment(this.get("startDate")).startOf("day");a?(s=this.get("admissionDetailReportColumns"),s.patientDays.include=!0,s.dischargeDate.include=!0):s={total:{label:"Total",include:!0,property:"total",format:"_numberFormat"}},l=t.default.isEmpty(l)?moment().endOf("day"):moment(l).endOf("day");var o=e.reduce(function(e,n){var o=n.get("endDate"),r=moment(n.get("startDate")).startOf("day");o=t.default.isEmpty(o)?moment().endOf("day"):moment(o).endOf("day"),r.isBefore(i)&&(r=i),o.isAfter(l)&&(o=l);var d=o.diff(r,"days",!0);return a&&this._addReportRow({patient:n.get("patient"),patientId:n.get("patient.displayPatientId"),patientName:n.get("patient.displayName"),admissionDate:n.get("startDate"),dischargeDate:n.get("endDate"),patientDays:d},!1,s),e+=d}.bind(this),0);a?this._addReportRow({patientDays:"Total: "+this._numberFormat(o)},!0,s):this._addReportRow({total:o},!1,s),this._finishReport(s)},_generateProcedureReport:function(e){this._findProceduresByDate().then(function(n){var a=void 0;if(n=n.filter(function(e){var n=e.get("visit");return!t.default.isEmpty(n)&&!t.default.isEmpty(n.get("patient.id"))&&n.get("patient.archived")!==!0}),0===e.indexOf("detailed")){a=this.get("procedureDetailReportColumns"),n.forEach(function(e){e.set("patient",e.get("visit.patient"))});var l=this._totalByType(n,"description","all procedures");this._addPatientProcedureRows(l,a),this._finishReport(a)}else a=this.get("diagnosticReportColumns"),this._addRowsByType(n,"description","Total procedures: ",a),this._finishReport(a)}.bind(this),function(e){this._notifyReportError("Error in _generateProcedureReport: "+e)}.bind(this))},_generateStatusReport:function(){this._findPatientsByStatus().then(function(e){var t=this.get("statusReportColumns"),n=e.sortBy("lastName","firstName");this._getPatientVisits(n).then(function(e){e.forEach(function(e){this._addReportRow({patient:e},!1,t)}.bind(this)),this._finishReport(t)}.bind(this)).catch(function(e){this._notifyReportError("Error in _generateStatusReport: "+e)}.bind(this))}.bind(this)).catch(function(e){this._notifyReportError("Error in _generateStatusReport: "+e)}.bind(this))},_generateVisitReport:function(e){var n=this,a=this.get("reportColumns"),l=this.getProperties("examiner","visitDate","visitType","location","clinic","primaryDiagnosis","secondaryDiagnosis");for(var s in l)if(!t.default.isEmpty(l[s]))switch(s){case"diagnosis":e=this._filterByLike(e,"diagnosisList",l[s]);break;default:e=e.filterBy(s,l[s])}a.procedures.include?!function(){var a={};e.forEach(function(e){a[e.get("id")]=e.get("procedures")}),t.default.RSVP.hash(a).then(function(t){e.forEach(function(e){e.set("resolvedProcedures",t[e.get("id")])}),this._finishVisitReport(e)}.bind(n))}():this._finishVisitReport(e)},_getPatientVisits:function(e){return new t.default.RSVP.Promise(function(n,a){var l={};e.forEach(function(e){l[e.get("id")]=this.getPatientVisits(e)}.bind(this)),t.default.RSVP.hash(l).then(function(t){e.forEach(function(e){e.set("visits",t[e.get("id")])}),n(e)},a)}.bind(this))},_haveLikeValue:function(e,t){return e.toLowerCase().indexOf(t.toLowerCase())>-1},_listToString:function(e,n,a){var l=[];return t.default.isEmpty(e)||(l=e.map(function(e){return t.default.get(e,n)+" ( "+this._dateFormat(t.default.get(e,a))+")"}.bind(this))),l.join(",\n")},_totalByType:function(e,n,a){var l=0,s=[];return e.forEach(function(e){var a=e.get(n),i=void 0;t.default.isEmpty(a)||(i=s.find(function(e){var t=e.type;return t.trim().toLowerCase()===a.toLowerCase()}),t.default.isEmpty(i)&&(i={type:a.trim(),total:0,records:[]},s.push(i)),i.total++,i.records.push(e),l++)}),s=s.sortBy("type"),s.push({type:a,total:l}),s},_procedureListToString:function(e){return this._listToString(e,"description","procedureDate")},_validateDates:function(){var e=void 0,n=this.get("endDate"),a=!0,l=this.get("reportType"),s=this.get("startDate");return"status"===l||(t.default.isEmpty(s)?(e="Please enter a start date.",a=!1):!t.default.isEmpty(n)&&n.getTime()0&&this.set("firstKey",this._getStartKeyFromItem(e.get("firstObject"))),e.get("length")>i){var n=e.popObject();this.set("nextStartKey",this._getStartKeyFromItem(n))}else this.set("nextStartKey");t(e)}.bind(this),a)}.bind(this))},queryParams:{sortDesc:{refreshModel:!0},sortKey:{refreshModel:!0},startKey:{refreshModel:!0}},setupController:function(e,t){var a=this.getProperties("firstKey","nextStartKey");e.setProperties(a);var l={currentScreenTitle:this.get("pageTitle")};this.get("hideNewButton")?l.newButtonAction=null:n.default.isEmpty(this.get("newButtonAction"))||(l.newButtonAction=this.get("newButtonAction")),n.default.isEmpty(this.get("newButtonText"))||(l.newButtonText=this.get("newButtonText")),this.send("setSectionHeader",l),this.closeProgressModal(),this._super(e,t)}})}),define("hospitalrun/routes/abstract-module-route",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember","hospitalrun/mixins/user-session"],function(e,t,n,a){function l(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0),e.set("searchText",this.get("searchText")),this.controllerFor("navigation").closeProgressModal();var n=this.controllerFor(this.get("moduleName")),l="Search Results for "+a.default.Handlebars.Utils.escapeExpression(this.get("searchText"))+"";n.set("currentScreenTitle",l.htmlSafe())}})}),define("hospitalrun/routes/application",["exports","ember-simple-auth/mixins/application-route-mixin","ember","hospitalrun/mixins/setup-user-role"],function(e,t,n,a){var l=n.default.inject,s=n.default.Route,i=s.extend(t.default,a.default,{database:l.service(),config:l.service(),session:l.service(),shouldSetupUserRole:!0,actions:{closeModal:function(){this.disconnectOutlet({parentView:"application",outlet:"modal"})},openModal:function(e,t){t&&this.controllerFor(e).set("model",t),this.renderModal(e)},updateModal:function(e,t){this.controllerFor(e).set("model",t)}},model:function(e,t){var n=this.get("session"),a=n&&n.get("isAuthenticated");return this.get("config").setup().then(function(e){if("finishgauth"!==t.targetName&&"login"!==t.targetName){if(this.set("shouldSetupUserRole",!0),a)return this.get("database").setup(e).catch(function(){n.invalidate()})}else"finishgauth"===t.targetName&&this.set("shouldSetupUserRole",!1)}.bind(this))},afterModel:function(){this.controllerFor("navigation").set("allowSearch",!1),$("#apploading").remove()},renderModal:function(e){this.render(e,{into:"application",outlet:"modal"})},sessionAuthenticated:function(){this.get("shouldSetupUserRole")===!0&&this.setupUserRole(),this._super()}});e.default=i}),define("hospitalrun/routes/index",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember"],function(e,t,n){e.default=n.default.Route.extend(t.default,{afterModel:function(){this.controllerFor("navigation").set("allowSearch",!1)}})}),define("hospitalrun/routes/login",["exports","ember","ember-simple-auth/mixins/unauthenticated-route-mixin"],function(e,t,n){e.default=t.default.Route.extend(n.default,{config:t.default.inject.service(),beforeModel:function(e){return this.get("session").get("isAuthenticated")?void this._super(e):this.get("config").useGoogleAuth().then(function(e){e&&window.location.replace("/auth/google")})}})}),define("hospitalrun/serializers/application",["exports","ember-pouch"],function(e,t){e.default=t.Serializer.extend()}),define("hospitalrun/serializers/user",["exports","ember-data"],function(e,t){var n=t.default.JSONSerializer.extend({attrs:{rev:"_rev"},primaryKey:"_id",isNewSerializerAPI:!0,normalizeArrayResponse:function(e,t,n,a,l){var s=n.rows.map(function(e){return e.doc}.bind(this));return this._super(e,t,s,a,l)},normalizeSaveResponse:function(e,t,n){return{data:{id:n.id,type:"user",attrs:{rev:n.rev}}}}});e.default=n}),define("hospitalrun/services/ajax",["exports","ember-ajax/services/ajax"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/services/config",["exports","ember"],function(e,t){var n=t.default.inject,a=t.default.run;e.default=t.default.Service.extend({configDB:null,database:n.service(),session:n.service(),sessionData:t.default.computed.alias("session.data"),setup:function(){var e=this.replicateConfigDB.bind(this),t=this.loadConfig.bind(this),n=this.createDB();return this.set("configDB",n),this.setCurrentUser(),e(n).then(t)},createDB:function(){return new PouchDB("config")},replicateConfigDB:function(e){var n=new t.default.RSVP.Promise(function(t){var n=document.location.protocol+"//"+document.location.host+"/db/config";e.replicate.from(n).then(t).catch(t)});return n},loadConfig:function(){var e=this.get("configDB"),n={include_docs:!0,keys:["config_consumer_key","config_consumer_secret","config_disable_offline_sync","config_oauth_token","config_token_secret","config_use_google_auth"]};return new t.default.RSVP.Promise(function(t,a){e.allDocs(n,function(e,n){e&&(console.log("Could not get configDB configs:",e),a(e));for(var l={},s=0;s-1){d=n;var u=n.split("/");r=u.pop(),n=u.join("/"),n+="/"}if(d.indexOf(".")===-1)if(e.type){var p=e.type.split("/");d+="."+p.pop()}else d+=".png";this.fileExists(d).then(function(u){if(u&&(d=n+i.getTime()+r),t.default.isEmpty(o)&&s("Local filesystem unavailable, please use Google Chrome browser"),t.default.isEmpty(r)&&!t.default.isEmpty(e.type)){var p=e.type.split("/");p.length>1&&(d+="."+p[1])}o.mkdir(n,!1,function(){o.write(d,{data:e,type:e.type},function(e){c.saveFileLink(d,a),l(e)},function(e){s(e)})},function(e){s(e)})}.bind(this))}.bind(this))},deleteFile:function(e,n){return new t.default.RSVP.Promise(function(t,a){var l=this.get("filer"),s=this.get("config");try{l.rm(e,function(){s.removeFileLink(n),t()},a)}catch(e){a(e)}}.bind(this))},downloadIfNeeded:function(e){var n=t.default.get(e,"fileName");this.fileExists(n).then(function(t){t||this._downloadFileFromServer(e)}.bind(this))},fileExists:function(e){return new t.default.RSVP.Promise(function(t){var n=this.get("filer");n.fs.root.getFile(e,{},function(){t(!0)},function(){t(!1)})}.bind(this))},fileToDataURL:function(e){return new t.default.RSVP.Promise(function(t){var n=new FileReader;n.onloadend=function(e){t(e.target.result)},n.readAsDataURL(e)})},fileToString:function(e){return new t.default.RSVP.Promise(function(t){var n=new FileReader;n.onloadend=function(e){t(e.target.result)},n.readAsText(e)})},isFileSystemEnabled:function(){var e=this.get("filer");return!t.default.isEmpty(e)}.property("filer"),pathToFileSystemURL:function(e){return new t.default.RSVP.Promise(function(t){var n=this.get("filer");n.fs.root.getFile(e,{},function(e){t(e.toURL())},function(){t()})}.bind(this))}})}),define("hospitalrun/services/i18n",["exports","ember-i18n/services/i18n"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/services/keyboard",["exports","ember-keyboard/services/keyboard"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/services/session",["exports","ember-simple-auth/services/session"],function(e,t){e.default=t.default}),define("hospitalrun/services/validations",["exports","ember"],function(e,t){var n=t.default.set;e.default=t.default.Service.extend({init:function(){n(this,"cache",{})}})}),define("hospitalrun/serviceworkers/pouchdb-sync",["exports"],function(e){function t(){if(!d&&r.config_disable_offline_sync!==!0){var e={ajax:{headers:{},timeout:3e4}};r.config_consumer_secret&&r.config_token_secret&&r.config_consumer_key&&r.config_oauth_token&&(e.ajax.headers["x-oauth-consumer-secret"]=r.config_consumer_secret,e.ajax.headers["x-oauth-consumer-key"]=r.config_consumer_key,e.ajax.headers["x-oauth-token-secret"]=r.config_token_secret,e.ajax.headers["x-oauth-token"]=r.config_oauth_token);var t=self.location.protocol+"//"+self.location.host+"/db/main",n=new PouchDB(t,e);d=u.sync(n,{live:!0,retry:!0}).on("change",function(e){logDebug("local sync change",e)}).on("paused",function(){logDebug("local sync paused")}).on("active",function(){logDebug("local sync active")}).on("denied",function(e){logDebug("local sync denied:",e)}).on("complete",function(e){logDebug("local sync complete:",e)}).on("error",function(e){logDebug("local sync error:",e)})}}function n(){return new Promise(function(e,t){r?e():c.allDocs({include_docs:!0}).then(function(t){r={},t.rows.forEach(function(e){r[e.id]=e.doc.value}),e()},t)})}function a(e,a,l,s){return n().then(t).catch(function(e){logDebug("Error setting up remote sync",JSON.stringify(e,null,2))}),logDebug("Looking for couchdb response for:",e.url),new Promise(function(t,n){var r=performance.now();toolbox.networkOnly(e,a,l).then(function(a){if(a){var l=performance.now()-r;t(a),i(l,e.url)}else logDebug("Network first returned no response, get data from local pouch db."),o(s,e,t,n)}).catch(function(a){logDebug("Network first returned err, get data from local pouch db:",a),o(s,e,t,n)})})}function l(e){return new Response(JSON.stringify(e),{status:200,statusText:"OK"})}function s(e){var t={};if(e.indexOf("?")>0)for(var n=e.split("?"),a=decodeURIComponent(n[1]).split("&"),l=0;l()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/}}),define("hospitalrun/utils/get-cmd-key",["exports","ember-keyboard/utils/get-cmd-key"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/i18n/compile-template",["exports","ember-i18n/utils/i18n/compile-template"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/i18n/missing-message",["exports","ember-i18n/utils/i18n/missing-message"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/item-condition",["exports","ember"],function(e,t){function n(){var e=arguments.length<=0||void 0===arguments[0]?"B":arguments[0],n=t.default.A(l).findBy("rank",e);return n.value}function a(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];return e*=t,e>=14?"good":e<7?"bad":"average"}e.rankToMultiplier=n,e.getCondition=a;var l=[{rank:"A",value:.5},{rank:"B",value:1},{rank:"C",value:2}]}),define("hospitalrun/utils/listener-name",["exports","ember-keyboard/utils/listener-name"],function(e,t){Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.default}})}),define("hospitalrun/utils/patient-validation",["exports","ember"],function(e,t){e.default={patientTypeAhead:{acceptance:{accept:!0,if:function(e){if(!e.get("selectPatient"))return!1;if(!e.get("hasDirtyAttributes"))return!1;var n=e.get("patient.displayName"),a=e.get("patientTypeAhead");if(t.default.isEmpty(n)||t.default.isEmpty(a))return!0;var l=a.substr(0,n.length).toLowerCase();return 0!==n.toLowerCase().indexOf(l)},message:"Please select a patient"}}}}),define("hospitalrun/utils/pouch-views",["exports","ember"],function(e,t){function n(e,t){return t.query(e,{limit:0}).catch(function(e){console.log("index error: "+JSON.stringify(e,null,2))})}function a(e,t){var n={_id:"_design/"+e.name,version:e.version,views:{}};return t&&(n._rev=t),n.views[e.name]={map:e.function.toString()},e.sort&&(n.lists={sort:e.sort}),n}function l(e,a,l,s){return a.get("_design/"+e.name).then(function(i){return i.version!==e.version?o(e,a,i._rev,l,s):l?n(e.name,a):t.default.RSVP.resolve()},function(){return o(e,a,null,l,s)})}function s(e,t,n){var a="function(head, req) {function keysEqual(keyA, keyB) {for (var i= 0; i < keyA.length; i++) {if (keyA[i] !== keyB[i]) {return false;}}return true;}";return t&&(a+='function getCompareDate(dateString) {if (!dateString || dateString === "") {return 0;}return new Date(dateString).getTime();}'),a+='function compareStrings(aString, bString) {if (!aString) {aString = "";}if (!bString) {bString = "";}if (aString < bString) {return -1;} else if (aString > bString) {return 1;} else {return 0;}}var row,rows=[],startingPosition = 0;while(row = getRow()) {rows.push(row);}',n&&(a+="rows = rows.filter("+n+");"),a+="rows.sort("+e+');if (req.query.sortDesc) {rows = rows.reverse();}if (req.query.sortStartKey) {var startKey = JSON.parse(req.query.sortStartKey);for (var i=0; i 0) {rows = rows.slice(startingPosition);}send(JSON.stringify({"rows" : rows}));}'}function i(e,t){return"function(doc) {\n var doctype, uidx;\n if (doc._id && (uidx = doc._id.indexOf('_')) > 0 && !doc.data.archived) {\n doctype = doc._id.substring(0, uidx);\n if (doctype === '"+e+"') {\n "+t+"\n }\n }\n }"}function o(e,t,l,s,i){var o=a(e,l);return s&&console.log("WARNING: The view "+e.name+" is out of date. Please update the pouch dump "+i+" to the latest version of "+e.name),t.put(o).then(function(){return n(e.name,t)},function(e){console.log("ERR updating design doc:",JSON.stringify(e,null,2))})}function r(e){return"var "+e+" = doc.data."+e+";\n if ("+e+" && "+e+' !== "") {\n '+e+" = new Date("+e+");\n if ("+e+".getTime) {\n "+e+" = "+e+".getTime();\n }\n }"}var d="if (doc.data.friendlyId) {\n emit([doc.data.friendlyId, doc._id]);\n } else if (doc.data.externalPatientId) {\n emit([doc.data.externalPatientId, doc._id]);\n } else {\n emit([doc._id, doc._id]);\n }",c=s(function(e,t){var n="";switch(req.query&&req.query.sortKey&&(n=req.query.sortKey),n){case"firstName":case"sex":case"lastName":case"status":return compareStrings(e.doc.data[n],t.doc.data[n]);case"dateOfBirth":return getCompareDate(e.doc.data.dateOfBirth)-getCompareDate(t.doc.data.dateOfBirth);default:return 0}}.toString(),!0),u=[{name:"appointments_by_date",function:i("appointment",r("endDate")+"\n "+r("startDate")+"\n emit([startDate, endDate, doc._id]);"),sort:s(function(e,t){function n(e){return e&&""!==e?e:"Scheduled"}var a="";switch(req.query&&req.query.sortKey&&(a=req.query.sortKey),a){case"appointmentType":case"location":case"provider":return compareStrings(e.doc.data[a],t.doc.data[a]);case"date":var l=getCompareDate(e.doc.data.startDate)-getCompareDate(t.doc.data.startDate);return 0===l?getCompareDate(e.doc.data.endDate)-getCompareDate(t.doc.data.endDate):l;case"status":var s=n(e.doc.data[a]),i=n(t.doc.data[a]);return compareStrings(s,i);default:return 0}}.toString(),!0,function(e){var t=null,n=!0;if(req.query&&req.query.filterBy&&(t=JSON.parse(req.query.filterBy)),!t)return!0;for(var a=0;a","11011011000",30],["?","11011000110",31],["@","11000110110",32],["A","10100011000",33],["B","10001011000",34],["C","10001000110",35],["D","10110001000",36],["E","10001101000",37],["F","10001100010",38],["G","11010001000",39],["H","11000101000",40],["I","11000100010",41],["J","10110111000",42],["K","10110001110",43],["L","10001101110",44],["M","10111011000",45],["N","10111000110",46],["O","10001110110",47],["P","11101110110",48],["Q","11010001110",49],["R","11000101110",50],["S","11011101000",51],["T","11011100010",52],["U","11011101110",53],["V","11101011000",54],["W","11101000110",55],["X","11100010110",56],["Y","11101101000",57],["Z","11101100010",58],["[","11100011010",59],["\\","11101111010",60],["]","11001000010",61],["^","11110001010",62],["_","10100110000",63],["`","10100001100",64],["a","10010110000",65],["b","10010000110",66],["c","10000101100",67],["d","10000100110",68],["e","10110010000",69],["f","10110000100",70],["g","10011010000",71],["h","10011000010",72],["i","10000110100",73],["j","10000110010",74],["k","11000010010",75],["l","11001010000",76],["m","11110111010",77],["n","11000010100",78],["o","10001111010",79],["p","10100111100",80],["q","10010111100",81],["r","10010011110",82],["s","10111100100",83],["t","10011110100",84],["u","10011110010",85],["v","11110100100",86],["w","11110010100",87],["x","11110010010",88],["y","11011011110",89],["z","11011110110",90],["{","11110110110",91],["|","10101111000",92],["}","10100011110",93],["~","10001011110",94],[String.fromCharCode(127),"10111101000",95],[String.fromCharCode(128),"10111100010",96],[String.fromCharCode(129),"11110101000",97],[String.fromCharCode(130),"11110100010",98],[String.fromCharCode(131),"10111011110",99],[String.fromCharCode(132),"10111101110",100],[String.fromCharCode(133),"11101011110",101],[String.fromCharCode(134),"11110101110",102]],l="11010010000",c="1100011101011",f=/^[!-~ ]+$/}window.EmberENV={FEATURES:{},EXTEND_PROTOTYPES:{Date:!1}};var runningTests=!1,loader,define,requireModule,require,requirejs;if(function(e){"use strict";function t(){l={define:0,require:0,reify:0,findDeps:0,modules:0,exports:0,resolve:0,resolveRelative:0,findModule:0,pendingQueueLength:0},requirejs._stats=l}function n(e){throw new Error("an unsupported module was defined, expected `define(name, deps, module)` instead got: `"+e+"` arguments to define`")}function r(e,t,n,r){l.modules++,this.id=p++,this.name=e,this.deps=!t.length&&n.length?m:t,this.module={exports:{}},this.callback=n,this.hasExportsAsDep=!1,this.isAlias=r,this.reified=new Array(t.length),this.state="new"}function i(e){this.name=e}function o(e,t){throw new Error("Could not find module `"+e+"` imported from `"+t+"`")}function s(e,t,n){l.findModule++;for(var r=d[e]||d[e+"/index"];r&&r.isAlias;)r=d[r.name];return r||o(e,t),n&&"pending"!==r.state&&"finalized"!==r.state&&(r.findDeps(n),n.push(r),l.pendingQueueLength++),r}function a(e,t){if(l.resolve++,"."!==e.charAt(0))return e;l.resolveRelative++;for(var n=e.split("/"),r=t.split("/"),i=r.slice(0,-1),o=0,s=n.length;o=0;r--)t[r].exports();return n.module.exports},t(),loader={noConflict:function(t){var n,r;for(n in t)t.hasOwnProperty(n)&&c.hasOwnProperty(n)&&(r=t[n],e[r]=e[n],e[n]=c[n])}};var f;f=Array.isArray?Array.isArray:function(e){return"[object Array]"===Object.prototype.toString.call(e)};var d={},h={},p=0,m=["require","exports","module"];r.prototype.makeDefaultExport=function(){var e=this.module.exports;null===e||"object"!=typeof e&&"function"!=typeof e||void 0!==e.default||Object.isFrozen(e)||(e.default=e)},r.prototype.exports=function(){if("finalized"===this.state||"reifying"===this.state)return this.module.exports;l.exports++,loader.wrapModules&&(this.callback=loader.wrapModules(this.name,this.callback)),this.reify();var e=this.callback.apply(this,this.reified);return this.state="finalized",this.hasExportsAsDep&&void 0===e||(this.module.exports=e),this.makeDefaultExport(),this.module.exports},r.prototype.unsee=function(){this.state="new",this.module={exports:{}}},r.prototype.reify=function(){if("reified"!==this.state){this.state="reifying";try{this.reified=this._reify(),this.state="reified"}finally{"reifying"===this.state&&(this.state="errored")}}},r.prototype._reify=function(){l.reify++;for(var e=this.reified.slice(),t=0;t0&&t-1 in e)}function i(e,t,n){return pe.isFunction(t)?pe.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?pe.grep(e,function(e){return e===t!==n}):"string"!=typeof t?pe.grep(e,function(e){return se.call(t,e)>-1!==n}):ke.test(t)?pe.filter(t,e,n):(t=pe.filter(t,e),pe.grep(e,function(e){return se.call(t,e)>-1!==n&&1===e.nodeType}))}function o(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function s(e){var t={};return pe.each(e.match(Re)||[],function(e,n){t[n]=!0}),t}function a(e){return e}function u(e){throw e}function l(e,t,n){var r;try{e&&pe.isFunction(r=e.promise)?r.call(e).done(t).fail(n):e&&pe.isFunction(r=e.then)?r.call(e,t,n):t.call(void 0,e)}catch(e){n.call(void 0,e)}}function c(){te.removeEventListener("DOMContentLoaded",c),e.removeEventListener("load",c),pe.ready()}function f(){this.expando=pe.expando+f.uid++}function d(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Le.test(e)?JSON.parse(e):e)}function h(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Fe,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=d(n)}catch(e){}Ie.set(e,t,n)}else n=void 0;return n}function p(e,t,n,r){var i,o=1,s=20,a=r?function(){return r.cur()}:function(){return pe.css(e,t,"")},u=a(),l=n&&n[3]||(pe.cssNumber[t]?"":"px"),c=(pe.cssNumber[t]||"px"!==l&&+u)&&qe.exec(pe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do o=o||".5",c/=o,pe.style(e,t,c+l);while(o!==(o=a()/u)&&1!==o&&--s)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function m(e){var t,n=e.ownerDocument,r=e.nodeName,i=$e[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=pe.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),$e[r]=i,i)}function v(e,t){for(var n,r,i=[],o=0,s=e.length;o-1)i&&i.push(o);else if(l=pe.contains(o.ownerDocument,o),s=y(f.appendChild(o),"script"),l&&g(s),n)for(c=0;o=s[c++];)Ke.test(o.type||"")&&n.push(o);return f}function _(){return!0}function w(){return!1}function x(){try{return te.activeElement}catch(e){}}function E(e,t,n,r,i,o){var s,a;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(a in t)E(e,a,n,r,t[a],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=w;else if(!i)return e;return 1===o&&(s=i,i=function(e){return pe().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=pe.guid++)),e.each(function(){pe.event.add(this,t,i,r,n)})}function k(e,t){return pe.nodeName(e,"table")&&pe.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e:e}function S(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function A(e){var t=rt.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function O(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(Pe.hasData(e)&&(o=Pe.access(e),s=Pe.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;n1&&"string"==typeof p&&!de.checkClone&&nt.test(p))return e.each(function(n){var o=e.eq(n);m&&(t[0]=p.call(this,n,o.html())),C(o,t,r,i)});if(d&&(o=b(t,e[0].ownerDocument,!1,e,i),s=o.firstChild,1===o.childNodes.length&&(o=s),s||i)){for(a=pe.map(y(o,"script"),S),u=a.length;f=0&&nE.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[q]=!0,e}function i(e){var t=N.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)E.attrHandle[n[r]]=t}function s(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function a(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ke(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),s=o.length;s--;)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}function f(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function d(){}function h(e){for(var t=0,n=e.length,r="";t1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function v(e,n,r){for(var i=0,o=n.length;i-1&&(r[l]=!(s[l]=f))}}else b=y(b===s?b.splice(p,b.length):b),o?o(null,s,b,u):X.apply(s,b)})}function b(e){for(var t,n,r,i=e.length,o=E.relative[e[0].type],s=o||E.relative[" "],a=o?1:0,u=p(function(e){return e===t},s,!0),l=p(function(e){return ee(t,e)>-1},s,!0),c=[function(e,n,r){var i=!o&&(r||n!==C)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];a1&&m(c),a>1&&h(e.slice(0,a-1).concat({value:" "===e[a-2].type?"*":""})).replace(ae,"$1"),n,a0,o=e.length>0,s=function(r,s,a,u,l){var c,f,d,h=0,p="0",m=r&&[],v=[],g=C,b=r||o&&E.find.TAG("*",l),_=U+=null==g?1:Math.random()||.1,w=b.length;for(l&&(C=s===N||s||l);p!==w&&null!=(c=b[p]);p++){if(o&&c){for(f=0,s||c.ownerDocument===N||(j(c),a=!P);d=e[f++];)if(d(c,s||N,a)){u.push(c);break}l&&(U=_)}i&&((c=!d&&c)&&h--,r&&m.push(c))}if(h+=p,i&&p!==h){for(f=0;d=n[f++];)d(m,v,s,a);if(r){if(h>0)for(;p--;)m[p]||v[p]||(v[p]=J.call(u));v=y(v)}X.apply(u,v),l&&!r&&v.length>0&&h+n.length>1&&t.uniqueSort(u)}return l&&(U=_,C=g),m};return i?r(s):s}var w,x,E,k,S,A,O,T,C,R,D,j,N,M,P,I,L,F,B,q="sizzle"+1*new Date,z=e.document,U=0,H=0,$=n(),W=n(),V=n(),K=function(e,t){return e===t&&(D=!0),0},Y={}.hasOwnProperty,G=[],J=G.pop,Q=G.push,X=G.push,Z=G.slice,ee=function(e,t){for(var n=0,r=e.length;n+~]|"+ne+")"+ne+"*"),ce=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),fe=new RegExp(oe),de=new RegExp("^"+re+"$"),he={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},pe=/^(?:input|select|textarea|button)$/i,me=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,ye=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ge=/[+~]/,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),_e=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},we=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,xe=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},Ee=function(){j()},ke=p(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{X.apply(G=Z.call(z.childNodes),z.childNodes),G[z.childNodes.length].nodeType}catch(e){X={apply:G.length?function(e,t){Q.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}x=t.support={},S=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},j=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:z;return r!==N&&9===r.nodeType&&r.documentElement?(N=r,M=N.documentElement,P=!S(N),z!==N&&(n=N.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",Ee,!1):n.attachEvent&&n.attachEvent("onunload",Ee)),x.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),x.getElementsByTagName=i(function(e){return e.appendChild(N.createComment("")),!e.getElementsByTagName("*").length}),x.getElementsByClassName=ve.test(N.getElementsByClassName),x.getById=i(function(e){return M.appendChild(e).id=q,!N.getElementsByName||!N.getElementsByName(q).length}),x.getById?(E.filter.ID=function(e){var t=e.replace(be,_e);return function(e){return e.getAttribute("id")===t}},E.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&P){var n=t.getElementById(e);return n?[n]:[]}}):(E.filter.ID=function(e){var t=e.replace(be,_e);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t; +}},E.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&P){var n,r,i,o=t.getElementById(e);if(o){if(n=o.getAttributeNode("id"),n&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if(n=o.getAttributeNode("id"),n&&n.value===e)return[o]}return[]}}),E.find.TAG=x.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):x.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},E.find.CLASS=x.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&P)return t.getElementsByClassName(e)},L=[],I=[],(x.qsa=ve.test(N.querySelectorAll))&&(i(function(e){M.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&I.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||I.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+q+"-]").length||I.push("~="),e.querySelectorAll(":checked").length||I.push(":checked"),e.querySelectorAll("a#"+q+"+*").length||I.push(".#.+[+~]")}),i(function(e){e.innerHTML="";var t=N.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&I.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&I.push(":enabled",":disabled"),M.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&I.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),I.push(",.*:")})),(x.matchesSelector=ve.test(F=M.matches||M.webkitMatchesSelector||M.mozMatchesSelector||M.oMatchesSelector||M.msMatchesSelector))&&i(function(e){x.disconnectedMatch=F.call(e,"*"),F.call(e,"[s!='']:x"),L.push("!=",oe)}),I=I.length&&new RegExp(I.join("|")),L=L.length&&new RegExp(L.join("|")),t=ve.test(M.compareDocumentPosition),B=t||ve.test(M.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=t?function(e,t){if(e===t)return D=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!x.sortDetached&&t.compareDocumentPosition(e)===n?e===N||e.ownerDocument===z&&B(z,e)?-1:t===N||t.ownerDocument===z&&B(z,t)?1:R?ee(R,e)-ee(R,t):0:4&n?-1:1)}:function(e,t){if(e===t)return D=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],u=[t];if(!i||!o)return e===N?-1:t===N?1:i?-1:o?1:R?ee(R,e)-ee(R,t):0;if(i===o)return s(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;a[r]===u[r];)r++;return r?s(a[r],u[r]):a[r]===z?-1:u[r]===z?1:0},N):N},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==N&&j(e),n=n.replace(ce,"='$1']"),x.matchesSelector&&P&&!V[n+" "]&&(!L||!L.test(n))&&(!I||!I.test(n)))try{var r=F.call(e,n);if(r||x.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,N,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==N&&j(e),B(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==N&&j(e);var n=E.attrHandle[t.toLowerCase()],r=n&&Y.call(E.attrHandle,t.toLowerCase())?n(e,t,!P):void 0;return void 0!==r?r:x.attributes||!P?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(we,xe)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(D=!x.detectDuplicates,R=!x.sortStable&&e.slice(0),e.sort(K),D){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return R=null,e},k=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=k(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=k(t);return n},E=t.selectors={cacheLength:50,createPseudo:r,match:he,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,_e),e[3]=(e[3]||e[4]||e[5]||"").replace(be,_e),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return he.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&fe.test(n)&&(t=A(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,_e).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(se," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,h,p,m=o!==s?"nextSibling":"previousSibling",v=t.parentNode,y=a&&t.nodeName.toLowerCase(),g=!u&&!a,b=!1;if(v){if(o){for(;m;){for(d=t;d=d[m];)if(a?d.nodeName.toLowerCase()===y:1===d.nodeType)return!1;p=m="only"===e&&!p&&"nextSibling"}return!0}if(p=[s?v.firstChild:v.lastChild],s&&g){for(d=v,f=d[q]||(d[q]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],h=l[0]===U&&l[1],b=h&&l[2],d=h&&v.childNodes[h];d=++h&&d&&d[m]||(b=h=0)||p.pop();)if(1===d.nodeType&&++b&&d===t){c[e]=[U,h,b];break}}else if(g&&(d=t,f=d[q]||(d[q]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],h=l[0]===U&&l[1],b=h),b===!1)for(;(d=++h&&d&&d[m]||(b=h=0)||p.pop())&&((a?d.nodeName.toLowerCase()!==y:1!==d.nodeType)||!++b||(g&&(f=d[q]||(d[q]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[U,b]),d!==t)););return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,n){var i,o=E.pseudos[e]||E.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[q]?o(n):o.length>1?(i=[e,e,"",n],E.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),s=i.length;s--;)r=ee(e,i[s]),e[r]=!(t[r]=i[s])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=O(e.replace(ae,"$1"));return i[q]?r(function(e,t,n,r){for(var o,s=i(e,null,r,[]),a=e.length;a--;)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,_e),function(t){return(t.textContent||t.innerText||k(t)).indexOf(e)>-1}}),lang:r(function(e){return de.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,_e).toLowerCase(),function(t){var n;do if(n=P?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===M},focus:function(e){return e===N.activeElement&&(!N.hasFocus||N.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:l(!1),disabled:l(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!E.pseudos.empty(e)},header:function(e){return me.test(e.nodeName)},input:function(e){return pe.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[n<0?n+t:n]}),even:c(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=n<0?n+t:n;++r2&&"ID"===(s=o[0]).type&&9===t.nodeType&&P&&E.relative[o[1].type]){if(t=(E.find.ID(s.matches[0].replace(be,_e),t)||[])[0],!t)return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=he.needsContext.test(e)?0:o.length;i--&&(s=o[i],!E.relative[a=s.type]);)if((u=E.find[a])&&(r=u(s.matches[0].replace(be,_e),ge.test(o[0].type)&&f(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&h(o),!e)return X.apply(n,r),n;break}}return(l||O(e,c))(r,t,!P,n,!t||ge.test(e)&&f(t.parentNode)||t),n},x.sortStable=q.split("").sort(K).join("")===q,x.detectDuplicates=!!D,j(),x.sortDetached=i(function(e){return 1&e.compareDocumentPosition(N.createElement("fieldset"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),x.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;if(!n)return e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);pe.find=be,pe.expr=be.selectors,pe.expr[":"]=pe.expr.pseudos,pe.uniqueSort=pe.unique=be.uniqueSort,pe.text=be.getText,pe.isXMLDoc=be.isXML,pe.contains=be.contains,pe.escapeSelector=be.escape;var _e=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&pe(e).is(n))break;r.push(e)}return r},we=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},xe=pe.expr.match.needsContext,Ee=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,ke=/^.[^:#\[\.,]*$/;pe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?pe.find.matchesSelector(r,e)?[r]:[]:pe.find.matches(e,pe.grep(t,function(e){return 1===e.nodeType}))},pe.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(pe(e).filter(function(){for(t=0;t1?pe.uniqueSort(n):n},filter:function(e){return this.pushStack(i(this,e||[],!1))},not:function(e){return this.pushStack(i(this,e||[],!0))},is:function(e){return!!i(this,"string"==typeof e&&xe.test(e)?pe(e):e||[],!1).length}});var Se,Ae=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,Oe=pe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||Se,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ae.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof pe?t[0]:t,pe.merge(this,pe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:te,!0)),Ee.test(r[1])&&pe.isPlainObject(t))for(r in t)pe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=te.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):pe.isFunction(e)?void 0!==n.ready?n.ready(e):e(pe):pe.makeArray(e,this)};Oe.prototype=pe.fn,Se=pe(te);var Te=/^(?:parents|prev(?:Until|All))/,Ce={children:!0,contents:!0,next:!0,prev:!0};pe.fn.extend({has:function(e){var t=pe(e,this),n=t.length;return this.filter(function(){for(var e=0;e-1:1===n.nodeType&&pe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?pe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?se.call(pe(e),this[0]):se.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(pe.uniqueSort(pe.merge(this.get(),pe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),pe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return _e(e,"parentNode")},parentsUntil:function(e,t,n){return _e(e,"parentNode",n)},next:function(e){return o(e,"nextSibling")},prev:function(e){return o(e,"previousSibling")},nextAll:function(e){return _e(e,"nextSibling")},prevAll:function(e){return _e(e,"previousSibling")},nextUntil:function(e,t,n){return _e(e,"nextSibling",n)},prevUntil:function(e,t,n){return _e(e,"previousSibling",n)},siblings:function(e){return we((e.parentNode||{}).firstChild,e)},children:function(e){return we(e.firstChild)},contents:function(e){return e.contentDocument||pe.merge([],e.childNodes)}},function(e,t){pe.fn[e]=function(n,r){var i=pe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=pe.filter(r,i)),this.length>1&&(Ce[e]||pe.uniqueSort(i),Te.test(e)&&i.reverse()),this.pushStack(i)}});var Re=/[^\x20\t\r\n\f]+/g;pe.Callbacks=function(e){e="string"==typeof e?s(e):pe.extend({},e);var t,n,r,i,o=[],a=[],u=-1,l=function(){for(i=e.once,r=t=!0;a.length;u=-1)for(n=a.shift();++u-1;)o.splice(n,1),n<=u&&u--}),this},has:function(e){return e?pe.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},pe.extend({Deferred:function(t){var n=[["notify","progress",pe.Callbacks("memory"),pe.Callbacks("memory"),2],["resolve","done",pe.Callbacks("once memory"),pe.Callbacks("once memory"),0,"resolved"],["reject","fail",pe.Callbacks("once memory"),pe.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return pe.Deferred(function(t){pe.each(n,function(n,r){var i=pe.isFunction(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&pe.isFunction(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var l=this,c=arguments,f=function(){var e,f;if(!(t=s&&(r!==u&&(l=void 0,c=[e]),n.rejectWith(l,c))}};t?d():(pe.Deferred.getStackHook&&(d.stackTrace=pe.Deferred.getStackHook()),e.setTimeout(d))}}var s=0;return pe.Deferred(function(e){n[0][3].add(o(0,e,pe.isFunction(i)?i:a,e.notifyWith)),n[1][3].add(o(0,e,pe.isFunction(t)?t:a)),n[2][3].add(o(0,e,pe.isFunction(r)?r:u))}).promise()},promise:function(e){return null!=e?pe.extend(e,i):i}},o={};return pe.each(n,function(e,t){var s=t[2],a=t[5];i[t[1]]=s.add,a&&s.add(function(){r=a},n[3-e][2].disable,n[0][2].lock),s.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=s.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=re.call(arguments),o=pe.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?re.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(l(e,o.done(s(n)).resolve,o.reject),"pending"===o.state()||pe.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)l(i[n],s(n),o.reject);return o.promise()}});var De=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;pe.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&De.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},pe.readyException=function(t){e.setTimeout(function(){throw t})};var je=pe.Deferred();pe.fn.ready=function(e){return je.then(e).catch(function(e){pe.readyException(e)}),this},pe.extend({isReady:!1,readyWait:1,holdReady:function(e){e?pe.readyWait++:pe.ready(!0)},ready:function(e){(e===!0?--pe.readyWait:pe.isReady)||(pe.isReady=!0,e!==!0&&--pe.readyWait>0||je.resolveWith(te,[pe]))}}),pe.ready.then=je.then,"complete"===te.readyState||"loading"!==te.readyState&&!te.documentElement.doScroll?e.setTimeout(pe.ready):(te.addEventListener("DOMContentLoaded",c),e.addEventListener("load",c));var Ne=function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===pe.type(n)){i=!0;for(a in n)Ne(e,t,a,n[a],!0,o,s)}else if(void 0!==r&&(i=!0,pe.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(pe(e),n)})),t))for(;a1,null,!0)},removeData:function(e){return this.each(function(){Ie.remove(this,e)})}}),pe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Pe.get(e,t),n&&(!r||pe.isArray(n)?r=Pe.access(e,t,pe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=pe.queue(e,t),r=n.length,i=n.shift(),o=pe._queueHooks(e,t),s=function(){pe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Pe.get(e,n)||Pe.access(e,n,{empty:pe.Callbacks("once memory").add(function(){Pe.remove(e,[t+"queue",n])})})}}),pe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Ke=/^$|\/(?:java|ecma)script/i,Ye={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Ye.optgroup=Ye.option,Ye.tbody=Ye.tfoot=Ye.colgroup=Ye.caption=Ye.thead,Ye.th=Ye.td;var Ge=/<|&#?\w+;/;!function(){var e=te.createDocumentFragment(),t=e.appendChild(te.createElement("div")),n=te.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),de.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",de.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var Je=te.documentElement,Qe=/^key/,Xe=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ze=/^([^.]*)(?:\.(.+)|)/;pe.event={global:{},add:function(e,t,n,r,i){var o,s,a,u,l,c,f,d,h,p,m,v=Pe.get(e);if(v)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&pe.find.matchesSelector(Je,i),n.guid||(n.guid=pe.guid++),(u=v.events)||(u=v.events={}),(s=v.handle)||(s=v.handle=function(t){return"undefined"!=typeof pe&&pe.event.triggered!==t.type?pe.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Re)||[""],l=t.length;l--;)a=Ze.exec(t[l])||[],h=m=a[1],p=(a[2]||"").split(".").sort(),h&&(f=pe.event.special[h]||{},h=(i?f.delegateType:f.bindType)||h,f=pe.event.special[h]||{},c=pe.extend({type:h,origType:m,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&pe.expr.match.needsContext.test(i),namespace:p.join(".")},o),(d=u[h])||(d=u[h]=[],d.delegateCount=0,f.setup&&f.setup.call(e,r,p,s)!==!1||e.addEventListener&&e.addEventListener(h,s)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),pe.event.global[h]=!0)},remove:function(e,t,n,r,i){var o,s,a,u,l,c,f,d,h,p,m,v=Pe.hasData(e)&&Pe.get(e);if(v&&(u=v.events)){for(t=(t||"").match(Re)||[""],l=t.length;l--;)if(a=Ze.exec(t[l])||[],h=m=a[1],p=(a[2]||"").split(".").sort(),h){for(f=pe.event.special[h]||{},h=(r?f.delegateType:f.bindType)||h,d=u[h]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=d.length;o--;)c=d[o],!i&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));s&&!d.length&&(f.teardown&&f.teardown.call(e,p,v.handle)!==!1||pe.removeEvent(e,h,v.handle),delete u[h])}else for(h in u)pe.event.remove(e,h+t[l],n,r,!0);pe.isEmptyObject(u)&&Pe.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,s,a=pe.event.fix(e),u=new Array(arguments.length),l=(Pe.get(this,"events")||{})[a.type]||[],c=pe.event.special[a.type]||{};for(u[0]=a,t=1;t=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||l.disabled!==!0)){for(o=[],s={},n=0;n-1:pe.find(i,this,null,[l]).length),s[i]&&o.push(r);o.length&&a.push({elem:l,handlers:o})}return l=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,tt=/\s*$/g;pe.extend({htmlPrefilter:function(e){return e.replace(et,"<$1>")},clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=pe.contains(e.ownerDocument,e);if(!(de.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||pe.isXMLDoc(e)))for(s=y(a),o=y(e),r=0,i=o.length;r0&&g(s,!u&&y(e,"script")),a},cleanData:function(e){for(var t,n,r,i=pe.event.special,o=0;void 0!==(n=e[o]);o++)if(Me(n)){if(t=n[Pe.expando]){if(t.events)for(r in t.events)i[r]?pe.event.remove(n,r):pe.removeEvent(n,r,t.handle);n[Pe.expando]=void 0}n[Ie.expando]&&(n[Ie.expando]=void 0)}}}),pe.fn.extend({detach:function(e){return R(this,e,!0)},remove:function(e){return R(this,e)},text:function(e){return Ne(this,function(e){return void 0===e?pe.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return C(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e); +t.appendChild(e)}})},prepend:function(){return C(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=k(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return C(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return C(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(pe.cleanData(y(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return pe.clone(this,e,t)})},html:function(e){return Ne(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!tt.test(e)&&!Ye[(Ve.exec(e)||["",""])[1].toLowerCase()]){e=pe.htmlPrefilter(e);try{for(;n1)}}),pe.Tween=L,L.prototype={constructor:L,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||pe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(pe.cssNumber[n]?"":"px")},cur:function(){var e=L.propHooks[this.prop];return e&&e.get?e.get(this):L.propHooks._default.get(this)},run:function(e){var t,n=L.propHooks[this.prop];return this.options.duration?this.pos=t=pe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):L.propHooks._default.set(this),this}},L.prototype.init.prototype=L.prototype,L.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=pe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){pe.fx.step[e.prop]?pe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[pe.cssProps[e.prop]]&&!pe.cssHooks[e.prop]?e.elem[e.prop]=e.now:pe.style(e.elem,e.prop,e.now+e.unit)}}},L.propHooks.scrollTop=L.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},pe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},pe.fx=L.prototype.init,pe.fx.step={};var ht,pt,mt=/^(?:toggle|show|hide)$/,vt=/queueHooks$/;pe.Animation=pe.extend($,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return p(n.elem,e,qe.exec(t),n),n}]},tweener:function(e,t){pe.isFunction(e)?(t=e,e=["*"]):e=e.match(Re);for(var n,r=0,i=e.length;r1)},removeAttr:function(e){return this.each(function(){pe.removeAttr(this,e)})}}),pe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?pe.prop(e,t,n):(1===o&&pe.isXMLDoc(e)||(i=pe.attrHooks[t.toLowerCase()]||(pe.expr.match.bool.test(t)?yt:void 0)),void 0!==n?null===n?void pe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=pe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!de.radioValue&&"radio"===t&&pe.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Re);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),yt={set:function(e,t,n){return t===!1?pe.removeAttr(e,n):e.setAttribute(n,n),n}},pe.each(pe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=gt[t]||pe.find.attr;gt[t]=function(e,t,r){var i,o,s=t.toLowerCase();return r||(o=gt[s],gt[s]=i,i=null!=n(e,t,r)?s:null,gt[s]=o),i}});var bt=/^(?:input|select|textarea|button)$/i,_t=/^(?:a|area)$/i;pe.fn.extend({prop:function(e,t){return Ne(this,pe.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[pe.propFix[e]||e]})}}),pe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&pe.isXMLDoc(e)||(t=pe.propFix[t]||t,i=pe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=pe.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||_t.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),de.optSelected||(pe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),pe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){pe.propFix[this.toLowerCase()]=this}),pe.fn.extend({addClass:function(e){var t,n,r,i,o,s,a,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).addClass(e.call(this,t,V(this)))});if("string"==typeof e&&e)for(t=e.match(Re)||[];n=this[u++];)if(i=V(n),r=1===n.nodeType&&" "+W(i)+" "){for(s=0;o=t[s++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");a=W(r),i!==a&&n.setAttribute("class",a)}return this},removeClass:function(e){var t,n,r,i,o,s,a,u=0;if(pe.isFunction(e))return this.each(function(t){pe(this).removeClass(e.call(this,t,V(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Re)||[];n=this[u++];)if(i=V(n),r=1===n.nodeType&&" "+W(i)+" "){for(s=0;o=t[s++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");a=W(r),i!==a&&n.setAttribute("class",a)}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):pe.isFunction(e)?this.each(function(n){pe(this).toggleClass(e.call(this,n,V(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=pe(this),o=e.match(Re)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=V(this),t&&Pe.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Pe.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+W(V(n))+" ").indexOf(t)>-1)return!0;return!1}});var wt=/\r/g;pe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=pe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,pe(this).val()):e,null==i?i="":"number"==typeof i?i+="":pe.isArray(i)&&(i=pe.map(i,function(e){return null==e?"":e+""})),t=pe.valHooks[this.type]||pe.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=pe.valHooks[i.type]||pe.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(wt,""):null==n?"":n)}}}),pe.extend({valHooks:{option:{get:function(e){var t=pe.find.attr(e,"value");return null!=t?t:W(pe.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,s="select-one"===e.type,a=s?null:[],u=s?o+1:i.length;for(r=o<0?u:s?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),pe.each(["radio","checkbox"],function(){pe.valHooks[this]={set:function(e,t){if(pe.isArray(t))return e.checked=pe.inArray(pe(e).val(),t)>-1}},de.checkOn||(pe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var xt=/^(?:focusinfocus|focusoutblur)$/;pe.extend(pe.event,{trigger:function(t,n,r,i){var o,s,a,u,l,c,f,d=[r||te],h=le.call(t,"type")?t.type:t,p=le.call(t,"namespace")?t.namespace.split("."):[];if(s=a=r=r||te,3!==r.nodeType&&8!==r.nodeType&&!xt.test(h+pe.event.triggered)&&(h.indexOf(".")>-1&&(p=h.split("."),h=p.shift(),p.sort()),l=h.indexOf(":")<0&&"on"+h,t=t[pe.expando]?t:new pe.Event(h,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=p.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:pe.makeArray(n,[t]),f=pe.event.special[h]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!pe.isWindow(r)){for(u=f.delegateType||h,xt.test(u+h)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(r.ownerDocument||te)&&d.push(a.defaultView||a.parentWindow||e)}for(o=0;(s=d[o++])&&!t.isPropagationStopped();)t.type=o>1?u:f.bindType||h,c=(Pe.get(s,"events")||{})[t.type]&&Pe.get(s,"handle"),c&&c.apply(s,n),c=l&&s[l],c&&c.apply&&Me(s)&&(t.result=c.apply(s,n),t.result===!1&&t.preventDefault());return t.type=h,i||t.isDefaultPrevented()||f._default&&f._default.apply(d.pop(),n)!==!1||!Me(r)||l&&pe.isFunction(r[h])&&!pe.isWindow(r)&&(a=r[l],a&&(r[l]=null),pe.event.triggered=h,r[h](),pe.event.triggered=void 0,a&&(r[l]=a)),t.result}},simulate:function(e,t,n){var r=pe.extend(new pe.Event,n,{type:e,isSimulated:!0});pe.event.trigger(r,null,t)}}),pe.fn.extend({trigger:function(e,t){return this.each(function(){pe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return pe.event.trigger(e,t,n,!0)}}),pe.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){pe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),pe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),de.focusin="onfocusin"in e,de.focusin||pe.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){pe.event.simulate(t,e.target,pe.event.fix(e))};pe.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Pe.access(r,t);i||r.addEventListener(e,n,!0),Pe.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Pe.access(r,t)-1;i?Pe.access(r,t,i):(r.removeEventListener(e,n,!0),Pe.remove(r,t))}}});var Et=e.location,kt=pe.now(),St=/\?/;pe.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||pe.error("Invalid XML: "+t),n};var At=/\[\]$/,Ot=/\r?\n/g,Tt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;pe.param=function(e,t){var n,r=[],i=function(e,t){var n=pe.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(pe.isArray(e)||e.jquery&&!pe.isPlainObject(e))pe.each(e,function(){i(this.name,this.value)});else for(n in e)K(n,e[n],t,i);return r.join("&")},pe.fn.extend({serialize:function(){return pe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=pe.prop(this,"elements");return e?pe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!pe(this).is(":disabled")&&Ct.test(this.nodeName)&&!Tt.test(e)&&(this.checked||!We.test(e))}).map(function(e,t){var n=pe(this).val();return null==n?null:pe.isArray(n)?pe.map(n,function(e){return{name:t.name,value:e.replace(Ot,"\r\n")}}):{name:t.name,value:n.replace(Ot,"\r\n")}}).get()}});var Rt=/%20/g,Dt=/#.*$/,jt=/([?&])_=[^&]*/,Nt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Mt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Pt=/^(?:GET|HEAD)$/,It=/^\/\//,Lt={},Ft={},Bt="*/".concat("*"),qt=te.createElement("a");qt.href=Et.href,pe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:Mt.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Bt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":pe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?J(J(e,pe.ajaxSettings),t):J(pe.ajaxSettings,e)},ajaxPrefilter:Y(Lt),ajaxTransport:Y(Ft),ajax:function(t,n){function r(t,n,r,a){var l,d,h,_,w,x=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,s=a||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(_=Q(p,E,r)),_=X(p,_,E,l),l?(p.ifModified&&(w=E.getResponseHeader("Last-Modified"),w&&(pe.lastModified[o]=w),w=E.getResponseHeader("etag"),w&&(pe.etag[o]=w)),204===t||"HEAD"===p.type?x="nocontent":304===t?x="notmodified":(x=_.state,d=_.data,h=_.error,l=!h)):(h=x,!t&&x||(x="error",t<0&&(t=0))),E.status=t,E.statusText=(n||x)+"",l?y.resolveWith(m,[d,x,E]):y.rejectWith(m,[E,x,h]),E.statusCode(b),b=void 0,f&&v.trigger(l?"ajaxSuccess":"ajaxError",[E,p,l?d:h]),g.fireWith(m,[E,x]),f&&(v.trigger("ajaxComplete",[E,p]),--pe.active||pe.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,s,a,u,l,c,f,d,h,p=pe.ajaxSetup({},n),m=p.context||p,v=p.context&&(m.nodeType||m.jquery)?pe(m):pe.event,y=pe.Deferred(),g=pe.Callbacks("once memory"),b=p.statusCode||{},_={},w={},x="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=Nt.exec(s);)a[t[1].toLowerCase()]=t[2];t=a[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?s:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,_[e]=t),this},overrideMimeType:function(e){return null==c&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||x;return i&&i.abort(t),r(0,t),this}};if(y.promise(E),p.url=((t||p.url||Et.href)+"").replace(It,Et.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(Re)||[""],null==p.crossDomain){l=te.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=qt.protocol+"//"+qt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=pe.param(p.data,p.traditional)),G(Lt,p,n,E),c)return E;f=pe.event&&p.global,f&&0===pe.active++&&pe.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Pt.test(p.type),o=p.url.replace(Dt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Rt,"+")):(h=p.url.slice(o.length),p.data&&(o+=(St.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(o=o.replace(jt,"$1"),h=(St.test(o)?"&":"?")+"_="+kt++ +h),p.url=o+h),p.ifModified&&(pe.lastModified[o]&&E.setRequestHeader("If-Modified-Since",pe.lastModified[o]),pe.etag[o]&&E.setRequestHeader("If-None-Match",pe.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&E.setRequestHeader("Content-Type",p.contentType),E.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Bt+"; q=0.01":""):p.accepts["*"]);for(d in p.headers)E.setRequestHeader(d,p.headers[d]);if(p.beforeSend&&(p.beforeSend.call(m,E,p)===!1||c))return E.abort();if(x="abort",g.add(p.complete),E.done(p.success),E.fail(p.error),i=G(Ft,p,n,E)){if(E.readyState=1,f&&v.trigger("ajaxSend",[E,p]),c)return E;p.async&&p.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},p.timeout));try{c=!1,i.send(_,r)}catch(e){if(c)throw e;r(-1,e)}}else r(-1,"No Transport");return E},getJSON:function(e,t,n){return pe.get(e,t,n,"json")},getScript:function(e,t){return pe.get(e,void 0,t,"script")}}),pe.each(["get","post"],function(e,t){pe[t]=function(e,n,r,i){return pe.isFunction(n)&&(i=i||r,r=n,n=void 0),pe.ajax(pe.extend({url:e,type:t,dataType:i,data:n,success:r},pe.isPlainObject(e)&&e))}}),pe._evalUrl=function(e){return pe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},pe.fn.extend({wrapAll:function(e){var t;return this[0]&&(pe.isFunction(e)&&(e=e.call(this[0])),t=pe(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return pe.isFunction(e)?this.each(function(t){pe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=pe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=pe.isFunction(e);return this.each(function(n){pe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){pe(this).replaceWith(this.childNodes)}),this}}),pe.expr.pseudos.hidden=function(e){return!pe.expr.pseudos.visible(e)},pe.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},pe.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var zt={0:200,1223:204},Ut=pe.ajaxSettings.xhr();de.cors=!!Ut&&"withCredentials"in Ut,de.ajax=Ut=!!Ut,pe.ajaxTransport(function(t){var n,r;if(de.cors||Ut&&!t.crossDomain)return{send:function(i,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(s in i)a.setRequestHeader(s,i[s]);n=function(e){return function(){n&&(n=r=a.onload=a.onerror=a.onabort=a.onreadystatechange=null,"abort"===e?a.abort():"error"===e?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(zt[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=n(),r=a.onerror=n("error"),void 0!==a.onabort?a.onabort=r:a.onreadystatechange=function(){4===a.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{a.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),pe.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),pe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return pe.globalEval(e),e}}}),pe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),pe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=pe(" - - + +