From a8534ef163917b6ff7fffd3bb4f57522e0ff983b Mon Sep 17 00:00:00 2001 From: John Kleinschmidt Date: Thu, 8 Sep 2016 17:13:13 -0400 Subject: [PATCH] Version 0.9.15 --- CHANGELOG.md | 14 +++++++++++--- app/mixins/hospitalrun-version.js | 2 +- package.json | 2 +- ...ospitalrun-b6ed07adeebea32530e38e712cf2d9de.js} | 4 ++-- prod/index.html | 4 ++-- prod/manifest.appcache | 4 ++-- prod/service-worker.js | 4 ++-- 7 files changed, 21 insertions(+), 13 deletions(-) rename prod/assets/{hospitalrun-0485f3b42ec8f6809a6c3176483a0598.js => hospitalrun-b6ed07adeebea32530e38e712cf2d9de.js} (99%) diff --git a/CHANGELOG.md b/CHANGELOG.md index b44d29ca0d..63da8d72f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,19 @@ # Change Log -## [0.9.14](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.14) (2016-09-08) +## [0.9.15](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.15) (2016-09-08) + +[Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.14...0.9.15) + +**Merged pull requests:** + +- Update hospitalrun-dblisteners to version 0.9.4 🚀 [\#642](https://github.com/HospitalRun/hospitalrun-frontend/pull/642) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) +- Update ember-cli-stylelint to version 0.6.0 🚀 [\#641](https://github.com/HospitalRun/hospitalrun-frontend/pull/641) ([greenkeeperio-bot](https://github.com/greenkeeperio-bot)) + +## [0.9.14](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.14) (2016-09-08) [Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.13...0.9.14) -Forgot to run build. +- Forgot build for last release, so this has a build ## [0.9.13](https://github.com/HospitalRun/hospitalrun-frontend/tree/0.9.13) (2016-09-08) - [Full Changelog](https://github.com/HospitalRun/hospitalrun-frontend/compare/0.9.12...0.9.13) **Implemented enhancements:** diff --git a/app/mixins/hospitalrun-version.js b/app/mixins/hospitalrun-version.js index df68053fe4..b512ef2439 100644 --- a/app/mixins/hospitalrun-version.js +++ b/app/mixins/hospitalrun-version.js @@ -1,4 +1,4 @@ import Ember from 'ember'; export default Ember.Mixin.create({ - version: '0.9.14' + version: '0.9.15' }); diff --git a/package.json b/package.json index 9c9d07687a..7802f3c23b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hospitalrun", - "version": "0.9.14", + "version": "0.9.15", "description": "Ember front end for HospitalRun", "homepage": "http://hospitalrun.io", "directories": { diff --git a/prod/assets/hospitalrun-0485f3b42ec8f6809a6c3176483a0598.js b/prod/assets/hospitalrun-b6ed07adeebea32530e38e712cf2d9de.js similarity index 99% rename from prod/assets/hospitalrun-0485f3b42ec8f6809a6c3176483a0598.js rename to prod/assets/hospitalrun-b6ed07adeebea32530e38e712cf2d9de.js index 851e9a0b8f..d491ba0fad 100644 --- a/prod/assets/hospitalrun-0485f3b42ec8f6809a6c3176483a0598.js +++ b/prod/assets/hospitalrun-b6ed07adeebea32530e38e712cf2d9de.js @@ -22,7 +22,7 @@ name:"Nombre",markAsConsumed:"Marcar como consumido",newItem:"Nuevo elemento",or 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",userRoles:"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",patientHistory:"Historique du patient",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:{deleteValueInventoryTypeMedicationTitle:"Medicação Não Pode ser Excluída",deleteValueInventoryTypeMedicationMessage:"O tipo de inventário Medicação não pode ser excluído por que é necessário para o Módulo de Medicação.",deleteValueLabPricingTypeProcedureTitle:"Tipo de Preço Laboratório Não Pode Ser Excluído",deleteValueLabPricingTypeProcedureMessage:"O tipo de preço Procedimento Laboratorial não pode ser excluído por que é necessário para o Módulo de Laboratório.",deleteValueImagingPricingTypeProcedureTitle:"Tipo de Preço Imagem Não Pode Ser Excluído",deleteValueImagingPricingTypeProcedureMessage:"O tipo de preço Imagem não pode ser excluído por que é necessário para o Módulo de Imagem.",deleteValueVisitTypeAdmissionTitle:"Tipo de Visita Admissão Não Pode Ser Excluído",deleteValueVisitTypeAdmissionMessage:"O Tipo de Visita Admissão não pode ser excluído por que é necessário para o Módulo de Visitas.",deleteValueVisitTypeImagingTitle:"Tipo de Visita Imagem Não Pode Ser Excluído",deleteValueVisitTypeImagingMessage:"O Tipo de Visita Imagem não pode ser excluído por que é necessário para o Módulo de Imagem.",deleteValueVisitTypeLabTitle:"Tipo de Visita Laboratório Não Pode Ser Excluído",deleteValueVisitTypeLabMessage:"O Tipo de Visita Laboratório não pode ser excluído por que é necessário para o Módulo de Laboratório",deleteValueVisitTypePharmacyTitle:"Tipo de Visita Farmácia Não Pode Ser Excluído",deleteValueVisitTypePharmacyMessage:"Tipo de Visita Farmácia não pode ser excluído por que é necessário para o Módulo de Medicação.",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",userRoles:"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",patientHistory:"Histórico do Paciente",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"},headings:{history:"Histórico",historySince:"Histórico Desde"},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",costs:"Custos",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(function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:2,column:0}},moduleName:"hospitalrun/medication/completed/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),a},statements:[["inline","partial",["medication/index"],[],["loc",[null,[1,0],[1,30]]],0,0]],locals:[],templates:[]}}())}),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(function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:10,column:0}},moduleName:"hospitalrun/medication/delete/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","alert alert-danger");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("span");e.setAttribute(a,"class","glyphicon glyphicon-warning-sign"),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(e.childAt(t,[1]),3,3),a},statements:[["inline","t",["medication.messages.confirmDeletion"],[],["loc",[null,[8,4],[8,47]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:11,column:0}},moduleName:"hospitalrun/medication/delete/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","modal-dialog",[],["isUpdateDisabled",["subexpr","@mut",[["get","isUpdateDisabled",["loc",[null,[2,21],[2,37]]],0,0,0,0]],[],[],0,0],"title",["subexpr","@mut",[["get","title",["loc",[null,[3,10],[3,15]]],0,0,0,0]],[],[],0,0],"updateButtonAction",["subexpr","@mut",[["get","updateButtonAction",["loc",[null,[4,23],[4,41]]],0,0,0,0]],[],[],0,0],"updateButtonText",["subexpr","@mut",[["get","updateButtonText",["loc",[null,[5,21],[5,37]]],0,0,0,0]],[],[],0,0]],0,null,["loc",[null,[1,0],[10,17]]]]],locals:[],templates:[e]}}())}),define("hospitalrun/medication/edit/controller",["exports","hospitalrun/controllers/abstract-edit-controller","ember","hospitalrun/mixins/fulfill-request","hospitalrun/mixins/inventory-locations","hospitalrun/mixins/inventory-selection","hospitalrun/mixins/patient-id","hospitalrun/mixins/patient-submodule","hospitalrun/mixins/user-session"],function(e,t,n,a,r,l,i,o,d){e.default=t.default.extend(l.default,a.default,r.default,i.default,o.default,d.default,{medicationController:n.default.inject.controller("medication"),newPatientId:null,expenseAccountList:n.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(this.get("model").validate().catch(n.default.K),n.default.isEmpty(e))return"required"}.property("model.quantity"),quantityClass:function(){var e=this.get("model.prescription"),t="col-xs-3",a=this.get("isFulfilling");return(a||n.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,t,n=this.get("i18n"),a=this.get("isFulfilled");a?(e=n.t("medication.alerts.fulfilledTitle"),t="The medication request has been fulfilled.",this.set("model.selectPatient",!1)):(e=n.t("medication.alerts.savedTitle"),t=n.t("medication.alerts.savedMessage")),this.saveVisitIfNeeded(e,t)},_addNewPatient:function(){var e=this.get("i18n");this.displayAlert(e.t("alerts.pleaseWait"),e.t("messages.newPatientHasToBeCreated")),this._getNewPatientId().then(function(e){var t,n=this.get("model.patientTypeAhead"),a=n.split(" "),r={friendlyId:e,patientFullName:n,requestingController:this};a.length>=3?(r.firstName=a[0],r.middleName=a[1],r.lastName=a.splice(2,a.length).join(" ")):2===a.length?(r.firstName=a[0],r.lastName=a[1]):r.firstName=n,t=this.store.createRecord("patient",r),this.send("openModal","patients.quick-add",t)}.bind(this))},_getNewPatientId:function(){var e=this.get("newPatientId");return n.default.isEmpty(e)?new n.default.RSVP.Promise(function(e,t){this.generateFriendlyId().then(function(t){this.set("newPatientId",t),e(t)}.bind(this),t)}.bind(this)):n.default.RSVP.resolve(e)},beforeUpdate:function(){var e=this.get("isFulfilling"),t=this.get("model.isNew");return t||e?new n.default.RSVP.Promise(function(a,r){var l=this.get("model");l.validate().then(function(){l.get("isValid")?t?n.default.isEmpty(l.get("patient"))?(this._addNewPatient(),r({ignore:!0,message:"creating new patient first"})):(l.set("medicationTitle",l.get("inventoryItem.name")),l.set("priceOfMedication",l.get("inventoryItem.price")),l.set("status","Requested"),l.set("requestedBy",l.getUserName()),l.set("requestedDate",new Date),this.addChildToVisit(l,"medication","Pharmacy").then(function(){this.finishBeforeUpdate(e,a)}.bind(this),r)):this.finishBeforeUpdate(e,a):(this.send("showDisabledDialog"),r("invalid model"))}.bind(this)).catch(function(){this.send("showDisabledDialog"),r("invalid model")}.bind(this))}.bind(this)):n.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"),actions:{addedNewPatient:function(e){this.send("closeModal"),this.set("model.patient",e),this.set("newPatientId"),this.send("update")}}})}),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"],function(e,t,n,a,r,l,i){e.default=n.default.extend(r.default,l.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=PouchDB.utils.uuid(),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},r=t.get("inventoryItem.id"),l=t.get("patient");a.default.isEmpty(r)&&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(l)&&this._fetchPatientList(e)}})}),define("hospitalrun/medication/edit/template",["exports"],function(e){e.default=Ember.HTMLBars.template(function(){var e=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:3,column:4},end:{line:5,column:4}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","patient-summary",[],["patient",["subexpr","@mut",[["get","model.patient",["loc",[null,[4,32],[4,45]]],0,0,0,0]],[],[],0,0],"returnTo","medication.edit","returnToContext",["subexpr","@mut",[["get","model.id",["loc",[null,[4,89],[4,97]]],0,0,0,0]],[],[],0,0],"disablePatientLink",["subexpr","@mut",[["get","model.isNew",["loc",[null,[4,117],[4,128]]],0,0,0,0]],[],[],0,0]],["loc",[null,[4,6],[4,131]]],0,0]],locals:[],templates:[]}}(),t=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:7,column:6},end:{line:9,column:6}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","patient-typeahead",[],["property","patientTypeAhead","label",["subexpr","t",["labels.patient"],[],["loc",[null,[8,62],[8,82]]],0,0],"content",["subexpr","@mut",[["get","patientList",["loc",[null,[8,91],[8,102]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","selectedPatient",["loc",[null,[8,113],[8,128]]],0,0,0,0]],[],[],0,0],"class","col-xs-6 required test-patient-input"],["loc",[null,[8,8],[8,175]]],0,0]],locals:[],templates:[]}}(),n=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:10,column:6},end:{line:17,column:6}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","em-select",[],["class","col-xs-4 required test-add-visit","label",["subexpr","t",["labels.visit"],[],["loc",[null,[11,67],[11,85]]],0,0],"property","visit","content",["subexpr","@mut",[["get","patientVisitsForSelect",["loc",[null,[12,35],[12,57]]],0,0,0,0]],[],[],0,0],"optionValuePath","selectObject","optionLabelPath","selectObject.visitDescription","prompt",["subexpr","t",["labels.addNewOutpatientVisit"],[],["loc",[null,[14,17],[14,51]]],0,0],"selected",["subexpr","@mut",[["get","model.visit",["loc",[null,[15,19],[15,30]]],0,0,0,0]],[],[],0,0]],["loc",[null,[11,8],[16,10]]],0,0]],locals:[],templates:[]}}(),a=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:17,column:6},end:{line:22,column:6}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","form-group col-xs-3");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("label"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("p");e.setAttribute(a,"class","form-control-static");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=new Array(2);return r[0]=e.createMorphAt(e.childAt(a,[1]),0,0),r[1]=e.createMorphAt(e.childAt(a,[3]),0,0),r},statements:[["inline","t",["labels.visit"],[],["loc",[null,[19,17],[19,37]]],0,0],["content","model.visit.visitDescription",["loc",[null,[20,41],[20,73]]],0,0,0,0]],locals:[],templates:[]}}(),r=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:24,column:4},end:{line:29,column:4}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","form-group");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("label");e.setAttribute(a,"class","control-label");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("p");e.setAttribute(a,"class","form-control-static");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=new Array(2);return r[0]=e.createMorphAt(e.childAt(a,[1]),0,0),r[1]=e.createMorphAt(e.childAt(a,[3]),0,0),r},statements:[["inline","t",["labels.medication"],[],["loc",[null,[26,37],[26,62]]],0,0],["content","model.medicationName",["loc",[null,[27,39],[27,63]]],0,0,0,0]],locals:[],templates:[]}}(),l=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:29,column:4},end:{line:31,column:4}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1); return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","inventory-typeahead",[],["property","inventoryItemTypeAhead","label",["subexpr","t",["labels.medication"],[],["loc",[null,[30,68],[30,91]]],0,0],"content",["subexpr","@mut",[["get","medicationList",["loc",[null,[30,100],[30,114]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","selectedInventoryItem",["loc",[null,[30,125],[30,146]]],0,0,0,0]],[],[],0,0],"class","required test-medication-input"],["loc",[null,[30,6],[30,187]]],0,0]],locals:[],templates:[]}}(),i=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:32,column:4},end:{line:37,column:4}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","form-group");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("label");e.setAttribute(a,"class","control-label");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("p");e.setAttribute(a,"class","form-control-static");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=new Array(2);return r[0]=e.createMorphAt(e.childAt(a,[1]),0,0),r[1]=e.createMorphAt(e.childAt(a,[3]),0,0),r},statements:[["inline","t",["labels.prescriber"],[],["loc",[null,[34,37],[34,62]]],0,0],["content","model.requestedBy",["loc",[null,[35,39],[35,60]]],0,0,0,0]],locals:[],templates:[]}}(),o=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:41,column:8},end:{line:43,column:8}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","date-format",[["get","model.prescriptionDate",["loc",[null,[42,24],[42,46]]],0,0,0,0]],[],["loc",[null,[42,10],[42,48]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:38,column:4},end:{line:47,column:4}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode(" ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[3]),r=new Array(4);return r[0]=e.createMorphAt(t,1,1,n),r[1]=e.createMorphAt(a,1,1),r[2]=e.createMorphAt(a,3,3),r[3]=e.createMorphAt(a,5,5),r},statements:[["inline","static-text",[],["label",["subexpr","t",["labels.prescription"],[],["loc",[null,[39,26],[39,51]]],0,0],"value",["subexpr","@mut",[["get","model.prescription",["loc",[null,[39,58],[39,76]]],0,0,0,0]],[],[],0,0]],["loc",[null,[39,6],[39,79]]],0,0],["block","static-text",[],["label",["subexpr","t",["labels.prescriptionDate"],[],["loc",[null,[41,29],[41,58]]],0,0],"class","col-xs-4"],0,null,["loc",[null,[41,8],[43,24]]]],["inline","static-text",[],["label",["subexpr","@mut",[["get","quantityLabel",["loc",[null,[44,28],[44,41]]],0,0,0,0]],[],[],0,0],"class","col-xs-3","value",["subexpr","@mut",[["get","model.quantity",["loc",[null,[44,65],[44,79]]],0,0,0,0]],[],[],0,0]],["loc",[null,[44,8],[44,82]]],0,0],["inline","static-text",[],["label",["subexpr","t",["medication.labels.refills"],[],["loc",[null,[45,28],[45,59]]],0,0],"class","col-xs-3","value",["subexpr","@mut",[["get","model.refills",["loc",[null,[45,83],[45,96]]],0,0,0,0]],[],[],0,0]],["loc",[null,[45,8],[45,99]]],0,0]],locals:[],templates:[e]}}(),d=function(){var e=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:58,column:10},end:{line:63,column:10}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","form-group");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("label");e.setAttribute(a,"class","control-label");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(2);return a[0]=e.createMorphAt(e.childAt(t,[1,1]),0,0),a[1]=e.createMorphAt(t,3,3,n),a},statements:[["inline","t",["labels.fulfillRequest"],[],["loc",[null,[60,43],[60,72]]],0,0],["inline","em-checkbox",[],["label",["subexpr","t",["labels.fulfillRequestNow"],[],["loc",[null,[62,32],[62,62]]],0,0],"property","shouldFulfillRequest"],["loc",[null,[62,12],[62,96]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:57,column:8},end:{line:64,column:8}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","if",[["get","canFulfill",["loc",[null,[58,16],[58,26]]],0,0,0,0]],[],0,null,["loc",[null,[58,10],[63,17]]]]],locals:[],templates:[e]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:56,column:6},end:{line:65,column:6}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","if",[["get","model.isNew",["loc",[null,[57,14],[57,25]]],0,0,0,0]],[],0,null,["loc",[null,[57,8],[64,15]]]]],locals:[],templates:[e]}}(),t=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:66,column:6},end:{line:72,column:6}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(2);return a[0]=e.createMorphAt(t,1,1,n),a[1]=e.createMorphAt(t,3,3,n),a},statements:[["inline","select-or-typeahead",[],["property","expenseAccount","label",["subexpr","t",["labels.billTo"],[],["loc",[null,[67,62],[67,81]]],0,0],"list",["subexpr","@mut",[["get","expenseAccountList",["loc",[null,[67,87],[67,105]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.expenseAccount",["loc",[null,[67,116],[67,136]]],0,0,0,0]],[],[],0,0]],["loc",[null,[67,8],[67,139]]],0,0],["inline","inventory-location-picker",[],["label",["subexpr","t",["labels.pullFrom"],[],["loc",[null,[68,42],[68,63]]],0,0],"quantityRequested",["subexpr","@mut",[["get","model.quantity",["loc",[null,[68,82],[68,96]]],0,0,0,0]],[],[],0,0],"locationList",["subexpr","@mut",[["get","model.inventoryItem.availableLocations",["loc",[null,[69,24],[69,62]]],0,0,0,0]],[],[],0,0],"selectedLocations",["subexpr","@mut",[["get","model.inventoryLocations",["loc",[null,[70,28],[70,52]]],0,0,0,0]],[],[],0,0]],["loc",[null,[68,8],[71,10]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:47,column:4},end:{line:73,column:4}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[5]),r=new Array(6);return r[0]=e.createMorphAt(t,1,1,n),r[1]=e.createMorphAt(e.childAt(t,[3]),1,1),r[2]=e.createMorphAt(a,1,1),r[3]=e.createMorphAt(a,3,3),r[4]=e.createMorphAt(t,7,7,n),r[5]=e.createMorphAt(t,8,8,n),e.insertBoundary(t,null),r},statements:[["inline","em-text",[],["property","prescription","label",["subexpr","t",["labels.prescription"],[],["loc",[null,[48,46],[48,71]]],0,0],"rows","3","class",["subexpr","@mut",[["get","prescriptionClass",["loc",[null,[48,86],[48,103]]],0,0,0,0]],[],[],0,0]],["loc",[null,[48,6],[48,106]]],0,0],["inline","date-picker",[],["property","prescriptionDate","label",["subexpr","t",["labels.prescriptionDate"],[],["loc",[null,[50,56],[50,85]]],0,0],"class","col-sm-4"],["loc",[null,[50,8],[50,104]]],0,0],["inline","em-input",[],["property","quantity","label",["subexpr","@mut",[["get","quantityLabel",["loc",[null,[53,45],[53,58]]],0,0,0,0]],[],[],0,0],"class",["subexpr","@mut",[["get","quantityClass",["loc",[null,[53,65],[53,78]]],0,0,0,0]],[],[],0,0]],["loc",[null,[53,8],[53,81]]],0,0],["inline","em-input",[],["property","refills","label",["subexpr","t",["medication.labels.refills"],[],["loc",[null,[54,44],[54,75]]],0,0],"class","col-xs-3"],["loc",[null,[54,8],[54,94]]],0,0],["block","unless",[["get","model.hideFulfillRequest",["loc",[null,[56,16],[56,40]]],0,0,0,0]],[],0,null,["loc",[null,[56,6],[65,17]]]],["block","if",[["get","isFulfilling",["loc",[null,[66,12],[66,24]]],0,0,0,0]],[],1,null,["loc",[null,[66,6],[72,13]]]]],locals:[],templates:[e,t]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:2,column:2},end:{line:74,column:2}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode(" ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[2]),r=new Array(6);return r[0]=e.createMorphAt(t,0,0,n),r[1]=e.createMorphAt(a,1,1),r[2]=e.createMorphAt(a,2,2),r[3]=e.createMorphAt(t,4,4,n),r[4]=e.createMorphAt(t,5,5,n),r[5]=e.createMorphAt(t,6,6,n),e.insertBoundary(t,0),e.insertBoundary(t,null),r},statements:[["block","unless",[["get","model.selectPatient",["loc",[null,[3,14],[3,33]]],0,0,0,0]],[],0,null,["loc",[null,[3,4],[5,15]]]],["block","if",[["get","model.selectPatient",["loc",[null,[7,12],[7,31]]],0,0,0,0]],[],1,null,["loc",[null,[7,6],[9,13]]]],["block","if",[["get","model.isNew",["loc",[null,[10,12],[10,23]]],0,0,0,0]],[],2,3,["loc",[null,[10,6],[22,13]]]],["block","if",[["get","isFulfilledOrRequested",["loc",[null,[24,10],[24,32]]],0,0,0,0]],[],4,5,["loc",[null,[24,4],[31,11]]]],["block","if",[["get","isFulfilledOrRequested",["loc",[null,[32,10],[32,32]]],0,0,0,0]],[],6,null,["loc",[null,[32,4],[37,11]]]],["block","if",[["get","isFulfilled",["loc",[null,[38,10],[38,21]]],0,0,0,0]],[],7,8,["loc",[null,[38,4],[73,11]]]]],locals:[],templates:[e,t,n,a,r,l,i,o,d]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:75,column:0}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","em-form",[],["model",["subexpr","@mut",[["get","model",["loc",[null,[2,19],[2,24]]],0,0,0,0]],[],[],0,0],"submitButton",!1],0,null,["loc",[null,[2,2],[74,14]]]]],locals:[],templates:[e]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:76,column:0}},moduleName:"hospitalrun/medication/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","edit-panel",[],["editPanelProps",["subexpr","@mut",[["get","editPanelProps",["loc",[null,[1,29],[1,43]]],0,0,0,0]],[],[],0,0]],0,null,["loc",[null,[1,0],[75,15]]]]],locals:[],templates:[e]}}())}),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"),r=this.get("searchStatus");return[r,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(function(){var e=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:11,column:8},end:{line:13,column:8}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("th"),a=e.createComment("");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(e.childAt(t,[1]),0,0),a},statements:[["inline","t",["labels.actions"],[],["loc",[null,[12,14],[12,36]]],0,0]],locals:[],templates:[]}}(),t=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:23,column:10},end:{line:27,column:10}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("td"),a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("button");e.setAttribute(a,"class","btn btn-default");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1,1]),r=new Array(2);return r[0]=e.createElementMorph(a),r[1]=e.createMorphAt(a,0,0),r},statements:[["element","action",["editItem",["get","medicationRequest",["loc",[null,[25,66],[25,83]]],0,0,0,0]],["bubbles",!1],["loc",[null,[25,46],[25,100]]],0,0],["inline","t",["labels.fulfill"],[],["loc",[null,[25,101],[25,123]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:15,column:6},end:{line:29,column:6}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:1,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("tr");e.setAttribute(n,"class","clickable");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("td"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("td"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("td"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("td"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("td"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("td"),r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode(" ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=new Array(8);return r[0]=e.createElementMorph(a),r[1]=e.createMorphAt(e.childAt(a,[1]),0,0),r[2]=e.createMorphAt(e.childAt(a,[3]),0,0),r[3]=e.createMorphAt(e.childAt(a,[5]),0,0),r[4]=e.createMorphAt(e.childAt(a,[7]),0,0),r[5]=e.createMorphAt(e.childAt(a,[9]),0,0),r[6]=e.createMorphAt(e.childAt(a,[11]),0,0),r[7]=e.createMorphAt(a,13,13),r},statements:[["element","action",["editItem",["get","medicationRequest",["loc",[null,[16,32],[16,49]]],0,0,0,0]],[],["loc",[null,[16,12],[16,51]]],0,0],["inline","date-format",[["get","medicationRequest.prescriptionDate",["loc",[null,[17,28],[17,62]]],0,0,0,0]],[],["loc",[null,[17,14],[17,64]]],0,0],["content","medicationRequest.patient.displayName",["loc",[null,[18,14],[18,55]]],0,0,0,0],["content","medicationRequest.requestedBy",["loc",[null,[19,14],[19,47]]],0,0,0,0],["content","medicationRequest.medicationName",["loc",[null,[20,14],[20,50]]],0,0,0,0],["content","medicationRequest.quantity",["loc",[null,[21,14],[21,44]]],0,0,0,0],["content","medicationRequest.status",["loc",[null,[22,14],[22,42]]],0,0,0,0],["block","if",[["get","showActions",["loc",[null,[23,16],[23,27]]],0,0,0,0]],[],0,null,["loc",[null,[23,10],[27,17]]]]],locals:["medicationRequest"],templates:[e]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:2,column:2},end:{line:31,column:2}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("table");e.setAttribute(n,"class","table");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("tr");e.setAttribute(a,"class","table-header");var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("th"),l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r);var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("th"),l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r);var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("th"),l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r);var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("th"),l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r);var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("th"),l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r);var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("th"),l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r);var r=e.createTextNode("\n");e.appendChild(a,r);var r=e.createComment("");e.appendChild(a,r);var r=e.createTextNode(" ");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode(" ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=e.childAt(a,[1]),l=new Array(8);return l[0]=e.createMorphAt(e.childAt(r,[1]),0,0),l[1]=e.createMorphAt(e.childAt(r,[3]),0,0),l[2]=e.createMorphAt(e.childAt(r,[5]),0,0),l[3]=e.createMorphAt(e.childAt(r,[7]),0,0),l[4]=e.createMorphAt(e.childAt(r,[9]),0,0),l[5]=e.createMorphAt(e.childAt(r,[11]),0,0),l[6]=e.createMorphAt(r,13,13),l[7]=e.createMorphAt(a,3,3),l},statements:[["inline","t",["labels.date"],[],["loc",[null,[5,12],[5,31]]],0,0],["inline","t",["labels.patient"],[],["loc",[null,[6,12],[6,34]]],0,0],["inline","t",["labels.prescriber"],[],["loc",[null,[7,12],[7,37]]],0,0],["inline","t",["labels.medication"],[],["loc",[null,[8,12],[8,37]]],0,0],["inline","t",["labels.quantity"],[],["loc",[null,[9,12],[9,35]]],0,0],["inline","t",["labels.status"],[],["loc",[null,[10,12],[10,33]]],0,0],["block","if",[["get","showActions",["loc",[null,[11,14],[11,25]]],0,0,0,0]],[],0,null,["loc",[null,[11,8],[13,15]]]],["block","each",[["get","model",["loc",[null,[15,14],[15,19]]],0,0,0,0]],[],1,null,["loc",[null,[15,6],[29,15]]]]],locals:[],templates:[e,t]}}(),t=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:33,column:39},end:{line:33,column:127}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createElement("a");e.setAttribute(n,"href","#");var a=e.createComment("");return e.appendChild(n,a),e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[0]),r=new Array(2);return r[0]=e.createElementMorph(a),r[1]=e.createMorphAt(a,0,0),r},statements:[["element","action",["newItem"],[],["loc",[null,[33,65],[33,85]]],0,0],["inline","t",["medication.messages.createNew"],[],["loc",[null,[33,86],[33,123]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:31,column:2},end:{line:35,column:2}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","alert alert-info");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("p"),r=e.createComment("");e.appendChild(a,r);var r=e.createTextNode(" ");e.appendChild(a,r);var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1,1]),r=new Array(2);return r[0]=e.createMorphAt(a,0,0),r[1]=e.createMorphAt(a,2,2),r},statements:[["inline","t",["messages.noItemsFound"],[],["loc",[null,[33,9],[33,38]]],0,0],["block","if",[["get","canAdd",["loc",[null,[33,45],[33,51]]],0,0,0,0]],[],0,null,["loc",[null,[33,39],[33,134]]]]],locals:[],templates:[e]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:36,column:0}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","if",[["get","model",["loc",[null,[2,8],[2,13]]],0,0,0,0]],[],0,1,["loc",[null,[2,2],[35,9]]]]],locals:[],templates:[e,t]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:37,column:0}},moduleName:"hospitalrun/medication/index/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","item-listing",[],["paginationProps",["subexpr","@mut",[["get","paginationProps",["loc",[null,[1,32],[1,47]]],0,0,0,0]],[],[],0,0]],0,null,["loc",[null,[1,0],[36,17]]]]],locals:[],templates:[e]}}())}),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,r,l,i,o,d){e.default=n.default.extend(r.default,l.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(d.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(function(){var e=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:3,column:4},end:{line:9,column:4}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","em-select",[],["class","required","label",["subexpr","t",["labels.medication"],[],["loc",[null,[4,41],[4,64]]],0,0],"property","medication","content",["subexpr","@mut",[["get","patientMedication",["loc",[null,[5,38],[5,55]]],0,0,0,0]],[],[],0,0],"optionValuePath","selectObject","optionLabelPath","selectObject.inventoryItem.name","selected",["subexpr","@mut",[["get","model.medication",["loc",[null,[7,17],[7,33]]],0,0,0,0]],[],[],0,0]],["loc",[null,[4,6],[8,8]]],0,0]],locals:[],templates:[]}}(),t=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:9,column:4},end:{line:11,column:4}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" "); -e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","inventory-typeahead",[],["property","inventoryItemTypeAhead","label",["subexpr","t",["labels.medication"],[],["loc",[null,[10,68],[10,91]]],0,0],"content",["subexpr","@mut",[["get","medicationList",["loc",[null,[10,100],[10,114]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","selectedInventoryItem",["loc",[null,[10,125],[10,146]]],0,0,0,0]],[],[],0,0],"class","required test-medication-input","showQuantity",!1],["loc",[null,[10,6],[10,207]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:2,column:2},end:{line:30,column:2}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[2]),r=e.childAt(t,[4]),l=e.childAt(t,[8]),i=new Array(9);return i[0]=e.createMorphAt(t,0,0,n),i[1]=e.createMorphAt(a,1,1),i[2]=e.createMorphAt(a,3,3),i[3]=e.createMorphAt(r,1,1),i[4]=e.createMorphAt(r,3,3),i[5]=e.createMorphAt(r,5,5),i[6]=e.createMorphAt(t,6,6,n),i[7]=e.createMorphAt(l,1,1),i[8]=e.createMorphAt(l,3,3),e.insertBoundary(t,0),i},statements:[["block","if",[["get","showPatientMedicationList",["loc",[null,[3,10],[3,35]]],0,0,0,0]],[],0,1,["loc",[null,[3,4],[11,11]]]],["inline","patient-typeahead",[],["property","patientTypeAhead","label",["subexpr","t",["labels.patient"],[],["loc",[null,[13,60],[13,80]]],0,0],"content",["subexpr","@mut",[["get","patientList",["loc",[null,[13,89],[13,100]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","selectedPatient",["loc",[null,[13,111],[13,126]]],0,0,0,0]],[],[],0,0],"class","col-xs-6"],["loc",[null,[13,6],[13,145]]],0,0],["inline","em-select",[],["class","col-xs-6","label",["subexpr","t",["labels.visit"],[],["loc",[null,[14,41],[14,59]]],0,0],"property","visit","content",["subexpr","@mut",[["get","patientVisitsForSelect",["loc",[null,[15,33],[15,55]]],0,0,0,0]],[],[],0,0],"optionValuePath","selectObject","optionLabelPath","selectObject.visitDescription","selected",["subexpr","@mut",[["get","model.visit",["loc",[null,[17,17],[17,28]]],0,0,0,0]],[],[],0,0]],["loc",[null,[14,6],[18,8]]],0,0],["inline","em-input",[],["property","quantity","label",["subexpr","t",["medication.labels.quantityToReturn"],[],["loc",[null,[21,43],[21,83]]],0,0],"class","col-xs-3 required test-medication-quantity"],["loc",[null,[21,6],[21,136]]],0,0],["inline","select-or-typeahead",[],["property","deliveryLocation","label",["subexpr","t",["medication.labels.returnLocation"],[],["loc",[null,[22,62],[22,100]]],0,0],"list",["subexpr","@mut",[["get","warehouseList",["loc",[null,[22,106],[22,119]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.location",["loc",[null,[22,130],[22,144]]],0,0,0,0]],[],[],0,0],"className","col-xs-4"],["loc",[null,[22,6],[22,167]]],0,0],["inline","select-or-typeahead",[],["property","deliveryAisle","label",["subexpr","t",["medication.labels.returnAisle"],[],["loc",[null,[23,59],[23,94]]],0,0],"list",["subexpr","@mut",[["get","aisleLocationList",["loc",[null,[23,100],[23,117]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.aisleLocation",["loc",[null,[23,128],[23,147]]],0,0,0,0]],[],[],0,0],"className","col-xs-4"],["loc",[null,[23,6],[23,170]]],0,0],["inline","em-text",[],["property","reason","label",["subexpr","t",["medication.labels.returnReason"],[],["loc",[null,[25,38],[25,74]]],0,0],"rows","3"],["loc",[null,[25,4],[25,85]]],0,0],["inline","date-picker",[],["property","dateCompleted","label",["subexpr","t",["medication.labels.adjustmentDate"],[],["loc",[null,[27,51],[27,89]]],0,0],"class","col-sm-4"],["loc",[null,[27,6],[27,108]]],0,0],["inline","select-or-typeahead",[],["property","expenseAccount","label",["subexpr","t",["medication.labels.creditToAccount"],[],["loc",[null,[28,60],[28,99]]],0,0],"list",["subexpr","@mut",[["get","expenseAccountList",["loc",[null,[28,105],[28,123]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.expenseAccount",["loc",[null,[28,134],[28,154]]],0,0,0,0]],[],[],0,0],"className","col-sm-8"],["loc",[null,[28,6],[28,178]]],0,0]],locals:[],templates:[e,t]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:31,column:0}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","em-form",[],["model",["subexpr","@mut",[["get","model",["loc",[null,[2,19],[2,24]]],0,0,0,0]],[],[],0,0],"submitButton",!1],0,null,["loc",[null,[2,2],[30,14]]]]],locals:[],templates:[e]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:32,column:0}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","edit-panel",[],["editPanelProps",["subexpr","@mut",[["get","editPanelProps",["loc",[null,[1,29],[1,43]]],0,0,0,0]],[],[],0,0]],0,null,["loc",[null,[1,0],[31,15]]]]],locals:[],templates:[e]}}())}),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(function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:3,column:0}},moduleName:"hospitalrun/medication/search/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","partial",["medication/index"],[],["loc",[null,[2,4],[2,34]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:3,column:19}},moduleName:"hospitalrun/medication/search/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","search-listing",[],["newButtonText",["subexpr","t",["buttons.newRequest"],[],["loc",[null,[1,32],[1,56]]],0,0],"allButtonText",["subexpr","t",["buttons.allRequests"],[],["loc",[null,[1,71],[1,96]]],0,0]],0,null,["loc",[null,[1,0],[3,19]]]]],locals:[],templates:[e]}}())}),define("hospitalrun/mixins/active-link",["exports","ember-cli-active-link-wrapper/mixins/active-link"],function(e,t){e.default=t.default}),define("hospitalrun/mixins/appointment-statuses",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({appointmentStatusList:["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 r=this.store.createRecord("proc-charge",{dateCharged:new Date,quantity:e,pricingItem:n});r.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"),r=t.default.Object.create({value:[],userCanAdd:a});return t.default.isEmpty(e)||r.set("value",e.filterBy("pricingType",n)),r}.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 r=!1;return t.default.isEmpty(e)||(r=!t.default.isEmpty(e.findBy("pricingType",n))),r&&n!==a}),n=n.sortBy("name")}.property("pricingTypeValues","pricingTypeForObjectType","pricingList"),pricingTypeValues:t.default.computed.alias("pricingTypes.value"),createMultipleRequests:function(e,t,n,a){var r=e.get("firstObject"),l=this.get("model");l.set(t,r),this.addChildToVisit(l,n,a).then(function(r){l.save().then(function(){this._finishCreateMultipleRequests(e,t,n,a,r)}.bind(this))}.bind(this))},_finishCreateMultipleRequests:function(e,n,a,r,l){var i,o={},d=this.get("model"),s=[],c=this.get("model.patient"),u=[];d.eachAttribute(function(e){o[e]=d.get(e)}),e.forEach(function(e,t){t>0&&(i=this.store.createRecord(r.toLowerCase(),o),i.set(n,e),i.set("patient",c),i.set("visit",l),s.push(i),u.push(i.save()))}.bind(this)),t.default.RSVP.all(u).then(function(){var e=[];s.forEach(function(t){e.push(this.addChildToVisit(t,a,r))}.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,r){var l,i=this.get("pricingTypeForObjectType");l=this.store.createRecord("pricing",{name:e,category:n,pricingType:i}),l.save().then(function(e){this.get("pricingList").addObject({id:e.get("id"),name:l.get("name")}),this.set(a,l),t()}.bind(this),r)}.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,r){var l=[],i=this.get("model");a.forEach(function(n){var a=this.findChargeForPricingItem(n,i.get("charges")),r=i.get(n.id);t.default.isEmpty(r)?a&&(e.removeObject(a),l.push(a.destroyRecord())):a?a.get("quantity")!==r&&(a.set("quantity",r),l.push(a.save())):l.push(this._createNewChargeRecord(r,n.id))}.bind(this)),t.default.RSVP.all(l,"Charges updated for current record:"+this.get("model.id")).then(n,r)}.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.getPouchId({},"pricing"),r=n.getPouchId(null,"pricing"),l=this.get("pricingCategory"),i={startkey:[l,null,null,r],endkey:[l,{},{},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/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/dob-days",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({convertDOBToText:function(e,t,n){var a=new Date,r=0,l=0,i=0;e&&(void 0===e.getFullYear&&(e=moment(e,"l").toDate()),void 0!==e.getFullYear&&(r=a.getFullYear()-e.getFullYear(),(a.getMonth()0?r+"y "+l+"m "+i+"d":l+"m "+i+"d":n?r>1?r+" years "+l+" months":1===r?r+" year "+l+" months":l+" months":r>1?r+" years "+l+" months "+i+" days":1===r?r+" year "+l+" months "+i+" days":l+" months "+i+" days"}})}),define("hospitalrun/mixins/edit-panel-props",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({additionalButtons:null,cancelAction:null,cancelButtonText:null,disabledAction:null,hideCancelButton:null,isUpdateDisabled:null,showUpdateButton:null,updateButtonAction:null,updateButtonText:null,editPanelProps:function(){return this.getProperties(["additionalButtons","cancelAction","cancelButtonText","disabledAction","hideCancelButton","isUpdateDisabled","showUpdateButton","updateButtonAction","updateButtonText"])}.property("additionalButtons","cancelAction","cancelButtonText","disabledAction","hideCancelButton","isUpdateDisabled","showUpdateButton","updateButtonAction","updateButtonText")})}),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,r){return new t.default.RSVP.Promise(function(l,i){var o=e.get("markAsConsumed"),d=e.get("transactionType");"Request"===d&&(d=null),e.get("inventoryItem").then(function(s){o?(e.set("adjustPurchases",!0),t.default.isEmpty(d)&&e.set("transactionType","Fulfillment"),this._performFulfillment(e,s,a).then(function(){this._finishFulfillRequest(e,s,n,a,r),l()}.bind(this),i)):(e.set("adjustPurchases",!1),t.default.isEmpty(d)&&e.set("transactionType","Transfer"),this._finishFulfillRequest(e,s,n,a,r),l())}.bind(this),i)}.bind(this))},_findQuantity:function(e,t,n,a){var r,l,i=[],o=n.get("quantity"),d=parseInt(e.get("quantity")),s=d,c=[],u=0;if(a){var p=t.get("lastObject");l=p.get("costPerUnit"),p.incrementProperty("currentQuantity",d),u+=l*s,c.push({id:p.get("id"),quantity:d}),i.addObject(p)}else{var m=t.any(function(e){return r=e.get("currentQuantity"),!(e.get("expired")||r<=0)&&(l=e.get("costPerUnit"),!!a||(s>r?(u+=l*r,s-=r,c.push({id:e.get("id"),quantity:parseInt(r)}),r=0):(u+=l*s,r-=s,c.push({id:e.get("id"),quantity:parseInt(s)}),s=0),e.set("currentQuantity",r),i.addObject(e),0===s))});if(!m)return"Could not find any purchases that had the required quantity:"+d}return e.set("costPerUnit",(u/d).toFixed(2)),e.set("quantityAtCompletion",o),e.set("purchasesAffected",c),e.set("purchases",i),n.updateQuantity(),!0},_finishFulfillRequest:function(e,n,a,r,l){var i=e.get("inventoryLocations"),o=[],d=e.get("markAsConsumed"),s=[],c=parseInt(e.get("quantity")),u=e.get("purchases");if(r){var p=i.get("firstObject");p.incrementProperty("quantity",c),s.push(p.save()),o.push({name:p.get("locationName"),quantity:c})}else i.reduce(function(t,a){var r=e.get("deliveryLocation"),l=e.get("deliveryAisle"),i=parseInt(a.get("quantity"));if(t>0)return d||(a.set("transferAisleLocation",l),a.set("transferLocation",r)),i>=t?(d?(a.decrementProperty("quantity",t),s.push(a.save())):(a.set("adjustmentQuantity",t),s.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:t}),0):(d?(a.decrementProperty("quantity",i),s.push(a.save())):(a.set("adjustmentQuantity",i),s.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:i}),t-i)}.bind(this),c);e.set("locationsAffected",o),d&&u.forEach(function(e){s.push(e.save())}),t.default.RSVP.all(s,"Preliminary saving done for inventory fulfillment").then(function(){var r=[];r.push(n.save()),e.set("status","Completed"),e.set("completedBy",e.getUserName()),r.push(e.save()),t.default.RSVP.all(r,"All saving done for inventory fulfillment").then(function(){this.send("doneFulfillRequest"),a&&this.send("closeModal"),l||this.transitionTo("inventory.index")}.bind(this))}.bind(this))},_performFulfillment:function(e,n,a){return new t.default.RSVP.Promise(function(t,r){var l=n.get("purchases"),i=n.get("quantity"),o=e.get("quantity");if(a||i>=o){var d=this._findQuantity(e,l,n,a);d===!0?t():r(d)}else r("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.14"})}),define("hospitalrun/mixins/imaging-pricing-types",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({defaultImagingPricingTypes:["Imaging Procedure"]})}),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(),r=Math.floor(Math.random()*(n-e+1))+e;return t.default.RSVP.resolve(a.toString(36)+"_"+r.toString(36))}})}),define("hospitalrun/mixins/inventory-locations",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({aisleToFind:null,locationToFind:null,_addQuantityToLocation:function(e,n,a,r){return new t.default.RSVP.Promise(function(t,l){this._findOrCreateLocation(e,a,r).then(function(e){e.incrementProperty("quantity",n),e.save().then(t,l)})}.bind(this))},_findOrCreateLocation:function(e,n,a){return new t.default.RSVP.Promise(function(t,r){var l=!1,i=e.get("locations");if(this.set("aisleToFind",a),this.set("locationToFind",n),l=i.find(this.findLocation,this))t(l);else{var o=this.get("store").createRecord("inv-location",{id:PouchDB.utils.uuid(),aisleLocation:a,location:n,quantity:0});i.addObject(o),o.save().then(function(){t(o)},r)}}.bind(this))},findLocation:function(e){var n=e.get("aisleLocation"),a=this.get("aisleToFind"),r=e.get("location"),l=this.get("locationToFind");if((t.default.isEmpty(n)&&t.default.isEmpty(a)||n===a)&&(t.default.isEmpty(r)&&t.default.isEmpty(l)||r===l))return!0},newPurchaseAdded:function(e,n){return new t.default.RSVP.Promise(function(t,a){var r=n.get("aisleLocation"),l=n.get("location"),i=parseInt(n.get("originalQuantity"));this._addQuantityToLocation(e,i,l,r).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"),r=n.get("transferLocation"),l=parseInt(n.get("adjustmentQuantity"));return new t.default.RSVP.Promise(function(t,i){this._addQuantityToLocation(e,l,r,a).then(function(){n.decrementProperty("quantity",l),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,a=this.get("defaultInventoryTypes"),r=this.get("inventoryTypeList");return e=t.default.isEmpty(r)?a:r,e=n.default.selectValues(e)}.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/lab-pricing-types",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({defaultLabPricingTypes:["Lab Procedure"]})}),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 r=this.get(e);r.then?this.get(e).then(function(e){n.set("medicationTitle",e.get("name"))}):this.set("medicationTitle",r.get("name"))},getMedicationPrice:function(e){var n=this,a=this.get("priceOfMedication");return t.default.isEmpty(a)?void this.get(e).then(function(e){n.set("priceOfMedication",e.get("price"))}):a},getMedicationDetails:function(e){var n=this;return new t.default.RSVP.Promise(function(a){var r=n.get("medicationTitle"),l=n.get("priceOfMedication");if(t.default.isEmpty(r)||t.default.isEmpty(l)){var i=n.get(e);i.then?n.get(e).then(function(e){a({name:e.get("name"),price:e.get("price")})}):a({name:i.get("name"),price:i.get("price")})}else a({name:r,price:l})})},medicationTitle:n.default.attr("string"),priceOfMedication:n.default.attr("number")})}),define("hospitalrun/mixins/modal-helper",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({displayAlert:function(e,n,a){var r=this.get("i18n"),l=t.default.Object.extend({updateButtonText:r.t("buttons.ok")});this.send("openModal","dialog",l.create({title:e,message:n,okAction:a,hideCancelButton:!0,updateButtonAction:"ok"}))},displayConfirm:function(e,n,a,r){t.default.isEmpty(r)&&(r=t.default.Object.create()),r.set("confirmAction",a),r.set("title",e),r.set("message",n),r.set("updateButtonAction","confirm"),r.set("updateButtonText","Ok"),this.send("openModal","dialog",r)}})}),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:"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", +e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","inventory-typeahead",[],["property","inventoryItemTypeAhead","label",["subexpr","t",["labels.medication"],[],["loc",[null,[10,68],[10,91]]],0,0],"content",["subexpr","@mut",[["get","medicationList",["loc",[null,[10,100],[10,114]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","selectedInventoryItem",["loc",[null,[10,125],[10,146]]],0,0,0,0]],[],[],0,0],"class","required test-medication-input","showQuantity",!1],["loc",[null,[10,6],[10,207]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:2,column:2},end:{line:30,column:2}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","row");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[2]),r=e.childAt(t,[4]),l=e.childAt(t,[8]),i=new Array(9);return i[0]=e.createMorphAt(t,0,0,n),i[1]=e.createMorphAt(a,1,1),i[2]=e.createMorphAt(a,3,3),i[3]=e.createMorphAt(r,1,1),i[4]=e.createMorphAt(r,3,3),i[5]=e.createMorphAt(r,5,5),i[6]=e.createMorphAt(t,6,6,n),i[7]=e.createMorphAt(l,1,1),i[8]=e.createMorphAt(l,3,3),e.insertBoundary(t,0),i},statements:[["block","if",[["get","showPatientMedicationList",["loc",[null,[3,10],[3,35]]],0,0,0,0]],[],0,1,["loc",[null,[3,4],[11,11]]]],["inline","patient-typeahead",[],["property","patientTypeAhead","label",["subexpr","t",["labels.patient"],[],["loc",[null,[13,60],[13,80]]],0,0],"content",["subexpr","@mut",[["get","patientList",["loc",[null,[13,89],[13,100]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","selectedPatient",["loc",[null,[13,111],[13,126]]],0,0,0,0]],[],[],0,0],"class","col-xs-6"],["loc",[null,[13,6],[13,145]]],0,0],["inline","em-select",[],["class","col-xs-6","label",["subexpr","t",["labels.visit"],[],["loc",[null,[14,41],[14,59]]],0,0],"property","visit","content",["subexpr","@mut",[["get","patientVisitsForSelect",["loc",[null,[15,33],[15,55]]],0,0,0,0]],[],[],0,0],"optionValuePath","selectObject","optionLabelPath","selectObject.visitDescription","selected",["subexpr","@mut",[["get","model.visit",["loc",[null,[17,17],[17,28]]],0,0,0,0]],[],[],0,0]],["loc",[null,[14,6],[18,8]]],0,0],["inline","em-input",[],["property","quantity","label",["subexpr","t",["medication.labels.quantityToReturn"],[],["loc",[null,[21,43],[21,83]]],0,0],"class","col-xs-3 required test-medication-quantity"],["loc",[null,[21,6],[21,136]]],0,0],["inline","select-or-typeahead",[],["property","deliveryLocation","label",["subexpr","t",["medication.labels.returnLocation"],[],["loc",[null,[22,62],[22,100]]],0,0],"list",["subexpr","@mut",[["get","warehouseList",["loc",[null,[22,106],[22,119]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.location",["loc",[null,[22,130],[22,144]]],0,0,0,0]],[],[],0,0],"className","col-xs-4"],["loc",[null,[22,6],[22,167]]],0,0],["inline","select-or-typeahead",[],["property","deliveryAisle","label",["subexpr","t",["medication.labels.returnAisle"],[],["loc",[null,[23,59],[23,94]]],0,0],"list",["subexpr","@mut",[["get","aisleLocationList",["loc",[null,[23,100],[23,117]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.aisleLocation",["loc",[null,[23,128],[23,147]]],0,0,0,0]],[],[],0,0],"className","col-xs-4"],["loc",[null,[23,6],[23,170]]],0,0],["inline","em-text",[],["property","reason","label",["subexpr","t",["medication.labels.returnReason"],[],["loc",[null,[25,38],[25,74]]],0,0],"rows","3"],["loc",[null,[25,4],[25,85]]],0,0],["inline","date-picker",[],["property","dateCompleted","label",["subexpr","t",["medication.labels.adjustmentDate"],[],["loc",[null,[27,51],[27,89]]],0,0],"class","col-sm-4"],["loc",[null,[27,6],[27,108]]],0,0],["inline","select-or-typeahead",[],["property","expenseAccount","label",["subexpr","t",["medication.labels.creditToAccount"],[],["loc",[null,[28,60],[28,99]]],0,0],"list",["subexpr","@mut",[["get","expenseAccountList",["loc",[null,[28,105],[28,123]]],0,0,0,0]],[],[],0,0],"selection",["subexpr","@mut",[["get","model.expenseAccount",["loc",[null,[28,134],[28,154]]],0,0,0,0]],[],[],0,0],"className","col-sm-8"],["loc",[null,[28,6],[28,178]]],0,0]],locals:[],templates:[e,t]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:31,column:0}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","em-form",[],["model",["subexpr","@mut",[["get","model",["loc",[null,[2,19],[2,24]]],0,0,0,0]],[],[],0,0],"submitButton",!1],0,null,["loc",[null,[2,2],[30,14]]]]],locals:[],templates:[e]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:32,column:0}},moduleName:"hospitalrun/medication/return/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","edit-panel",[],["editPanelProps",["subexpr","@mut",[["get","editPanelProps",["loc",[null,[1,29],[1,43]]],0,0,0,0]],[],[],0,0]],0,null,["loc",[null,[1,0],[31,15]]]]],locals:[],templates:[e]}}())}),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(function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:3,column:0}},moduleName:"hospitalrun/medication/search/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,1,1,n),a},statements:[["inline","partial",["medication/index"],[],["loc",[null,[2,4],[2,34]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:1,column:0},end:{line:3,column:19}},moduleName:"hospitalrun/medication/search/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createComment("");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(t,0,0,n),e.insertBoundary(t,0),e.insertBoundary(t,null),a},statements:[["block","search-listing",[],["newButtonText",["subexpr","t",["buttons.newRequest"],[],["loc",[null,[1,32],[1,56]]],0,0],"allButtonText",["subexpr","t",["buttons.allRequests"],[],["loc",[null,[1,71],[1,96]]],0,0]],0,null,["loc",[null,[1,0],[3,19]]]]],locals:[],templates:[e]}}())}),define("hospitalrun/mixins/active-link",["exports","ember-cli-active-link-wrapper/mixins/active-link"],function(e,t){e.default=t.default}),define("hospitalrun/mixins/appointment-statuses",["exports","ember","hospitalrun/utils/select-values"],function(e,t,n){e.default=t.default.Mixin.create({appointmentStatusList:["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 r=this.store.createRecord("proc-charge",{dateCharged:new Date,quantity:e,pricingItem:n});r.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"),r=t.default.Object.create({value:[],userCanAdd:a});return t.default.isEmpty(e)||r.set("value",e.filterBy("pricingType",n)),r}.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 r=!1;return t.default.isEmpty(e)||(r=!t.default.isEmpty(e.findBy("pricingType",n))),r&&n!==a}),n=n.sortBy("name")}.property("pricingTypeValues","pricingTypeForObjectType","pricingList"),pricingTypeValues:t.default.computed.alias("pricingTypes.value"),createMultipleRequests:function(e,t,n,a){var r=e.get("firstObject"),l=this.get("model");l.set(t,r),this.addChildToVisit(l,n,a).then(function(r){l.save().then(function(){this._finishCreateMultipleRequests(e,t,n,a,r)}.bind(this))}.bind(this))},_finishCreateMultipleRequests:function(e,n,a,r,l){var i,o={},d=this.get("model"),s=[],c=this.get("model.patient"),u=[];d.eachAttribute(function(e){o[e]=d.get(e)}),e.forEach(function(e,t){t>0&&(i=this.store.createRecord(r.toLowerCase(),o),i.set(n,e),i.set("patient",c),i.set("visit",l),s.push(i),u.push(i.save()))}.bind(this)),t.default.RSVP.all(u).then(function(){var e=[];s.forEach(function(t){e.push(this.addChildToVisit(t,a,r))}.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,r){var l,i=this.get("pricingTypeForObjectType");l=this.store.createRecord("pricing",{name:e,category:n,pricingType:i}),l.save().then(function(e){this.get("pricingList").addObject({id:e.get("id"),name:l.get("name")}),this.set(a,l),t()}.bind(this),r)}.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,r){var l=[],i=this.get("model");a.forEach(function(n){var a=this.findChargeForPricingItem(n,i.get("charges")),r=i.get(n.id);t.default.isEmpty(r)?a&&(e.removeObject(a),l.push(a.destroyRecord())):a?a.get("quantity")!==r&&(a.set("quantity",r),l.push(a.save())):l.push(this._createNewChargeRecord(r,n.id))}.bind(this)),t.default.RSVP.all(l,"Charges updated for current record:"+this.get("model.id")).then(n,r)}.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.getPouchId({},"pricing"),r=n.getPouchId(null,"pricing"),l=this.get("pricingCategory"),i={startkey:[l,null,null,r],endkey:[l,{},{},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/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/dob-days",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({convertDOBToText:function(e,t,n){var a=new Date,r=0,l=0,i=0;e&&(void 0===e.getFullYear&&(e=moment(e,"l").toDate()),void 0!==e.getFullYear&&(r=a.getFullYear()-e.getFullYear(),(a.getMonth()0?r+"y "+l+"m "+i+"d":l+"m "+i+"d":n?r>1?r+" years "+l+" months":1===r?r+" year "+l+" months":l+" months":r>1?r+" years "+l+" months "+i+" days":1===r?r+" year "+l+" months "+i+" days":l+" months "+i+" days"}})}),define("hospitalrun/mixins/edit-panel-props",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({additionalButtons:null,cancelAction:null,cancelButtonText:null,disabledAction:null,hideCancelButton:null,isUpdateDisabled:null,showUpdateButton:null,updateButtonAction:null,updateButtonText:null,editPanelProps:function(){return this.getProperties(["additionalButtons","cancelAction","cancelButtonText","disabledAction","hideCancelButton","isUpdateDisabled","showUpdateButton","updateButtonAction","updateButtonText"])}.property("additionalButtons","cancelAction","cancelButtonText","disabledAction","hideCancelButton","isUpdateDisabled","showUpdateButton","updateButtonAction","updateButtonText")})}),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,r){return new t.default.RSVP.Promise(function(l,i){var o=e.get("markAsConsumed"),d=e.get("transactionType");"Request"===d&&(d=null),e.get("inventoryItem").then(function(s){o?(e.set("adjustPurchases",!0),t.default.isEmpty(d)&&e.set("transactionType","Fulfillment"),this._performFulfillment(e,s,a).then(function(){this._finishFulfillRequest(e,s,n,a,r),l()}.bind(this),i)):(e.set("adjustPurchases",!1),t.default.isEmpty(d)&&e.set("transactionType","Transfer"),this._finishFulfillRequest(e,s,n,a,r),l())}.bind(this),i)}.bind(this))},_findQuantity:function(e,t,n,a){var r,l,i=[],o=n.get("quantity"),d=parseInt(e.get("quantity")),s=d,c=[],u=0;if(a){var p=t.get("lastObject");l=p.get("costPerUnit"),p.incrementProperty("currentQuantity",d),u+=l*s,c.push({id:p.get("id"),quantity:d}),i.addObject(p)}else{var m=t.any(function(e){return r=e.get("currentQuantity"),!(e.get("expired")||r<=0)&&(l=e.get("costPerUnit"),!!a||(s>r?(u+=l*r,s-=r,c.push({id:e.get("id"),quantity:parseInt(r)}),r=0):(u+=l*s,r-=s,c.push({id:e.get("id"),quantity:parseInt(s)}),s=0),e.set("currentQuantity",r),i.addObject(e),0===s))});if(!m)return"Could not find any purchases that had the required quantity:"+d}return e.set("costPerUnit",(u/d).toFixed(2)),e.set("quantityAtCompletion",o),e.set("purchasesAffected",c),e.set("purchases",i),n.updateQuantity(),!0},_finishFulfillRequest:function(e,n,a,r,l){var i=e.get("inventoryLocations"),o=[],d=e.get("markAsConsumed"),s=[],c=parseInt(e.get("quantity")),u=e.get("purchases");if(r){var p=i.get("firstObject");p.incrementProperty("quantity",c),s.push(p.save()),o.push({name:p.get("locationName"),quantity:c})}else i.reduce(function(t,a){var r=e.get("deliveryLocation"),l=e.get("deliveryAisle"),i=parseInt(a.get("quantity"));if(t>0)return d||(a.set("transferAisleLocation",l),a.set("transferLocation",r)),i>=t?(d?(a.decrementProperty("quantity",t),s.push(a.save())):(a.set("adjustmentQuantity",t),s.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:t}),0):(d?(a.decrementProperty("quantity",i),s.push(a.save())):(a.set("adjustmentQuantity",i),s.push(this.transferToLocation(n,a))),o.push({name:a.get("locationName"),quantity:i}),t-i)}.bind(this),c);e.set("locationsAffected",o),d&&u.forEach(function(e){s.push(e.save())}),t.default.RSVP.all(s,"Preliminary saving done for inventory fulfillment").then(function(){var r=[];r.push(n.save()),e.set("status","Completed"),e.set("completedBy",e.getUserName()),r.push(e.save()),t.default.RSVP.all(r,"All saving done for inventory fulfillment").then(function(){this.send("doneFulfillRequest"),a&&this.send("closeModal"),l||this.transitionTo("inventory.index")}.bind(this))}.bind(this))},_performFulfillment:function(e,n,a){return new t.default.RSVP.Promise(function(t,r){var l=n.get("purchases"),i=n.get("quantity"),o=e.get("quantity");if(a||i>=o){var d=this._findQuantity(e,l,n,a);d===!0?t():r(d)}else r("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.15"})}),define("hospitalrun/mixins/imaging-pricing-types",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({defaultImagingPricingTypes:["Imaging Procedure"]})}),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(),r=Math.floor(Math.random()*(n-e+1))+e;return t.default.RSVP.resolve(a.toString(36)+"_"+r.toString(36))}})}),define("hospitalrun/mixins/inventory-locations",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({aisleToFind:null,locationToFind:null,_addQuantityToLocation:function(e,n,a,r){return new t.default.RSVP.Promise(function(t,l){this._findOrCreateLocation(e,a,r).then(function(e){e.incrementProperty("quantity",n),e.save().then(t,l)})}.bind(this))},_findOrCreateLocation:function(e,n,a){return new t.default.RSVP.Promise(function(t,r){var l=!1,i=e.get("locations");if(this.set("aisleToFind",a),this.set("locationToFind",n),l=i.find(this.findLocation,this))t(l);else{var o=this.get("store").createRecord("inv-location",{id:PouchDB.utils.uuid(),aisleLocation:a,location:n,quantity:0});i.addObject(o),o.save().then(function(){t(o)},r)}}.bind(this))},findLocation:function(e){var n=e.get("aisleLocation"),a=this.get("aisleToFind"),r=e.get("location"),l=this.get("locationToFind");if((t.default.isEmpty(n)&&t.default.isEmpty(a)||n===a)&&(t.default.isEmpty(r)&&t.default.isEmpty(l)||r===l))return!0},newPurchaseAdded:function(e,n){return new t.default.RSVP.Promise(function(t,a){var r=n.get("aisleLocation"),l=n.get("location"),i=parseInt(n.get("originalQuantity"));this._addQuantityToLocation(e,i,l,r).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"),r=n.get("transferLocation"),l=parseInt(n.get("adjustmentQuantity"));return new t.default.RSVP.Promise(function(t,i){this._addQuantityToLocation(e,l,r,a).then(function(){n.decrementProperty("quantity",l),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,a=this.get("defaultInventoryTypes"),r=this.get("inventoryTypeList");return e=t.default.isEmpty(r)?a:r,e=n.default.selectValues(e)}.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/lab-pricing-types",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({defaultLabPricingTypes:["Lab Procedure"]})}),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 r=this.get(e);r.then?this.get(e).then(function(e){n.set("medicationTitle",e.get("name"))}):this.set("medicationTitle",r.get("name"))},getMedicationPrice:function(e){var n=this,a=this.get("priceOfMedication");return t.default.isEmpty(a)?void this.get(e).then(function(e){n.set("priceOfMedication",e.get("price"))}):a},getMedicationDetails:function(e){var n=this;return new t.default.RSVP.Promise(function(a){var r=n.get("medicationTitle"),l=n.get("priceOfMedication");if(t.default.isEmpty(r)||t.default.isEmpty(l)){var i=n.get(e);i.then?n.get(e).then(function(e){a({name:e.get("name"),price:e.get("price")})}):a({name:i.get("name"),price:i.get("price")})}else a({name:r,price:l})})},medicationTitle:n.default.attr("string"),priceOfMedication:n.default.attr("number")})}),define("hospitalrun/mixins/modal-helper",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({displayAlert:function(e,n,a){var r=this.get("i18n"),l=t.default.Object.extend({updateButtonText:r.t("buttons.ok")});this.send("openModal","dialog",l.create({title:e,message:n,okAction:a,hideCancelButton:!0,updateButtonAction:"ok"}))},displayConfirm:function(e,n,a,r){t.default.isEmpty(r)&&(r=t.default.Object.create()),r.set("confirmAction",a),r.set("title",e),r.set("message",n),r.set("updateButtonAction","confirm"),r.set("updateButtonText","Ok"),this.send("openModal","dialog",r)}})}),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:"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:"Lookup Lists",iconClass:"octicon-chevron-right",route:"admin.lookup",capability:"update_config"},{title:"Address Fields",iconClass:"octicon-chevron-right",route:"admin.address",capability:"update_config"},{title:"Load DB",iconClass:"octicon-plus",route:"admin.loaddb",capability:"load_db"},{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:"user_roles"},{title:"Workflow",iconClass:"octicon-chevron-right",route:"admin.workflow",capability:"update_config"}]}],localizedNavItems:t.default.computed("navItems.[]",function(){var e=this,t="navigation.",a=function(e,t){return"string"==typeof e?t:e};return this.get("navItems").map(function(r){var l=t+n(r.title).toLowerCase(),i=e.get("i18n").t(l);return r.localizedTitle=a(i,r.title),r.subnav=r.subnav.map(function(r){var l=t+"subnav."+n(r.title),i=e.get("i18n").t(l);return r.localizedTitle=a(i,r.title),r}),r})})})}),define("hospitalrun/mixins/number-format",["exports","ember"],function(e,t){e.default=t.default.Mixin.create({_calculateTotal:function(e,n){var a,r=0;return a=t.default.isArray(e)?e:this.get(e),r=a.reduce(function(e,a){return e+=this._getValidNumber(t.default.get(a,n))}.bind(this),0),this._numberFormat(r,!0)},_getValidNumber:function(e){return t.default.isEmpty(e)||isNaN(e)?0:Number(e)},_numberFormat:function(e,n){var a;if(!t.default.isEmpty(e)){if(isNaN(e))return;return a=Math.round(e)===e?Number(e).toString():Number(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}})}),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){e.default=t.default.Mixin.create({_addDiagnosisToList:function(e,n,a){t.default.isEmpty(e)||t.default.isEmpty(n.findBy("description",e))&&n.addObject({date:a.get("startDate"),description:e})},getPrimaryDiagnoses:function(e){var n=[];t.default.isEmpty(e)||e.forEach(function(e){this._addDiagnosisToList(e.get("primaryDiagnosis"),n,e),this._addDiagnosisToList(e.get("primaryBillingDiagnosis"),n,e)}.bind(this));var a=n.get("firstObject");return t.default.isEmpty(a)||(a.first=!0),n},getSecondaryDiagnoses:function(e){var n=[];t.default.isEmpty(e)||e.forEach(function(e){t.default.isEmpty(e.get("additionalDiagnoses"))||n.addObjects(e.get("additionalDiagnoses"))});var a=n.get("firstObject");return t.default.isEmpty(a)||(a.first=!0),n}})}),define("hospitalrun/mixins/patient-id",["exports","ember","hospitalrun/mixins/pouchdb"],function(e,t,n){function a(e,t){return t<1e5&&(t=("00000"+t).slice(-5)),""+e+t}e.sequenceId=a;var r=t.default.inject,l=t.default.isEmpty;e.default=t.default.Mixin.create(n.default,{idPrefix:null,database:r.service(),config:r.service(),generateFriendlyId:function(){var e=this,t=this.get("config"),n=this.get("database"),r=this.get("maxValue"),i=function e(i){var o=void 0,d=void 0;return t.getPatientPrefix().then(function(e){o=i.incrementProperty("value"),d=a(e,o);var t={startkey:[d,null],endkey:[d,r]};return n.queryMainDB(t,"patient_by_display_id")}).then(function(t){return l(t.rows)?(i.set("value",o),i.save().then(function(){return d})):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:0}));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")}},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"),r=t.default.get(e,"id");return t.default.isEmpty(a)?t.default.isEmpty(n)?r:n:a},getPatientDisplayName:function(e){var n=t.default.get(e,"firstName"),a=t.default.get(e,"lastName"),r=t.default.get(e,"middleName"),l=[];return t.default.isEmpty(n)||l.push(n),t.default.isEmpty(r)||l.push(r),t.default.isEmpty(a)||l.push(a),l.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","hospitalrun/mixins/patient-visits","hospitalrun/utils/select-values"],function(e,t,n,a){e.default=t.default.Mixin.create(n.default,{findPatientVisits:!0,needToUpdateVisit:!1,patientList:null,selectedPatient: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("returnPatientId"))},returnToVisit:function(){this._cancelUpdate(),this.transitionToRoute("visits.edit",this.get("returnVisitId"))}},addChildToVisit:function(e,n,a){return new t.default.RSVP.Promise(function(r,l){var i=this.get("model.visit");t.default.isEmpty(i)?i=this.createNewVisit(a).then(function(t){this._finishAddChildToVisit(e,n,t,r,l)}.bind(this),l):this._finishAddChildToVisit(e,n,i,r,l)}.bind(this))},_finishAddChildToVisit:function(e,t,n,a,r){n.get(t).then(function(t){t.addObject(e),this.set("needToUpdateVisit",!0),a(n)}.bind(this),r)},cancelAction:function(){var e=this.get("model.returnToPatient"),t=this.get("model.returnToVisit");return t?"returnToVisit":e?"returnToPatient":"returnToAllItems"}.property("model.returnToPatient","model.returnToVisit"),createNewVisit:function(e){return new t.default.RSVP.Promise(function(t,n){var a=this.get("model"),r=a.get("patient"),l=this.get("store").createRecord("visit",{startDate:new Date,endDate:new Date,outPatient:!0,patient:r,visitType:e});a.set("visit",l),l.save().then(function(){l.reload().then(function(e){this.getPatientVisits(r).then(function(n){this.set("patientVisits",n),a.set("visit",e),t(e)}.bind(this),n)}.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:t.default.computed.alias("model.patient.id"),patientChanged:function(){var e=this.get("model.patient");!t.default.isEmpty(e)&&this.get("findPatientVisits")?this.getPatientVisits(e).then(function(e){t.default.isEmpty(this.get("model.patient"))?this.set("patientVisits",[]):this.set("patientVisits",e)}.bind(this)):t.default.isEmpty(e)&&this.get("findPatientVisits")&&this.set("patientVisits",[])}.observes("model.patient"),selectedPatientChanged:function(){var e=this.get("selectedPatient");t.default.isEmpty(e)?this.set("model.patient",null):this.store.find("patient",e.id).then(function(e){this.set("model.patient",e),t.default.run.once(this,function(){this.get("model").validate().catch(t.default.K)})}.bind(this))}.observes("selectedPatient"),patientIdChanged:function(){var e=this.get("patientId");t.default.isEmpty(e)||this.set("returnPatientId",e)}.observes("patientId").on("init"),patientVisits:[],returnPatientId:null,returnVisitId:null,patientVisitsForSelect:function(){return this.get("patientVisits").map(a.default.selectObjectMap)}.property("patientVisits.[]"),removeChildFromVisit:function(e,n){return new t.default.RSVP.Promise(function(a,r){var l=[],i=this.get("model.visit");l.addObjects(this.resolveVisitChildren()),t.default.RSVP.all(l,"Resolved visit children before removing "+n).then(function(){i.get(n).then(function(t){t.removeObject(e),i.save().then(a,r)}.bind(this),r)}.bind(this),r)}.bind(this))},resolveVisitChildren:function(){var e=[],n=this.get("model.visit");return t.default.isEmpty(n)||(e.push(n.get("imaging")),e.push(n.get("labs")),e.push(n.get("medication")),e.push(n.get("procedures")),e.push(n.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)},visitIdChanged:function(){var e=this.get("visitId");t.default.isEmpty(e)||this.set("returnVisitId",e)}.observes("visitId").on("init"),visitId:t.default.computed.alias("model.visit.id"),visitsController:t.default.computed.alias("controllers.visits")})}),define("hospitalrun/mixins/patient-visits",["exports","ember","hospitalrun/mixins/pouchdb"],function(e,t,n){e.default=t.default.Mixin.create(n.default,{getPatientVisits:function(e){return new t.default.RSVP.Promise(function(t,n){var a=this.get("maxValue"),r=e.get("id");this.store.query("visit",{options:{startkey:[r,null,null,null,"visit_"],endkey:[r,a,a,a,a]},mapReduce:"visit_by_patient"}).then(t,n)}.bind(this))}})}),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 r=[n.status,(n.name||n.error)+":",n.message||n.reason].join(" ");t.default.run(null,e,r)}.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=new t.default.Handlebars.SafeString("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=new t.default.Handlebars.SafeString(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"],function(e,t){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:"Please enter a result before completing"}}}})}),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/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_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"],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.contains(e);var r=this.get("defaultCapabilities"),l=r[e];if(!t.default.isEmpty(l))return l.contains(n.role)}return!1},getUserName:function(e){var n,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,r=this.get("defaultVisitTypes"),l=this.get("visitTypesList");return a=t.default.isEmpty(l)?r:l.get("value"),a=n.default.selectValues(a,e)},visitTypes:function(){return this._getVisitTypes()}.property("visitTypesList","defaultVisitTypes"),visitTypesWithEmpty:function(){return this._getVisitTypes(!0)}.property("visitTypesList","defaultVisitTypes")})}),define("hospitalrun/models/abstract",["exports","ember-data","ember","ember-validations","ember-pouch","hospitalrun/mixins/user-session"],function(e,t,n,a,r,l){e.default=r.Model.extend(l.default,a.default,{session:n.default.inject.service(),archived:t.default.attr("boolean"),lastModified:t.default.attr("date"),modifiedBy:t.default.attr(),modifiedFields:t.default.attr(),save:function(e){var t,a=this.changedAttributes(),r=new Date,l=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")){n.default.isEmpty(l)&&(l={}),this.set("lastModified",r);for(t in a)l[t]=r;this.set("modifiedFields",l),this.set("modifiedBy",this.getUserName())}return this._super(e).catch(function(t){if(!n.default.isEmpty(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 r in a)t.set(r,a[r][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/appointment",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/utils/patient-validation"],function(e,t,n,a,r){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),r=t.format(n);return a+" - "+r},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="",r=moment(this.get("startDate"));return r.isSame(t,"day")?(a=r.format(this.get("shortDateFormat")),e||(a+=" ",a+=this._getDateSpan(r,t,this.get("timeFormat")))):(n=e?this.get("shortDateFormat"):this.get("longDateFormat"),a=this._getDateSpan(r,t,n)),a}.property("startDate","endDate"),validations:{appointmentDate:{presence:{if:function(e){var t=e.get("appointmentType");return"Admission"!==t}}},patientTypeAhead:r.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"),r=e.get("endDate");if(a.default.isEmpty(r)||a.default.isEmpty(n))return!0;if(t){if(r.getTime()r},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=l}),define("hospitalrun/models/inv-purchase",["exports","hospitalrun/models/abstract","ember-data","ember","hospitalrun/mixins/location-name"],function(e,t,n,a,r){var l=t.default.extend(r.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:Number((e/t).toFixed(2))}.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(),validations:{purchaseCost:{numericality:!0},originalQuantity:{numericality:!0},vendor:{presence:!0}}});e.default=l}),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,r,l){var i=t.default.extend(n.default,l.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 r.default.isEmpty(t)?e:t.get("displayName")}.property("deliveryAisle","deliveryLocation","patient"),haveReason:function(){return!r.default.isEmpty(this.get("reason"))}.property("reason"),isAdjustment:function(){var e=this.get("adjustmentTypes"),t=this.get("transactionType"),n=e.findBy("type",t);return!r.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"),l=e.get("status");if("Requested"===l)return!1;if(r.default.isEmpty(t)||r.default.isEmpty(n))return r.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 r.default.isEmpty(t)}},acceptance:{accept:!0,if:function(e){var t=e.get("isNew"),n=parseInt(e.get("quantity")),a=e.get("transactionType"),r=null;return"Return"!==a&&(r=t&&"Request"===a?e.get("inventoryItem.quantity"):e.get("inventoryLocation.quantity"),n>r)},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:{if:function(e){return e.haveInvoiceItems()}}},purchaseCost:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},if:function(e){return e.haveInvoiceItems()}}},quantity:{numericality:{greaterThan:0,messages:{greaterThan:"must be greater than 0"},if: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,r,l,i){var o={if:function(e){var t=e.get("skipSavePurchase");return!t&&e.get("isNew")}};e.default=t.default.extend(l.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,r.default)("locations.@each.quantity",function(){var e=this.get("locations").filter(function(e){return e.get("quantity")>0});return e}),displayLocations:(0,r.default)("availableLocations",function(){var e=this,t=this.get("availableLocations"),n=[];return t.forEach(function(t){var r=t.get("aisleLocation"),l=t.get("location"),i=e.formatLocationName(l,r);a.default.isEmpty(i)||n.push(i)}),n.toString()}),condition:(0,r.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:o},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,r,l,i){e.default=t.default.extend(n.default,l.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:r.default.computed.mapBy("lineItemsByCategory","discount"),discount:r.default.computed.sum("discountTotals"),nationalInsuranceTotals:r.default.computed.mapBy("lineItemsByCategory","nationalInsurance"),nationalInsurance:r.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:r.default.computed.mapBy("lineItemsByCategory","privateInsurance"),privateInsurance:r.default.computed.sum("privateInsuranceTotals"),lineTotals:r.default.computed.mapBy("lineItems","total"),total:r.default.computed.sum("lineTotals"),displayInvoiceNumber:function(){var e=this.get("externalInvoiceNumber"),t=this.get("id");return r.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);r.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(!r.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:r.default.computed.mapBy("lineItems","amountOwed"),patientResponsibility:r.default.computed.sum("patientResponsibilityTotals"),paymentAmountChanged:function(){var e=this.get("payments"),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,r,l,i){e.default=t.default.extend(n.default,a.default,i.default,{charges:r.default.hasMany("proc-charge",{async:!1}),labDate:r.default.attr("date"),labType:r.default.belongsTo("pricing",{async:!1}),notes:r.default.attr("string"),patient:r.default.belongsTo("patient",{async:!1}),requestedBy:r.default.attr("string"),requestedDate:r.default.attr("date"),result:r.default.attr("string"),status:r.default.attr("string"),visit:r.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:l.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,r,l,i){e.default=t.default.extend(n.default,r.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!(!l.default.isEmpty(t)||!l.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(l.default.isEmpty(t)||l.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,r,l,i){e.default=t.default.extend(n.default,i.default,{admitted:l.default.attr("boolean",{defaultValue:!1}),additionalContacts:l.default.attr(),address:l.default.attr("string"),address2:l.default.attr("string"),address3:l.default.attr("string"),address4:l.default.attr("string"),bloodType:l.default.attr("string"),clinic:l.default.attr("string"),country:l.default.attr("string"),dateOfBirth:l.default.attr("date"),economicClassification:l.default.attr("string"),email:l.default.attr("string"),expenses:l.default.attr(),externalPatientId:l.default.attr("string"),familySupport1:l.default.attr("string"),familySupport2:l.default.attr("string"),familySupport3:l.default.attr("string"),familySupport4:l.default.attr("string"),familySupport5:l.default.attr("string"),friendlyId:l.default.attr("string"),familyInfo:l.default.attr(),firstName:l.default.attr("string"),sex:l.default.attr("string"),occupation:l.default.attr("string"),history:l.default.attr("string"),insurance:l.default.attr("string"),lastName:l.default.attr("string"),livingArrangement:l.default.attr("string"),middleName:l.default.attr("string"),notes:l.default.attr("string"),otherIncome:l.default.attr("string"),payments:l.default.hasMany("payment",{async:!0}),patientType:l.default.attr("string"),parent:l.default.attr("string"),paymentProfile:l.default.belongsTo("price-profile",{async:!1}),phone:l.default.attr("string"),placeOfBirth:l.default.attr("string"),referredDate:l.default.attr("date"),referredBy:l.default.attr("string"),religion:l.default.attr("string"),socialActionTaken:l.default.attr("string"),socialRecommendation:l.default.attr("string"),status:l.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)r.default.isEmpty(e[n])||(r.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"),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","ember"],function(e,t,n,a){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"),downloadImageFromServer:function(e){var t=this,n=e.get("url"),r=new XMLHttpRequest;a.default.isEmpty(n)||(this.getPatientDirectory(e.get("patientId")),r.open("GET",n,!0),r.responseType="blob",r.onload=function(){var n=new Blob([r.response]);t.addImageToFileStore(n,null,e)},r.send())}})}),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,r){e.default=t.default.extend(r.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"),r=e.get("itemName");if(a.default.isEmpty(n)||a.default.isEmpty(r))return!0;var l=r.substr(0,n.length);return n!==l},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,r){var l=t.default.Model.extend(r.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=l}),define("hospitalrun/models/visit",["exports","hospitalrun/models/abstract","ember-data","ember"],function(e,t,n,a){function r(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,[]),r=e.get("isNew"),l=this.get("model"),i=e.serialize();if(i.id=e.get("id"),r)n.addObject(a.default.Object.create(i));else{var o=n.findBy("id",i.id);a.default.setProperties(o,i)}l.set(t,n),this.send("update",!0),this.send("closeModal")},afterUpdate:function(e){this.send("openModal","dialog",a.default.Object.create({title:this.get("i18n").t("patients.titles.savedPatient"),message:this.get("i18n").t("patients.messages.savedPatient",e),updateButtonAction:"returnToPatient",updateButtonText:this.get("i18n").t("patients.buttons.backToPatients"),cancelButtonText:this.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,r,l,i,o){e.default=t.default.extend(a.default,r.default,i.default,l.default,{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(){return this.generateFriendlyId().then(function(e){return{friendlyId:e}})},setupController:function(e,t){var a=t.get("friendlyId"),r=t.get("externalPatientId"),l=this.get("maxValue"),i=t.get("id");n.default.isEmpty(a)&&!n.default.isEmpty(r)&&t.set("friendlyId",r),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,l,l,l]},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(function(){var e=function(){var e=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:14,column:8},end:{line:16,column:8}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("li");e.setAttribute(n,"role","presentation");var a=e.createElement("a");e.setAttribute(a,"href","#social"),e.setAttribute(a,"role","tab"),e.setAttribute(a,"data-toggle","pill"),e.setAttribute(a,"data-test-selector","social-tab");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(1);return a[0]=e.createMorphAt(e.childAt(t,[1,0]),0,0),a},statements:[["inline","t",["patients.navigation.socialWork"],[],["loc",[null,[15,114],[15,152]]],0,0]],locals:[],templates:[]}}();return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:3,column:4},end:{line:18,column:4}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n ");e.appendChild(t,n);var n=e.createElement("ul");e.setAttribute(n,"class","nav nav-pills tab-nav"),e.setAttribute(n,"role","tablist");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation"),e.setAttribute(a,"class","active");var r=e.createElement("a");e.setAttribute(r,"href","#history"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","history-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#general"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","general-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#photos"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","photos-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#appointments"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","appointments-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#visits"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","visits-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#medication"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","medication-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#imaging"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","imaging-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("li");e.setAttribute(a,"role","presentation");var r=e.createElement("a");e.setAttribute(r,"href","#labs"),e.setAttribute(r,"role","tab"),e.setAttribute(r,"data-toggle","pill"),e.setAttribute(r,"data-test-selector","labs-tab");var l=e.createComment("");e.appendChild(r,l),e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode(" ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[3]),r=new Array(10);return r[0]=e.createMorphAt(t,1,1,n),r[1]=e.createMorphAt(e.childAt(a,[1,0]),0,0),r[2]=e.createMorphAt(e.childAt(a,[3,0]),0,0),r[3]=e.createMorphAt(e.childAt(a,[5,0]),0,0),r[4]=e.createMorphAt(e.childAt(a,[7,0]),0,0),r[5]=e.createMorphAt(e.childAt(a,[9,0]),0,0),r[6]=e.createMorphAt(e.childAt(a,[11,0]),0,0),r[7]=e.createMorphAt(e.childAt(a,[13,0]),0,0),r[8]=e.createMorphAt(e.childAt(a,[15,0]),0,0),r[9]=e.createMorphAt(a,17,17),r},statements:[["inline","patient-summary",[],["patient",["subexpr","@mut",[["get","model",["loc",[null,[4,32],[4,37]]],0,0,0,0]],[],[],0,0],"visits",["subexpr","@mut",[["get","model.visits",["loc",[null,[4,45],[4,57]]],0,0,0,0]],[],[],0,0],"patientProcedures",["subexpr","@mut",[["get","patientProcedures",["loc",[null,[4,76],[4,93]]],0,0,0,0]],[],[],0,0],"disablePatientLink",!0,"store",["subexpr","@mut",[["get","store",["loc",[null,[4,124],[4,129]]],0,0,0,0]],[],[],0,0]],["loc",[null,[4,6],[4,132]]],0,0],["inline","t",["patients.navigation.history"],[],["loc",[null,[6,129],[6,164]]],0,0],["inline","t",["patients.navigation.general"],[],["loc",[null,[7,114],[7,149]]],0,0],["inline","t",["patients.navigation.photos"],[],["loc",[null,[8,112],[8,146]]],0,0],["inline","t",["patients.navigation.appointments"],[],["loc",[null,[9,124],[9,164]]],0,0],["inline","t",["patients.navigation.visits"],[],["loc",[null,[10,112],[10,146]]],0,0],["inline","t",["patients.navigation.medication"],[],["loc",[null,[11,120],[11,158]]],0,0],["inline","t",["patients.navigation.imaging"],[],["loc",[null,[12,114],[12,149]]],0,0],["inline","t",["patients.navigation.labs"],[],["loc",[null,[13,108],[13,140]]],0,0],["block","if",[["get","canAddSocialWork",["loc",[null,[14,14],[14,30]]],0,0,0,0]],[],0,null,["loc",[null,[14,8],[16,15]]]]],locals:[],templates:[e]}}(),t=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:23,column:12},end:{line:29,column:12}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","panel-heading clearfix");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("button");e.setAttribute(a,"type","button"),e.setAttribute(a,"class","btn btn-primary align-right");var r=e.createTextNode("\n ");e.appendChild(a,r);var r=e.createElement("span");e.setAttribute(r,"class","octicon octicon-plus"),e.appendChild(a,r);var r=e.createComment("");e.appendChild(a,r);var r=e.createTextNode("\n ");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1,1]),r=new Array(2);return r[0]=e.createElementMorph(a),r[1]=e.createMorphAt(a,2,2),r},statements:[["element","action",["showAddPatientNote"],["bubbles",!1,"on","click"],["loc",[null,[25,74],[25,130]]],0,0],["inline","t",["buttons.newNote"],[],["loc",[null,[26,60],[26,83]]],0,0]],locals:[],templates:[]}}(),t=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:40,column:20},end:{line:45,column:20}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","ph-note-item");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("h5");e.setAttribute(a,"class","ph-note-heading");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=new Array(2);return r[0]=e.createMorphAt(e.childAt(a,[1]),0,0),r[1]=e.createMorphAt(a,3,3),r},statements:[["inline","t",["patients.headings.history"],[],["loc",[null,[42,50],[42,83]]],0,0],["inline","html-line-break",[["get","visit.history",["loc",[null,[43,40],[43,53]]],0,0,0,0]],[],["loc",[null,[43,22],[43,55]]],0,0]],locals:[],templates:[]}}(),t=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:47,column:20},end:{line:52,column:20}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" ");e.appendChild(t,n);var n=e.createElement("div");e.setAttribute(n,"class","ph-note-item");var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createElement("h5");e.setAttribute(a,"class","ph-note-heading");var r=e.createComment("");e.appendChild(a,r),e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a);var a=e.createComment("");e.appendChild(n,a);var a=e.createTextNode("\n ");e.appendChild(n,a),e.appendChild(t,n);var n=e.createTextNode("\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=e.childAt(t,[1]),r=new Array(2);return r[0]=e.createMorphAt(e.childAt(a,[1]),0,0),r[1]=e.createMorphAt(a,3,3),r},statements:[["inline","t",["patients.headings.historySince"],[],["loc",[null,[49,50],[49,88]]],0,0],["inline","html-line-break",[["get","visit.historySince",["loc",[null,[50,40],[50,58]]],0,0,0,0]],[],["loc",[null,[50,22],[50,60]]],0,0]],locals:[],templates:[]}}(),n=function(){var e=function(){var e=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:60,column:32},end:{line:62,column:32}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" [");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode(" - ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("]\n");return e.appendChild(t,n),t},buildRenderNodes:function(e,t,n){var a=new Array(2);return a[0]=e.createMorphAt(t,1,1,n),a[1]=e.createMorphAt(t,3,3,n),a},statements:[["inline","t",["labels.cptcode"],[],["loc",[null,[61,35],[61,58]]],0,0],["content","procedure.cptCode",["loc",[null,[61,61],[61,82]]],0,0,0,0]],locals:[],templates:[]}}(),t=function(){return{meta:{revision:"Ember@2.7.3",loc:{source:null,start:{line:67,column:32},end:{line:69,column:32}},moduleName:"hospitalrun/patients/edit/template.hbs"},isEmpty:!1,arity:0,cachedFragment:null,hasRendered:!1,buildFragment:function(e){var t=e.createDocumentFragment(),n=e.createTextNode(" , ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode(": ");e.appendChild(t,n);var n=e.createComment("");e.appendChild(t,n);var n=e.createTextNode("\n"); @@ -48,4 +48,4 @@ locals:[],templates:[]}}(),t=function(){var e=function(){return{meta:{revision:" a},statements:[["block","item-listing",[],["paginationProps",["subexpr","@mut",[["get","paginationProps",["loc",[null,[1,32],[1,47]]],0,0,0,0]],[],[],0,0]],0,null,["loc",[null,[1,0],[42,17]]]]],locals:[],templates:[e]}}())}),define("hospitalrun/users/route",["exports","ember-simple-auth/mixins/authenticated-route-mixin","ember"],function(e,t,n){e.default=n.default.Route.extend(t.default,{actions:{allItems:function(){this.transitionTo("users.index")}}})}),define("hospitalrun/utils/date-sort",["exports","ember"],function(e,t){e.default={sortByDate:function(e,n,a){var r=e.get(a),l=n.get(a);return t.default.compare(r.getTime(),l.getTime())}}}),define("hospitalrun/utils/email-validation",["exports"],function(e){e.default={emailRegex:/^(([^<>()[\]\\.,;:\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/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(r).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 r=[{rank:"A",value:.5},{rank:"B",value:1},{rank:"C",value:2}]}),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 r=a.substr(0,n.length);return n!==r},message:"Please select a patient"}}}}),define("hospitalrun/utils/pouch-views",["exports"],function(e){function t(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 n(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.sortStartKey) {var startKey = JSON.parse(req.query.sortStartKey);for (var i=0; i 0) {rows = rows.slice(startingPosition);}send(JSON.stringify({"rows" : rows}));}'}function a(e,t){return'function(doc) {var doctype,uidx;if (doc._id && (uidx = doc._id.indexOf("_")) > 0 && !doc.data.archived) {doctype = doc._id.substring(0, uidx);if(doctype === "'+e+'") {'+t+"}}}"}function r(e,n,a){var r=t(e,a);n.put(r).then(function(){n.query(e.name,{stale:"update_after"})},function(e){console.log("ERR updateDesignDoc:",e)})}function l(e){return"var "+e+" = doc.data."+e+";if ("+e+" && "+e+' !== "") {'+e+" = new Date("+e+");if ("+e+".getTime) {"+e+" = "+e+".getTime();}}"}var i="if (doc.data.friendlyId) {emit([doc.data.friendlyId, doc._id]);} else if (doc.data.externalPatientId) {emit([doc.data.externalPatientId, doc._id]);} else {emit([doc._id, doc._id]);}",o=n(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),d=[{name:"appointments_by_date",function:a("appointment",l("endDate")+l("startDate")+"emit([startDate, endDate, doc._id]);"),sort:n(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 r=getCompareDate(e.doc.data.startDate)-getCompareDate(t.doc.data.startDate);return 0===r?getCompareDate(e.doc.data.endDate)-getCompareDate(t.doc.data.endDate):r;case"status":var l=n(e.doc.data[a]),i=n(t.doc.data[a]);return compareStrings(l,i);default:return 0}}.toString(),!0,function(e){var t,n=null,a=!0;if(req.query&&req.query.filterBy&&(n=JSON.parse(req.query.filterBy)),!n)return!0;for(t=0;t - + @@ -45,7 +45,7 @@ - +