'use strict';

define('hospitalrun/tests/acceptance/admin-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | admin', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /admin', function (assert) {
    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin');
      andThen(function () {
        assert.equal(currentURL(), '/admin');
        select('.lookup-type', 'Visit Types');
        andThen(function () {
          assert.equal(find('h3.panel-title').text(), 'Visit Types', 'Visit Types header is displayed');
          assert.equal(find('td.lookup-type-value:first').text(), 'Admission', 'Admission visit type displays');
          click('button:contains(Update)');
          waitToAppear('.modal-dialog');
          andThen(function () {
            assert.equal(find('.modal-title').text(), 'List Saved', 'Lookup list is saved');
          });
        });
      });
    });
  });

  (0, _qunit.test)('add new lookup value', function (assert) {
    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin');
      andThen(function () {
        assert.equal(currentURL(), '/admin');
        select('.lookup-type', 'Anesthesiologists');
        click('button:contains(Add Value)');
        waitToAppear('.modal-dialog');
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'Add Value', 'Add value modal is displayed');
          fillIn('.lookup-type-value input', 'Dr Smith');
          click('button:contains(Add):last');
          andThen(function () {
            waitToAppear('td.lookup-type-value:contains(Dr Smith)');
            andThen(function () {
              assert.equal(find('td.lookup-type-value:contains(Dr Smith)').length, 1, 'Added lookup type is added to list');
            });
          });
        });
      });
    });
  });

  (0, _qunit.test)('delete lookup value', function (assert) {
    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin');
      andThen(function () {
        assert.equal(currentURL(), '/admin');
        select('.lookup-type', 'Anesthesia Types');
        andThen(function () {
          assert.equal(find('td.lookup-type-value:contains(Epidural)').length, 1, 'Have lookup type to delete from list');
          click('button:contains(Delete)');
          waitToAppear('.modal-dialog');
        });
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'Delete Value', 'Delete value modal is displayed');
          click('.modal-footer button:contains(Ok)');
        });
        andThen(function () {
          assert.equal(find('td.lookup-type-value:contains(Epidural)').length, 0, 'Deleted lookup type is removed from the list');
        });
      });
    });
  });

  (0, _qunit.test)('Update address options', function (assert) {
    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin/address');
      andThen(function () {
        assert.equal(currentURL(), '/admin/address');
        fillIn('input', 'Address Label');
        click('button:contains(Update)');
        andThen(function () {
          waitToAppear('.modal-dialog');
          andThen(function () {
            assert.equal(find('.modal-title').text(), 'Options Saved', 'Address Options Saved');
          });
        });
      });
    });
  });

  (0, _qunit.test)('Update header options', function (assert) {
    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin/print-header');
      andThen(function () {
        assert.equal(currentURL(), '/admin/print-header');
        fillIn('input', 'Print Header Label');
        click('button:contains(Update)');
        andThen(function () {
          waitToAppear('.modal-dialog');
          andThen(function () {
            assert.equal(find('.modal-title').text(), 'Options Saved', 'Header Options Saved');
          });
        });
      });
    });
  });

  (0, _qunit.test)('Update workflow options', function (assert) {
    var selector = 'input[type=checkbox]';

    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin/workflow');
      andThen(function () {
        assert.equal(currentURL(), '/admin/workflow', 'Correctly navigated to admin workflow');

        setAllTo(false, function () {
          visit('/admin/workflow');
          andThen(function () {
            setAllTo(true);
          });
        });
      });
    });

    function setAllTo(checked, cb) {
      Array.prototype.slice.call(document.querySelectorAll(selector)).forEach(function (node) {
        node.checked = checked;
      });
      click('button:contains(Update)');
      andThen(function () {
        waitToAppear('.modal-dialog');
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'Options Saved', 'Workflow Options Saved');
          verifyAll(checked);
          if (cb) {
            cb();
          }
        });
      });
    }

    function verifyAll(checked) {
      Array.prototype.slice.call(document.querySelectorAll(selector)).forEach(function (node) {
        assert.equal(node.checked, checked, 'Checkbox is ' + (checked ? 'checked' : 'unchecked'));
      });
    }
  });
});
define('hospitalrun/tests/acceptance/admin-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/admin-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/admin-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/appointments-test', ['exports', 'ember', 'qunit', 'moment', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _moment, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  var DATE_TIME_FORMAT = 'l h:mm A';
  var TIME_FORMAT = 'h:mm';

  (0, _qunit.module)('Acceptance | appointments', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /appointments', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/appointments');
      andThen(function () {
        assert.equal(currentURL(), '/appointments');
        findWithAssert('button:contains(new appointment)');
        findWithAssert('.table-header');
      });
    });
  });

  (0, _qunit.test)('visiting /appointments/missed', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      var url = '/appointments';
      var today = (0, _moment['default'])();
      var tomorrow = (0, _moment['default'])().add(1, 'days');
      var status = 'Missed';
      createAppointment(assert, {
        startDate: today,
        endDate: tomorrow,
        allDay: false,
        status: status
      });
      visit(url);
      andThen(function () {
        assert.equal(currentURL(), url);
        findWithAssert('.appointment-status:contains(' + status + ')');
      });
    });
  });

  (0, _qunit.test)('test appointment for today', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      visit('/appointments/today');
      assert.equal(find('.appointment-date').length, 0, 'should have 0 appointment today');
      visit('/appointments/edit/new');
      andThen(function () {
        assert.equal(currentURL(), '/appointments/edit/new');
        findWithAssert('button:contains(Cancel)');
        findWithAssert('button:contains(Add)');
      });

      createAppointment(assert);

      visit('/appointments/today');
      andThen(function () {
        assert.equal(currentURL(), '/appointments/today');
        assert.equal(find('.appointment-status').text(), 'Scheduled', 'should have 1 appointment today');
      });
    });
  });

  (0, _qunit.test)('Creating a new appointment', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      visit('/appointments/edit/new');

      andThen(function () {
        assert.equal(currentURL(), '/appointments/edit/new');
        findWithAssert('button:contains(Cancel)');
        findWithAssert('button:contains(Add)');
      });

      createAppointment(assert);

      andThen(function () {
        assert.equal(currentURL(), '/appointments');
        assert.equal(find('tr').length, 2, 'New appointment has been added');
        findWithAssert('button:contains(Check In)');
        findWithAssert('button:contains(Edit)');
        findWithAssert('button:contains(Delete)');
      });
    });
  });

  (0, _qunit.test)('Checkin to a visit from appointment', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      createAppointment(assert);
      visit('/appointments');

      andThen(function () {
        assert.equal(currentURL(), '/appointments');
        assert.equal(find('tr').length, 2, 'New appointment has been added');
        findWithAssert('button:contains(Check In)');
        findWithAssert('button:contains(Edit)');
        findWithAssert('button:contains(Delete)');
      });

      click('button:contains(Check In)');
      andThen(function () {
        assert.equal(currentURL(), '/visits/edit/checkin', 'Now in add visiting information route');
      });
      click('.panel-footer button:contains(Check In)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Checked In', 'Patient has been checked in');
      });
      click('button:contains(Ok)');
      andThen(function () {
        findWithAssert('button:contains(New Note)');
        findWithAssert('button:contains(New Procedure)');
        findWithAssert('button:contains(New Medication)');
        findWithAssert('button:contains(New Lab)');
        findWithAssert('button:contains(New Imaging)');
        findWithAssert('button:contains(New Vitals)');
        findWithAssert('button:contains(Add Item)');
      });
      click('button:contains(Return)');

      andThen(function () {
        assert.equal(currentURL(), '/appointments');
        assert.equal(find('button:contains(Check In)').length, 0, 'Check In button no longer appears');
        findWithAssert('button:contains(Edit)');
        findWithAssert('button:contains(Delete)');
      });
    });
  });

  (0, _qunit.test)('Delete an appointment', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      createAppointment(assert);
      visit('/appointments');

      andThen(function () {
        assert.equal(currentURL(), '/appointments');
        assert.equal(find('.appointment-date').length, 1, 'One appointment is listed');
        findWithAssert('button:contains(Check In)');
        findWithAssert('button:contains(Edit)');
        findWithAssert('button:contains(Delete)');
        click('button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text().trim(), 'Delete Appointment', 'Delete Appointment confirmation modal has been displayed');
        click('.modal-dialog button:contains(Delete)');
      });
      andThen(function () {
        waitToDisappear('.appointment-date');
      });
      andThen(function () {
        assert.equal(find('.appointment-date').length, 0, 'No appointments are displayed');
      });
    });
  });

  (0, _qunit.test)('Appointment calendar', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      var today = (0, _moment['default'])().startOf('day');
      var later = (0, _moment['default'])(today).add(1, 'hours');
      var startTime = today.format(TIME_FORMAT);
      var endTime = later.format(TIME_FORMAT);
      var timeString = startTime + ' - ' + endTime;
      createAppointment(assert, {
        startDate: today,
        endDate: later,
        allDay: false,
        status: 'Scheduled'
      });

      andThen(function () {
        visit('/appointments/calendar');
      });

      andThen(function () {
        assert.equal(currentURL(), '/appointments/calendar');
        assert.equal(find('.view-current-title').text(), 'Appointments Calendar', 'Appoinment Calendar displays');
        assert.equal(find('.fc-content .fc-time').text(), timeString, 'Time appears in calendar');
        assert.equal(find('.fc-title').text(), 'Lennex ZinyandoDr Test', 'Appoinment displays in calendar');
        click('.fc-title');
      });

      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Appointment', 'Edit Appointment displays');
        assert.equal(find('.test-appointment-start input').val(), today.format(DATE_TIME_FORMAT), 'Start date/time are correct');
        assert.equal(find('.test-appointment-end input').val(), later.format(DATE_TIME_FORMAT), 'End date/time are correct');
      });
    });
  });

  (0, _qunit.test)('Theater scheduling', function (assert) {
    runWithPouchDump('appointments', function () {
      authenticateUser();
      var later = (0, _moment['default'])();
      later.hour(11);
      later.minute(30);
      var today = (0, _moment['default'])();
      today.hour(10);
      today.minute(30);
      var startTime = today.format(TIME_FORMAT);
      var endTime = later.format(TIME_FORMAT);
      var timeString = startTime + ' - ' + endTime;

      createAppointment(assert, {
        endDate: later,
        startDate: today,
        isSurgery: true
      });

      andThen(function () {
        visit('/appointments/theater');
      });

      andThen(function () {
        assert.equal(currentURL(), '/appointments/theater', 'Theater schedule url is correct.');
        assert.equal(find('.view-current-title').text(), 'Theater Schedule', 'Theater Schedule displays');
        assert.equal(find('.fc-content .fc-time').text(), timeString, 'Time appears in calendar');
        assert.equal(find('.fc-title').text(), 'Lennex ZinyandoDr Test', 'Appoinment displays in calendar');
        click('.fc-title');
      });

      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Surgical Appointment', 'Edit Surgical Appointment displays');
        assert.equal(find('.test-appointment-date input').val(), today.format('l'), 'Date is correct');
        assert.equal(find('.start-hour').val(), today.hour(), 'Start hour is correct');
        assert.equal(find('.start-minute').val(), today.minute(), 'Start minute is correct');
        assert.equal(find('.end-hour').val(), later.hour(), 'End hour is correct');
        assert.equal(find('.end-minute').val(), later.minute(), 'End minute is correct');
      });
    });
  });

  function createAppointment(assert) {
    var appointment = arguments.length <= 1 || arguments[1] === undefined ? { startDate: new Date(), endDate: (0, _moment['default'])().add(1, 'day').toDate(), allDay: true, status: 'Scheduled' } : arguments[1];

    if (appointment.isSurgery) {
      visit('/appointments/edit/newsurgery');
    } else {
      visit('/appointments/edit/new');
    }
    typeAheadFillIn('.test-patient-input', 'Lennex Zinyando - P00017');
    if (appointment.isSurgery) {
      selectDate('.test-appointment-date input', appointment.startDate);
      var endHour = getHour(appointment.endDate);
      var endMinute = appointment.endDate.format('mm');
      var startHour = getHour(appointment.startDate);
      var startMinute = appointment.startDate.format('mm');
      select('.end-hour', endHour);
      select('.end-minute', endMinute);
      select('.start-hour', startHour);
      select('.start-minute', startMinute);
    } else {
      select('.test-appointment-status', appointment.status);
      if (!appointment.allDay) {
        click('.appointment-all-day input');
        fillIn('.test-appointment-start input', appointment.startDate.format(DATE_TIME_FORMAT));
        fillIn('.test-appointment-end input', appointment.endDate.format(DATE_TIME_FORMAT));
      } else {
        selectDate('.test-appointment-start input', appointment.startDate);
        selectDate('.test-appointment-end input', appointment.endDate);
      }
    }
    typeAheadFillIn('.test-appointment-location', 'Harare');
    typeAheadFillIn('.test-appointment-with', 'Dr Test');
    click('button:contains(Add)');
    waitToAppear('.modal-dialog');
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Appointment Saved', 'Appointment has been saved');
      click('.modal-footer button:contains(Ok)');
    });
    andThen(function () {
      click('button:contains(Return)');
    });
  }

  function getHour(date) {
    var hour = date.format('h A');
    if (hour.indexOf('12') === 0) {
      if (hour === '12 AM') {
        hour = 'Midnight';
      } else {
        hour = 'Noon';
      }
    }
    return hour;
  }
});
define('hospitalrun/tests/acceptance/appointments-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/appointments-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/appointments-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/custom-forms-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | custom forms', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('crud operations on custom-forms', function (assert) {
    var crusts = ['Thin', 'Deep Dish', 'Flatbread'];
    var desserts = ['Ice Cream', 'Cookies', 'Cake'];
    var toppings = ['Cheese', 'Pepperoni', 'Mushrooms'];

    function addField(fieldType, label, values) {
      click('button:contains(Add Field)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Value', 'Add Value modal displays.');
        select('.custom-field-select', fieldType);
        fillIn('.custom-field-label input', label);
        fillIn('.custom-field-colspan input', '1');
      });
      if (values) {
        click('button:contains(Add Value)');
        andThen(function () {
          fillIn('.custom-field-value:last', 'Delete Me');
        });
        andThen(function () {
          assert.equal(find('.custom-field-value:contains(Delete Me)').length, 0, 'Field value successfully added');
        });
        andThen(function () {
          click('button.delete-field-value');
        });
        andThen(function () {
          assert.equal(find('.custom-field-value:contains(Delete Me)').length, 0, 'Field value successfully deleted');
          values.forEach(function (value) {
            click('button:contains(Add Value)');
            andThen(function () {
              fillIn('.custom-field-value:last', value);
            });
          });
        });
      }
      andThen(function () {
        click('.modal-footer button:contains(Add)');
      });
    }

    function verifyPreview() {
      click('button:contains(Preview)');
      waitToAppear('.form-preview');
      andThen(function () {
        assert.equal(find('.form-preview label:contains(Pizza Toppings)').length, 1, 'Found Pizza Toppings Label');
        toppings.forEach(function (topping) {
          assert.equal(find('.form-preview label:contains(' + topping + '):has(input[type=checkbox])').length, 1, 'Found ' + topping + ' checkbox');
        });
        assert.equal(find('.form-preview label:contains(Pizza Crust)').length, 1, 'Found Pizza Toppings Label');
        crusts.forEach(function (crust) {
          assert.equal(find('.form-preview option:contains(' + crust + ')').length, 1, 'Found ' + crust + ' option');
        });
        assert.equal(find('.form-preview label:contains(Dessert)').length, 1, 'Found Pizza Toppings Label');
        desserts.forEach(function (dessert) {
          assert.equal(find('.form-preview label:contains(' + dessert + '):has(input[type=radio])').length, 1, 'Found ' + dessert + ' radio option');
        });
        assert.equal(find('.form-preview label:contains(Beverage)').length, 1, 'Found Beverage Label');
        assert.equal(find('.form-preview input[id*=beverage]').length, 1, 'Found Beverage input');
        assert.equal(find('.form-preview label:contains(Special Instructions)').length, 1, 'Found Special Instructions Label');
        assert.equal(find('.form-preview textarea[id*=specialInstructions]').length, 1, 'Found special instructions textarea');
        click('button:contains(Preview)'); // Hide preview to reset it back to being closed.
      });
    }

    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/admin/custom-forms');
      andThen(function () {
        assert.equal(currentURL(), '/admin/custom-forms', 'Navigated to custom forms index page');
        assert.equal(find('.custom-form-name').length, 0, 'No custom forms appears in the listing.');
        click('button:contains(new form)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'New Custom Form', 'New custom form edit page displays');
        assert.equal(currentURL(), '/admin/custom-forms/edit/new', 'Navigated to create new custom form');
        fillIn('.custom-form-name input', 'Test Custom Form');
        fillIn('.custom-form-columns input', '2');
        select('.custom-form-type', 'Visit');
        click('.panel-footer button:contains(Add)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Form Saved', 'Form is saved');
        addField('Checkbox', 'Pizza Toppings', toppings);
      });
      andThen(function () {
        addField('Dropdown', 'Pizza Crust', crusts);
      });
      andThen(function () {
        addField('Radio', 'Dessert', desserts);
      });
      andThen(function () {
        addField('Text', 'Beverage');
      });
      andThen(function () {
        addField('Large Text', 'Special Instructions');
      });
      andThen(function () {
        click('button:contains(Update)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Form Saved', 'Form is updated');
        verifyPreview(1);
      });
      andThen(function () {
        click('button:contains(Return)');
        waitToAppear('.view-current-title:contains(Custom Forms)');
      });
      andThen(function () {
        assert.equal(find('.custom-form-name:contains(Test Custom Form)').length, 1, 'Custom form appears in listing.');
        click('button:contains(Edit)');
        waitToAppear('button:contains(Preview)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Custom Form', 'Custom form edit page displays');
        verifyPreview(2);
      });
      andThen(function () {
        click('button:contains(Return)');
        waitToAppear('.view-current-title:contains(Custom Forms)');
      });
      andThen(function () {
        click('button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Custom Form', 'Delete confirmation displays');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        assert.equal(find('.custom-form-name').length, 0, 'Deleted custom form disappears from custom form listing.');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/custom-forms-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/custom-forms-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/custom-forms-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/imaging-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | imaging', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /imaging', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/imaging');

      andThen(function () {
        assert.equal(currentURL(), '/imaging');
        var newImagingButton = find('button:contains(new imaging)');
        assert.equal(newImagingButton.length, 1, 'New Imaging button is visible');
        findWithAssert('p:contains(No items found. )');
        findWithAssert('a:contains(Create a new record?)');
      });
      click('button:contains(new imaging)');
      andThen(function () {
        assert.equal(currentURL(), '/imaging/edit/new');
      });
    });
  });

  (0, _qunit.test)('create a new imaging request', function (assert) {
    runWithPouchDump('imaging', function () {
      authenticateUser();
      visit('/imaging/edit/new');

      andThen(function () {
        assert.equal(currentURL(), '/imaging/edit/new');
      });
      typeAheadFillIn('.patient-input', 'Joe Bagadonuts - P00001');
      typeAheadFillIn('.imaging-type-input', 'Chest Scan');
      typeAheadFillIn('.radiologist-input', 'Dr Test');
      fillIn('.result-input input', 'Check is clear');
      fillIn('textarea', 'Patient is healthy');
      click('button:contains(Add)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Imaging Request Saved', 'Imaging Request was saved successfully');
      });
      click('button:contains(Ok)');
      andThen(function () {
        findWithAssert('button:contains(Update)');
        findWithAssert('button:contains(Return)');
        findWithAssert('button:contains(Complete)');
      });
      andThen(function () {
        assert.equal(find('.patient-summary').length, 1, 'Patient summary is displayed');
      });
      click('button:contains(Return)');
      andThen(function () {
        assert.equal(currentURL(), '/imaging');
        assert.equal(find('tr').length, 3, 'Two imaging requests are displayed');
      });
    });
  });

  (0, _qunit.test)('completed requests are displayed', function (assert) {
    runWithPouchDump('imaging', function () {
      authenticateUser();
      visit('/imaging/completed');

      andThen(function () {
        assert.equal(currentURL(), '/imaging/completed');
        assert.equal(find('.table').length, 1, 'Requests table is visible');
      });
    });
  });

  (0, _qunit.test)('mark an imaging request as completed', function (assert) {
    runWithPouchDump('imaging', function () {
      authenticateUser();
      visit('/imaging');

      andThen(function () {
        assert.equal(currentURL(), '/imaging');
        assert.equal(find('.table').length, 1, 'Requests table is visible');
        assert.equal(find('tr').length, 2, 'One imaging request not completed');
      });
      click('button:contains(Edit):first');
      andThen(function () {
        assert.equal(currentURL(), '/imaging/edit/12DEDA58-4670-7A74-BA8B-9CC5E5CA82E7');
        findWithAssert('button:contains(Update)');
        findWithAssert('button:contains(Return)');
        findWithAssert('button:contains(Complete)');
      });
      click('button:contains(Complete)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Imaging Request Completed', 'Imaging Request was saved successfully');
      });
      click('button:contains(Ok)');
      click('button:contains(Return)');
      andThen(function () {
        assert.equal(currentURL(), '/imaging');
        findWithAssert('a:contains(Create a new record?)');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/imaging-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/imaging-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/imaging-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/incident-test', ['exports', 'ember', 'qunit', 'moment', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _moment, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  var DATE_FORMAT = 'l';
  var DATE_TIME_FORMAT = 'l h:mm A';
  var DEPARTMENT = 'Pharmacy';
  var INCIDENT_CATEGORY = 'Patient Falls';
  var INCIDENT_CATEGORY_ITEM = 'Ambulating';
  var INCIDENT_DESCRIPTION = 'Patient fell on wet floor that was recently mopped.';
  var INCIDENT_NOTES = 'Additional Notes here';
  var EDIT_INCIDENT_NOTE = 'The wet floor sign had fallen down and was no longer visible.';
  var REPORTED_TO = 'Jack Bridges';

  (0, _qunit.module)('Acceptance | Incidents', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('Incident category management', function (assert) {
    runWithPouchDump('incident', function () {
      authenticateUser();
      visit('/admin/inc-category');
      andThen(function () {
        assert.equal(currentURL(), '/admin/inc-category', 'Incident Categories url is correct');
        click('button:contains(+ new category)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/admin/inc-category/edit/new', 'New incident category URL is correct');
        fillIn('.incident-category-name input', 'Infection Control');
        addItem(assert, 'Surgical Site Infection');
      });
      andThen(function () {
        addItem(assert, 'Hospital Acquired Infection');
      });
      andThen(function () {
        click('button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Item', 'Delete Item modal appears');
        click('.modal-footer button:contains(Ok)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.incident-category-item:contains(Surgical Site Infection)').length, 0, 'Deleted incident category item disappears');
        click('.panel-footer button:contains(Update)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Incident Category Saved', 'Incident Category saved modal appears');
        click('button:contains(Return)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/admin/inc-category', 'Incident Categories url is correct');
        assert.equal(find('td.incident-catergory-name:contains(Infection Control)').length, 1, 'New incident category displays in listing');
      });
    });
  });

  (0, _qunit.test)('Incident creation and editing', function (assert) {
    runWithPouchDump('incident', function () {
      var now = (0, _moment['default'])();
      authenticateUser();
      visit('/incident');
      andThen(function () {
        assert.equal(currentURL(), '/incident', 'Incident listing url is correct');
        click('button:contains(+ new incident)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/incident/edit/new', 'Incident edit url is correct');
        click('.sentinel-event input');
        fillIn('.incident-date input', now.format(DATE_TIME_FORMAT));
        typeAheadFillIn('.incident-department', DEPARTMENT);
        fillIn('.reported-to', REPORTED_TO);
        select('.incident-category', INCIDENT_CATEGORY);
        waitToAppear('.incident-category-item option:contains(' + INCIDENT_CATEGORY_ITEM + ')');
      });
      andThen(function () {
        select('.incident-category-item', INCIDENT_CATEGORY_ITEM);
        typeAheadFillIn('.patient-name', 'Joe Bagadonuts - P00001');
        waitToAppear('.patient-id:contains(P00001)');
      });
      andThen(function () {
        assert.equal(find('.patient-id').text(), 'P00001', 'Selected patient id appears');
        fillIn('.incident-description textarea', 'Patient blacked out and fell down.');
      });
      andThen(function () {
        click('.panel-footer button:contains(Add)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Incident Saved', ' Incident Saved modal appears');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        assert.equal(find('.tab-nav li a:contains(Notes)').length, 1, 'Notes tab appears');
        assert.equal(find('.tab-nav li a:contains(Attachment)').length, 1, 'Attachment tab appears');
        assert.equal(find('.tab-nav li a:contains(Harm Score)').length, 1, 'Harm Score custom form tab appears');
        assert.equal(find('.tab-nav li a:contains(+ Add Form)').length, 1, 'Add Custom form tab appears');
        click('button:contains(+ New Note)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        fillIn('.note-description textarea', INCIDENT_NOTES);
        click('.modal-footer button:contains(Add)');
      });
      andThen(function () {
        waitToDisappear('.modal-dialog');
        waitToAppear('.note-description:contains(' + INCIDENT_NOTES + ')');
      });
      andThen(function () {
        assert.equal(find('.note-description:contains(' + INCIDENT_NOTES + ')').length, 1, 'Added note appears in listing');
        click('.tab-nav li a:contains(Attachment)');
      });
      andThen(function () {
        click('button:contains(+ New Attachment)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Attachment', 'Add attachment dialog appears');
        // Right now we don't have a good way to test adding attachments.
        click('.modal-footer button:contains(Cancel)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        click('.tab-nav li a:contains(Harm Score)');
      });
      andThen(function () {
        assert.equal(find('#customForm0 label:contains(No Actual Event)').length, 1, 'Always add custom form renders');
        click('.tab-nav li a:contains(+ Add Form)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Custom Form', 'Add custom form dialog appears');
        select('.form-to-add', 'Incident');
      });
      andThen(function () {
        click('.modal-footer button:contains(Add Form)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.tab-nav li a:contains(Pre-Incident Risk Assessment)').length, 1, 'Pre-Incident Risk Assessment form tab now appears');
        assert.equal(find('.tab-nav li a:contains(+ Add Form)').length, 0, 'Add Custom form tab disappears');
        click('.tab-nav li a:contains(Pre-Incident Risk Assessment)');
      });
      andThen(function () {
        assert.equal(find('#customForm1 label:contains(Minimum No injuries, low financial loss)').length, 1, 'Pre-Incident Risk Assessment custom form renders');
        click('.panel-footer button:contains(Update)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Incident Saved', ' Incident Saved modal appears');
        click('.modal-footer button:contains(Ok)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        click('.panel-footer button:contains(Return)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/incident', 'Incident listing url is correct');
        assert.equal(find('.incident-row').length, 2, 'Two incidents appears');
        assert.equal(find('.incident-row td.incident-date:contains(' + now.format(DATE_FORMAT) + ')').length, 1, 'Incident date appears in listing');
        assert.equal(find('.incident-row td.incident-department:contains(' + DEPARTMENT + ')').length, 1, 'Incident department appears in listing');
        assert.equal(find('.incident-row td.incident-category:contains(' + INCIDENT_CATEGORY + ')').length, 1, 'Incident category appears in listing');
        assert.equal(find('.incident-row td.incident-category-item:contains(' + INCIDENT_CATEGORY_ITEM + ')').length, 1, 'Incident category item appears in listing');
        assert.equal(find('.incident-row td.incident-status:last').text(), 'Reported', 'Incident status of reported appears in listing');
        visit('/incident/edit/56c64d71-ba30-4271-b899-f6f6b031f589');
      });
      andThen(function () {
        var incidentDate = (0, _moment['default'])(1489004400000);
        assert.equal(currentURL(), '/incident/edit/56c64d71-ba30-4271-b899-f6f6b031f589', 'Incident edit url is correct');
        assert.equal(find('.sentinel-event input:checked').length, 1, 'Sentinel Event checkbox is checked');
        assert.equal(find('.incident-date input').val(), incidentDate.format(DATE_TIME_FORMAT), 'Date of incident displays');
        assert.equal(find('.incident-department .tt-input').val(), 'Reception', 'Incident department displays');
        assert.equal(find('.reported-to input').val(), 'Jane Bagadonuts', 'Reported to displays.');
        assert.equal(find('.incident-category option:selected').text().trim(), 'Accident or Injury', 'Category displays');
        assert.equal(find('.incident-category-item option:selected').text().trim(), 'Patient', 'Category item displays');
        assert.equal(find('.patient-name .tt-input').val(), 'Joe Bagadonuts - P00001', 'Patient impacted name displays');
        assert.equal(find('.patient-id').text(), 'P00001', 'Patient id displays');
        assert.equal(find('.incident-description textarea').val(), 'Patient fell on wet floor.', 'Description displays');
        fillIn('.incident-description textarea', INCIDENT_DESCRIPTION);
      });
      andThen(function () {
        assert.equal(find('.incident-description textarea').val(), INCIDENT_DESCRIPTION, 'Updated description displays');
        click('.panel-footer button:contains(Update)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Incident Saved', ' Incident Saved modal appears');
        click('.modal-footer button:contains(Ok)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        click('#notes tr button:contains(Edit)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Edit Note', ' Edit Note modal appears');
        fillIn('.note-description textarea', EDIT_INCIDENT_NOTE);
      });
      andThen(function () {
        click('.modal-footer button:contains(Update)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.note-description').text(), EDIT_INCIDENT_NOTE, 'Note is updated');
        click('#notes tr button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Note', ' Delete Note modal appears');
        click('.modal-footer button:contains(Delete)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.note-description').length, 0, 'Note has been deleted');
        click('.tab-nav li a:contains(Attachment)');
        waitToAppear('#attachments td a:contains(Download)');
      });
      andThen(function () {
        assert.equal(find('#attachments td a:contains(Download)').length, 1, 'Download button appears for attachment');
        click('#attachments td button:contains(Edit)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Edit Attachment', ' Edit Attachment modal appears');
        fillIn('.attachment-title input', 'Incident Report Form');
      });
      andThen(function () {
        click('.modal-footer button:contains(Update)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('#attachments td:contains(Incident Report Form)').length, 1, 'Updated attachment title appears');
        click('#attachments td button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Attachment', ' Delete Attachment modal appears');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        assert.equal(find('#attachments td:contains(Incident Report Form)').length, 0, 'Deleted attachment disappears');
      });
    });
  });

  (0, _qunit.test)('Incident deletion', function (assert) {
    runWithPouchDump('incident', function () {
      authenticateUser();
      visit('/incident');
      andThen(function () {
        assert.equal(currentURL(), '/incident', 'Incident listing url is correct');
        assert.equal(find('.incident-row').length, 1, 'One incident appears');
        click('.incident-row button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Incident', ' Delete Incident modal appears');
        click('.modal-footer button:contains(Delete)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.incident-row').length, 0, 'Incident diappears from list');
      });
    });
  });

  function addItem(assert, itemName) {
    click('button:contains(Add Item)');
    waitToAppear('.modal-dialog');
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Add Category Item', 'Add Category Item modal appears');
      fillIn('.incident-category-item input', itemName);
    });
    andThen(function () {
      click('.modal-footer button:contains(Add)');
      waitToAppear('.incident-category-item:contains(' + itemName + ')');
    });
    andThen(function () {
      assert.equal(find('.incident-category-item:contains(' + itemName + ')').length, 1, 'New incident category item appears');
    });
  }
});
define('hospitalrun/tests/acceptance/incident-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/incident-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/incident-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/inventory-test', ['exports', 'ember', 'qunit', 'moment', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _moment, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | inventory', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /inventory', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/inventory');

      andThen(function () {
        assert.equal(currentURL(), '/inventory');
        findWithAssert('button:contains(new request)');
        findWithAssert('button:contains(inventory received)');
        findWithAssert('p:contains(No requests found. )');
        findWithAssert('a:contains(Create a new request?)');
      });
    });
  });

  (0, _qunit.test)('Adding a new inventory item', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/inventory/edit/new');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/edit/new');
      });
      fillIn('.test-inv-name input', 'Biogesic');
      select('.test-inv-rank', 'B');
      fillIn('textarea', 'Biogesic nga medisina');
      select('.test-inv-type', 'Medication');
      fillIn('.test-inv-cross input', '2600');
      fillIn('.test-inv-reorder input', '100');
      fillIn('.test-inv-price input', '5');
      select('.test-inv-dist-unit', 'tablet');
      fillIn('.test-inv-quantity input', '1000');
      fillIn('.test-inv-cost input', '4000');
      select('.test-inv-unit', 'tablet');
      typeAheadFillIn('.test-vendor', 'Alpha Pharmacy');
      click('button:contains(Add)');
      waitToAppear('.modal-dialog');

      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Inventory Item Saved', 'Inventory Item was saved successfully');
      });
      click('button:contains(Ok)');

      andThen(function () {
        findWithAssert('button:contains(Add Purchase)');
        findWithAssert('button:contains(Update)');
        findWithAssert('button:contains(Return)');
      });

      click('button:contains(Return)');
      andThen(function () {
        assert.equal(currentURL(), '/inventory/listing');
        assert.equal(find('tr').length, 2, 'One item is listed');
      });
    });
  });

  (0, _qunit.test)('Items with negative quantites should not be saved', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/inventory/edit/new');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/edit/new');
      });
      fillIn('.test-inv-name input', 'Biogesic');
      select('.test-inv-rank', 'B');
      fillIn('textarea', 'Biogesic nga medisina');
      select('.test-inv-type', 'Medication');
      fillIn('.test-inv-cross input', '2600');
      fillIn('.test-inv-reorder input', '100');
      fillIn('.test-inv-price input', '5');
      select('.test-inv-dist-unit', 'tablet');
      fillIn('.test-inv-quantity input', '-1000');
      fillIn('.test-inv-cost input', '4000');
      select('.test-inv-unit', 'tablet');
      typeAheadFillIn('.test-vendor', 'Alpha Pharmacy');
      click('button:contains(Add)');
      waitToAppear('.modal-dialog');

      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Warning!!!!', 'Inventory Item with negative quantity should not be saved.');
      });
      click('button:contains(Ok)');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/edit/new');
        findWithAssert('button:contains(Add)');
        findWithAssert('button:contains(Cancel)');
        assert.equal(find('.test-inv-quantity .help-block').text(), 'not a valid number', 'Error message should be present for invalid quantities');
      });
    });
  });

  (0, _qunit.test)('Visiting /inventory/barcode', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser();
      visit('/inventory/listing');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/listing');
        click('a:contains(Barcode)');
        andThen(function () {
          assert.equal(currentURL(), '/inventory/barcode/igbmk5zf_is');
          findWithAssert('.panel-body img[src^="data:image"]');
        });
      });
    });
  });

  (0, _qunit.test)('Deleting the last inventory item', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser();
      visit('/inventory/listing');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/listing');
        click('button:contains(Delete)');
        waitToAppear('.modal-dialog');
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'Delete Item', 'Deleting confirmation.');
        });
        click('.modal-content button:contains(Delete)');
        waitToAppear('.panel-body .alert-info');
        andThen(function () {
          assert.equal(currentURL(), '/inventory/listing');
          findWithAssert('a:contains(Create a new record?)');
        });
      });
    });
  });

  (0, _qunit.test)('Creating a new inventory request', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser();
      visit('/inventory/request/new');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/request/new');
      });
      typeAheadFillIn('.test-inv-item', 'Biogesic - m00001 (1000 available)');
      fillIn('.test-inv-quantity input', 500);
      typeAheadFillIn('.test-delivery-location', 'Harare');
      typeAheadFillIn('.test-delivery-aisle', 'C100');
      typeAheadFillIn('.test-bill-to', 'Accounts Dept');
      click('button:contains(Add)');
      waitToAppear('.modal-dialog');

      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Request Updated', 'New request has been saved');
      });
      click('button:contains(Ok)');
      andThen(function () {
        findWithAssert('button:contains(Fulfill)');
        findWithAssert('button:contains(Cancel)');
      });
      click('button:contains(Cancel)');
      andThen(function () {
        assert.equal(currentURL(), '/inventory');
        assert.equal(find('tr').length, 3, 'Two requests are now displayed');
      });
    });
  });

  (0, _qunit.test)('Fulfilling an inventory request', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser();
      visit('/inventory');

      andThen(function () {
        assert.equal(currentURL(), '/inventory');
        var tableRows = find('tr').length;
        assert.equal(tableRows, 2, 'One request not fulfilled');
      });
      click('button:contains(Fulfill)');

      andThen(function () {
        findWithAssert('button:contains(Fulfill)');
        findWithAssert('button:contains(Cancel)');
      });
      waitToAppear('.inventory-location option:contains(No Location)');
      andThen(function () {
        click('button:contains(Fulfill)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        var modalTitle = find('.modal-title');
        assert.equal(modalTitle.text(), 'Request Fulfilled', 'Inventory request has been fulfilled');
      });

      click('button:contains(Ok)');
      andThen(function () {
        assert.equal(currentURL(), '/inventory');
      });
    });
  });

  (0, _qunit.test)('Deleting an inventory request', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser();
      visit('/inventory');

      andThen(function () {
        assert.equal(currentURL(), '/inventory', 'Navigated to /inventory');
        assert.equal(find('button:contains(Delete)').length, 1, 'There is one request');
      });

      click('button:contains(Delete)');
      waitToAppear('.modal-dialog');

      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Item', 'Deleting confirmation');
      });

      click('.modal-content button:contains(Delete)');
      waitToAppear('.panel-body .alert-info');

      andThen(function () {
        assert.equal(currentURL(), '/inventory', 'Navigated to /inventory');
        assert.equal(find('button:contains(Delete)').length, 0, 'Request was deleted');
      });
    });
  });

  (0, _qunit.test)('User with add_inventory_request and without fulfill_inventory rights should not be able to delete others\' requests', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser({
        name: 'nurse.mgr',
        roles: ['Nurse Manager', 'user'],
        role: 'Nurse Manager'
      });
      visit('/inventory');

      andThen(function () {
        assert.equal(currentURL(), '/inventory', 'Navigated to /inventory');
        assert.equal(find('button:contains(Delete)').length, 0, 'User doesn\'t see Delete button');
      });
    });
  });

  (0, _qunit.test)('Receiving inventory', function (assert) {
    runWithPouchDump('inventory', function () {
      authenticateUser();
      visit('/inventory/batch/new');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/batch/new');
      });
      typeAheadFillIn('.test-vendor', 'Alpha Pharmacy');
      fillIn('.test-invoice-number input', 'P2345');
      typeAheadFillIn('.test-inv-item', 'Biogesic - m00001');
      fillIn('.test-inv-quantity input', 500);
      fillIn('.test-inv-cost input', '2000');
      waitToAppear('.inventory-distribution-unit');
      andThen(function () {
        click('button:contains(Save)');
        waitToAppear('.modal-title');
      });
      andThen(function () {
        var modalTitle = find('.modal-title');
        assert.equal(modalTitle.text(), 'Inventory Purchases Saved', 'Inventory has been received');
      });
      click('button:contains(Ok)');

      andThen(function () {
        assert.equal(currentURL(), '/inventory/listing');
      });
    });
  });

  testSimpleReportForm('Detailed Adjustment');
  testSimpleReportForm('Detailed Purchase');
  testSimpleReportForm('Detailed Stock Usage');
  testSimpleReportForm('Detailed Stock Transfer');
  testSimpleReportForm('Detailed Expenses');
  testSimpleReportForm('Expiration Date');
  testSimpleReportForm('Summary Expenses');
  testSimpleReportForm('Summary Purchase');
  testSimpleReportForm('Summary Stock Usage');
  testSimpleReportForm('Summary Stock Transfer');
  testSimpleReportForm('Finance Summary');
  testSingleDateReportForm('Inventory By Location');
  testSingleDateReportForm('Inventory Valuation');

  function testSimpleReportForm(reportName) {
    (0, _qunit.test)(reportName + ' report can be generated', function (assert) {
      runWithPouchDump('default', function () {
        authenticateUser();
        visit('/inventory/reports');
        andThen(function () {
          assert.equal(currentURL(), '/inventory/reports');
        });
        var startDate = (0, _moment['default'])('2015-10-01');
        var endDate = (0, _moment['default'])('2015-10-31');
        selectDate('.test-start-date input', startDate.toDate());
        selectDate('.test-end-date input', endDate.toDate());
        select('#report-type', '' + reportName);
        click('button:contains(Generate Report)');
        waitToAppear('.panel-title');

        andThen(function () {
          var reportTitle = reportName + ' Report ' + startDate.format('l') + ' - ' + endDate.format('l');
          assert.equal(find('.panel-title').text().trim(), reportTitle, reportName + ' Report generated');
          var exportLink = findWithAssert('a:contains(Export Report)');
          assert.equal($(exportLink).attr('download'), reportTitle + '.csv');
        });
      });
    });
  }

  function testSingleDateReportForm(reportName) {
    (0, _qunit.test)(reportName + ' report can be generated', function (assert) {
      runWithPouchDump('default', function () {
        authenticateUser();
        visit('/inventory/reports');
        andThen(function () {
          assert.equal(currentURL(), '/inventory/reports');
        });
        select('#report-type', '' + reportName);
        click('button:contains(Generate Report)');
        waitToAppear('.panel-title');

        andThen(function () {
          var reportTitle = reportName + ' Report ' + (0, _moment['default'])().format('l');
          assert.equal(find('.panel-title').text().trim(), reportTitle, reportName + ' Report generated');
          var exportLink = findWithAssert('a:contains(Export Report)');
          assert.equal($(exportLink).attr('download'), reportTitle + '.csv');
        });
      });
    });
  }
});
define('hospitalrun/tests/acceptance/inventory-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/inventory-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/inventory-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/invoices-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | invoices', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /invoices', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
      });
    });
  });

  (0, _qunit.test)('create invoice', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/invoices/edit/new');
      andThen(function () {
        assert.equal(currentURL(), '/invoices/edit/new');
      });
      typeAheadFillIn('.invoice-patient', 'Joe Bagadonuts - TCH 00001');
      waitToAppear('.invoice-visit option:contains((Admission))');
      andThen(function () {
        select('.invoice-visit', '(Admission)');
        fillIn('.external-invoice-no input', 'inv000002');
      });
      waitToAppear('button:contains(Update)');
      andThen(function () {
        click('button:contains(Update)');
      });
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Invoice Saved', 'Invoice was saved successfully');
      });
    });
  });

  (0, _qunit.test)('print invoice', function (assert) {
    runWithPouchDump('billing', function () {
      window.print = _ember['default'].K; // Disable browser print dialog.
      authenticateUser();
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
        assert.equal(find('.invoice-number:contains(inv00001)').length, 1, 'Invoice is available for printing');
        click('button:contains(Edit)');
        waitToAppear('button:contains(Print)');
      });
      andThen(function () {
        click('button:contains(Print)');
      });
      andThen(function () {
        assert.equal(find('.print-invoice').length, 1, 'Invoice is displayed for printing');
      });
    });
  });

  // test pricing profile
  (0, _qunit.test)('pricing profiles', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/pricing/profiles');
      andThen(function () {
        assert.equal(find('.btn-primary:contains(+ new item)').length, 1, 'We can add a new pricing profile');
        click('button:contains(+ new item)');
        waitToAppear('h4:contains(New Pricing Profile)');
      });
      // % discount
      andThen(function () {
        fillIn('.pricing-profile-name input', '50% profile');
        fillIn('.pricing-profile-percentage input', '50');
        click('button:contains(Add)');
        waitToAppear('button:contains(Ok)');
        click('button:contains(Ok)');
      });
      andThen(function () {
        click('button:contains(+ new item)');
        waitToAppear('h4:contains(New Pricing Profile)');
      });
      // flat discount
      andThen(function () {
        fillIn('.pricing-profile-name input', '$100 discount');
        fillIn('.pricing-profile-discount input', '100');
        click('button:contains(Add)');
        waitToAppear('button:contains(Ok)');
        click('button:contains(Ok)');
      });
      andThen(function () {
        click('button:contains(+ new item)');
        waitToAppear('h4:contains(New Pricing Profile)');
      });
      // flat fee
      andThen(function () {
        fillIn('.pricing-profile-name input', '$150 fee');
        fillIn('.pricing-set-fee input', '150');
        click('button:contains(Add)');
        waitToAppear('button:contains(Ok)');
        click('button:contains(Ok)');
      });
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
        assert.equal(find('.invoice-number:contains(inv00001)').length, 1, 'Invoice is available for modifying');
        click('button:contains(Edit)');
      });
    });
  });

  (0, _qunit.test)('delete invoice', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
        assert.equal(find('.invoice-number:contains(inv00001)').length, 1, 'Invoice is displayed for deletion');
      });
      click('button:contains(Delete)');
      andThen(function () {
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.alert').text().trim(), 'Are you sure you wish to delete inv00001?', 'Invoice deletion confirm displays');
      });
      click('button:contains(Delete):last');
      waitToDisappear('.invoice-number:contains(inv00001)');
      andThen(function () {
        assert.equal(find('.invoice-number:contains(inv00001)').length, 0, 'Invoice is deleted');
      });
    });
  });

  (0, _qunit.test)('add payment', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
      });
      click('button:contains(Add Payment)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Payment', 'Add Payment modal displays');
      });
      fillIn('.payment-amount input', 100);
      click('.update-payment-btn');
      waitToAppear('.modal-title:contains(Payment Added)');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Payment Added', 'Payment was saved successfully');
        click('.modal-footer button:contains(Ok)');
        waitToDisappear('.modal-dialog');
      });
    });
  });

  (0, _qunit.test)('add deposit', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
      });
      click('button:contains(add deposit)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Deposit', 'Add Deposit modal displays');
      });
      fillIn('.payment-amount input', 140);
      typeAheadFillIn('.payment-patient', 'Joe Bagadonuts - TCH 00001');
      click('.update-payment-btn');
      waitToAppear('.modal-title:contains(Deposit Added)');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Deposit Added', 'Deposit was saved successfully');
      });
    });
  });

  (0, _qunit.test)('cashier role', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser({
        name: 'cashier@hospitalrun.io',
        roles: ['Cashier', 'user'],
        role: 'Cashier',
        prefix: 'p1'
      });
      visit('/invoices');
      andThen(function () {
        assert.equal(currentURL(), '/invoices');
        assert.equal(find('.primary-section-link').length, 2, 'Should have 2 navigations');
        assert.equal(find('.primary-section-link:contains(Scheduling)').length, 1, 'should see Scheduling navigation');
        assert.equal(find('.primary-section-link:contains(Billing)').length, 1, 'should see Billing navigation');

        assert.equal(find('li:contains(Billed)').length, 1, 'should see Billed selection');
        assert.equal(find('li:contains(Drafts)').length, 1, 'should see Drafts selection');
        assert.equal(find('li:contains(All Invoices)').length, 1, 'should see All Invoices selection');
      });
      click('a:contains(Billing)');
      andThen(function () {
        assert.equal(find('.category-sub-item').length, 3, 'Should have 3 sub navigations');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/invoices-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/invoices-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/invoices-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/labs-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | labs', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /labs', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/labs');

      andThen(function () {
        assert.equal(currentURL(), '/labs');
        findWithAssert('a:contains(Create a new record?)');
        findWithAssert('button:contains(new lab)');
      });
    });
  });

  (0, _qunit.test)('Adding a new lab request', function (assert) {
    runWithPouchDump('labs', function () {
      authenticateUser();
      visit('/labs');

      click('button:contains(new lab)');

      andThen(function () {
        assert.equal(currentURL(), '/labs/edit/new');
      });

      typeAheadFillIn('.test-patient-name', 'Lennex Zinyando - P00017');
      typeAheadFillIn('.test-lab-type', 'Chest Scan');
      fillIn('.test-result-input input', 'Chest is clear');
      fillIn('textarea', 'Dr test ordered another scan');
      click('button:contains(Add)');
      waitToAppear('.modal-dialog');

      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Lab Request Saved', 'Lab Request was saved successfully');
        findWithAssert('.patient-summary');
      });

      click('.modal-footer button:contains(Ok)');

      andThen(function () {
        assert.equal(find('.patient-summary').length, 1, 'Patient summary is displayed');
      });

      click('.panel-footer button:contains(Return)');

      andThen(function () {
        assert.equal(currentURL(), '/labs');
        assert.equal(find('tr').length, 3, 'Two lab requests are displayed');
      });
    });
  });

  (0, _qunit.test)('Marking a lab request as completed', function (assert) {
    runWithPouchDump('labs', function () {
      authenticateUser();
      visit('/labs/completed');

      andThen(function () {
        assert.equal(find('.alert-info').text().trim(), 'No completed items found.', 'No completed requests are displayed');
      });

      visit('/labs');
      click('button:contains(Edit)');
      click('button:contains(Complete)');
      waitToAppear('.modal-dialog');

      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Lab Request Completed', 'Lab Request was completed successfully');
      });

      click('.modal-footer button:contains(Ok)');
      click('.panel-footer button:contains(Return)');
      visit('/labs/completed');

      andThen(function () {
        assert.equal(find('tr').length, 2, 'One completed request is displayed');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/labs-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/labs-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/labs-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/login-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app', 'ember-cli-fake-server'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp, _emberCliFakeServer) {
  'use strict';

  (0, _qunit.module)('Acceptance | login', {
    beforeEach: function beforeEach() {
      _emberCliFakeServer['default'].start();
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _emberCliFakeServer['default'].stop();
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting / redirects user to login', function (assert) {
    assert.expect(1);
    runWithPouchDump('default', function () {
      visit('/');

      andThen(function () {
        assert.equal(currentURL(), '/login');
      });
    });
  });

  (0, _qunit.test)('login with correct credentials', function (assert) {
    login(assert);
  });
  (0, _qunit.test)('login with correct credentials but space around username', function (assert) {
    login(assert, true);
  });

  (0, _qunit.test)('incorrect credentials shows an error message on the screen', function (assert) {
    if (!window.ELECTRON) {
      assert.expect(2);
    }
    runWithPouchDump('default', function () {
      visit('/');

      var errorMessage = 'Username or password is incorrect.';

      (0, _emberCliFakeServer.stubRequest)('post', '/auth/login', function (request) {
        assert.equal(request.requestBody, 'name=hradmin&password=tset', 'credential are sent to the server');
        request.error({ 'error': 'unauthorized', 'reason': errorMessage });
      });

      fillIn('#identification', 'hradmin');
      fillIn('#password', 'tset');
      click('button:contains(Sign in)');
      waitToAppear('.form-signin-alert');

      andThen(function () {
        assert.equal(find('.form-signin-alert').text(), errorMessage, 'Error reason is shown');
      });
    });
  });

  function login(assert, spaceAroundUsername) {
    if (!window.ELECTRON) {
      assert.expect(2);
    }
    runWithPouchDump('default', function () {
      visit('/login');

      (0, _emberCliFakeServer.stubRequest)('post', '/auth/login', function (request) {
        assert.equal(request.requestBody, 'name=hradmin&password=test', !spaceAroundUsername ? 'credential are sent to the server' : 'username trimmed and credential are sent to the server');
        request.ok({ 'ok': true, 'name': 'hradmin', 'roles': ['System Administrator', 'admin', 'user'] });
      });

      andThen(function () {
        assert.equal(currentURL(), '/login');
      });

      fillIn('#identification', !spaceAroundUsername ? 'hradmin' : ' hradmin');
      fillIn('#password', 'test');
      click('button:contains(Sign in)');
      andThen(function () {
        waitToAppear('.sidebar-nav-logo');
      });
    });
  }
});
define('hospitalrun/tests/acceptance/login-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/login-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/login-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/medication-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | medication', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /medication', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/medication');

      andThen(function () {
        assert.equal(currentURL(), '/medication');
        findWithAssert('button:contains(new request)');
        findWithAssert('button:contains(dispense medication)');
        findWithAssert('button:contains(return medication)');
        findWithAssert('p:contains(No items found. )');
        findWithAssert('a:contains(Create a new medication request?)');
      });
    });
  });

  (0, _qunit.test)('creating a new medication request', function (assert) {
    runWithPouchDump('medication', function () {
      authenticateUser();
      visit('/medication/edit/new');

      andThen(function () {
        assert.equal(currentURL(), '/medication/edit/new');
      });
      typeAheadFillIn('.test-patient-input', 'Lennex Zinyando - P00017');
      waitToAppear('.have-inventory-items');
      andThen(function () {
        typeAheadFillIn('.test-medication-input', 'Biogesic - m00001 (950 available)');
      });
      andThen(function () {
        fillIn('textarea', '30 Biogesic Pills');
        fillIn('.test-quantity-input input', '30');
      });
      waitToDisappear('.disabled-btn:contains(Add)');
      andThen(function () {
        click('button:contains(Add)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text().trim(), 'Medication Request Saved', 'New medication request has been saved');
      });

      click('button:contains(Ok)');
      click('button:contains(Return)');
      andThen(function () {
        assert.equal(currentURL(), '/medication');
        assert.equal(find('tr').length, 3, 'New medication request is now displayed');
      });
    });
  });

  (0, _qunit.test)('fulfilling a medication request', function (assert) {
    runWithPouchDump('medication', function () {
      authenticateUser();
      visit('/medication');
      click('button:contains(Fulfill)');

      andThen(function () {
        assert.equal(find('.patient-summary').length, 1, 'Patient summary is displayed');
      });
      waitToAppear('.inventory-location option:contains(No Location)');
      andThen(function () {
        click('button:contains(Fulfill)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text().trim(), 'Medication Request Fulfilled', 'Medication Request has been Fulfilled');
      });

      click('button:contains(Ok)');
      click('button:contains(Return)');

      andThen(function () {
        assert.equal(currentURL(), '/medication');
        findWithAssert('p:contains(No items found. )');
        findWithAssert('a:contains(Create a new medication request?)');
      });
    });
  });

  (0, _qunit.test)('complete a medication request', function (assert) {
    runWithPouchDump('medication', function () {
      authenticateUser();
      visit('/medication/completed');
      assert.equal(find('.clickable').length, 0, 'Should have 0 completed request');
      visit('/medication');
      click('button:contains(Fulfill)');

      andThen(function () {
        assert.equal(find('.patient-summary').length, 1, 'Patient summary is displayed');
      });
      waitToAppear('.inventory-location option:contains(No Location)');
      andThen(function () {
        click('button:contains(Fulfill)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text().trim(), 'Medication Request Fulfilled', 'Medication Request has been Fulfilled');
      });

      click('button:contains(Ok)');
      visit('/medication/completed');
      andThen(function () {
        assert.equal(currentURL(), '/medication/completed');
        assert.equal(find('.clickable').length, 1, 'Should have 1 completed request');
      });
    });
  });

  (0, _qunit.test)('returning medication', function (assert) {
    runWithPouchDump('medication', function () {
      authenticateUser();
      visit('/medication/return/new');

      andThen(function () {
        assert.equal(currentURL(), '/medication/return/new');
      });
      waitToAppear('.have-inventory-items');
      andThen(function () {
        typeAheadFillIn('.test-medication-input', 'Biogesic - m00001');
      });
      andThen(function () {
        fillIn('.test-medication-quantity input', 30);
        waitToDisappear('.disabled-btn:contains(Return Medication)');
      });
      andThen(function () {
        click('button:contains(Return Medication)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Medication Returned', 'Medication has been return successfully');
      });
      click('button:contains(Ok)');

      andThen(function () {
        assert.equal(currentURL(), '/medication');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/medication-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/medication-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/medication-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/operative-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  var ADDITIONAL_NOTES = 'Additional Notes here';
  var CASE_COMPLEXITY = 7;
  var OPERATION_DESCRIPTION = 'Operation Description Goes Here';
  var OPERATION_SURGEON = 'Dr Nick';
  var PROCEDURE_FIX_ARM = 'fix broken arm';
  var PROCEDURE_HIP = 'hip adductor release';

  (0, _qunit.module)('Acceptance | Operative Plan and Operation Report', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('Plan and report creation', function (assert) {
    runWithPouchDump('operative', function () {
      authenticateUser();
      visit('/patients');
      andThen(function () {
        assert.equal(currentURL(), '/patients', 'Patients listing url is correct');
        click('button:contains(Edit)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/patients/edit/cd572865-dcc0-441e-a2ad-be400dc256da', 'Patient edit URL is correct');
        assert.equal(find('a.primary-diagnosis:contains(Broken Arm)').length, 1, 'Primary diagnosis appears');
        assert.equal(find('a.secondary-diagnosis:contains(Tennis Elbow)').length, 1, 'Secondary diagnosis appears');
        click('a:contains(Add Operative Plan)');
        waitToAppear('span.secondary-diagnosis:contains(Tennis Elbow)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/patients/operative-plan/new?forPatientId=cd572865-dcc0-441e-a2ad-be400dc256da', 'New operative plan URL is correct');
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient header displays');
        assert.equal(find('.view-current-title').text(), 'New Operative Plan', 'New operative plan title is correct');
        assert.equal(find('span.primary-diagnosis:contains(Broken Arm)').length, 1, 'Primary diagnosis appears as read only');
        assert.equal(find('span.secondary-diagnosis:contains(Tennis Elbow)').length, 1, 'Secondary diagnosis appears as read only');
        fillIn('.operation-description textarea', OPERATION_DESCRIPTION);
        typeAheadFillIn('.procedure-description', PROCEDURE_HIP);
      });
      andThen(function () {
        click('button:contains(Add Procedure)');
        waitToAppear('.procedure-listing td.procedure-description');
      });
      andThen(function () {
        assert.equal(find('.procedure-listing td.procedure-description').text(), PROCEDURE_HIP, 'Added procedure displays in procedure table');
        typeAheadFillIn('.procedure-description', 'Delete Me');
      });
      andThen(function () {
        click('button:contains(Add Procedure)');
        waitToAppear('.procedure-listing td.procedure-description:contains(Delete Me)');
      });
      andThen(function () {
        findWithAssert('.procedure-listing td.procedure-description:contains(Delete Me)');
        click('.procedure-listing tr:last button:contains(Delete)');
      });
      andThen(function () {
        assert.equal(find('.procedure-listing td.procedure-description:contains(Delete Me)').length, 0, 'Procedure is properly deleted');
        typeAheadFillIn('.procedure-description', PROCEDURE_FIX_ARM); // Leave typeahead filled in with value to automatically add on save.
        typeAheadFillIn('.plan-surgeon', OPERATION_SURGEON);
        assert.equal(find('.plan-status select').val(), 'planned', 'Plan status is set to planned');
        fillIn('.case-complexity input', CASE_COMPLEXITY);
        fillIn('.admission-instructions textarea', 'Get blood tests done on admission.');
        fillIn('.additional-notes textarea', ADDITIONAL_NOTES);
      });
      andThen(function () {
        click('.panel-footer button:contains(Add)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Plan Saved', 'Plan saved modal displays');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Operative Plan', 'Edit operative plan title is correct');
        assert.equal(find('.procedure-listing td.procedure-description:contains(' + PROCEDURE_FIX_ARM + ')').length, 1, 'Procedure from typeahead gets added to procedure list on save');
        click('button:contains(Return)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/patients/edit/cd572865-dcc0-441e-a2ad-be400dc256da', 'Return goes back to patient screen');
        assert.equal(find('a:contains(Current Operative Plan)').length, 1, 'Link to newly created plan appears');
        click('a:contains(Current Operative Plan)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Operative Plan', 'Edit operative plan title is correct');
        assert.equal(find('button:contains(Complete Plan)').length, 1, 'Complete Plan button appears');
        click('button:contains(Complete Plan)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Plan Completed', 'Plan completed modal displays');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Operation Report', 'Edit Operation Report title is correct');
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient header displays');
        assert.equal(find('a.primary-diagnosis:contains(Broken Arm)').length, 1, 'Primary diagnosis appears as editable');
        assert.equal(find('a.secondary-diagnosis:contains(Tennis Elbow)').length, 1, 'Secondary diagnosis appears as  editable');
        assert.equal(find('.operation-description textarea').val(), OPERATION_DESCRIPTION, 'Operation description is copied from operative plan');
        assert.equal(find('.operation-surgeon .tt-input').val(), OPERATION_SURGEON, 'Surgeon is copied from operative plan');
        assert.equal(find('.case-complexity input').val(), CASE_COMPLEXITY, 'Case complexity is copied from operative plan');
        assert.equal(find('.procedure-listing td.procedure-description:contains(' + PROCEDURE_HIP + ')').length, 1, 'Procedure ' + PROCEDURE_HIP + ' is copied from operative plan');
        assert.equal(find('.procedure-listing td.procedure-description:contains(' + PROCEDURE_FIX_ARM + ')').length, 1, 'Procedure ' + PROCEDURE_FIX_ARM + ' is copied from operative plan');
        typeAheadFillIn('.operation-assistant', 'Dr Cindy');
      });
      andThen(function () {
        click('.panel-footer button:contains(Update)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Report Saved', 'Report Saved modal displays');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        click('button:contains(Return)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/patients/edit/cd572865-dcc0-441e-a2ad-be400dc256da', 'Patient edit URL is correct');
        assert.equal(find('a.patient-procedure:contains(fix broken arm)').length, 1, 'Procedure/operative report shows on patient header');
        click('a.patient-procedure:contains(fix broken arm)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Operation Report', 'Operation Report appears for editing');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/operative-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/operative-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/operative-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/outpatient-test', ['exports', 'ember', 'qunit', 'moment', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _moment, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | outpatient', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('Check In/Check Out Existing outpatient', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      visit('/patients/outpatient');
      andThen(function () {
        assert.equal(currentURL(), '/patients/outpatient', 'Outpatient url is correct');
        assert.equal(find('.view-current-title').text(), 'Today\'s Outpatients', 'Title is correct');
        click('button:contains(Patient Check In)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/visits/edit/checkin', 'Check In url is correct');
        typeAheadFillIn('.patient-name', 'Joe Bagadonuts - P00001');
        waitToAppear('.patient-name .ps-info-data');
      });
      andThen(function () {
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient record displays');
        assert.equal(find('.new-patient-checkbox input:checked').length, 0, 'New Patient checkbox is not checked');
        select('.visit-type', 'Clinic');
        click('button:contains(Check In)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Checked In', 'Patient has been checked in');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        findWithAssert('button:contains(Check Out)');
        click('button:contains(Return)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/patients/outpatient', 'Returned to Outpatient');
        assert.equal(find('.outpatient-list td:contains(Joe Bagadonuts)').length, 1, 'Checked in patient appears in list');
        click('button:contains(Check Out)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Check Out', 'Patient checkout confirmation displays');
        click('button:contains(Ok)');
        waitToAppear('.modal-title:contains(Patient Checked Out)');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Checked Out', 'Patient has been checked out confirmation');
        click('button:contains(Ok)');
      });
      andThen(function () {
        assert.equal(find('.outpatient-list td:contains(Joe Bagadonuts)').length, 0, 'Checked out patient no longer appears');
      });
    });
  });

  (0, _qunit.test)('Check In/Check Out new outpatient', function (assert) {
    runWithPouchDump('patient', function () {
      var visitDate = (0, _moment['default'])('2015-10-01');
      var visitLocation = 'Outpatient Followup';
      authenticateUser();
      visit('/patients/outpatient');
      andThen(function () {
        assert.equal(currentURL(), '/patients/outpatient', 'Outpatient url is correct');
        assert.equal(find('.view-current-title').text(), 'Today\'s Outpatients', 'Title is correct');
        click('button:contains(Patient Check In)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/visits/edit/checkin', 'Check In url is correct');
        typeAheadFillIn('.patient-name', 'Jane Bagadonuts');
      });
      andThen(function () {
        assert.equal(find('.new-patient-checkbox input:checked').length, 1, 'New Patient checkbox is checked');
        selectDate('.checkin-date input', visitDate.toDate());
        select('.visit-type', 'Followup');
        typeAheadFillIn('.visit-location', visitLocation);
      });
      andThen(function () {
        click('button:contains(Check In)');
        waitToAppear('.modal-title:contains(New Patient)');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'New Patient', 'New Patient dialog appears');
        click('.modal-footer button:contains(Add)');
        waitToAppear('.modal-title:contains(Patient Checked In)');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Checked In', 'Patient has been checked in');
        assert.equal(find('.modal-body').text().trim(), 'Jane Bagadonuts has been created and checked in.', 'Patient has been created and checked in');
        click('button:contains(Ok)');
      });
      andThen(function () {
        findWithAssert('button:contains(Check Out)');
        click('button:contains(Return)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/patients/outpatient', 'Returned to Outpatient');
        assert.equal(find('.outpatient-list td:contains(Jane Bagadonuts)').length, 0, 'Checked in patient does not appears in list because of date');
        selectDate('.outpatient-date input', visitDate.toDate());
        click('button:contains(Search)');
        waitToAppear('.view-current-title:contains(Outpatients for ' + visitDate.format('l') + ')');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Outpatients for ' + visitDate.format('l'), 'Title updates to specified date');
        waitToAppear('.outpatient-list td:contains(Jane Bagadonuts)');
      });
      andThen(function () {
        assert.equal(find('.outpatient-list td:contains(Jane Bagadonuts)').length, 1, 'Checked in patient appears with date filtered.');
        select('.outpatient-location', 'Hospital');
        click('button:contains(Search)');
      });
      andThen(function () {
        assert.equal(find('.outpatient-list td:contains(Jane Bagadonuts)').length, 0, 'Checked in patient does not appear because different location.');
        findWithAssert('.outpatient-location option:contains(' + visitLocation + ')');
        select('.outpatient-location', visitLocation);
        click('button:contains(Search)');
      });
      andThen(function () {
        assert.equal(find('.outpatient-list td:contains(Jane Bagadonuts)').length, 1, 'Checked in patient appears with date and location filtered.');
        visit('/patients');
      });
      andThen(function () {
        assert.equal(find('tr:last td:contains(Jane)').length, 1, 'New patient appears in patient listing.');
        click('tr:last td button:contains(Check Out)');
        waitToAppear('.view-current-title:contains(Edit Visit)');
      });
      andThen(function () {
        assert.equal(find('.view-current-title').text(), 'Edit Visit', 'Visit displays on checkout from patient listing');
        assert.equal(find('.patient-name .ps-info-data').text(), 'Jane Bagadonuts', 'Jane Bagadonuts patient record displays');
        click('button:contains(Check Out)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Checked Out', 'Patient has been checked out confirmation');
        click('button:contains(Ok)');
      });
      andThen(function () {
        var checkoutDate = (0, _moment['default'])();
        assert.equal(find('.checkout-date input').val(), checkoutDate.format('l h:mm A'), 'Check Out date properly set');
        visit('/patients/outpatient');
      });
      andThen(function () {
        assert.equal(find('.outpatient-list td:contains(Jane Bagadonuts)').length, 0, 'Checked out patient no longer appears');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/outpatient-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/outpatient-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/outpatient-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/patient-notes-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | patient notes', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('patient notes crud testing', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/patients/edit/new');
      andThen(function () {
        assert.equal(currentURL(), '/patients/edit/new');
        fillIn('.test-first-name input', 'John');
        fillIn('.test-last-name input', 'Doe');
      });
      andThen(function () {
        click('.panel-footer button:contains(Add)');
        waitToAppear('.message:contains(The patient record for John Doe has been saved)');
      });
      andThen(function () {
        assert.equal(find('.message').text(), 'The patient record for John Doe has been saved.');
        waitToAppear('.patient-summary');
      });
      andThen(function () {
        findWithAssert('.patient-summary');
        click('[data-test-selector=visits-tab]');
      });
      andThen(function () {
        findWithAssert('#visits');
        click('button:contains(New Visit)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/visits/edit/new', 'Now in add visiting information route');
        click('.panel-footer button:contains(Add)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Visit Saved', 'New visit has been saved');
        click('button:contains(Ok)');
      });
      andThen(function () {
        click('[data-test-selector=notes-tab]');
      });
      andThen(function () {
        assert.equal(find('button:contains(New Note)').length, 1, 'New Note button in visible');
        click('button:contains(New Note)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'New Note for John Doe', 'Notes modal appeared');
        fillIn('.test-note-content textarea', 'This is a note.');
        fillIn('.test-note-attribution input', 'Dr. Nick');
      });
      andThen(function () {
        click('.modal-footer button:contains(Add)');
        waitToDisappear('.modal-dialog');
        waitToAppear('#visit-notes table tr td:contains(This is a note.)');
      });
      andThen(function () {
        assert.equal(find('#visit-notes table tr td:contains(This is a note.)').length, 1, 'Successfully added note.');
        click('#visit-notes table tr td button:contains(Edit)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        fillIn('.test-note-content textarea', 'This is an updated note.');
      });
      andThen(function () {
        click('.modal-footer button:contains(Update)');
        waitToDisappear('.modal-dialog');
        waitToAppear('#visit-notes table tr td:contains(This is an updated note.)');
      });
      andThen(function () {
        assert.equal(find('#visit-notes table tr td:contains(This is an updated note.)').length, 1, 'Successfully updated note.');
        click('#visit-notes table tr td button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Note', 'Delete Note modal appeared');
        click('.modal-footer button:contains(Ok)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('#visit-notes table tr td:contains(This is an updated note.)').length, 0, 'Successfully deleted note.');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/patient-notes-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/patient-notes-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/patient-notes-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/patients-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | patients', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /patients route', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/patients');
      andThen(function () {
        assert.equal(currentURL(), '/patients');
        var noPatientsFound = find('[data-test-selector="no-patients-found"]');
        assert.equal(noPatientsFound.text().trim(), 'No patients found. Create a new patient record?', 'no records found');
        var newPatientButton = find('button:contains(+ new patient)');
        assert.equal(newPatientButton.length, 1, 'Add new patient button is visible');
      });
      click('button:contains(+ new patient)');
      andThen(function () {
        assert.equal(currentURL(), '/patients/edit/new');
      });
    });
  });

  (0, _qunit.test)('View reports tab', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/patients/reports');

      andThen(function () {
        var generateReportButton = find('button:contains(Generate Report)');
        assert.equal(currentURL(), '/patients/reports');
        assert.equal(generateReportButton.length, 1, 'Generate Report button is visible');
        var reportType = find('[data-test-selector="select-report-type"]');
        assert.equal(reportType.length, 1, 'Report type select is visible');
        assert.equal(reportType.find(':selected').text().trim(), 'Admissions Detail', 'Default value selected"');
      });
    });
  });

  var reportNames = ['Admissions Summary', 'Diagnostic Testing', 'Discharges Detail', 'Discharges Summary', 'Procedures Detail'];

  reportNames.forEach(function (reportName) {
    testSimpleReportForm(reportName);
    testExportReportName(reportName);
  });

  (0, _qunit.test)('View reports tab | Patient Status', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/patients/reports');
      select('[data-test-selector="select-report-type"] select', 'Patient Status');

      andThen(function () {
        var generateReportButton = find('button:contains(Generate Report)');
        assert.equal(currentURL(), '/patients/reports');
        assert.equal(generateReportButton.length, 1, 'Generate Report button is visible');
        var reportType = find('[data-test-selector="select-report-type"] select');
        assert.equal(reportType.length, 1, 'Report type select is visible');
        assert.equal(reportType.find(':selected').text().trim(), 'Patient Status', 'Default value selected"');
      });
    });
  });

  (0, _qunit.test)('Testing admitted patient', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      visit('/patients/admitted');
      andThen(function () {
        assert.equal(currentURL(), '/patients/admitted');
        assert.equal(find('.clickable').length, 1, 'One patient is listed');
      });

      click('button:contains(Discharge)');
      waitToAppear('.view-current-title:contains(Edit Visit)');
      andThen(function () {
        assert.equal(currentURL(), '/visits/edit/03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'should return visits/edit instead');
      });
      click('.panel-footer button:contains(Discharge)');
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Patient Discharged', 'Patient has been discharged');
      });

      click('button:contains(Ok)');
      visit('/patients/admitted');
      waitToAppear('.view-current-title:contains(Admitted Patients)');
      andThen(function () {
        assert.equal(find('.clickable').length, 0, 'No patient is listed');
      });
    });
  });

  (0, _qunit.test)('Adding a new patient record', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      visit('/patients/edit/new');
      andThen(function () {
        assert.equal(currentURL(), '/patients/edit/new');
      });

      fillIn('.test-first-name input', 'John');
      fillIn('.test-last-name input', 'Doe');
      click('.panel-footer button:contains(Add)');
      waitToAppear('.message:contains(The patient record for John Doe has been saved)');
      andThen(function () {
        assert.equal(find('.message').text().trim(), 'The patient record for John Doe has been saved.');
      });

      waitToAppear('.patient-summary');

      andThen(function () {
        findWithAssert('.patient-summary');
      });
      andThen(function () {
        findWithAssert('#general');
      });
    });
  });

  (0, _qunit.test)('Delete a patient record', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      visit('/patients');
      andThen(function () {
        assert.equal(currentURL(), '/patients', 'Patient listing url is correct');
        assert.equal(find('tr.clickable td:contains(Joe)').length, 1, 'One patient exists to delete.');
        click('tr.clickable button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Patient', 'Delete Patient ');
        assert.equal(find('.modal-body').text().trim(), 'Are you sure you wish to delete Joe Bagadonuts?', 'Patient information appears in modal');
        click('.modal-footer button:contains(Delete)');
        waitToDisappear('.modal-dialog');
        waitToDisappear('tr.clickable td:contains(Joe)');
      });
      andThen(function () {
        assert.equal(find('tr.clickable td:contains(Joe)').length, 0, 'Patient has been successfully deleted.');
      });
    });
  });

  function testSimpleReportForm(reportName) {
    (0, _qunit.test)('View reports tab | ' + reportName + ' shows start and end dates', function (assert) {
      runWithPouchDump('default', function () {
        authenticateUser();
        visit('/patients/reports');
        select('[data-test-selector="select-report-type"] select', reportName);

        andThen(function () {
          var reportStartDate = find('[data-test-selector="select-report-start-date"]');
          var reportEndDate = find('[data-test-selector="select-report-end-date"]');
          assert.equal(reportStartDate.length, 1, 'Report start date select is visible');
          assert.equal(reportEndDate.length, 1, 'Report end date select is visible');
          var reportType = find('[data-test-selector="select-report-type"] select');
          assert.equal(reportType.find(':selected').text().trim(), reportName, reportName + ' option selected');
        });
      });
    });
  }

  function testExportReportName(reportName) {
    (0, _qunit.test)('View reports tab | Export reports name for ' + reportName + ' shows report name, start and end dates', function (assert) {
      runWithPouchDump('default', function () {
        authenticateUser();
        visit('/patients/reports');
        select('[data-test-selector="select-report-type"] select', reportName);

        andThen(function () {
          assert.equal(currentURL(), '/patients/reports');
        });

        fillIn('[data-test-selector="select-report-start-date"] input', '12/11/2016');
        fillIn('[data-test-selector="select-report-end-date"] input', '12/31/2016');

        click('button:contains(Generate Report)');
        waitToAppear('.panel-title');

        andThen(function () {
          var exportReportButton = findWithAssert('a:contains(Export Report)');
          assert.equal($(exportReportButton).attr('download'), reportName + ' Report 12/11/2016 - 12/31/2016.csv');
        });
      });
    });
  }
});
define('hospitalrun/tests/acceptance/patients-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/patients-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/patients-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/pricing-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  function verifyPricingLists(path, includesPrices, excludesPrices, assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit(path);
      andThen(function () {
        assert.equal(currentURL(), path);
        includesPrices.forEach(function (priceName) {
          assert.equal(find('.price-name:contains(' + priceName + ')').length, 1, priceName + ' displays');
        });
        excludesPrices.forEach(function (priceName) {
          assert.equal(find('.price-name:contains(' + priceName + ')').length, 0, priceName + ' is not present');
        });
      });
    });
  }

  (0, _qunit.module)('Acceptance | pricing', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /pricing', function (assert) {
    var includesPrices = ['Xray Hand', 'Blood test', 'Leg Casting', 'Gauze pad'];
    verifyPricingLists('/pricing', includesPrices, [], assert);
  });

  (0, _qunit.test)('visiting /pricing/imaging', function (assert) {
    var excludesPrices = ['Blood test', 'Leg Casting', 'Gauze pad'];
    var includesPrices = ['Xray Hand'];
    verifyPricingLists('/pricing/imaging', includesPrices, excludesPrices, assert);
  });

  (0, _qunit.test)('visiting /pricing/lab', function (assert) {
    var excludesPrices = ['Xray Hand', 'Leg Casting', 'Gauze pad'];
    var includesPrices = ['Blood test'];
    verifyPricingLists('/pricing/lab', includesPrices, excludesPrices, assert);
  });

  (0, _qunit.test)('visiting /pricing/procedure', function (assert) {
    var excludesPrices = ['Xray Hand', 'Blood test', 'Gauze pad'];
    var includesPrices = ['Leg Casting'];
    verifyPricingLists('/pricing/procedure', includesPrices, excludesPrices, assert);
  });

  (0, _qunit.test)('visiting /pricing/ward', function (assert) {
    var excludesPrices = ['Xray Hand', 'Blood test', 'Leg Casting'];
    var includesPrices = ['Gauze pad'];
    verifyPricingLists('/pricing/ward', includesPrices, excludesPrices, assert);
  });

  (0, _qunit.test)('create new price', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/pricing/edit/new');
      andThen(function () {
        assert.equal(currentURL(), '/pricing/edit/new');
        fillIn('.price-name input', 'Xray Foot');
        fillIn('.price-amount input', 100);
        fillIn('.price-department input', 'Imaging');
        select('.price-category', 'Imaging');
        click('button:contains(Add):last');
        waitToAppear('.modal-dialog');
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'Pricing Item Saved', 'Pricing Item saved');
          click('button:contains(Ok)');
        });
        andThen(function () {
          click('button:contains(Add Override)');
          waitToAppear('.modal-dialog');
        });
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'Add Override', 'Add Override Dialog displays');
          select('.pricing-profile', 'Half off');
          fillIn('.pricing-override-price input', 20);
        });
        andThen(function () {
          click('button:contains(Add):last');
          waitToAppear('.override-profile');
        });
        andThen(function () {
          assert.equal(find('.override-profile').text(), 'Half off', 'Pricing override saved');
        });
      });
    });
  });

  (0, _qunit.test)('delete price', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/pricing/lab');
      andThen(function () {
        assert.equal(currentURL(), '/pricing/lab');
        assert.equal(find('.price-name:contains(Blood test)').length, 1, 'Price exists to delete');
        click('button:contains(Delete)');
      });
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.alert').text().trim(), 'Are you sure you wish to delete Blood test?', 'Pricing item is displayed for deletion');
      });
      click('button:contains(Delete):last');
      waitToDisappear('.price-name:contains(Blood test)');
      andThen(function () {
        assert.equal(find('.price-name:contains(Blood test)').length, 0, 'Price disappears from price list');
      });
    });
  });

  (0, _qunit.test)('create new pricing profile', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/pricing/profiles');
      andThen(function () {
        assert.equal(currentURL(), '/pricing/profiles');
        click('button:contains(+ new item)');
        waitToAppear('.modal-dialog');
        andThen(function () {
          assert.equal(find('.modal-title').text(), 'New Pricing Profile', 'New Pricing Profile modal appears');
        });
        fillIn('.pricing-profile-name input', 'Quarter Off');
        fillIn('.pricing-profile-percentage input', 25);
        fillIn('.pricing-profile-discount input', 10);
        andThen(function () {
          click('button:contains(Add)');
        });
        waitToAppear('.modal-title:contains(Pricing Profile Saved)');
        click('button:contains(Ok)');
        waitToAppear('.pricing-profile-name:contains(Quarter Off)');
        andThen(function () {
          assert.equal(find('.pricing-profile-name:contains(Quarter Off)').text(), 'Quarter Off', 'New price profile displays');
        });
      });
    });
  });

  (0, _qunit.test)('delete pricing profile', function (assert) {
    runWithPouchDump('billing', function () {
      authenticateUser();
      visit('/pricing/profiles');
      andThen(function () {
        assert.equal(currentURL(), '/pricing/profiles');
        assert.equal(find('.pricing-profile-name:contains(Half off)').length, 1, 'Pricing profile exists to delete');
        click('button:contains(Delete)');
      });
      waitToAppear('.modal-dialog');
      andThen(function () {
        assert.equal(find('.modal-title').text().trim(), 'Delete Profile', 'Pricing Profile delete confirmation is displayed');
      });
      click('button:contains(Ok)');
      waitToDisappear('.pricing-profile-name:contains(Half off)');
      andThen(function () {
        assert.equal(find('.pricing-profile-name:contains(Half off)').length, 0, 'Pricing profile disappears from list');
      });
    });
  });
});
define('hospitalrun/tests/acceptance/pricing-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/pricing-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/pricing-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/procedure-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  (0, _qunit.module)('Acceptance | procedures', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  testWithVisit('Add procedure', function (assert) {
    var procedureDesc = 'Release Left Elbow Bursa and Ligament, Percutaneous Approach';
    assert.equal(find('#visit-procedures tr').length, 2, 'One procedure is listed for the visit');
    click('button:contains(New Procedure)');
    andThen(function () {
      typeAheadFillIn('.procedure-description', procedureDesc);
      typeAheadFillIn('.procedure-physician', 'Dr Jones');
      updateProcedure(assert, 'Add');
    });
    andThen(function () {
      click('button:contains(Return)');
    });
    andThen(function () {
      assert.equal(find('#visit-procedures tr').length, 3, 'Two procedure are listed for the visit');
      assert.equal(find('#visit-procedures td:contains(' + procedureDesc + ')').length, 1, 'New procedure description is listed for the visit');
    });
  });

  testWithVisit('Edit procedure', function (assert) {
    click('#visit-procedures button:contains(Edit)');
    andThen(function () {
      assert.equal(currentURL(), '/visits/procedures/edit/398B4F58-152F-1476-8ED1-329C4D85E25F', 'Procedure url is correct');
      fillIn('.procedure-notes', 'Abdominals blood glucose level blood pressure carbohydrate medications');
    });
    andThen(function () {
      click('button:contains(Add Item)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Add Charge Item', 'Add Charge Item modal appears');
      typeAheadFillIn('.charge-item-name', 'Gauze pad');
      click('.modal-footer button:contains(Add)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
      waitToAppear('td.charge-item-name:contains(Gauze pad)');
    });
    andThen(function () {
      assert.equal(find('td.charge-item-name:contains(Gauze pad)').length, 1, 'New charge item appears');
      click('.charge-items tr:last button:contains(Edit)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Edit Charge Item', 'Edit Charge Item modal appears');
      typeAheadFillIn('.charge-item-name', 'Gauze padding');
    });
    andThen(function () {
      click('.modal-footer button:contains(Update)');
    });
    andThen(function () {
      waitToAppear('td.charge-item-name:contains(Gauze padding)');
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('td.charge-item-name:contains(Gauze padding)').length, 1, 'Updated charge item appears');
      assert.equal(find('.medication-charges tr').length, 2, 'One medication charge exists');
      assert.equal(find('.medication-charges button:contains(Add Medication)').length, 1, 'Add medication button exists');
      click('button:contains(Add Medication)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Add Medication Used', 'Add Medication Used modal appears');
      typeAheadFillIn('.medication-used', 'Cefazolin 500mg vial (Hazolin) - m00001 (999998 available)');
      waitToDisappear('.disabled-btn:contains(Add)');
    });
    andThen(function () {
      click('.modal-footer button:contains(Add)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      updateProcedure(assert, 'Update');
    });
    andThen(function () {
      assert.equal(find('.medication-charges td:contains(Cefazolin 500mg vial)').length, 2, 'Two medication charges exists');
      click('.medication-charges button:contains(Edit):first');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Edit Medication Used', 'Edit Medication Used modal appears here');
      fillIn('.medication-quantity input', 2);
      click('.modal-footer button:contains(Update)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
      waitToAppear('.medication-charge-quantity:contains(2)');
    });
    andThen(function () {
      assert.equal(find('.medication-charge-quantity:first').text(), '2', 'Updated medication quantity appears');
      updateProcedure(assert, 'Update');
    });
    andThen(function () {
      click('.charge-items tr:last button:contains(Delete)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Delete Charge Item', 'Delete Charge Item dialog displays');
      click('.modal-footer button:contains(Ok)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
      waitToDisappear('.charge-items tr:last button:contains(Delete)');
    });
    andThen(function () {
      click('.medication-charges tr:last button:contains(Delete)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Delete Medication Used', 'Delete Medication Used dialog displays');
      click('.modal-footer button:contains(Ok)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      updateProcedure(assert, 'Update');
    });
    andThen(function () {
      waitToAppear('button:contains(Return)');
    });
    andThen(function () {
      click('button:contains(Return)');
    });
    andThen(function () {
      click('#visit-procedures button:contains(Edit)');
    });
    andThen(function () {
      assert.equal(currentURL(), '/visits/procedures/edit/398B4F58-152F-1476-8ED1-329C4D85E25F', 'Returned back to procedure');
      assert.equal(find('td.charge-item-name').length, 0, 'Charge item is deleted');
      assert.equal(find('.medication-charges tr').length, 2, 'Medication used is deleted');
    });
  });

  testWithVisit('Delete procedure', function (assert) {
    assert.equal(find('#visit-procedures tr').length, 2, 'One procedure is displayed to delete');
    click('#visit-procedures button:contains(Delete)');
    waitToAppear('.modal-dialog');
    andThen(function () {});
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Delete Procedure', 'Delete Procedure confirmation displays');
      click('.modal-footer button:contains(Delete)');
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('#visit-procedures tr').length, 1, 'Procedure is deleted');
    });
  });

  function testWithVisit(testLabel, testFunction) {
    (0, _qunit.test)(testLabel, function (assert) {
      runWithPouchDump('patient', function () {
        authenticateUser();
        visit('/patients');
        andThen(function () {
          assert.equal(currentURL(), '/patients', 'Patient url is correct');
          click('button:contains(Edit)');
        });
        andThen(function () {
          assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient record displays');
          click('[data-test-selector=visits-tab]');
          waitToAppear('#visits button:contains(Edit)');
        });
        andThen(function () {
          click('#visits button:contains(Edit)');
        });
        andThen(function () {
          assert.equal(currentURL(), '/visits/edit/03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'Visit url is correct');
          testFunction(assert);
        });
      });
    });
  }

  function updateProcedure(assert, buttonText) {
    andThen(function () {
      click('.panel-footer button:contains(' + buttonText + ')');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Procedure Saved', 'Procedure Saved dialog displays');
      click('button:contains(Ok)');
    });
  }
});
define('hospitalrun/tests/acceptance/procedure-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/procedure-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/procedure-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/role-test', ['exports', 'ember', 'qunit', 'hospitalrun/tests/helpers/start-app', 'hospitalrun/mixins/user-roles'], function (exports, _ember, _qunit, _hospitalrunTestsHelpersStartApp, _hospitalrunMixinsUserRoles) {
  'use strict';

  (0, _qunit.module)('Acceptance | roles', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /admin/roles', function (assert) {
    runWithPouchDump('admin', function () {
      authenticateUser();
      visit('/admin/roles');
      andThen(function () {
        assert.equal(currentURL(), '/admin/roles');
        select('.role-select', 'Doctor');
      });
      andThen(function () {
        assert.equal(find('.checkbox-appointments input:checked').length, 0, 'Appointments checkbox is not checked');
        assert.equal(find('.checkbox-addAppointment input:checked').length, 0, 'Add appointments checkbox is not checked');
      });
      click('.checkbox-appointments input');
      click('.checkbox-addAppointment input');
      andThen(function () {
        assert.equal(find('.checkbox-appointments input:checked').length, 1, 'Appointments checkbox is checked');
        assert.equal(find('.checkbox-addAppointment input:checked').length, 1, 'Add appointments checkbox is checked');
        click('button:contains(Update)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Role Saved', 'Role has been saved');
        assert.equal(find('.modal-body').text().trim(), 'The Doctor role has been saved.', 'Doctor role has been saved');
        click('button:contains(Ok)');
        invalidateSession();
        visit('/login');
      });
      andThen(function () {
        authenticateUser({
          name: 'doctor@hospitalrun.io',
          roles: ['Doctor', 'user'],
          role: 'Doctor',
          prefix: 'p1'
        });
      });
      visit('/appointments/edit/new');
      andThen(function () {
        assert.equal(currentURL(), '/appointments/edit/new', 'Doctor can now navigate to new appointments');
        assert.equal(find('.view-current-title').text(), 'New Appointment', 'New appointment screen displays');
      });
    });
  });

  _hospitalrunMixinsUserRoles.PREDEFINED_USER_ROLES.forEach(function (role) {
    if (role.defaultRoute && role.name !== 'User Administrator') {
      (0, _qunit.test)('Testing User Role homescreen for ' + role.name, function (assert) {
        runWithPouchDump('default', function () {
          authenticateUser({
            roles: role.roles,
            role: role.name,
            authenticated: {
              role: role.name
            }
          });
          visit('/');
          waitToAppear('.view-current-title');
          andThen(function () {
            var defaultURL = role.defaultRoute.replace('.index', '');
            if (defaultURL === 'users') {
              defaultURL = 'admin/users';
            }
            assert.equal(currentURL(), '/' + defaultURL, 'Correct homepage displays for role ' + role.name);
            invalidateSession();
          });
        });
      });
    }
  });
});
define('hospitalrun/tests/acceptance/role-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/role-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/role-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/users-test', ['exports', 'ember', 'ember-cli-fake-server', 'pouchdb', 'npm:pouchdb-adapter-memory', 'hospitalrun/tests/helpers/start-app', 'hospitalrun/mixins/user-roles', 'qunit'], function (exports, _ember, _emberCliFakeServer, _pouchdb, _npmPouchdbAdapterMemory, _hospitalrunTestsHelpersStartApp, _hospitalrunMixinsUserRoles, _qunit) {
  'use strict';

  var MOCK_USER_DATA = [{
    'id': 'org.couchdb.user:hradmin',
    'key': 'org.couchdb.user:hradmin',
    'value': { 'rev': '1-242f3d5b5eb8596144f8a6300f9f5a2f' },
    'doc': {
      '_id': 'org.couchdb.user:hradmin',
      '_rev': '1-242f3d5b5eb8596144f8a6300f9f5a2f',
      'password_scheme': 'pwdscheme',
      'iterations': 10,
      'name': 'hradmin',
      'roles': ['System Administrator', 'admin', 'user'],
      'type': 'user',
      'userPrefix': 'p',
      'derived_key': 'derivedkeyhere',
      'salt': 'saltgoeshere',
      'displayName': 'HospitalRun Administrator',
      'email': 'hradmin@hospitalrun.io'
    }
  }, {
    'id': 'org.couchdb.user:joe@donuts.com',
    'key': 'org.couchdb.user:joe@donuts.com',
    'value': {
      'rev': '1-ef3d54502f2cc8e8f73d8547881f0836'
    },
    'doc': {
      '_id': 'org.couchdb.user:joe@donuts.com',
      '_rev': '1-ef3d54502f2cc8e8f73d8547881f0836',
      'password_scheme': 'pbkdf2',
      'iterations': 10,
      'displayName': 'Joe Bagadonuts',
      'email': 'joe@donuts.com',
      'name': 'joe@donuts.com',
      'roles': ['Hospital Administrator', 'user'],
      'userPrefix': 'p01',
      'type': 'user',
      'derived_key': 'derivedkeyhere',
      'salt': 'saltgoeshere'
    }
  }];

  var RSVP = _ember['default'].RSVP;

  function addAllUsers(assert) {
    if (window.ELECTRON) {
      return _addOfflineUsers();
    }
    (0, _emberCliFakeServer.stubRequest)('get', '/db/_users/_all_docs', function (request) {
      var expectedQuery = {
        include_docs: 'true',
        startkey: '"org.couchdb.user"'
      };
      assert.equal(JSON.stringify(request.queryParams), JSON.stringify(expectedQuery), 'All Users request sent to the server');
      request.ok({
        'total_rows': 1,
        'offset': 1,
        'rows': MOCK_USER_DATA
      });
    });
    return RSVP.resolve();
  }

  function _addOfflineUsers() {
    return wait().then(function () {
      _pouchdb['default'].plugin(_npmPouchdbAdapterMemory['default']);
      var usersDB = new _pouchdb['default']('_users', {
        adapter: 'memory'
      });
      var joeUser = MOCK_USER_DATA[1];
      // hradmin already added by run-with-pouch-dump
      delete joeUser.doc._rev;
      return usersDB.put(joeUser.doc);
    });
  }

  (0, _qunit.module)('Acceptance | users', {
    beforeEach: function beforeEach() {
      _emberCliFakeServer['default'].start();
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _emberCliFakeServer['default'].stop();
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('visiting /admin/users', function (assert) {
    runWithPouchDump('default', function () {
      var role = _hospitalrunMixinsUserRoles.PREDEFINED_USER_ROLES.findBy('name', 'User Administrator');
      authenticateUser({
        roles: role.roles,
        role: role.name,
        authenticated: {
          role: role.name
        }
      });
      addAllUsers(assert);
      andThen(function () {
        visit('/'); // Default home page for User Administrator is admin/users
        andThen(function () {
          assert.equal(currentURL(), '/admin/users', 'User Administrator initial page displays');
          assert.equal(find('td.user-display-name:first').text(), 'HospitalRun Administrator');
          assert.equal(find('td.user-name:first').text(), 'hradmin');
          assert.equal(find('td.user-email:first').text(), 'hradmin@hospitalrun.io');
          assert.equal(find('td.user-role:first').text(), 'System Administrator');
        });
      });
    });
  });

  (0, _qunit.test)('create new user', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      addAllUsers(assert);
      andThen(function () {
        visit('/admin/users');
        (0, _emberCliFakeServer.stubRequest)('put', '/db/_users/org.couchdb.user:jane@donuts.com', function (request) {
          var expectedBody = {
            _id: 'org.couchdb.user:jane@donuts.com',
            deleted: false,
            displayName: 'Jane Bagadonuts',
            email: 'jane@donuts.com',
            name: 'jane@donuts.com',
            password: 'password',
            roles: ['Hospital Administrator', 'user'],
            userPrefix: 'p02',
            type: 'user'
          };
          assert.equal(request.requestBody, JSON.stringify(expectedBody), 'New user data sent to the server');
          request.ok({
            'ok': true,
            'id': 'org.couchdb.user:jane@donuts.com',
            'rev': '1-ef3d54502f2cc8e8f73d8547881f0836'
          });
        });

        visit('/admin/users/edit/new');
        andThen(function () {
          select('.user-role', 'Hospital Administrator');
          fillIn('.user-display-name input', 'Jane Bagadonuts');
          fillIn('.user-email input', 'jane@donuts.com');
          fillIn('.user-password input', 'password');
          click('button:contains(Add)');
          waitToAppear('.modal-dialog');
          andThen(function () {
            assert.equal(find('.modal-title').text(), 'User Saved', 'User was saved successfully');
            assert.equal(find('.view-current-title').text(), 'Edit User', 'Page title changed to Edit User');
          });
          click('button:contains(Ok)');
        });
      });
    });
  });

  (0, _qunit.test)('delete user', function (assert) {
    runWithPouchDump('default', function () {
      authenticateUser();
      addAllUsers(assert);
      andThen(function () {
        (0, _emberCliFakeServer.stubRequest)('put', '/db/_users/org.couchdb.user:joe@donuts.com', function (request) {
          var expectedBody = {
            _id: 'org.couchdb.user:joe@donuts.com',
            derived_key: 'derivedkeyhere',
            deleted: true,
            displayName: 'Joe Bagadonuts',
            email: 'joe@donuts.com',
            iterations: 10,
            name: 'joe@donuts.com',
            password_scheme: 'pbkdf2',
            _rev: '1-ef3d54502f2cc8e8f73d8547881f0836',
            roles: ['deleted'],
            salt: 'saltgoeshere',
            userPrefix: 'p01',
            type: 'user'
          };
          assert.equal(request.requestBody, JSON.stringify(expectedBody), 'Delete user request sent to the server');
          request.ok({
            'ok': true,
            'id': 'org.couchdb.user:joe@donuts.com',
            'rev': '1-ef3d54502f2cc8e8f73d8547881f0836'
          });
        });

        visit('/admin/users');
        andThen(function () {
          click('button:contains(Delete):last');
          waitToAppear('.modal-dialog');
          andThen(function () {
            assert.equal(find('.alert').text().trim(), 'Are you sure you wish to delete ?', 'User is displayed for deletion');
          });
          click('button:contains(Delete):last');
          andThen(function () {
            assert.equal(find('.user-email:contains(joe@donuts.com)').length, 0, 'User disappears from user list');
          });
        });
      });
    });
  });
});
define('hospitalrun/tests/acceptance/users-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/users-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/users-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/acceptance/visit-test', ['exports', 'ember', 'moment', 'qunit', 'hospitalrun/tests/helpers/start-app'], function (exports, _ember, _moment, _qunit, _hospitalrunTestsHelpersStartApp) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;

  var visitData = {
    outPatient: {
      LOCATION: 'Springfield Hospital',
      EXAMINER: 'Sarah Kearney',
      PRIMARY_DIAGNOSIS: 'ACL deficient knee, right',
      SECONDARY_DIAGNOSIS: 'ACL deficient knee, left',
      OPERATION_DESCRIPTION: 'Describe Operation here',
      PROCEDURE_SPLINT: 'application of long arm post splint',
      ADMISSION_INSTRUCTIONS: 'Admission Instructions here',
      OPD_PROCEDURE_DESCRIPTION: 'Bilateral knee Release',
      OPD_PROCEDURE_PHYSICIAN: 'Sarah Kearney',
      LAB_TYPE: 'Cholesterol',
      IMAGING_TYPE: 'Cervical Spine AP-L',
      APPOINTMENT_START_DATE: (0, _moment['default'])().add(7, 'days').format('l h:mm A'),
      APPOINTMENT_END_DATE: (0, _moment['default'])().add(8, 'days').format('l h:mm A'),
      NOTE_CONTENT: 'OPD notes are entered here'
    },
    admission: {
      EXAMINER: 'Drederick Willie',
      NOTE_CONTENT: 'Patient notes are entered here'
    }
  };

  (0, _qunit.module)('Acceptance | visits', {
    beforeEach: function beforeEach() {
      this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();
    },

    afterEach: function afterEach() {
      _ember['default'].run(this.application, 'destroy');
    }
  });

  (0, _qunit.test)('Add admission visit', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      addVisit(assert);
      andThen(function () {
        addAdmissionData(assert);
      });
      andThen(function () {
        newReport(assert, 'Discharge');
      });
      andThen(function () {
        checkDischargeReport(assert);
      });
      andThen(function () {
        saveReport(assert, 'Discharge');
      });
      andThen(function () {
        viewReport(assert, 'Discharge');
      });
    });
  });

  (0, _qunit.test)('Add OPD visit', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      addVisit(assert, 'Clinic');
      andThen(function () {
        addOutpatientData(assert);
      });
      andThen(function () {
        newReport(assert, 'OPD');
      });
      andThen(function () {
        checkOPDReport(assert);
      });
      andThen(function () {
        saveReport(assert, 'OPD');
      });
      andThen(function () {
        viewReport(assert, 'OPD');
      });
    });
  });

  (0, _qunit.test)('Edit visit', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      visit('/patients');
      andThen(function () {
        assert.equal(currentURL(), '/patients', 'Patient url is correct');
        click('button:contains(Edit)');
      });
      andThen(function () {
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient record displays');
        click('[data-test-selector=visits-tab]');
        waitToAppear('#visits button:contains(Edit)');
      });
      andThen(function () {
        click('#visits button:contains(Edit)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/visits/edit/03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'Visit url is correct');
        click('a:contains(Add Allergy)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Allergy', 'Add Allergy dialog displays');
        fillIn('.test-allergy input', 'Oatmeal');
        click('.modal-footer button:contains(Add)');
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('a.allergy-button:contains(Oatmeal)').length, 1, 'New allergy appears');
        click('a:contains(Add Diagnosis)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Add Diagnosis', 'Add Diagnosis dialog displays');
        fillIn('.diagnosis-text input', 'Broken Arm');
        click('.modal-footer button:contains(Add)');
        waitToAppear('a.primary-diagnosis');
      });
      andThen(function () {
        assert.equal(find('a.primary-diagnosis:contains(Broken Arm)').length, 1, 'New primary diagnosis appears');
        click('button:contains(New Medication)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/medication/edit/new?forVisitId=03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'New medication url is correct');
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'New medication prepopulates with patient');
        click('button:contains(Cancel)');
      });
      andThen(function () {
        click('button:contains(New Lab)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/labs/edit/new?forVisitId=03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'New lab url is correct');
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'New lab prepopulates with patient');
        click('button:contains(Cancel)');
      });
      andThen(function () {
        click('button:contains(New Imaging)');
      });
      andThen(function () {
        assert.equal(currentURL(), '/imaging/edit/new?forVisitId=03C7BF8B-04E0-DD9E-9469-96A5604F5340', 'New imaging url is correct');
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'New imaging prepopulates with patient');
        click('button:contains(Cancel)');
      });
      andThen(function () {
        click('button:contains(New Vitals)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        fillIn('.temperature-text input', '34.56');
        fillIn('.weight-text input', '34.56');
        fillIn('.height-text input', '34.56');
        fillIn('.sbp-text input', '34.56');
        fillIn('.dbp-text input', '34.56');
        fillIn('.heart-rate-text input', '34.56');
        fillIn('.respiratory-rate-text input', '34.56');
        click('.modal-footer button:contains(Add)');
        waitToAppear('#visit-vitals tr:last td:contains(34.56)');
      });
      andThen(function () {
        assert.equal(find('#visit-vitals tr:last td:contains(34.56)').length, 7, 'New vitals appears');
        click('button:contains(Add Item)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        typeAheadFillIn('.charge-item-name', 'Gauze pad');
        click('.modal-footer button:contains(Add)');
      });
      andThen(function () {
        waitToDisappear('.modal-dialog');
        waitToAppear('td.charge-item-name');
      });
      andThen(function () {
        assert.equal(find('td.charge-item-name').text(), 'Gauze pad', 'New charge item appears');
      });
      andThen(function () {
        updateVisit(assert, 'Update');
      });
      andThen(function () {
        click('a.primary-diagnosis:contains(Broken Arm)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Edit Diagnosis', 'Edit Diagnosis modal appears');
        assert.equal(find('.modal-footer button:contains(Delete)').length, 1, 'Delete button appears');
      });
      andThen(function () {
        click('.modal-footer button:contains(Delete)');
      });
      andThen(function () {
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        click('#visit-vitals tr:last button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Vitals', 'Delete Vitals dialog displays');
        click('.modal-footer button:contains(Delete)');
        click('[data-test-selector=charges-tab]');
      });
      andThen(function () {
        click('.charge-items tr:last button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Charge Item', 'Delete Charge Item dialog displays');
        click('.modal-footer button:contains(Ok)');
      });
      andThen(function () {
        waitToDisappear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('a.primary-diagnosis:contains(Broken Arm)').length, 0, 'New primary diagnosis is deleted');
        assert.equal(find('#visit-vitals tr:last td:contains(34.56)').length, 0, 'Vital is deleted');
        assert.equal(find('td.charge-item-name').length, 0, 'Charge item is deleted');
      });
    });
  });

  (0, _qunit.test)('Delete visit', function (assert) {
    runWithPouchDump('patient', function () {
      authenticateUser();
      visit('/patients');
      andThen(function () {
        assert.equal(currentURL(), '/patients', 'Patient url is correct');
        click('button:contains(Edit)');
      });
      andThen(function () {
        assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient record displays');
        click('[data-test-selector=visits-tab]');
        waitToAppear('#visits button:contains(Delete)'); // Make sure visits have been retrieved.
      });
      andThen(function () {
        assert.equal(find('#visits tr').length, 2, 'One visit is displayed to delete');
        click('#visits button:contains(Delete)');
        waitToAppear('.modal-dialog');
      });
      andThen(function () {
        assert.equal(find('.modal-title').text(), 'Delete Visit', 'Delete Visit confirmation displays');
        click('.modal-footer button:contains(Delete)');
      });
      andThen(function () {
        waitToDisappear('.modal-dialog');
        waitToDisappear('#visits td:contains(Fall from in-line roller-skates, initial encounter)');
      });
      andThen(function () {
        assert.equal(find('#visits tr').length, 1, 'Visit is deleted');
      });
    });
  });

  function addVisit(assert, type) {
    visit('/patients');
    andThen(function () {
      assert.equal(currentURL(), '/patients', 'Patient url is correct');
      click('button:contains(Edit)');
    });
    andThen(function () {
      assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient record displays');
      click('[data-test-selector=visits-tab]');
      waitToAppear('#visits button:contains(Edit)');
    });
    andThen(function () {
      click('#visits button:contains(New Visit)');
      waitToAppear('#visit-info');
    });
    andThen(function () {
      assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts displays as patient for visit');
      updateVisit(assert, 'Add', type);
    });
  }

  function addOutpatientData(assert) {
    typeAheadFillIn('.visit-location', visitData.outPatient.LOCATION);
    typeAheadFillIn('.visit-examiner', visitData.outPatient.EXAMINER);
    andThen(function () {
      click('a:contains(Add Diagnosis)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Add Diagnosis', 'Add Diagnosis dialog displays');
      fillIn('.diagnosis-text input', visitData.outPatient.PRIMARY_DIAGNOSIS);
      click('.modal-footer button:contains(Add)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      click('a:contains(Add Diagnosis)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Add Diagnosis', 'Add Diagnosis dialog displays');
      fillIn('.diagnosis-text input', visitData.outPatient.SECONDARY_DIAGNOSIS);
      click('.secondary-diagnosis input');
    });
    andThen(function () {
      click('.modal-footer button:contains(Add)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
      waitToAppear('a.secondary-diagnosis:contains(' + visitData.outPatient.SECONDARY_DIAGNOSIS + ')');
    });
    andThen(function () {
      click('a:contains(Add Operative Plan)');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('/patients/operative-plan/new?forVisitId') > -1, 'New operative plan URL is visited');
      assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Joe Bagadonuts patient header displays');
      assert.equal(find('.view-current-title').text(), 'New Operative Plan', 'New operative plan title is correct');
      fillIn('.operation-description textarea', visitData.outPatient.OPERATION_DESCRIPTION);
      typeAheadFillIn('.procedure-description', visitData.outPatient.PROCEDURE_SPLINT);
      click('button:contains(Add Procedure)');
      waitToAppear('.procedure-listing td.procedure-description');
      fillIn('.admission-instructions textarea', visitData.outPatient.ADMISSION_INSTRUCTIONS);
    });
    updateVisitData(assert, 'Plan Saved');
    andThen(function () {
      click('[data-test-selector=procedures-tab]');
      waitToAppear('[data-test-selector=new-procedure-btn]');
      assert.equal(find('[data-test-selector=new-procedure-btn]').text().trim(), 'New Procedure', 'New Procedure button displayed');
      click('[data-test-selector=new-procedure-btn]');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/procedures/edit/new?forVisitId') > -1, 'New Procedures URL is visited');
      typeAheadFillIn('.procedure-description', visitData.outPatient.OPD_PROCEDURE_DESCRIPTION);
      typeAheadFillIn('.procedure-physician', visitData.outPatient.OPD_PROCEDURE_PHYSICIAN);
    });
    updateVisitData(assert, 'Procedure Saved');
    andThen(function () {
      click('button:contains(New Lab)');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('/labs/edit/new?forVisitId') > -1, 'New Lab URL is visited');
      typeAheadFillIn('.test-lab-type', visitData.outPatient.LAB_TYPE);
    });
    updateVisitData(assert, 'Lab Request Saved');
    andThen(function () {
      click('button:contains(New Imaging)');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('/imaging/edit/new?forVisitId') > -1, 'New Imaging URL is visited');
      typeAheadFillIn('.imaging-type-input', visitData.outPatient.IMAGING_TYPE);
    });
    updateVisitData(assert, 'Imaging Request Saved');
    andThen(function () {
      click('button:contains(New Appointment)');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('/appointments/edit/new?forVisitId') > -1, 'New Appointment URL is visited');
      click('.appointment-all-day input');
      fillIn('.test-appointment-start input', visitData.outPatient.APPOINTMENT_START_DATE);
      fillIn('.test-appointment-end input', visitData.outPatient.APPOINTMENT_END_DATE);
    });
    updateVisitData(assert, 'Appointment Saved');
    andThen(function () {
      click('[data-test-selector=notes-tab]');
      waitToAppear('[data-test-selector=new-note-btn]');
      click('[data-test-selector=new-note-btn]');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'New Note for Joe Bagadonuts', 'New Note dialog displays');
      fillIn('.test-note-content textarea', visitData.outPatient.NOTE_CONTENT);
      click('.modal-footer button:contains(Add)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/edit/') > -1, 'Returns back to visit URL');
    });
  }

  function addAdmissionData(assert) {
    typeAheadFillIn('.visit-examiner', visitData.admission.EXAMINER);
    andThen(function () {
      click('[data-test-selector=notes-tab]');
      waitToAppear('[data-test-selector=new-note-btn]');
      click('[data-test-selector=new-note-btn]');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'New Note for Joe Bagadonuts', 'New Note dialog displays');
      fillIn('.test-note-content textarea', visitData.admission.NOTE_CONTENT);
      click('.modal-footer button:contains(Add)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/edit/') > -1, 'Returns back to visit URL');
    });
  }

  function newReport(assert, type) {
    andThen(function () {
      click('[data-test-selector=reports-tab]');
      waitToAppear('[data-test-selector=report-btn]');
      assert.equal(find('[data-test-selector=report-btn]').text().trim(), 'New ' + type + ' Report', 'Discharge report can be created for this type of visit');
      click('[data-test-selector=report-btn]');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/reports/edit/new') > -1, 'Report url is correct');
      assert.equal(find('.view-current-title').text(), 'New ' + type + ' Report', type + ' report title displayed correctly');
      assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Patient record displays');
    });
  }

  function checkOPDReport(assert) {
    andThen(function () {
      assert.equal(find('.patient-id .ps-info-data').text(), 'P00001', 'Patient ID is displayed');
      assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Patient First Name & Last Name is displayed');
      assert.equal(find('.test-visit-date .test-visit-date-label').text().trim(), 'Date of Visit:', 'Visit date label displayed');
      assert.ok(!isEmpty(find('.test-visit-date .test-visit-date-data').text()), 'Visit date is displayed');
      findWithAssert('.test-visit-type .test-visit-type-label:contains(Visit Type)');
      assert.equal(find('.test-visit-type .test-visit-type-data').text(), 'Clinic', 'Visit Type is displayed');
      findWithAssert('.test-examiner .test-examiner-label:contains(Examiner)');
      assert.equal(find('.test-examiner .test-examiner-data').text(), visitData.outPatient.EXAMINER, 'Visit Examiner is displayed');
      findWithAssert('.test-location .test-location-label:contains(Visit Location)');
      assert.equal(find('.test-location .test-location-data').text(), visitData.outPatient.LOCATION, 'Visit Location is displayed');
      findWithAssert('.primary-diagnosis:contains(' + visitData.outPatient.PRIMARY_DIAGNOSIS + ')');
      findWithAssert('.secondary-diagnosis:contains(' + visitData.outPatient.SECONDARY_DIAGNOSIS + ')');
      findWithAssert('.test-opd-procedure .test-opd-procedure-label:contains(Procedures)');
      assert.ok(find('.test-opd-procedure .test-opd-procedure-data').text().indexOf(visitData.outPatient.OPD_PROCEDURE_DESCRIPTION) > -1, 'OPD Procedure is displayed');
      findWithAssert('.test-labs .test-labs-label:contains(Labs)');
      assert.ok(find('.test-labs .test-labs-data').text().indexOf(visitData.outPatient.LAB_TYPE) > -1, 'Lab request is displayed');
      findWithAssert('.test-images .test-images-label:contains(Images)');
      assert.ok(find('.test-images .test-images-data').text().indexOf(visitData.outPatient.IMAGING_TYPE) > -1, 'Image request is displayed');
      findWithAssert('.test-operative-plan .test-operative-plan-label:contains(Operative Plan)');
      findWithAssert('.test-operative-plan .test-operative-plan-description-label:contains(Operation Description:)');
      assert.equal(find('.test-operative-plan .test-operative-plan-description-data').text(), visitData.outPatient.OPERATION_DESCRIPTION);
      findWithAssert('.test-operative-plan .test-operative-plan-procedures-label:contains(Planned Procedures:)');
      assert.equal(find('.test-operative-plan .test-operative-plan-procedures-description').text(), visitData.outPatient.PROCEDURE_SPLINT);
      findWithAssert('.test-operative-plan .test-operative-plan-instructions-label:contains(Instructions upon Admission:)');
      assert.equal(find('.test-operative-plan .test-operative-plan-instructions-data').text(), visitData.outPatient.ADMISSION_INSTRUCTIONS, 'Admission Instruction is displayed');
    });
  }

  function checkDischargeReport(assert) {
    andThen(function () {
      findWithAssert('.test-examiner .test-examiner-label:contains(Examiner)');
      assert.equal(find('.test-examiner .test-examiner-data').text(), visitData.admission.EXAMINER, 'Examiner is displayed');
      assert.equal(find('.test-visit-date .test-visit-date-label').text().trim(), 'Admission Date:', 'Visit date label displays as admission');
      assert.equal(find('.test-visit-date .test-visit-discharge-date-label').text().trim(), 'Discharge Date:', 'Discharge date label displays');
      findWithAssert('.test-notes .test-notes-label:contains(Notes)');
      assert.ok(find('.test-notes .test-notes-data').text().indexOf(visitData.admission.NOTE_CONTENT) > -1, 'Notes are displayed');
    });
  }

  function saveReport(assert, type) {
    andThen(function () {
      click('.panel-footer button:contains(Add)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Report saved', type + ' report saved successfully');
      click('button:contains(Ok)');
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.view-current-title').text(), type + ' Report', 'Report title updated correctly');
      assert.ok(find('.panel-footer button:contains(Print)').is(':visible'), 'Print button is now visible');
      click('button:contains(Return)');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/edit/') > -1, 'Visit url is correct');
    });
  }

  function viewReport(assert, type) {
    andThen(function () {
      click('[data-test-selector=reports-tab]');
      waitToAppear('[data-test-selector=view-report-btn]');
      click('[data-test-selector=view-report-btn]');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/reports/edit') > -1, 'Edit report url is correct');
      assert.equal(find('.patient-name .ps-info-data').text(), 'Joe Bagadonuts', 'Patient record displays');
      assert.equal(find('.view-current-title').text(), type + ' Report', 'Report title displayed correctly');
      assert.ok(find('.panel-footer button:contains(Print)').is(':visible'), 'Print button is visible');
    });
  }

  function updateVisitData(assert, modalTitle) {
    andThen(function () {
      click('.panel-footer button:contains(Add)');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), modalTitle, modalTitle + ' modal displays');
      click('.modal-footer button:contains(Ok)');
    });
    andThen(function () {
      waitToDisappear('.modal-dialog');
    });
    andThen(function () {
      click('button:contains(Return)');
    });
    andThen(function () {
      assert.ok(currentURL().indexOf('visits/edit/') > -1, 'Returns back to visit URL');
    });
  }

  function updateVisit(assert, buttonText, visitType) {
    andThen(function () {
      if (visitType) {
        select('select[id*="visitType"]', visitType);
        waitToDisappear('label[for*="display_endDate"]');
      }
      click('.panel-footer button:contains(' + buttonText + ')');
      waitToAppear('.modal-dialog');
    });
    andThen(function () {
      assert.equal(find('.modal-title').text(), 'Visit Saved', 'Visit Saved dialog displays');
      click('button:contains(Ok)');
    });
  }
});
define('hospitalrun/tests/acceptance/visit-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - acceptance/visit-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'acceptance/visit-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/adapters/application', ['exports', 'hospitalrun/mixins/check-for-errors', 'ember', 'npm:uuid', 'ember-concurrency-test-waiter/with-test-waiter', 'ember-pouch', 'ember-concurrency'], function (exports, _hospitalrunMixinsCheckForErrors, _ember, _npmUuid, _emberConcurrencyTestWaiterWithTestWaiter, _emberPouch, _emberConcurrency) {
  'use strict';

  var reads = _ember['default'].computed.reads;
  var get = _ember['default'].get;
  var bind = _ember['default'].run.bind;
  exports['default'] = _emberPouch.Adapter.extend(_hospitalrunMixinsCheckForErrors['default'], {
    ajax: _ember['default'].inject.service(),
    database: _ember['default'].inject.service(),
    db: reads('database.mainDB'),
    usePouchFind: reads('database.usePouchFind'),

    _specialQueries: ['containsValue', 'mapReduce'],

    _esDefaultSize: 25,

    _executeContainsSearch: function _executeContainsSearch(store, type, query) {
      var _this = this;

      var usePouchFind = get(this, 'usePouchFind');
      if (usePouchFind) {
        return this._executePouchDBFind(store, type, query);
      }
      var typeName = this.getRecordTypeName(type);
      var searchUrl = '/search/hrdb/' + typeName + '/_search';
      if (query.containsValue && query.containsValue.value) {
        var _ret = (function () {
          var queryString = '';
          query.containsValue.keys.forEach(function (key) {
            if (!_ember['default'].isEmpty(queryString)) {
              queryString = queryString + ' OR ';
            }
            var queryValue = query.containsValue.value;
            switch (key.type) {
              case 'contains':
                {
                  queryValue = '*' + queryValue + '*';
                  break;
                }
              case 'fuzzy':
                {
                  queryValue = queryValue + '~';
                  break;
                }
            }
            queryString = queryString + 'data.' + key.name + ':' + queryValue;
          });
          var ajax = get(_this, 'ajax');
          if (_ember['default'].isEmpty(query.size)) {
            query.size = _this.get('_esDefaultSize');
          }

          return {
            v: ajax.request(searchUrl, {
              dataType: 'json',
              data: {
                q: queryString,
                size: _this.get('_esDefaultSize')
              }
            }).then(function (results) {
              if (results && results.hits && results.hits.hits) {
                var resultDocs = _ember['default'].A(results.hits.hits).map(function (hit) {
                  var mappedResult = hit._source;
                  mappedResult.id = hit._id;
                  return mappedResult;
                });
                var response = {
                  rows: resultDocs
                };
                return _this._handleQueryResponse(response, store, type);
              } else if (results.rows) {
                return _this._handleQueryResponse(results, store, type);
              } else {
                throw new Error('Search results are not valid');
              }
            })['catch'](function () {
              // Try pouch db find if ajax fails
              return _this._executePouchDBFind(store, type, query);
            })
          };
        })();

        if (typeof _ret === 'object') return _ret.v;
      } else {
        throw new Error('invalid query');
      }
    },

    _executePouchDBFind: function _executePouchDBFind(store, type, query) {
      this._init(store, type);
      var db = this.get('db');
      var recordTypeName = this.getRecordTypeName(type);
      var queryParams = {
        selector: {
          $or: []
        }
      };
      if (query.containsValue && query.containsValue.value) {
        (function () {
          var regexp = new RegExp(query.containsValue.value, 'i');
          query.containsValue.keys.forEach(function (key) {
            var subQuery = {};
            subQuery['data.' + key.name] = { $regex: regexp };
            queryParams.selector.$or.push(subQuery);
          });
        })();
      }

      return db.find(queryParams).then(function (pouchRes) {
        return db.rel.parseRelDocs(recordTypeName, pouchRes.docs);
      });
    },

    _handleQueryResponse: function _handleQueryResponse(response, store, type) {
      var _this2 = this;

      var database = this.get('database');
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        if (response.rows.length > 0) {
          (function () {
            var ids = response.rows.map(function (row) {
              return database.getEmberId(row.id);
            });
            _this2.findRecord(store, type, ids).then(function (findResponse) {
              var primaryRecordName = type.modelName.camelize().pluralize();
              var sortedValues = [];
              // Sort response in order of ids
              ids.forEach(function (id) {
                var resolvedRecord = findResponse[primaryRecordName].findBy('id', id);
                sortedValues.push(resolvedRecord);
              });
              findResponse[primaryRecordName] = sortedValues;
              resolve(findResponse);
            }, reject);
          })();
        } else {
          var emptyResponse = {};
          emptyResponse[type.modelName] = [];
          resolve(emptyResponse);
        }
      });
    },

    /**
     * @private
     * Look for nulls and maxvalues in start key because those keys can't be handled by the sort/list function
     */
    _doesStartKeyContainSpecialCharacters: function _doesStartKeyContainSpecialCharacters(startkey) {
      var haveSpecialCharacters = false;
      var maxValue = this.get('maxValue');
      if (!_ember['default'].isEmpty(startkey) && _ember['default'].isArray(startkey)) {
        startkey.forEach(function (keyvalue) {
          if (keyvalue === null || keyvalue === maxValue) {
            haveSpecialCharacters = true;
          }
        });
      }
      return haveSpecialCharacters;
    },

    _startChangesToStoreListener: function _startChangesToStoreListener() {
      var db = this.get('db');
      if (db) {
        this.changes = db.changes({
          since: 'now',
          live: true,
          returnDocs: false
        }).on('change', bind(this, 'onChange')).on('error', _ember['default'].K); // Change sometimes throws weird 500 errors that we can ignore
        db.changesListener = this.changes;
      }
    },

    generateIdForRecord: function generateIdForRecord() {
      return _npmUuid['default'].v4();
    },

    query: function query(store, type, _query, options) {
      var _this3 = this;

      var specialQuery = false;
      for (var i = 0; i < this._specialQueries.length; i++) {
        if (_ember['default'].get(_query, this._specialQueries[i])) {
          specialQuery = true;
          break;
        }
      }

      if (!specialQuery) {
        if (_query.options) {
          this._init(store, type);
          var recordTypeName = this.getRecordTypeName(type);
          return this.get('db').rel.find(recordTypeName, _query.options);
        } else {
          return this._super(store, type, _query, options);
        }
      } else {
        var _ret4 = (function () {
          var mapReduce = null;
          var queryParams = {};
          if (_query.options) {
            queryParams = _ember['default'].copy(_query.options);
            if (_query.sortKey || _query.filterBy) {
              if (_query.sortDesc) {
                queryParams.sortDesc = _query.sortDesc;
              }
              if (_query.sortKey) {
                queryParams.sortKey = _query.sortKey;
              }
              if (!_this3._doesStartKeyContainSpecialCharacters(queryParams.startkey)) {
                queryParams.sortLimit = queryParams.limit;
                delete queryParams.limit;
                queryParams.sortStartKey = JSON.stringify(queryParams.startkey);
                delete queryParams.startkey;
              } else if (queryParams.startkey) {
                queryParams.startkey = JSON.stringify(queryParams.startkey);
              }
              if (_query.filterBy) {
                queryParams.filterBy = JSON.stringify(_query.filterBy);
              }
              if (queryParams.endkey) {
                queryParams.endkey = JSON.stringify(queryParams.endkey);
              }
              _query.useList = true;
            }
          }
          queryParams.reduce = false;
          queryParams.include_docs = false;
          if (_query.mapReduce) {
            mapReduce = _query.mapReduce;
          } else if (_query.containsValue) {
            return {
              v: _this3._executeContainsSearch(store, type, _query)
            };
          }
          var database = get(_this3, 'database');
          return {
            v: new _ember['default'].RSVP.Promise(function (resolve, reject) {
              var db = _this3.get('db');
              try {
                if (mapReduce) {
                  if (_query.useList) {
                    queryParams.include_docs = true;
                    var listParams = {
                      query: queryParams
                    };
                    db.list(mapReduce + '/sort/' + mapReduce, listParams, function (err, response) {
                      if (err) {
                        reject(database.handleErrorResponse(err));
                      } else {
                        var responseJSON = JSON.parse(response.body);
                        _this3._handleQueryResponse(responseJSON, store, type).then(resolve, reject);
                      }
                    });
                  } else {
                    db.query(mapReduce, queryParams, function (err, response) {
                      if (err) {
                        reject(database.handleErrorResponse(err));
                      } else {
                        _this3._handleQueryResponse(response, store, type).then(resolve, reject);
                      }
                    });
                  }
                } else {
                  db.allDocs(queryParams, function (err, response) {
                    if (err) {
                      reject(database.handleErrorResponse(err));
                    } else {
                      _this3._handleQueryResponse(response, store, type).then(resolve, reject);
                    }
                  });
                }
              } catch (err) {
                reject(database.handleErrorResponse(err));
              }
            }, 'findQuery in application-pouchdb-adapter')
          };
        })();

        if (typeof _ret4 === 'object') return _ret4.v;
      }
    },

    createRecord: function createRecord(store, type, record) {
      return this._checkForErrors(this._super(store, type, record));
    },

    findAll: function findAll(store, type) {
      return this._checkForErrors(this._super(store, type));
    },

    findMany: function findMany(store, type, ids) {
      return this._checkForErrors(this._super(store, type, ids));
    },

    findHasMany: function findHasMany(store, record, link, rel) {
      return this._checkForErrors(this._super(store, record, link, rel));
    },

    findRecord: function findRecord(store, type, id) {
      return this._checkForErrors(this._super(store, type, id));
    },

    updateRecord: function updateRecord(store, type, record) {
      return this._checkForErrors(this._super(store, type, record));
    },

    deleteRecord: function deleteRecord(store, type, record) {
      return this._checkForErrors(this._super(store, type, record));
    },

    checkForErrorsTask: (0, _emberConcurrencyTestWaiterWithTestWaiter['default'])((0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(callPromise) {
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        var _this4 = this;

        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            context$1$0.next = 2;
            return new _ember['default'].RSVP.Promise(function (resolve, reject) {
              callPromise.then(resolve, function (err) {
                var database = get(_this4, 'database');
                reject(database.handleErrorResponse(err));
              });
            });

          case 2:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 3:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    }))),

    _checkForErrors: function _checkForErrors(callPromise) {
      return get(this, 'checkForErrorsTask').perform(callPromise);
    }

  });
});
define('hospitalrun/tests/adapters/application.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - adapters/application.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'adapters/application.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/adapters/user', ['exports', 'ember', 'hospitalrun/mixins/check-for-errors', 'ember-data', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsCheckForErrors, _emberData, _hospitalrunMixinsUserSession) {
  'use strict';

  var ENDPOINT = '/db/_users/';

  var RESTAdapter = _emberData['default'].RESTAdapter;
  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = RESTAdapter.extend(_hospitalrunMixinsCheckForErrors['default'], _hospitalrunMixinsUserSession['default'], {
    defaultSerializer: 'couchdb',

    config: inject.service(),
    database: inject.service(),
    session: inject.service(),

    oauthHeaders: alias('database.oauthHeaders'),
    standAlone: alias('config.standAlone'),
    usersDB: alias('database.usersDB'),

    headers: computed('oauthHeaders', function () {
      var oauthHeaders = get(this, 'oauthHeaders');
      if (_ember['default'].isEmpty(oauthHeaders)) {
        return {};
      } else {
        return oauthHeaders;
      }
    }),

    ajaxError: function ajaxError(jqXHR) {
      var error = this._super(jqXHR);
      if (jqXHR && jqXHR.status === 401) {
        var jsonErrors = _ember['default'].$.parseJSON(jqXHR.responseText);
        window.Hospitalrun.__container__.lookup('controller:application').transitionToRoute('login');
        return new _emberData['default'].InvalidError(jsonErrors);
      } else {
        return error;
      }
    },

    /**
    @method ajaxOptions Overriden here so that we can specify xhr with credentials
    @private
    @param {String} url
    @param {String} type The request type GET, POST, PUT, DELETE etc.
    @param {Object} options
    @return {Object} hash
    */
    ajaxOptions: function ajaxOptions(url, type, options) {
      options = options || {};
      options.xhrFields = { withCredentials: true };
      return this._super(url, type, options);
    },

    /**
      Called by the store when a newly created record is
      saved via the `save` method on a model record instance.
      The `createRecord` method serializes the record and makes an Ajax (HTTP POST) request
      to a URL computed by `buildURL`.
      See `serialize` for information on how to customize the serialized form
      of a record.
      @method createRecord
      @param {DS.Store} store
      @param {DS.Model} type
      @param {DS.Snapshot} snapshot
      @return {Promise} promise
    */
    createRecord: function createRecord(store, type, snapshot) {
      return this.updateRecord(store, type, snapshot);
    },

    /**
      Called by the store when a record is deleted.
      The `deleteRecord` method  makes an Ajax (HTTP DELETE) request to a URL computed by `buildURL`.
      @method deleteRecord
      @param {DS.Store} store
      @param {DS.Model} type
      @param {DS.Snapshot} snapshot
      @return {Promise} promise
    */
    deleteRecord: function deleteRecord(store, type, snapshot) {
      return this.updateRecord(store, type, snapshot, true);
    },

    /**
      Called by the store in order to fetch the JSON for a given
      type and ID.
      The `findRecord` method makes an Ajax request to a URL computed by
      `buildURL`, and returns a promise for the resulting payload.
      This method performs an HTTP `GET` request with the id provided as part of the query string.
      @since 1.13.0
      @method findRecord
      @param {DS.Store} store
      @param {DS.Model} type
      @param {String} id
      @param {DS.Snapshot} snapshot
      @return {Promise} promise
    */
    findRecord: function findRecord(store, type, id, snapshot) {
      if (get(this, 'standAlone') === true) {
        return this._offlineFind(id);
      } else {
        return this._checkForErrors(this._super(store, type, id, snapshot));
      }
    },

    /**
      Called by the store in order to fetch a JSON array for all
      of the records for a given type.
      The `findAll` method makes an Ajax (HTTP GET) request to a URL computed by `buildURL`, and returns a
      promise for the resulting payload.
      @method findAll
      @param {DS.Store} store
      @param {DS.Model} type
      @param {String} sinceToken
      @param {DS.SnapshotRecordArray} snapshotRecordArray
      @return {Promise} promise
    */
    findAll: function findAll(store, type, sinceToken, snapshotRecordArray) {
      var ajaxData = {
        data: {
          include_docs: true,
          startkey: '"org.couchdb.user"'
        }
      };
      if (get(this, 'standAlone') === true) {
        return this._offlineFindAll(ajaxData.data);
      } else {
        var url = this.buildURL(type.modelName, null, snapshotRecordArray, 'findAll');
        return this._checkForErrors(this.ajax(url, 'GET', ajaxData));
      }
    },

    shouldReloadAll: function shouldReloadAll() {
      return true;
    },

    /**
     Called by the store when an existing record is saved
     via the `save` method on a model record instance.
      The `updateRecord` method serializes the record and makes an Ajax (HTTP PUT) request
     to a URL computed by `buildURL`.
      See `serialize` for information on how to customize the serialized form
     of a record.
      @method updateRecord
     @param {DS.Store} store
     @param {subclass of DS.Model} type
     @param {DS.Snapshot} record
     @param {boolean} deleteUser true if we are deleting the user.
     @returns {Promise} promise
    */
    updateRecord: function updateRecord(store, type, record, deleteUser) {
      var data = {};
      var serializer = store.serializerFor(record.modelName);
      serializer.serializeIntoHash(data, type, record, { includeId: true });
      data.type = 'user';
      if (deleteUser) {
        data.deleted = true;
        delete data.oauth;
        data.roles = ['deleted'];
      }
      if (_ember['default'].isEmpty(data._rev)) {
        delete data._rev;
      }
      data = this._cleanPasswordAttrs(data);
      if (get(this, 'standAlone') === true) {
        return this._offlineUpdateRecord(data);
      } else {
        var putURL = this._buildURL('user', get(record, 'id'));
        return this._checkForErrors(this.ajax(putURL, 'PUT', {
          data: data
        }));
      }
    },
    /**
     Builds a URL for a `store.findAll(type)` call.
     Example:
     ```app/adapters/comment.js
     import DS from 'ember-data';
     export default DS.JSONAPIAdapter.extend({
       urlForFindAll(id, modelName, snapshot) {
         return 'data/comments.json';
       }
     });
     ```
     @method urlForFindAll
     @param {String} modelName
     @param {DS.SnapshotRecordArray} snapshot
     @return {String} url
     */
    urlForFindAll: function urlForFindAll() /* modelName, snapshot */{
      return ENDPOINT + '_all_docs';
    },

    /**
      @method urlPrefix
      @private
      @param {String} path
      @param {String} parentURL
      @return {String} urlPrefix
    */
    urlPrefix: function urlPrefix() /* path, parentURL */{
      return ENDPOINT;
    },

    /**
      @method _buildURL
      @private
      @param {String} modelName
      @param {String} id
      @return {String} url
    */
    _buildURL: function _buildURL(modelName, id) {
      return '' + ENDPOINT + id;
    },

    /**
     Remove null/empty password fields from payload sent to server
     */
    _cleanPasswordAttrs: function _cleanPasswordAttrs(data) {
      var attrsToCheck = ['derived_key', 'password', 'password_scheme', 'password_sha', 'salt', 'iterations'];
      attrsToCheck.forEach(function (attr) {
        if (_ember['default'].isEmpty(data[attr])) {
          delete data[attr];
        }
      });
      return data;
    },

    /**
     Called by find in we're in standAlone mode.
      @method private
      @param {String} id - document id we are retrieving
    @returns {Promise} promise
    */
    _offlineFind: function _offlineFind(id) {
      var _this = this;

      var usersDB = get(this, 'database.usersDB');
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        usersDB.get(id).then(resolve)['catch'](function (err) {
          var database = get(_this, 'database');
          reject(database.handleErrorResponse(err));
        });
      });
    },

    /**
    Called by updateRecord in we're in standAlone mode.
     @method private
    @param {POJO} data - the data we're going to search for in Pouch
    @returns {Promise} promise
    */
    _offlineFindAll: function _offlineFindAll(data) {
      var usersDB = get(this, 'database.usersDB');
      return usersDB.allDocs(data);
    },

    /**
    Called by updateRecord in we're in standAlone mode.
     @method private
    @param {POJO} data - the data we're going to store in Pouch
    @returns {Promise} promise
    */
    _offlineUpdateRecord: function _offlineUpdateRecord(data) {
      var usersDB = get(this, 'usersDB');
      return usersDB.put(data);
    }

  });
});
define('hospitalrun/tests/adapters/user.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - adapters/user.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'adapters/user.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/address/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller'], function (exports, _hospitalrunControllersAbstractEditController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    hideCancelButton: true,
    updateCapability: 'update_config',

    afterUpdate: function afterUpdate() {
      this.displayAlert(this.get('i18n').t('admin.address.titles.optionsSaved'), this.get('i18n').t('admin.address.messages.addressSaved'));
    }
  });
});
define('hospitalrun/tests/admin/address/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/address/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/address/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/address/route', ['exports', 'ember', 'hospitalrun/routes/abstract-edit-route', 'ember-concurrency', 'ember-i18n', 'hospitalrun/utils/unauthorized-error'], function (exports, _ember, _hospitalrunRoutesAbstractEditRoute, _emberConcurrency, _emberI18n, _hospitalrunUtilsUnauthorizedError) {
  'use strict';

  function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    hideNewButton: true,
    newTitle: (0, _emberI18n.translationMacro)('admin.address.newTitle'),
    editTitle: (0, _emberI18n.translationMacro)('admin.address.editTitle'),

    model: function model() {
      return this.get('fetchAddressOptions').perform();
    },

    fetchAddressOptions: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0() {
      var store;
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            store = this.get('store');
            context$1$0.prev = 1;
            context$1$0.next = 4;
            return store.find('option', 'address_options');

          case 4:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 7:
            context$1$0.prev = 7;
            context$1$0.t0 = context$1$0['catch'](1);

            if (!_instanceof(context$1$0.t0, _hospitalrunUtilsUnauthorizedError['default'])) {
              context$1$0.next = 11;
              break;
            }

            throw context$1$0.t0;

          case 11:
            return context$1$0.abrupt('return', store.push(this.get('defaultAddressOption')));

          case 12:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this, [[1, 7]]);
    })).keepLatest().cancelOn('deactivate'),

    defaultAddressOption: computed(function () {
      return this.get('store').normalize('option', {
        id: 'address_options',
        value: {
          address1Label: this.get('i18n').t('admin.address.addressLabel'),
          address1Include: true
        }
      });
    })
  });
});
define('hospitalrun/tests/admin/address/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/address/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/address/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/custom-forms/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'npm:uuid'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _npmUuid) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    customForms: _ember['default'].inject.service(),
    preview: false,
    previewModel: _ember['default'].Object.create(),
    updateCapability: 'update_config',

    afterUpdate: function afterUpdate() {
      var customForms = this.get('customForms');
      var model = this.get('model');
      customForms.resetCustomFormByType(model.get('formType'));
      this.displayAlert(this.get('i18n').t('admin.customForms.titles.formSaved'), this.get('i18n').t('admin.customForms.messages.formSaved', this.get('model')));
    },

    actions: {
      addField: function addField() {
        var newField = this.store.createRecord('custom-field');
        this.send('openModal', 'admin.custom-forms.field-edit', newField);
      },

      deleteField: function deleteField(field) {
        var fields = this.get('model.fields');
        fields.removeObject(field);
      },

      editField: function editField(field) {
        if (isEmpty(field)) {
          field = this.store.createRecord('custom-field');
        }
        this.send('openModal', 'admin.custom-forms.field-edit', field);
      },

      moveFieldDown: function moveFieldDown(field) {
        var fields = this.get('model.fields');
        var currentFieldIdx = fields.indexOf(field);
        var nextField = fields.objectAt(currentFieldIdx + 1);
        fields.replace(currentFieldIdx, 2, [nextField, field]);
      },

      moveFieldUp: function moveFieldUp(field) {
        var fields = this.get('model.fields');
        var previousFieldIdx = fields.indexOf(field) - 1;
        var previousField = fields.objectAt(previousFieldIdx);
        fields.replace(previousFieldIdx, 2, [field, previousField]);
      },

      togglePreview: function togglePreview() {
        this.toggleProperty('preview');
      },

      updateField: function updateField(field) {
        if (field.get('isNew')) {
          this._addNewField(field);
        }
        this.get('model').save();
      }
    },

    formName: computed('model.name', function () {
      var i18n = this.get('i18n');
      var formName = this.get('model.name');
      if (isEmpty(formName)) {
        return i18n.t('admin.customForms.labels.newForm');
      } else {
        return formName;
      }
    }),

    formTypeValues: ['incident', 'operativePlan', 'patient', 'socialwork', 'visit', 'opdReport', 'dischargeReport', 'lab'],

    formTypes: computed(function () {
      var i18n = this.get('i18n');
      var formTypeValues = this.get('formTypeValues');
      return formTypeValues.map(function (formTypeId) {
        return {
          id: formTypeId,
          value: i18n.t('admin.customForms.labels.' + formTypeId + 'FormType')
        };
      }).sort(function (a, b) {
        return _ember['default'].compare(a.value.toString(), b.value.toString());
      });
    }),

    lastFieldIndex: computed('model.fields.length', function () {
      return this.get('model.fields.length') - 1;
    }),

    fieldTypeLabel: function fieldTypeLabel(fieldType) {
      var i18n = this.get('i18n');
      return i18n.t('admin.customForms.labels.' + fieldType);
    },

    _addNewField: function _addNewField(field) {
      var changedAttributes = field.changedAttributes();
      var fieldAttributes = {};
      var store = this.get('store');
      this._generatePropertyNames(field);
      Object.keys(changedAttributes).forEach(function (attributeName) {
        var _changedAttributes$attributeName = _slicedToArray(changedAttributes[attributeName], 2);

        var newValue = _changedAttributes$attributeName[1];

        fieldAttributes[attributeName] = newValue;
      });
      fieldAttributes.property = field.get('property');
      var newField = store.push({
        data: {
          id: _npmUuid['default'].v4(),
          type: 'custom-field',
          attributes: fieldAttributes
        }
      });
      var formFields = this.get('model.fields');
      formFields.addObject(newField);
    },

    _generatePropertyNames: function _generatePropertyNames(field) {
      var type = field.get('type');
      var propertyName = this._getPropertyName(field);
      if (type === 'checkbox') {
        var values = field.get('values');
        values.forEach(function (value, index) {
          value.set('property', '' + propertyName + (index + 1));
        });
      } else {
        field.set('property', propertyName);
      }
    },

    _getPropertyName: function _getPropertyName(field) {
      var camelizedLabel = field.get('label').camelize();
      var labelIndex = 1;
      var propertyName = camelizedLabel;
      while (this._isPropertyUsed(propertyName) && labelIndex < 10) {
        propertyName = '' + camelizedLabel + ++labelIndex;
      }
      return propertyName;
    },

    _isPropertyUsed: function _isPropertyUsed(propertyName) {
      var fields = this.get('model.fields');
      var existingProperty = fields.findBy('property', propertyName);
      if (!isEmpty(existingProperty)) {
        return true;
      } else {
        var checkboxes = fields.filterBy('type', 'checkbox');
        return checkboxes.any(function (checkbox) {
          existingProperty = checkbox.get('values').findBy('property', propertyName);
          if (!isEmpty(existingProperty)) {
            return true;
          }
        });
      }
    }

  });
});
define('hospitalrun/tests/admin/custom-forms/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/custom-forms/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/custom-forms/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/custom-forms/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    hideNewButton: true,
    newTitle: (0, _emberI18n.translationMacro)('admin.customForms.titles.newCustomForm'),
    editTitle: (0, _emberI18n.translationMacro)('admin.customForms.titles.editCustomForm'),
    modelName: 'custom-form',

    actions: {
      allItems: function allItems() {
        this.transitionTo('admin.custom-forms');
      }
    }
  });
});
define('hospitalrun/tests/admin/custom-forms/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/custom-forms/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/custom-forms/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/custom-forms/field-edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    editController: _ember['default'].inject.controller('admin/custom-forms/edit'),
    cancelAction: 'closeModal',
    i18n: _ember['default'].inject.service(),

    actions: {
      addValue: function addValue() {
        var fieldValues = this.get('model.values');
        if (isEmpty(fieldValues)) {
          var model = this.get('model');
          fieldValues = [];
          model.set('values', fieldValues);
        }
        fieldValues.addObject(_ember['default'].Object.create());
      },

      deleteValue: function deleteValue(valueToDelete) {
        var fieldValues = this.get('model.values');
        fieldValues.removeObject(valueToDelete);
      },

      selectType: function selectType(fieldType) {
        this.get('model').set('type', fieldType);
      },

      update: function update() {
        this.get('editController').send('updateField', this.get('model'));
        this.send('closeModal');
      }
    },

    fieldTypeValues: ['checkbox', 'radio', 'select', 'text', 'textarea'],

    fieldTypes: computed(function () {
      var i18n = this.get('i18n');
      var fieldTypeValues = this.get('fieldTypeValues');
      return fieldTypeValues.map(function (fieldTypeId) {
        return {
          id: fieldTypeId,
          value: i18n.t('admin.customForms.labels.' + fieldTypeId)
        };
      }).sort(function (a, b) {
        return _ember['default'].compare(a.value.toString(), b.value.toString());
      });
    }),

    showValues: computed('model.type', function () {
      var type = this.get('model.type');
      return type === 'checkbox' || type === 'radio' || type === 'select';
    })

  });
});
define('hospitalrun/tests/admin/custom-forms/field-edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/custom-forms/field-edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/custom-forms/field-edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/custom-forms/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    addPermission: 'update_config',
    deletePermission: 'update_config'
  });
});
define('hospitalrun/tests/admin/custom-forms/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/custom-forms/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/custom-forms/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/custom-forms/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember, _hospitalrunMixinsModalHelper, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsUserSession['default'], {
    newButtonAction: computed(function () {
      if (this.currentUserCan('update_config')) {
        return 'newItem';
      } else {
        return null;
      }
    }),
    newButtonText: (0, _emberI18n.translationMacro)('admin.customForms.buttons.newForm'),

    pageTitle: (0, _emberI18n.translationMacro)('admin.customForms.titles.customForms'),
    model: function model() {
      var store = this.get('store');
      return store.findAll('custom-form');
    },

    actions: {
      deleteItem: function deleteItem(item) {
        var i18n = this.get('i18n');
        var model = _ember['default'].Object.create({
          itemToDelete: item
        });
        var message = i18n.t('messages.delete', { name: item.get('name') });
        var title = i18n.t('admin.customForms.titles.deleteForm');
        this.displayConfirm(title, message, 'deleteCustomForm', model);
      },

      deleteCustomForm: function deleteCustomForm(model) {
        model.itemToDelete.set('archived', true);
        model.itemToDelete.save().then(function () {
          model.itemToDelete.unloadRecord();
        });
      },

      editItem: function editItem(item) {
        this.transitionTo('admin.custom-forms.edit', item);
      },

      newItem: function newItem() {
        this.transitionTo('admin.custom-forms.edit', 'new');
      }

    }
  });
});
define('hospitalrun/tests/admin/custom-forms/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/custom-forms/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/custom-forms/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/loaddb/controller', ['exports', 'ember', 'ember-i18n', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/progress-dialog'], function (exports, _ember, _emberI18n, _hospitalrunMixinsModalHelper, _hospitalrunMixinsProgressDialog) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsProgressDialog['default'], {
    database: _ember['default'].inject.service(),
    fileSystem: _ember['default'].inject.service('filesystem'),
    progressMessage: (0, _emberI18n.translationMacro)('admin.loaddb.progressMessage'),
    progressTitle: (0, _emberI18n.translationMacro)('admin.loaddb.progressTitle'),
    syncResults: null,
    fileImportedName: null,

    actions: {
      loadFile: function loadFile() {
        var _this = this;

        var fileSystem = this.get('fileSystem');
        var fileToImport = this.get('importFile');
        if (!fileToImport || !fileToImport.type) {
          this.displayAlert(this.get('i18n').t('admin.loaddb.displayAlertTitle'), this.get('i18n').t('admin.loaddb.displayAlertMessage'));
        } else {
          this.showProgressModal();
          this.set('syncResults');
          this.set('fileImportedName');
          fileSystem.fileToString(fileToImport).then(function (fileAsString) {
            var database = _this.get('database');
            var fileName = _this.get('importFile.name');
            _this.set('fileImportedName', fileName);
            _this.set('importFile');
            _this.set('model.importFileName');
            database.loadDBFromDump(fileAsString).then(function (results) {
              _this.closeProgressModal();
              _this.set('syncResults', results);
            })['catch'](function (err) {
              _this.displayAlert(_this.get('i18n').t('admin.loaddb.errorDisplayAlertTitle'), _this.get('i18n').t('admin.loaddb.errorDisplayAlertMessage', { error: JSON.stringify(err) }));
            });
          });
        }
      }
    }
  });
});
define('hospitalrun/tests/admin/loaddb/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/loaddb/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/loaddb/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/loaddb/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'ember-i18n', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _emberI18n, _hospitalrunMixinsUserSession) {
  'use strict';

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    hideNewButton: true,
    editTitle: (0, _emberI18n.translationMacro)('admin.loaddb.editTitle'),

    database: inject.service(),

    beforeModel: function beforeModel() {
      if (!this.currentUserCan('load_db')) {
        this.transitionTo('application');
      }
    },

    // Make sure database is available for import
    model: function model() {
      var _this = this;

      var database = get(this, 'database');
      return database.getDBInfo()['catch'](function (err) {
        return _this.send('error', database.handleErrorResponse(err));
      });
    }
  });
});
define('hospitalrun/tests/admin/loaddb/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/loaddb/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/loaddb/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/lookup/controller', ['exports', 'ember', 'hospitalrun/mixins/billing-categories', 'npm:csv-parse', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/inventory-type-list', 'hospitalrun/mixins/unit-types', 'hospitalrun/mixins/visit-types', 'ember-keyboard'], function (exports, _ember, _hospitalrunMixinsBillingCategories, _npmCsvParse, _hospitalrunMixinsModalHelper, _hospitalrunMixinsInventoryTypeList, _hospitalrunMixinsUnitTypes, _hospitalrunMixinsVisitTypes, _emberKeyboard) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsBillingCategories['default'], _emberKeyboard.EKMixin, _hospitalrunMixinsInventoryTypeList['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsUnitTypes['default'], _hospitalrunMixinsVisitTypes['default'], {
    fileSystem: inject.service('filesystem'),
    lookupLists: inject.service(),

    canEditValues: computed('model.lookupType', function () {
      var lookupType = this.get('model.lookupType');
      return lookupType !== 'imaging_pricing_types' && lookupType !== 'lab_pricing_types';
    }),

    lookupTypes: computed(function () {
      return [{
        name: this.get('i18n').t('admin.lookup.anesthesiaTypes'),
        value: 'anesthesia_types',
        model: {
          procedure: 'anesthesiaType'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.anesthesiologists'),
        value: 'anesthesiologists',
        model: {
          procedure: 'anesthesiologist'
        }
      }, {
        defaultValues: 'defaultBillingCategories',
        name: this.get('i18n').t('admin.lookup.billingCategories'),
        value: 'billing_categories',
        models: {
          'billing-line-item': 'category'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.clinicList'),
        value: 'clinic_list',
        models: { // Models that use this lookup -- use this later to update models on lookup changes
          patient: 'clinic'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.countryList'),
        value: 'country_list',
        models: {
          patient: 'country'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.diagnosisList'),
        value: 'diagnosis_list',
        models: {
          diagnosis: 'diagnosis'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.cptCodeList'),
        value: 'cpt_code_list',
        models: {
          procedure: 'cptCode'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.expenseAccountList'),
        value: 'expense_account_list',
        models: {
          'inv-request': 'expenseAccount',
          pricing: 'expenseAccount'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.aisleLocationList'),
        value: 'aisle_location_list',
        models: {
          inventory: 'aisleLocation',
          'inv-location': 'aisleLocation',
          'inv-purchase': 'aisleLocation',
          'inv-request': ['deliveryAisle', 'locationsAffected' // Special use case that we need to handle
          ]
        }
      }, {
        name: this.get('i18n').t('admin.lookup.warehouseList'),
        value: 'warehouse_list',
        models: {
          inventory: 'location',
          'inv-location': 'location',
          'inv-purchase': 'location',
          'inv-request': ['deliveryLocation', 'locationsAffected' // Special use case that we need to handle
          ]
        }
      }, {
        name: this.get('i18n').t('admin.lookup.incidentDepartments'),
        value: 'incident_departments',
        models: {
          incident: 'department'
        }
      }, {
        defaultValues: 'defaultInventoryTypes',
        name: this.get('i18n').t('admin.lookup.inventoryTypes'),
        value: 'inventory_types',
        models: {
          inventory: 'inventoryType'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.imagingPricingTypes'),
        value: 'imaging_pricing_types',
        models: {
          pricing: 'pricingType'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.labPricingTypes'),
        value: 'lab_pricing_types',
        models: {
          pricing: 'pricingType'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.patientStatusList'),
        value: 'patient_status_list',
        models: {
          patient: 'status'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.physicianList'),
        value: 'physician_list',
        models: {
          appointment: 'provider',
          visit: 'examiner',
          procedure: ['assistant', 'physician']
        }
      }, {
        name: this.get('i18n').t('admin.lookup.procedureList'),
        value: 'procedure_list',
        models: {
          procedure: 'description'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.procedureLocations'),
        value: 'procedure_locations',
        models: {
          procedure: 'location'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.procedurePricingTypes'),
        value: 'procedure_pricing_types',
        models: {
          pricing: 'pricingType'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.radiologists'),
        value: 'radiologists',
        model: {
          imaging: 'radiologist'
        }
      }, {
        name: this.get('i18n').t('labels.sex'),
        value: 'sex',
        model: {
          patient: 'sex'
        }
      }, {
        defaultValues: 'defaultUnitList',
        name: this.get('i18n').t('admin.lookup.unitTypes'),
        value: 'unit_types',
        models: {
          inventory: 'distributionUnit',
          'inv-purchase': 'distributionUnit'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.vendorList'),
        value: 'vendor_list',
        models: {
          'inv-purchase': 'vendor'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.visitLocationList'),
        value: 'visit_location_list',
        models: {
          appointment: 'location',
          visit: 'location'
        }
      }, {
        defaultValues: 'defaultVisitTypes',
        name: this.get('i18n').t('admin.lookup.visitTypes'),
        value: 'visit_types',
        models: {
          visit: 'visitType'
        }
      }, {
        name: this.get('i18n').t('admin.lookup.wardPricingTypes'),
        value: 'ward_pricing_types',
        models: {
          pricing: 'pricingType'
        }
      }];
    }),

    importFile: computed.alias('lookupTypeList.importFile'),

    lookupTitle: computed('model.lookupType', function () {
      var lookupType = this.get('model.lookupType');
      var lookupTypes = this.get('lookupTypes');
      var lookupDesc = undefined;
      if (!_ember['default'].isEmpty(lookupType)) {
        lookupDesc = lookupTypes.findBy('value', lookupType);
        if (!_ember['default'].isEmpty(lookupDesc)) {
          return lookupDesc.name;
        }
      }
    }),

    lookupTypeList: computed('model.lookupType', function () {
      var lookupType = this.get('model.lookupType');
      var lookupItem = undefined;
      if (!_ember['default'].isEmpty(lookupType)) {
        lookupItem = this.get('model').findBy('id', lookupType);
        if (_ember['default'].isEmpty(lookupItem) || !lookupItem.get('isLoaded')) {
          var defaultValues = [];
          var lookupTypes = this.get('lookupTypes');
          var lookupDesc = lookupTypes.findBy('value', lookupType);
          var store = this.get('store');
          if (!_ember['default'].isEmpty(lookupDesc) && !_ember['default'].isEmpty(lookupDesc.defaultValues)) {
            defaultValues = this.get(lookupDesc.defaultValues);
          }
          lookupItem = store.push(store.normalize('lookup', {
            id: lookupType,
            value: defaultValues
          }));
        }
        if (!_ember['default'].isEmpty(lookupItem) && _ember['default'].isEmpty(lookupItem.get('userCanAdd'))) {
          lookupItem.set('userCanAdd', true);
        }
        return lookupItem;
      }
    }),

    lookupTypeValues: computed('model.lookupType', 'lookupTypeList.value.[]', function () {
      var _this = this;

      var lookupType = this.get('model.lookupType');
      var values = this.get('lookupTypeList.value');
      if (!_ember['default'].isEmpty(values)) {
        values.sort(this._sortValues);
        values = values.map(function (value) {
          return {
            canModify: _this._canModifyValue(value, lookupType),
            value: value
          };
        });
      }
      return _ember['default'].ArrayProxy.create({ content: _ember['default'].A(values) });
    }),

    showOrganizeByType: computed('model.lookupType', function () {
      var lookupType = this.get('model.lookupType');
      return !_ember['default'].isEmpty(lookupType) && lookupType.indexOf('pricing_types') > 0;
    }),

    _canModifyValue: function _canModifyValue(value, lookupType) {
      switch (lookupType) {
        case 'inventory_types':
          {
            if (value === 'Medication') {
              return false;
            }
            break;
          }
        case 'lab_pricing_types':
          {
            if (value === 'Lab Procedure') {
              return false;
            }
            break;
          }
        case 'imaging_pricing_types':
          {
            if (value === 'Imaging Procedure') {
              return false;
            }
            break;
          }
        case 'visit_types':
          {
            if (value === 'Admission') {
              return false;
            } else if (value === 'Imaging') {
              return false;
            } else if (value === 'Lab') {
              return false;
            } else if (value === 'Pharmacy') {
              return false;
            }
          }
      }
      return true;
    },

    _importLookupList: function _importLookupList(file) {
      var _this2 = this;

      var fileSystem = get(this, 'fileSystem');
      var lookupTypeList = get(this, 'lookupTypeList');
      var lookupValues = get(lookupTypeList, 'value');
      fileSystem.fileToString(file).then(function (values) {
        (0, _npmCsvParse['default'])(values, { trim: true }, function (err, data) {
          data.forEach(function (row) {
            var _row = _slicedToArray(row, 1);

            var newValue = _row[0];

            if (!lookupValues.includes(newValue)) {
              lookupValues.addObject(newValue);
            }
          });
          lookupValues.sort();
          var i18n = get(_this2, 'i18n');
          var message = i18n.t('admin.lookup.alertImportListSaveMessage');
          var title = i18n.t('admin.lookup.alertImportListSaveTitle');
          lookupTypeList.save().then(function () {
            var lookupLists = get(_this2, 'lookupLists');
            lookupLists.resetLookupList(get(lookupTypeList, 'id'));
            _this2.displayAlert(title, message);
            _this2.set('importFile');
            _this2.set('model.importFileName');
          });
        });
      });
    },

    _sortValues: function _sortValues(a, b) {
      return _ember['default'].compare(a.toLowerCase(), b.toLowerCase());
    },

    activateKeyboard: _ember['default'].on('init', function () {
      this.set('keyboardActivated', true);
    }),

    updateListKeyboard: _ember['default'].on((0, _emberKeyboard.keyDown)('ctrl+KeyS'), (0, _emberKeyboard.keyDown)('cmd+KeyS'), function (event) {
      this.send('updateList');
      event.preventDefault();
    }),

    actions: {
      addValue: function addValue() {
        this.send('openModal', 'admin.lookup.edit', _ember['default'].Object.create({
          isNew: true
        }));
      },
      confirmDeleteValue: function confirmDeleteValue(value) {
        var i18n = this.get('i18n');
        var title = i18n.t('admin.lookup.titles.deleteLookupValue');
        var message = i18n.t('messages.delete', { name: value });
        this.displayConfirm(title, message, 'deleteValue', _ember['default'].Object.create({
          valueToDelete: value
        }));
      },
      deleteValue: function deleteValue(value) {
        var lookupTypeList = this.get('lookupTypeList');
        var lookupTypeValues = lookupTypeList.get('value');
        var valueToDelete = value.get('valueToDelete');
        lookupTypeValues.removeObject(valueToDelete.toString());
        lookupTypeList.save();
      },
      editValue: function editValue(value) {
        if (!_ember['default'].isEmpty(value)) {
          this.send('openModal', 'admin.lookup.edit', _ember['default'].Object.create({
            isNew: false,
            originalValue: value.toString(),
            value: value.toString()
          }));
        }
      },
      importList: function importList() {
        var fileToImport = this.get('importFile');
        if (!fileToImport || !fileToImport.type) {
          this.displayAlert(this.get('i18n').t('admin.lookup.alertImportListTitle'), this.get('i18n').t('admin.lookup.alertImportListMessage'));
        } else {
          this._importLookupList(fileToImport);
        }
      },
      updateList: function updateList() {
        var _this3 = this;

        var lookupTypeList = this.get('lookupTypeList');
        lookupTypeList.save().then(function () {
          var lookupLists = get(_this3, 'lookupLists');
          lookupLists.resetLookupList(get(lookupTypeList, 'id'));
          _this3.displayAlert(_this3.get('i18n').t('admin.lookup.alertImportListUpdateTitle'), _this3.get('i18n').t('admin.lookup.alertImportListUpdateMessage'));
        });
      },
      updateValue: function updateValue(valueObject) {
        var updateList = false;
        var lookupTypeList = this.get('lookupTypeList');
        var values = lookupTypeList.get('value');
        var value = valueObject.get('value');
        if (valueObject.get('isNew')) {
          updateList = true;
        } else {
          var originalValue = valueObject.get('originalValue');
          if (value !== originalValue) {
            values.removeObject(originalValue);
            updateList = true;
            // TODO UPDATE ALL EXISTING DATA LOOKUPS (NODEJS JOB)
          }
        }
        if (updateList) {
          values.addObject(value);
          values = values.sort(this._sortValues);
          lookupTypeList.set('value', values);
          this.send('updateList');
        }
      }
    }
  });
});
define('hospitalrun/tests/admin/lookup/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/lookup/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/lookup/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/lookup/edit/controller', ['exports', 'ember', 'hospitalrun/mixins/is-update-disabled'], function (exports, _ember, _hospitalrunMixinsIsUpdateDisabled) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsIsUpdateDisabled['default'], {
    editController: _ember['default'].inject.controller('admin/lookup'),
    showUpdateButton: true,

    updateButtonAction: 'update',
    updateButtonText: (function () {
      var i18n = this.get('i18n');
      if (this.get('model.isNew')) {
        return i18n.t('buttons.add');
      } else {
        return i18n.t('buttons.update');
      }
    }).property('model.isNew'),

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      update: function update() {
        if (!_ember['default'].isEmpty(this.get('model.value'))) {
          this.get('editController').send('updateValue', this.get('model'));
          this.send('closeModal');
        }
      }
    }
  });
});
define('hospitalrun/tests/admin/lookup/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/lookup/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/lookup/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/lookup/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    hideNewButton: true,
    pageTitle: (0, _emberI18n.translationMacro)('admin.lookup.pageTitle'),
    model: function model() {
      var _this = this;

      return this.store.findAll('lookup')['catch'](function (error) {
        return _this.send('error', error);
      });
    },

    afterModel: function afterModel(model) {
      model.set('lookupType', 'anesthesia_types');
    },

    actions: {
      deleteValue: function deleteValue(value) {
        this.controller.send('deleteValue', value);
      }
    }
  });
});
define('hospitalrun/tests/admin/lookup/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/lookup/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/lookup/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/print-header/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller'], function (exports, _hospitalrunControllersAbstractEditController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    hideCancelButton: true,
    updateCapability: 'update_config',

    afterUpdate: function afterUpdate() {
      this.displayAlert(this.get('i18n').t('admin.header.titles.optionsSaved'), this.get('i18n').t('admin.header.messages.headerSaved'));
    }
  });
});
define('hospitalrun/tests/admin/print-header/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/print-header/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/print-header/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/print-header/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'ember-i18n', 'hospitalrun/utils/unauthorized-error'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _emberI18n, _hospitalrunUtilsUnauthorizedError) {
  'use strict';

  function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    hideNewButton: true,
    newTitle: (0, _emberI18n.translationMacro)('admin.header.newTitle'),
    editTitle: (0, _emberI18n.translationMacro)('admin.header.editTitle'),
    model: function model() {
      var _this = this;

      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        _this.get('store').find('option', 'print_header').then(function (headerOptions) {
          resolve(headerOptions);
        }, function (err) {
          if (_instanceof(err, _hospitalrunUtilsUnauthorizedError['default'])) {
            reject(err);
          } else {
            var store = _this.get('store');
            var newConfig = store.push(store.normalize('option', {
              id: 'print_header',
              value: {
                facilityName: _this.get('i18n').t('admin.header.facilityName'),
                headerLine1: _this.get('i18n').t('admin.header.headerLine1')
              }
            }));
            resolve(newConfig);
          }
        });
      });
    }
  });
});
define('hospitalrun/tests/admin/print-header/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/print-header/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/print-header/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/query/controller', ['exports', 'ember', 'hospitalrun/mixins/edit-panel-props', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunMixinsEditPanelProps, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsEditPanelProps['default'], {
    hideCancelButton: true,
    showUpdateButton: true,
    updateButtonAction: 'query',
    updateButtonText: 'Query', // admin function not requiring i8ln

    objectTypeList: ['appointment', 'imaging', 'inv-location', 'inv-purchase', 'inv-request', 'inventory', 'invoice', 'lab', 'medication', 'patient', 'photo', 'procedure', 'visit', 'vital'],

    objectTypes: _ember['default'].computed.map('objectTypeList', _hospitalrunUtilsSelectValues['default'].selectValuesMap),

    actions: {
      query: function query() {
        var fieldName = this.get('fieldName');
        var objectType = this.get('objectType');
        var queryValue = this.get('queryValue');
        var query = {
          containsValue: {
            value: queryValue,
            keys: [fieldName]
          }
        };
        this.store.query(objectType, query).then((function (results) {
          var _this = this;

          if (_ember['default'].isEmpty(results)) {
            this.set('errorMessage', 'Query returned no results.');
            this.set('haveError', true);
            this.set('showQueryResults', false);
          } else {
            (function () {
              var currentValue = undefined;
              var attributes = ['id'];
              var resultRows = [];
              results.get('firstObject').eachAttribute(function (name) {
                attributes.push(name);
              });

              results.forEach(function (result) {
                var resultRow = [];
                /* resultRow.push({
                    name: 'id',
                    value: result.get('id')
                }); */
                attributes.forEach(function (attribute) {
                  currentValue = result.get(attribute);
                  if (!_ember['default'].isEmpty(currentValue)) {
                    resultRow.push({
                      name: attribute,
                      value: currentValue
                    });
                  }
                });
                resultRows.push(resultRow);
              });
              _this.set('resultRows', resultRows);
              _this.set('haveError', false);
              _this.set('showQueryResults', true);
            })();
          }
        }).bind(this), (function (error) {
          this.set('errorMessage', error);
          this.set('haveError', true);
          this.set('showQueryResults', false);
        }).bind(this));
      }
    }
  });
});
define('hospitalrun/tests/admin/query/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/query/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/query/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/query/route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember', 'hospitalrun/mixins/user-session'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _ember, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _ember['default'].Route.extend(_hospitalrunMixinsUserSession['default'], _emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    beforeModel: function beforeModel() {
      if (!this.currentUserCan('query_db')) {
        this.transitionTo('application');
      }
    }
  });
});
define('hospitalrun/tests/admin/query/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/query/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/query/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/roles/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/user-roles', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsUserRoles, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsUserRoles['default'], _hospitalrunMixinsUserSession['default'], {
    currentRole: '',
    disabledAction: false,
    hideCancelButton: true,
    updateCapability: 'define_user_roles',
    filteredRoles: _ember['default'].computed.filter('userRoles', function (userRole) {
      return userRole.name !== 'System Administrator';
    }),

    availableCapabilities: [{
      name: 'admin',
      capabilities: ['admin', 'loadDb', 'updateConfig', 'defineUserRoles']
    }, {
      name: 'appointments',
      capabilities: ['appointments', 'addAppointment']
    }, {
      name: 'billing',
      capabilities: ['billing', 'addBillingDiagnosis', 'addCharge', 'addPricing', 'addPricingProfile', 'addInvoice', 'addPayment', 'deleteInvoice', 'deletePricing', 'deletePricingProfile', 'editInvoice', 'invoices', 'overrideInvoice', 'pricing', 'cashier', 'listPaidInvoices']
    }, {
      name: 'patients',
      capabilities: ['patients', 'addAllergy', 'addDiagnosis', 'addNote', 'addOperativePlan', 'addOperationReport', 'addPhoto', 'addPatient', 'addProcedure', 'addSocialwork', 'addVisit', 'addVitals', 'admitPatient', 'deleteNote', 'deletePhoto', 'deletePatient', 'deleteAppointment', 'deleteDiagnosis', 'deleteProcedure', 'deleteSocialwork', 'deleteVitals', 'deleteVisit', 'dischargePatient', 'patientReports', 'visits']
    }, {
      name: 'medication',
      capabilities: ['medication', 'addMedication', 'deleteMedication', 'fulfillMedication']
    }, {
      name: 'labs',
      capabilities: ['labs', 'addLab', 'completeLab', 'deleteLab']
    }, {
      name: 'imaging',
      capabilities: ['imaging', 'addImaging', 'completeImaging', 'deleteImaging']
    }, {
      name: 'incident',
      capabilities: ['incident', 'addIncident', 'addIncidentCategory', 'deleteIncident', 'deleteIncidentCategory', 'manageIncidents', 'generateIncidentReport']
    }, {
      name: 'inventory',
      capabilities: ['inventory', 'addInventoryRequest', 'addInventoryItem', 'addInventoryPurchase', 'adjustInventoryLocation', 'deleteInventoryItem', 'fulfillInventory']
    }],

    missingCapablities: _ember['default'].computed('availableCapabilities', 'defaultCapabilities', function () {
      var availableCapabilities = this.get('availableCapabilities');
      var capabilityBySection = Object.keys(availableCapabilities);
      var defaultCapabilities = Object.keys(this.get('defaultCapabilities'));
      var missing = [];
      defaultCapabilities.forEach(function (capability) {
        var capabilityUsed = false;
        capabilityBySection.forEach(function (sectionName) {
          var section = availableCapabilities[sectionName];
          if (section.capabilities.includes(capability.camelize())) {
            capabilityUsed = true;
          }
        });
        if (!capabilityUsed) {
          missing.push(capability + ' - ' + capability.camelize());
        }
      });
      return missing;
    }),

    capabilitySections: _ember['default'].computed.map('availableCapabilities', function (section) {
      var _this = this;

      var mappedCapabilities = [];
      section.capabilities.forEach(function (key) {
        mappedCapabilities.push({
          key: key,
          name: _this.get('i18n').t('admin.roles.capability.' + key)
        });
      });
      return {
        name: this.get('i18n').t('admin.roles.capability.' + section.name),
        capabilities: mappedCapabilities
      };
    }),

    actions: {
      selectRole: function selectRole(role) {
        var _this2 = this;

        var roleToUpdate = this.get('model').findBy('id', role.dasherize());
        this.set('currentRole', role);
        this.set('roleToUpdate', roleToUpdate);
        try {
          if (roleToUpdate) {
            (function () {
              var capabilities = roleToUpdate.get('capabilities');
              _this2.get('availableCapabilities').forEach(function (section) {
                section.capabilities.forEach(function (capability) {
                  if (capabilities.includes(capability)) {
                    _this2.set(capability, true);
                  } else {
                    _this2.set(capability, false);
                  }
                });
              });
            })();
          } else {
            (function () {
              var defaultCapabilities = _this2.get('defaultCapabilities');
              Object.keys(defaultCapabilities).forEach(function (capability) {
                var capabilityRoles = defaultCapabilities[capability];
                if (capabilityRoles.includes(role)) {
                  _this2.set(capability.camelize(), true);
                } else {
                  _this2.set(capability.camelize(), false);
                }
              });
            })();
          }
        } catch (ex) {
          console.log('ex setting role:', ex);
        }
      },

      update: function update() {
        var _this3 = this;

        var currentRole = this.get('currentRole');
        var roleToUpdate = this.get('roleToUpdate');
        if (_ember['default'].isEmpty(roleToUpdate)) {
          roleToUpdate = this.get('store').createRecord('user-role', {
            id: currentRole.dasherize(),
            name: currentRole
          });
        }
        var capabilitiesToSave = [];
        this.get('availableCapabilities').forEach(function (section) {
          section.capabilities.forEach(function (capability) {
            if (_this3.get(capability) === true) {
              capabilitiesToSave.push(capability);
            }
          });
        });
        roleToUpdate.set('capabilities', capabilitiesToSave);
        roleToUpdate.save().then(function () {
          _this3.displayAlert(_this3.get('i18n').t('admin.roles.titles.roleSaved'), _this3.get('i18n').t('admin.roles.messages.roleSaved', { roleName: currentRole }));
        });
      }
    }

  });
});
define('hospitalrun/tests/admin/roles/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/roles/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/roles/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/roles/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    hideNewButton: true,
    newTitle: (0, _emberI18n.translationMacro)('admin.userRoles'),
    editTitle: (0, _emberI18n.translationMacro)('admin.userRoles'),
    model: function model() {
      return this.get('store').findAll('user-role');
    }
  });
});
define('hospitalrun/tests/admin/roles/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/roles/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/roles/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/route', ['exports', 'hospitalrun/routes/abstract-module-route'], function (exports, _hospitalrunRoutesAbstractModuleRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_user',
    allowSearch: false,
    moduleName: 'admin',
    sectionTitle: 'Admin',

    editPath: (function () {
      return 'users.edit';
    }).property(),

    deletePath: (function () {
      return 'users.delete';
    }).property()
  });
});
define('hospitalrun/tests/admin/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/textreplace/controller', ['exports', 'ember', 'ember-validations'], function (exports, _ember, _emberValidations) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_emberValidations['default'], {
    hideCancelButton: true,
    updateCapability: 'update_config',

    createExpansion: (function () {
      var newExpansion = this.get('store').createRecord('text-expansion');
      this.set('newExpansion', newExpansion);
    }).on('init'),

    actions: {
      cancelExpansion: function cancelExpansion() {
        this.createExpansion();
      }
    },

    validations: {
      'newExpansion.from': {
        presence: true
      },
      'newExpansion.to': {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/admin/textreplace/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/textreplace/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/textreplace/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/textreplace/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    pageTitle: (0, _emberI18n.translationMacro)('admin.textReplacements.pageTitle'),
    hideNewButton: true,

    model: function model() {
      var store = this.get('store');
      return store.findAll('text-expansion').then(function (result) {
        return result.filter(function (model) {
          var isNew = model.get('isNew');
          return !isNew;
        });
      });
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      controller.createExpansion();
    },

    actions: {
      addExpansion: function addExpansion(newExpansion) {
        var _this = this;

        newExpansion.save().then(function () {
          _this.refresh();
        })['catch'](function () {
          _this.refresh();
        });
      },

      deleteExpansion: function deleteExpansion(expansion) {
        var _this2 = this;

        expansion.deleteRecord();
        expansion.save().then(function () {
          _this2.refresh();
        })['catch'](function () {
          _this2.refresh();
        });
      }
    }
  });
});
define('hospitalrun/tests/admin/textreplace/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/textreplace/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/textreplace/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/visit-forms/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/visit-types'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsVisitTypes) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsVisitTypes['default'], {
    hideCancelButton: true,
    updateCapability: 'update_config',
    visitTypesList: computed.alias('model.visitTypesList'),

    visitFormsForEditing: computed('model.visitForms', 'visitTypes', function () {
      var visitForms = this.get('model.visitForms');
      var visitTypes = this.get('visitTypes');

      var editList = visitTypes.map(function (visitType) {
        if (!visitForms[visitType.value]) {
          visitForms[visitType.value] = 'initial';
        }
        return {
          type: visitType.value,
          form: visitForms[visitType.value]
        };
      });
      return editList;
    }),

    visitTemplateIds: ['initial', 'followup'],

    visitTemplates: computed(function () {
      var i18n = this.get('i18n');
      var visitTemplateIds = this.get('visitTemplateIds');
      return visitTemplateIds.map(function (currentId) {
        return {
          id: currentId,
          value: i18n.t('admin.visitForms.labels.' + currentId)
        };
      });
    }),

    afterUpdate: function afterUpdate() {
      this.displayAlert(this.get('i18n').t('admin.address.titles.optionsSaved'), this.get('i18n').t('admin.address.messages.addressSaved'));
    },

    actions: {
      selectForm: function selectForm(visitType, event) {
        var visitForms = this.get('model.visitForms');
        visitForms[visitType] = event.target.value;
      }
    }
  });
});
define('hospitalrun/tests/admin/visit-forms/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/visit-forms/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/visit-forms/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/visit-forms/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    hideNewButton: true,
    editTitle: (0, _emberI18n.translationMacro)('admin.visitForms.titles.visitForms'),
    newTitle: _ember['default'].computed.alias('editTitle'),
    model: function model() {
      var store = this.get('store');
      var promiseHash = {
        visitFormsOption: store.find('option', 'visit_forms'),
        visitTypes: store.find('lookup', 'visit_types')
      };
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        _ember['default'].RSVP.hashSettled(promiseHash).then(function (results) {
          var model = _ember['default'].Object.create();
          if (results.visitTypes.state === 'fulfilled') {
            model.set('visitTypesList', results.visitTypes.value);
          }
          if (results.visitFormsOption.state === 'fulfilled') {
            model.set('visitForms', results.visitFormsOption.value);
          } else {
            model.set('visitForms', {});
          }
          resolve(model);
        }, reject);
      });
    }
  });
});
define('hospitalrun/tests/admin/visit-forms/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/visit-forms/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/visit-forms/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/workflow/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller'], function (exports, _hospitalrunControllersAbstractEditController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    hideCancelButton: true,
    updateCapability: 'update_config',

    afterUpdate: function afterUpdate() {
      this.displayAlert(this.get('i18n').t('admin.workflow.titles.optionsSaved'), this.get('i18n').t('admin.workflow.messages.optionsSaved'));
    }
  });
});
define('hospitalrun/tests/admin/workflow/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/workflow/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/workflow/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/admin/workflow/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    hideNewButton: true,
    editTitle: (0, _emberI18n.translationMacro)('admin.workflow.editTitle'),

    model: function model() {
      var store = this.get('store');
      return store.find('option', 'workflow_options')['catch'](function () {
        // create a new workflow_option if none exists
        return store.push(store.normalize('option', {
          id: 'workflow_options',
          value: {
            admissionDeposit: false,
            clinicPrepayment: false,
            followupPrepayment: false,
            outpatientLabPrepayment: false,
            outpatientImagingPrepayment: false,
            outpatientMedicationPrepayment: false
          }
        }));
      });
    }
  });
});
define('hospitalrun/tests/admin/workflow/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - admin/workflow/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'admin/workflow/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/allergy/edit/controller', ['exports', 'ember', 'hospitalrun/controllers/abstract-edit-controller'], function (exports, _ember, _hospitalrunControllersAbstractEditController) {
  'use strict';

  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    i18n: inject.service(),
    editController: alias('model.editController'),
    newAllergy: false,

    additionalButtons: computed('model.isNew', function () {
      var model = get(this, 'model');
      var btn = get(this, 'i18n').t('buttons.delete');
      var isNew = get(model, 'isNew');
      if (!isNew) {
        return [{
          'class': 'btn btn-default warning',
          buttonAction: 'deleteAllergy',
          buttonIcon: 'octicon octicon-x',
          buttonText: btn
        }];
      }
    }),

    title: _ember['default'].computed('model', function () {
      var model = get(this, 'model');
      var i18n = get(this, 'i18n');
      var isNew = get(model, 'isNew');
      if (!isNew) {
        return i18n.t('allergies.titles.editAllergy');
      } else {
        return i18n.t('allergies.titles.addAllergy');
      }
    }),

    beforeUpdate: function beforeUpdate() {
      var allergy = get(this, 'model');
      set(this, 'newAllergy', get(allergy, 'isNew'));
      return _ember['default'].RSVP.Promise.resolve();
    },

    afterUpdate: function afterUpdate(allergy) {
      var newAllergy = get(this, 'newAllergy');
      if (newAllergy) {
        get(this, 'editController').send('addAllergy', allergy);
        set(this, 'name', '');
      } else {
        this.send('closeModal');
      }
    },

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      deleteAllergy: function deleteAllergy() {
        var allergy = get(this, 'model');
        get(this, 'editController').send('deleteAllergy', allergy);
      }
    }
  });
});
define('hospitalrun/tests/allergy/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - allergy/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'allergy/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/app', ['exports', 'ember', 'hospitalrun/tests/resolver', 'ember-load-initializers', 'hospitalrun/tests/config/environment'], function (exports, _ember, _hospitalrunTestsResolver, _emberLoadInitializers, _hospitalrunTestsConfigEnvironment) {
  'use strict';

  var App = undefined;

  _ember['default'].MODEL_FACTORY_INJECTIONS = true;

  App = _ember['default'].Application.extend({
    modulePrefix: _hospitalrunTestsConfigEnvironment['default'].modulePrefix,
    podModulePrefix: _hospitalrunTestsConfigEnvironment['default'].podModulePrefix,
    Resolver: _hospitalrunTestsResolver['default']
  });

  (0, _emberLoadInitializers['default'])(App, _hospitalrunTestsConfigEnvironment['default'].modulePrefix);

  exports['default'] = App;
});
define('hospitalrun/tests/app.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - app.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'app.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/calendar/controller', ['exports', 'hospitalrun/appointments/index/controller', 'hospitalrun/mixins/appointment-statuses', 'moment', 'hospitalrun/mixins/visit-types', 'hospitalrun/utils/select-values', 'ember'], function (exports, _hospitalrunAppointmentsIndexController, _hospitalrunMixinsAppointmentStatuses, _moment, _hospitalrunMixinsVisitTypes, _hospitalrunUtilsSelectValues, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunAppointmentsIndexController['default'].extend(_hospitalrunMixinsAppointmentStatuses['default'], _hospitalrunMixinsVisitTypes['default'], {
    appointmentType: null,
    endDate: null,
    location: null,
    provider: null,
    queryParams: ['appointmentType', 'endDate', 'provider', 'status', 'startDate', 'location', 'viewType'],
    startDate: null,
    status: null,
    viewType: 'agendaWeek',

    appointmentsController: inject.controller('appointments'),
    locations: alias('appointmentsController.locationList.value'),
    physicians: alias('appointmentsController.physicianList.value'),

    calendarDate: computed('startDate', function () {
      var startDate = get(this, 'startDate');
      if (!isEmpty(startDate)) {
        return (0, _moment['default'])(parseInt(startDate));
      }
    }),

    locationList: computed('locations', function () {
      return _hospitalrunUtilsSelectValues['default'].selectValues(get(this, 'locations'), true);
    }),

    physicianList: computed('physicians', function () {
      return _hospitalrunUtilsSelectValues['default'].selectValues(get(this, 'physicians'), true);
    }),

    _getSelectedFilteringCriteria: function _getSelectedFilteringCriteria() {
      var rawCriteria = {
        status: get(this, 'model.selectedStatus'),
        type: get(this, 'model.selectedAppointmentType'),
        provider: get(this, 'model.selectedProvider'),
        location: get(this, 'model.selectedLocation')
      };

      return {
        status: isEmpty(rawCriteria.status) ? null : rawCriteria.status,
        type: isEmpty(rawCriteria.type) ? null : rawCriteria.type,
        provider: isEmpty(rawCriteria.provider) ? null : rawCriteria.provider,
        location: isEmpty(rawCriteria.location) ? null : rawCriteria.location
      };
    },

    actions: {
      clearFilteringCriteria: function clearFilteringCriteria() {
        set(this, 'model.selectedStatus', null);
        set(this, 'model.selectedAppointmentType', null);
        set(this, 'model.selectedProvider', null);
        set(this, 'model.selectedLocation', null);
        this.send('filter');
      },

      createNewAppointment: function createNewAppointment(dateClicked) {
        var newAppointment = this.store.createRecord('appointment', {
          appointmentType: 'Admission',
          allDay: false,
          selectPatient: true,
          startDate: dateClicked.local().toDate()
        });
        this.send('editAppointment', newAppointment);
      },

      filter: function filter() {
        var criteria = this._getSelectedFilteringCriteria();
        this.setProperties({
          appointmentType: criteria.type,
          provider: criteria.provider,
          status: criteria.status,
          location: criteria.location
        });
      },

      handleVisualConfigurationChanged: function handleVisualConfigurationChanged(newConfiguration) {
        this.setProperties(newConfiguration);
      },

      navigateToAppointment: function navigateToAppointment(calendarEvent) {
        this.send('editAppointment', calendarEvent.referencedAppointment);
      },

      updateAppointment: function updateAppointment(calendarEvent) {
        var _this = this;

        var appointmentToUpdate = calendarEvent.referencedAppointment;
        var newEnd = calendarEvent.end.local().toDate();
        var newStart = calendarEvent.start.local().toDate();
        set(appointmentToUpdate, 'startDate', newStart);
        set(appointmentToUpdate, 'endDate', newEnd);
        appointmentToUpdate.save()['catch'](function (error) {
          _this.send('error', error, 'appointments.calendar');
        });
      }
    }
  });
});
define('hospitalrun/tests/appointments/calendar/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/calendar/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/calendar/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/calendar/route', ['exports', 'hospitalrun/appointments/index/route', 'ember', 'ember-i18n'], function (exports, _hospitalrunAppointmentsIndexRoute, _ember, _emberI18n) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunAppointmentsIndexRoute['default'].extend({
    dateIntervalEnd: null,
    dateIntervalStart: null,
    editReturn: 'appointments.calendar',
    filterParams: ['appointmentType', 'provider', 'status', 'location'],
    modelName: 'appointment',
    pageTitle: (0, _emberI18n.translationMacro)('appointments.calendarTitle'),

    queryParams: {
      appointmentType: { refreshModel: true },
      endDate: { refreshModel: true },
      provider: { refreshModel: true },
      status: { refreshModel: true },
      startDate: { refreshModel: true },
      location: { refreshModel: true },
      viewType: { refreshModel: false }
    },

    model: function model(params) {
      return this._super(params).then(this._createCalendarEvents.bind(this)).then(function (calendarEvents) {
        calendarEvents.selectedAppointmentType = params.appointmentType;
        calendarEvents.selectedProvider = params.provider;
        calendarEvents.selectedStatus = params.status;
        calendarEvents.selectedLocation = params.location;
        return calendarEvents;
      });
    },

    _createCalendarEvent: function _createCalendarEvent(appointment) {
      var title = get(appointment, 'patient.displayName');
      var provider = get(appointment, 'provider');
      if (!isEmpty(provider)) {
        title = title + '\n' + provider;
      }
      var event = {
        allDay: get(appointment, 'allDay'),
        title: title,
        start: get(appointment, 'startDate'),
        end: get(appointment, 'endDate'),
        referencedAppointment: appointment
      };
      var location = get(appointment, 'location');
      if (isEmpty(location)) {
        var i18n = get(this, 'i18n');
        location = i18n.t('appointments.labels.noLocation').toString();
      }
      event.resourceId = location.toLowerCase();
      return event;
    },

    _createCalendarEvents: function _createCalendarEvents(appointments) {
      var _this = this;

      var events = [];
      var resources = [];
      appointments.forEach(function (appointment) {
        var event = _this._createCalendarEvent(appointment);
        events.push(event);
        var resourceId = get(event, 'resourceId');
        if (!resources.findBy('id', resourceId)) {
          resources.push({
            id: resourceId,
            title: get(event, 'referencedAppointment.location')
          });
        }
      });
      return {
        events: events,
        resources: resources
      };
    },

    _modelQueryParams: function _modelQueryParams(params) {
      var endDate = params.endDate;
      var startDate = params.startDate;

      if (endDate === null || startDate === null) {
        return this._super(params);
      }
      var searchOptions = {
        startkey: [parseInt(startDate), parseInt(startDate), this._getMinPouchId()],
        endkey: [parseInt(endDate), parseInt(endDate), this._getMaxPouchId()]
      };

      return {
        options: searchOptions,
        mapReduce: 'appointments_by_date'
      };
    }
  });
});
define('hospitalrun/tests/appointments/calendar/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/calendar/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/calendar/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller'], function (exports, _hospitalrunControllersAbstractDeleteController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: 'Delete Appointment',

    afterDeleteAction: (function () {
      var deleteFromPatient = this.get('model.deleteFromPatient');
      if (deleteFromPatient) {
        return 'appointmentDeleted';
      } else {
        return 'closeModal';
      }
    }).property('model.deleteFromPatient')
  });
});
define('hospitalrun/tests/appointments/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/appointment-statuses', 'ember', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/mixins/visit-types'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsAppointmentStatuses, _ember, _hospitalrunMixinsPatientSubmodule, _hospitalrunMixinsVisitTypes) {
  'use strict';

  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsAppointmentStatuses['default'], _hospitalrunMixinsPatientSubmodule['default'], _hospitalrunMixinsVisitTypes['default'], {
    findPatientVisits: false,
    updateCapability: 'add_appointment',

    appointmentsController: inject.controller('appointments'),
    physicianList: alias('appointmentsController.physicianList'),
    surgeryLocationList: alias('appointmentsController.surgeryLocationList'),
    visitLocationList: alias('appointmentsController.locationList'),
    visitTypesList: alias('appointmentsController.visitTypesList'),

    cancelAction: computed('model.returnTo', function () {
      var returnTo = get(this, 'model.returnTo');
      if (_ember['default'].isEmpty(returnTo)) {
        return this._super();
      } else {
        return 'returnTo';
      }
    }),

    isAdmissionAppointment: computed('model.appointmentType', function () {
      var model = get(this, 'model');
      var appointmentType = get(model, 'appointmentType');
      var isAdmissionAppointment = appointmentType === 'Admission';
      return isAdmissionAppointment;
    }),

    lookupListsToUpdate: computed('model.appointmentType', function () {
      var appointmentType = get(this, 'model.appointmentType');
      var lists = [{
        name: 'physicianList',
        property: 'model.provider',
        id: 'physician_list'
      }];
      if (appointmentType === 'Surgery') {
        lists.push({
          name: 'visitLocationList',
          property: 'model.location',
          id: 'visit_location_list'
        });
      } else {
        lists.push({
          name: 'surgeryLocationList',
          property: 'model.location',
          id: 'procedure_locations'
        });
      }
    }),

    showTime: computed('model.allDay', 'isAdmissionAppointment', function () {
      var allDay = get(this, 'model.allDay');
      var isAdmissionAppointment = get(this, 'isAdmissionAppointment');
      return !allDay && isAdmissionAppointment;
    }),

    afterUpdate: function afterUpdate(model) {
      var i18n = get(this, 'i18n');
      var patientInfo = {
        patient: get(model, 'patient.displayName')
      };
      var message = i18n.t('appointments.messages.appointmentSaved', patientInfo);
      var title = i18n.t('appointments.titles.appointmentSaved');
      this.displayAlert(title, message);
    },

    actions: {
      appointmentTypeChanged: function appointmentTypeChanged(appointmentType) {
        var model = get(this, 'model');
        set(model, 'appointmentType', appointmentType);
        var isAdmissionAppointment = get(this, 'isAdmissionAppointment');
        set(model, 'allDay', isAdmissionAppointment);
      }
    }
  });
});
define('hospitalrun/tests/appointments/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'ember', 'moment', 'hospitalrun/mixins/patient-list-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _ember, _moment, _hospitalrunMixinsPatientListRoute, _emberI18n) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var resolve = _ember['default'].RSVP.resolve;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], _hospitalrunMixinsPatientListRoute['default'], {

    editTitle: (0, _emberI18n.translationMacro)('appointments.editTitle'),
    modelName: 'appointment',
    newButtonText: (0, _emberI18n.translationMacro)('appointments.buttons.newButton'),

    newTitle: (0, _emberI18n.translationMacro)('appointments.newTitle'),

    getNewData: function getNewData(params) {
      var idParam = get(this, 'idParam');
      var newData = {
        appointmentType: 'Admission',
        allDay: true,
        selectPatient: true,
        startDate: new Date()
      };
      if (!isEmpty(idParam) && params[idParam] === 'newsurgery') {
        newData.appointmentType = 'Surgery';
        newData.allDay = false;
        newData.endDate = (0, _moment['default'])().add('1', 'hours').toDate();
        newData.returnTo = 'appointments.theater';
      }
      return resolve(newData);
    },

    getScreenTitle: function getScreenTitle(model) {
      var appointmentType = get(model, 'appointmentType');
      if (appointmentType === 'Surgery') {
        var i18n = get(this, 'i18n');
        var isNew = get(model, 'isNew');
        if (isNew) {
          return i18n.t('appointments.titles.newSurgicalAppointment');
        } else {
          return i18n.t('appointments.titles.editSurgicalAppointment');
        }
      } else {
        return this._super(model);
      }
    },

    model: function model(params) {
      var idParam = this.get('idParam');
      var modelId = params[idParam];
      if (!isEmpty(idParam) && modelId.indexOf('new') === 0) {
        if (!isEmpty(params.forPatientId)) {
          var modelPromise = this._super(params);
          return this._setPatientOnModel(modelPromise, params.forPatientId);
        } else if (!isEmpty(params.forVisitId)) {
          var modelPromise = this._super(params);
          return this._setVisitOnModel(modelPromise, params.forVisitId);
        } else {
          return this._createNewRecord(params);
        }
      } else {
        return this._super(params);
      }
    }

  });
});
define('hospitalrun/tests/appointments/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    startKey: [],
    canAddVisit: (function () {
      return this.currentUserCan('add_visit');
    }).property(),

    canEdit: (function () {
      // Add and edit are the same capability
      return this.currentUserCan('add_appointment');
    }).property(),

    canDelete: (function () {
      return this.currentUserCan('delete_appointment');
    }).property(),

    sortProperties: ['startDate', 'endDate'],
    sortAscending: true
  });
});
define('hospitalrun/tests/appointments/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'moment', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _moment, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    editReturn: 'appointments.index',
    modelName: 'appointment',
    newButtonText: (0, _emberI18n.translationMacro)('appointments.buttons.newButton'),
    pageTitle: (0, _emberI18n.translationMacro)('appointments.thisWeek'),

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var endDate = item.get('endDate');
      var id = this._getPouchIdFromItem(item);
      var startDate = item.get('startDate');
      if (endDate && endDate !== '') {
        endDate = new Date(endDate);
        if (endDate.getTime) {
          endDate = endDate.getTime();
        }
      }
      if (startDate && startDate !== '') {
        startDate = new Date(startDate);
        if (startDate.getTime) {
          startDate = startDate.getTime();
        }
      }

      return [startDate, endDate, id];
    },

    _modelQueryParams: function _modelQueryParams() {
      var endOfWeek = (0, _moment['default'])().endOf('week').toDate().getTime();
      var startOfWeek = (0, _moment['default'])().startOf('week').toDate().getTime();
      var maxId = this._getMaxPouchId();
      return {
        options: {
          startkey: [startOfWeek, null, null],
          endkey: [endOfWeek, endOfWeek, maxId]
        },
        mapReduce: 'appointments_by_date'
      };
    },

    actions: {
      editAppointment: function editAppointment(appointment) {
        appointment.set('returnTo', this.get('editReturn'));
        this.send('editItem', appointment);
      }
    }
  });
});
define('hospitalrun/tests/appointments/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/route', ['exports', 'hospitalrun/routes/abstract-module-route', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractModuleRoute, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    addCapability: 'add_appointment',
    allowSearch: false,
    currentScreenTitle: (0, _emberI18n.translationMacro)('appointments.currentScreenTitle'),
    editTitle: (0, _emberI18n.translationMacro)('appointments.editTitle'),
    newTitle: (0, _emberI18n.translationMacro)('appointments.newTitle'),
    moduleName: 'appointments',
    newButtonText: (0, _emberI18n.translationMacro)('appointments.buttons.newButton'),
    sectionTitle: (0, _emberI18n.translationMacro)('appointments.sectionTitle'),

    actions: {
      checkIn: function checkIn(appointment) {
        var patient = appointment.get('patient');
        var visitProps = appointment.getProperties('startDate', 'endDate', 'location', 'patient');
        visitProps.visitType = appointment.get('appointmentType');
        visitProps.examiner = appointment.get('provider');
        visitProps.appointment = appointment;
        visitProps.hidePatientSelection = true;
        visitProps.patient = patient;
        visitProps.returnTo = 'appointments';
        this.transitionTo('visits.edit', 'checkin').then((function (newRoute) {
          newRoute.currentModel.setProperties(visitProps);
          newRoute.controller.getPatientDiagnoses(patient, newRoute.currentModel);
        }).bind(this));
      }
    },

    additionalModels: [{
      name: 'physicianList',
      findArgs: ['lookup', 'physician_list']
    }, {
      name: 'locationList',
      findArgs: ['lookup', 'visit_location_list']
    }, {
      name: 'surgeryLocationList',
      findArgs: ['lookup', 'procedure_locations']
    }, {
      name: 'visitTypesList',
      findArgs: ['lookup', 'visit_types']
    }]
  });
});
define('hospitalrun/tests/appointments/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/search/controller', ['exports', 'hospitalrun/appointments/index/controller', 'hospitalrun/mixins/appointment-statuses', 'ember', 'hospitalrun/utils/select-values', 'hospitalrun/mixins/visit-types'], function (exports, _hospitalrunAppointmentsIndexController, _hospitalrunMixinsAppointmentStatuses, _ember, _hospitalrunUtilsSelectValues, _hospitalrunMixinsVisitTypes) {
  'use strict';

  exports['default'] = _hospitalrunAppointmentsIndexController['default'].extend(_hospitalrunMixinsAppointmentStatuses['default'], _hospitalrunMixinsVisitTypes['default'], {
    appointmentsController: _ember['default'].inject.controller('appointments'),
    appointmentType: null,
    physicians: _ember['default'].computed.alias('appointmentsController.physicianList.value'),
    physicianList: (function () {
      return _hospitalrunUtilsSelectValues['default'].selectValues(this.get('physicians'), true);
    }).property('physicians'),

    provider: null,
    queryParams: ['appointmentType', 'provider', 'status', 'startKey', 'startDate'],
    selectedProvider: null,
    selectedStatus: null,
    sortProperties: null,
    startDate: null,
    startKey: [],
    status: null,
    visitTypesList: _ember['default'].computed.alias('appointmentsController.visitTypesList'),

    actions: {
      search: function search() {
        var appointmentType = this.get('model.selectedAppointmentType');
        var fieldsToSet = {
          startKey: [],
          previousStartKey: null,
          previousStartKeys: []
        };
        var provider = this.get('model.selectedProvider');
        var status = this.get('model.selectedStatus');
        var startDate = this.get('model.selectedStartingDate');

        if (_ember['default'].isEmpty(appointmentType)) {
          fieldsToSet.appointmentType = null;
        } else {
          fieldsToSet.appointmentType = appointmentType;
        }
        if (_ember['default'].isEmpty(provider)) {
          fieldsToSet.provider = null;
        } else {
          fieldsToSet.provider = provider;
        }
        if (_ember['default'].isEmpty(status)) {
          fieldsToSet.status = null;
        } else {
          fieldsToSet.status = status;
        }
        if (!_ember['default'].isEmpty(startDate)) {
          fieldsToSet.startDate = startDate.getTime();
        }
        if (!_ember['default'].isEmpty(fieldsToSet)) {
          this.setProperties(fieldsToSet);
        }
      }
    }
  });
});
define('hospitalrun/tests/appointments/search/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/search/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/search/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/search/route', ['exports', 'hospitalrun/appointments/index/route', 'hospitalrun/mixins/date-format', 'ember', 'moment', 'ember-i18n'], function (exports, _hospitalrunAppointmentsIndexRoute, _hospitalrunMixinsDateFormat, _ember, _moment, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunAppointmentsIndexRoute['default'].extend(_hospitalrunMixinsDateFormat['default'], {
    editReturn: 'appointments.search',
    filterParams: ['appointmentType', 'provider', 'status'],
    modelName: 'appointment',
    pageTitle: (0, _emberI18n.translationMacro)('appointments.searchTitle'),

    queryParams: {
      appointmentType: { refreshModel: true },
      provider: { refreshModel: true },
      status: { refreshModel: true },
      startDate: { refreshModel: true },
      startKey: { refreshModel: true }
    },

    _modelQueryParams: function _modelQueryParams(params) {
      var startDate = params.startDate;

      var maxValue = this.get('maxValue');
      if (_ember['default'].isEmpty(startDate)) {
        startDate = (0, _moment['default'])();
      } else {
        startDate = (0, _moment['default'])(parseInt(startDate));
      }
      var startOfDay = startDate.startOf('day').toDate().getTime();
      var searchOptions = {
        startkey: [startOfDay, null, 'appointment_'],
        endkey: [maxValue, maxValue, 'appointment_' + maxValue]
      };
      return {
        options: searchOptions,
        mapReduce: 'appointments_by_date'
      };
    },

    model: function model(params) {
      return this._super(params).then((function (model) {
        model.setProperties({
          selectedAppointmentType: params.appointmentType,
          selectedProvider: params.provider,
          selectedStatus: params.status
        });
        var startDate = params.startDate;

        startDate = new Date();
        if (!_ember['default'].isEmpty(params.startDate)) {
          startDate.setTime(params.startDate);
        }
        model.set('selectedStartingDate', startDate);
        model.set('display_selectedStartingDate', this._dateFormat(startDate));
        return model;
      }).bind(this));
    }

  });
});
define('hospitalrun/tests/appointments/search/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/search/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/search/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/theater/controller', ['exports', 'hospitalrun/appointments/calendar/controller'], function (exports, _hospitalrunAppointmentsCalendarController) {
  'use strict';

  exports['default'] = _hospitalrunAppointmentsCalendarController['default'].extend({
    dayGroupByResource: {
      day: {
        groupByResource: true
      }
    },

    actions: {
      createNewAppointment: function createNewAppointment(dateClicked) {
        var newAppointment = this.store.createRecord('appointment', {
          appointmentType: 'Surgery',
          selectPatient: true,
          startDate: dateClicked.local().toDate(),
          endDate: dateClicked.add('1', 'hours').local().toDate()
        });
        this.send('editAppointment', newAppointment);
      }
    }
  });
});
define('hospitalrun/tests/appointments/theater/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/theater/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/theater/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/theater/route', ['exports', 'hospitalrun/appointments/calendar/route', 'ember-i18n'], function (exports, _hospitalrunAppointmentsCalendarRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunAppointmentsCalendarRoute['default'].extend({
    editReturn: 'appointments.theater',
    newButtonText: (0, _emberI18n.translationMacro)('appointments.buttons.scheduleSurgery'),
    pageTitle: (0, _emberI18n.translationMacro)('appointments.titles.theaterSchedule'),

    _modelQueryParams: function _modelQueryParams(params) {
      var queryParams = this._super(params);
      queryParams.mapReduce = 'surgical_appointments_by_date';
      return queryParams;
    },

    actions: {
      newItem: function newItem() {
        this.transitionTo('appointments.edit', 'newsurgery');
      }
    }
  });
});
define('hospitalrun/tests/appointments/theater/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/theater/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/theater/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/today/controller', ['exports', 'hospitalrun/appointments/index/controller'], function (exports, _hospitalrunAppointmentsIndexController) {
  'use strict';

  exports['default'] = _hospitalrunAppointmentsIndexController['default'].extend({
    startKey: []
  });
});
define('hospitalrun/tests/appointments/today/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/today/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/today/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/appointments/today/route', ['exports', 'hospitalrun/appointments/index/route', 'moment', 'ember-i18n'], function (exports, _hospitalrunAppointmentsIndexRoute, _moment, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunAppointmentsIndexRoute['default'].extend({
    editReturn: 'appointments.today',
    modelName: 'appointment',
    pageTitle: (0, _emberI18n.translationMacro)('appointments.todayTitle'),

    _modelQueryParams: function _modelQueryParams() {
      var endOfDay = (0, _moment['default'])().endOf('day').toDate().getTime();
      var maxValue = this.get('maxValue');
      var startOfDay = (0, _moment['default'])().startOf('day').toDate().getTime();
      return {
        options: {
          startkey: [startOfDay, null, 'appointment_'],
          endkey: [endOfDay, endOfDay, 'appointment_' + maxValue]
        },
        mapReduce: 'appointments_by_date'
      };
    }
  });
});
define('hospitalrun/tests/appointments/today/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - appointments/today/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'appointments/today/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/authenticators/custom', ['exports', 'ember', 'ember-simple-auth/authenticators/base', 'npm:crypto', 'hospitalrun/mixins/map-oauth-params', 'hospitalrun/mixins/oauth-headers'], function (exports, _ember, _emberSimpleAuthAuthenticatorsBase, _npmCrypto, _hospitalrunMixinsMapOauthParams, _hospitalrunMixinsOauthHeaders) {
  'use strict';

  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var RSVP = _ember['default'].RSVP;
  exports['default'] = _emberSimpleAuthAuthenticatorsBase['default'].extend(_hospitalrunMixinsMapOauthParams['default'], _hospitalrunMixinsOauthHeaders['default'], {
    ajax: _ember['default'].inject.service(),
    config: _ember['default'].inject.service(),
    database: _ember['default'].inject.service(),
    serverEndpoint: '/auth/login',

    standAlone: alias('config.standAlone'),
    usersDB: alias('database.usersDB'),

    _checkUser: function _checkUser(user, oauthConfigs) {
      var _this = this;

      return new RSVP.Promise(function (resolve, reject) {
        var headers = _this.getOAuthHeaders(oauthConfigs);
        _this._makeRequest({ name: user.name }, '/chkuser', headers).then(function (response) {
          if (response.error) {
            reject(response);
          }
          user.displayName = response.displayName;
          user.role = response.role;
          user.prefix = response.prefix;
          resolve(user);
        })['catch'](function () {
          // If chkuser fails, user is probably offline; resolve with currently stored credentials
          resolve(user);
        });
      });
    },

    _finishAuth: function _finishAuth(user, oauthConfigs) {
      var config = this.get('config');
      var database = this.get('database');
      config.setCurrentUser(user);
      return database.setup().then(function () {
        user.oauthConfigs = oauthConfigs;
        return user;
      });
    },

    _makeRequest: function _makeRequest(data, url, headers, method) {
      if (!url) {
        url = this.serverEndpoint;
      }
      var ajax = get(this, 'ajax');
      var params = {
        type: 'POST',
        data: data,
        dataType: 'json',
        contentType: 'application/x-www-form-urlencoded',
        xhrFields: {
          withCredentials: true
        }
      };
      if (method) {
        params.type = method;
      }
      if (headers) {
        params.headers = headers;
      }

      return ajax.request(url, params);
    },

    _saveOAuthConfigs: function _saveOAuthConfigs(params) {
      var config = get(this, 'config');
      var oauthConfigs = this.mapOauthParams(params);
      return config.saveOauthConfigs(oauthConfigs).then(function () {
        return oauthConfigs;
      });
    },

    /**
     Authenticate using google auth credentials or credentials from couch db.
     @method authenticate
     @param {Object} credentials The credentials to authenticate the session with
     @return {RSVP.Promise} A promise that resolves when an access token is successfully acquired from the server and rejects otherwise
     */
    authenticate: function authenticate(credentials) {
      var _this2 = this;

      var standAlone = get(this, 'standAlone');
      if (standAlone === true) {
        return this._authenticateStandAlone(credentials);
      }
      if (credentials.google_auth) {
        return this._saveOAuthConfigs(credentials.params).then(function (oauthConfigs) {
          return _this2._checkUser({ name: credentials.params.i }, oauthConfigs).then(function (user) {
            return _this2._finishAuth(user, oauthConfigs);
          });
        });
      }

      var username = this._getUserName(credentials);
      var data = { name: username, password: credentials.password };
      return this._makeRequest(data).then(function (user) {
        if (user.error) {
          throw new Error(user.errorResult || 'Unauthorized user');
        }
        var userInfo = {
          displayName: user.displayName,
          prefix: user.prefix,
          role: user.role
        };
        userInfo.name = username;

        return _this2._saveOAuthConfigs(user).then(function (oauthConfigs) {
          return _this2._finishAuth(userInfo, oauthConfigs);
        });
      });
    },

    invalidate: function invalidate(data) {
      var standAlone = get(this, 'standAlone');
      if (this.useGoogleAuth || standAlone) {
        return RSVP.resolve();
      } else {
        // Ping the remote db to make sure we still have connectivity before logging off.
        var headers = this.getOAuthHeaders(data.oauthConfigs);
        var remoteDBUrl = get(this, 'database').getRemoteDBUrl();
        return this._makeRequest({}, remoteDBUrl, headers, 'GET');
      }
    },

    restore: function restore(data) {
      if (window.ELECTRON) {
        // config service has not been setup yet, so config.standAlone not available yet
        return RSVP.resolve(data);
      }
      return this._checkUser(data, data.oauthConfigs);
    },

    _authenticateStandAlone: function _authenticateStandAlone(credentials) {
      var _this3 = this;

      var usersDB = get(this, 'usersDB');
      return new RSVP.Promise(function (resolve, reject) {
        var username = _this3._getUserName(credentials);
        usersDB.get('org.couchdb.user:' + username).then(function (user) {
          var salt = user.salt;
          var iterations = user.iterations;
          var derived_key = user.derived_key;
          var password = credentials.password;

          _this3._checkPassword(password, salt, iterations, derived_key, function (error, isCorrectPassword) {
            if (error) {
              reject(error);
            }
            if (!isCorrectPassword) {
              reject(new Error('UNAUTHORIZED'));
            }
            user.role = _this3._getPrimaryRole(user);
            _this3._finishAuth(user, {}).then(resolve, reject);
          });
        }, reject);
      });
    },

    // Based on https://github.com/hoodiehq/hoodie-account-server-api/blob/master/lib/utils/validate-password.js
    _checkPassword: function _checkPassword(password, salt, iterations, derivedKey, callback) {
      _npmCrypto['default'].pbkdf2(password, salt, iterations, 20, 'sha1', function (error, derivedKeyCheck) {
        if (error) {
          return callback(error);
        }
        callback(null, derivedKeyCheck.toString('hex') === derivedKey);
      });
    },

    _getPrimaryRole: function _getPrimaryRole(user) {
      var primaryRole = '';
      if (user.roles) {
        user.roles.forEach(function (role) {
          if (role !== 'user' && role !== 'admin') {
            primaryRole = role;
          }
        });
      }
      return primaryRole;
    },

    _getUserName: function _getUserName(credentials) {
      var username = credentials.identification;
      if (typeof username === 'string' && username) {
        username = username.trim();
      }
      return username;
    }

  });
});
define('hospitalrun/tests/authenticators/custom.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - authenticators/custom.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'authenticators/custom.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/action-checkbox', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    // From http://emberjs.jsbin.com/rwjblue/58/edit?html,css,js,output
    attributeBindings: ['type', 'value'],
    tagName: 'input',
    type: 'checkbox',
    checked: false,

    _updateElementValue: (function () {
      this.set('checked', this.$().prop('checked'));
    }).on('didInsertElement'),

    change: function change() {
      this._updateElementValue();
      this.sendAction('action', this.get('value'), this.get('checked'));
    }
  });
});
define('hospitalrun/tests/components/action-checkbox.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/action-checkbox.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/action-checkbox.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/array-display', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    isArray: (function () {
      var content = this.get('content');
      return _ember['default'].isArray(content);
    }).property('content')
  });
});
define('hospitalrun/tests/components/array-display.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/array-display.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/array-display.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/calendar-control', ['exports', 'ember', 'moment'], function (exports, _ember, _moment) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Component.extend({
    calendarHeader: {
      center: 'agendaDay,agendaWeek,month',
      left: 'title',
      right: 'today prev,next'
    },
    defaultDate: null,
    defaultView: 'agendaWeek',
    height: 500,
    onDayClick: null,
    onEventClick: null,
    onEventDrop: null,
    onEventResize: null,
    userCanEdit: false,

    visualConfiguration: {
      endDate: null,
      startDate: null,
      viewType: null
    },

    /**
     * FullCalendar gives the start and end timestamps based on UTC (eg start at
     * midnight UTC and end at 11:59PM UTC), but for our purposes we want to show
     * users events that start at midnight their timezone and end at 11:59PM in
     * their timezone.  This function takes a UTC timestamps from fullcalendar
     * and returns the timestamp in the users timezone (eg midnight UTC is returned
     * as midnight EST for EST users).
     * @param timestamp A number representing the milliseconds elapsed between
     * 1 January 1970 00:00:00 UTC and the given date.
     * @return String timestamp in users timezone.
     */
    _convertDateFromUTCToLocal: function _convertDateFromUTCToLocal(date) {
      return (0, _moment['default'])(date.utc().format('YYYY-MM-DD HH:mm:ss')).valueOf();
    },

    actions: {
      handleRenderingComplete: function handleRenderingComplete(view) {
        function configurationsDiffer(firstConfig, secondConfig) {
          return firstConfig.startDate !== secondConfig.startDate || firstConfig.endDate !== secondConfig.endDate || firstConfig.viewType !== secondConfig.viewType;
        }

        var currentConfiguration = get(this, 'visualConfiguration');

        var newConfiguration = {
          startDate: this._convertDateFromUTCToLocal(view.intervalStart),
          endDate: this._convertDateFromUTCToLocal(view.intervalEnd),
          viewType: view.name
        };

        if (isEmpty(currentConfiguration.startDate) && isEmpty(currentConfiguration.endDate)) {
          set(this, 'visualConfiguration', newConfiguration);
        } else if (configurationsDiffer(currentConfiguration, newConfiguration)) {
          set(this, 'visualConfiguration', newConfiguration);
          get(this, 'onVisualConfigurationChanged')(newConfiguration);
        }
      }
    }
  });
});
define('hospitalrun/tests/components/calendar-control.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/calendar-control.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/calendar-control.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/charge-quantity', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    i18n: _ember['default'].inject.service(),
    classNames: ['col-xs-2', 'form-group'],
    classNameBindings: ['hasError'],
    tagName: 'td',
    pricingItem: null,

    didReceiveAttrs: function didReceiveAttrs() /* attrs */{
      this._super.apply(this, arguments);
      this.quantitySelected = _ember['default'].computed.alias('model.' + this.get('pricingItem.id'));
    },

    hasError: (function () {
      var quantitySelected = this.get('quantitySelected');
      return !_ember['default'].isEmpty(quantitySelected) && isNaN(quantitySelected);
    }).property('quantitySelected'),

    quantityHelp: (function () {
      if (this.get('hasError')) {
        return this.get('i18n').t('errors.invalidNumber');
      }
    }).property('hasError')

  });
});
define('hospitalrun/tests/components/charge-quantity.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/charge-quantity.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/charge-quantity.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/charges-by-type-tab', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    attributeBindings: ['role'],
    classNameBindings: ['active'],
    index: null,
    pricingList: null,
    role: 'presentation',
    tagName: 'li',

    active: (function () {
      var index = this.get('index');
      return index === 0;
    }).property(),

    tabId: (function () {
      return this.get('pricingType').toLowerCase().dasherize();
    }).property('pricingType'),

    tabHref: (function () {
      var tabId = this.get('tabId');
      return '#' + tabId;
    }).property('tabId')
  });
});
define('hospitalrun/tests/components/charges-by-type-tab.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/charges-by-type-tab.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/charges-by-type-tab.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/checkbox-or-typeahead', ['exports', 'ember', 'hospitalrun/components/select-or-typeahead'], function (exports, _ember, _hospitalrunComponentsSelectOrTypeahead) {
  'use strict';

  exports['default'] = _hospitalrunComponentsSelectOrTypeahead['default'].extend({
    checkboxesPerRow: 5,
    model: null,

    _getLabelFromContent: function _getLabelFromContent(object) {
      var optionLabelPath = this.get('optionLabelPath');
      return _ember['default'].get(object, optionLabelPath);
    },

    _getValueFromContent: function _getValueFromContent(object) {
      var optionValuePath = this.get('optionValuePath');
      return _ember['default'].get(object, optionValuePath);
    },

    _mapCheckboxValues: function _mapCheckboxValues(value) {
      return {
        label: this._getLabelFromContent(value),
        value: this._getValueFromContent(value)
      };
    },

    _setup: (function () {
      var property = this.get('property');
      _ember['default'].defineProperty(this, 'errors', _ember['default'].computed('model.errors.' + property, function () {
        var property = this.get('property');
        var errors = this.get('model.errors.' + property);
        if (!_ember['default'].isEmpty(errors)) {
          return errors[0];
        }
      }));
    }).on('init'),

    checkboxRows: (function () {
      var checkboxRows = [];
      var checkboxesPerRow = this.get('checkboxesPerRow');
      var content = this.get('content');
      var allValues = content.copy();
      while (allValues.length > 0) {
        var checkBoxRowValues = allValues.splice(0, checkboxesPerRow).map(this._mapCheckboxValues.bind(this));
        checkboxRows.push(checkBoxRowValues);
      }
      return checkboxRows;
    }).property('content', 'checkboxesPerRow'),

    actions: {
      checkboxChanged: function checkboxChanged(value, checked) {
        var property = this.get('property');
        var propertyName = 'model.' + property;
        var selectedValues = this.get(propertyName);
        if (!_ember['default'].isArray(selectedValues)) {
          selectedValues = [];
        }
        if (checked && !selectedValues.includes(value)) {
          selectedValues.addObject(value);
        } else if (!checked && selectedValues.includes(value)) {
          selectedValues.removeObject(value);
        }
        this.set(propertyName, selectedValues);
        this.set('selection', selectedValues);
        this.get('model').validate()['catch'](_ember['default'].K);
      }
    }

  });
});
define('hospitalrun/tests/components/checkbox-or-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/checkbox-or-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/checkbox-or-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/custom-form-manager', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  var Component = _ember['default'].Component;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = Component.extend(_hospitalrunUtilsSelectValues['default'], {
    customForms: inject.service(),
    formType: null,
    formsForType: null,
    model: null,
    openModalAction: 'openModal',

    formsForSelect: alias('customForms.formsForSelect'),
    formsToDisplay: alias('customForms.formsToDisplay'),
    showAddButton: alias('customForms.showAddButton'),

    didReceiveAttrs: function didReceiveAttrs() /* attrs */{
      this._super.apply(this, arguments);
      var customForms = get(this, 'customForms');
      var formType = get(this, 'formType');
      var model = get(this, 'model');
      customForms.setupForms(formType, model);
    },

    actions: {
      addForm: function addForm() {
        var model = get(this, 'model');
        var formsForSelect = get(this, 'formsForSelect');
        this.sendAction('openModalAction', 'custom-form-add', _ember['default'].Object.create({
          modelToAddTo: model,
          customForms: formsForSelect
        }));
      }
    }
  });
});
define('hospitalrun/tests/components/custom-form-manager.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/custom-form-manager.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/custom-form-manager.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/custom-form', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Component.extend(_hospitalrunUtilsSelectValues['default'], {
    classNames: 'detail-section-content',
    propertyPrefix: '',
    fieldsByRow: computed('form', 'form.fields.[]', 'form.columns', function () {
      var _this = this;

      var rows = [];
      var form = this.get('form');
      var fields = this.get('form.fields');
      if (!isEmpty(form) && !isEmpty(fields)) {
        (function () {
          var numberOfColumns = _this.getWithDefault('form.columns', 1);
          var currentRow = [];

          var colCount = 0;
          var colWidth = Math.floor(12 / numberOfColumns);
          fields.forEach(function (field) {
            var classNames = field.get('classNames');
            if (!classNames) {
              classNames = '';
            }
            var colSpan = field.get('colSpan') || 1;
            if (colCount === numberOfColumns || colCount + colSpan > numberOfColumns) {
              rows.push(currentRow.slice());
              currentRow = [];
              colCount = 0;
            }
            classNames += ' col-sm-' + colWidth * colSpan;
            field.set('displayClassNames', classNames);
            if (field.get('type') === 'radio') {
              field.set('mappedValues', field.get('values').map(function (value) {
                return _ember['default'].get(value, 'label');
              }));
            }
            currentRow.push(field);
            colCount += colSpan;
          });
          if (colCount > 0) {
            rows.push(currentRow);
          }
        })();
      }
      return rows;
    })
  });
});
define('hospitalrun/tests/components/custom-form.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/custom-form.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/custom-form.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/date-filter', ['exports', 'ember', 'hospitalrun/mixins/pikaday-component'], function (exports, _ember, _hospitalrunMixinsPikadayComponent) {
  'use strict';

  var Component = _ember['default'].Component;
  exports['default'] = Component.extend(_hospitalrunMixinsPikadayComponent['default'], {
    classNames: ['input-group'],
    dateSetAction: 'filter',

    actions: {
      clearFilter: function clearFilter() {
        var $input = this.$('input');
        $input.val('');
        this.sendAction('dateSetAction');
      }
    }
  });
});
define('hospitalrun/tests/components/date-filter.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/date-filter.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/date-filter.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/date-input', ['exports', 'ember', 'ember-rapid-forms/components/html-input', 'hospitalrun/mixins/pikaday-component'], function (exports, _ember, _emberRapidFormsComponentsHtmlInput, _hospitalrunMixinsPikadayComponent) {
  'use strict';

  exports['default'] = _emberRapidFormsComponentsHtmlInput['default'].extend(_hospitalrunMixinsPikadayComponent['default'], {
    _shouldSetDate: function _shouldSetDate(currentDate, picker) {
      return picker && (_ember['default'].isEmpty(currentDate) || _ember['default'].isEmpty(picker.getDate()) || currentDate.getTime && picker.getDate().getTime() !== currentDate.getTime());
    },

    currentDateChangedValue: function currentDateChangedValue() {
      var currentDate = this.get('currentDate');
      var picker = this.get('_picker');
      if (!_ember['default'].isEmpty(currentDate) && this._shouldSetDate(currentDate, picker)) {
        picker.setDate(currentDate);
      }
    },

    format: (function () {
      var showTime = this.get('showTime');
      if (showTime) {
        return 'l h:mm A';
      } else {
        return 'l';
      }
    }).property('mainComponent.showTime'),

    showTimeChanged: (function () {
      var picker = this.get('_picker');
      if (picker) {
        picker.destroy();
        this.didInsertElement();
      }
    }).observes('mainComponent.showTime'),

    dateSet: function dateSet() {
      var currentDate = this.get('currentDate');
      var picker = this.get('_picker');
      if (this._shouldSetDate(currentDate, picker)) {
        var newDate = picker.getDate();
        var mainComponent = this.get('mainComponent');
        var dateSetAction = mainComponent.get('dateSetAction');
        this.set('currentDate', newDate);
        if (!_ember['default'].isEmpty(dateSetAction)) {
          mainComponent.sendAction('dateSetAction', newDate);
        }
      }
    },

    didReceiveAttrs: function didReceiveAttrs() /* attrs */{
      this._super.apply(this, arguments);
      var dateProperty = this.get('mainComponent.originalPropery');
      var displayPropertyName = 'display_' + dateProperty;
      this.currentDate = _ember['default'].computed.alias('mainComponent.model.' + dateProperty);
      this.minDate = _ember['default'].computed.alias('mainComponent.minDate');
      this.maxDate = _ember['default'].computed.alias('mainComponent.maxDate');
      this.showTime = _ember['default'].computed.alias('mainComponent.showTime');
      this.yearRange = _ember['default'].computed.alias('mainComponent.yearRange');
      this.addObserver('mainComponent.model.' + dateProperty, this, this.currentDateChangedValue);
      _ember['default'].Binding.from('mainComponent.model.errors.' + dateProperty).to('mainComponent.model.errors.' + displayPropertyName).connect(this);
    }

  });
});
define('hospitalrun/tests/components/date-input.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/date-input.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/date-input.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/date-picker', ['exports', 'ember-rapid-forms/components/em-input'], function (exports, _emberRapidFormsComponentsEmInput) {
  // Dervied from http://spin.atomicobject.com/2013/10/29/ember-js-date-picker/
  'use strict';

  exports['default'] = _emberRapidFormsComponentsEmInput['default'].extend({
    dateSetAction: null, // Specify an action to fire when a date is selected
    htmlComponent: 'date-input',
    minDate: null,
    maxDate: null,
    originalPropery: null,
    showTime: false,
    yearRange: 10,

    didReceiveAttrs: function didReceiveAttrs(attrs) {
      var dateProperty = this.get('property');
      var displayPropertyName = 'display_' + dateProperty;
      this.set('property', displayPropertyName);
      this.set('originalPropery', dateProperty);
      this._super(attrs);
    }
  });
});
define('hospitalrun/tests/components/date-picker.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/date-picker.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/date-picker.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/date-time-picker', ['exports', 'ember', 'moment'], function (exports, _ember, _moment) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Component.extend({
    i18n: _ember['default'].inject.service(),
    dateTimePickerDate: null,
    datePickerClass: '',
    endDate: _ember['default'].computed.alias('model.endDate'),
    endHour: null,
    endMinute: null,
    label: '',
    startDate: _ember['default'].computed.alias('model.startDate'),
    startHour: null,
    startMinute: null,

    didReceiveAttrs: function didReceiveAttrs() {
      var endDate = (0, _moment['default'])(this.get('endDate'));
      var startDate = (0, _moment['default'])(this.get('startDate'));
      if (isEmpty(endDate)) {
        endDate = startDate;
      }
      this.set('endHour', endDate.hour());
      this.set('endMinute', endDate.minute());
      this.set('startHour', startDate.hour());
      this.set('startMinute', startDate.minute());
      this.set('dateTimePickerDate', startDate.toDate());
      this._updateDates();
    },

    hourList: computed(function () {
      var hour = undefined;
      var hourList = [];
      var i18n = this.get('i18n');
      for (hour = 0; hour < 24; hour++) {
        var hourText = undefined;
        var hourProp = {
          hour: hour % 12 // Show hour in 12 hour am/pm format
        };
        if (hour === 0) {
          hourText = i18n.t('components.dateTimePicker.midnight');
        } else if (hour === 12) {
          hourText = i18n.t('components.dateTimePicker.noon');
        } else if (hour < 12) {
          hourText = i18n.t('components.dateTimePicker.amHour', hourProp);
        } else {
          hourText = i18n.t('components.dateTimePicker.pmHour', hourProp);
        }
        hourList.push({
          name: hourText,
          value: hour
        });
      }
      return hourList;
    }),

    isAllDay: computed('model.allDay', function () {
      var allDay = this.get('model.allDay');
      if (allDay) {
        this.set('startHour', 0);
        this.set('startMinute', 0);
        this.set('endHour', 23);
        this.set('endMinute', 59);
        this._updateDates();
      }
      return allDay;
    }),

    minuteList: computed(function () {
      var minute = undefined;
      var minuteList = [];
      for (minute = 0; minute < 60; minute++) {
        minuteList.push({
          name: String('00' + minute).slice(-2),
          value: minute
        });
      }
      return minuteList;
    }),

    actions: {
      dateChanged: function dateChanged() /* newDate */{
        this._updateDates();
      },

      endHourChanged: function endHourChanged(endHour) {
        this.set('endHour', endHour);
        this._updateDates();
      },

      endMinuteChanged: function endMinuteChanged(endMinute) {
        this.set('endMinute', endMinute);
        this._updateDates();
      },

      startHourChanged: function startHourChanged(startHour) {
        this.set('startHour', startHour);
        this._updateDates();
      },

      startMinuteChanged: function startMinuteChanged(startMinute) {
        this.set('startMinute', startMinute);
        this._updateDates();
      }
    },

    endTimeHasError: computed('model.isValid', function () {
      var endDateError = this.get('model.errors.endDate');
      return endDateError.length > 0;
    }),

    _updateDates: function _updateDates() {
      var _this = this;

      _ember['default'].run.once(this, function () {
        var datePrefixes = ['start', 'end'];
        datePrefixes.forEach(function (datePrefix) {
          var dateProperty = datePrefix + 'Date';
          var dateToChange = _this.get(dateProperty);
          var dateSelected = _this.get('dateTimePickerDate');
          var hour = _this.get(datePrefix + 'Hour');
          var minute = _this.get(datePrefix + 'Minute');
          if (!_ember['default'].isEmpty(dateSelected)) {
            dateToChange = (0, _moment['default'])(dateSelected);
            dateToChange.hour(hour);
            dateToChange.minute(minute);
            _this.set(dateProperty, dateToChange.toDate());
          }
        });
        var model = _this.get('model');
        model.validate()['catch'](_ember['default'].K);
      });
    }

  });
});
define('hospitalrun/tests/components/date-time-picker.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/date-time-picker.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/date-time-picker.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/edit-panel', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    editPanelProps: null,
    cancelAction: 'cancel',

    actions: {
      cancel: function cancel() {
        this.sendAction('cancelAction');
      },
      disabledAction: function disabledAction() {
        this.sendAction('editPanelProps.disabledAction');
      },
      fireButtonAction: function fireButtonAction(buttonAction) {
        this.set(buttonAction, buttonAction);
        this.sendAction(buttonAction);
      },
      updateButtonAction: function updateButtonAction() {
        this.sendAction('editPanelProps.updateButtonAction');
      }
    }
  });
});
define('hospitalrun/tests/components/edit-panel.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/edit-panel.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/edit-panel.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/expand-text', ['exports', 'ember', 'hospitalrun/tests/utils/text-expansion'], function (exports, _ember, _hospitalrunTestsUtilsTextExpansion) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var Component = _ember['default'].Component;
  var htmlSafe = _ember['default'].String.htmlSafe;
  var computed = _ember['default'].computed;
  var inject = _ember['default'].inject;
  exports['default'] = Component.extend({
    i18n: inject.service(),
    store: inject.service(),

    userText: '',

    didInsertElement: function didInsertElement() {
      var _this = this;

      var feedbackDiv = document.createElement('div');
      feedbackDiv.style.position = 'absolute';

      var _$ = this.$('textarea');

      var _$2 = _slicedToArray(_$, 1);

      var textarea = _$2[0];

      this.set('textarea', textarea);
      var textPos = textarea.getBoundingClientRect();
      var fbStyle = feedbackDiv.style;
      fbStyle.top = textPos.bottom + 'px';
      fbStyle.left = textPos.left + 'px';
      fbStyle.width = textarea.offsetWidth + 'px';
      // THIS CODE NEEDS TO BE CHANGED -- INLINE STYLES ARE EVIL!
      fbStyle.backgroundColor = 'lightyellow';
      fbStyle.borderStyle = 'solid';
      fbStyle.borderWidth = '1px';
      fbStyle.borderRadius = '3px';
      fbStyle.paddingLeft = '5px';
      fbStyle.visibility = 'hidden';

      this.set('feedbackDiv', feedbackDiv);
      this.get('feedbackText');
      this.get('activeExpansionSite');

      this.get('store').findAll('text-expansion').then(function (expansions) {
        return expansions.reduce(function (prev, curr) {
          prev[curr.get('from')] = curr.get('to');
          return prev;
        }, {});
      }).then(function (expansions) {
        _this.set('expansions', expansions);
      });
    },

    keyUp: function keyUp(k) {
      var textArea = k.target;
      var text = textArea.value;
      this.set('userText', text);
      this.set('cursorLocation', textArea.selectionStart);
    },

    keyDown: function keyDown(k) {
      if (k.keyCode === 13) {
        var possibleSwaps = this.get('possibleSwaps');
        if (possibleSwaps && possibleSwaps.length === 1) {
          var swapTo = possibleSwaps[0].to;
          var activeSite = this.get('activeExpansionSite');
          var sliceLength = activeSite.match.length;
          var currentText = k.target.value;
          var modifiedText = currentText.slice(0, activeSite.index) + swapTo + currentText.slice(activeSite.index + sliceLength);
          k.target.value = modifiedText;

          k.preventDefault();
          k.returnValue = false;
          k.cancelBubble = true;
          return false;
        }
      }
    },

    // Find an expandable word that has the cursor within it
    activeExpansionSite: computed('userText', 'cursorLocation', function () {

      var userText = this.get('userText');
      var textarea = this.get('textarea');
      if (!textarea) {
        return null;
      }
      var cursorLoc = textarea.selectionStart;
      var subjects = _hospitalrunTestsUtilsTextExpansion['default'].findExpansionSubjects(userText);
      var sites = _hospitalrunTestsUtilsTextExpansion['default'].findExpansionSites(userText, subjects);

      return sites.find(function (s) {
        var endIndex = s.index + s.match.length;

        return cursorLoc >= s.index && cursorLoc <= endIndex;
      });
    }),

    // If an expansion site is active, which possible swaps could occur there?
    possibleSwaps: computed('activeExpansionSite', 'expansions', function () {
      var _this2 = this;

      var activeSite = this.get('activeExpansionSite');

      if (activeSite) {
        var _ret = (function () {
          var expansions = _this2.get('expansions');
          return {
            v: Object.keys(expansions).filter(function (ex) {
              return ex.startsWith(activeSite.term);
            }).sort().map(function (from) {
              return {
                from: from,
                to: expansions[from]
              };
            })
          };
        })();

        if (typeof _ret === 'object') return _ret.v;
      }
    }),

    expansionText: computed('possibleSwaps', 'activeExpansionSite', 'userText', function () {
      var result = '';

      var i18n = this.get('i18n');
      var possibleSwaps = this.get('possibleSwaps');
      if (possibleSwaps) {
        var activeSite = this.get('activeExpansionSite');

        if (possibleSwaps.length === 1) {
          var swapTo = possibleSwaps[0].to;
          result = i18n.t('admin.textReplacements.performExpand', { from: activeSite.term, to: swapTo });
        } else if (possibleSwaps.length > 1) {
          var possible = possibleSwaps.map(function (swap) {
            return swap.from;
          }).join(', ');
          result = i18n.t('admin.textReplacements.possibleExpansions', { possible: possible });
        } else {
          result = i18n.t('admin.textReplacements.noMatches', { term: activeSite.term });
        }
      }

      return result;
    }),

    expansionDivStyle: computed('expansionText', function () {
      var expansionText = this.get('expansionText');
      var visiblility = expansionText ? 'visible' : 'hidden';
      var textArea = this.get('textarea');

      var styleString = 'visibility: ' + visiblility + ';';

      if (textArea) {
        var textPos = textArea.getBoundingClientRect();
        styleString += ' top: ' + textPos.bottom + 'px; left: ' + textPos.left + 'px; width: ' + textArea.offsetWidth + 'px;';
      }
      return htmlSafe(styleString);
    })
  });
});
define('hospitalrun/tests/components/expand-text.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/expand-text.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/expand-text.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/ext-radio', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    includeOtherOption: false,
    otherOptionLabel: null,
    showInline: false,

    haveLabel: (function () {
      var firstRadio = this.get('content.firstObject');
      return !_ember['default'].isEmpty(firstRadio.label);
    }).property('content'),

    radioClass: (function () {
      if (this.get('showInline')) {
        return 'radio-inline';
      } else {
        return 'radio';
      }
    }).property('showInline')
  });
});
define('hospitalrun/tests/components/ext-radio.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/ext-radio.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/ext-radio.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/file-upload', ['exports', 'hospitalrun/components/image-upload'], function (exports, _hospitalrunComponentsImageUpload) {
  'use strict';

  exports['default'] = _hospitalrunComponentsImageUpload['default'].extend({
    resizeFile: false
  });
});
define('hospitalrun/tests/components/file-upload.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/file-upload.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/file-upload.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/icd10-pcs-typeahead', ['exports', 'hospitalrun/components/icd10-typeahead'], function (exports, _hospitalrunComponentsIcd10Typeahead) {
  'use strict';

  exports['default'] = _hospitalrunComponentsIcd10Typeahead['default'].extend();
});
define('hospitalrun/tests/components/icd10-pcs-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/icd10-pcs-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/icd10-pcs-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/icd10-typeahead', ['exports', 'hospitalrun/components/type-ahead'], function (exports, _hospitalrunComponentsTypeAhead) {
  'use strict';

  exports['default'] = _hospitalrunComponentsTypeAhead['default'].extend({
    'class': 'scrollable-typeahead',
    minlength: 2,
    selectionKey: 'id',
    setOnBlur: true,
    templates: {
      header: '<div class="alert alert-success well-sm query-results" role="alert"></div>'
    },

    _sourceQuery: function _sourceQuery(query, cb) {
      // Custom source function
      // Get the data from the Blodhound engine and process it.
      this.bloodhound.get(query, (function (suggestions) {
        cb(suggestions);
        // Set the headers content.
        var $header = this.$('.query-results');
        $header.html('<strong><em>' + query + '</em></strong> returned <strong>' + suggestions.length + '</strong> results');
      }).bind(this));
    },

    _getSource: function _getSource() {
      return this._sourceQuery.bind(this);
    }
  });
});
define('hospitalrun/tests/components/icd10-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/icd10-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/icd10-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/image-upload', ['exports', 'ember', 'ember-rapid-forms/components/em-input'], function (exports, _ember, _emberRapidFormsComponentsEmInput) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _emberRapidFormsComponentsEmInput['default'].extend({
    fileInputEl: null,
    isImage: true,
    resizeFile: true,
    selectedFile: null,
    type: 'file',

    _fileChanged: function _fileChanged() {
      var _this = this;

      var inputEl = this.get('fileInputEl');
      var resize = this.get('resizeFile');

      if (!isEmpty(inputEl.files[0]) && resize) {
        (function () {
          // Derived from https://github.com/josefrichter/resize/blob/master/public/preprocess.js
          var blobURL = window.URL.createObjectURL(inputEl.files[0]); // and get it's URL
          // helper Image object
          var image = new Image();
          image.src = blobURL;
          image.addEventListener('load', (function () {
            window.URL.revokeObjectURL(blobURL);
            // have to wait till it's loaded
            this.set('selectedFile', this._resizeImage(image)); // send it to canvas
            this.set('isImage', true);
          }).bind(_this));
          image.addEventListener('error', (function () {
            // if image load fails, file probably isn't an image, so don't resize
            window.URL.revokeObjectURL(blobURL);
            this.set('selectedFile', inputEl.files[0]);
            this.set('isImage', false);
          }).bind(_this));
        })();
      } else {
        this.set('isImage', false);
        this.set('selectedFile', inputEl.files[0]);
      }
    },

    /**
     * Resize the image to no larger than 1024px so that file sizes
     * are not too large.
     */
    _resizeImage: function _resizeImage(img) {
      // Derived from https://github.com/josefrichter/resize/blob/master/public/preprocess.js
      var canvas = document.createElement('canvas');
      var height = img.height;
      var width = img.width;

      var maxHeight = 1024;
      var maxWidth = 1024;

      // calculate the width and height, constraining the proportions
      if (width > height) {
        if (width > maxWidth) {
          // height *= max_width / width;
          height = Math.round(height *= maxWidth / width);
          width = maxWidth;
        }
      } else {
        if (height > maxHeight) {
          // width *= max_height / height;
          width = Math.round(width *= maxHeight / height);
          height = maxHeight;
        }
      }

      // resize the canvas and draw the image data into it
      canvas.width = width;
      canvas.height = height;
      var ctx = canvas.getContext('2d');
      ctx.drawImage(img, 0, 0, width, height);

      var dataURI = canvas.toDataURL('image/png');
      var binary = atob(dataURI.split(',')[1]);
      var array = [];
      for (var i = 0; i < binary.length; i++) {
        array.push(binary.charCodeAt(i));
      }
      return new Blob([new Uint8Array(array)], { type: 'image/png' });
    },

    didInsertElement: function didInsertElement() {
      var $input = this.$('input');
      this.set('fileInputEl', $input[0]);
      $input.on('change', this._fileChanged.bind(this));
    }

  });
});
define('hospitalrun/tests/components/image-upload.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/image-upload.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/image-upload.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/inventory-location-picker', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    calculatedLocationPickers: null,
    doingSetup: false,
    label: null,
    locationList: null,
    quantityRequested: null,

    locationChange: function locationChange() {
      var doingSetup = this.get('doingSetup');
      var locationList = this.get('locationList');
      var locationPickers = this.get('calculatedLocationPickers');
      var quantityRequested = this.get('quantityRequested');
      var quantitySatisfiedIdx = -1;
      var selectedLocations = [];
      if (!doingSetup) {
        locationPickers.reduce(function (previousValue, item, index) {
          var selectedLocation = item.get('selectedLocation');
          var returnValue = undefined;
          if (_ember['default'].isEmpty(selectedLocation)) {
            returnValue = previousValue;
          } else {
            returnValue = previousValue + selectedLocation.get('quantity');
          }
          if (quantitySatisfiedIdx === -1 && returnValue >= quantityRequested) {
            quantitySatisfiedIdx = index;
          }
          return returnValue;
        }, 0);
        if (quantitySatisfiedIdx > -1) {
          if (locationPickers.get('length') > quantitySatisfiedIdx + 1) {
            locationPickers = locationPickers.slice(0, quantitySatisfiedIdx + 1);
            this.set('calculatedLocationPickers', locationPickers);
          }
        } else {
          locationPickers.addObject(_ember['default'].Object.create());
        }
        this._setupLocationPickers(locationPickers, locationList);
      }
      locationPickers.forEach(function (locationPicker) {
        selectedLocations.addObject(locationPicker.get('selectedLocation'));
      });
      this.set('componentSelectedLocations', selectedLocations);
    },

    _setup: (function () {
      _ember['default'].Binding.from('selectedLocations').to('componentSelectedLocations').connect(this);
    }).on('init'),

    _setupLocationPickers: function _setupLocationPickers(locationPickers, locationList, setInitialLocation) {
      locationPickers.reduce(function (previousValue, item) {
        var selectedLocation = item.get('selectedLocation');
        item.set('subLocationList', previousValue.map(_hospitalrunUtilsSelectValues['default'].selectObjectMap));
        if (!previousValue.includes(selectedLocation) || setInitialLocation) {
          item.set('selectedLocation', previousValue.get('firstObject'));
        }
        item.set('label', 'And');
        return previousValue.filter(function (location) {
          return item.get('selectedLocation.id') !== location.get('id');
        });
      }, locationList);
      var firstPicker = locationPickers.get('firstObject');
      if (!_ember['default'].isEmpty(firstPicker)) {
        firstPicker.set('label', this.get('label'));
      }
      this.set('calculatedLocationPickers', locationPickers);
    },

    locationPickers: (function () {
      var locationList = this.get('locationList');
      var locationPickers = [];
      var quantityRequested = this.get('quantityRequested');
      if (_ember['default'].isEmpty(locationList) || _ember['default'].isEmpty(quantityRequested)) {
        // We need both a locationList and a quantityRequested
        return;
      }
      this.set('doingSetup', true);
      locationList.reduce(function (previousValue, location) {
        if (previousValue < quantityRequested) {
          locationPickers.addObject(_ember['default'].Object.create());
        }
        return previousValue + location.get('quantity');
      }, 0);
      this._setupLocationPickers(locationPickers, locationList, true);
      this.locationChange();
      this.set('doingSetup', false);
      return this.get('calculatedLocationPickers');
    }).property('calculatedLocationPickers', 'locationList', 'quantityRequested')
  });
});
define('hospitalrun/tests/components/inventory-location-picker.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/inventory-location-picker.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/inventory-location-picker.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/inventory-typeahead', ['exports', 'ember', 'hospitalrun/components/type-ahead'], function (exports, _ember, _hospitalrunComponentsTypeAhead) {
  'use strict';

  exports['default'] = _hospitalrunComponentsTypeAhead['default'].extend({
    classNameBindings: ['haveInventoryItems'],
    displayKey: 'name',
    showQuantity: true,
    i18n: _ember['default'].inject.service(),
    store: _ember['default'].inject.service(),

    _mapInventoryItems: function _mapInventoryItems(item) {
      var returnObj = {};
      if (this.get('showQuantity') && item.quantity) {
        returnObj.name = item.name + ' - ' + item.friendlyId + ' (' + this.get('i18n').t('inventory.labels.availableQuantity', { quantity: item.quantity }) + ')';
      } else {
        returnObj.name = item.name + ' - ' + item.friendlyId;
      }
      returnObj[this.get('selectionKey')] = item;
      return returnObj;
    },

    haveInventoryItems: (function () {
      var content = this.get('content');
      if (!_ember['default'].isEmpty(content) && content.length > 0) {
        return 'have-inventory-items';
      }
    }).property('content'),

    mappedContent: (function () {
      var content = this.get('content');
      var mapped = [];
      if (content) {
        mapped = content.map(this._mapInventoryItems.bind(this));
      }
      return mapped;
    }).property('content'),

    contentChanged: (function () {
      var bloodhound = this.get('bloodhound');
      var content = this.get('content');
      if (bloodhound) {
        bloodhound.clear();
        bloodhound.add(content.map(this._mapInventoryItems.bind(this)));
      }
    }).observes('content.[]'),

    itemSelected: function itemSelected(selectedInventoryItem) {
      var _this = this;

      this._super();
      var store = this.get('store');
      if (!_ember['default'].isEmpty(selectedInventoryItem)) {
        store.find('inventory', selectedInventoryItem.id).then(function (inventoryItem) {
          var model = _this.get('model');
          model.set('inventoryItem', inventoryItem);
          _ember['default'].run.once(_this, function () {
            model.validate()['catch'](_ember['default'].K);
          });
        });
      }
    }
  });
});
define('hospitalrun/tests/components/inventory-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/inventory-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/inventory-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/item-listing', ['exports', 'ember', 'hospitalrun/mixins/paging-actions'], function (exports, _ember, _hospitalrunMixinsPagingActions) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsPagingActions['default'], {
    classNames: ['panel', 'panel-primary']
  });
});
define('hospitalrun/tests/components/item-listing.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/item-listing.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/item-listing.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/loading-message', ['exports', 'ember', 'ember-i18n'], function (exports, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'span',
    showLoadingMessages: false,
    loadingMessages: [(0, _emberI18n.translationMacro)('loading.messages.0'), (0, _emberI18n.translationMacro)('loading.messages.1'), (0, _emberI18n.translationMacro)('loading.messages.2'), (0, _emberI18n.translationMacro)('loading.messages.3'), (0, _emberI18n.translationMacro)('loading.messages.4'), (0, _emberI18n.translationMacro)('loading.messages.5'), (0, _emberI18n.translationMacro)('loading.messages.6'), (0, _emberI18n.translationMacro)('loading.messages.7'), (0, _emberI18n.translationMacro)('loading.messages.8'), (0, _emberI18n.translationMacro)('loading.messages.9'), (0, _emberI18n.translationMacro)('loading.messages.10'), (0, _emberI18n.translationMacro)('loading.messages.11')],

    _setRandomMessage: function _setRandomMessage() {
      var loadingMessages = this.get('loadingMessages');
      var idx = Math.floor(Math.random() * loadingMessages.length);
      this.set('message', loadingMessages[idx]);
      this.set('timer', _ember['default'].run.later(this, this._setRandomMessage, 1000));
    },

    didInsertElement: function didInsertElement() {
      this._setRandomMessage();
    },

    willDestroyElement: function willDestroyElement() {
      var timer = this.get('timer');
      if (!_ember['default'].isEmpty(timer)) {
        _ember['default'].run.cancel(timer);
      }
    }
  });
});
define('hospitalrun/tests/components/loading-message.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/loading-message.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/loading-message.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/location-select', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    locationPicker: null,

    _setup: (function () {
      this.locationChange = this.currentLocationChanged.bind(this);
    }).on('init'),

    currentLocationChanged: function currentLocationChanged(newLocation) {
      this.get('locationPicker').set('selectedLocation', newLocation);
      _ember['default'].run.once(this, function () {
        this.get('parentView').locationChange();
      });
    }

  });
});
define('hospitalrun/tests/components/location-select.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/location-select.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/location-select.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/medication-allergy', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var _get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Component.extend({
    classNames: 'ps-info-group long-form',

    canAddAllergy: null,
    patient: null,
    editAllergyAction: 'editAllergy',
    showAddAllergyAction: 'showAddAllergy',

    showAllergies: computed('canAddAllergy', 'patient.allergies.[]', {
      get: function get() {
        var canAddAllergy = _get(this, 'canAddAllergy');
        var patientAllergies = _get(this, 'patient.allergies');
        return canAddAllergy || !isEmpty(patientAllergies);
      }
    }),

    actions: {
      editAllergy: function editAllergy(allergy) {
        this.sendAction('editAllergyAction', allergy);
      },

      createNewAllergy: function createNewAllergy() {
        this.sendAction('showAddAllergyAction');
      }
    }
  });
});
define('hospitalrun/tests/components/medication-allergy.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/medication-allergy.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/medication-allergy.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/modal-dialog', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    i18n: _ember['default'].inject.service(),
    cancelAction: 'cancel',
    closeModalAction: 'closeModal',
    hideCancelButton: false,
    hideUpdateButton: false,
    isUpdateDisabled: false,
    title: '',
    updateButtonAction: '',
    updateButtonClass: '',
    updateButtonText: '',
    cancelButtonText: '',
    cancelBtnText: (function () {
      var cancelText = this.get('cancelButtonText');
      if (_ember['default'].isEmpty(cancelText)) {
        return this.get('i18n').t('buttons.cancel');
      } else {
        return cancelText;
      }
    }).property('cancelButtonText'),
    actions: {
      cancelAction: function cancelAction() {
        this.sendAction('cancelAction');
      },

      fireButtonAction: function fireButtonAction(buttonAction) {
        this.set(buttonAction, buttonAction);
        this.sendAction(buttonAction);
      },

      updateAction: function updateAction() {
        this.sendAction('updateButtonAction');
      }

    },

    didInsertElement: function didInsertElement() {
      var $modal = this.$('.modal').modal();

      $modal.on('hidden.bs.modal', (function () {
        this.sendAction('closeModalAction');
        this.sendAction('cancelAction');
      }).bind(this));
    },

    willDestroyElement: function willDestroyElement() {
      var $modal = this.$('.modal');
      $modal.off('hidden.bs.modal');
      $modal.modal('hide');
      // jquery fixes
      $('body').removeClass('modal-open');
      $('.modal-backdrop').remove();
    }
  });
});
define('hospitalrun/tests/components/modal-dialog.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/modal-dialog.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/modal-dialog.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/nav-menu', ['exports', 'ember', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsUserSession['default'], {
    callCloseSettings: 'closeSettings',
    callNavAction: 'navAction',
    classNames: ['primary-nav-item'],
    isShowing: false,
    nav: null,
    tagName: 'div',

    show: computed('nav', 'session.data.authenticated.userCaps', function () {
      this._setupSubNav();
      return this.currentUserCan(get(this, 'nav').capability);
    }),

    _setup: (function () {
      var nav = get(this, 'nav');
      nav.closeSubnav = (function () {
        set(this, 'isShowing', false);
      }).bind(this);
      this._setupSubNav();
    }).on('init'),

    _setupSubNav: function _setupSubNav() {
      var _this = this;

      var nav = get(this, 'nav');
      nav.subnav.forEach(function (item) {
        set(item, 'show', _this.currentUserCan(item.capability));
      });
    },

    actions: {
      resetNav: function resetNav() {
        this.sendAction('callCloseSettings');
      },

      toggleContent: function toggleContent() {
        this.toggleProperty('isShowing');
        this.sendAction('callNavAction', this.nav);
      }
    }
  });
});
define('hospitalrun/tests/components/nav-menu.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/nav-menu.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/nav-menu.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/nav-paging', ['exports', 'ember', 'hospitalrun/mixins/paging-actions'], function (exports, _ember, _hospitalrunMixinsPagingActions) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsPagingActions['default'], {
    classNames: ['paging-buttons'],
    paginationProps: null
  });
});
define('hospitalrun/tests/components/nav-paging.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/nav-paging.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/nav-paging.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/number-input', ['exports', 'ember-rapid-forms/components/em-input'], function (exports, _emberRapidFormsComponentsEmInput) {
  'use strict';

  exports['default'] = _emberRapidFormsComponentsEmInput['default'].extend({
    sanitizeFunction: function sanitizeFunction(value) {
      return value.replace(new RegExp(/([^0-9|.]+)/g), '');
    },

    focusOut: function focusOut() {
      this._sanitizeValue();
      return this._super();
    },

    keyUp: function keyUp() {
      this._sanitizeValue();
      return this._super();
    },

    _sanitizeValue: function _sanitizeValue() {
      var model = this.get('model');
      var property = this.get('property');
      var currentValue = model.get(property);
      var clean = this.get('sanitizeFunction')(currentValue);
      model.set(property, clean);
    }
  });
});
define('hospitalrun/tests/components/number-input.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/number-input.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/number-input.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/operative-procedures', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports.addProcedure = _addProcedure;
  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  var _get = _ember['default'].get;
  var set = _ember['default'].set;

  function _addProcedure(model) {
    var procedures = _get(model, 'procedures');
    var description = _get(model, 'procedureDescription');
    if (!isEmpty(description)) {
      procedures.addObject({
        description: description
      });
      set(model, 'procedureDescription', null);
    }
  }

  exports['default'] = _ember['default'].Component.extend({
    model: null,
    procedureList: null,
    haveProcedures: computed('model.procedures.[]', {
      get: function get() {
        return !isEmpty(_get(this, 'model.procedures'));
      }
    }),

    actions: {
      addProcedure: function addProcedure() {
        var model = _get(this, 'model');
        _addProcedure(model);
      },

      deleteProcedure: function deleteProcedure(procedureToDelete) {
        var model = _get(this, 'model');
        var procedures = _get(model, 'procedures');
        procedures.removeObject(procedureToDelete);
        model.validate();
      }
    }

  });
});
define('hospitalrun/tests/components/operative-procedures.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/operative-procedures.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/operative-procedures.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/patient-diagnosis', ['exports', 'ember', 'hospitalrun/mixins/patient-diagnosis', 'ember-i18n', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsPatientDiagnosis, _emberI18n, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  var _get = _ember['default'].get;

  var DIAGNOSIS_KEYS = ['diagnosisContainer', 'hideInActiveDiagnoses', 'diagnosisContainer.diagnoses.@each.active', 'diagnosisContainer.diagnoses.@each.secondaryDiagnosis'];

  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsPatientDiagnosis['default'], _hospitalrunMixinsUserSession['default'], {
    i18n: _ember['default'].inject.service(),
    allowAddDiagnosis: false,
    diagnosisContainer: null,
    diagnosisProperty: null,
    diagnosisList: null,
    editDiagnosisAction: 'editDiagnosis',
    hideInActiveDiagnoses: true,
    showAddDiagnosisAction: 'showAddDiagnosis',
    primaryDiagnosisLabel: (0, _emberI18n.translationMacro)('patients.labels.primaryDiagnosis'),
    secondaryDiagnosisLabel: (0, _emberI18n.translationMacro)('patients.labels.secondaryDiagnosis'),

    canAddDiagnosis: computed('allowAddDiagnosis', {
      get: function get() {
        var allowAddDiagnosis = _get(this, 'allowAddDiagnosis');
        return allowAddDiagnosis && this.currentUserCan('add_diagnosis');
      }
    }),

    havePrimaryDiagnoses: computed('primaryDiagnoses.length', {
      get: function get() {
        var primaryDiagnosesLength = this.get('primaryDiagnoses.length');
        return primaryDiagnosesLength > 0;
      }
    }),

    haveSecondaryDiagnoses: computed('secondaryDiagnoses.length', {
      get: function get() {
        var secondaryDiagnosesLength = this.get('secondaryDiagnoses.length');
        return secondaryDiagnosesLength > 0;
      }
    }),

    primaryDiagnoses: computed.apply(undefined, DIAGNOSIS_KEYS.concat([{
      get: function get() {
        var diagnosisContainer = this.get('diagnosisContainer');
        var hideInActiveDiagnoses = this.get('hideInActiveDiagnoses');
        return this.getDiagnoses(diagnosisContainer, hideInActiveDiagnoses, false);
      }
    }])),

    secondaryDiagnoses: computed.apply(undefined, DIAGNOSIS_KEYS.concat([{
      get: function get() {
        var diagnosisContainer = this.get('diagnosisContainer');
        var hideInActiveDiagnoses = this.get('hideInActiveDiagnoses');
        return this.getDiagnoses(diagnosisContainer, hideInActiveDiagnoses, true);
      }
    }])),

    showPrimaryDiagnoses: computed('canAddDiagnosis', 'havePrimaryDiagnoses', {
      get: function get() {
        return this.get('canAddDiagnosis') || this.get('havePrimaryDiagnoses');
      }
    }),

    actions: {
      editDiagnosis: function editDiagnosis(diagnosis) {
        this.sendAction('editDiagnosisAction', diagnosis);
      },

      showAddDiagnosis: function showAddDiagnosis() {
        this.sendAction('showAddDiagnosisAction');
      }
    }

  });
});
define('hospitalrun/tests/components/patient-diagnosis.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/patient-diagnosis.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/patient-diagnosis.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/patient-orders', ['exports', 'ember', 'hospitalrun/mixins/filter-list', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsFilterList, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsFilterList['default'], _hospitalrunMixinsUserSession['default'], {
    editImagingAction: 'editImaging',
    editLabAction: 'editLab',
    editMedicationAction: 'editMedication',
    filterBy: null,
    filterValue: null,
    newImagingAction: 'newImaging',
    newLabAction: 'newLab',
    newMedicationAction: 'newMedication',
    showDeleteImagingAction: 'showDeleteImaging',
    showDeleteLabAction: 'showDeleteLab',
    showDeleteMedicationAction: 'showDeleteMedication',
    sortKey: null,
    sortDesc: false,
    orderTypeFilters: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return [i18n.t('components.patientOrders.labels.imagingOrderType').toString(), i18n.t('components.patientOrders.labels.labOrderType').toString(), i18n.t('components.patientOrders.labels.medicationOrderType').toString()];
    }),

    canAddImaging: _ember['default'].computed(function () {
      return this.currentUserCan('add_imaging');
    }),

    canAddLab: _ember['default'].computed(function () {
      return this.currentUserCan('add_lab');
    }),

    canAddMedication: _ember['default'].computed(function () {
      return this.currentUserCan('add_medication');
    }),

    canDeleteImaging: _ember['default'].computed(function () {
      return this.currentUserCan('delete_imaging');
    }),

    canDeleteLab: _ember['default'].computed(function () {
      return this.currentUserCan('delete_lab');
    }),

    canDeleteMedication: _ember['default'].computed(function () {
      return this.currentUserCan('delete_medication');
    }),

    filteredList: computed('orderList.[]', 'filterBy', 'filterValue', function () {
      var filterBy = this.get('filterBy');
      var filterValue = this.get('filterValue');
      var orderList = this.get('orderList');
      orderList = this.filterList(orderList, filterBy, filterValue);
      return orderList;
    }),

    orderList: computed('visit.imaging.[]', 'visit.labs.[]', 'visit.medication.[]', function () {
      var _this = this;

      var i18n = this.get('i18n');
      var imaging = this.get('visit.imaging');
      var labs = this.get('visit.labs');
      var medication = this.get('visit.medication');
      var orderList = new _ember['default'].A();
      orderList.addObjects(imaging.map(function (item) {
        item.set('orderType', i18n.t('components.patientOrders.labels.imagingOrderType'));
        item.set('name', item.get('imagingType.name'));
        item.set('dateProcessed', item.get('imagingDate'));
        _this._setPermissions(item, 'canAddImaging', 'canDeleteImaging');
        return item;
      }));
      orderList.addObjects(labs.map(function (item) {
        item.set('orderType', i18n.t('components.patientOrders.labels.labOrderType'));
        item.set('name', item.get('labType.name'));
        item.set('dateProcessed', item.get('labDate'));
        _this._setPermissions(item, 'canAddLab', 'canDeleteLab');
        return item;
      }));
      orderList.addObjects(medication.map(function (item) {
        item.set('orderType', i18n.t('components.patientOrders.labels.medicationOrderType'));
        item.set('name', item.get('medicationName'));
        item.set('dateProcessed', item.get('prescriptionDate'));
        item.set('result', '');
        item.set('notes', item.get('prescription'));
        _this._setPermissions(item, 'canAddMedication', 'canDeleteMedication');
        return item;
      }));
      return orderList;
    }),

    sortedOrders: _ember['default'].computed('filteredList', 'sortKey', 'sortDesc', function () {
      var filteredList = this.get('filteredList');
      var sortDesc = this.get('sortDesc');
      var sortKey = this.get('sortKey');
      if (_ember['default'].isEmpty(filteredList) || _ember['default'].isEmpty(sortKey)) {
        return filteredList;
      }
      filteredList = filteredList.sort(function (a, b) {
        var compareA = a.get(sortKey);
        var compareB = b.get(sortKey);
        if (sortKey === 'orderType') {
          compareA = compareA.toString();
          compareB = compareB.toString();
        }
        if (sortDesc) {
          return _ember['default'].compare(compareB, compareA);
        } else {
          return _ember['default'].compare(compareA, compareB);
        }
      });
      return filteredList;
    }),

    i18n: _ember['default'].inject.service(),
    visit: null,

    _setPermissions: function _setPermissions(item, editPerm, deletePerm) {
      if (item.get('canEdit')) {
        if (this.get(editPerm)) {
          item.set('canEdit', true);
        }
        if (this.get(deletePerm)) {
          item.set('canDelete', true);
        }
      }
    },

    actions: {
      filter: function filter(filterBy, filterValue) {
        this.setProperties({
          filterBy: filterBy,
          filterValue: filterValue
        });
      },

      newImaging: function newImaging() {
        this.sendAction('newImagingAction');
      },

      newLab: function newLab() {
        this.sendAction('newLabAction');
      },

      newMedication: function newMedication() {
        this.sendAction('newMedicationAction');
      },

      editOrder: function editOrder(order) {
        var modelName = order.get('constructor.modelName').capitalize();
        this.sendAction('edit' + modelName + 'Action', order);
      },

      showDeleteOrder: function showDeleteOrder(order) {
        var modelName = order.get('constructor.modelName').capitalize();
        this.sendAction('showDelete' + modelName + 'Action', order);
      },

      sortByKey: function sortByKey(sortBy, sortDesc) {
        this.setProperties({
          sortKey: sortBy,
          sortDesc: sortDesc
        });
      }
    }

  });
});
define('hospitalrun/tests/components/patient-orders.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/patient-orders.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/patient-orders.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/patient-summary', ['exports', 'ember', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  var _get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsUserSession['default'], {
    allowAddAllergy: false,
    allowAddDiagnosis: false,
    allowAddOperativePlan: false,
    classNames: ['patient-summary'],
    diagnosisContainer: null,
    diagnosisList: null,
    disablePatientLink: false,
    editAllergyAction: 'editAllergy',
    editDiagnosisAction: 'editDiagnosis',
    editOperativePlanAction: 'editOperativePlan',
    editOperationReportAction: 'editOperationReport',
    editProcedureAction: 'editProcedure',
    hideInActiveDiagnoses: true,
    patient: null,
    patientProcedures: null,
    showAddAllergyAction: 'showAddAllergy',
    showAddDiagnosisAction: 'showAddDiagnosis',
    showPatientAction: 'showPatient',

    canAddAllergy: computed('allowAddAllergy', {
      get: function get() {
        var allowAddAllergy = _get(this, 'allowAddAllergy');
        return allowAddAllergy && this.currentUserCan('add_allergy');
      }
    }),

    canAddOperativePlan: computed('allowAddOperativePlan', {
      get: function get() {
        var allowAddOperativePlan = _get(this, 'allowAddOperativePlan');
        return allowAddOperativePlan && this.currentUserCan('add_operative_plan');
      }
    }),

    currentOperativePlan: computed('patient.operativePlans.@each.status', {
      get: function get() {
        var operativePlans = _get(this, 'patient.operativePlans');
        return operativePlans.findBy('isPlanned', true);
      }
    }),

    haveProcedures: computed('patientProcedures.length', function () {
      var proceduresLength = this.get('patientProcedures.length');
      return proceduresLength > 0;
    }),

    shouldLinkToPatient: computed('disablePatientLink', function () {
      var disablePatientLink = this.get('disablePatientLink');
      return !disablePatientLink;
    }),

    didReceiveAttrs: function didReceiveAttrs() {
      this._super.apply(this, arguments);
      var diagnosisContainer = _get(this, 'diagnosisContainer');
      if (isEmpty(diagnosisContainer)) {
        set(this, 'diagnosisContainer', _get(this, 'patient'));
      }
    },

    actions: {
      addOperativePlan: function addOperativePlan() {
        this.sendAction('editOperativePlanAction');
      },

      editOperativePlan: function editOperativePlan(operativePlan) {
        this.sendAction('editOperativePlanAction', operativePlan);
      },

      linkToPatient: function linkToPatient() {
        var shouldLink = this.get('shouldLinkToPatient');
        if (shouldLink) {
          var patient = this.get('patient');
          var returnTo = this.get('returnTo');
          var returnToContext = this.get('returnToContext');
          patient.set('returnTo', returnTo);
          patient.set('returnToContext', returnToContext);
          this.sendAction('showPatientAction', this.get('patient'));
        }
      },

      editAllergy: function editAllergy(allergy) {
        this.sendAction('editAllergyAction', allergy);
      },

      editDiagnosis: function editDiagnosis(diagnosis) {
        this.sendAction('editDiagnosisAction', diagnosis);
      },

      editProcedure: function editProcedure(procedure) {
        var report = _get(procedure, 'report');
        if (isEmpty(report)) {
          this.sendAction('editProcedureAction', procedure);
        } else {
          this.sendAction('editOperationReportAction', report);
        }
      },

      showAddAllergy: function showAddAllergy() {
        this.sendAction('showAddAllergyAction');
      },

      showAddDiagnosis: function showAddDiagnosis() {
        this.sendAction('showAddDiagnosisAction');
      }
    }
  });
});
define('hospitalrun/tests/components/patient-summary.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/patient-summary.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/patient-summary.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/patient-typeahead', ['exports', 'ember', 'hospitalrun/mixins/patient-name', 'hospitalrun/components/type-ahead'], function (exports, _ember, _hospitalrunMixinsPatientName, _hospitalrunComponentsTypeAhead) {
  'use strict';

  exports['default'] = _hospitalrunComponentsTypeAhead['default'].extend(_hospitalrunMixinsPatientName['default'], {
    displayKey: 'name',
    selectedAction: 'selectedPatientChanged',
    setOnBlur: true,

    _mapPatient: function _mapPatient(item) {
      var returnObj = {};
      returnObj.name = this.getPatientDisplayName(item) + ' - ' + this.getPatientDisplayId(item);
      returnObj[this.get('selectionKey')] = item;
      return returnObj;
    },

    contentChanged: (function () {
      var bloodhound = this.get('bloodhound');
      var content = this.get('content');
      if (bloodhound) {
        bloodhound.clear();
        if (!_ember['default'].isEmpty(content)) {
          bloodhound.add(content.map(this._mapPatient.bind(this)));
        }
      }
    }).observes('content.[]'),

    mappedContent: (function () {
      var content = this.get('content');
      var mapped = [];
      if (content) {
        mapped = content.map(this._mapPatient.bind(this));
      }
      return mapped;
    }).property('content')

  });
});
define('hospitalrun/tests/components/patient-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/patient-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/patient-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/photo-display', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    computedPhotoUrl: null,
    filesystem: _ember['default'].inject.service(),
    isFileSystemEnabled: _ember['default'].computed.alias('filesystem.isFileSystemEnabled'),
    fileName: _ember['default'].computed.alias('photo.fileName'),
    photo: null,
    url: _ember['default'].computed.alias('photo.url'),

    photoUrl: (function () {
      var computedPhotoUrl = this.get('computedPhotoUrl');
      var fileName = this.get('fileName');
      var filesystem = this.get('filesystem');
      var isFileSystemEnabled = this.get('isFileSystemEnabled');
      var url = this.get('url');
      if (!_ember['default'].isEmpty(computedPhotoUrl)) {
        return computedPhotoUrl;
      } else if (isFileSystemEnabled) {
        filesystem.pathToFileSystemURL(fileName).then((function (photoUrl) {
          if (!_ember['default'].isEmpty(photoUrl)) {
            this.set('computedPhotoUrl', photoUrl);
          }
        }).bind(this));
      }
      return url;
    }).property('computedPhotoUrl', 'fileName', 'url')
  });
});
define('hospitalrun/tests/components/photo-display.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/photo-display.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/photo-display.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/price-list', ['exports', 'ember', 'hospitalrun/mixins/charge-actions'], function (exports, _ember, _hospitalrunMixinsChargeActions) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsChargeActions['default'], {
    attributeBindings: ['tabId:id', 'role'],
    charges: _ember['default'].computed.alias('model.charges'),
    classNameBindings: ['active'],
    classNames: ['tab-pane'],
    index: null,
    model: null,
    pricingList: null,
    pricingType: null,
    role: 'tab',
    setChargeQuantityAction: 'setChargeQuantity',

    active: (function () {
      var index = this.get('index');
      return index === 0;
    }).property(),

    pricingListByType: (function () {
      var pricingList = this.get('pricingList');
      var pricingType = this.get('pricingType');
      var rows = [];
      if (!_ember['default'].isEmpty(pricingList)) {
        pricingList = pricingList.filterBy('pricingType', pricingType);
        pricingList = pricingList.map((function (pricingItem) {
          var chargesForItem = this.findChargeForPricingItem(pricingItem, this.get('charges'));
          if (chargesForItem) {
            this.sendAction('setChargeQuantityAction', pricingItem.id, chargesForItem.get('quantity'));
          }
          return pricingItem;
        }).bind(this));
        var offset = 0;
        var _pricingList = pricingList;
        var _length = _pricingList.length;

        while (offset < _length) {
          rows.push(pricingList.slice(offset, offset + 6));
          offset += 6;
        }
      }
      return rows;
    }).property('pricingType', 'pricingList'),

    tabId: (function () {
      return this.get('pricingType').toLowerCase().dasherize();
    }).property('pricingType')

  });
});
define('hospitalrun/tests/components/price-list.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/price-list.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/price-list.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/pricing-typeahead', ['exports', 'ember', 'hospitalrun/components/type-ahead'], function (exports, _ember, _hospitalrunComponentsTypeAhead) {
  'use strict';

  exports['default'] = _hospitalrunComponentsTypeAhead['default'].extend({
    displayKey: 'name',
    setOnBlur: true,

    _mapContentItems: function _mapContentItems() {
      var content = this.get('content');
      if (content) {
        var mapped = content.filter(function (item) {
          return !_ember['default'].isEmpty(item);
        });
        mapped = mapped.map((function (item) {
          var returnObj = {};
          returnObj.name = item.name;
          returnObj[this.get('selectionKey')] = item;
          return returnObj;
        }).bind(this));
        return mapped;
      } else {
        return [];
      }
    }
  });
});
define('hospitalrun/tests/components/pricing-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/pricing-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/pricing-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/print-this', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Component.extend({
    print: true,
    delay: null,

    didInsertElement: function didInsertElement() {
      if (get(this, 'print')) {
        var delay = get(this, 'delay');
        if (!isEmpty(delay) && !isNaN(delay) && delay > 0) {
          _ember['default'].run.later(null, function () {
            window.print();
          }, delay);
        } else {
          _ember['default'].run.scheduleOnce('afterRender', this, function () {
            window.print();
          });
        }
      }
    }
  });
});
define('hospitalrun/tests/components/print-this.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/print-this.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/print-this.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/quantity-calc', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Component.extend({
    quantityGroups: [],
    calculated: null,
    currentUnit: null,
    targetUnit: null,
    unitList: null,

    didReceiveAttrs: function didReceiveAttrs() /* attrs */{
      this._super.apply(this, arguments);
      var quantityGroups = this.get('quantityGroups');
      if (isEmpty(quantityGroups)) {
        var calculated = this.get('calculated');
        var targetUnit = this.get('targetUnit');
        quantityGroups.addObject({
          index: 0,
          unit: targetUnit,
          firstQuantity: true,
          quantity: calculated
        });
      }
    },

    showTotal: (function () {
      var calculated = this.get('calculated');
      var quantityGroups = this.get('quantityGroups');
      if (quantityGroups.length > 1 && !_ember['default'].isEmpty(calculated) && !isNaN(calculated)) {
        return true;
      }
      return false;
    }).property('calculated'),

    currentQuantityGroups: (function () {
      var firstQuantityObject = undefined;
      var quantityGroups = this.get('quantityGroups');
      var targetUnit = this.get('targetUnit');
      firstQuantityObject = quantityGroups.get('firstObject');
      if (!_ember['default'].isEmpty(firstQuantityObject)) {
        var selectedUnit = firstQuantityObject.unit;
        if (_ember['default'].isEmpty(selectedUnit)) {
          this.set('quantityGroups.firstObject.unit', targetUnit);
        } else {
          this.updateCurrentUnit(selectedUnit, 0);
        }
      }
      return quantityGroups;
    }).property('quantityGroups', 'targetUnit'),

    calculateTotal: function calculateTotal() {
      var quantityGroups = this.get('quantityGroups');
      var haveQuantities = false;
      var lastObject = quantityGroups.get('lastObject');
      var targetUnit = this.get('targetUnit');
      haveQuantities = quantityGroups.every(function (item) {
        var quantity = item.quantity;
        var unit = item.unit;

        return !_ember['default'].isEmpty(quantity) && !_ember['default'].isEmpty(unit) && !isNaN(quantity);
      });
      if (haveQuantities && lastObject.unit === targetUnit) {
        var newValue = quantityGroups.reduce(function (previousValue, item) {
          return previousValue * parseInt(item.quantity);
        }, 1);
        this.set('calculated', newValue);
      } else {
        this.set('calculated');
      }
    },

    updateCurrentUnit: function updateCurrentUnit(selectedUnit, index) {
      var targetUnit = this.get('targetUnit');
      var quantityGroups = this.get('quantityGroups');
      var groupLength = quantityGroups.length;
      if (!_ember['default'].isEmpty(targetUnit)) {
        if (selectedUnit === targetUnit) {
          // Done
          if (index < groupLength - 1) {
            quantityGroups.removeAt(index + 1, groupLength - 1 - index);
          }
        } else {
          if (index === groupLength - 1) {
            quantityGroups.addObject({
              unitName: selectedUnit,
              unit: targetUnit,
              index: quantityGroups.length
            });
          } else {
            _ember['default'].set(quantityGroups.objectAt(index + 1), 'unitName', selectedUnit);
          }
        }
        _ember['default'].run.once(this, this.calculateTotal);
      }
    }
  });
});
define('hospitalrun/tests/components/quantity-calc.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/quantity-calc.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/quantity-calc.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/quantity-conv', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    firstQuantity: false,
    quantity: null,
    quantityHelp: null,
    unitName: null,
    unit: null,
    resetUnitName: false,
    targetUnit: _ember['default'].computed.alias('parentView.targetUnit'),
    unitList: null,

    unitClass: (function () {
      var selectedUnit = this.get('unit');
      var targetUnit = this.get('targetUnit');
      var unitClass = 'has-success';
      if (!_ember['default'].isEmpty(targetUnit) && _ember['default'].isEmpty(selectedUnit)) {
        this.set('unitHelp', 'please select a unit');
        unitClass = 'has-error';
      } else {
        if (_ember['default'].isEmpty(targetUnit)) {
          unitClass = '';
        }
        this.set('unitHelp');
      }
      this.get('parentView').updateCurrentUnit(selectedUnit, this.get('index'));
      return unitClass;
    }).property('targetUnit', 'unit'),

    quantityClass: (function () {
      var quantity = this.get('quantity');
      var quantityClass = 'has-success';
      var targetUnit = this.get('targetUnit');
      if (!_ember['default'].isEmpty(targetUnit) && (_ember['default'].isEmpty(quantity) || isNaN(quantity) || quantity < 0)) {
        this.set('quantityHelp', 'not a valid number');
        quantityClass = 'has-error';
      } else {
        if (_ember['default'].isEmpty(targetUnit)) {
          quantityClass = '';
        }
        this.set('quantityHelp');
      }
      _ember['default'].run.once(this, function () {
        this.get('parentView').calculateTotal();
      });
      return quantityClass;
    }).property('quantity', 'targetUnit')
  });
});
define('hospitalrun/tests/components/quantity-conv.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/quantity-conv.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/quantity-conv.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/role-select', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    // possible passed-in values with their defaults:
    content: null,
    prompt: null,
    optionValuePath: 'roles',
    optionLabelPath: 'name',
    action: _ember['default'].K, // action to fire on change

    // shadow the passed-in `selection` to avoid
    // leaking changes to it via a 2-way binding
    _selection: _ember['default'].computed.reads('selection'),

    init: function init() {
      this._super.apply(this, arguments);
      if (!this.get('content')) {
        this.set('content', []);
      }
    },

    actions: {
      change: function change() {
        var selectEl = this.$('select').get(0);
        var selectedIndex = selectEl.selectedIndex;

        var content = this.get('content');

        // decrement index by 1 if we have a prompt
        var hasPrompt = !!this.get('prompt');
        var contentIndex = hasPrompt ? selectedIndex - 1 : selectedIndex;

        var selection = content[contentIndex].roles;

        // set the local, shadowed selection to avoid leaking
        // changes to `selection` out via 2-way binding
        this.set('_selection', selection);

        var changeCallback = this.get('action');
        changeCallback(selection);
      }
    }
  });
});
define('hospitalrun/tests/components/role-select.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/role-select.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/role-select.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/search-listing', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    action: 'allItems',
    actions: {
      allItems: function allItems() {
        this.sendAction();
      }
    }
  });
});
define('hospitalrun/tests/components/search-listing.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/search-listing.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/search-listing.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/select-or-typeahead', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    name: 'select-or-typeahead',
    className: null,
    hint: true,
    label: null,
    list: null,
    optionLabelPath: 'value',
    optionValuePath: 'id',
    property: null,
    prompt: ' ',
    selection: null,
    setOnBlur: true,
    typeAheadType: null,

    content: (function () {
      var list = this.get('list');
      var optionLabelPath = this.get('optionLabelPath');
      var optionValuePath = this.get('optionValuePath');
      var userCanAdd = this.get('userCanAdd');

      if (!_ember['default'].isEmpty(list) && list.get) {
        var contentList = list.get('value');
        if (_ember['default'].isEmpty(contentList)) {
          return [];
        }

        if (!userCanAdd && optionLabelPath === 'value' && optionValuePath === 'id') {
          return contentList.map(_hospitalrunUtilsSelectValues['default'].selectValuesMap);
        } else {
          return contentList;
        }
      }
    }).property('list.value.[]'),

    usePricingTypeAhead: (function () {
      return this.get('typeAheadType') === 'pricing';
    }).property('typeAheadType'),

    userCanAdd: (function () {
      var list = this.get('list');
      if (!_ember['default'].isEmpty(list) && list.get) {
        return list.get('userCanAdd');
      } else {
        return true;
      }
    }).property('list.userCanAdd')
  });
});
define('hospitalrun/tests/components/select-or-typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/select-or-typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/select-or-typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/smart-prescription', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].TextArea.extend(_ember['default'].TargetActionSupport, {
    valueDidChange: _ember['default'].observer('value', function () {
      this.triggerAction({
        action: 'search'
      });
    })
  });
});
define('hospitalrun/tests/components/smart-prescription.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/smart-prescription.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/smart-prescription.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/sortable-column', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    classNames: ['sortable-column'],
    tagName: 'th',
    action: 'sortByKey',
    filterAction: 'filter',
    filterBy: null,
    filteredBy: null,
    filterType: 'list',
    sortDesc: false,
    sortBy: null,
    sortKey: null,
    filtered: false,

    sorted: (function () {
      var sortBy = this.get('sortBy');
      var sortKey = this.get('sortKey');
      return sortBy === sortKey;
    }).property('sortBy', 'sortKey'),

    actions: {
      sort: function sort() {
        var sortBy = this.get('sortBy');
        var sorted = this.get('sorted');
        var sortDesc = false;
        if (sorted) {
          sortDesc = this.toggleProperty('sortDesc');
        }
        this.sendAction('action', sortBy, sortDesc);
      },

      filter: function filter(filterValue) {
        if (_ember['default'].isEmpty(filterValue)) {
          this.set('filtered');
        } else {
          this.set('filtered', true);
        }
        var filterBy = this.get('filterBy');
        var $dropdown = this.$('.dropdown-toggle');
        $dropdown.dropdown('toggle');
        this.sendAction('filterAction', filterBy, filterValue);
      }
    }
  });
});
define('hospitalrun/tests/components/sortable-column.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/sortable-column.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/sortable-column.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/take-photo', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var TAKE_PICTURE = 'takeAPicture';
  var UPLOAD_FILE = 'uploadAFile';
  var FILE_SOURCES = [TAKE_PICTURE, UPLOAD_FILE];

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;

  // Derived from https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Taking_still_photos and
  // https://github.com/samdutton/simpl/blob/master/getusermedia/sources/js/main.js
  exports['default'] = _ember['default'].Component.extend({
    defaultPhotoSource: null,
    canvas: null,
    height: 0,
    isImage: false,
    photo: null,
    photoFile: null,
    photoSource: null,
    selectedCamera: null,
    setupCamera: false,
    sourceLabel: null,
    video: null,
    videoSources: null,
    width: 200,

    i18n: inject.service(),

    canCaptureVideo: computed(function () {
      return navigator.mediaDevices && navigator.mediaDevices.getUserMedia;
    }),

    photoSources: computed(function () {
      var i18n = get(this, 'i18n');
      return FILE_SOURCES.map(function (source) {
        return {
          label: i18n.t('components.takePhoto.labels.' + source),
          value: source
        };
      });
    }),

    sourceChooserLabel: computed('sourceLabel', function () {
      var i18n = get(this, 'i18n');
      var sourceLabel = get(this, 'sourceLabel');
      if (isEmpty(sourceLabel)) {
        return i18n.t('components.takePhoto.how');
      } else {
        return sourceLabel;
      }
    }),

    showFileUpload: computed('photoSource', function () {
      var photoSource = get(this, 'photoSource');
      return photoSource === UPLOAD_FILE;
    }),

    showCameraSelect: computed('videoSources', function () {
      var showFileUpload = get(this, 'showFileUpload');
      var videoSources = get(this, 'videoSources');
      return !showFileUpload && videoSources && videoSources.length > 1;
    }),

    didInsertElement: function didInsertElement() {
      var canCaptureVideo = get(this, 'canCaptureVideo');
      var photoSource = get(this, 'defaultPhotoSource');
      if (isEmpty(photoSource)) {
        if (canCaptureVideo) {
          photoSource = TAKE_PICTURE;
        } else {
          photoSource = UPLOAD_FILE;
        }
      }
      this._photoSourceChanged(photoSource);
    },

    willDestroyElement: function willDestroyElement() {
      this._stopStream();
    },

    /**
     * Setup the specified camera
     */
    _cameraChange: function _cameraChange(selectedCamera) {
      set(this, 'selectedCamera', selectedCamera);
      var stream = get(this, 'stream');
      var video = get(this, 'video');
      if (!_ember['default'].isEmpty(stream)) {
        video.src = null;
        this._stopStream();
      }
      var videoSource = get(this, 'selectedCamera');
      var constraints = {
        audio: false,
        video: {
          deviceId: videoSource
        }
      };
      navigator.mediaDevices.getUserMedia(constraints).then(this._gotStream.bind(this))['catch'](this._errorCallback);
      this._setupVideo();
    },

    _errorCallback: function _errorCallback(error) {
      console.log('navigator.mediaDevices.getUserMedia error: ', error);
    },

    /**
     * Callback for MediaStreamTrack.getSources
     */
    _gotSources: function _gotSources(sourceInfos) {
      var cameraCount = 0;
      var cameraLabel = undefined;
      var videoSources = [];
      for (var i = 0; i !== sourceInfos.length; ++i) {
        var sourceInfo = sourceInfos[i];
        if (sourceInfo.kind === 'videoinput') {
          cameraLabel = 'Camera \'' + ++cameraCount;
          if (sourceInfo.label) {
            cameraLabel += ' (' + sourceInfo.label + ')';
          }
          videoSources.addObject({
            deviceId: sourceInfo.deviceId,
            label: cameraLabel
          });
        }
      }
      set(this, 'videoSources', videoSources);
      if (videoSources.length > 0) {
        set(this, 'selectedCamera', videoSources[0].deviceId);
        this._cameraChange(videoSources[0].deviceId);
      }
    },

    /**
     * Callback handler for getUserMedia.
     */
    _gotStream: function _gotStream(stream) {
      if (this.isDestroyed) {
        this._stopStream(stream);
      } else {
        var video = get(this, 'video');
        set(this, 'stream', stream); // make stream available to object
        video.srcObject = stream;
        video.play();
      }
    },

    _photoSourceChanged: function _photoSourceChanged(photoSource) {
      var camera = this.$('.camera');
      var setupCamera = get(this, 'setupCamera');
      set(this, 'photoSource', photoSource);
      if (photoSource === UPLOAD_FILE) {
        camera.hide();
      } else {
        camera.show();
        if (!setupCamera) {
          var canvas = this.$('canvas').get(0);
          var photo = this.$('img').get(0);
          var video = this.$('video').get(0);
          this.setProperties({
            canvas: canvas,
            photo: photo,
            video: video
          });
          if (navigator.mediaDevices) {
            if (!navigator.mediaDevices.enumerateDevices) {
              if (navigator.mediaDevices.getUserMedia) {
                var constraints = { audio: false, video: true };
                navigator.mediaDevices.getUserMedia(constraints).then(this._gotStream.bind(this))['catch'](this._errorCallback);
                this._setupCanPlayListener(video);
              }
            } else {
              navigator.mediaDevices.enumerateDevices().then(this._gotSources.bind(this))['catch'](this._errorCallback);
              this._setupCanPlayListener(video);
            }
          }
          set(this, 'setupCamera', true);
        }
      }
    },

    _setupCanPlayListener: function _setupCanPlayListener(video) {
      // Remove listener if it was already added before.
      video.removeEventListener('canplay', this._setupVideo.bind(this), false);
      video.addEventListener('canplay', this._setupVideo.bind(this), false);
    },

    /**
     * Setup the dimensions for the video preview and picture elements.
     */
    _setupVideo: function _setupVideo() {
      var canvas = get(this, 'canvas');
      var height = get(this, 'height');
      var video = get(this, 'video');
      var width = get(this, 'width');
      height = video.videoHeight / (video.videoWidth / width);
      video.setAttribute('width', width);
      video.setAttribute('height', height);
      canvas.setAttribute('width', width);
      canvas.setAttribute('height', height);
      this.setProperties({
        height: height,
        width: width
      });
    },

    _stopStream: function _stopStream(stream) {
      var streamToStop = stream || get(this, 'stream');
      if (!_ember['default'].isEmpty(streamToStop)) {
        if (typeof streamToStop.active === 'undefined') {
          streamToStop.stop();
        } else {
          var _streamToStop$getTracks = streamToStop.getTracks();

          var _streamToStop$getTracks2 = _slicedToArray(_streamToStop$getTracks, 1);

          var track = _streamToStop$getTracks2[0];

          track.stop();
        }
      }
    },

    actions: {
      cameraChange: function cameraChange(selectedCamera) {
        this._cameraChange(selectedCamera);
      },

      photoSourceChange: function photoSourceChange(photoSource) {
        this._photoSourceChanged(photoSource);
      },

      takePhoto: function takePhoto() {
        var canvas = get(this, 'canvas');
        var height = get(this, 'height');
        var video = get(this, 'video');
        var width = get(this, 'width');
        canvas.width = width;
        canvas.height = height;
        canvas.getContext('2d').drawImage(video, 0, 0, width, height);
        var data = canvas.toDataURL('image/png');
        var binary = atob(data.split(',')[1]);
        var array = [];
        for (var i = 0; i < binary.length; i++) {
          array.push(binary.charCodeAt(i));
        }
        set(this, 'photoFile', new Blob([new Uint8Array(array)], { type: 'image/png' }));
        set(this, 'isImage', true);
      }
    }

  });
});
define('hospitalrun/tests/components/take-photo.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/take-photo.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/take-photo.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/text-search', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].TextField.extend(_ember['default'].TargetActionSupport, {
    change: function change() {
      this.triggerAction({
        action: 'search'
      });
    },
    didInsertElement: function didInsertElement() {
      this.$().focus();
    }
  });
});
define('hospitalrun/tests/components/text-search.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/text-search.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/text-search.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/type-ahead', ['exports', 'ember-rapid-forms/components/em-input', 'hospitalrun/mixins/typeahead'], function (exports, _emberRapidFormsComponentsEmInput, _hospitalrunMixinsTypeahead) {
  'use strict';

  exports['default'] = _emberRapidFormsComponentsEmInput['default'].extend(_hospitalrunMixinsTypeahead['default']);
});
define('hospitalrun/tests/components/type-ahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/type-ahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/type-ahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/typeahead-filter', ['exports', 'ember', 'hospitalrun/mixins/typeahead'], function (exports, _ember, _hospitalrunMixinsTypeahead) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend(_hospitalrunMixinsTypeahead['default'], {
    classNames: ['input-group'],
    selectedAction: 'filter',
    setOnBlur: false,

    actions: {
      clearFilter: function clearFilter() {
        var $input = this.$('.tt-input');
        $input.val('');
        this.sendAction('selectedAction');
      }
    }
  });
});
define('hospitalrun/tests/components/typeahead-filter.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/typeahead-filter.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/typeahead-filter.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/components/upcoming-appointments', ['exports', 'ember-data', 'ember', 'moment'], function (exports, _emberData, _ember, _moment) {
  'use strict';

  var PromiseArray = _emberData['default'].PromiseArray;
  var Component = _ember['default'].Component;
  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = Component.extend({
    patient: null,

    database: inject.service(),
    store: inject.service(),

    appointments: computed('patient', function () {
      var patient = get(this, 'patient');
      if (!isEmpty(patient)) {
        var database = get(this, 'database');
        var endDate = (0, _moment['default'])().add(10, 'years').toDate().getTime();
        var maxApptId = database.getMaxPouchId('appointment');
        var minApptId = database.getMinPouchId('appointment');
        var patientId = get(patient, 'id');
        var startDate = (0, _moment['default'])().toDate().getTime();
        var store = get(this, 'store');
        var appointmentPromise = store.query('appointment', {
          options: {
            startkey: [patientId, startDate, startDate, minApptId],
            endkey: [patientId, endDate, endDate, maxApptId]
          },
          mapReduce: 'appointments_by_patient'
        });
        return PromiseArray.create({
          promise: appointmentPromise
        });
      }
    })
  });
});
define('hospitalrun/tests/components/upcoming-appointments.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - components/upcoming-appointments.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'components/upcoming-appointments.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/abstract-delete-controller', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend({
    afterDeleteAction: 'closeModal',
    showUpdateButton: true,
    updateButtonText: 'Delete',
    updateButtonAction: 'delete',

    isUpdateDisabled: false,

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      'delete': function _delete() {
        var recordToDelete = this.get('model');
        recordToDelete.set('archived', true);
        recordToDelete.save().then((function () {
          recordToDelete.unloadRecord();
          this.send(this.get('afterDeleteAction'), recordToDelete);
        }).bind(this));
      }
    }
  });
});
define('hospitalrun/tests/controllers/abstract-delete-controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/abstract-delete-controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/abstract-delete-controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/abstract-edit-controller', ['exports', 'ember', 'hospitalrun/mixins/edit-panel-props', 'hospitalrun/mixins/is-update-disabled', 'hospitalrun/mixins/modal-helper', 'ember-concurrency', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsEditPanelProps, _hospitalrunMixinsIsUpdateDisabled, _hospitalrunMixinsModalHelper, _emberConcurrency, _hospitalrunMixinsUserSession) {
  'use strict';

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var RSVP = _ember['default'].RSVP;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsEditPanelProps['default'], _hospitalrunMixinsIsUpdateDisabled['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsUserSession['default'], {
    cancelAction: 'allItems',

    cancelButtonText: (function () {
      var i18n = get(this, 'i18n');
      var hasDirtyAttributes = get(this, 'model.hasDirtyAttributes');
      if (hasDirtyAttributes) {
        return i18n.t('buttons.cancel');
      } else {
        return i18n.t('buttons.returnButton');
      }
    }).property('model.hasDirtyAttributes'),

    disabledAction: (function () {
      var model = get(this, 'model');
      if (model.validate) {
        model.validate()['catch'](_ember['default'].K);
      }
      var isValid = model.get('isValid');
      if (!isValid) {
        return 'showDisabledDialog';
      }
    }).property('model.isValid'),

    isNewOrDeleted: (function () {
      return get(this, 'model.isNew') || get(this, 'model.isDeleted');
    }).property('model.isNew', 'model.isDeleted'),

    lookupLists: inject.service(),
    /**
     *  Lookup lists that should be updated when the model has a new value to add to the lookup list.
     *  lookupListsToUpdate: [{
     *      name: 'countryList', //Name of property containing lookup list
     *      property: 'country', //Corresponding property on model that potentially contains a new value to add to the list
     *      id: 'country_list' //Id of the lookup list to update
     *  }
     */
    lookupListsLastUpdate: null,
    lookupListsToUpdate: null,

    showUpdateButton: (function () {
      var updateButtonCapability = get(this, 'updateCapability');
      return this.currentUserCan(updateButtonCapability);
    }).property('updateCapability'),

    updateButtonAction: 'update',
    updateButtonText: (function () {
      var i18n = get(this, 'i18n');
      if (get(this, 'model.isNew')) {
        return i18n.t('buttons.add');
      } else {
        return i18n.t('buttons.update');
      }
    }).property('model.isNew'),
    updateCapability: null,

    /* Silently update and then fire the specified action. */
    silentUpdate: function silentUpdate(action, whereFrom) {
      var _this = this;

      return this.get('updateTask').perform(true).then(function () {
        _this.send(action, whereFrom);
      });
    },

    /**
     * Task to update the model and perform the before update and after update
     * @param skipAfterUpdate boolean (optional) indicating whether or not
     * to skip the afterUpdate call.
     */
    updateTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(skipAfterUpdate) {
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        var _this2 = this;

        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            context$1$0.prev = 0;
            context$1$0.next = 3;
            return this.beforeUpdate().then(function () {
              return _this2.saveModel(skipAfterUpdate);
            })['catch'](function (err) {
              return _this2._handleError(err);
            });

          case 3:
            context$1$0.next = 8;
            break;

          case 5:
            context$1$0.prev = 5;
            context$1$0.t0 = context$1$0['catch'](0);

            this._handleError(context$1$0.t0);

          case 8:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this, [[0, 5]]);
    })).enqueue(),

    /**
     * Add the specified value to the lookup list if it doesn't already exist in the list.
     * @param lookupList array the lookup list to add to.
     * @param value string the value to add.
     * @param listsToUpdate array the lookup lists that need to be saved.
     * @param listsName string name of the list to add the value to.
     */
    _addValueToLookupList: function _addValueToLookupList(lookupList, value, listsToUpdate, listName) {
      var lookupListValues = lookupList.get('value');
      if (!_ember['default'].isArray(lookupListValues)) {
        lookupListValues = [];
      }
      if (!lookupListValues.includes(value)) {
        lookupListValues.push(value);
        lookupListValues.sort();
        lookupList.set('value', lookupListValues);
        if (!listsToUpdate.includes(lookupList)) {
          listsToUpdate.push(lookupList);
        }
        this.set(listName, lookupList);
      }
    },

    _cancelUpdate: function _cancelUpdate() {
      var cancelledItem = get(this, 'model');
      cancelledItem.rollbackAttributes();
    },

    _handleError: function _handleError(err) {
      if (!err.ignore) {
        var i18n = get(this, 'i18n');
        var errorDetails = err;
        if (!errorDetails.message) {
          errorDetails.message = err.toString();
        }
        this.displayAlert(i18n.t('alerts.errorExclamation'), i18n.t('messages.saveActionException', errorDetails));
      }
    },

    actions: {
      cancel: function cancel() {
        this._cancelUpdate();
        this.send(get(this, 'cancelAction'));
      },

      returnTo: function returnTo() {
        this._cancelUpdate();
        var returnTo = get(this, 'model.returnTo');
        var returnToContext = get(this, 'model.returnToContext');
        if (isEmpty(returnToContext)) {
          this.transitionToRoute(returnTo);
        } else {
          this.transitionToRoute(returnTo, returnToContext);
        }
      },

      showDisabledDialog: function showDisabledDialog() {
        var i18n = get(this, 'i18n');
        this.displayAlert(i18n.t('alerts.warningExclamation'), i18n.t('messages.requiredFieldsCorrectErrors'));
      },

      /**
       * Update the model and perform the before update and after update
       * @param skipAfterUpdate boolean (optional) indicating whether or not
       * to skip the afterUpdate call.
       */
      update: function update(skipAfterUpdate) {
        return this.get('updateTask').perform(skipAfterUpdate);
      }
    },

    /**
     * Override this function to perform logic after record update
     * @param record the record that was just updated.
     */
    afterUpdate: function afterUpdate() {},

    /**
     * Override this function to perform logic before record update.
     * @returns {Promise} Promise that resolves after before update is done.
     */
    beforeUpdate: function beforeUpdate() {
      return _ember['default'].RSVP.Promise.resolve();
    },

    /**
     * Save the model and then (optionally) run the after update.
     * @param skipAfterUpdate boolean (optional) indicating whether or not
     * to skip the afterUpdate call.
     */
    saveModel: function saveModel(skipAfterUpdate) {
      var _this3 = this;

      return get(this, 'model').save().then(function (record) {
        _this3.updateLookupLists().then(function () {
          if (!skipAfterUpdate) {
            _this3.afterUpdate(record);
          }
        });
      })['catch'](function (error) {
        _this3.send('error', error);
      });
    },

    /**
     * Update any new values added to a lookup list
     */
    updateLookupLists: function updateLookupLists() {
      var _this4 = this;

      var lookupListsToUpdate = get(this, 'lookupListsToUpdate');
      var listsToUpdate = _ember['default'].A();
      var lookupPromises = [];
      if (!isEmpty(lookupListsToUpdate)) {
        lookupListsToUpdate.forEach(function (list) {
          var propertyValue = get(_this4, get(list, 'property'));
          var lookupListToUpdate = get(_this4, get(list, 'name'));
          if (!isEmpty(propertyValue)) {
            if (!isEmpty(lookupListToUpdate) && lookupListToUpdate.then) {
              lookupPromises.push(lookupListToUpdate.then(function (lookupList) {
                return _this4._checkListForUpdate(list, lookupList, listsToUpdate, propertyValue);
              }));
            } else {
              _this4._checkListForUpdate(list, lookupListToUpdate, listsToUpdate, propertyValue);
            }
          }
        });
        if (!isEmpty(lookupPromises)) {
          return RSVP.all(lookupPromises).then(function () {
            var lookupLists = get(_this4, 'lookupLists');
            var updatePromises = [];
            listsToUpdate.forEach(function (list) {
              updatePromises.push(list.save().then(function () {
                set(_this4, 'lookupListsLastUpdate', new Date().getTime());
                lookupLists.resetLookupList(get(list, 'id'));
              }));
            });
            return RSVP.all(updatePromises);
          });
        }
      }
      return RSVP.resolve();
    },

    _checkListForUpdate: function _checkListForUpdate(listInfo, lookupList, listsToUpdate, propertyValue) {
      var store = get(this, 'store');
      if (!lookupList) {
        lookupList = store.push(store.normalize('lookup', {
          id: listInfo.id,
          value: [],
          userCanAdd: true
        }));
      }
      if (_ember['default'].isArray(propertyValue)) {
        propertyValue.forEach((function (value) {
          this._addValueToLookupList(lookupList, value, listsToUpdate, listInfo.name);
        }).bind(this));
      } else {
        this._addValueToLookupList(lookupList, propertyValue, listsToUpdate, listInfo.name);
      }
      return lookupList;
    }

  });
});
define('hospitalrun/tests/controllers/abstract-edit-controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/abstract-edit-controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/abstract-edit-controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/abstract-paged-controller', ['exports', 'ember', 'hospitalrun/mixins/pagination-props', 'hospitalrun/mixins/progress-dialog', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsPaginationProps, _hospitalrunMixinsProgressDialog, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsPaginationProps['default'], _hospitalrunMixinsProgressDialog['default'], _hospitalrunMixinsUserSession['default'], {
    addPermission: null,
    deletePermission: null,
    nextStartKey: null,
    previousStartKey: null,
    previousStartKeys: [],
    progressMessage: 'Loading Records.  Please wait...',
    progressTitle: 'Loading',
    queryParams: ['startKey', 'sortKey', 'sortDesc'],
    sortDesc: false,
    sortKey: null,

    canAdd: (function () {
      return this.currentUserCan(this.get('addPermission'));
    }).property(),

    canDelete: (function () {
      return this.currentUserCan(this.get('deletePermission'));
    }).property(),

    canEdit: (function () {
      // Default to using add permission
      return this.currentUserCan(this.get('addPermission'));
    }).property(),

    showActions: (function () {
      return this.get('canAdd') || this.get('canEdit') || this.get('canDelete');
    }).property('canAdd', 'canEdit', 'canDelete'),

    disablePreviousPage: (function () {
      return _ember['default'].isEmpty(this.get('previousStartKey'));
    }).property('previousStartKey'),

    disableNextPage: (function () {
      return _ember['default'].isEmpty(this.get('nextStartKey'));
    }).property('nextStartKey'),

    showPagination: (function () {
      return !_ember['default'].isEmpty(this.get('previousStartKey')) || !_ember['default'].isEmpty(this.get('nextStartKey'));
    }).property('nextStartKey', 'previousStartKey'),

    hasRecords: _ember['default'].computed('model.length', {
      get: function get() {
        var model = this.get('model');
        if (!_ember['default'].isEmpty(model)) {
          return model.get('length') > 0;
        } else {
          return false;
        }
      }
    }),

    actions: {
      nextPage: function nextPage() {
        var key = this.get('nextStartKey');
        var previousStartKeys = this.get('previousStartKeys');
        var firstKey = this.get('firstKey');
        this.set('previousStartKey', firstKey);
        previousStartKeys.push(firstKey);
        this.set('startKey', key);
        this.showProgressModal();
      },
      previousPage: function previousPage() {
        var key = this.get('previousStartKey');
        var previousStartKeys = this.get('previousStartKeys');
        previousStartKeys.pop();
        this.set('startKey', key);
        this.set('previousStartKey', previousStartKeys.pop());
        this.set('previousStartKeys', previousStartKeys);
        this.showProgressModal();
      },
      sortByKey: function sortByKey(sortKey, sortDesc) {
        this.setProperties({
          previousStartKey: null,
          previousStartKeys: [],
          nextStartKey: null,
          sortDesc: sortDesc,
          sortKey: sortKey,
          startKey: null,
          firstKey: null
        });
        this.showProgressModal();
      }
    }
  });
});
define('hospitalrun/tests/controllers/abstract-paged-controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/abstract-paged-controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/abstract-paged-controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/abstract-report-controller', ['exports', 'ember', 'hospitalrun/mixins/date-format', 'hospitalrun/mixins/modal-helper', 'moment', 'hospitalrun/mixins/number-format', 'hospitalrun/mixins/pagination-props', 'hospitalrun/mixins/pouchdb', 'hospitalrun/mixins/progress-dialog'], function (exports, _ember, _hospitalrunMixinsDateFormat, _hospitalrunMixinsModalHelper, _moment, _hospitalrunMixinsNumberFormat, _hospitalrunMixinsPaginationProps, _hospitalrunMixinsPouchdb, _hospitalrunMixinsProgressDialog) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsDateFormat['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsNumberFormat['default'], _hospitalrunMixinsPaginationProps['default'], _hospitalrunMixinsPouchdb['default'], _hospitalrunMixinsProgressDialog['default'], {
    defaultErrorMessage: 'An error was encountered while generating the requested report.  Please let your system administrator know that you have encountered an error.',
    offset: 0,
    limit: 25,
    progressMessage: 'Please wait while your report is generated.',
    progressTitle: 'Generating Report',
    reportColumns: null,
    reportHeaders: null,
    reportRows: [],
    reportTitle: null,
    reportType: null,
    reportTypes: null,
    showFirstPageButton: true,
    showLastPageButton: true,
    showReportResults: false,

    /**
     * Add a row to the report using the selected columns to add the row.
     * @param {Array} row the row to add
     * @param {boolean} skipFormatting true if formatting should be skipped.
     * @param reportColumns {Object} the columns to display on the report;
     * optional, if not set, the property reportColumns on the controller
     * will be used.
     * @param reportAction {Object} action to fire on row when row is clicked.
     */
    _addReportRow: function _addReportRow(row, skipFormatting, reportColumns, rowAction) {
      var columnValue = undefined;
      var reportRows = this.get('reportRows');
      var reportRow = [];
      if (_ember['default'].isEmpty(reportColumns)) {
        reportColumns = this.get('reportColumns');
      }
      for (var column in reportColumns) {
        if (reportColumns[column].include) {
          columnValue = _ember['default'].get(row, reportColumns[column].property);
          if (_ember['default'].isEmpty(columnValue)) {
            reportRow.push('');
          } else if (reportColumns[column].format === '_numberFormat') {
            if (skipFormatting) {
              reportRow.push(columnValue);
            } else {
              reportRow.push(this._numberFormat(columnValue));
            }
          } else if (!skipFormatting && reportColumns[column].format) {
            reportRow.push(this[reportColumns[column].format](columnValue));
          } else {
            reportRow.push(columnValue);
          }
        }
      }
      if (rowAction) {
        reportRows.addObject({
          rowAction: rowAction,
          row: reportRow
        });
      } else {
        reportRows.addObject(reportRow);
      }
    },

    /**
     * Finish up the report by setting headers, titles and export.
     * @param reportColumns {Object} the columns to display on the report;
     * optional, if not set, the property reportColumns on the controller
     * will be used.
     */
    _finishReport: function _finishReport(reportColumns) {
      this.set('showReportResults', true);
      this.set('offset', 0);
      this._setReportHeaders(reportColumns);
      this._setReportTitle();
      this._generateExport();
      this.closeProgressModal();
    },

    _generateExport: function _generateExport() {
      var csvRows = [];
      var reportHeaders = this.get('reportHeaders');
      var dataArray = [reportHeaders];
      dataArray.addObjects(this.get('reportRows'));
      dataArray.forEach(function (reportRow) {
        var rowToAdd = undefined;
        if (reportRow.row) {
          rowToAdd = reportRow.row;
        } else {
          rowToAdd = reportRow;
        }
        rowToAdd = rowToAdd.map(function (column) {
          if (!column) {
            return '';
          } else if (column.replace) {
            return column.replace('"', '""');
          } else {
            return column;
          }
        });
        csvRows.push('"' + rowToAdd.join('","') + '"');
      });
      var csvString = csvRows.join('\r\n');
      var uriContent = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csvString);
      this.set('csvExport', uriContent);
    },

    _notifyReportError: function _notifyReportError(errorMessage) {
      var i18n = this.get('i18n');
      this.closeProgressModal();
      this.displayAlert(i18n.t('alerts.reportError'), i18n.t('messages.reportError'));
      throw new Error(errorMessage);
    },

    _setReportHeaders: function _setReportHeaders(reportColumns) {
      var reportHeaders = [];
      if (_ember['default'].isEmpty(reportColumns)) {
        reportColumns = this.get('reportColumns');
      }
      for (var column in reportColumns) {
        if (reportColumns[column].include) {
          reportHeaders.push(reportColumns[column].label);
        }
      }
      this.set('reportHeaders', reportHeaders);
    },

    _setReportTitle: function _setReportTitle() {
      var endDate = this.get('endDate');
      var formattedEndDate = '';
      var formattedStartDate = '';
      var reportType = this.get('reportType');
      var reportTypes = this.get('reportTypes');
      var startDate = this.get('startDate');
      if (!_ember['default'].isEmpty(endDate)) {
        formattedEndDate = (0, _moment['default'])(endDate).format('l');
      }

      var reportDesc = reportTypes.findBy('value', reportType);
      if (_ember['default'].isEmpty(startDate)) {
        this.set('reportTitle', this.get('i18n').t('inventory.reports.titleSingleDate', {
          name: reportDesc.name,
          date: formattedEndDate
        }));
      } else {
        formattedStartDate = (0, _moment['default'])(startDate).format('l');
        this.set('reportTitle', this.get('i18n').t('inventory.reports.titleDateRange', {
          name: reportDesc.name,
          startDate: formattedStartDate,
          endDate: formattedEndDate
        }));
      }
    },

    actions: {
      firstPage: function firstPage() {
        this.set('offset', 0);
      },

      nextPage: function nextPage() {
        var limit = this.get('limit');
        this.incrementProperty('offset', limit);
      },

      previousPage: function previousPage() {
        var limit = this.get('limit');
        this.decrementProperty('offset', limit);
      },

      lastPage: function lastPage() {
        var reportRowLength = this.get('reportRows.length');
        var limit = this.get('limit');
        var pages = parseInt(reportRowLength / limit);
        this.set('offset', pages * limit);
      }

    },

    currentReportRows: (function () {
      var limit = this.get('limit');
      var offset = this.get('offset');
      var reportRows = this.get('reportRows');
      return reportRows.slice(offset, offset + limit);
    }).property('reportRows.[]', 'offset', 'limit'),

    disablePreviousPage: (function () {
      return this.get('offset') === 0;
    }).property('offset'),

    disableNextPage: (function () {
      var limit = this.get('limit');
      var length = this.get('reportRows.length');
      var offset = this.get('offset');
      return offset + limit >= length;
    }).property('offset', 'limit', 'reportRows.length'),

    showPagination: (function () {
      var length = this.get('reportRows.length');
      var limit = this.get('limit');
      return length > limit;
    }).property('reportRows.length')

  });
});
define('hospitalrun/tests/controllers/abstract-report-controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/abstract-report-controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/abstract-report-controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/application', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend({
    filesystem: _ember['default'].inject.service(),
    session: _ember['default'].inject.service(),
    _setup: (function () {
      var fileSystem = this.get('filesystem');
      fileSystem.setup();
    }).on('init')
  });
});
define('hospitalrun/tests/controllers/application.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/application.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/application.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/index', ['exports', 'ember', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunMixinsUserSession) {
  'use strict';

  var alias = _ember['default'].computed.alias;
  var inject = _ember['default'].inject;
  var get = _ember['default'].get;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsUserSession['default'], {
    config: inject.service(),
    database: inject.service(),
    standAlone: alias('config.standAlone'),
    needsUserSetup: alias('config.needsUserSetup'),
    // on init, look up the list of users and determine if there's a need for a needsUserSetup msg
    init: function init() {
      var _this = this;

      if (get(this, 'standAlone')) {
        get(this, 'database.usersDB').allDocs().then(function (results) {
          if (results.total_rows <= 1) {
            set(_this, 'config.needsUserSetup', true);
          }
        });
      }
    },
    actions: {
      newUser: function newUser() {
        this.send('createNewUser');
      }
    }
  });
});
define('hospitalrun/tests/controllers/index.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/index.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/index.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/login', ['exports', 'ember', 'ember-ajax/errors'], function (exports, _ember, _emberAjaxErrors) {
  'use strict';

  var LoginController = _ember['default'].Controller.extend({
    session: _ember['default'].inject.service(),
    errorMessage: null,
    identification: null,
    password: null,

    actions: {
      authenticate: function authenticate() {
        var _this = this;

        var _getProperties = this.getProperties('identification', 'password');

        var identification = _getProperties.identification;
        var password = _getProperties.password;

        this.get('session').authenticate('authenticator:custom', {
          identification: identification,
          password: password
        })['catch'](function (err) {
          if ((0, _emberAjaxErrors.isAbortError)(err) || (0, _emberAjaxErrors.isTimeoutError)(err)) {
            _this.set('errorMessage', false);
            _this.set('offlineError', true);
          } else {
            _this.set('errorMessage', true);
            _this.set('offlineError', false);
          }
        });
      }
    }
  });

  exports['default'] = LoginController;
});
define('hospitalrun/tests/controllers/login.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/login.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/login.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/controllers/navigation', ['exports', 'ember', 'hospitalrun/mixins/hospitalrun-version', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/progress-dialog', 'hospitalrun/mixins/user-session', 'hospitalrun/mixins/navigation'], function (exports, _ember, _hospitalrunMixinsHospitalrunVersion, _hospitalrunMixinsModalHelper, _hospitalrunMixinsProgressDialog, _hospitalrunMixinsUserSession, _hospitalrunMixinsNavigation) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsHospitalrunVersion['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsProgressDialog['default'], _hospitalrunMixinsUserSession['default'], _hospitalrunMixinsNavigation['default'], {
    ajax: _ember['default'].inject.service(),
    application: _ember['default'].inject.controller(),
    allowSearch: false,
    config: _ember['default'].inject.service(),
    currentSearchText: null,
    currentRouteName: _ember['default'].computed.alias('application.currentRouteName'),
    progressTitle: 'Searching',
    searchRoute: null,
    session: _ember['default'].inject.service(),
    syncStatus: '',
    currentOpenNav: null,

    actions: {
      about: function about() {
        var _this = this;

        var version = this.get('version');
        this.get('ajax').request('/serverinfo').then(function (siteInfo) {
          var message = 'Version: ' + version;
          if (!_ember['default'].isEmpty(siteInfo)) {
            message += ' Site Info: ' + siteInfo;
          }
          _this.displayAlert(_this.get('i18n').t('navigation.about'), message);
        });
      },

      invalidateSession: function invalidateSession() {
        var _this2 = this;

        var session = this.get('session');
        if (session.get('isAuthenticated')) {
          session.invalidate()['catch'](function () {
            var i18n = _this2.get('i18n');
            var message = i18n.t('navigation.messages.logoutFailed');
            var title = i18n.t('navigation.titles.logoutFailed');
            _this2.displayAlert(title, message);
          });
        }
      },

      search: function search() {
        if (this.allowSearch && this.searchRoute) {
          var currentRouteName = this.get('currentRouteName');
          var currentSearchText = this.get('currentSearchText');
          var textToFind = this.get('searchText');
          if (currentSearchText !== textToFind || currentRouteName.indexOf('.search') === -1) {
            this.set('searchText', '');
            this.set('progressMessage', 'Searching for ' + textToFind + '. Please wait...');
            this.showProgressModal();
            this.transitionToRoute(this.searchRoute + '/' + textToFind);
          }
        }
      },

      navAction: function navAction(nav) {
        if (this.currentOpenNav && this.currentOpenNav.route !== nav.route) {
          this.currentOpenNav.closeSubnav();
        }
        this.set('currentOpenNav', nav);
        this.transitionToRoute(nav.route);
        this.set('isShowingSettings', false);
      },

      toggleSettings: function toggleSettings() {
        this.toggleProperty('isShowingSettings');
      },

      closeSettings: function closeSettings() {
        this.set('isShowingSettings', false);
      }

    }
  });
});
define('hospitalrun/tests/controllers/navigation.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - controllers/navigation.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'controllers/navigation.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/custom-form-add/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    updateAction: 'addForm',

    actions: {
      addForm: function addForm() {
        var modelToAddTo = this.get('model.modelToAddTo');
        var modelCustomForms = modelToAddTo.get('customForms');
        var selectedForm = this.get('model.selectedForm');
        if (isEmpty(modelCustomForms)) {
          modelCustomForms = _ember['default'].Object.create();
          modelToAddTo.set('customForms', modelCustomForms);
        }
        modelCustomForms.set(selectedForm, _ember['default'].Object.create());
        modelToAddTo.notifyPropertyChange('customForms');
        this.send('closeModal');
      }
    },

    isUpdateDisabled: computed('model.selectedForm', function () {
      return isEmpty(this.get('model.selectedForm'));
    })

  });
});
define('hospitalrun/tests/custom-form-add/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - custom-form-add/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'custom-form-add/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/diagnosis/edit/controller', ['exports', 'ember', 'hospitalrun/controllers/abstract-edit-controller'], function (exports, _ember, _hospitalrunControllersAbstractEditController) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    updateCapability: 'add_diagnosis',
    editController: _ember['default'].computed.alias('model.editController'),
    diagnosisList: _ember['default'].computed.alias('editController.diagnosisList'),
    newDiagnosis: false,

    lookupListsToUpdate: [{
      name: 'diagnosisList',
      property: 'model.diagnosis',
      id: 'diagnosis_list'
    }],

    additionalButtons: computed('model.isNew', function () {
      var i8n = this.get('i18n');
      var isNew = this.get('model.isNew');
      if (!isNew) {
        return [{
          'class': 'btn btn-default warning',
          buttonAction: 'deleteDiagnosis',
          buttonIcon: 'octicon octicon-x',
          buttonText: i8n.t('buttons.delete')
        }];
      }
    }),

    canDeleteDiagnosis: computed(function () {
      return this.currentUserCan('delete_diagnosis');
    }),

    title: computed('model.isNew', function () {
      var i8n = this.get('i18n');
      var isNew = this.get('model.isNew');
      if (isNew) {
        return i8n.t('diagnosis.titles.addDiagnosis');
      } else {
        return i8n.t('diagnosis.titles.editDiagnosis');
      }
    }),

    afterUpdate: function afterUpdate(diagnosis) {
      var newDiagnosis = this.get('newDiagnosis');
      if (newDiagnosis) {
        this.get('editController').send('addDiagnosis', diagnosis);
      } else {
        this.send('closeModal');
      }
    },

    beforeUpdate: function beforeUpdate() {
      var diagnosis = this.get('model');
      this.set('newDiagnosis', diagnosis.get('isNew'));
      return _ember['default'].RSVP.Promise.resolve();
    },

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      deleteDiagnosis: function deleteDiagnosis() {
        var diagnosis = this.get('model');
        this.get('editController').send('deleteDiagnosis', diagnosis);
      }
    }
  });
});
define('hospitalrun/tests/diagnosis/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - diagnosis/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'diagnosis/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/dialog/controller', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Controller.extend({
    showUpdateButton: true,
    isUpdateDisabled: false,

    cancelAction: computed('model.cancelAction', function () {
      var cancelAction = get(this, 'model.cancelAction');
      if (isEmpty(cancelAction)) {
        cancelAction = 'cancel';
      }
      return cancelAction;
    }),

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      confirm: function confirm() {
        var closeModalOnConfirm = this.getWithDefault('model.closeModalOnConfirm', true);
        var confirmAction = this.getWithDefault('model.confirmAction', 'model.confirm');
        this.send(confirmAction, get(this, 'model'));
        if (closeModalOnConfirm) {
          this.send('closeModal');
        }
      },

      ok: function ok() {
        var okAction = get(this, 'model.okAction');
        var okContext = get(this, 'model.okContext');
        if (isEmpty(okContext)) {
          okContext = get(this, 'model');
        }
        if (!isEmpty(okAction)) {
          this.send(okAction, okContext);
        }
        this.send('closeModal');
      }
    }
  });
});
define('hospitalrun/tests/dialog/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - dialog/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'dialog/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/electron', ['exports'], function (exports) {
  /* jshint undef: false */
  /* eslint-env node */

  'use strict';

  var _require = require('electron');

  var app = _require.app;
  var BrowserWindow = _require.BrowserWindow;

  var mainWindow = null;

  app.on('window-all-closed', function onWindowAllClosed() {
    if (process.platform !== 'darwin') {
      app.quit();
    }
  });

  app.on('ready', function onReady() {
    mainWindow = new BrowserWindow({
      width: 800,
      height: 600,
      backgroundThrottling: false
    });

    delete mainWindow.module;

    if (process.env.EMBER_ENV === 'test') {
      mainWindow.loadURL('file://' + __dirname + '/index.html');
    } else {
      mainWindow.loadURL('file://' + __dirname + '/dist/index.html');
    }

    mainWindow.on('closed', function onClosed() {
      mainWindow = null;
    });
  });
});
define('hospitalrun/tests/electron.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - electron.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'electron.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/ember-electron/main', ['exports'], function (exports) {
  /* jshint node:true */
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var _require = require('electron');

  var app = _require.app;
  var BrowserWindow = _require.BrowserWindow;
  var protocol = _require.protocol;

  var _require2 = require('path');

  var dirname = _require2.dirname;
  var resolve = _require2.resolve;

  var url = require('url');
  var protocolServe = require('electron-protocol-serve');

  var mainWindow = null;

  // The testUrl is a file: url pointing to our index.html, with some query
  // params we need to preserve for testem. So we need to register our ember
  // protocol accordingly.

  var _process$argv = _slicedToArray(process.argv, 3);

  var indexUrl = _process$argv[2];

  var _url$parse = url.parse(indexUrl);

  var indexPath = _url$parse.pathname;
  var indexQuery = _url$parse.search;

  var emberAppLocation = 'serve://dist' + indexQuery;

  protocol.registerStandardSchemes(['serve'], { secure: true });
  // The index.html is in the tests/ directory, so we want all other assets to
  // load from its parent directory
  protocolServe({
    cwd: resolve(dirname(indexPath), '..'),
    app: app,
    protocol: protocol,
    indexPath: indexPath
  });

  app.on('window-all-closed', function onWindowAllClosed() {
    if (process.platform !== 'darwin') {
      app.quit();
    }
  });

  app.on('ready', function onReady() {
    mainWindow = new BrowserWindow({
      width: 800,
      height: 600,
      backgroundThrottling: false
    });

    delete mainWindow.module;

    mainWindow.loadURL(emberAppLocation);

    mainWindow.on('closed', function onClosed() {
      mainWindow = null;
    });
  });
});
define('hospitalrun/tests/ember-electron/main.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - ember-electron/main.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'ember-electron/main.js should pass ESLint.\n');
  });
});
define("hospitalrun/tests/ember-sinon-qunit/test", ["exports", "ember-sinon-qunit/test-support/test"], function (exports, _emberSinonQunitTestSupportTest) {
  exports["default"] = function () {
    console.warn("Using deprecated import path for ember-sinon-qunit; use `import test from 'ember-sinon-qunit/test-support/test';` instead.");
    return _emberSinonQunitTestSupportTest["default"].apply(this, arguments);
  };
});
// backwards compatibility
define('hospitalrun/tests/finishgauth/route', ['exports', 'ember', 'hospitalrun/mixins/map-oauth-params', 'hospitalrun/mixins/setup-user-role'], function (exports, _ember, _hospitalrunMixinsMapOauthParams, _hospitalrunMixinsSetupUserRole) {
  'use strict';

  exports['default'] = _ember['default'].Route.extend(_hospitalrunMixinsMapOauthParams['default'], _hospitalrunMixinsSetupUserRole['default'], {
    config: _ember['default'].inject.service(),
    database: _ember['default'].inject.service(),
    session: _ember['default'].inject.service(),
    model: function model(params) {
      if (params.k && params.s1 && params.s2 && params.t) {
        this.get('session').authenticate('authenticator:custom', {
          google_auth: true,
          params: params
        });
      }
    }
  });
});
define('hospitalrun/tests/finishgauth/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - finishgauth/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'finishgauth/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/authenticate-user', ['exports', 'ember', 'hospitalrun/tests/helpers/ember-simple-auth'], function (exports, _ember, _hospitalrunTestsHelpersEmberSimpleAuth) {
  'use strict';

  var merge = _ember['default'].merge;

  _ember['default'].Test.registerHelper('authenticateUser', function (app) {
    var attrs = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

    var expiresAt = new Date().getTime() + 600000;
    (0, _hospitalrunTestsHelpersEmberSimpleAuth.authenticateSession)(app, merge({
      name: 'hradmin',
      roles: ['System Administrator', 'admin', 'user'],
      expires_at: expiresAt,
      role: 'System Administrator',
      prefix: 'p1'
    }, attrs));
  });

  _ember['default'].Test.registerHelper('invalidateSession', function (app) {
    (0, _hospitalrunTestsHelpersEmberSimpleAuth.invalidateSession)(app);
  });
});
define('hospitalrun/tests/helpers/authenticate-user.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/authenticate-user.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/authenticate-user.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/date-format', ['exports', 'ember', 'moment'], function (exports, _ember, _moment) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  exports['default'] = _ember['default'].Helper.helper(function (params, hash) {
    if (!_ember['default'].isEmpty(params[0])) {
      var dateFormat = 'l';

      var _params = _slicedToArray(params, 1);

      var date = _params[0];

      if (hash && hash.format) {
        dateFormat = hash.format;
      }
      if (date && typeof date.get == 'function') {
        date = date.get('content');
      }
      return (0, _moment['default'])(date).format(dateFormat);
    }
  });
});
define('hospitalrun/tests/helpers/date-format.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/date-format.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/date-format.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/destroy-app', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = destroyApp;

  function destroyApp(application) {
    _ember['default'].run(application, 'destroy');
  }
});
define('hospitalrun/tests/helpers/destroy-app.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/destroy-app.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/destroy-app.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/ember-i18n/test-helpers', ['exports', 'ember'], function (exports, _ember) {

  // example usage: find(`.header:contains(${t('welcome_message')})`)
  _ember['default'].Test.registerHelper('t', function (app, key, interpolations) {
    var i18n = app.__container__.lookup('service:i18n');
    return i18n.t(key, interpolations);
  });

  // example usage: expectTranslation('.header', 'welcome_message');
  _ember['default'].Test.registerHelper('expectTranslation', function (app, element, key, interpolations) {
    var text = app.testHelpers.t(key, interpolations);

    assertTranslation(element, key, text);
  });

  var assertTranslation = (function () {
    if (typeof QUnit !== 'undefined' && typeof ok === 'function') {
      return function (element, key, text) {
        ok(find(element + ':contains(' + text + ')').length, 'Found translation key ' + key + ' in ' + element);
      };
    } else if (typeof expect === 'function') {
      return function (element, key, text) {
        var found = !!find(element + ':contains(' + text + ')').length;
        expect(found).to.equal(true);
      };
    } else {
      return function () {
        throw new Error("ember-i18n could not find a compatible test framework");
      };
    }
  })();
});
define('hospitalrun/tests/helpers/ember-keyboard/register-test-helpers', ['exports', 'ember', 'ember-keyboard', 'ember-keyboard/fixtures/modifiers-array', 'ember-keyboard/utils/get-cmd-key'], function (exports, _ember, _emberKeyboard, _emberKeyboardFixturesModifiersArray, _emberKeyboardUtilsGetCmdKey) {

  var keyEvent = function keyEvent(app, attributes, type, element) {
    var event = attributes.split('+').reduce(function (event, attribute) {
      if (_emberKeyboardFixturesModifiersArray['default'].indexOf(attribute) > -1) {
        attribute = attribute === 'cmd' ? (0, _emberKeyboardUtilsGetCmdKey['default'])() : attribute;
        event[attribute + 'Key'] = true;
      } else {
        event.keyCode = (0, _emberKeyboard.getKeyCode)(attribute);
      }

      return event;
    }, {});

    return app.testHelpers.triggerEvent(element || document, type, event);
  };

  exports['default'] = function () {
    _ember['default'].Test.registerAsyncHelper('keyDown', function (app, attributes, element) {
      return keyEvent(app, attributes, 'keydown', element);
    });

    _ember['default'].Test.registerAsyncHelper('keyUp', function (app, attributes, element) {
      return keyEvent(app, attributes, 'keyup', element);
    });

    _ember['default'].Test.registerAsyncHelper('keyPress', function (app, attributes, element) {
      return keyEvent(app, attributes, 'keypress', element);
    });
  };
});
define('hospitalrun/tests/helpers/ember-simple-auth', ['exports', 'ember-simple-auth/authenticators/test'], function (exports, _emberSimpleAuthAuthenticatorsTest) {
  exports.authenticateSession = authenticateSession;
  exports.currentSession = currentSession;
  exports.invalidateSession = invalidateSession;

  var TEST_CONTAINER_KEY = 'authenticator:test';

  function ensureAuthenticator(app, container) {
    var authenticator = container.lookup(TEST_CONTAINER_KEY);
    if (!authenticator) {
      app.register(TEST_CONTAINER_KEY, _emberSimpleAuthAuthenticatorsTest['default']);
    }
  }

  function authenticateSession(app, sessionData) {
    var container = app.__container__;

    var session = container.lookup('service:session');
    ensureAuthenticator(app, container);
    session.authenticate(TEST_CONTAINER_KEY, sessionData);
    return wait();
  }

  function currentSession(app) {
    return app.__container__.lookup('service:session');
  }

  function invalidateSession(app) {
    var session = app.__container__.lookup('service:session');
    if (session.get('isAuthenticated')) {
      session.invalidate();
    }
    return wait();
  }
});
/* global wait */
define('hospitalrun/tests/helpers/html-line-break', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  exports['default'] = _ember['default'].Helper.helper(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 1);

    var text = _ref2[0];

    if (text !== null && typeof text !== 'undefined') {
      return _ember['default'].String.htmlSafe(text.replace(/\n/g, '<br>'));
    } else {
      return null;
    }
  });
});
define('hospitalrun/tests/helpers/html-line-break.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/html-line-break.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/html-line-break.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/is-equal-array', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  exports['default'] = _ember['default'].Helper.helper(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 2);

    var lhs = _ref2[0];
    var rhs = _ref2[1];

    if (!_ember['default'].isArray(lhs) || !_ember['default'].isArray(rhs) || lhs.get('length') !== rhs.get('length')) {
      return false;
    }
    return lhs.every(function (item) {
      return rhs.includes(item);
    });
  });
});
define('hospitalrun/tests/helpers/is-equal-array.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/is-equal-array.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/is-equal-array.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/is-equal', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  exports['default'] = _ember['default'].Helper.helper(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 2);

    var lhs = _ref2[0];
    var rhs = _ref2[1];

    return lhs === rhs;
  });
});
define('hospitalrun/tests/helpers/is-equal.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/is-equal.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/is-equal.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/is-not', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  exports['default'] = _ember['default'].Helper.helper(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 1);

    var value = _ref2[0];

    return !value;
  });
});
define('hospitalrun/tests/helpers/is-not.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/is-not.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/is-not.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/module-for-acceptance', ['exports', 'qunit', 'ember', 'hospitalrun/tests/helpers/start-app', 'hospitalrun/tests/helpers/destroy-app'], function (exports, _qunit, _ember, _hospitalrunTestsHelpersStartApp, _hospitalrunTestsHelpersDestroyApp) {
  'use strict';

  var Promise = _ember['default'].RSVP.Promise;

  exports['default'] = function (name) {
    var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

    (0, _qunit.module)(name, {
      beforeEach: function beforeEach() {
        this.application = (0, _hospitalrunTestsHelpersStartApp['default'])();

        if (options.beforeEach) {
          return options.beforeEach.apply(this, arguments);
        }
      },

      afterEach: function afterEach() {
        var _this = this;

        var afterEach = options.afterEach && options.afterEach.apply(this, arguments);
        return Promise.resolve(afterEach).then(function () {
          return (0, _hospitalrunTestsHelpersDestroyApp['default'])(_this.application);
        });
      }
    });
  };
});
define('hospitalrun/tests/helpers/module-for-acceptance.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/module-for-acceptance.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/module-for-acceptance.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/number-format', ['exports', 'ember', 'hospitalrun/mixins/number-format'], function (exports, _ember, _hospitalrunMixinsNumberFormat) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var NumberHandler = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']);
  exports['default'] = _ember['default'].Helper.helper(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 1);

    var number = _ref2[0];

    var numberHandler = new NumberHandler();
    return numberHandler._numberFormat(number);
  });
});
define('hospitalrun/tests/helpers/number-format.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/number-format.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/number-format.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/read-path', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  exports['default'] = _ember['default'].Helper.helper(function (_ref) {
    var _ref2 = _slicedToArray(_ref, 2);

    var object = _ref2[0];
    var path = _ref2[1];

    if (_ember['default'].isEmpty(path)) {
      return object;
    } else {
      return _ember['default'].get(object, path);
    }
  });
});
define('hospitalrun/tests/helpers/read-path.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/read-path.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/read-path.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/resolver', ['exports', 'hospitalrun/resolver', 'hospitalrun/config/environment'], function (exports, _hospitalrunResolver, _hospitalrunConfigEnvironment) {
  'use strict';

  var resolver = _hospitalrunResolver['default'].create();

  resolver.namespace = {
    modulePrefix: _hospitalrunConfigEnvironment['default'].modulePrefix,
    podModulePrefix: _hospitalrunConfigEnvironment['default'].podModulePrefix
  };

  exports['default'] = resolver;
});
define('hospitalrun/tests/helpers/resolver.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/resolver.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/resolver.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/run-with-pouch-dump', ['exports', 'hospitalrun/utils/pouch-views', 'ember', 'pouchdb', 'npm:pouchdb-adapter-memory', 'npm:pouchdb-users', 'hospitalrun/services/database', 'hospitalrun/services/config', 'npm:worker-pouch/client'], function (exports, _hospitalrunUtilsPouchViews, _ember, _pouchdb, _npmPouchdbAdapterMemory, _npmPouchdbUsers, _hospitalrunServicesDatabase, _hospitalrunServicesConfig, _npmWorkerPouchClient) {
  /* jshint ignore:start */
  'use strict';

  var get = _ember['default'].get;
  var set = _ember['default'].set;

  function cleanupDatabases(maindb, dbs) {
    return wait().then(function () {
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        if (maindb.changesListener) {
          maindb.changesListener.cancel();
          maindb.changesListener.on('complete', function () {
            destroyDatabases(dbs).then(resolve, reject);
          });
        } else {
          destroyDatabases(dbs).then(resolve, reject);
        }
      });
    });
  }

  function destroyDatabases(dbs) {
    var destroyQueue = [];
    dbs.forEach(function (db) {
      destroyQueue.push(db.info().then(function () {
        return db.destroy();
      }));
    });
    return _ember['default'].RSVP.all(destroyQueue);
  }

  function runWithPouchDumpAsyncHelper(app, dumpName, functionToRun) {
    _pouchdb['default'].plugin(_npmPouchdbAdapterMemory['default']);
    _pouchdb['default'].plugin(_npmPouchdbUsers['default']);

    var db = new _pouchdb['default']('hospitalrun-test-database', {
      adapter: 'memory'
    });
    var configDB = new _pouchdb['default']('hospitalrun-test-config-database', {
      adapter: 'memory'
    });
    var usersDB = undefined;
    if (window.ELECTRON) {
      usersDB = new _pouchdb['default']('_users', {
        adapter: 'memory'
      });
    }
    var dump = require('hospitalrun/tests/fixtures/' + dumpName)['default'];
    var promise = db.load(dump);

    var InMemoryDatabaseService = _hospitalrunServicesDatabase['default'].extend({

      createDB: function createDB(configs) {
        var standAlone = get(this, 'standAlone');
        if (standAlone || !configs.config_external_search) {
          set(this, 'usePouchFind', true);
        }
        if (standAlone) {
          return promise.then(function () {
            return db;
          });
        }
        if (!window.ELECTRON && navigator.serviceWorker) {
          // Use pouch-worker to run the DB in the service worker
          return navigator.serviceWorker.ready.then(function () {
            if (navigator.serviceWorker.controller && navigator.serviceWorker.controller.postMessage) {
              _pouchdb['default'].adapter('worker', _npmWorkerPouchClient['default']);
              db = new _pouchdb['default']('hospitalrun-test-database', {
                adapter: 'worker',
                worker: function worker() {
                  return navigator.serviceWorker;
                }
              });
              return db.load(dump).then(function () {
                return db;
              });
            } else {
              return promise.then(function () {
                return db;
              });
            }
          });
        } else {
          return promise.then(function () {
            return db;
          });
        }
      },
      createUsersDB: function createUsersDB() {
        var _this = this;

        return usersDB.installUsersBehavior().then(function () {
          set(_this, 'usersDB', usersDB);
          return usersDB.put({
            _id: 'org.couchdb.user:hradmin',
            displayName: 'HospitalRun Administrator',
            email: 'hradmin@hospitalrun.io',
            type: 'user',
            name: 'hradmin',
            password: 'test',
            roles: ['System Administrator', 'admin', 'user'],
            userPrefix: 'p1'
          });
        })['catch'](function (err) {
          console.log('Error creating users db!!!', err);
        });
      }
    });

    var InMemoryConfigService = _hospitalrunServicesConfig['default'].extend({
      createDB: function createDB() {
        return configDB;
      },
      replicateConfigDB: function replicateConfigDB() {
        return configDB.get('config_disable_offline_sync').then(function (doc) {
          if (doc.value !== true) {
            doc.value = true;
            return configDB.put(doc);
          }
        })['catch'](function () {
          return configDB.put({
            _id: 'config_disable_offline_sync',
            value: true
          });
        });
      }
    });

    app.__deprecatedInstance__.register('service:config', InMemoryConfigService);
    app.__deprecatedInstance__.register('service:database', InMemoryDatabaseService);

    return new _ember['default'].RSVP.Promise(function (resolve) {
      promise.then(function () {
        db.setMaxListeners(35);
        (0, _hospitalrunUtilsPouchViews['default'])(db, true, dumpName).then(function () {
          functionToRun();
          andThen(function () {
            var databasesToClean = [configDB, db];
            if (window.ELECTRON) {
              databasesToClean.push(usersDB);
            }
            cleanupDatabases(db, databasesToClean).then(function () {
              configDB = null;
              db = null;
              if (window.ELECTRON) {
                usersDB = null;
              }
              resolve();
            }, function (err) {
              console.log('error cleaning up dbs:', err);
            });
          });
        });
      }, function (err) {
        console.log('error loading db', JSON.stringify(err, null, 2));
      });
    });
  }

  _ember['default'].Test.registerAsyncHelper('runWithPouchDump', runWithPouchDumpAsyncHelper);
  /* jshint ignore:end */
});
define('hospitalrun/tests/helpers/run-with-pouch-dump.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/run-with-pouch-dump.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/run-with-pouch-dump.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/select-date', ['exports', 'ember', 'moment'], function (exports, _ember, _moment) {
  // Derived from https://raw.githubusercontent.com/edgycircle/ember-pikaday/master/addon/helpers/pikaday.js
  'use strict';

  function triggerNativeEvent(element, eventName) {
    if (document.createEvent) {
      var _event = document.createEvent('Events');
      _event.initEvent(eventName, true, false);
      element.dispatchEvent(_event);
    } else {
      element.fireEvent('on' + eventName);
    }
  }

  _ember['default'].Test.registerAsyncHelper('selectDate', function (app, selector, date) {
    return new _ember['default'].RSVP.Promise(function (resolve) {
      click(selector);
      waitToAppear('.pika-single:not(.is-hidden)').then(function () {
        fillIn(selector, (0, _moment['default'])(date).format('l'));
        andThen(function () {
          triggerNativeEvent(app.$(selector)[0], 'change');
          resolve();
        });
      });
    });
  });
});
define('hospitalrun/tests/helpers/select-date.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/select-date.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/select-date.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/select', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  _ember['default'].Test.registerAsyncHelper('select', function (app, selector) {
    for (var _len = arguments.length, texts = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
      texts[_key - 2] = arguments[_key];
    }

    var $options = app.testHelpers.findWithAssert(selector + ' option');

    $options.each(function () {
      var _this = this;

      var $option = _ember['default'].$(this);

      _ember['default'].run(function () {
        _this.selected = texts.some(function (text) {
          return $option.is(':contains(\'' + text + '\')');
        });
        if (_this.selected) {
          $option.trigger('change');
        }
      });
    });

    return app.testHelpers.wait();
  });
});
define('hospitalrun/tests/helpers/select.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/select.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/select.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/start-app', ['exports', 'ember', 'hospitalrun/app', 'hospitalrun/config/environment', 'hospitalrun/tests/helpers/run-with-pouch-dump', 'hospitalrun/tests/helpers/authenticate-user', 'hospitalrun/tests/helpers/select', 'hospitalrun/tests/helpers/select-date', 'hospitalrun/tests/helpers/typeahead-fillin', 'hospitalrun/tests/helpers/wait-to-appear'], function (exports, _ember, _hospitalrunApp, _hospitalrunConfigEnvironment, _hospitalrunTestsHelpersRunWithPouchDump, _hospitalrunTestsHelpersAuthenticateUser, _hospitalrunTestsHelpersSelect, _hospitalrunTestsHelpersSelectDate, _hospitalrunTestsHelpersTypeaheadFillin, _hospitalrunTestsHelpersWaitToAppear) {
  'use strict';

  exports['default'] = startApp;

  function createTranslationWrapper(original, context) {
    function t(str, data) {
      var result = original.call(context, str, data);
      if (result.indexOf && result.indexOf('Missing translation') > -1) {
        throw new Error(result);
      }

      return result.string || result;
    }

    return t;
  }

  function startApp(attrs) {
    var application = undefined;

    // use defaults, but you can override
    var attributes = _ember['default'].assign({}, _hospitalrunConfigEnvironment['default'].APP, attrs);

    _ember['default'].run(function () {
      application = _hospitalrunApp['default'].create(attributes);
      application.setupForTesting();
      application.injectTestHelpers();
    });

    var translationService = application.__container__.lookup('service:i18n');
    application.__container__.lookup('service:i18n').t = createTranslationWrapper(translationService.t, translationService);

    return application;
  }
});
define('hospitalrun/tests/helpers/start-app.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/start-app.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/start-app.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/typeahead-fillin', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  _ember['default'].Test.registerAsyncHelper('typeAheadFillIn', function (app, selector, value) {
    var typeAheadSelector = selector + ' .tt-input';
    fillIn(typeAheadSelector, value);
    triggerEvent(typeAheadSelector, 'input');
    triggerEvent(typeAheadSelector, 'blur');
    return app.testHelpers.wait();
  });
});
define('hospitalrun/tests/helpers/typeahead-fillin.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/typeahead-fillin.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/typeahead-fillin.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/helpers/validate-properties', ['exports', 'ember', 'ember-qunit'], function (exports, _ember, _emberQunit) {
  exports.testValidPropertyValues = testValidPropertyValues;
  exports.testInvalidPropertyValues = testInvalidPropertyValues;

  var run = _ember['default'].run;

  function validateValues(object, propertyName, values, isTestForValid) {
    var promise = null;
    var validatedValues = [];

    values.forEach(function (value) {
      function handleValidation(errors) {
        var hasErrors = object.get('errors.' + propertyName + '.firstObject');
        if (hasErrors && !isTestForValid || !hasErrors && isTestForValid) {
          validatedValues.push(value);
        }
      }

      run(object, 'set', propertyName, value);

      var objectPromise = null;
      run(function () {
        objectPromise = object.validate().then(handleValidation, handleValidation);
      });

      // Since we are setting the values in a different run loop as we are validating them,
      // we need to chain the promises so that they run sequentially. The wrong value will
      // be validated if the promises execute concurrently
      promise = promise ? promise.then(objectPromise) : objectPromise;
    });

    return promise.then(function () {
      return validatedValues;
    });
  }

  function testPropertyValues(propertyName, values, isTestForValid, context) {
    var validOrInvalid = isTestForValid ? 'Valid' : 'Invalid';
    var testName = validOrInvalid + ' ' + propertyName;

    (0, _emberQunit.test)(testName, function (assert) {
      var object = this.subject();

      if (context && typeof context === 'function') {
        context(object);
      }

      // Use QUnit.dump.parse so null and undefined can be printed as literal 'null' and
      // 'undefined' strings in the assert message.
      var valuesString = QUnit.dump.parse(values).replace(/\n(\s+)?/g, '').replace(/,/g, ', ');
      var assertMessage = 'Expected ' + propertyName + ' to have ' + validOrInvalid.toLowerCase() + ' values: ' + valuesString;

      return validateValues(object, propertyName, values, isTestForValid).then(function (validatedValues) {
        assert.deepEqual(validatedValues, values, assertMessage);
      });
    });
  }

  function testValidPropertyValues(propertyName, values, context) {
    testPropertyValues(propertyName, values, true, context);
  }

  function testInvalidPropertyValues(propertyName, values, context) {
    testPropertyValues(propertyName, values, false, context);
  }
});
define('hospitalrun/tests/helpers/wait-to-appear', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  function isVisible(selector) {
    return $(selector).length > 0;
  }

  function checkVisibility(selector, interval, resolve, visibility) {
    if (isVisible(selector) === visibility) {
      resolve($(selector));
    } else {
      _ember['default'].run.later(null, function () {
        checkVisibility(selector, interval, resolve, visibility);
      }, interval);
    }
  }

  function waitToAppear(app, selector) {
    var interval = arguments.length <= 2 || arguments[2] === undefined ? 200 : arguments[2];

    return new _ember['default'].RSVP.Promise(function (resolve) {
      checkVisibility(selector, interval, resolve, true);
    });
  }

  function waitToDisappear(app, selector) {
    var interval = arguments.length <= 2 || arguments[2] === undefined ? 200 : arguments[2];

    return new _ember['default'].RSVP.Promise(function (resolve) {
      checkVisibility(selector, interval, resolve, false);
    });
  }
  _ember['default'].Test.registerAsyncHelper('waitToAppear', waitToAppear);
  _ember['default'].Test.registerAsyncHelper('waitToDisappear', waitToDisappear);
});
define('hospitalrun/tests/helpers/wait-to-appear.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - helpers/wait-to-appear.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'helpers/wait-to-appear.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/address/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/address/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/address/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/custom-forms/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/custom-forms/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/custom-forms/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/custom-forms/field-edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/custom-forms/field-edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/custom-forms/field-edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/custom-forms/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/custom-forms/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/custom-forms/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/loaddb/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/loaddb/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/loaddb/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/lookup/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/lookup/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/lookup/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/lookup/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/lookup/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/lookup/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/print-header/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/print-header/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/print-header/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/query/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/query/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/query/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/roles/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/roles/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/roles/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/textreplace/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/textreplace/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/textreplace/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/visit-forms/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/visit-forms/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/visit-forms/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/admin/workflow/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/admin/workflow/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/admin/workflow/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/allergy/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/allergy/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/allergy/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/calendar/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/calendar/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/calendar/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/search/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/search/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/search/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/theater/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/theater/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/theater/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/appointments/today/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/appointments/today/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/appointments/today/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/custom-form-add/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/custom-form-add/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/custom-form-add/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/diagnosis/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/diagnosis/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/diagnosis/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/dialog/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/dialog/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/dialog/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/charge/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/charge/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/charge/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/completed/completed-list-item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/completed/completed-list-item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/completed/completed-list-item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/completed/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/completed/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/completed/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/index/imaging-edit-button/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/index/imaging-edit-button/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/index/imaging-edit-button/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/index/requested-list-item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/index/requested-list-item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/index/requested-list-item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/imaging/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/imaging/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/imaging/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inc-category/add-item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inc-category/add-item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inc-category/add-item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inc-category/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inc-category/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inc-category/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inc-category/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inc-category/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inc-category/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inc-category/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inc-category/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inc-category/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/attachment/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/attachment/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/attachment/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/completed/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/completed/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/completed/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/note/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/note/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/note/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/note/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/note/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/note/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/incident/reports/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/incident/reports/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/incident/reports/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/adjust/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/adjust/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/adjust/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/barcode/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/barcode/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/barcode/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/batch/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/batch/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/batch/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/listing/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/listing/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/listing/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/purchase/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/purchase/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/purchase/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/purchase/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/purchase/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/purchase/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/quick-add/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/quick-add/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/quick-add/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/rank-select/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/rank-select/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/rank-select/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/reports/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/reports/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/reports/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/request/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/request/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/request/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/search/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/search/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/search/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/inventory/transfer/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/inventory/transfer/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/inventory/transfer/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/invoices/add-line-item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/invoices/add-line-item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/invoices/add-line-item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/invoices/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/invoices/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/invoices/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/invoices/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/invoices/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/invoices/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/invoices/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/invoices/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/invoices/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/invoices/payment/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/invoices/payment/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/invoices/payment/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/invoices/search/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/invoices/search/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/invoices/search/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/charge/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/charge/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/charge/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/completed/labs-completed-list-item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/completed/labs-completed-list-item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/completed/labs-completed-list-item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/completed/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/completed/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/completed/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/index/labs-edit-button/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/index/labs-edit-button/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/index/labs-edit-button/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/index/labs-list-item/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/index/labs-list-item/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/index/labs-list-item/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/labs/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/labs/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/labs/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/medication/completed/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/medication/completed/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/medication/completed/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/medication/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/medication/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/medication/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/medication/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/medication/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/medication/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/medication/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/medication/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/medication/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/medication/return/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/medication/return/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/medication/return/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/medication/search/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/medication/search/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/medication/search/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/add-contact/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/add-contact/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/add-contact/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/admitted/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/admitted/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/admitted/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/imaging/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/imaging/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/imaging/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/labs/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/labs/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/labs/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/medication/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/medication/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/medication/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/notes/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/notes/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/notes/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/operation-report/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/operation-report/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/operation-report/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/operative-plan/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/operative-plan/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/operative-plan/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/outpatient/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/outpatient/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/outpatient/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/photo/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/photo/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/photo/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/quick-add/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/quick-add/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/quick-add/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/reports/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/reports/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/reports/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/search/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/search/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/search/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/socialwork/expense/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/socialwork/expense/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/socialwork/expense/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/patients/socialwork/family-info/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/patients/socialwork/family-info/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/patients/socialwork/family-info/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/imaging/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/imaging/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/imaging/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/lab/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/lab/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/lab/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/override/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/override/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/override/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/procedure/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/procedure/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/procedure/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/profiles/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/profiles/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/profiles/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/profiles/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/profiles/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/profiles/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/search/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/search/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/search/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/pricing/ward/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/pricing/ward/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/pricing/ward/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/print/invoice/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/print/invoice/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/print/invoice/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/procedures/charge/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/procedures/charge/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/procedures/charge/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/procedures/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/procedures/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/procedures/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/procedures/medication/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/procedures/medication/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/procedures/medication/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/application.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/application.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/application.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/charges-by-type.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/charges-by-type.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/charges-by-type.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/array-display.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/array-display.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/array-display.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/calendar-control.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/calendar-control.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/calendar-control.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/charge-quantity.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/charge-quantity.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/charge-quantity.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/charges-by-type-tab.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/charges-by-type-tab.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/charges-by-type-tab.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/checkbox-or-typeahead.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/checkbox-or-typeahead.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/checkbox-or-typeahead.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/cross-icon-svg.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/cross-icon-svg.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/cross-icon-svg.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/custom-form-manager.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/custom-form-manager.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/custom-form-manager.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/custom-form.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/custom-form.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/custom-form.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/date-filter.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/date-filter.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/date-filter.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/date-time-picker.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/date-time-picker.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/date-time-picker.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/edit-panel.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/edit-panel.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/edit-panel.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/expand-text.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/expand-text.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/expand-text.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/ext-radio.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/ext-radio.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/ext-radio.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/inventory-location-picker.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/inventory-location-picker.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/inventory-location-picker.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/item-listing.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/item-listing.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/item-listing.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/location-select.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/location-select.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/location-select.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/logo-dark-svg.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/logo-dark-svg.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/logo-dark-svg.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/logo-svg.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/logo-svg.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/logo-svg.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/medication-allergy.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/medication-allergy.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/medication-allergy.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/menu-svg.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/menu-svg.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/menu-svg.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/modal-dialog.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/modal-dialog.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/modal-dialog.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/nav-menu.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/nav-menu.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/nav-menu.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/nav-paging.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/nav-paging.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/nav-paging.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/operative-procedures.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/operative-procedures.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/operative-procedures.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/patient-diagnosis.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/patient-diagnosis.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/patient-diagnosis.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/patient-orders.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/patient-orders.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/patient-orders.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/patient-summary.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/patient-summary.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/patient-summary.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/photo-display.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/photo-display.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/photo-display.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/price-list.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/price-list.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/price-list.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/quantity-calc.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/quantity-calc.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/quantity-calc.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/quantity-conv.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/quantity-conv.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/quantity-conv.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/render-typeahead.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/render-typeahead.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/render-typeahead.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/role-select.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/role-select.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/role-select.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/search-listing.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/search-listing.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/search-listing.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/select-or-typeahead.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/select-or-typeahead.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/select-or-typeahead.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/sortable-column.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/sortable-column.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/sortable-column.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/static-text.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/static-text.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/static-text.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/take-photo.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/take-photo.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/take-photo.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/typeahead-filter.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/typeahead-filter.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/typeahead-filter.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/components/upcoming-appointments.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/components/upcoming-appointments.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/components/upcoming-appointments.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/empty.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/empty.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/empty.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/error.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/error.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/error.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/index.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/index.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/index.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/inv-purchase.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/inv-purchase.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/inv-purchase.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/inventory-basic.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/inventory-basic.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/inventory-basic.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/item-charges.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/item-charges.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/item-charges.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/loading.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/loading.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/loading.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/login.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/login.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/login.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/navigation.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/navigation.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/navigation.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/report-rows.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/report-rows.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/report-rows.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/section.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/section.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/section.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/sidebar_nav/header.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/sidebar_nav/header.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/sidebar_nav/header.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/sidebar_nav/message.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/sidebar_nav/message.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/sidebar_nav/message.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/sidebar_nav/primary_nav.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/sidebar_nav/primary_nav.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/sidebar_nav/primary_nav.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/templates/sidebar_nav/search.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/templates/sidebar_nav/search.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/templates/sidebar_nav/search.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/users/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/users/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/users/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/users/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/users/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/users/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/users/index/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/users/index/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/users/index/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/charge/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/charge/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/charge/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/procedures/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/procedures/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/procedures/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/reports/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/reports/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/reports/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/vitals/delete/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/vitals/delete/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/vitals/delete/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/hospitalrun/visits/vitals/edit/template.template-lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('TemplateLint - hospitalrun/visits/vitals/edit/template.hbs');
  QUnit.test('should pass TemplateLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'hospitalrun/visits/vitals/edit/template.hbs should pass TemplateLint.\n');
  });
});
define('hospitalrun/tests/imaging/charge/controller', ['exports', 'hospitalrun/procedures/charge/controller', 'ember'], function (exports, _hospitalrunProceduresChargeController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunProceduresChargeController['default'].extend({
    cancelAction: 'closeModal',
    newPricingItem: false,
    requestingController: _ember['default'].inject.controllers('imaging/edit'),
    pricingList: _ember['default'].computed.alias('requestingController.chargesPricingList')
  });
});
define('hospitalrun/tests/imaging/charge/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/charge/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/charge/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/completed/completed-list-item/component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'tr'
  });
});
define('hospitalrun/tests/imaging/completed/completed-list-item/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/completed/completed-list-item/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/completed/completed-list-item/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/completed/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    startKey: [],
    showActions: false
  });
});
define('hospitalrun/tests/imaging/completed/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/completed/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/completed/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/completed/route', ['exports', 'ember-i18n', 'hospitalrun/imaging/index/route'], function (exports, _emberI18n, _hospitalrunImagingIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunImagingIndexRoute['default'].extend({
    pageTitle: (0, _emberI18n.translationMacro)('imaging.titles.completedImaging'),
    searchStatus: 'Completed'
  });
});
define('hospitalrun/tests/imaging/completed/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/completed/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/completed/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'hospitalrun/mixins/patient-submodule'], function (exports, _hospitalrunControllersAbstractDeleteController, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend(_hospitalrunMixinsPatientSubmodule['default'], {
    title: 'Delete Request',

    actions: {
      'delete': function _delete() {
        this.deleteChildFromVisit('imaging');
      }
    }
  });
});
define('hospitalrun/tests/imaging/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/charge-actions', 'ember', 'hospitalrun/mixins/patient-submodule'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsChargeActions, _ember, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsChargeActions['default'], _hospitalrunMixinsPatientSubmodule['default'], {
    imagingController: _ember['default'].inject.controller('imaging'),

    chargePricingCategory: 'Imaging',
    chargeRoute: 'imaging.charge',
    selectedImagingType: null,

    canComplete: (function () {
      var isNew = this.get('model.isNew');
      var imagingTypeName = this.get('model.imagingTypeName');
      var selectedImagingType = this.get('selectedImagingType');
      if (isNew && (_ember['default'].isEmpty(imagingTypeName) || _ember['default'].isArray(selectedImagingType) && selectedImagingType.length > 1)) {
        return false;
      } else {
        return this.currentUserCan('complete_imaging');
      }
    }).property('selectedImagingType.[]', 'model.imagingTypeName'),

    actions: {
      completeImaging: function completeImaging() {
        this.set('model.status', 'Completed');
        this.get('model').validate().then((function () {
          if (this.get('model.isValid')) {
            this.set('model.imagingDate', new Date());
            this.send('update');
          }
        }).bind(this))['catch'](_ember['default'].K);
      },

      /**
       * Save the imaging request(s), creating multiples when user selects multiple imaging tests.
       */
      update: function update() {
        var _this = this;

        if (this.get('model.isNew')) {
          (function () {
            var newImaging = _this.get('model');
            var selectedImagingType = _this.get('selectedImagingType');
            if (_ember['default'].isEmpty(_this.get('model.status'))) {
              _this.set('model.status', 'Requested');
            }
            _this.set('model.requestedBy', newImaging.getUserName());
            _this.set('model.requestedDate', new Date());
            if (_ember['default'].isEmpty(selectedImagingType)) {
              _this.saveNewPricing(_this.get('model.imagingTypeName'), 'Imaging', 'model.imagingType').then((function () {
                this.addChildToVisit(newImaging, 'imaging', 'Imaging').then((function () {
                  this.saveModel();
                }).bind(this));
              }).bind(_this));
            } else {
              _this.getSelectedPricing('selectedImagingType').then((function (pricingRecords) {
                if (_ember['default'].isArray(pricingRecords)) {
                  this.createMultipleRequests(pricingRecords, 'imagingType', 'imaging', 'Imaging');
                } else {
                  this.set('model.imagingType', pricingRecords);
                  this.addChildToVisit(newImaging, 'imaging', 'Imaging').then((function () {
                    this.saveModel();
                  }).bind(this));
                }
              }).bind(_this));
            }
          })();
        } else {
          this.saveModel();
        }
      }
    },

    additionalButtons: (function () {
      var i18n = this.get('i18n');
      var canComplete = this.get('canComplete');
      var isValid = this.get('model.isValid');
      if (isValid && canComplete) {
        return [{
          buttonAction: 'completeImaging',
          buttonIcon: 'glyphicon glyphicon-ok',
          'class': 'btn btn-primary on-white',
          buttonText: i18n.t('buttons.complete')
        }];
      }
    }).property('canComplete', 'model.isValid'),

    lookupListsToUpdate: [{
      name: 'radiologistList',
      property: 'model.radiologist',
      id: 'radiologists'
    }],

    pricingTypeForObjectType: 'Imaging Procedure',
    pricingTypes: _ember['default'].computed.alias('imagingController.imagingPricingTypes'),

    pricingList: null, // This gets filled in by the route

    radiologistList: _ember['default'].computed.alias('imagingController.radiologistList'),

    updateCapability: 'add_imaging',

    afterUpdate: function afterUpdate(saveResponse, multipleRecords) {
      var i18n = this.get('i18n');
      this.updateLookupLists();
      var afterDialogAction = undefined,
          alertTitle = undefined,
          alertMessage = undefined;
      if (this.get('model.status') === 'Completed') {
        alertTitle = i18n.t('imaging.alerts.completedTitle');
        alertMessage = i18n.t('imaging.alerts.completedMessage');
      } else {
        alertTitle = i18n.t('imaging.alerts.savedTitle');
        alertMessage = i18n.t('imaging.alerts.savedMessage');
      }
      if (multipleRecords) {
        afterDialogAction = this.get('cancelAction');
      }
      this.saveVisitIfNeeded(alertTitle, alertMessage, afterDialogAction);
      this.set('model.selectPatient', false);
    }

  });
});
define('hospitalrun/tests/imaging/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/edit/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'hospitalrun/mixins/charge-route', 'ember', 'moment', 'hospitalrun/mixins/patient-list-route'], function (exports, _emberI18n, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _hospitalrunMixinsChargeRoute, _ember, _moment, _hospitalrunMixinsPatientListRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], _hospitalrunMixinsChargeRoute['default'], _hospitalrunMixinsPatientListRoute['default'], {
    editTitle: (0, _emberI18n.translationMacro)('imaging.titles.editTitle'),
    modelName: 'imaging',
    newTitle: (0, _emberI18n.translationMacro)('imaging.titles.editTitle'),
    pricingCategory: 'Imaging',

    actions: {
      returnToAllItems: function returnToAllItems() {
        this.controller.send('returnToAllItems');
      }
    },

    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        selectPatient: true,
        requestDate: (0, _moment['default'])().startOf('day').toDate()
      });
    }
  });
});
define('hospitalrun/tests/imaging/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    startKey: [],
    addPermission: 'add_imaging'
  });
});
define('hospitalrun/tests/imaging/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/index/imaging-edit-button/component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'button',
    classNames: ['btn', 'btn-default', 'neutral']
  });
});
define('hospitalrun/tests/imaging/index/imaging-edit-button/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/index/imaging-edit-button/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/index/imaging-edit-button/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/index/requested-list-item/component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'tr',
    classNames: ['clickable'],

    click: function click() {
      this.sendAction('action', this.imaging);
    }
  });
});
define('hospitalrun/tests/imaging/index/requested-list-item/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/index/requested-list-item/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/index/requested-list-item/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/index/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-index-route'], function (exports, _emberI18n, _hospitalrunRoutesAbstractIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    modelName: 'imaging',
    pageTitle: (0, _emberI18n.translationMacro)('imaging.pageTitle'),
    searchStatus: 'Requested',

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var imagingDateAsTime = item.get('imagingDateAsTime');
      var id = this._getPouchIdFromItem(item);
      var requestedDateAsTime = item.get('requestedDateAsTime');
      var searchStatus = this.get('searchStatus');
      return [searchStatus, requestedDateAsTime, imagingDateAsTime, id];
    },
    _modelQueryParams: function _modelQueryParams() {
      var maxId = this._getMaxPouchId();
      var maxValue = this.get('maxValue');
      var minId = this._getMinPouchId();
      var searchStatus = this.get('searchStatus');
      return {
        options: {
          startkey: [searchStatus, null, null, minId],
          endkey: [searchStatus, maxValue, maxValue, maxId]
        },
        mapReduce: 'imaging_by_status'
      };
    }
  });
});
define('hospitalrun/tests/imaging/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/imaging/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-module-route'], function (exports, _emberI18n, _hospitalrunRoutesAbstractModuleRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_imaging',
    additionalModels: [{
      name: 'imagingPricingTypes',
      findArgs: ['lookup', 'imaging_pricing_types']
    }, {
      name: 'radiologistList',
      findArgs: ['lookup', 'radiologists']
    }],
    allowSearch: false,
    moduleName: 'imaging',
    newButtonText: (0, _emberI18n.translationMacro)('imaging.buttons.newButton'),
    sectionTitle: (0, _emberI18n.translationMacro)('imaging.sectionTitle')
  });
});
define('hospitalrun/tests/imaging/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - imaging/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'imaging/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/add-item/controller', ['exports', 'ember', 'ember-i18n'], function (exports, _ember, _emberI18n) {
  'use strict';

  var Controller = _ember['default'].Controller;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = Controller.extend({
    showUpdateButton: true,
    title: (0, _emberI18n.translationMacro)('incident.titles.addCategoryItem'),
    updateButtonAction: 'add',
    updateButtonText: 'Add',

    incidentCategoryEdit: inject.controller('inc-category/edit'),
    editController: alias('incidentCategoryEdit'),

    actions: {
      add: function add() {
        var newItem = get(this, 'model');
        get(this, 'editController').send('addItem', newItem);
      },

      cancel: function cancel() {
        this.send('closeModal');
      }
    }
  });
});
define('hospitalrun/tests/inc-category/add-item/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/add-item/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/add-item/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractDeleteController, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: (0, _emberI18n.translationMacro)('incident.titles.deleteIncidentCategory')
  });
});
define('hospitalrun/tests/inc-category/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  var get = _ember['default'].get;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    updateCapability: 'add_incident_category',

    afterUpdate: function afterUpdate(record) {
      var i18n = get(this, 'i18n');
      var message = i18n.t('incident.messages.incidentCategorySaved', { name: get(record, 'incidentCategoryName') });
      var title = i18n.t('incident.titles.incidentCategorySaved');
      this.displayAlert(title, message);
    },

    actions: {
      addItem: function addItem(newItem) {
        var categoryItems = this.getWithDefault('model.incidentCategoryItems', []);
        var model = get(this, 'model');
        categoryItems.addObject(newItem);
        model.set('incidentCategoryItems', categoryItems);
        this.send('update', true);
        this.send('closeModal');
      },

      deleteItem: function deleteItem(model) {
        var item = model.get('itemToDelete');
        var categoryItems = get(this, 'model.incidentCategoryItems');
        categoryItems.removeObject(item);
        this.send('update', true);
      },

      showAddItem: function showAddItem() {
        this.send('openModal', 'inc-category.add-item', _ember['default'].Object.create());
      },

      showDeleteItem: function showDeleteItem(item) {
        var i18n = get(this, 'i18n');
        var modelName = i18n.t('models.item.names.singular');
        var message = i18n.t('messages.delete_singular', { name: modelName });
        var title = i18n.t('incident.titles.deleteItem');
        this.displayConfirm(title, message, 'deleteItem', _ember['default'].Object.create({
          itemToDelete: item
        }));
      }
    }

  });
});
define('hospitalrun/tests/inc-category/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    editTitle: (0, _emberI18n.translationMacro)('incident.titles.editIncidentCategory'),
    modelName: 'inc-category',
    newTitle: (0, _emberI18n.translationMacro)('incident.titles.newIncidentCategory'),

    actions: {
      deleteItem: function deleteItem(model) {
        this.controller.send('deleteItem', model);
      }
    }
  });
});
define('hospitalrun/tests/inc-category/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'ember'], function (exports, _hospitalrunControllersAbstractPagedController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    startKey: [],

    canDeleteIncidentCategory: _ember['default'].computed(function () {
      return this.currentUserCan('delete_incident_category');
    }),

    actions: {
      showDeleteIncidentCategory: function showDeleteIncidentCategory(category) {
        this.send('openModal', 'inc-category.delete', category);
      }
    }
  });
});
define('hospitalrun/tests/inc-category/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    modelName: 'inc-category',
    newButtonAction: 'newItem',
    newButtonText: (0, _emberI18n.translationMacro)('incident.buttons.newCategory'),
    pageTitle: (0, _emberI18n.translationMacro)('incident.titles.incidentCategories'),

    actions: {
      editItem: function editItem(category) {
        this.transitionTo('inc-category.edit', category);
      },

      newItem: function newItem() {
        this.transitionTo('inc-category.edit', 'new');
      }
    }
  });
});
define('hospitalrun/tests/inc-category/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inc-category/route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Route.extend(_emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    actions: {
      allItems: function allItems() {
        this.transitionTo('inc-category.index');
      }
    }
  });
});
define('hospitalrun/tests/inc-category/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inc-category/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inc-category/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/attachment/controller', ['exports', 'hospitalrun/patients/photo/controller', 'ember', 'ember-i18n'], function (exports, _hospitalrunPatientsPhotoController, _ember, _emberI18n) {
  'use strict';

  var inject = _ember['default'].inject;
  exports['default'] = _hospitalrunPatientsPhotoController['default'].extend({
    addAction: 'addAttachment',
    editTitle: (0, _emberI18n.translationMacro)('incident.titles.editAttachment'),
    modelName: 'attachment',
    newTitle: (0, _emberI18n.translationMacro)('incident.titles.addAttachment'),
    fileRequiredMessage: (0, _emberI18n.translationMacro)('incident.messages.attachmentFileRequired'),

    editController: inject.controller('incident/edit')

  });
});
define('hospitalrun/tests/incident/attachment/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/attachment/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/attachment/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/completed/controller', ['exports', 'hospitalrun/incident/index/controller'], function (exports, _hospitalrunIncidentIndexController) {
  'use strict';

  exports['default'] = _hospitalrunIncidentIndexController['default'].extend({
    canDelete: false,
    startKey: []
  });
});
define('hospitalrun/tests/incident/completed/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/completed/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/completed/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/completed/route', ['exports', 'hospitalrun/incident/index/route', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunIncidentIndexRoute, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunIncidentIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    editReturn: 'incident.completed',
    modelName: 'incident',
    pageTitle: (0, _emberI18n.translationMacro)('incident.titles.closed'),

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var id = this._getPouchIdFromItem(item);
      return [item.get('reportedBy'), id];
    },

    _modelQueryParams: function _modelQueryParams() {
      var maxId = this._getMaxPouchId();
      var currentUser = this.getUserName(true);
      var queryParams = {
        mapReduce: 'closed_incidents_by_user'
      };
      if (!this.currentUserCan('manage_incidents')) {
        queryParams.options = {
          startkey: [currentUser, null],
          endkey: [currentUser, maxId]
        };
      }
      return queryParams;
    }
  });
});
define('hospitalrun/tests/incident/completed/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/completed/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/completed/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'ember', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractDeleteController, _ember, _emberI18n) {
  'use strict';

  var get = _ember['default'].get;
  var RSVP = _ember['default'].RSVP;
  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: (0, _emberI18n.translationMacro)('incident.titles.deleteIncident'),

    _deleteChildObject: function _deleteChildObject(incident, childObject, destroyPromises) {
      incident.get(childObject).then(function (childObject) {
        childObject.forEach(function (child) {
          destroyPromises.push(child.destroyRecord()); // Add the destroy promise to the list
        });
      });
    },

    actions: {
      'delete': function _delete() {
        var destroyPromises = [];
        var incident = get(this, 'model');
        this._deleteChildObject(incident, 'notes', destroyPromises);
        RSVP.all(destroyPromises).then((function () {
          // fires when all the destroys have been completed.
          get(this, 'model').destroyRecord().then((function () {
            // delete incident
            this.send('closeModal');
          }).bind(this));
        }).bind(this));
      }
    }
  });
});
define('hospitalrun/tests/incident/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember-data', 'ember', 'hospitalrun/mixins/friendly-id', 'hospitalrun/mixins/incident-statuses', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/utils/select-values', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractEditController, _emberData, _ember, _hospitalrunMixinsFriendlyId, _hospitalrunMixinsIncidentStatuses, _hospitalrunMixinsPatientSubmodule, _hospitalrunUtilsSelectValues, _hospitalrunMixinsUserSession) {
  'use strict';

  var PromiseArray = _emberData['default'].PromiseArray;
  var PromiseObject = _emberData['default'].PromiseObject;
  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsIncidentStatuses['default'], _hospitalrunMixinsFriendlyId['default'], _hospitalrunMixinsPatientSubmodule['default'], _hospitalrunUtilsSelectValues['default'], _hospitalrunMixinsUserSession['default'], {
    lookupListsToUpdate: [{
      name: 'incidentDepartmentList',
      property: 'model.department',
      id: 'incident_departments'
    }],
    sequenceName: 'incident',
    sequenceView: 'incident_by_friendly_id',
    updateCapability: 'add_incident',

    customForms: inject.service(),
    database: inject.service(),
    filesystem: inject.service(),
    lookupLists: inject.service(),

    customFormsToAdd: alias('customForms.formsForSelect'),
    customFormsToDisplay: alias('customForms.formsToDisplay'),
    showAddFormButton: alias('customForms.showAddButton'),
    incidentController: inject.controller('incident'),

    canManageIncident: computed('model.{isNew,status}', function () {
      var canManageIncident = this.currentUserCan('manage_incidents');
      var status = get(this, 'model.status');
      var isNew = get(this, 'model.isNew');
      if (isNew || status === _hospitalrunMixinsIncidentStatuses.CLOSED) {
        canManageIncident = false;
      }
      return canManageIncident;
    }),

    canUpdateStatus: computed('model.isNew', function () {
      var canManageIncident = this.currentUserCan('manage_incidents');
      var isNew = get(this, 'model.isNew');
      return canManageIncident && !isNew;
    }),

    categoryNameList: computed('incidentCategoryList.@each.archived', function () {
      return PromiseArray.create({
        promise: get(this, 'incidentCategoryList').then(function (categoryList) {
          return categoryList.map(function (value) {
            return {
              id: get(value, 'incidentCategoryName'),
              value: get(value, 'incidentCategoryName')
            };
          });
        })
      });
    }),

    incidentCategoryList: computed(function () {
      var lookupLists = get(this, 'lookupLists');
      return lookupLists.getLookupList('incidentCategories');
    }).volatile(),

    incidentDepartmentList: computed('lookupListsLastUpdate', function () {
      var lookupLists = get(this, 'lookupLists');
      return PromiseObject.create({
        promise: lookupLists.getLookupList('incident_departments')
      });
    }).volatile(),

    incidentStatuses: computed(function () {
      var _this = this;

      return get(this, 'statusList').map(function (status) {
        return {
          id: status,
          value: _this.getLocalizedStatus(status)
        };
      });
    }),

    itemList: computed('model.categoryName', function () {
      var categoryNameSelected = get(this, 'model.categoryName');
      if (!_ember['default'].isEmpty(categoryNameSelected)) {
        return PromiseArray.create({
          promise: get(this, 'incidentCategoryList').then(function (categoryList) {
            var incidentCategory = categoryList.findBy('incidentCategoryName', categoryNameSelected);
            return get(incidentCategory, 'incidentCategoryItems');
          })
        });
      }
    }),

    afterUpdate: function afterUpdate() {
      var i18n = get(this, 'i18n');
      this.displayAlert(i18n.t('incident.titles.incidentSaved'), i18n.t('incident.messages.saved'));
    },

    beforeUpdate: function beforeUpdate() {
      var model = get(this, 'model');
      set(model, 'modifiedByDisplayName', this.getUserName(false));
      if (get(model, 'isNew')) {
        return this.generateFriendlyId('incident').then(function (friendlyId) {
          set(model, 'friendlyId', friendlyId);
        });
      } else {
        return _ember['default'].RSVP.resolve();
      }
    },

    setupCustomForms: function setupCustomForms() {
      var customForms = get(this, 'customForms');
      var model = get(this, 'model');
      customForms.setupForms('incident', model);
    },

    /**
     * Adds or removes the specified object from the specified list.
     * @param {String} listName The name of the list to operate on.
     * @param {Object} listObject The object to add or removed from the
     * specified list.
     * @param {boolean} removeObject If true remove the object from the list;
     * otherwise add the specified object to the list.
     */
    _updateList: function _updateList(listName, listObject, removeObject) {
      var model = get(this, 'model');
      get(model, listName).then((function (list) {
        if (removeObject) {
          list.removeObject(listObject);
        } else {
          list.addObject(listObject);
        }
        this.send('update', true);
        this.send('closeModal');
      }).bind(this));
    },

    actions: {
      addNote: function addNote(newNote) {
        this._updateList('notes', newNote);
      },

      addAttachment: function addAttachment(newAttachment) {
        this._updateList('incidentAttachments', newAttachment);
      },

      addCustomForm: function addCustomForm() {
        var model = get(this, 'model');
        var customFormsToAdd = get(this, 'customFormsToAdd');
        this.send('openModal', 'custom-form-add', _ember['default'].Object.create({
          modelToAddTo: model,
          customForms: customFormsToAdd
        }));
      },

      showAddAttachment: function showAddAttachment() {
        var newNote = get(this, 'store').createRecord('attachment', {
          dateAdded: new Date(),
          addedBy: this.getUserName(true),
          addedByDisplayName: this.getUserName(false),
          saveToDir: '/incidents/' + get(this, 'model.id') + '/'
        });
        this.send('openModal', 'incident.attachment', newNote);
      },

      showAddNote: function showAddNote() {
        var newNote = get(this, 'store').createRecord('incident-note', {
          dateRecorded: new Date(),
          givenBy: this.getUserName(true),
          givenByDisplayName: this.getUserName(false)
        });
        this.send('openModal', 'incident.note.edit', newNote);
      },

      deleteAttachment: function deleteAttachment(model) {
        var _this2 = this;

        var attachment = get(model, 'itemToDelete');
        this._updateList('incidentAttachments', attachment, true);
        attachment.destroyRecord().then(function () {
          var attachmentId = get(attachment, 'id');
          var database = get(_this2, 'database');
          var filePath = get(attachment, 'fileName');
          var fileSystem = get(_this2, 'filesystem');
          var isFileSystemEnabled = get(fileSystem, 'isFileSystemEnabled');
          if (isFileSystemEnabled) {
            var pouchDbId = database.getPouchId(attachmentId, 'attachment');
            fileSystem.deleteFile(filePath, pouchDbId)['catch'](function () /* ignored */{});
          }
        });
      },

      deleteNote: function deleteNote(note) {
        this._updateList('notes', note, true);
      },

      showDeleteAttachment: function showDeleteAttachment(attachment) {
        var i18n = get(this, 'i18n');
        var modelName = i18n.t('models.attachment.names.singular');
        var message = i18n.t('messages.delete_singular', { name: modelName });
        var model = _ember['default'].Object.create({
          itemToDelete: attachment
        });
        var title = i18n.t('incident.titles.deleteAttachment');
        this.displayConfirm(title, message, 'deleteAttachment', model);
      },

      showDeleteNote: function showDeleteNote(note) {
        this.send('openModal', 'incident.note.delete', note);
      },

      showEditAttachment: function showEditAttachment(attachment) {
        this.send('openModal', 'incident.attachment', attachment);
      },

      showEditNote: function showEditNote(note) {
        this.send('openModal', 'incident.note.edit', note);
      }

    }

  });
});
define('hospitalrun/tests/incident/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'hospitalrun/mixins/patient-list-route', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _hospitalrunMixinsPatientListRoute, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  var get = _ember['default'].get;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsPatientListRoute['default'], _hospitalrunMixinsUserSession['default'], {
    editTitle: (0, _emberI18n.translationMacro)('incident.titles.editIncident'),
    modelName: 'incident',
    newTitle: (0, _emberI18n.translationMacro)('incident.titles.newIncident'),

    customForms: _ember['default'].inject.service(),

    getNewData: function getNewData() {
      var customForms = get(this, 'customForms');
      var now = new Date();
      var newData = {
        customForms: _ember['default'].Object.create(),
        dateOfIncident: now,
        reportedDate: now,
        reportedBy: this.getUserName(true),
        reportedByDisplayName: this.getUserName(false)
      };
      return customForms.setDefaultCustomForms(['incident'], newData);
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      controller.setupCustomForms();
    },

    actions: {
      deleteAttachment: function deleteAttachment(model) {
        this.controller.send('deleteAttachment', model);
      }
    }
  });
});
define('hospitalrun/tests/incident/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'ember', 'hospitalrun/mixins/filter-list', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _ember, _hospitalrunMixinsFilterList, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsFilterList['default'], _hospitalrunMixinsUserSession['default'], {
    addPermission: 'add_incident',
    deletePermission: 'delete_incident',
    startKey: [],

    incidentController: inject.controller('incident'),
    departmentNames: alias('incidentController.incidentDepartmentList.value'),

    categoryItems: computed('model.@each.categoryItem', function () {
      return this._getUniqueValues('categoryItem');
    }),

    categoryNames: computed('model.@each.categoryName', function () {
      return this._getUniqueValues('categoryName');
    }),

    statusList: computed('model.@each.localizedStatus', function () {
      return this._getUniqueValues('localizedStatus');
    }),

    filteredIncidents: computed('model.[]', 'filterBy', 'filterValue', function () {
      var filterBy = get(this, 'filterBy');
      var filterValue = get(this, 'filterValue');
      var incidents = get(this, 'model');
      return this.filterList(incidents, filterBy, filterValue);
    }),

    sortedIncidents: computed('filteredIncidents', 'sortByKey', 'sortByDesc', function () {
      var filteredList = get(this, 'filteredIncidents');
      return this.sortFilteredList(filteredList);
    }),

    _getUniqueValues: function _getUniqueValues(attribute) {
      var uniqueValues = get(this, 'model').map(function (incident) {
        return get(incident, attribute);
      }).uniq();
      return uniqueValues.filter(function (value) {
        return !isEmpty(value);
      });
    },

    actions: {
      showDeleteIncident: function showDeleteIncident(incident) {
        this.send('openModal', 'incident.delete', incident);
      }
    }
  });
});
define('hospitalrun/tests/incident/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    editReturn: 'incident.index',
    itemsPerPage: null, // Fetch all incidents as one page
    modelName: 'incident',
    pageTitle: (0, _emberI18n.translationMacro)('incident.titles.incidents'),

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var id = this._getPouchIdFromItem(item);
      return [item.get('reportedBy'), id];
    },

    _modelQueryParams: function _modelQueryParams() {
      var maxId = this._getMaxPouchId();
      var currentUser = this.getUserName(true);
      var queryParams = {
        mapReduce: 'open_incidents_by_user'
      };
      if (!this.currentUserCan('manage_incidents')) {
        queryParams.options = {
          startkey: [currentUser, null],
          endkey: [currentUser, maxId]
        };
      }
      return queryParams;
    }

  });
});
define('hospitalrun/tests/incident/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/note/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'ember', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractDeleteController, _ember, _emberI18n) {
  'use strict';

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    afterDeleteAction: 'notifyNoteDelete',
    editController: inject.controller('incident/edit'),

    title: (0, _emberI18n.translationMacro)('incident.titles.deleteNote'),

    actions: {
      notifyNoteDelete: function notifyNoteDelete() {
        get(this, 'editController').send('deleteNote', get(this, 'model'));
        this.send('closeModal');
      }
    }
  });
});
define('hospitalrun/tests/incident/note/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/note/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/note/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/note/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var RSVP = _ember['default'].RSVP;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    cancelAction: 'closeModal',
    newNote: false,
    updateCapability: 'manage_incidents',

    editController: inject.controller('incident/edit'),

    title: computed('model.isNew', function () {
      var i18n = get(this, 'i18n');
      var isNew = get(this, 'model.isNew');
      if (isNew) {
        return i18n.t('incident.titles.addNote');
      }
      return i18n.t('incident.titles.editNote');
    }),

    afterUpdate: function afterUpdate(note) {
      if (get(this, 'newNote')) {
        get(this, 'editController').send('addNote', note);
      } else {
        this.send('closeModal');
      }
    },

    beforeUpdate: function beforeUpdate() {
      set(this, 'newNote', get(this, 'model.isNew'));
      return RSVP.resolve();
    }

  });
});
define('hospitalrun/tests/incident/note/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/note/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/note/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/reports/controller', ['exports', 'hospitalrun/controllers/abstract-report-controller', 'ember', 'hospitalrun/mixins/number-format', 'hospitalrun/mixins/user-session', 'moment'], function (exports, _hospitalrunControllersAbstractReportController, _ember, _hospitalrunMixinsNumberFormat, _hospitalrunMixinsUserSession, _moment) {
  'use strict';

  var get = _ember['default'].get;
  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  var RSVP = _ember['default'].RSVP;
  exports['default'] = _hospitalrunControllersAbstractReportController['default'].extend(_hospitalrunMixinsUserSession['default'], _hospitalrunMixinsNumberFormat['default'], {
    reportType: 'department',

    canGenerateReport: computed(function () {
      return this.currentUserCan('generate_incident_report');
    }),

    departmentReportColumns: computed(function () {
      var i18n = get(this, 'i18n');
      return {
        department: {
          label: i18n.t('incident.labels.department'),
          include: true,
          property: 'type' // property type because in _addReportRow function looks for column name with value as type
        },
        total: {
          label: i18n.t('incident.labels.total'),
          include: true,
          property: 'total',
          format: '_numberFormat'
        }
      };
    }),
    incidentCategoryReportColumns: computed(function () {
      var i18n = get(this, 'i18n');
      return {
        incidentCategory: {
          label: i18n.t('incident.labels.category'),
          include: true,
          property: 'type'
        },
        total: {
          label: i18n.t('incident.labels.total'),
          include: true,
          property: 'total',
          format: '_numberFormat'
        }
      };
    }),

    reportTypes: computed(function () {
      var i18n = get(this, 'i18n');
      return [{
        name: i18n.t('incident.titles.incidentsByDepartment'),
        value: 'department'
      }, {
        name: i18n.t('incident.titles.incidentsByCategory'),
        value: 'incidentCategory'
      }];
    }),

    /**
     * Find Incidents by the specified dates and the incidents's date.
     */
    _findIncidentsByDate: function _findIncidentsByDate() {
      var filterEndDate = get(this, 'endDate');
      var filterStartDate = get(this, 'startDate');
      var findParams = {
        options: {},
        mapReduce: 'incident_by_date'
      };
      var maxValue = get(this, 'maxValue');
      return new RSVP.Promise((function (resolve, reject) {
        if (isEmpty(filterStartDate)) {
          reject();
        }
        findParams.options.startkey = [filterStartDate.getTime(), null];

        if (!isEmpty(filterEndDate)) {
          filterEndDate = (0, _moment['default'])(filterEndDate).endOf('day').toDate();
          findParams.options.endkey = [filterEndDate.getTime(), maxValue];
        }
        return this.store.query('incident', findParams).then(resolve, reject);
      }).bind(this));
    },

    _generateByDepartmentOrByIncidentCategoryReport: function _generateByDepartmentOrByIncidentCategoryReport(incidents, reportType) {
      var reportColumns = undefined,
          reportProperty = undefined;
      if (reportType === 'department') {
        reportColumns = get(this, 'departmentReportColumns');
        reportProperty = 'department';
      } else {
        reportColumns = get(this, 'incidentCategoryReportColumns');
        reportProperty = 'categoryName';
      }
      this._addRowsByType(incidents, reportProperty, 'Total incidents: ', reportColumns);
      this._finishReport(reportColumns);
    },

    /**
     * Given a list of records, organize and total by them by type and then add them to the report.
     * @param records {Array} list of records to total.
     * @param typeField {String} the field in the records containing the type.
     * @param totalLabel {String} the label for the grand total.
     * @param reportColumns
     */
    _addRowsByType: function _addRowsByType(records, typeField, totalLabel, reportColumns) {
      var types = this._totalByType(records, typeField, totalLabel);
      types.forEach((function (type) {
        this._addReportRow(type, true, reportColumns);
      }).bind(this));
    },

    /**
     * Given a list of records, total them by type and also add a grand total.
     * @param records {Array} list of records to total.
     * @param typeField {String} the field in the records containing the type.
     * @param totalLabel {String} the label for the grand total.
     * @param reportColumns
     */
    _totalByType: function _totalByType(records, typeField, totalLabel) {
      var total = 0;
      var types = [];
      records.forEach(function (record) {
        var type = record.get(typeField);
        var typeObject = undefined;
        if (!isEmpty(type)) {
          typeObject = types.findBy('type', type);
          if (isEmpty(typeObject)) {
            typeObject = {
              type: type,
              total: 0,
              records: []
            };
            types.push(typeObject);
          }
          typeObject.total++;
          typeObject.records.push(record);
          total++;
        }
      });
      types = types.sortBy('type');
      types.push({ type: totalLabel, total: total });
      return types;
    },

    actions: {
      generateReport: function generateReport() {
        var _this = this;

        var reportRows = get(this, 'reportRows');
        var reportType = get(this, 'reportType');
        reportRows.clear();
        this.showProgressModal();
        switch (reportType) {
          case 'department':
          case 'incidentCategory':
            {
              this._findIncidentsByDate().then(function (incidents) {
                _this._generateByDepartmentOrByIncidentCategoryReport(incidents, reportType);
              })['catch'](function (ex) {
                console.log('Error:', ex);
                _this.closeProgressModal();
              });
              break;
            }
        }
      }
    }
  });
});
define('hospitalrun/tests/incident/reports/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/reports/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/reports/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/reports/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    pageTitle: 'Incident Report',

    // No model for reports; data gets retrieved when report is run.
    model: function model() {
      return _ember['default'].RSVP.resolve(_ember['default'].Object.create({}));
    }

  });
});
define('hospitalrun/tests/incident/reports/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/reports/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/reports/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/incident/route', ['exports', 'hospitalrun/routes/abstract-module-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractModuleRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_incident',
    additionalModels: [{
      name: 'incidentDepartmentList',
      findArgs: ['lookup', 'incident_departments']
    }, {
      name: 'incidentCategoryList',
      findArgs: ['inc-category']
    }],
    moduleName: 'incident',
    newButtonText: (0, _emberI18n.translationMacro)('incident.buttons.newIncident'),
    sectionTitle: (0, _emberI18n.translationMacro)('incident.titles.incidents')
  });
});
define('hospitalrun/tests/incident/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - incident/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'incident/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/initializers/i18n', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    name: 'i18n',

    after: 'ember-i18n',

    initialize: function initialize(app) {
      app.inject('route', 'i18n', 'service:i18n');
      app.inject('controller', 'i18n', 'service:i18n');
      app.inject('mixin', 'i18n', 'service:i18n');
      app.inject('model', 'i18n', 'service:i18n');
    }
  };
});
define('hospitalrun/tests/initializers/i18n.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - initializers/i18n.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'initializers/i18n.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/integration/components/calendar-control-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForComponent)('calendar-control', 'Integration | Component | calendar control', {
    integration: true
  });

  (0, _emberQunit.test)('it renders', function (assert) {
    this.render(Ember.HTMLBars.template({
      'id': '+BxiQ5WN',
      'block': '{"statements":[["append",["unknown",["calendar-control"]],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',
      'meta': {}
    }));

    assert.equal(this.$('.ember-view.full-calendar').length, 1);
  });
});
define('hospitalrun/tests/integration/components/calendar-control-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - integration/components/calendar-control-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'integration/components/calendar-control-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/integration/components/inventory/rank-select-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForComponent)('inventory/rank-select', 'Integration | Component | inventory/rank select', {
    integration: true
  });

  (0, _emberQunit.test)('it renders correctly', function (assert) {
    this.set('value', null);

    this.render(Ember.HTMLBars.template({
      'id': 'vWKziaVT',
      'block': '{"statements":[["append",["helper",["inventory/rank-select"],null,[["property","prompt"],["value","n/a"]]],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',
      'meta': {}
    }));

    // options
    var $options = this.$('option');
    assert.equal($options.length, 4, 'Should render 4 options');
    assert.equal($options[0].value, '', 'First option value is empty (prompt)');
    assert.equal($options[0].innerHTML.trim(), 'n/a', 'First option label is prompt');
    assert.equal($options[1].value, 'A', 'Second option is "A"');
    assert.equal($options[2].value, $options[2].innerHTML.trim(), 'Values are similar as labels');
  });
});
define('hospitalrun/tests/integration/components/inventory/rank-select-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - integration/components/inventory/rank-select-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'integration/components/inventory/rank-select-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/integration/components/medication-allergy-test', ['exports', 'ember-qunit', 'ember'], function (exports, _emberQunit, _ember) {
  'use strict';

  var Patient = _ember['default'].Object.extend({ allergies: [] });
  var patient = Patient.create();
  var Allergy = _ember['default'].Object.extend();
  var allergy = Allergy.create({ name: 'test allergy' });

  (0, _emberQunit.moduleForComponent)('medication-allergy', 'Integration | Component | medication allergy', {
    integration: true,
    beforeEach: function beforeEach() {
      this.inject.service('i18n');
    }
  });

  (0, _emberQunit.test)('allergy component renders with appropriate data', function (assert) {
    patient.get('allergies').pushObject(allergy);
    // Set any properties with this.set('myProperty', 'value');
    // Handle any actions with this.on('myAction', function(val) { ... });
    this.set('patient', patient);
    this.render(_ember['default'].HTMLBars.template({
      'id': 'fJBUU3mI',
      'block': '{"statements":[["append",["helper",["medication-allergy"],null,[["patient"],[["get",["patient"]]]]],false]],"locals":[],"named":[],"yields":[],"blocks":[],"hasPartials":false}',
      'meta': {}
    }));
    var allergyName = allergy.get('name');
    var allergies = patient.get('allergies');
    assert.equal(this.$('.allergy-list span').length, allergies.length, 'renders allergy list with correct list of elements');
    assert.equal(this.$('.allergy-list span').first().text().trim(), allergyName, 'renders allergy name');
  });
});
define('hospitalrun/tests/integration/components/medication-allergy-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - integration/components/medication-allergy-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'integration/components/medication-allergy-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/integration/components/number-input-test', ['exports', 'ember-qunit', 'ember-test-helpers/wait', 'ember'], function (exports, _emberQunit, _emberTestHelpersWait, _ember) {
  'use strict';

  (0, _emberQunit.moduleForComponent)('number-input', 'Integration | Component | number input', {
    integration: true
  });

  (0, _emberQunit.test)('the number-input renders', function (assert) {
    assert.expect(2);

    this.render(_ember['default'].HTMLBars.template({
      'id': 'RiD4k2NT',
      'block': '{"statements":[["text","\\n"],["block",["em-form"],null,[["model"],[["get",["model"]]]],0],["text","  "]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text","      "],["append",["helper",["number-input"],null,[["property","label","class"],["petType","Pet Type","test-number-input"]]],false],["text","\\n"]],"locals":[]}],"hasPartials":false}',
      'meta': {}
    }));

    assert.equal(this.$('label').text().trim(), 'Pet Type', 'it renders the label');
    assert.ok(_ember['default'].isPresent(this.$('.test-number-input')), 'it renders the input field');
  });

  (0, _emberQunit.test)('the number input sanitizes the data', function (assert) {
    assert.expect(1);

    this.set('model', _ember['default'].Object.create({ petType: 'cats' }));

    this.set('sanitizeFunction', function (value) {
      assert.equal(value, 'dragons', 'it passes the value to the sanitize function');
    });

    this.render(_ember['default'].HTMLBars.template({
      'id': '+K6+/A5x',
      'block': '{"statements":[["text","\\n"],["block",["em-form"],null,[["model"],[["get",["model"]]]],0],["text","  "]],"locals":[],"named":[],"yields":[],"blocks":[{"statements":[["text","      "],["append",["helper",["number-input"],null,[["property","sanitizeFunction","label","class"],["petType",["get",["sanitizeFunction"]],"Pet Type","test-number-input"]]],false],["text","\\n"]],"locals":[]}],"hasPartials":false}',
      'meta': {}
    }));

    this.$('input').eq(0).val('dragons');
    this.$('input').eq(0).trigger('input');
    this.$('input').eq(0).blur();
    return (0, _emberTestHelpersWait['default'])();
  });
});
define('hospitalrun/tests/integration/components/number-input-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - integration/components/number-input-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'integration/components/number-input-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/adjust/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/inventory-adjustment-types', 'ember', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsInventoryAdjustmentTypes, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsInventoryAdjustmentTypes['default'], {
    inventoryController: _ember['default'].inject.controller('inventory'),

    expenseAccountList: _ember['default'].computed.alias('inventoryController.expenseAccountList'),

    title: (0, _emberI18n.translationMacro)('inventory.titles.adjustment'),

    transactionTypeChanged: (function () {
      _ember['default'].run.once(this, function () {
        this.get('model').validate()['catch'](_ember['default'].K);
      });
    }).observes('transactionType'),

    updateButtonText: (function () {
      var transactionType = this.get('model.transactionType');
      var adjustmentType = this.get('adjustmentTypes').findBy('type', transactionType);
      return adjustmentType.name;
    }).property('model.transactionType'),

    updateButtonAction: 'adjust',

    updateCapability: 'adjust_inventory_location',

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      adjust: function adjust() {
        this.send('adjustItems', this.get('model'), true);
      }
    }
  });
});
define('hospitalrun/tests/inventory/adjust/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/adjust/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/adjust/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/barcode/controller', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend({
    selectedPrinter: null,

    barcodeUri: (function () {
      var id = this.get('model.id');
      var name = this.get('model.name');

      /* eslint new-cap: ['error', { 'capIsNew': false }]  */
      return _ember['default'].$(document).JsBarcode(id, {
        width: 1,
        height: 20,
        fontSize: 10,
        displayValue: name,
        returnUri: true
      });
    }).property('model.id', 'model.name'),

    printers: (function () {
      return dymo.label.framework.getTapePrinters();
    }).property(),

    havePrinters: (function () {
      var printers = this.get('printers');
      if (printers.length > 0) {
        return true;
      } else {
        return false;
      }
    }).property('printers'),

    singlePrinter: (function () {
      var printers = this.get('printers');
      if (printers.length === 1) {
        return true;
      } else {
        return false;
      }
    }).property('printers'),

    actions: {
      print: function print() {
        var barcodeUri = this.get('barcodeUri');
        var selectedPrinter = this.get('selectedPrinter');
        if (!selectedPrinter) {
          selectedPrinter = this.get('printers')[0].name;
        }
        _ember['default'].$.get('/dymo/BarcodeAsImage.label', function (labelXml) {
          var barcodeAsImageLabel = dymo.label.framework.openLabelXml(labelXml);
          var pngBase64 = barcodeUri.substr('data:image/png;base64,'.length);
          barcodeAsImageLabel.setObjectText('Image', pngBase64);
          barcodeAsImageLabel.print(selectedPrinter);
        }, 'text');
      }
    }

  });
});
define('hospitalrun/tests/inventory/barcode/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/barcode/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/barcode/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/barcode/route', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Route.extend({
    model: function model(params) {
      return this.store.find('inventory', params.inventory_id);
    }

  });
});
define('hospitalrun/tests/inventory/barcode/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/barcode/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/barcode/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/batch/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/inventory-id', 'hospitalrun/mixins/inventory-locations', 'ember', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsInventoryId, _hospitalrunMixinsInventoryLocations, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsInventoryId['default'], _hospitalrunMixinsInventoryLocations['default'], {
    doingUpdate: false,
    inventoryController: _ember['default'].inject.controller('inventory'),
    inventoryItems: null,
    warehouseList: _ember['default'].computed.alias('inventoryController.warehouseList'),
    aisleLocationList: _ember['default'].computed.alias('inventoryController.aisleLocationList'),
    vendorList: _ember['default'].computed.alias('inventoryController.vendorList'),
    purchaseAttributes: ['expirationDate', 'inventoryItem', 'lotNumber', 'purchaseCost', 'quantity', 'vendorItemNo'],

    inventoryList: (function () {
      var inventoryItems = this.get('inventoryItems');
      if (!_ember['default'].isEmpty(inventoryItems)) {
        var mappedItems = inventoryItems.map(function (item) {
          return item.doc;
        });
        return mappedItems;
      }
    }).property('inventoryItems.[]'),

    lookupListsToUpdate: [{
      name: 'aisleLocationList', // Name of property containing lookup list
      property: 'model.aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'aisle_location_list' // Id of the lookup list to update
    }, {
      name: 'vendorList', // Name of property containing lookup list
      property: 'model.vendor', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'vendor_list' // Id of the lookup list to update
    }, {
      name: 'warehouseList', // Name of property containing lookup list
      property: 'model.location', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'warehouse_list' // Id of the lookup list to update
    }],

    showDistributionUnit: (function () {
      return this._haveValidInventoryItem();
    }).property('model.inventoryItemTypeAhead', 'model.inventoryItem'),

    showInvoiceItems: (function () {
      var invoiceItems = this.get('model.invoiceItems');
      return !_ember['default'].isEmpty(invoiceItems);
    }).property('model.invoiceItems.[]'),

    totalReceived: (function () {
      var invoiceItems = this.get('model.invoiceItems');
      var total = 0;
      if (!_ember['default'].isEmpty('invoiceItems')) {
        total = invoiceItems.reduce(function (previousValue, item) {
          return previousValue + Number(item.get('purchaseCost'));
        }, total);
      }
      var purchaseCost = this.get('model.purchaseCost');
      if (this.get('model.isValid') && !_ember['default'].isEmpty(purchaseCost)) {
        total += Number(purchaseCost);
      }
      return total;
    }).property('model.invoiceItems.[].purchaseCost', 'model.isValid', 'model.purchaseCost'),

    updateButtonText: (0, _emberI18n.translationMacro)('inventory.labels.save'),

    updateCapability: 'add_inventory_item',

    _addNewInventoryItem: function _addNewInventoryItem() {
      this.generateId().then((function (inventoryId) {
        var inventoryItem = this.store.createRecord('inventory', {
          id: inventoryId,
          name: this.get('model.inventoryItemTypeAhead'),
          quantity: 0, // Needed for validation purposes
          skipSavePurchase: true
        });
        this.send('openModal', 'inventory.quick-add', inventoryItem);
      }).bind(this));
    },

    _addInventoryItem: function _addInventoryItem() {
      var model = this.get('model');
      var inventoryItemTypeAhead = this.get('model.inventoryItemTypeAhead');
      var purchaseCost = this.get('model.purchaseCost');
      var quantity = this.get('model.quantity');
      return model.validate().then((function () {
        if (this.get('model.isValid') && !_ember['default'].isEmpty(inventoryItemTypeAhead) && !_ember['default'].isEmpty(quantity) && !_ember['default'].isEmpty(purchaseCost)) {
          if (this._haveValidInventoryItem()) {
            this._addInvoiceItem();
          } else {
            this._addNewInventoryItem();
            return true;
          }
        } else {
          throw Error('invalid');
        }
      }).bind(this))['catch']((function () {
        this.displayAlert(this.get('i18n').t('inventory.titles.warning'), this.get('i18n').t('inventory.messages.warning'));
      }).bind(this));
    },

    _addInvoiceItem: function _addInvoiceItem() {
      var model = this.get('model');
      var invoiceItems = model.get('invoiceItems');
      var itemProperties = model.getProperties(this.get('purchaseAttributes'));
      var invoiceItem = _ember['default'].Object.create(itemProperties);
      invoiceItems.addObject(invoiceItem);
      model.set('expirationDate');
      model.set('inventoryItem');
      model.set('inventoryItemTypeAhead');
      model.set('lotNumber');
      model.set('purchaseCost');
      model.set('quantity');
      model.set('selectedInventoryItem');
      model.set('vendorItemNo');
    },

    _findInventoryItem: function _findInventoryItem(purchase) {
      var invoiceItems = this.get('model.invoiceItems');
      var inventoryId = purchase.get('inventoryItem');
      if (!_ember['default'].isEmpty(inventoryId)) {
        var invoiceItem = invoiceItems.find(function (item) {
          return item.get('inventoryItem.id') === inventoryId;
        }, this);
        if (!_ember['default'].isEmpty(invoiceItem)) {
          return invoiceItem.get('inventoryItem');
        }
      }
    },

    _haveValidInventoryItem: function _haveValidInventoryItem() {
      var inventoryItemTypeAhead = this.get('model.inventoryItemTypeAhead');
      var inventoryItem = this.get('model.inventoryItem');
      if (_ember['default'].isEmpty(inventoryItemTypeAhead) || _ember['default'].isEmpty(inventoryItem)) {
        return false;
      } else {
        var inventoryItemName = inventoryItem.get('name');
        var typeAheadName = inventoryItemTypeAhead.substr(0, inventoryItemName.length);
        if (typeAheadName !== inventoryItemName) {
          return false;
        } else {
          return true;
        }
      }
    },

    _savePurchases: function _savePurchases() {
      var model = this.get('model');
      var purchaseDefaults = model.getProperties(['dateReceived', 'vendor', 'invoiceNo', 'location', 'aisleLocation', 'giftInKind']);
      var invoiceItems = model.get('invoiceItems');
      var inventoryPurchase = undefined;
      var savePromises = [];
      invoiceItems.forEach((function (invoiceItem) {
        var inventoryItem = invoiceItem.get('inventoryItem');
        var quantity = invoiceItem.get('quantity');
        inventoryPurchase = this.store.createRecord('inv-purchase', purchaseDefaults);
        inventoryPurchase.setProperties(invoiceItem.getProperties(this.get('purchaseAttributes')));
        inventoryPurchase.setProperties({
          distributionUnit: inventoryItem.get('distributionUnit'),
          currentQuantity: quantity,
          originalQuantity: quantity,
          inventoryItem: inventoryItem.get('id')
        });
        savePromises.push(inventoryPurchase.save());
      }).bind(this));
      _ember['default'].RSVP.all(savePromises).then((function (results) {
        var inventorySaves = [];
        var purchasesAdded = [];
        results.forEach((function (newPurchase) {
          var inventoryItem = this._findInventoryItem(newPurchase);
          var purchases = inventoryItem.get('purchases');
          purchases.addObject(newPurchase);
          purchasesAdded.push(this.newPurchaseAdded(inventoryItem, newPurchase));
        }).bind(this));

        _ember['default'].RSVP.all(inventorySaves).then((function () {
          results.forEach((function (newPurchase) {
            var inventoryItem = this._findInventoryItem(newPurchase);
            inventoryItem.updateQuantity();
            inventorySaves.push(inventoryItem.save());
          }).bind(this));
          _ember['default'].RSVP.all(inventorySaves).then((function () {
            this.updateLookupLists();
            this.displayAlert(this.get('i18n').t('inventory.titles.purchaseSaved'), this.get('i18n').t('inventory.messages.purchaseSaved'), 'allItems');
          }).bind(this));
        }).bind(this));
      }).bind(this));
    },

    actions: {
      addInventoryItem: function addInventoryItem() {
        this._addInventoryItem();
      },

      addedNewInventoryItem: function addedNewInventoryItem(inventoryItem) {
        this.set('model.inventoryItem', inventoryItem);
        this._addInvoiceItem();
        this.send('closeModal');
        if (this.get('doingUpdate')) {
          this._savePurchases();
        }
      },

      removeItem: function removeItem(removeInfo) {
        var invoiceItems = this.get('model.invoiceItems');
        var item = removeInfo.itemToRemove;
        invoiceItems.removeObject(item);
        this.send('closeModal');
      },

      showRemoveItem: function showRemoveItem(item) {
        var message = this.get('i18n').t('inventory.messages.removeItem');
        var model = _ember['default'].Object.create({
          itemToRemove: item
        });
        var title = this.get('i18n').t('inventory.titles.removeItem');
        this.displayConfirm(title, message, 'removeItem', model);
      },

      /**
       * Update the model
       */
      update: function update() {
        this.set('doingUpdate', true);
        this._addInventoryItem().then((function (addingNewInventory) {
          if (!addingNewInventory) {
            this._savePurchases();
          }
        }).bind(this));
      }
    }
  });
});
define('hospitalrun/tests/inventory/batch/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/batch/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/batch/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/batch/route', ['exports', 'hospitalrun/inventory/request/route', 'ember', 'ember-i18n'], function (exports, _hospitalrunInventoryRequestRoute, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunInventoryRequestRoute['default'].extend({
    editTitle: (0, _emberI18n.translationMacro)('navigation.subnav.inventoryReceived'),
    modelName: 'inventory-batch',
    newTitle: (0, _emberI18n.translationMacro)('navigation.subnav.inventoryReceived'),
    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        invoiceItems: [],
        dateReceived: new Date()
      });
    },

    actions: {
      addedNewInventoryItem: function addedNewInventoryItem(model) {
        this.controller.send('addedNewInventoryItem', model);
      }
    }
  });
});
define('hospitalrun/tests/inventory/batch/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/batch/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/batch/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/delete/controller', ['exports', 'ember-i18n', 'hospitalrun/controllers/abstract-delete-controller'], function (exports, _emberI18n, _hospitalrunControllersAbstractDeleteController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: (0, _emberI18n.translationMacro)('inventory.labels.deleteItem')
  });
});
define('hospitalrun/tests/inventory/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/friendly-id', 'hospitalrun/mixins/inventory-locations', 'hospitalrun/mixins/inventory-type-list', 'hospitalrun/mixins/return-to', 'hospitalrun/mixins/unit-types', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsFriendlyId, _hospitalrunMixinsInventoryLocations, _hospitalrunMixinsInventoryTypeList, _hospitalrunMixinsReturnTo, _hospitalrunMixinsUnitTypes, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsFriendlyId['default'], _hospitalrunMixinsInventoryLocations['default'], _hospitalrunMixinsInventoryTypeList['default'], _hospitalrunMixinsReturnTo['default'], _hospitalrunMixinsUnitTypes['default'], _hospitalrunMixinsUserSession['default'], {
    inventory: _ember['default'].inject.controller(),
    savingNewItem: false,
    sequenceView: 'inventory_by_friendly_id',

    canAddPurchase: (function () {
      return this.currentUserCan('add_inventory_purchase');
    }).property(),

    canAdjustLocation: function canAdjustLocation() {
      return this.currentUserCan('adjust_inventory_location');
    },

    warehouseList: _ember['default'].computed.alias('inventory.warehouseList'),
    aisleLocationList: _ember['default'].computed.alias('inventory.aisleLocationList'),
    inventoryTypeList: _ember['default'].computed.alias('inventory.inventoryTypeList.value'),
    inventoryUnitList: _ember['default'].computed.alias('inventory.inventoryUnitList.value'),
    vendorList: _ember['default'].computed.alias('inventory.vendorList'),
    database: _ember['default'].inject.service(),

    lookupListsToUpdate: [{
      name: 'aisleLocationList', // Name of property containing lookup list
      property: 'model.aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'aisle_location_list' // Id of the lookup list to update
    }, {
      name: 'vendorList', // Name of property containing lookup list
      property: 'model.vendor', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'vendor_list' // Id of the lookup list to update
    }, {
      name: 'warehouseList', // Name of property containing lookup list
      property: 'model.location', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'warehouse_list' // Id of the lookup list to update
    }],

    canEditQuantity: (function () {
      return this.get('model.isNew');
    }).property('model.isNew'),

    haveTransactions: (function () {
      var transactions = this.get('transactions');
      return transactions !== null;
    }).property('transactions.[]'),

    locationQuantityTotal: (function () {
      var locations = this.get('model.locations');
      var total = locations.reduce(function (previousValue, location) {
        return previousValue + parseInt(location.get('quantity'));
      }, 0);
      return total;
    }).property('model.locations'),

    /**
     * Check to see if the total quantity by location matches the quantity calculated on the item
     * @return {boolean} true if there is a discrepency;otherwise false.
     */
    quantityDiscrepency: (function () {
      var locationQuantityTotal = this.get('locationQuantityTotal');
      var quantity = this.get('model.quantity');
      return !_ember['default'].isEmpty(locationQuantityTotal) && !_ember['default'].isEmpty(quantity) && locationQuantityTotal !== quantity;
    }).property('locationQuantityTotal', 'model.quantity'),

    /**
     * Get the difference in quantity between the total quantity by location and the quantity on the item.
     * @return {int} the difference.
     */
    quantityDifferential: (function () {
      var locationQuantityTotal = this.get('locationQuantityTotal');
      var quantity = this.get('model.quantity');
      return Math.abs(locationQuantityTotal - quantity);
    }).property('locationQuantityTotal', 'model.quantity'),

    originalQuantityUpdated: (function () {
      var isNew = this.get('model.isNew');
      var quantity = this.get('model.originalQuantity');
      if (isNew && !_ember['default'].isEmpty(quantity)) {
        this.set('model.quantity', quantity);
      }
    }).observes('model.isNew', 'model.originalQuantity'),

    sequenceName: computed('model.inventoryType', function () {
      var inventoryType = get(this, 'model.inventoryType');
      return 'inventory_' + inventoryType;
    }),

    showTransactions: (function () {
      var transactions = this.get('transactions');
      return !_ember['default'].isEmpty(transactions);
    }).property('transactions.[]'),

    transactions: null,

    updateCapability: 'add_inventory_item',

    actions: {
      adjustItems: function adjustItems(inventoryLocation) {
        var adjustmentQuantity = parseInt(inventoryLocation.get('adjustmentQuantity'));
        var inventoryItem = this.get('model');
        var transactionType = inventoryLocation.get('transactionType');
        var request = this.get('store').createRecord('inv-request', {
          adjustPurchases: true,
          dateCompleted: inventoryLocation.get('dateCompleted'),
          expenseAccount: inventoryLocation.get('expenseAccount'),
          inventoryItem: inventoryItem,
          quantity: adjustmentQuantity,
          transactionType: transactionType,
          reason: inventoryLocation.get('reason'),
          deliveryAisle: inventoryLocation.get('aisleLocation'),
          deliveryLocation: inventoryLocation.get('location')
        });
        request.set('inventoryLocations', [inventoryLocation]);
        var increment = false;
        if (transactionType === 'Adjustment (Add)' || transactionType === 'Return') {
          increment = true;
        }
        request.set('markAsConsumed', true);
        // Make sure inventory item is resolved first.
        request.get('inventoryItem').then((function () {
          this.send('fulfillRequest', request, true, increment, true);
        }).bind(this));
      },

      editNewItem: function editNewItem() {
        this.send('editItem', this.get('model.id'));
      },

      showAdjustment: function showAdjustment(inventoryLocation) {
        inventoryLocation.setProperties({
          dateCompleted: new Date(),
          adjustmentItem: this.get('model'),
          adjustmentQuantity: '',
          reason: '',
          transferItem: null,
          transactionType: 'Adjustment (Add)'
        });
        this.send('openModal', 'inventory.adjust', inventoryLocation);
      },

      showTransfer: function showTransfer(inventoryLocation) {
        inventoryLocation.set('adjustmentQuantity');
        inventoryLocation.set('transferItem', this.get('model'));
        inventoryLocation.set('dateCompleted', new Date());
        this.send('openModal', 'inventory.transfer', inventoryLocation);
      },

      transferItems: function transferItems(inventoryLocation) {
        var inventoryItem = this.get('model');
        var request = this.get('store').createRecord('inv-request', {
          adjustPurchases: false,
          dateCompleted: inventoryLocation.get('dateCompleted'),
          inventoryItem: inventoryItem,
          quantity: inventoryLocation.get('adjustmentQuantity'),
          deliveryAisle: inventoryLocation.get('transferAisleLocation'),
          deliveryLocation: inventoryLocation.get('transferLocation'),
          transactionType: 'Transfer'
        });
        this.transferToLocation(inventoryItem, inventoryLocation).then((function () {
          inventoryLocation.setProperties({
            transferItem: null,
            transferLocation: null,
            transferAisleLocation: null,
            adjustmentQuantity: null
          });
          request.set('locationsAffected', [{
            name: inventoryLocation.get('locationName'),
            quantity: request.get('quantity')
          }]);
          request.get('inventoryItem').then((function () {
            // Make sure relationships are resolved before saving
            this._saveRequest(request);
          }).bind(this));
        }).bind(this));
      },

      updatePurchase: function updatePurchase(purchase, updateQuantity) {
        if (updateQuantity) {
          this.get('model').updateQuantity();
          this.send('update', true);
        }
        this.send('closeModal');
      }
    },

    _completeBeforeUpdate: function _completeBeforeUpdate(friendlyId) {
      var promises = [];
      var model = this.get('model');
      var newPurchase = model.getProperties('aisleLocation', 'dateReceived', 'purchaseCost', 'lotNumber', 'expirationDate', 'giftInKind', 'invoiceNo', 'location', 'originalQuantity', 'quantityGroups', 'vendor', 'vendorItemNo');
      var quantity = this.get('model.originalQuantity');
      if (!_ember['default'].isEmpty(quantity)) {
        newPurchase.currentQuantity = quantity;
        newPurchase.inventoryItem = this.get('model.id');
        var purchase = this.get('store').createRecord('inv-purchase', newPurchase);
        promises.push(purchase.save());
        this.get('model.purchases').addObject(purchase);
        promises.push(this.newPurchaseAdded(this.get('model'), purchase));
      }
      model.set('friendlyId', friendlyId);
      return _ember['default'].RSVP.all(promises, 'All before update done for inventory item');
    },

    /**
     * Saves the specified request, then updates the inventory item and closes the modal.
     */
    _saveRequest: function _saveRequest(request) {
      request.set('status', 'Completed');
      request.set('completedBy', request.getUserName());
      request.save().then((function () {
        this.send('update', true);
        this.send('closeModal');
        this.getTransactions();
      }).bind(this));
    },

    getTransactions: function getTransactions() {
      var inventoryId = this.get('model.id');
      this.set('transactions', null);
      this.store.query('inv-request', {
        options: {
          endkey: [inventoryId, 'Completed', 0],
          startkey: [inventoryId, 'Completed', 9999999999999],
          descending: true
        },
        mapReduce: 'inventory_request_by_item'
      }).then((function (transactions) {
        this.set('transactions', transactions);
      }).bind(this));
    },

    beforeUpdate: function beforeUpdate() {
      var _this = this;

      if (this.get('model.isNew')) {
        var _ret = (function () {
          var model = _this.get('model');
          return {
            v: model.validate().then(function () {
              if (model.get('isValid')) {
                _this.set('savingNewItem', true);
                return _this.generateFriendlyId('inventory').then(function (friendlyId) {
                  return _this._completeBeforeUpdate(friendlyId);
                });
              } else {
                throw Error('invalid model');
              }
            })['catch'](function () {
              _this.send('showDisabledDialog');
            })
          };
        })();

        if (typeof _ret === 'object') return _ret.v;
      } else {
        return _ember['default'].RSVP.Promise.resolve();
      }
    },

    afterUpdate: function afterUpdate() {
      var afterUpdateAction = null;
      if (this.get('savingNewItem')) {
        afterUpdateAction = 'editNewItem';
        this.set('savingNewItem', false);
      }
      this.displayAlert('Inventory Item Saved', 'The inventory item has been saved.', afterUpdateAction);
    }
  });
});
define('hospitalrun/tests/inventory/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'ember-i18n', 'hospitalrun/mixins/inventory-id'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _emberI18n, _hospitalrunMixinsInventoryId) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsInventoryId['default'], {
    editTitle: (0, _emberI18n.translationMacro)('inventory.labels.editItem'),
    modelName: 'inventory',
    newTitle: (0, _emberI18n.translationMacro)('inventory.labels.newItem'),

    actions: {
      adjustItems: function adjustItems(inventoryLocation) {
        this.controller.send('adjustItems', inventoryLocation);
      },

      doneFulfillRequest: function doneFulfillRequest() {
        this.controller.getTransactions();
      },

      editNewItem: function editNewItem() {
        this.controller.send('editNewItem');
      },

      transferItems: function transferItems(inventoryLocation) {
        this.controller.send('transferItems', inventoryLocation);
      },

      updatePurchase: function updatePurchase(purchase, updateQuantity) {
        this.controller.send('updatePurchase', purchase, updateQuantity);
      }
    },

    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        dateReceived: new Date(),
        quantityGroups: []
      });
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      controller.getTransactions();
    }
  });
});
define('hospitalrun/tests/inventory/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/index/controller', ['exports', 'ember', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _ember, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    startKey: [],
    canAdd: (function () {
      return this.currentUserCan('add_inventory_request');
    }).property(),

    canFulfill: (function () {
      return this.currentUserCan('fulfill_inventory');
    }).property(),

    currentUserName: computed('', function () {
      return this.getUserName();
    })
  });
});
define('hospitalrun/tests/inventory/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    modelName: 'inv-request',
    newButtonAction: (function () {
      if (this.currentUserCan('add_inventory_request')) {
        return 'newRequest';
      } else {
        return null;
      }
    }).property(),
    newButtonText: (0, _emberI18n.translationMacro)('buttons.newRequestPlus'),
    pageTitle: (0, _emberI18n.translationMacro)('navigation.subnav.requests'),

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var itemId = this._getPouchIdFromItem(item);
      return ['Requested', null, itemId];
    },

    _modelQueryParams: function _modelQueryParams() {
      var maxValue = this.get('maxValue');
      return {
        options: {
          startkey: ['Requested', null, null],
          endkey: ['Requested', maxValue, maxValue]
        },
        mapReduce: 'inventory_request_by_status'
      };
    },

    actions: {
      fulfill: function fulfill(item) {
        item.set('dateCompleted', new Date());
        this.transitionTo('inventory.request', item);
      }
    }
  });
});
define('hospitalrun/tests/inventory/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/listing/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    canAddItem: (function () {
      return this.currentUserCan('add_inventory_item');
    }).property(),

    canAddPurchase: (function () {
      return this.currentUserCan('add_inventory_purchase');
    }).property(),

    canDeleteItem: (function () {
      return this.currentUserCan('delete_inventory_item');
    }).property(),

    startKey: []
  });
});
define('hospitalrun/tests/inventory/listing/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/listing/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/listing/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/listing/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'hospitalrun/mixins/user-session', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _hospitalrunMixinsUserSession, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    modelName: 'inventory',
    newButtonAction: (function () {
      if (this.currentUserCan('add_inventory_item')) {
        return 'newItem';
      } else {
        return null;
      }
    }).property(),
    newButtonText: (0, _emberI18n.translationMacro)('buttons.newItem'),
    pageTitle: (0, _emberI18n.translationMacro)('inventory.labels.items'),

    _modelQueryParams: function _modelQueryParams() {
      return {
        mapReduce: 'inventory_by_name'
      };
    },

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var inventoryId = this._getPouchIdFromItem(item);
      return [item.get('name'), inventoryId];
    }

  });
});
define('hospitalrun/tests/inventory/listing/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/listing/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/listing/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/purchase/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/unit-types'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsUnitTypes) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsUnitTypes['default'], {
    inventoryController: _ember['default'].inject.controller('inventory'),
    cancelAction: 'closeModal',

    canEditQuantity: (function () {
      var originalQuantity = this.get('model.originalQuantity');
      var currentQuantity = this.get('model.currentQuantity');
      if (currentQuantity < originalQuantity) {
        return false;
      }
      return true;
    }).property('model.currentQuantity', 'model.originalQuantity'),

    warehouseList: _ember['default'].computed.alias('inventoryController.warehouseList'),
    aisleLocationList: _ember['default'].computed.alias('inventoryController.aisleLocationList'),
    inventoryUnitList: _ember['default'].computed.alias('inventoryController.inventoryUnitList.value'),
    vendorList: _ember['default'].computed.alias('inventoryController.vendorList'),

    lookupListsToUpdate: [{
      name: 'aisleLocationList', // Name of property containing lookup list
      property: 'model.aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'aisle_location_list' // Id of the lookup list to update
    }, {
      name: 'vendorList', // Name of property containing lookup list
      property: 'model.vendor', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'vendor_list' // Id of the lookup list to update
    }, {
      name: 'warehouseList', // Name of property containing lookup list
      property: 'model.location', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'warehouse_list' // Id of the lookup list to update
    }],

    newPurchase: false,

    updateQuantity: false,

    updateCapability: 'add_inventory_purchase',

    title: (function () {
      var i18n = this.get('i18n');
      var isNew = this.get('model.isNew');
      if (isNew) {
        return i18n.t('inventory.titles.addPurchase');
      }
      return i18n.t('inventory.titles.editPurchase');
    }).property('model.isNew'),

    beforeUpdate: function beforeUpdate() {
      var isNew = this.get('model.isNew');
      var changedAttributes = this.get('model').changedAttributes();
      if (changedAttributes.originalQuantity) {
        this.set('model.currentQuantity', this.get('model.originalQuantity'));
        if (!isNew) {
          this.set('updateQuantity', true);
        }
      }
      if (isNew) {
        this.set('newPurchase', true);
      }
      return _ember['default'].RSVP.Promise.resolve();
    },

    afterUpdate: function afterUpdate(record) {
      if (this.get('newPurchase')) {
        this.send('addPurchase', record);
      } else {
        this.send('updatePurchase', record, true);
      }
    }
  });
});
define('hospitalrun/tests/inventory/purchase/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/purchase/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/purchase/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/quick-add/controller', ['exports', 'hospitalrun/inventory/edit/controller', 'ember-i18n'], function (exports, _hospitalrunInventoryEditController, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunInventoryEditController['default'].extend({
    title: (0, _emberI18n.translationMacro)('inventory.titles.inventoryItem'),

    updateCapability: 'add_inventory_item',

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      }
    },

    beforeUpdate: function beforeUpdate() {
      if (this.get('model.skipSavePurchase')) {
        this.set('model.quantity', null);
      }
      return this._super();
    },

    afterUpdate: function afterUpdate(record) {
      this.send('addedNewInventoryItem', record);
    }
  });
});
define('hospitalrun/tests/inventory/quick-add/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/quick-add/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/quick-add/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/rank-select/component', ['exports', 'ember', 'hospitalrun/utils/select-values', 'ember-computed'], function (exports, _ember, _hospitalrunUtilsSelectValues, _emberComputed) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    rankOptions: [],
    prompt: ' ',
    'class': 'col-sm-2 test-inv-rank',

    options: (0, _emberComputed['default'])('rankOptions', function () {
      return _hospitalrunUtilsSelectValues['default'].selectValues(this.get('rankOptions'));
    }),

    init: function init() {
      this._super.apply(this, arguments);

      // set available options
      this.set('rankOptions', _ember['default'].A(['A', 'B', 'C']));
    }
  });
});
define('hospitalrun/tests/inventory/rank-select/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/rank-select/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/rank-select/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/reports/controller', ['exports', 'hospitalrun/controllers/abstract-report-controller', 'ember', 'hospitalrun/mixins/inventory-adjustment-types', 'hospitalrun/mixins/location-name', 'hospitalrun/mixins/modal-helper', 'moment', 'hospitalrun/mixins/number-format', 'hospitalrun/utils/select-values'], function (exports, _hospitalrunControllersAbstractReportController, _ember, _hospitalrunMixinsInventoryAdjustmentTypes, _hospitalrunMixinsLocationName, _hospitalrunMixinsModalHelper, _moment, _hospitalrunMixinsNumberFormat, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractReportController['default'].extend(_hospitalrunMixinsLocationName['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsNumberFormat['default'], _hospitalrunMixinsInventoryAdjustmentTypes['default'], {
    inventoryController: _ember['default'].inject.controller('inventory'),
    effectiveDate: null,
    endDate: null,
    expenseCategories: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return [i18n.t('inventory.labels.inventoryConsumed'), i18n.t('inventory.labels.giftUsage'), i18n.t('inventory.labels.inventoryObsolence')];
    }),
    expenseMap: null,
    filterLocation: null,
    grandCost: 0,
    grandQuantity: 0,
    locationSummary: null,
    reportType: 'daysLeft',
    startDate: null,

    database: _ember['default'].inject.service(),
    warehouseList: _ember['default'].computed.map('inventoryController.warehouseList.value', _hospitalrunUtilsSelectValues['default'].selectValuesMap),
    reportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        date: {
          label: i18n.t('labels.date'),
          include: true,
          property: 'date'
        },
        id: {
          label: i18n.t('labels.id'),
          include: true,
          property: 'inventoryItem.friendlyId'
        },
        name: {
          label: i18n.t('inventory.labels.name'),
          include: true,
          property: 'inventoryItem.name'
        },
        transactionType: {
          label: i18n.t('inventory.labels.adjustmentType'),
          include: false,
          property: 'transactionType'
        },
        expenseAccount: {
          label: i18n.t('inventory.labels.expense'),
          include: false,
          property: 'expenseAccount'
        },
        description: {
          label: i18n.t('labels.description'),
          include: false,
          property: 'inventoryItem.description'
        },
        type: {
          label: i18n.t('labels.type'),
          include: true,
          property: 'inventoryItem.inventoryType'
        },
        xref: {
          label: i18n.t('inventory.labels.crossReference'),
          include: false,
          property: 'inventoryItem.crossReference'
        },
        reorder: {
          label: i18n.t('inventory.labels.reorderPoint'),
          include: false,
          property: 'inventoryItem.reorderPoint',
          format: '_numberFormat'
        },
        price: {
          label: i18n.t('inventory.labels.salePricePerUnit'),
          include: false,
          property: 'inventoryItem.price',
          format: '_numberFormat'
        },
        quantity: {
          label: i18n.t('labels.quantity'),
          include: true,
          property: 'quantity',
          format: '_numberFormat'
        },
        consumedPerDay: {
          label: i18n.t('inventory.labels.consumptionRate'),
          include: false,
          property: 'consumedPerDay'
        },
        daysLeft: {
          label: i18n.t('inventory.labels.daysLeft'),
          include: false,
          property: 'daysLeft'
        },
        unit: {
          label: i18n.t('inventory.labels.distributionUnit'),
          include: true,
          property: 'inventoryItem.distributionUnit'
        },
        unitcost: {
          label: i18n.t('inventory.labels.unitCost'),
          include: true,
          property: 'unitCost',
          format: '_numberFormat'
        },
        total: {
          label: i18n.t('inventory.labels.totalCost'),
          include: true,
          property: 'totalCost',
          format: '_numberFormat'
        },
        gift: {
          label: i18n.t('inventory.labels.gift'),
          include: true,
          property: 'giftInKind'
        },
        locations: {
          label: i18n.t('inventory.labels.locations'),
          include: true,
          property: 'locations',
          format: '_addLocationColumn'
        },
        aisle: {
          label: i18n.t('inventory.labels.aisle'),
          include: false,
          property: 'locations',
          format: '_addAisleColumn'
        },
        vendor: {
          label: i18n.t('inventory.labels.vendor'),
          include: false,
          property: 'vendors'
        }
      };
    }),
    reportTypes: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return [{
        name: i18n.t('inventory.reports.daysSupply'),
        value: 'daysLeft'
      }, {
        name: i18n.t('inventory.reports.adjustment'),
        value: 'detailedAdjustment'
      }, {
        name: i18n.t('inventory.reports.purchaseDetail'),
        value: 'detailedPurchase'
      }, {
        name: i18n.t('inventory.reports.stockUsageDetail'),
        value: 'detailedUsage'
      }, {
        name: i18n.t('inventory.reports.stockTransferDetail'),
        value: 'detailedTransfer'
      }, {
        name: i18n.t('inventory.reports.expenseDetail'),
        value: 'detailedExpense'
      }, {
        name: i18n.t('inventory.reports.expiration'),
        value: 'expiration'
      }, {
        name: i18n.t('inventory.reports.invLocation'),
        value: 'byLocation'
      }, {
        name: i18n.t('inventory.reports.invValuation'),
        value: 'valuation'
      }, {
        name: i18n.t('inventory.reports.expenseSum'),
        value: 'summaryExpense'
      }, {
        name: i18n.t('inventory.reports.purchaseSum'),
        value: 'summaryPurchase'
      }, {
        name: i18n.t('inventory.reports.stockUsageSum'),
        value: 'summaryUsage'
      }, {
        name: i18n.t('inventory.reports.stockTransferSum'),
        value: 'summaryTransfer'
      }, {
        name: i18n.t('inventory.reports.finance'),
        value: 'summaryFinance'
      }];
    }),

    hideLocationFilter: (function () {
      var reportType = this.get('reportType');
      return reportType === 'summaryFinance';
    }).property('reportType'),

    includeDate: (function () {
      var reportType = this.get('reportType');
      if (!_ember['default'].isEmpty(reportType) && reportType.indexOf('detailed') === 0) {
        this.set('reportColumns.date.include', true);
        return true;
      } else {
        this.set('reportColumns.date.include', false);
        return false;
      }
    }).property('reportType'),

    includeDaysLeft: (function () {
      var reportType = this.get('reportType');
      if (reportType === 'daysLeft') {
        this.set('reportColumns.consumedPerDay.include', true);
        this.set('reportColumns.daysLeft.include', true);
        return true;
      } else {
        this.set('reportColumns.consumedPerDay.include', false);
        this.set('reportColumns.daysLeft.include', false);
        return false;
      }
    }).property('reportType'),

    includeCostFields: (function () {
      var reportType = this.get('reportType');
      if (reportType === 'detailedTransfer' || reportType === 'summaryTransfer' || reportType === 'daysLeft') {
        this.set('reportColumns.total.include', false);
        this.set('reportColumns.unitcost.include', false);
        return false;
      } else {
        this.set('reportColumns.total.include', true);
        this.set('reportColumns.unitcost.include', true);
        return true;
      }
    }).property('reportType'),

    includeExpenseAccount: (function () {
      var reportType = this.get('reportType');
      switch (reportType) {
        case 'detailedAdjustment':
        case 'detailedTransfer':
        case 'detailedUsage':
          {
            return true;
          }
        case 'detailedExpense':
          {
            this.set('reportColumns.expenseAccount.include', true);
            return true;
          }
        default:
          {
            this.set('reportColumns.expenseAccount.include', false);
            return false;
          }
      }
    }).property('reportType'),

    includeTransactionType: (function () {
      var reportType = this.get('reportType');
      if (reportType === 'detailedAdjustment') {
        this.set('reportColumns.transactionType.include', true);
        return true;
      } else {
        this.set('reportColumns.transactionType.include', false);
        return false;
      }
    }).property('reportType'),

    showEffectiveDate: (function () {
      var reportType = this.get('reportType');
      if (reportType === 'valuation' || reportType === 'byLocation') {
        this.set('startDate', null);
        if (_ember['default'].isEmpty(this.get('endDate'))) {
          this.set('endDate', new Date());
        }
        return true;
      } else {
        if (_ember['default'].isEmpty(this.get('startDate'))) {
          this.set('startDate', new Date());
        }
        return false;
      }
    }).property('reportType'),

    useFieldPicker: (function () {
      var reportType = this.get('reportType');
      return reportType !== 'expiration' && reportType !== 'summaryFinance';
    }).property('reportType'),

    _addAisleColumn: function _addAisleColumn(locations) {
      if (!_ember['default'].isEmpty(locations)) {
        return locations.map(function (location) {
          if (location.name.indexOf(':') > -1) {
            return location.name.split(':')[1];
          }
        });
      }
    },

    _addLocationColumn: function _addLocationColumn(locations) {
      var _this = this;

      if (!_ember['default'].isEmpty(locations)) {
        var _ret = (function () {
          var returnLocations = [];
          locations.forEach((function (location) {
            var formattedName = undefined;
            if (location.name.indexOf('From:') === 0) {
              formattedName = location.name;
            } else {
              formattedName = this._getWarehouseLocationName(location.name);
            }
            if (!returnLocations.includes(formattedName)) {
              returnLocations.push(formattedName);
            }
          }).bind(_this));
          return {
            v: returnLocations
          };
        })();

        if (typeof _ret === 'object') return _ret.v;
      }
    },

    _addReportRow: function _addReportRow(row, skipNumberFormatting, reportColumns, rowAction) {
      if (_ember['default'].isEmpty(rowAction) && !_ember['default'].isEmpty(row.inventoryItem) && !_ember['default'].isEmpty(row.inventoryItem.id)) {
        rowAction = {
          action: 'viewInventory',
          model: row.inventoryItem.id
        };
      }
      this._super(row, skipNumberFormatting, reportColumns, rowAction);
    },

    _addTotalsRow: function _addTotalsRow(label, summaryCost, summaryQuantity) {
      if (summaryQuantity > 0) {
        this._addReportRow({
          totalCost: label + this._numberFormat(summaryCost),
          quantity: label + this._numberFormat(summaryQuantity),
          unitCost: label + this._numberFormat(summaryCost / summaryQuantity)
        }, true);
      }
    },

    /**
     * Adjust the specified location by the specified quantity
     * @param {array} locations the list of locations to adjust from
     * @param {string} locationName the name of the location to adjust
     * @param {integer} quantity the quantity to adjust.
     * @param {boolean} increment boolean indicating if the adjustment is an increment; or false if decrement.
     */
    _adjustLocation: function _adjustLocation(locations, locationName, quantity, increment) {
      var locationToUpdate = locations.findBy('name', locationName);
      if (_ember['default'].isEmpty(locationToUpdate)) {
        locationToUpdate = {
          name: locationName,
          quantity: 0
        };
        locations.push(locationToUpdate);
      }
      if (increment) {
        locationToUpdate.quantity += quantity;
      } else {
        locationToUpdate.quantity -= quantity;
      }
    },

    /**
     * Adjust the specified purchase by the specified quantity.
     * @param {array} purchases the list of purchases to adjust from.
     * @param {string} purchaseId the id of the purchase to adjust.
     * @param {integer} quantity the quantity to adjust.
     * @param {boolean} increment boolean indicating if the adjustment is an increment; or false if decrement.
     */
    _adjustPurchase: function _adjustPurchase(purchases, purchaseId, quantity, increment) {
      var purchaseToAdjust = purchases.findBy('id', purchaseId);
      if (!_ember['default'].isEmpty(purchaseToAdjust)) {
        var calculatedQuantity = purchaseToAdjust.calculatedQuantity;

        if (increment) {
          calculatedQuantity += quantity;
        } else {
          calculatedQuantity -= quantity;
        }
        purchaseToAdjust.calculatedQuantity = calculatedQuantity;
      }
    },

    _calculateCosts: function _calculateCosts(inventoryPurchases, row) {
      // Calculate quantity and cost per unit for the row
      if (!_ember['default'].isEmpty(inventoryPurchases)) {
        inventoryPurchases.forEach((function (purchase) {
          var costPerUnit = this._calculateCostPerUnit(purchase);
          var quantity = purchase.calculatedQuantity;
          row.quantity += purchase.calculatedQuantity;
          row.totalCost += quantity * costPerUnit;
        }).bind(this));
      }
      if (row.totalCost === 0 || row.quantity === 0) {
        row.unitCost = 0;
      } else {
        row.unitCost = row.totalCost / row.quantity;
      }
      return row;
    },

    _calculateUsage: function _calculateUsage(inventoryPurchases, row) {
      // Calculate quantity and cost per unit for the row
      if (!_ember['default'].isEmpty(inventoryPurchases)) {
        inventoryPurchases.forEach((function (purchase) {
          var costPerUnit = this._calculateCostPerUnit(purchase);
          var quantity = purchase.calculatedQuantity;
          row.quantity -= purchase.calculatedQuantity;
          row.totalCost -= quantity * costPerUnit;
        }).bind(this));
      }
      if (row.totalCost === 0 || row.quantity === 0) {
        row.unitCost = 0;
      } else {
        row.unitCost = row.totalCost / row.quantity;
      }
      return row;
    },

    _calculateCostPerUnit: function _calculateCostPerUnit(purchase) {
      var purchaseCost = purchase.purchaseCost;

      var quantity = parseInt(purchase.originalQuantity);
      if (_ember['default'].isEmpty(purchaseCost) || _ember['default'].isEmpty(quantity)) {
        return 0;
      }
      return Number((purchaseCost / quantity).toFixed(2));
    },

    _findInventoryItems: function _findInventoryItems(queryParams, view, inventoryList, childName) {
      if (_ember['default'].isEmpty(inventoryList)) {
        inventoryList = {};
      }
      var database = this.get('database');
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        database.queryMainDB(queryParams, view).then((function (inventoryChildren) {
          var inventoryKeys = Object.keys(inventoryList);
          var inventoryIds = [];
          if (!_ember['default'].isEmpty(inventoryChildren.rows)) {
            inventoryChildren.rows.forEach(function (child) {
              if (child.doc.inventoryItem && !inventoryKeys.includes(child.doc.inventoryItem)) {
                inventoryIds.push(database.getPouchId(child.doc.inventoryItem, 'inventory'));
                inventoryKeys.push(child.doc.inventoryItem);
              }
            });
          }
          this._getInventoryItems(inventoryIds, inventoryList).then(function (inventoryMap) {
            // Link inventory children to inventory items
            inventoryChildren.rows.forEach(function (child) {
              var childItem = inventoryMap[child.doc.inventoryItem];
              if (!_ember['default'].isEmpty(childItem)) {
                if (childName !== 'purchaseObjects' || childItem.purchases.includes(child.doc.id)) {
                  var itemChildren = childItem[childName];
                  if (_ember['default'].isEmpty(itemChildren)) {
                    itemChildren = [];
                  }
                  itemChildren.push(child.doc);
                  childItem[childName] = itemChildren;
                }
              }
            });
            resolve(inventoryMap);
          }, reject);
        }).bind(this), reject);
      }).bind(this));
    },

    _findInventoryItemsByPurchase: function _findInventoryItemsByPurchase(reportTimes, inventoryMap) {
      return this._findInventoryItems({
        startkey: [reportTimes.startTime, 'invPurchase_'],
        endkey: [reportTimes.endTime, 'invPurchase_'],
        include_docs: true
      }, 'inventory_purchase_by_date_received', inventoryMap, 'purchaseObjects');
    },

    _findInventoryItemsByRequest: function _findInventoryItemsByRequest(reportTimes, inventoryMap) {
      return this._findInventoryItems({
        startkey: ['Completed', reportTimes.startTime, 'invRequest_'],
        endkey: ['Completed', reportTimes.endTime, 'invRequest_'],
        include_docs: true
      }, 'inventory_request_by_status', inventoryMap, 'requestObjects');
    },

    _finishExpenseReport: function _finishExpenseReport(reportType) {
      var expenseCategories = this.get('expenseCategories');
      var expenseMap = this.get('expenseMap');
      var i18n = this.get('i18n');
      expenseCategories.forEach((function (category) {
        var categoryTotal = 0;
        var expenseAccountName = undefined,
            totalLabel = undefined;
        this._addReportRow({
          inventoryItem: {
            name: i18n.t('inventory.reports.rows.expensesFor') + category
          }
        });
        expenseMap[category].expenseAccounts.forEach((function (expenseAccount) {
          if (reportType === 'detailedExpense') {
            expenseAccount.reportRows.forEach((function (row) {
              this._addReportRow(row);
            }).bind(this));
          }
          if (_ember['default'].isEmpty(expenseAccount.name)) {
            expenseAccountName = i18n.t('inventory.reports.rows.noAccount');
          } else {
            expenseAccountName = expenseAccount.name;
          }
          totalLabel = i18n.t('inventory.reports.rows.subtotalFor', { category: category, account: expenseAccountName });
          this._addReportRow({
            totalCost: totalLabel + this._numberFormat(expenseAccount.total)
          }, true);
          categoryTotal += expenseAccount.total;
        }).bind(this));
        totalLabel = i18n.t('inventory.reports.rows.totalFor', { 'var': category });
        this._addReportRow({
          totalCost: totalLabel + this._numberFormat(categoryTotal)
        }, true);
        this.incrementProperty('grandCost', categoryTotal);
      }).bind(this));
      this._addReportRow({
        totalCost: i18n.t('inventory.reports.rows.total') + this._numberFormat(this.get('grandCost'))
      }, true);
    },

    _finishLocationReport: function _finishLocationReport() {
      var currentLocation = '';
      var locationCost = 0;
      var locationSummary = this.get('locationSummary');
      var parentLocation = '';
      var parentCount = 0;
      var i18n = this.get('i18n');
      locationSummary = locationSummary.sortBy('name');
      locationSummary.forEach((function (location) {
        parentLocation = this._getWarehouseLocationName(location.name);
        var label = i18n.t('inventory.reports.rows.totalFor', { 'var': currentLocation });
        if (currentLocation !== parentLocation) {
          this._addTotalsRow(label, locationCost, parentCount);
          parentCount = 0;
          locationCost = 0;
          currentLocation = parentLocation;
        }
        if (this._includeLocation(parentLocation)) {
          for (var id in location.items) {
            if (location.items[id].quantity > 0) {
              this._addReportRow({
                giftInKind: location.items[id].giftInKind,
                inventoryItem: location.items[id].item,
                quantity: location.items[id].quantity,
                locations: [{
                  name: location.name
                }],
                totalCost: location.items[id].totalCost,
                unitCost: location.items[id].unitCost
              });
              parentCount += this._getValidNumber(location.items[id].quantity);
              locationCost += this._getValidNumber(location.items[id].totalCost);
              this.incrementProperty('grandCost', this._getValidNumber(location.items[id].totalCost));
              this.incrementProperty('grandQuantity', this._getValidNumber(location.items[id].quantity));
            }
          }
        }
      }).bind(this));
      if (parentCount > 0) {
        this._addTotalsRow(i18n.t('inventory.reports.rows.totalFor', { 'var': parentLocation }), locationCost, parentCount);
      }
    },

    _generateExpirationReport: function _generateExpirationReport() {
      var grandQuantity = 0;
      var database = this.get('database');
      var reportRows = this.get('reportRows');
      var reportTimes = this._getDateQueryParams();
      database.queryMainDB({
        startkey: [reportTimes.startTime, 'invPurchase_'],
        endkey: [reportTimes.endTime, 'invPurchase_'],
        include_docs: true
      }, 'inventory_purchase_by_expiration_date').then((function (inventoryPurchases) {
        var purchaseDocs = [];
        var inventoryIds = [];

        inventoryPurchases.rows.forEach((function (purchase) {
          if (purchase.doc.currentQuantity > 0 && !_ember['default'].isEmpty(purchase.doc.expirationDate)) {
            purchaseDocs.push(purchase.doc);
            inventoryIds.push(database.getPouchId(purchase.doc.inventoryItem, 'inventory'));
          }
        }).bind(this));
        this._getInventoryItems(inventoryIds).then((function (inventoryMap) {
          var i18n = this.get('i18n');
          purchaseDocs.forEach((function (purchase) {
            var currentQuantity = purchase.currentQuantity;

            var expirationDate = new Date(purchase.expirationDate);
            var inventoryItem = inventoryMap[purchase.inventoryItem];
            if (inventoryItem && this._includeLocation(purchase.location)) {
              reportRows.addObject([inventoryItem.friendlyId, inventoryItem.name, currentQuantity, inventoryItem.distributionUnit, (0, _moment['default'])(expirationDate).format('l'), this.formatLocationName(purchase.location, purchase.aisleLocation)]);
              grandQuantity += currentQuantity;
            }
          }).bind(this));
          reportRows.addObject(['', '', i18n.t('inventory.reports.rows.total') + grandQuantity, '', '']);
          this.set('showReportResults', true);
          this.set('reportHeaders', [i18n.t('labels.id'), i18n.t('labels.name'), i18n.t('inventory.labels.currentQuantity'), i18n.t('inventory.labels.distributionUnit'), i18n.t('inventory.labels.expirationDate'), i18n.t('inventory.labels.location')]);
          this._generateExport();
          this._setReportTitle();
          this.closeProgressModal();
        }).bind(this));
      }).bind(this));
    },

    _generateFinancialSummaryReport: function _generateFinancialSummaryReport() {
      var reportTimes = this._getDateQueryParams();
      /*
      step 1: find the valuation as of start date,
      meaning that we need to exchange the end date to be the start date and then tabulate the value
      */
      this._calculateBeginningBalance(reportTimes).then((function (beginningBalance) {
        this._generateSummaries(reportTimes).then((function (inventoryAdjustment) {
          var i = this._numberFormat(beginningBalance + inventoryAdjustment);
          var i18n = this.get('i18n');
          if (beginningBalance + inventoryAdjustment < 0) {
            this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceEnd'), '', '(' + i + ')']);
          } else {
            this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceEnd'), '', i]);
          }
          this.set('showReportResults', true);
          this.set('reportHeaders', [i18n.t('inventory.reports.rows.category'), i18n.t('labels.type'), i18n.t('inventory.labels.total')]);
          this._generateExport();
          this._setReportTitle();
          this.closeProgressModal();
        }).bind(this), (function (err) {
          this._notifyReportError(this.get('i18n').t('inventory.reports.rows.errInFinSum') + err);
        }).bind(this));
      }).bind(this));
    },

    _generateSummaries: function _generateSummaries(reportTimes) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var adjustedValue = 0;
        var i18n = this.get('i18n');
        /*
        cycle through each purchase and request from the beginning of time until startTime
        to determine the total value of inventory as of that date/time.
        */
        this._findInventoryItemsByRequest(reportTimes, {}).then((function (inventoryMap) {
          this._findInventoryItemsByPurchase(reportTimes, inventoryMap).then((function (inventoryMap) {
            var purchaseSummary = {};
            var consumed = {};
            var gikConsumed = {};
            var adjustments = {};
            this.get('adjustmentTypes').forEach(function (adjustmentType) {
              adjustments[adjustmentType.type] = [];
            });
            Object.keys(inventoryMap).forEach((function (key) {
              if (_ember['default'].isEmpty(key) || _ember['default'].isEmpty(inventoryMap[key])) {
                // If the inventory item has been deleted, ignore it.
                return;
              }
              var item = inventoryMap[key];

              if (!_ember['default'].isEmpty(item.purchaseObjects)) {
                item.purchaseObjects.forEach((function (purchase) {
                  purchaseSummary[item.inventoryType] = this._getValidNumber(purchaseSummary[item.inventoryType]) + this._getValidNumber(purchase.purchaseCost);
                }).bind(this));
              }
              if (!_ember['default'].isEmpty(item.requestObjects)) {
                item.requestObjects.forEach((function (request) {
                  // we have three categories here: consumed, gik consumed, and adjustments
                  if (request.adjustPurchases) {
                    if (request.transactionType === 'Fulfillment') {
                      if (request.giftInKind) {
                        gikConsumed[item.inventoryType] = this._getValidNumber(gikConsumed[item.inventoryType]) + this._getValidNumber(request.quantity * request.costPerUnit);
                      } else {
                        consumed[item.inventoryType] = this._getValidNumber(consumed[item.inventoryType]) + this._getValidNumber(request.quantity * request.costPerUnit);
                      }
                    } else {
                      adjustments[request.transactionType][item.inventoryType] = this._getValidNumber(adjustments[request.transactionType][item.inventoryType]) + this._getValidNumber(request.quantity * request.costPerUnit);
                    }
                  }
                }).bind(this));
              }
            }).bind(this));
            // write the purchase rows
            if (Object.keys(purchaseSummary).length > 0) {
              var purchaseTotal = 0;
              this.get('reportRows').addObject([i18n.t('inventory.labels.purchases'), '', '']);
              Object.keys(purchaseSummary).forEach((function (key) {
                var i = this._getValidNumber(purchaseSummary[key]);
                purchaseTotal += i;
                this.get('reportRows').addObject(['', key, this._numberFormat(i)]);
              }).bind(this));
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.totalPurchases'), '', this._numberFormat(purchaseTotal)]);
              adjustedValue += purchaseTotal;
            }
            // write the consumed rows
            if (Object.keys(consumed).length > 0 || Object.keys(gikConsumed).length > 0) {
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumed'), '', '']);
              var overallValue = 0;
              if (Object.keys(consumed).length > 0) {
                this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedPuchases'), '', '']);
                var consumedTotal = 0;
                Object.keys(consumed).forEach((function (key) {
                  var i = this._getValidNumber(consumed[key]);
                  consumedTotal += i;
                  this.get('reportRows').addObject(['', key, '(' + this._numberFormat(i) + ')']);
                }).bind(this));
                overallValue += consumedTotal;
                this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedPurchasesTotal'), '', '(' + this._numberFormat(consumedTotal) + ')']);
              }
              if (Object.keys(gikConsumed).length > 0) {
                this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedGik'), '', '']);
                var gikTotal = 0;
                Object.keys(gikConsumed).forEach((function (key) {
                  var i = this._getValidNumber(gikConsumed[key]);
                  gikTotal += i;
                  this.get('reportRows').addObject(['', key, '(' + this._numberFormat(i) + ')']);
                }).bind(this));
                overallValue += gikTotal;
                this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedGikTotal'), '', '(' + this._numberFormat(gikTotal) + ')']);
              }
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.consumedTotal'), '', '(' + this._numberFormat(overallValue) + ')']);
              adjustedValue -= overallValue;
            }
            // write the adjustment rows
            var adjustmentTotal = 0;
            this.get('reportRows').addObject([i18n.t('inventory.reports.rows.adjustments'), '', '']);
            Object.keys(adjustments).forEach((function (adjustmentT) {
              if (Object.keys(adjustments[adjustmentT]).length > 0) {
                this.get('reportRows').addObject([adjustmentT, '', '']);
                Object.keys(adjustments[adjustmentT]).forEach((function (key) {
                  var i = this._getValidNumber(adjustments[adjustmentT][key]);
                  if (adjustmentT === 'Adjustment (Add)' || adjustmentT === 'Return') {
                    adjustmentTotal += i;
                    this.get('reportRows').addObject(['', key, this._numberFormat(i)]);
                  } else {
                    adjustmentTotal -= i;
                    this.get('reportRows').addObject(['', key, '(' + this._numberFormat(i) + ')']);
                  }
                }).bind(this));
              }
            }).bind(this));
            if (adjustmentTotal < 0) {
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.adjustmentsTotal'), '', '(' + this._numberFormat(adjustmentTotal) + ')']);
            } else {
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.adjustmentsTotal'), '', this._numberFormat(adjustmentTotal)]);
            }

            adjustedValue += adjustmentTotal;
            resolve(adjustedValue);
          }).bind(this), reject);
        }).bind(this), reject);
      }).bind(this));
    },

    _calculateBeginningBalance: function _calculateBeginningBalance(reportTimes) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var startingValueReportTimes = {
          startTime: null,
          endTime: reportTimes.startTime
        };
        var beginningBalance = 0;
        var i18n = this.get('i18n');
        /*
        cycle through each purchase and request from the beginning of time until startTime
        to determine the total value of inventory as of that date/time.
        */
        this._findInventoryItemsByRequest(startingValueReportTimes, {}).then((function (inventoryMap) {
          this._findInventoryItemsByPurchase(startingValueReportTimes, inventoryMap).then((function (inventoryMap) {
            Object.keys(inventoryMap).forEach((function (key) {
              if (_ember['default'].isEmpty(key) || _ember['default'].isEmpty(inventoryMap[key])) {
                // If the inventory item has been deleted, ignore it.
                return;
              }
              var item = inventoryMap[key];
              var inventoryPurchases = item.purchaseObjects;
              var inventoryRequests = item.requestObjects;
              var row = {
                inventoryItem: item,
                quantity: 0,
                unitCost: 0,
                totalCost: 0
              };
              if (!_ember['default'].isEmpty(inventoryPurchases)) {
                // Setup intial locations for an inventory item
                inventoryPurchases.forEach(function (purchase) {
                  var purchaseQuantity = purchase.originalQuantity;
                  purchase.calculatedQuantity = purchaseQuantity;
                });
              }
              if (!_ember['default'].isEmpty(inventoryRequests)) {
                inventoryRequests.forEach((function (request) {
                  var adjustPurchases = request.adjustPurchases;

                  var increment = false;
                  var purchases = request.purchasesAffected;
                  var transactionType = request.transactionType;

                  increment = transactionType === 'Adjustment (Add)' || transactionType === 'Return';
                  if (adjustPurchases) {
                    if (!_ember['default'].isEmpty(purchases) && !_ember['default'].isEmpty(inventoryPurchases)) {
                      // Loop through purchase(s) on request and adjust corresponding inventory purchases
                      purchases.forEach((function (purchaseInfo) {
                        this._adjustPurchase(inventoryPurchases, purchaseInfo.id, purchaseInfo.quantity, increment);
                      }).bind(this));
                    }
                  }
                }).bind(this));
              }
              if (!_ember['default'].isEmpty(inventoryPurchases)) {
                row = this._calculateCosts(inventoryPurchases, row);
                beginningBalance += this._getValidNumber(row.totalCost);
              }
            }).bind(this));
            if (beginningBalance < 0) {
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceBegin'), '', '(' + this._numberFormat(beginningBalance) + ')']);
            } else {
              this.get('reportRows').addObject([i18n.t('inventory.reports.rows.balanceBegin'), '', this._numberFormat(beginningBalance)]);
            }
            resolve(beginningBalance);
          }).bind(this), reject);
        }).bind(this), reject);
      }).bind(this));
    },

    _generateInventoryReport: function _generateInventoryReport() {
      this.set('grandCost', 0);
      this.set('grandQuantity', 0);
      this.set('locationSummary', []);
      var dateDiff = undefined;
      var locationSummary = this.get('locationSummary');
      var reportType = this.get('reportType');
      var reportTimes = this._getDateQueryParams();
      var i18n = this.get('i18n');
      if (reportType === 'daysLeft') {
        var endDate = this.get('endDate');
        var startDate = this.get('startDate');
        if (_ember['default'].isEmpty(endDate) || _ember['default'].isEmpty(startDate)) {
          this.closeProgressModal();
          return;
        } else {
          dateDiff = (0, _moment['default'])(endDate).diff(startDate, 'days');
        }
      }
      this._findInventoryItemsByRequest(reportTimes, {}).then((function (inventoryMap) {
        this._findInventoryItemsByPurchase(reportTimes, inventoryMap).then((function (inventoryMap) {
          // Loop through each inventory item, looking at the requests and purchases to determine
          // state of inventory at effective date
          Object.keys(inventoryMap).forEach((function (key) {
            if (_ember['default'].isEmpty(inventoryMap[key])) {
              // If the inventory item has been deleted, ignore it.
              return;
            }
            var item = inventoryMap[key];
            var inventoryPurchases = item.purchaseObjects;
            var inventoryRequests = item.requestObjects;
            var row = {
              giftInKind: 'N',
              inventoryItem: item,
              quantity: 0,
              unitCost: 0,
              totalCost: 0,
              locations: [],
              vendors: []
            };
            if (!_ember['default'].isEmpty(inventoryPurchases)) {
              // Setup intial locations for an inventory item
              inventoryPurchases.forEach((function (purchase) {
                var locationName = this.getDisplayLocationName(purchase.location, purchase.aisleLocation);
                var purchaseQuantity = purchase.originalQuantity;
                purchase.calculatedQuantity = purchaseQuantity;
                if (purchase.giftInKind === true) {
                  row.giftInKind = 'Y';
                }
                if (!_ember['default'].isEmpty(purchase.vendor)) {
                  if (!row.vendors.includes(purchase.vendor)) {
                    row.vendors.push(purchase.vendor);
                  }
                }
                this._adjustLocation(row.locations, locationName, purchaseQuantity, true);
              }).bind(this));
            }

            if (!_ember['default'].isEmpty(inventoryRequests)) {
              inventoryRequests.forEach((function (request) {
                var adjustPurchases = request.adjustPurchases;
                var transactionType = request.transactionType;

                var increment = false;
                var locations = request.locationsAffected;
                var purchases = request.purchasesAffected;

                increment = transactionType === 'Adjustment (Add)' || transactionType === 'Return';
                if (adjustPurchases) {
                  if (!_ember['default'].isEmpty(purchases) && !_ember['default'].isEmpty(inventoryPurchases)) {
                    // Loop through purchase(s) on request and adjust corresponding inventory purchases
                    purchases.forEach((function (purchaseInfo) {
                      this._adjustPurchase(inventoryPurchases, purchaseInfo.id, purchaseInfo.quantity, increment);
                    }).bind(this));
                  }
                } else if (transactionType === 'Transfer') {
                  // Increment the delivery location
                  var locationName = this.getDisplayLocationName(request.deliveryLocation, request.deliveryAisle);
                  this._adjustLocation(row.locations, locationName, request.quantity, true);
                }
                // Loop through locations to adjust location quantity
                locations.forEach((function (locationInfo) {
                  this._adjustLocation(row.locations, locationInfo.name, locationInfo.quantity, increment);
                }).bind(this));
              }).bind(this));
            }

            var summaryCost = 0;
            var summaryQuantity = 0;

            switch (reportType) {
              case 'byLocation':
                {
                  row.locations.forEach((function (location) {
                    var locationToUpdate = locationSummary.findBy('name', this._getWarehouseLocationName(location.name));
                    if (_ember['default'].isEmpty(locationToUpdate)) {
                      locationToUpdate = _ember['default'].copy(location);
                      locationToUpdate.items = {};
                      locationSummary.push(locationToUpdate);
                    } else {
                      locationToUpdate.quantity += this._getValidNumber(location.quantity);
                    }
                    var costData = this._calculateCosts(inventoryPurchases, {
                      quantity: 0,
                      totalCost: 0
                    });
                    locationToUpdate.items[item.id] = {
                      item: item,
                      quantity: this._getValidNumber(location.quantity),
                      giftInKind: row.giftInKind,
                      totalCost: this._getValidNumber(costData.unitCost) * this._getValidNumber(location.quantity),
                      unitCost: this._getValidNumber(costData.unitCost)
                    };
                  }).bind(this));
                  break;
                }
              case 'daysLeft':
                {
                  if (!_ember['default'].isEmpty(inventoryRequests) && this._hasIncludedLocation(row.locations)) {
                    var consumedQuantity = inventoryRequests.reduce((function (previousValue, request) {
                      if (request.transactionType === 'Fulfillment') {
                        return previousValue += this._getValidNumber(request.quantity);
                      } else {
                        return previousValue;
                      }
                    }).bind(this), 0);
                    row.quantity = this._getValidNumber(item.quantity);
                    if (consumedQuantity > 0) {
                      row.consumedPerDay = this._numberFormat(consumedQuantity / dateDiff, true);
                      row.daysLeft = this._numberFormat(row.quantity / row.consumedPerDay);
                    } else {
                      if (consumedQuantity === 0) {
                        row.consumedPerDay = '0';
                      } else {
                        row.consumedPerDay = '?' + consumedQuantity;
                      }
                      row.daysLeft = '?';
                    }
                    this._addReportRow(row);
                  }
                  break;
                }
              case 'detailedAdjustment':
              case 'detailedTransfer':
              case 'detailedUsage':
              case 'detailedExpense':
              case 'summaryExpense':
                {
                  if (!_ember['default'].isEmpty(inventoryRequests)) {
                    inventoryRequests.forEach((function (request) {
                      var _this2 = this;

                      if (this._includeTransaction(reportType, request.transactionType) && this._hasIncludedLocation(request.locationsAffected)) {
                        (function () {
                          var deliveryLocation = _this2.getDisplayLocationName(request.deliveryLocation, request.deliveryAisle);
                          var locations = [];
                          var num = _this2._getValidNumber(request.quantity);
                          var totalCost = _this2._getValidNumber(request.quantity) * _this2._getValidNumber(request.costPerUnit);
                          locations = request.locationsAffected.map((function (location) {
                            if (reportType === 'detailedTransfer') {
                              return {
                                name: i18n.t('inventory.reports.rows.transfer2', { source: location.name, target: deliveryLocation }).toString()
                              };
                            } else {
                              return {
                                name: i18n.t('inventory.reports.rows.transfer1', { quantity: num, location: location.name }).toString()
                              };
                            }
                          }).bind(_this2));
                          var reportRow = {
                            date: (0, _moment['default'])(new Date(request.dateCompleted)).format('l'),
                            expenseAccount: request.expenseAccount,
                            giftInKind: row.giftInKind,
                            inventoryItem: row.inventoryItem,
                            quantity: request.quantity,
                            transactionType: request.transactionType,
                            locations: locations,
                            unitCost: request.costPerUnit,
                            totalCost: totalCost
                          };
                          if (reportType === 'detailedExpense' || reportType === 'summaryExpense') {
                            _this2._updateExpenseMap(request, reportRow);
                          } else {
                            _this2._addReportRow(reportRow);
                            summaryQuantity += _this2._getValidNumber(request.quantity);
                            summaryCost += _this2._getValidNumber(totalCost);
                          }
                        })();
                      }
                    }).bind(this));
                    if (reportType !== 'detailedExpense' && reportType !== 'summaryExpense') {
                      this._addTotalsRow(i18n.t('inventory.reports.rows.subtotal'), summaryCost, summaryQuantity);
                      this.incrementProperty('grandCost', summaryCost);
                      this.incrementProperty('grandQuantity', summaryQuantity);
                    }
                  }
                  break;
                }
              case 'summaryTransfer':
              case 'summaryUsage':
                {
                  if (!_ember['default'].isEmpty(inventoryRequests) && this._hasIncludedLocation(row.locations)) {
                    row.quantity = inventoryRequests.reduce((function (previousValue, request) {
                      if (this._includeTransaction(reportType, request.transactionType)) {
                        var totalCost = this._getValidNumber(request.quantity) * this._getValidNumber(request.costPerUnit);
                        summaryCost += totalCost;
                        return previousValue += this._getValidNumber(request.quantity);
                      } else {
                        return previousValue;
                      }
                    }).bind(this), 0);
                    if (row.quantity > 0) {
                      row.totalCost = summaryCost;
                      row.unitCost = summaryCost / row.quantity;
                      this._addReportRow(row);
                      this.incrementProperty('grandCost', summaryCost);
                      this.incrementProperty('grandQuantity', row.quantity);
                    }
                  }
                  break;
                }
              case 'detailedPurchase':
                {
                  if (!_ember['default'].isEmpty(inventoryPurchases)) {
                    inventoryPurchases.forEach((function (purchase) {
                      if (this._includeLocation(purchase.location)) {
                        var giftInKind = 'N';
                        if (purchase.giftInKind === true) {
                          giftInKind = 'Y';
                        }
                        this._addReportRow({
                          date: (0, _moment['default'])(new Date(purchase.dateReceived)).format('l'),
                          giftInKind: giftInKind,
                          inventoryItem: row.inventoryItem,
                          quantity: purchase.originalQuantity,
                          unitCost: purchase.costPerUnit,
                          totalCost: purchase.purchaseCost,
                          locations: [{
                            name: this.getDisplayLocationName(purchase.location, purchase.aisleLocation)
                          }]
                        });
                        summaryCost += this._getValidNumber(purchase.purchaseCost);
                        summaryQuantity += this._getValidNumber(purchase.originalQuantity);
                      }
                    }).bind(this));
                    this._addTotalsRow(i18n.t('inventory.reports.rows.subtotal'), summaryCost, summaryQuantity);
                    this.incrementProperty('grandCost', summaryCost);
                    this.incrementProperty('grandQuantity', summaryQuantity);
                  }
                  break;
                }
              case 'summaryPurchase':
                {
                  if (!_ember['default'].isEmpty(inventoryPurchases)) {
                    row.locations = [];
                    row.quantity = inventoryPurchases.reduce((function (previousValue, purchase) {
                      summaryCost += this._getValidNumber(purchase.purchaseCost);
                      var locationName = this.getDisplayLocationName(purchase.location, purchase.aisleLocation);
                      if (!row.locations.findBy('name', locationName)) {
                        row.locations.push({
                          name: this.getDisplayLocationName(purchase.location, purchase.aisleLocation)
                        });
                      }
                      return previousValue += this._getValidNumber(purchase.originalQuantity);
                    }).bind(this), 0);
                    if (this._hasIncludedLocation(row.locations)) {
                      row.unitCost = summaryCost / row.quantity;
                      row.totalCost = summaryCost;
                      this._addReportRow(row);
                      this.incrementProperty('grandCost', summaryCost);
                      this.incrementProperty('grandQuantity', row.quantity);
                    }
                  }
                  break;
                }
              case 'valuation':
                {
                  if (!_ember['default'].isEmpty(inventoryPurchases) && this._hasIncludedLocation(row.locations)) {
                    this._calculateCosts(inventoryPurchases, row);
                    this.incrementProperty('grandCost', this._getValidNumber(row.totalCost));
                    this.incrementProperty('grandQuantity', this._getValidNumber(row.quantity));
                    this._addReportRow(row);
                  }
                  break;
                }
            }
          }).bind(this));
          switch (reportType) {
            case 'detailedExpense':
            case 'summaryExpense':
              {
                this._finishExpenseReport(reportType);
                break;
              }
            case 'byLocation':
              {
                this._finishLocationReport();
                this._addTotalsRow(i18n.t('inventory.reports.rows.total'), this.get('grandCost'), this.get('grandQuantity'));
                break;
              }
            default:
              {
                this._addTotalsRow(i18n.t('inventory.reports.rows.total'), this.get('grandCost'), this.get('grandQuantity'));
              }
          }
          this._finishReport();
        }).bind(this), (function (err) {
          this._notifyReportError(i18n.t('inventory.reports.rows.errInFindPur') + err);
        }).bind(this));
      }).bind(this), (function (err) {
        this._notifyReportError(i18n.t('inventory.reports.rows.errInFindPur') + err);
      }).bind(this));
    },

    _getDateQueryParams: function _getDateQueryParams() {
      var endDate = this.get('endDate');
      var endTime = this.get('maxValue');
      var startDate = this.get('startDate');
      var startTime = undefined;
      if (!_ember['default'].isEmpty(endDate)) {
        endTime = (0, _moment['default'])(endDate).endOf('day').toDate().getTime();
      }
      if (!_ember['default'].isEmpty(startDate)) {
        startTime = (0, _moment['default'])(startDate).startOf('day').toDate().getTime();
      }
      return {
        endTime: endTime,
        startTime: startTime
      };
    },

    _getInventoryItems: function _getInventoryItems(inventoryIds, inventoryMap) {
      var database = this.get('database');
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        if (_ember['default'].isEmpty(inventoryMap)) {
          inventoryMap = {};
        }
        database.queryMainDB({
          keys: inventoryIds,
          include_docs: true
        }).then(function (inventoryItems) {
          inventoryItems.rows.forEach(function (inventoryItem) {
            if (inventoryItem.doc && inventoryItem.doc.archived !== true) {
              inventoryMap[inventoryItem.doc.id] = inventoryItem.doc;
            }
          });
          resolve(inventoryMap);
        }, reject);
      });
    },

    /**
     * Pull the warehouse name out of a formatted location name that (may) include the aisle location
     * @param {string} locationName the formatted location name.
     * @return {string} the warehouse name.
     */
    _getWarehouseLocationName: function _getWarehouseLocationName(locationName) {
      var returnLocation = '';
      if (locationName.indexOf(':') > -1) {
        returnLocation = locationName.split(':')[0].trim();
      } else {
        returnLocation = locationName;
      }
      return returnLocation;
    },

    /**
     * Determines if any of the passed in location objects match the currently filtered location
     * @param {array} locations list of location objects to check.
     * @return {boolean} true if any of the locations match the filter; otherwise false.
     */
    _hasIncludedLocation: function _hasIncludedLocation(locations) {
      var hasIncludedLocation = false;
      locations.forEach((function (location) {
        var locationName = this._getWarehouseLocationName(location.name);
        if (this._includeLocation(locationName)) {
          hasIncludedLocation = true;
        }
      }).bind(this));
      return hasIncludedLocation;
    },

    /**
     * Determine if the specified location should be included in the report
     * @param {string} location the location to check for inclusion
     * @return {boolean} true if the location should be included.
     */
    _includeLocation: function _includeLocation(location) {
      var filterLocation = this.get('filterLocation');
      return _ember['default'].isEmpty(filterLocation) || location === filterLocation;
    },

    /**
     * Given a report type and a transaction type determine if the transaction should
     * be included in the report.
     * @param {string} reportType the report type
     * @param {string} transactionType the transaction type
     * @return {boolean} true if the transaction should be included.
     */
    _includeTransaction: function _includeTransaction(reportType, transactionType) {
      var detailed = reportType.indexOf('detailed') === 0;
      var includeForReportType = undefined;
      if (reportType === 'detailedExpense' || reportType === 'summaryExpense') {
        return true;
      }
      switch (transactionType) {
        case 'Fulfillment':
          {
            if (detailed) {
              includeForReportType = 'detailedUsage';
            } else {
              includeForReportType = 'summaryUsage';
            }
            break;
          }
        case 'Transfer':
          {
            if (detailed) {
              includeForReportType = 'detailedTransfer';
            } else {
              includeForReportType = 'summaryTransfer';
            }
            break;
          }
        default:
          {
            if (detailed) {
              includeForReportType = 'detailedAdjustment';
            } else {
              includeForReportType = 'summaryAdjustment';
            }
          }
      }
      return reportType === includeForReportType;
    },

    _updateExpenseMap: function _updateExpenseMap(request, reportRow) {
      var categoryToUpdate = undefined;
      var expenseMap = this.get('expenseMap');
      var isGiftInKind = reportRow.giftInKind === 'Y';
      var increment = true;

      switch (request.transactionType) {
        case 'Fulfillment':
        case 'Return':
          {
            if (isGiftInKind) {
              categoryToUpdate = expenseMap['Gift In Kind Usage'];
            } else {
              categoryToUpdate = expenseMap['Inventory Consumed'];
            }
            if (request.transactionType === 'Return') {
              increment = false;
            }
            break;
          }
        case 'Adjustment (Add)':
        case 'Adjustment (Remove)':
        case 'Return To Vendor':
        case 'Write Off':
          {
            categoryToUpdate = expenseMap['Inventory Obsolence'];
            if (request.transactionType === 'Adjustment (Add)') {
              increment = false;
            }
            break;
          }
      }
      if (!_ember['default'].isEmpty(categoryToUpdate)) {
        var expenseAccountToUpdate = categoryToUpdate.expenseAccounts.findBy('name', request.expenseAccount);
        if (_ember['default'].isEmpty(expenseAccountToUpdate)) {
          expenseAccountToUpdate = {
            name: request.expenseAccount,
            total: 0,
            reportRows: []
          };
          categoryToUpdate.expenseAccounts.push(expenseAccountToUpdate);
        }
        expenseAccountToUpdate.reportRows.push(reportRow);
        var transactionValue = this._getValidNumber(request.quantity) * this._getValidNumber(request.costPerUnit);
        if (increment) {
          categoryToUpdate.total += transactionValue;
          expenseAccountToUpdate.total += transactionValue;
        } else {
          categoryToUpdate.total = categoryToUpdate.total - transactionValue;
          expenseAccountToUpdate.total = expenseAccountToUpdate.total - transactionValue;
          reportRow.totalCost = reportRow.totalCost * -1;
        }
      }
    },

    actions: {
      generateReport: function generateReport() {
        var _this3 = this;

        var endDate = this.get('endDate');
        var reportRows = this.get('reportRows');
        var reportType = this.get('reportType');
        var startDate = this.get('startDate');
        if (_ember['default'].isEmpty(startDate) && _ember['default'].isEmpty(endDate)) {
          return;
        }
        reportRows.clear();
        this.showProgressModal();
        switch (reportType) {
          case 'expiration':
            {
              this._generateExpirationReport();
              break;
            }
          case 'summaryFinance':
            {
              this._generateFinancialSummaryReport();
              break;
            }
          case 'detailedExpense':
          case 'summaryExpense':
            {
              var _ret3 = (function () {
                var expenseCategories = _this3.get('expenseCategories');
                var expenseMap = {};
                expenseCategories.forEach(function (category) {
                  expenseMap[category] = {
                    total: 0,
                    expenseAccounts: []
                  };
                });
                _this3.set('expenseMap', expenseMap);
                _this3._generateInventoryReport();
                return 'break';
              })();

              if (_ret3 === 'break') break;
            }
          default:
            {
              this._generateInventoryReport();
              break;
            }
        }
      },

      viewInventory: function viewInventory(id) {
        this.store.find('inventory', id).then((function (item) {
          item.set('returnTo', 'inventory.reports');
          this.transitionToRoute('inventory.edit', item);
        }).bind(this));
      }
    }
  });
});
define('hospitalrun/tests/inventory/reports/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/reports/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/reports/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/reports/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    pageTitle: (0, _emberI18n.translationMacro)('inventory.titles.inventoryReport'),

    // No model for reports; data gets retrieved when report is run.
    model: function model() {
      return _ember['default'].RSVP.resolve(_ember['default'].Object.create({}));
    }

  });
});
define('hospitalrun/tests/inventory/reports/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/reports/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/reports/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/request/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/fulfill-request', 'hospitalrun/mixins/inventory-locations', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsFulfillRequest, _hospitalrunMixinsInventoryLocations, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsFulfillRequest['default'], _hospitalrunMixinsInventoryLocations['default'], {
    inventoryController: _ember['default'].inject.controller('inventory'),
    inventoryItems: null,
    cancelAction: 'allRequests',

    warehouseList: _ember['default'].computed.alias('inventoryController.warehouseList'),
    aisleLocationList: _ember['default'].computed.alias('inventoryController.aisleLocationList'),
    expenseAccountList: _ember['default'].computed.alias('inventoryController.expenseAccountList'),

    inventoryList: (function () {
      var inventoryItems = this.get('inventoryItems');
      if (!_ember['default'].isEmpty(inventoryItems)) {
        var mappedItems = inventoryItems.map(function (item) {
          return item.doc;
        });
        return mappedItems;
      }
    }).property('inventoryItems.[]'),

    lookupListsToUpdate: [{
      name: 'expenseAccountList', // Name of property containing lookup list
      property: 'model.expenseAccount', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'expense_account_list' // Id of the lookup list to update
    }, {
      name: 'aisleLocationList', // Name of property containing lookup list
      property: 'model.deliveryAisle', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'aisle_location_list' // Id of the lookup list to update
    }, {
      name: 'warehouseList', // Name of property containing lookup list
      property: 'model.deliveryLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'warehouse_list' // Id of the lookup list to update
    }],

    canFulfill: (function () {
      var requestedItems = this.get('model.requestedItems');
      return _ember['default'].isEmpty(requestedItems) && this.currentUserCan('fulfill_inventory');
    }).property('model.requestedItems.[]'),

    isFulfilling: (function () {
      var canFulfill = this.get('canFulfill');
      var isRequested = this.get('isRequested');
      var fulfillRequest = this.get('model.shouldFulfillRequest');
      var isFulfilling = canFulfill && (isRequested || fulfillRequest);
      if (isFulfilling) {
        if (_ember['default'].isEmpty(this.get('model.dateCompleted'))) {
          this.set('model.dateCompleted', new Date());
        }
      } else {
        this.set('model.dateCompleted');
      }
      return isFulfilling;
    }).property('isRequested', 'model.shouldFulfillRequest'),

    isRequested: (function () {
      var status = this.get('model.status');
      return status === 'Requested';
    }).property('model.status'),

    quantityLabel: (function () {
      var selectedInventoryItem = this.get('selectedInventoryItem');
      if (_ember['default'].isEmpty(selectedInventoryItem)) {
        return this.get('i18n').t('labels.quantity').toString();
      } else {
        return this.get('i18n').t('inventory.labels.quantity', { unit: selectedInventoryItem.distributionUnit }).toString();
      }
    }).property('selectedInventoryItem'),

    showRequestedItems: (function () {
      var requestedItems = this.get('model.requestedItems');
      return !_ember['default'].isEmpty(requestedItems);
    }).property('model.requestedItems.[]'),

    updateViaFulfillRequest: false,

    updateButtonText: (function () {
      if (this.get('isFulfilling')) {
        return this.get('i18n').t('buttons.fulfill');
      }
      return this._super();
    }).property('model.isNew', 'isFulfilling'),

    updateCapability: 'add_inventory_request',

    actions: {
      addInventoryItem: function addInventoryItem() {
        var model = this.get('model');
        var inventoryItem = model.get('inventoryItem');
        var requestedItems = model.get('requestedItems');
        var quantity = model.get('quantity');
        model.validate().then((function () {
          if (model.get('isValid') && !_ember['default'].isEmpty(inventoryItem) && !_ember['default'].isEmpty(quantity)) {
            var requestedItem = _ember['default'].Object.create({
              item: inventoryItem.get('content'),
              quantity: quantity
            });
            requestedItems.addObject(requestedItem);
            model.set('inventoryItem');
            model.set('inventoryItemTypeAhead');
            model.set('quantity');
            this.set('selectedInventoryItem');
          }
        }).bind(this))['catch'](_ember['default'].K);
      },

      allRequests: function allRequests() {
        this.transitionToRoute('inventory.index');
      },

      removeItem: function removeItem(removeInfo) {
        var requestedItems = this.get('model.requestedItems');
        var item = removeInfo.itemToRemove;
        requestedItems.removeObject(item);
        this.send('closeModal');
      },

      showRemoveItem: function showRemoveItem(item) {
        var message = this.get('i18n').t('inventory.messages.removeItemRequest');
        var model = _ember['default'].Object.create({
          itemToRemove: item
        });
        var title = this.get('i18n').t('inventory.titles.removeItem');
        this.displayConfirm(title, message, 'removeItem', model);
      },

      /**
       * Update the model and perform the before update and after update
       * @param skipAfterUpdate boolean (optional) indicating whether or not
       * to skip the afterUpdate call.
       */
      update: function update(skipAfterUpdate) {
        this.beforeUpdate().then((function () {
          var _this = this;

          var updateViaFulfillRequest = this.get('updateViaFulfillRequest');
          if (updateViaFulfillRequest) {
            this.updateLookupLists();
            this.performFulfillRequest(this.get('model'), false, false, true).then(this.afterUpdate.bind(this));
          } else {
            var isNew = this.get('model.isNew');
            var requestedItems = this.get('model.requestedItems');
            if (isNew && !_ember['default'].isEmpty(requestedItems)) {
              (function () {
                var baseModel = _this.get('model');
                var propertiesToCopy = baseModel.getProperties(['dateRequested', 'deliveryAisle', 'deliveryLocation', 'expenseAccount', 'requestedBy', 'status']);
                var inventoryPromises = [];
                var newModels = [];
                var savePromises = [];
                if (!_ember['default'].isEmpty(_this.get('model.inventoryItem')) && !_ember['default'].isEmpty(_this.get('model.quantity'))) {
                  savePromises.push(baseModel.save());
                }
                requestedItems.forEach((function (requestedItem) {
                  propertiesToCopy.inventoryItem = requestedItem.get('item');
                  propertiesToCopy.quantity = requestedItem.get('quantity');
                  var modelToSave = this.get('store').createRecord('inv-request', propertiesToCopy);
                  inventoryPromises.push(modelToSave.get('inventoryItem'));
                  newModels.push(modelToSave);
                }).bind(_this));
                _ember['default'].RSVP.all(inventoryPromises, 'Get inventory items for inventory requests').then((function () {
                  newModels.forEach(function (newModel) {
                    savePromises.push(newModel.save());
                  });
                  _ember['default'].RSVP.all(savePromises, 'Save batch inventory requests').then((function () {
                    this.updateLookupLists();
                    this.afterUpdate();
                  }).bind(this));
                }).bind(_this));
              })();
            } else {
              this.get('model').save().then((function (record) {
                this.updateLookupLists();
                if (!skipAfterUpdate) {
                  this.afterUpdate(record);
                }
              }).bind(this));
            }
          }
        }).bind(this));
      }
    },

    afterUpdate: function afterUpdate() {
      var updateViaFulfillRequest = this.get('updateViaFulfillRequest');
      if (updateViaFulfillRequest) {
        this.displayAlert(this.get('i18n').t('inventory.titles.requestFulfilled'), this.get('i18n').t('inventory.messages.requestFulfilled'), 'allRequests');
      } else {
        this.displayAlert(this.get('i18n').t('inventory.titles.requestUpdated'), this.get('i18n').t('inventory.messages.requestUpdated'));
      }
    },

    beforeUpdate: function beforeUpdate() {
      if (this.get('isFulfilling')) {
        this.set('updateViaFulfillRequest', true);
      } else {
        this.set('updateViaFulfillRequest', false);
      }
      if (this.get('model.isNew')) {
        this.set('model.dateRequested', new Date());
        this.set('model.requestedBy', this.get('model').getUserName());
        if (!this.get('isFulfilling')) {
          this.set('model.status', 'Requested');
        }
      }
      return _ember['default'].RSVP.resolve();
    }
  });
});
// inventory-locations mixin is needed for fulfill-request mixin!
define('hospitalrun/tests/inventory/request/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/request/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/request/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/request/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    editTitle: (0, _emberI18n.translationMacro)('inventory.titles.editRequest'),
    modelName: 'inv-request',
    newTitle: (0, _emberI18n.translationMacro)('inventory.titles.addRequest'),
    database: _ember['default'].inject.service(),
    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        transactionType: 'Request',
        requestedItems: []
      });
    },

    actions: {
      allRequests: function allRequests(model) {
        this.controller.send('allRequests', model);
      },

      removeItem: function removeItem(model) {
        this.controller.send('removeItem', model);
      }
    },

    /**
     * Lazily load inventory items so that it doesn't impact performance.
     */
    setupController: function setupController(controller, model) {
      this._super(controller, model);
      var inventoryQuery = {
        startkey: 'inventory_',
        endkey: 'inventory_',
        include_docs: true
      };
      this.get('database').queryMainDB(inventoryQuery).then(function (result) {
        controller.set('inventoryItems', result.rows);
      });
    }
  });
});
define('hospitalrun/tests/inventory/request/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/request/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/request/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/route', ['exports', 'hospitalrun/routes/abstract-module-route', 'hospitalrun/mixins/fulfill-request', 'hospitalrun/mixins/inventory-id', 'hospitalrun/mixins/inventory-locations'], function (exports, _hospitalrunRoutesAbstractModuleRoute, _hospitalrunMixinsFulfillRequest, _hospitalrunMixinsInventoryId, _hospitalrunMixinsInventoryLocations) {
  'use strict';

  // inventory-locations mixin is needed for fulfill-request mixin!
  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend(_hospitalrunMixinsFulfillRequest['default'], _hospitalrunMixinsInventoryId['default'], _hospitalrunMixinsInventoryLocations['default'], {
    addCapability: 'add_inventory_item',
    additionalButtons: (function () {
      if (this.currentUserCan(this.get('addCapability'))) {
        return [{
          buttonAction: 'newInventoryBatch',
          buttonText: '+ inventory received',
          'class': 'btn btn-primary'
        }];
      }
    }).property(),

    additionalModels: [{
      name: 'aisleLocationList',
      findArgs: ['lookup', 'aisle_location_list']
    }, {
      name: 'expenseAccountList',
      findArgs: ['lookup', 'expense_account_list']
    }, {
      name: 'inventoryTypeList',
      findArgs: ['lookup', 'inventory_types']
    }, {
      name: 'inventoryUnitList',
      findArgs: ['lookup', 'unit_types']
    }, {
      name: 'warehouseList',
      findArgs: ['lookup', 'warehouse_list']
    }, {
      name: 'vendorList',
      findArgs: ['lookup', 'vendor_list']
    }],

    currentItem: null,
    moduleName: 'inventory',

    newButtonText: '+ new request',
    sectionTitle: 'Inventory',

    actions: {
      addPurchase: function addPurchase(newPurchase) {
        var currentItem = this.get('currentItem');
        var purchases = currentItem.get('purchases');
        purchases.addObject(newPurchase);
        this.newPurchaseAdded(currentItem, newPurchase).then((function () {
          currentItem.updateQuantity();
          currentItem.save().then((function () {
            this.send('closeModal');
          }).bind(this));
        }).bind(this));
      },

      newInventoryBatch: function newInventoryBatch() {
        if (this.currentUserCan(this.get('addCapability'))) {
          this.transitionTo('inventory.batch', 'new');
        }
      },

      newRequest: function newRequest() {
        this.transitionTo('inventory.request', 'new');
      },

      allItems: function allItems() {
        this.transitionTo('inventory.listing');
      },

      showAddPurchase: function showAddPurchase(inventoryItem) {
        var newPurchase = this.get('store').createRecord('inv-purchase', {
          dateReceived: new Date(),
          distributionUnit: inventoryItem.get('distributionUnit'),
          inventoryItem: inventoryItem.get('id')
        });
        this.set('currentItem', inventoryItem);
        this.send('openModal', 'inventory.purchase.edit', newPurchase);
      }
    }
  });
});
define('hospitalrun/tests/inventory/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/search/controller', ['exports', 'hospitalrun/inventory/listing/controller'], function (exports, _hospitalrunInventoryListingController) {
  'use strict';

  exports['default'] = _hospitalrunInventoryListingController['default'].extend();
});
define('hospitalrun/tests/inventory/search/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/search/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/search/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/search/route', ['exports', 'hospitalrun/routes/abstract-search-route'], function (exports, _hospitalrunRoutesAbstractSearchRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractSearchRoute['default'].extend({
    moduleName: 'inventory',
    searchKeys: [{
      name: 'crossReference',
      type: 'contains'
    }, {
      name: 'description',
      type: 'fuzzy'
    }, {
      name: 'friendlyId',
      type: 'contains'
    }, {
      name: 'name',
      type: 'fuzzy'
    }],
    searchModel: 'inventory'
  });
});
define('hospitalrun/tests/inventory/search/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/search/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/search/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/inventory/transfer/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    inventoryController: _ember['default'].inject.controller('inventory'),

    warehouseList: _ember['default'].computed.alias('inventoryController.warehouseList'),
    aisleLocationList: _ember['default'].computed.alias('inventoryController.aisleLocationList'),

    lookupListsToUpdate: [{
      name: 'aisleLocationList', // Name of property containing lookup list
      property: 'model.transferAisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'aisle_location_list' // Id of the lookup list to update
    }, {
      name: 'warehouseList', // Name of property containing lookup list
      property: 'model.transferLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'warehouse_list' // Id of the lookup list to update
    }],

    title: (0, _emberI18n.translationMacro)('inventory.titles.transfer'),
    updateButtonText: (0, _emberI18n.translationMacro)('inventory.labels.transfer'),
    updateButtonAction: 'transfer',
    updateCapability: 'adjust_inventory_location',

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      transfer: function transfer() {
        this.updateLookupLists();
        this.send('transferItems', this.get('model'), true);
      }
    }
  });
});
define('hospitalrun/tests/inventory/transfer/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - inventory/transfer/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'inventory/transfer/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/add-line-item/controller', ['exports', 'hospitalrun/mixins/billing-categories', 'ember', 'hospitalrun/mixins/is-update-disabled'], function (exports, _hospitalrunMixinsBillingCategories, _ember, _hospitalrunMixinsIsUpdateDisabled) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsBillingCategories['default'], _hospitalrunMixinsIsUpdateDisabled['default'], {
    invoiceController: _ember['default'].inject.controller('invoices'),

    billingCategoryList: _ember['default'].computed.alias('invoiceController.billingCategoryList'),
    editController: _ember['default'].inject.controller('invoices/edit'),
    title: 'Add Line Item',
    updateButtonText: 'Add',
    updateButtonAction: 'add',
    showUpdateButton: true,

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      add: function add() {
        this.get('model').save().then((function (record) {
          this.get('editController').send('addLineItem', record);
        }).bind(this));
      }
    },

    billingCategories: (function () {
      var defaultBillingCategories = this.get('defaultBillingCategories');
      var billingCategoryList = this.get('billingCategoryList');
      if (_ember['default'].isEmpty(billingCategoryList)) {
        return _ember['default'].Object.create({ value: defaultBillingCategories });
      } else {
        return billingCategoryList;
      }
    }).property('billingCategoryList', 'defaultBillingCategories')

  });
});
define('hospitalrun/tests/invoices/add-line-item/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/add-line-item/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/add-line-item/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller'], function (exports, _hospitalrunControllersAbstractDeleteController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: 'Delete Invoice'
  });
});
define('hospitalrun/tests/invoices/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'moment', 'hospitalrun/mixins/number-format', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/mixins/publish-statuses', 'hospitalrun/utils/select-values', 'npm:uuid'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _moment, _hospitalrunMixinsNumberFormat, _hospitalrunMixinsPatientSubmodule, _hospitalrunMixinsPublishStatuses, _hospitalrunUtilsSelectValues, _npmUuid) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsNumberFormat['default'], _hospitalrunMixinsPatientSubmodule['default'], _hospitalrunMixinsPublishStatuses['default'], {
    invoiceController: _ember['default'].inject.controller('invoices'),
    expenseAccountList: _ember['default'].computed.alias('invoiceController.expenseAccountList.value'),
    patientList: _ember['default'].computed.alias('invoiceController.patientList'),
    pharmacyCharges: [],
    pricingProfiles: _ember['default'].computed.map('invoiceController.pricingProfiles', _hospitalrunUtilsSelectValues['default'].selectObjectMap),
    supplyCharges: [],
    updateCapability: 'add_invoice',
    wardCharges: [],

    additionalButtons: (function () {
      var buttons = [];
      var isValid = this.get('model.isValid');
      var status = this.get('model.status');
      if (isValid && status === 'Draft') {
        buttons.push({
          'class': 'btn btn-default default',
          buttonAction: 'finalizeInvoice',
          buttonIcon: 'glyphicon glyphicon-ok',
          buttonText: 'Invoice Ready'
        });
      }
      buttons.push({
        'class': 'btn btn-default neutral',
        buttonAction: 'printInvoice',
        buttonIcon: 'glyphicon glyphicon-print',
        buttonText: 'Print'
      });
      return buttons;
    }).property('model.isValid', 'model.status'),

    canAddCharge: (function () {
      return this.currentUserCan('add_charge');
    }).property(),

    canAddPayment: (function () {
      return this.currentUserCan('add_payment');
    }).property(),

    pharmacyExpenseAccount: (function () {
      var expenseAccountList = this.get('expenseAccountList');
      if (!_ember['default'].isEmpty(expenseAccountList)) {
        var account = expenseAccountList.find(function (value) {
          if (value.toLowerCase().indexOf('pharmacy') > -1) {
            return true;
          }
        });
        return account;
      }
    }).property('expenseAccountList.value'),

    actions: {
      addItemCharge: function addItemCharge(lineItem) {
        var details = lineItem.get('details');
        var detail = this.store.createRecord('line-item-detail', {
          id: _npmUuid['default'].v4()
        });
        details.addObject(detail);
      },

      addLineItem: function addLineItem(lineItem) {
        var lineItems = this.get('model.lineItems');
        lineItems.addObject(lineItem);
        this.send('update', true);
        this.send('closeModal');
      },

      deleteCharge: function deleteCharge(deleteInfo) {
        this._deleteObject(deleteInfo.itemToDelete, deleteInfo.deleteFrom);
      },

      deleteLineItem: function deleteLineItem(deleteInfo) {
        this._deleteObject(deleteInfo.itemToDelete, this.get('model.lineItems'));
      },

      finalizeInvoice: function finalizeInvoice() {
        var currentInvoice = this.get('model');
        var invoicePayments = currentInvoice.get('payments');
        var paymentsToSave = [];
        currentInvoice.get('patient.payments').then((function (patientPayments) {
          patientPayments.forEach((function (payment) {
            var invoice = payment.get('invoice');
            if (_ember['default'].isEmpty(invoice)) {
              payment.set('invoice', currentInvoice);
              paymentsToSave.push(payment.save());
              invoicePayments.addObject(payment);
            }
          }).bind(this));
          _ember['default'].RSVP.all(paymentsToSave).then((function () {
            this.set('model.status', 'Billed');
            this.send('update');
          }).bind(this));
        }).bind(this));
      },

      printInvoice: function printInvoice() {
        this.transitionToRoute('print.invoice', this.get('model'));
      },

      removePayment: function removePayment(removeInfo) {
        var payments = this.get('model.payments');
        var payment = removeInfo.itemToRemove;
        payment.set('invoice');
        payments.removeObject(removeInfo.itemToRemove);
        this.send('update', true);
        this.send('closeModal');
      },

      showAddLineItem: function showAddLineItem() {
        var newLineItem = this.store.createRecord('billing-line-item', {
          id: _npmUuid['default'].v4()
        });
        this.send('openModal', 'invoices.add-line-item', newLineItem);
      },

      showDeleteItem: function showDeleteItem(itemToDelete, deleteFrom) {
        this.showDeleteModal(itemToDelete, _ember['default'].Object.create({
          confirmAction: 'deleteCharge',
          deleteFrom: deleteFrom,
          title: 'Delete Charge'
        }));
      },

      showDeleteLineItem: function showDeleteLineItem(item) {
        this.showDeleteModal(item, _ember['default'].Object.create({
          confirmAction: 'deleteLineItem',
          title: 'Delete Line Item'
        }));
      },

      showDeleteModal: function showDeleteModal(item, options) {
        options = _ember['default'].merge(options, _ember['default'].Object.create({
          message: 'Are you sure you want to delete ' + item.get('name') + '?',
          itemToDelete: item,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
        this.send('openModal', 'dialog', options);
      },

      showRemovePayment: function showRemovePayment(payment) {
        var message = 'Are you sure you want to remove this payment from this invoice?';
        var model = _ember['default'].Object.create({
          itemToRemove: payment
        });
        var title = 'Remove Payment';
        this.displayConfirm(title, message, 'removePayment', model);
      },

      toggleDetails: function toggleDetails(item) {
        item.toggleProperty('showDetails');
      }
    },

    changePaymentProfile: (function () {
      var patient = this.get('model.patient');
      var paymentProfile = this.get('model.paymentProfile');
      if (!_ember['default'].isEmpty(patient) && _ember['default'].isEmpty(paymentProfile)) {
        this.set('model.paymentProfile', patient.get('paymentProfile'));
      }
    }).observes('model.patient'),

    paymentProfileChanged: (function () {
      var discountPercentage = this._getValidNumber(this.get('model.paymentProfile.discountPercentage'));
      var originalPaymentProfileId = this.get('model.originalPaymentProfileId');
      var profileId = this.get('model.paymentProfile.id');
      if (profileId !== originalPaymentProfileId) {
        var lineItems = this.get('model.lineItems');
        lineItems.forEach((function (lineItem) {
          var details = lineItem.get('details');
          var lineDiscount = 0;
          details.forEach((function (detail) {
            var pricingOverrides = detail.get('pricingItem.pricingOverrides');
            if (!_ember['default'].isEmpty(pricingOverrides)) {
              var pricingOverride = pricingOverrides.findBy('profile.id', profileId);
              if (!_ember['default'].isEmpty(pricingOverride)) {
                _ember['default'].set(detail, 'price', pricingOverride.get('price'));
              }
            }
          }).bind(this));
          if (discountPercentage > 0) {
            var lineTotal = lineItem.get('total');
            lineDiscount = this._numberFormat(discountPercentage / 100 * lineTotal, true);
            lineItem.set('discount', lineDiscount);
          }
        }).bind(this));
        this.set('model.originalPaymentProfileId', profileId);
      }
    }).observes('model.paymentProfile'),

    visitChanged: (function () {
      var visit = this.get('model.visit');
      var lineItems = this.get('model.lineItems');
      if (!_ember['default'].isEmpty(visit) && _ember['default'].isEmpty(lineItems)) {
        this.set('model.originalPaymentProfileId');
        var promises = this.resolveVisitChildren();
        _ember['default'].RSVP.allSettled(promises, 'Resolved visit children before generating invoice').then((function (results) {
          var _this = this;

          var chargePromises = this._resolveVisitDescendents(results, 'charges');
          if (!_ember['default'].isEmpty(chargePromises)) {
            (function () {
              var promiseLabel = 'Reloaded charges before generating invoice';
              _ember['default'].RSVP.allSettled(chargePromises, promiseLabel).then((function (chargeResults) {
                var pricingPromises = [];
                chargeResults.forEach(function (result) {
                  if (!_ember['default'].isEmpty(result.value)) {
                    var pricingItem = result.value.get('pricingItem');
                    if (!_ember['default'].isEmpty(pricingItem)) {
                      pricingPromises.push(pricingItem.reload());
                    }
                  }
                });
                promiseLabel = 'Reloaded pricing items before generating invoice';
                _ember['default'].RSVP.allSettled(pricingPromises, promiseLabel).then((function () {
                  this._generateLineItems(visit, results);
                  this.paymentProfileChanged();
                }).bind(this));
              }).bind(_this));
            })();
          } else {
            this._generateLineItems(visit, results);
            this.paymentProfileChanged();
          }
        }).bind(this), function (err) {
          console.log('Error resolving visit children', err);
        });
      }
    }).observes('model.visit'),

    _addPharmacyCharge: function _addPharmacyCharge(charge, medicationItemName) {
      var _this2 = this;

      return charge.getMedicationDetails(medicationItemName).then(function (medicationDetails) {
        var quantity = charge.get('quantity');
        var pharmacyCharges = _this2.get('pharmacyCharges');
        var pharmacyExpenseAccount = _this2.get('pharmacyExpenseAccount');
        var pharmacyCharge = _this2.store.createRecord('line-item-detail', {
          id: _npmUuid['default'].v4(),
          name: medicationDetails.name,
          quantity: quantity,
          price: medicationDetails.price,
          department: 'Pharmacy',
          expenseAccount: pharmacyExpenseAccount
        });
        pharmacyCharges.addObject(pharmacyCharge);
      });
    },

    _addSupplyCharge: function _addSupplyCharge(charge, department) {
      var supplyCharges = this.get('supplyCharges');
      var supplyCharge = this._createChargeItem(charge, department);
      supplyCharges.addObject(supplyCharge);
    },

    _createChargeItem: function _createChargeItem(charge, department) {
      var chargeItem = this.store.createRecord('line-item-detail', {
        id: _npmUuid['default'].v4(),
        name: charge.get('pricingItem.name'),
        expenseAccount: charge.get('pricingItem.expenseAccount'),
        quantity: charge.get('quantity'),
        price: charge.get('pricingItem.price'),
        department: department,
        pricingItem: charge.get('pricingItem')
      });
      return chargeItem;
    },

    /**
     * Remove the specified object from the specified list, update the model and close the modal.
     * @param objectToDelete {object} - the object to remove
     * @param deleteFrom {Array} - the array to remove the object from.
     */
    _deleteObject: function _deleteObject(objectToDelete, deleteFrom) {
      deleteFrom.removeObject(objectToDelete);
      if (!objectToDelete.get('isNew')) {
        objectToDelete.destroyRecord();
      }
      this.send('update', true);
      this.send('closeModal');
    },

    _mapWardCharge: function _mapWardCharge(charge) {
      return this._createChargeItem(charge, 'Ward');
    },

    _completeBeforeUpdate: function _completeBeforeUpdate(sequence, resolve, reject) {
      var invoiceId = 'inv';
      var sequenceValue = undefined;
      sequence.incrementProperty('value', 1);
      sequenceValue = sequence.get('value');
      if (sequenceValue < 100000) {
        invoiceId += String('00000' + sequenceValue).slice(-5);
      } else {
        invoiceId += sequenceValue;
      }
      this.set('model.id', invoiceId);
      sequence.save().then(resolve, reject);
    },

    _generateLineItems: function _generateLineItems(visit, visitChildren) {
      var _this3 = this;

      var endDate = visit.get('endDate');
      var imaging = visitChildren[0].value;
      var labs = visitChildren[1].value;
      var lineDetail = undefined,
          lineItem = undefined;
      var lineItems = this.get('model.lineItems');
      var medication = visitChildren[2].value;
      var procedures = visitChildren[3].value;
      var startDate = visit.get('startDate');
      var visitCharges = visit.get('charges');
      this.setProperties({
        pharmacyCharges: [],
        supplyCharges: [],
        wardCharges: []
      });
      if (!_ember['default'].isEmpty(endDate) && !_ember['default'].isEmpty(startDate)) {
        endDate = (0, _moment['default'])(endDate);
        startDate = (0, _moment['default'])(startDate);
        var stayDays = endDate.diff(startDate, 'days');
        if (stayDays > 1) {
          lineDetail = this.store.createRecord('line-item-detail', {
            id: _npmUuid['default'].v4(),
            name: 'Days',
            quantity: stayDays
          });
          lineItem = this.store.createRecord('billing-line-item', {
            id: _npmUuid['default'].v4(),
            category: 'Hospital Charges',
            name: 'Room/Accomodation'
          });
          lineItem.get('details').addObject(lineDetail);
          lineItems.addObject(lineItem);
        }
      }

      var pharmacyChargePromises = [];
      medication.forEach((function (medicationItem) {
        pharmacyChargePromises.push(this._addPharmacyCharge(medicationItem, 'inventoryItem'));
      }).bind(this));

      this.set('wardCharges', visitCharges.map(this._mapWardCharge.bind(this)));

      procedures.forEach((function (procedure) {
        var charges = procedure.get('charges');
        charges.forEach((function (charge) {
          if (charge.get('medicationCharge')) {
            pharmacyChargePromises.push(this._addPharmacyCharge(charge, 'medication'));
          } else {
            this._addSupplyCharge(charge, 'O.R.');
          }
        }).bind(this));
      }).bind(this));

      labs.forEach((function (lab) {
        if (!_ember['default'].isEmpty(lab.get('labType'))) {
          this._addSupplyCharge(_ember['default'].Object.create({
            pricingItem: lab.get('labType'),
            quantity: 1
          }), 'Lab');
        }
        lab.get('charges').forEach((function (charge) {
          this._addSupplyCharge(charge, 'Lab');
        }).bind(this));
      }).bind(this));

      imaging.forEach((function (imaging) {
        if (!_ember['default'].isEmpty(imaging.get('imagingType'))) {
          this._addSupplyCharge(_ember['default'].Object.create({
            pricingItem: imaging.get('imagingType'),
            quantity: 1
          }), 'Imaging');
        }
        imaging.get('charges').forEach((function (charge) {
          this._addSupplyCharge(charge, 'Imaging');
        }).bind(this));
      }).bind(this));

      _ember['default'].RSVP.all(pharmacyChargePromises).then(function () {
        lineItem = _this3.store.createRecord('billing-line-item', {
          id: _npmUuid['default'].v4(),
          name: 'Pharmacy',
          category: 'Hospital Charges'
        });
        lineItem.get('details').addObjects(_this3.get('pharmacyCharges'));
        lineItems.addObject(lineItem);

        lineItem = _this3.store.createRecord('billing-line-item', {
          id: _npmUuid['default'].v4(),
          name: 'X-ray/Lab/Supplies',
          category: 'Hospital Charges'
        });
        lineItem.get('details').addObjects(_this3.get('supplyCharges'));
        lineItems.addObject(lineItem);

        lineItem = _this3.store.createRecord('billing-line-item', {
          id: _npmUuid['default'].v4(),
          name: 'Ward Items',
          category: 'Hospital Charges'
        });
        lineItem.get('details').addObjects(_this3.get('wardCharges'));
        lineItems.addObject(lineItem);

        lineItem = _this3.store.createRecord('billing-line-item', {
          id: _npmUuid['default'].v4(),
          name: 'Physical Therapy',
          category: 'Hospital Charges'
        });
        lineItems.addObject(lineItem);

        lineItem = _this3.store.createRecord('billing-line-item', {
          id: _npmUuid['default'].v4(),
          name: 'Others/Misc',
          category: 'Hospital Charges'
        });
        lineItems.addObject(lineItem);

        _this3.send('update', true);
      });
    },

    _resolveVisitDescendents: function _resolveVisitDescendents(results, childNameToResolve) {
      var promises = [];
      results.forEach(function (result) {
        if (!_ember['default'].isEmpty(result.value)) {
          result.value.forEach(function (record) {
            var children = record.get(childNameToResolve);
            if (!_ember['default'].isEmpty(children)) {
              children.forEach(function (child) {
                // Make sure children are fully resolved
                promises.push(child.reload());
              });
            }
          });
        }
      });
      return promises;
    },

    beforeUpdate: function beforeUpdate() {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var lineItems = this.get('model.lineItems');
        var savePromises = [];
        lineItems.forEach((function (lineItem) {
          lineItem.get('details').forEach((function (detail) {
            savePromises.push(detail.save());
          }).bind(this));
          savePromises.push(lineItem.save());
        }).bind(this));
        _ember['default'].RSVP.all(savePromises, 'Saved invoice children before saving invoice').then((function () {
          if (this.get('model.isNew')) {
            this.store.find('sequence', 'invoice').then((function (sequence) {
              this._completeBeforeUpdate(sequence, resolve, reject);
            }).bind(this), (function () {
              var store = this.get('store');
              var newSequence = store.push(store.normalize('sequence', {
                id: 'invoice',
                value: 0
              }));
              this._completeBeforeUpdate(newSequence, resolve, reject);
            }).bind(this));
          } else {
            resolve();
          }
        }).bind(this), reject);
      }).bind(this));
    },

    afterUpdate: function afterUpdate() {
      var message = 'The invoice record has been saved.';
      this.displayAlert('Invoice Saved', message);
    }
  });
});
define('hospitalrun/tests/invoices/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    editTitle: 'Edit Invoice',
    modelName: 'invoice',
    newTitle: 'New Invoice',

    actions: {
      deleteCharge: function deleteCharge(model) {
        this.controller.send('deleteCharge', model);
      },

      deleteLineItem: function deleteLineItem(model) {
        this.controller.send('deleteLineItem', model);
      },

      removePayment: function removePayment(model) {
        this.controller.send('removePayment', model);
      }
    },

    afterModel: function afterModel(model) {
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        var lineItems = model.get('lineItems');
        var promises = [];
        lineItems.forEach(function (lineItem) {
          promises.push(lineItem.reload());
        });
        _ember['default'].RSVP.all(promises, 'Reload billing line items for invoice').then(function (results) {
          var detailPromises = [];
          results.forEach(function (result) {
            result.get('details').forEach(function (detail) {
              detailPromises.push(detail.reload());
            });
          });
          _ember['default'].RSVP.all(detailPromises, 'Reload billing line item details for invoice').then(resolve, reject);
        }, reject);
      });
    },

    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        billDate: new Date(),
        status: 'Draft'
      });
    },

    setupController: function setupController(controller, model) {
      model.set('originalPaymentProfileId', model.get('paymentProfile.id'));
      this._super(controller, model);
      var lineItems = model.get('lineItems');
      var promises = [];
      lineItems.forEach(function (lineItem) {
        lineItem.get('details').forEach(function (detail) {
          var pricingItem = detail.get('pricingItem');
          if (!_ember['default'].isEmpty(pricingItem)) {
            promises.push(pricingItem.reload());
          }
        });
      });
    }
  });
});
define('hospitalrun/tests/invoices/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    addPermission: 'add_invoice',
    deletePermission: 'delete_invoice',
    canAddPayment: (function () {
      return this.currentUserCan('add_payment');
    }).property(),
    startKey: [],
    queryParams: ['startKey', 'status']
  });
});
define('hospitalrun/tests/invoices/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    modelName: 'invoice',
    pageTitle: 'Invoice Listing',

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var billDateAsTime = item.get('billDateAsTime');
      var id = this._getPouchIdFromItem(item);
      var searchStatus = item.get('status');
      return [searchStatus, billDateAsTime, id];
    },

    _modelQueryParams: function _modelQueryParams(params) {
      var queryParams = undefined;
      var maxId = this._getMaxPouchId();
      var maxValue = this.get('maxValue');
      var minId = this._getMinPouchId();
      var searchStatus = params.status;
      if (_ember['default'].isEmpty(searchStatus)) {
        searchStatus = 'Billed';
      }
      this.set('pageTitle', searchStatus + ' Invoices');
      queryParams = {
        options: {
          startkey: [searchStatus, null, minId],
          endkey: [searchStatus, maxValue, maxId]
        },
        mapReduce: 'invoice_by_status'
      };

      if (searchStatus === 'All') {
        delete queryParams.options.startkey;
        delete queryParams.options.endkey;
      }
      return queryParams;
    },

    queryParams: {
      startKey: { refreshModel: true },
      status: { refreshModel: true }
    }
  });
});
define('hospitalrun/tests/invoices/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/payment/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/patient-submodule'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsPatientSubmodule['default'], {
    cancelAction: 'closeModal',
    findPatientVisits: false,
    invoiceController: _ember['default'].inject.controller('invoices'),
    newPayment: false,

    expenseAccountList: _ember['default'].computed.alias('invoiceController.expenseAccountList'),
    patientList: _ember['default'].computed.alias('invoiceController.patientList'),

    _finishUpdate: function _finishUpdate(message, title) {
      this.send('closeModal');
      this.displayAlert(title, message);
    },

    currentPatient: (function () {
      var type = this.get('model.paymentType');
      if (type === 'Deposit') {
        return this.get('model.patient');
      } else {
        return this.get('model.invoice.patient');
      }
    }).property('model.patient', 'model.paymentType', 'model.invoice.patient'),

    title: (function () {
      var isNew = this.get('model.isNew');
      var type = this.get('model.paymentType');
      if (isNew) {
        return 'Add ' + type;
      } else {
        return 'Edit ' + type;
      }
    }).property('model.isNew', 'model.paymentType'),

    selectPatient: (function () {
      var isNew = this.get('model.isNew');
      var type = this.get('model.paymentType');
      return isNew && type === 'Deposit';
    }).property('model.isNew', 'model.paymentType'),

    beforeUpdate: function beforeUpdate() {
      if (this.get('model.isNew')) {
        this.set('newPayment', true);
      } else {
        this.set('newPayment', false);
      }
      var patient = this.get('currentPatient');
      this.set('model.charityPatient', patient.get('patientType') === 'Charity');
      return _ember['default'].RSVP.resolve();
    },

    afterUpdate: function afterUpdate() {
      this.get('model').save().then((function (record) {
        var _this = this;

        if (this.get('newPayment') === true) {
          (function () {
            var patient = _this.get('currentPatient');
            patient.get('payments').then((function (payments) {
              payments.addObject(record);
              patient.save().then((function () {
                var _this2 = this;

                if (record.get('paymentType') === 'Deposit') {
                  var message = 'A deposit of ' + record.get('amount') + ' was added for patient ' + patient.get('displayName');
                  this._finishUpdate(message, 'Deposit Added');
                } else {
                  (function () {
                    var invoice = _this2.get('model.invoice');
                    invoice.addPayment(record);
                    invoice.save().then((function () {
                      var message = 'A payment of ' + record.get('amount') + ' was added to invoice ' + invoice.get('id');
                      this._finishUpdate(message, 'Payment Added');
                    }).bind(_this2));
                  })();
                }
              }).bind(this));
            }).bind(_this));
          })();
        } else {
          this.send('closeModal');
        }
      }).bind(this));
    }
  });
});
define('hospitalrun/tests/invoices/payment/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/payment/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/payment/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/route', ['exports', 'hospitalrun/routes/abstract-module-route', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/patient-list-route'], function (exports, _hospitalrunRoutesAbstractModuleRoute, _hospitalrunMixinsModalHelper, _hospitalrunMixinsPatientListRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend(_hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsPatientListRoute['default'], {
    addCapability: 'add_invoice',
    currentScreenTitle: 'Invoices',
    editTitle: 'Edit Invoice',
    newTitle: 'New Invoice',
    moduleName: 'invoices',
    newButtonText: '+ new invoice',
    sectionTitle: 'Invoices',

    additionalButtons: (function () {
      if (this.currentUserCan('add_payment')) {
        return [{
          'class': 'btn btn-default',
          buttonText: '+ add deposit',
          buttonAction: 'showAddDeposit'
        }];
      }
    }).property(),

    additionalModels: [{
      name: 'billingCategoryList',
      findArgs: ['lookup', 'billing_categories']
    }, {
      name: 'expenseAccountList',
      findArgs: ['lookup', 'expense_account_list']
    }, {
      name: 'pricingProfiles',
      findArgs: ['price-profile']
    }],

    actions: {
      showAddDeposit: function showAddDeposit() {
        var payment = this.store.createRecord('payment', {
          paymentType: 'Deposit',
          datePaid: new Date()
        });
        this.send('openModal', 'invoices.payment', payment);
      },

      showAddPayment: function showAddPayment(invoice) {
        var payment = this.store.createRecord('payment', {
          invoice: invoice,
          paymentType: 'Payment',
          datePaid: new Date()
        });
        this.send('openModal', 'invoices.payment', payment);
      },

      showEditPayment: function showEditPayment(payment) {
        if (this.currentUserCan('add_payment')) {
          this.send('openModal', 'invoices.payment', payment);
        }
      }
    },

    subActions: (function () {
      var actions = [{
        text: 'Billed',
        linkTo: 'invoices.index',
        statusQuery: 'Billed'
      }];
      if (this.currentUserCan('add_invoice')) {
        actions.push({
          text: 'Drafts',
          linkTo: 'invoices.index',
          statusQuery: 'Draft'
        });
        actions.push({
          text: 'All Invoices',
          linkTo: 'invoices.index',
          statusQuery: 'All'
        });
      }
      if (this.currentUserCan('list_paid_invoices')) {
        actions.push({
          text: 'Paid',
          linkTo: 'invoices.index',
          statusQuery: 'Paid'
        });
      }
      return actions;
    }).property()

  });
});
define('hospitalrun/tests/invoices/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/invoices/search/route', ['exports', 'hospitalrun/routes/abstract-search-route'], function (exports, _hospitalrunRoutesAbstractSearchRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractSearchRoute['default'].extend({
    moduleName: 'invoices',
    searchKeys: [{
      name: 'externalInvoiceNumber',
      type: 'contains'
    }, {
      name: 'patientInfo',
      type: 'contains'
    }],
    searchModel: 'invoice'
  });
});
define('hospitalrun/tests/invoices/search/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - invoices/search/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'invoices/search/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/charge/controller', ['exports', 'hospitalrun/procedures/charge/controller', 'ember'], function (exports, _hospitalrunProceduresChargeController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunProceduresChargeController['default'].extend({
    labsEdit: _ember['default'].inject.controller('labs/edit'),
    cancelAction: 'closeModal',
    newPricingItem: false,
    requestingController: _ember['default'].computed.alias('controllers.labs/edit'),
    pricingList: _ember['default'].computed.alias('controllers.labs/edit.chargesPricingList')
  });
});
define('hospitalrun/tests/labs/charge/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/charge/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/charge/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/completed/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    startKey: [],
    showActions: false
  });
});
define('hospitalrun/tests/labs/completed/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/completed/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/completed/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/completed/labs-completed-list-item/component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'tr'
  });
});
define('hospitalrun/tests/labs/completed/labs-completed-list-item/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/completed/labs-completed-list-item/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/completed/labs-completed-list-item/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/completed/route', ['exports', 'hospitalrun/labs/index/route', 'ember-i18n'], function (exports, _hospitalrunLabsIndexRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunLabsIndexRoute['default'].extend({
    pageTitle: (0, _emberI18n.translationMacro)('labs.completedTitle'),
    searchStatus: 'Completed'
  });
});
define('hospitalrun/tests/labs/completed/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/completed/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/completed/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'hospitalrun/mixins/patient-submodule', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractDeleteController, _hospitalrunMixinsPatientSubmodule, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend(_hospitalrunMixinsPatientSubmodule['default'], {
    title: (0, _emberI18n.translationMacro)('labs.deleteTitle'),

    actions: {
      'delete': function _delete() {
        this.deleteChildFromVisit('labs');
      }
    }
  });
});
define('hospitalrun/tests/labs/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/charge-actions', 'ember', 'hospitalrun/mixins/patient-submodule'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsChargeActions, _ember, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsChargeActions['default'], _hospitalrunMixinsPatientSubmodule['default'], {
    labsController: _ember['default'].inject.controller('labs'),
    chargePricingCategory: 'Lab',
    chargeRoute: 'labs.charge',
    selectedLabType: null,

    canComplete: (function () {
      var isNew = this.get('model.isNew');
      var labTypeName = this.get('model.labTypeName');
      var selectedLabType = this.get('selectedLabType');
      if (isNew && (_ember['default'].isEmpty(labTypeName) || _ember['default'].isArray(selectedLabType) && selectedLabType.length > 1)) {
        return false;
      } else {
        return this.currentUserCan('complete_lab');
      }
    }).property('selectedLabType.[]', 'model.labTypeName'),

    actions: {
      completeLab: function completeLab() {
        this.set('model.status', 'Completed');
        this.get('model').validate().then((function () {
          if (this.get('model.isValid')) {
            this.set('model.labDate', new Date());
            this.send('update');
          }
        }).bind(this))['catch'](_ember['default'].K);
      },

      /**
       * Update the model and perform the before update and after update
       */
      update: function update() {
        var _this = this;

        if (this.get('model.isNew')) {
          (function () {
            var newLab = _this.get('model');
            var selectedLabType = _this.get('selectedLabType');
            if (_ember['default'].isEmpty(_this.get('model.status'))) {
              _this.set('model.status', 'Requested');
            }
            _this.set('model.requestedBy', newLab.getUserName());
            _this.set('model.requestedDate', new Date());
            if (_ember['default'].isEmpty(selectedLabType)) {
              _this.saveNewPricing(_this.get('model.labTypeName'), 'Lab', 'model.labType').then((function () {
                this.addChildToVisit(newLab, 'labs', 'Lab').then((function () {
                  this.saveModel();
                }).bind(this));
              }).bind(_this));
            } else {
              _this.getSelectedPricing('selectedLabType').then((function (pricingRecords) {
                if (_ember['default'].isArray(pricingRecords)) {
                  this.createMultipleRequests(pricingRecords, 'labType', 'labs', 'Lab');
                } else {
                  this.set('model.labType', pricingRecords);
                  this.addChildToVisit(newLab, 'labs', 'Lab').then((function () {
                    this.saveModel();
                  }).bind(this));
                }
              }).bind(_this));
            }
          })();
        } else {
          this.saveModel();
        }
      }
    },

    additionalButtons: (function () {
      var canComplete = this.get('canComplete');
      var isValid = this.get('model.isValid');
      var i18n = this.get('i18n');
      if (isValid && canComplete) {
        return [{
          buttonAction: 'completeLab',
          buttonIcon: 'glyphicon glyphicon-ok',
          'class': 'btn btn-primary on-white',
          buttonText: i18n.t('buttons.complete')
        }];
      }
    }).property('canComplete', 'model.isValid'),

    pricingTypeForObjectType: 'Lab Procedure',
    pricingTypes: _ember['default'].computed.alias('labsController.labPricingTypes'),

    pricingList: null, // This gets filled in by the route

    updateCapability: 'add_lab',

    afterUpdate: function afterUpdate(saveResponse, multipleRecords) {
      var i18n = this.get('i18n');
      var afterDialogAction = undefined,
          alertMessage = undefined,
          alertTitle = undefined;
      if (this.get('model.status') === 'Completed') {
        alertTitle = i18n.t('labs.alerts.requestCompletedTitle');
        alertMessage = i18n.t('labs.alerts.requestCompletedMessage');
      } else {
        alertTitle = i18n.t('labs.alerts.requestSavedTitle');
        alertMessage = i18n.t('labs.alerts.requestSavedMessage');
      }
      if (multipleRecords) {
        afterDialogAction = this.get('cancelAction');
      }
      this.saveVisitIfNeeded(alertTitle, alertMessage, afterDialogAction);
      this.set('model.selectPatient', false);
    }

  });
});
define('hospitalrun/tests/labs/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'hospitalrun/mixins/charge-route', 'ember', 'moment', 'hospitalrun/mixins/patient-list-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _hospitalrunMixinsChargeRoute, _ember, _moment, _hospitalrunMixinsPatientListRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], _hospitalrunMixinsChargeRoute['default'], _hospitalrunMixinsPatientListRoute['default'], {
    editTitle: (0, _emberI18n.translationMacro)('labs.editTitle'),
    modelName: 'lab',
    newTitle: (0, _emberI18n.translationMacro)('labs.newTitle'),
    pricingCategory: 'Lab',
    customForms: _ember['default'].inject.service(),

    actions: {
      returnToAllItems: function returnToAllItems() {
        this.controller.send('returnToAllItems');
      }
    },

    getNewData: function getNewData() {
      var newLabData = {
        selectPatient: true,
        requestDate: (0, _moment['default'])().startOf('day').toDate(),
        customForms: _ember['default'].Object.create()
      };
      var customForms = this.get('customForms');
      return customForms.setDefaultCustomForms(['lab'], newLabData);
    }
  });
});
define('hospitalrun/tests/labs/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    startKey: [],
    addPermission: 'add_lab'
  });
});
define('hospitalrun/tests/labs/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/index/labs-edit-button/component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'button',
    classNames: ['btn', 'btn-default', 'neutral']
  });
});
define('hospitalrun/tests/labs/index/labs-edit-button/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/index/labs-edit-button/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/index/labs-edit-button/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/index/labs-list-item/component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Component.extend({
    tagName: 'tr',
    classNames: ['clickable'],

    click: function click() {
      this.sendAction('action', this.lab);
    }
  });
});
define('hospitalrun/tests/labs/index/labs-list-item/component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/index/labs-list-item/component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/index/labs-list-item/component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    modelName: 'lab',
    pageTitle: (0, _emberI18n.translationMacro)('labs.requestsTitle'),
    searchStatus: 'Requested',

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var labDateAsTime = item.get('labDateAsTime');
      var id = this._getPouchIdFromItem(item);
      var requestedDateAsTime = item.get('requestedDateAsTime');
      var searchStatus = this.get('searchStatus');
      return [searchStatus, requestedDateAsTime, labDateAsTime, id];
    },

    _modelQueryParams: function _modelQueryParams() {
      var maxId = this._getMaxPouchId();
      var maxValue = this.get('maxValue');
      var minId = this._getMinPouchId();
      var searchStatus = this.get('searchStatus');
      return {
        options: {
          startkey: [searchStatus, null, null, minId],
          endkey: [searchStatus, maxValue, maxValue, maxId]
        },
        mapReduce: 'lab_by_status'
      };
    }
  });
});
define('hospitalrun/tests/labs/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/labs/route', ['exports', 'hospitalrun/routes/abstract-module-route', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractModuleRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_lab',
    additionalModels: [{
      name: 'labPricingTypes',
      findArgs: ['lookup', 'lab_pricing_types']
    }],
    allowSearch: false,
    moduleName: 'labs',
    newButtonText: (0, _emberI18n.translationMacro)('labs.buttons.newButton'),
    sectionTitle: (0, _emberI18n.translationMacro)('labs.sectionTitle')
  });
});
define('hospitalrun/tests/labs/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - labs/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'labs/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/de/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: 'Adresse 1 Kennzeichen',
        address2Label: 'Adresse 2 Kennzeichen',
        address3Label: 'Adresse 3 Kennzeichen',
        address4Label: 'Adresse 4 Kennzeichen',
        addressLabel: '',
        editTitle: '',
        include1Label: 'Einbezug 1 Kennzeichen',
        include2Label: 'Einbezug 2 Kennzeichen',
        include3Label: 'Einbezug 3 Kennzeichen',
        include4Label: 'Einbezug 4 Kennzeichen',
        messages: { addressSaved: 'Die Adressoptionen wurden gespeichert' },
        newTitle: '',
        titles: { optionsSaved: 'Optionen gespeichert' }
      },
      addressOptions: 'Adressoptionen',
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: 'Datenbank laden',
      loaddb: {
        displayAlertMessage: '',
        displayAlertTitle: '',
        editTitle: '',
        errorDisplayAlertMessage: '',
        errorDisplayAlertTitle: '',
        progressMessage: '',
        progressTitle: ''
      },
      lookup: {
        aisleLocationList: 'Gänge-Verzeichnis',
        alertImportListMessage: '',
        alertImportListSaveMessage: '',
        alertImportListSaveTitle: '',
        alertImportListTitle: '',
        alertImportListUpdateMessage: '',
        alertImportListUpdateTitle: '',
        anesthesiaTypes: 'Anästhesiearten',
        anesthesiologists: 'Anästhesiologe',
        billingCategories: 'Abrechnungskategorien',
        clinicList: 'Kliniken',
        countryList: 'Länder',
        cptCodeList: 'CPT Codes',
        diagnosisList: 'Diagnosen',
        edit: { template: {
            addTitle: '',
            editTitle: '',
            labelTitle: '',
            updateButtonTextAdd: '',
            updateButtonTextUpdate: ''
          } },
        expenseAccountList: 'Ausgabekonten',
        imagingPricingTypes: 'Bildgebungs-Preiskategorien',
        incidentDepartments: '',
        inventoryTypes: 'Inventartypen',
        labPricingTypes: 'Labor-Preiskategorien',
        pageTitle: '',
        patientStatusList: 'Patientenstatus',
        physicianList: 'Ärzte',
        procedureList: 'Abläufe',
        procedureLocations: 'Ablaufs-Orte',
        procedurePricingTypes: 'Ablaufs-Preiskategorien',
        radiologists: 'Radiologen',
        titles: { deleteLookupValue: '' },
        unitTypes: 'Einheiten',
        vendorList: 'Anbieter',
        visitLocationList: 'Einsatzorte',
        visitTypes: 'Besuchsarten',
        wardPricingTypes: 'Krankenstations-Preistypen',
        warehouseList: 'Warenhaus'
      },
      lookupLists: 'Nachschlagelisten',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: '',
          addBillingDiagnosis: '',
          addCharge: '',
          addDiagnosis: '',
          addImaging: '',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: '',
          addInventoryPurchase: '',
          addInventoryRequest: '',
          addInvoice: '',
          addLab: '',
          addMedication: '',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: '',
          addPayment: '',
          addPhoto: '',
          addPricing: '',
          addPricingProfile: '',
          addProcedure: '',
          addSocialwork: '',
          addVisit: '',
          addVitals: '',
          adjustInventoryLocation: '',
          admin: '',
          admitPatient: '',
          appointments: '',
          billing: '',
          completeImaging: '',
          completeLab: '',
          defineUserRoles: '',
          deleteAppointment: '',
          deleteDiagnosis: '',
          deleteImaging: '',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: '',
          deleteInvoice: '',
          deleteLab: '',
          deleteMedication: '',
          deleteNote: '',
          deletePatient: '',
          deletePhoto: '',
          deletePricing: '',
          deletePricingProfile: '',
          deleteProcedure: '',
          deleteSocialwork: '',
          deleteVisit: '',
          deleteVitals: '',
          dischargePatient: '',
          editInvoice: '',
          fulfillInventory: '',
          fulfillMedication: '',
          generateIncidentReport: '',
          imaging: '',
          incident: '',
          inventory: '',
          invoices: '',
          labs: '',
          loadDb: '',
          manageIncidents: '',
          medication: '',
          overrideInvoice: '',
          patientReports: '',
          patients: '',
          pricing: '',
          updateConfig: '',
          visits: ''
        },
        messages: { roleSaved: '' },
        titles: { roleSaved: '' }
      },
      userRoles: '',
      users: 'Benutzer',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: '',
        clinicPrepaymentLabel: '',
        editTitle: '',
        followupPrepaymentLabel: '',
        messages: { optionsSaved: '' },
        newTitle: '',
        outpatientImagingLabel: '',
        outpatientLabLabel: '',
        outpatientMedicationLabel: '',
        titles: { optionsSaved: '' },
        workflowLabel: ''
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: '',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: '' },
      labels: {
        allergyName: '',
        patientAllergy: ''
      },
      titles: {
        addAllergy: '',
        editAllergy: ''
      }
    },
    application: {
      messages: { sessionExpired: '' },
      titles: { sessionExpired: '' }
    },
    appointments: {
      buttons: {
        newButton: '',
        scheduleSurgery: ''
      },
      calendarTitle: '',
      currentScreenTitle: '',
      editTitle: '',
      labels: {
        noLocation: '',
        selectedStartingDate: ''
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: ''
      },
      missed: '',
      newTitle: '',
      searchTitle: '',
      sectionTitle: '',
      thisWeek: '',
      titles: {
        appointmentSaved: '',
        editSurgicalAppointment: '',
        newSurgicalAppointment: '',
        theaterSchedule: ''
      },
      todayTitle: ''
    },
    billing: {
      alerts: {
        noInvoiceFound: '',
        noPricingItems: '',
        noPricingProfiles: ''
      },
      buttons: {
        addOverride: '',
        createInvoice: ''
      },
      labels: {
        actualCharges: '',
        discountAmount: '',
        discountPercentage: '',
        externalInvoiceNumber: '',
        hmoCom: '',
        insurance: '',
        paymentProfile: '',
        paymentsDeposits: '',
        pricingPanelOverrides: '',
        pricingProfile: ''
      }
    },
    buttons: {
      add: 'Hinzufügen',
      addItem: '',
      addLineItem: '',
      addValue: 'Wert hinzufügen',
      addVisit: '',
      allRequests: '',
      barcode: '',
      cancel: 'Abbrechen',
      clear: '',
      close: '',
      complete: 'Abschließen',
      'delete': 'Entfernen',
      dispense: '',
      edit: '',
      filter: '',
      fulfill: '',
      'import': 'Importieren',
      loadFile: 'Datei laden',
      newItem: '',
      newNote: '',
      newRequest: '',
      newRequestPlus: '',
      newUser: 'Neuer Benutzer',
      ok: 'Okay',
      remove: '',
      returnButton: 'Zurück',
      search: '',
      showAll: '',
      showFewer: '',
      update: 'Aktualisieren'
    },
    components: {
      chargesByTypeTab: { charges: '' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '',
        midnight: '',
        noon: '',
        pmHour: ''
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: '' },
      quantityCalc: { result: '' },
      quantityConv: {
        conversion: '',
        unit: ''
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: '',
        how: '',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: '',
        preview: '',
        takePhoto: '',
        uploadFile: ''
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: '' },
      labels: { formToAdd: '' },
      titles: { addCustomForm: '' }
    },
    dashboard: {
      setup: '',
      title: 'Was möchten Sie tun?'
    },
    dates: {
      'long': '',
      longOmitDays: '',
      longOmitDaysPlural: '',
      longOmitDaysYears: '',
      longOmitYears: '',
      longPlural: '',
      'short': '',
      shortOmitYears: ''
    },
    diagnosis: {
      labels: {
        activeDiagnosis: '',
        date: '',
        diagnosis: '',
        secondaryDiagnosis: ''
      },
      titles: {
        addDiagnosis: '',
        editDiagnosis: ''
      }
    },
    errors: {
      accepted: '',
      blank: '',
      confirmation: '',
      empty: '',
      equalTo: '',
      even: '',
      exclusion: '',
      greaterThan: '',
      greaterThanOrEqualTo: '',
      inclusion: '',
      invalid: '',
      invalidNumber: '',
      lessThan: '',
      lessThanOrEqualTo: '',
      notANumber: '',
      notAnInteger: '',
      odd: '',
      otherThan: '',
      present: '',
      result: '',
      tooLong: '',
      tooShort: '',
      wrongLength: ''
    },
    headings: { chargedItems: '' },
    imaging: {
      alerts: {
        completedMessage: 'Die Anfrage zur Bildgebung wurde abgeschlossen.',
        completedTitle: 'Bildgebungs-Anfrage gestellt',
        savedMessage: 'Die Anfrage zur Bildgebung wurde gespeichert.',
        savedTitle: 'Bildgebungs-Anfrage gespeichert'
      },
      buttons: { newButton: '+ Neue Bildgebung' },
      labels: {
        addNewVisit: '--Neuen Besuch hinzufügen--',
        radiologist: 'Radiologe'
      },
      messages: { noCompleted: 'Keine erledigten Einträge gefunden.' },
      pageTitle: 'Anfrage zur Bildgebung',
      sectionTitle: 'Bildgebung',
      titles: {
        completedImaging: 'Erledigte Bildgebung',
        editTitle: 'Bildgebungs-Anfrage bearbeiten',
        newTitle: 'Neue Bildgebungs-Anfrage'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    inventory: {
      edit: {
        cost: '',
        delivered: '',
        location: '',
        prescription: '',
        pulled: '',
        quantity: '',
        reason: '',
        returned: '',
        transferredFrom: '',
        transferredTo: ''
      },
      labels: {
        action: '',
        add: '',
        addAdjustmentType: '',
        adjust: '',
        adjustmentDate: '',
        adjustmentFor: '',
        adjustmentType: '',
        aisle: '',
        aisleLocation: '',
        allInventory: '',
        allItems: '',
        availableQuantity: '',
        billTo: '',
        consumePurchases: '',
        consumptionRate: '',
        cost: '',
        costPerUnit: '',
        crossReference: '',
        currentQuantity: '',
        dateCompleted: '',
        dateEffective: '',
        dateEnd: '',
        dateReceived: '',
        dateStart: '',
        dateTransferred: '',
        daysLeft: '',
        deleteItem: '',
        deliveryAisle: '',
        deliveryLocation: '',
        details: '',
        distributionUnit: '',
        editItem: '',
        expense: '',
        expirationDate: '',
        fulfillRequest: '',
        fulfillRequestNow: '',
        gift: '',
        giftInKindNo: '',
        giftInKindYes: '',
        giftUsage: '',
        inventoryConsumed: '',
        inventoryItem: '',
        inventoryObsolence: '',
        invoiceItems: '',
        invoiceLineItem: '',
        invoiceNumber: '',
        item: '',
        itemNumber: '',
        items: '',
        location: '',
        locations: '',
        markAsConsumed: '',
        name: '',
        newItem: '',
        originalQuantity: '',
        print: '',
        printBarcode: '',
        printer: '',
        pullFrom: '',
        purchaseCost: '',
        purchaseInfo: '',
        purchases: '',
        quantity: '',
        quantityAvailable: '',
        quantityOnHand: '',
        quantityRequested: '',
        rank: '',
        reason: '',
        remove: '',
        removeAdjustmentType: '',
        reorderPoint: '',
        requestedItems: '',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        salePricePerUnit: '',
        save: '',
        serialNumber: '',
        total: '',
        totalCost: '',
        totalReceived: '',
        transaction: '',
        transactions: '',
        transfer: '',
        transferFrom: '',
        transferTo: '',
        transferToAisle: '',
        unit: '',
        unitCost: '',
        vendor: '',
        vendorItemNumber: '',
        writeOffAdjustmentType: '',
        xref: ''
      },
      messages: {
        adjust: '',
        createRequest: 'Neue Anfrage erstellen?',
        itemNotFound: '',
        loading: '',
        noItems: '',
        noRequests: 'Keine Anfragen gefunden.',
        purchaseSaved: '',
        quantity: '',
        removeItem: '',
        removeItemRequest: '',
        requestFulfilled: '',
        requestUpdated: '',
        warning: ''
      },
      reports: {
        adjustment: '',
        daysSupply: '',
        expenseDetail: '',
        expenseSum: '',
        expiration: '',
        'export': '',
        fields: '',
        finance: '',
        generate: '',
        invLocation: '',
        invValuation: '',
        purchaseDetail: '',
        purchaseSum: '',
        reportType: '',
        rows: {
          adjustments: '',
          adjustmentsTotal: '',
          balanceBegin: '',
          balanceEnd: '',
          category: '',
          consumed: '',
          consumedGik: '',
          consumedGikTotal: '',
          consumedPuchases: '',
          consumedPurchasesTotal: '',
          consumedTotal: '',
          errInFinSum: '',
          errInFindPur: '',
          errInFindReq: '',
          expensesFor: '',
          noAccount: '',
          subtotal: '',
          subtotalFor: '',
          total: '',
          totalFor: '',
          totalPurchases: '',
          transfer1: '',
          trasnfer2: ''
        },
        stockTransferDetail: '',
        stockTransferSum: '',
        stockUsageDetail: '',
        stockUsageSum: '',
        titleDateRange: '',
        titleSingleDate: ''
      },
      titles: {
        addPurchase: '',
        addRequest: '',
        adjustment: '',
        editPurchase: '',
        editRequest: '',
        inventoryItem: '',
        inventoryReport: '',
        purchaseSaved: '',
        quickAddTitle: '',
        removeItem: '',
        requestFulfilled: '',
        requestUpdated: '',
        transfer: '',
        warning: ''
      }
    },
    labels: {
      action: 'Aktion',
      actions: 'Aktionen',
      addNewOutpatientVisit: '',
      address: '',
      age: 'Alter',
      allDay: '',
      amount: '',
      anesthesia: '',
      assisting: '',
      balanceDue: '',
      billDate: '',
      billTo: '',
      category: '',
      completed: 'Erledigt',
      country: '',
      cptcode: '',
      creditTo: '',
      date: '',
      dateCompleted: 'Abschlussdatum',
      dateOfBirth: '',
      dateOfBirthShort: '',
      datePaid: '',
      dateRequested: 'Anfragedatum',
      'delete': 'Entfernen',
      deleteRequest: '',
      deleteUser: 'Benutzer löschen',
      department: '',
      description: '',
      discount: '',
      displayName: 'Angezeigter Name',
      docRead: 'Dokument gelesen',
      docWritten: 'Dokument geschrieben',
      edit: 'Bearbeiten',
      editUser: 'Benutzer bearbeiten',
      email: 'E-Mail',
      endDate: '',
      endTime: 'Endzeit',
      excess: '',
      expenseTo: '',
      fileLoadSuccessful: 'Datei erfolgreich geladen',
      fileName: '',
      fileToLoad: 'Datei laden',
      fulfill: 'Ausführen',
      fulfillRequest: '',
      fulfillRequestNow: '',
      fulfilled: '',
      grandTotal: '',
      id: 'Id-Nr',
      imageOrders: '',
      imagingType: 'Bildgebungsart',
      importFile: 'Datei importieren',
      invoiceId: '',
      labOrders: '',
      lineItems: '',
      loading: '',
      location: '',
      lookupType: 'Nachschlagebereich',
      medication: '',
      name: 'Name',
      newUser: 'Neuer Benutzer',
      note: '',
      notes: 'Notizen',
      number: '',
      on: '',
      password: 'Passwort',
      patient: 'Patient',
      payments: '',
      physician: '',
      prescriber: '',
      prescription: '',
      prescriptionDate: '',
      price: '',
      print: '',
      procedures: '',
      provider: '',
      pullFrom: '',
      quantity: 'Anzahl',
      remarks: '',
      requestedBy: 'Angefragt von',
      requestedOn: 'Angefragt am',
      requests: 'Anfragen',
      result: 'Ergebnis',
      results: 'Ergebnisse',
      role: 'Rolle',
      search: '',
      sex: 'Geschlecht',
      startDate: '',
      startTime: 'Startzeit',
      status: '',
      takenBy: '',
      total: '',
      type: '',
      userCanAddNewValue: 'Benutzer kann neue Werte hinzufügen',
      username: 'Username',
      value: 'Wert',
      view: '',
      visit: 'Besuch',
      'with': ''
    },
    labs: {
      alerts: {
        requestCompletedMessage: '',
        requestCompletedTitle: '',
        requestSavedMessage: '',
        requestSavedTitle: ''
      },
      buttons: { newButton: '' },
      completedTitle: '',
      deleteTitle: '',
      editTitle: '',
      labels: {
        addNewVisit: '',
        labType: ''
      },
      messages: {
        createNewRecord: '',
        noCompleted: '',
        noItemsFound: ''
      },
      newTitle: '',
      requestsTitle: '',
      sectionTitle: ''
    },
    loading: {
      messages: {
        '0': '',
        '1': '',
        '2': '',
        '3': '',
        '4': '',
        '5': '',
        '6': '',
        '7': '',
        '8': '',
        '9': '',
        '10': '',
        '11': ''
      },
      progressBar: { progress: '' }
    },
    login: {
      labels: {
        password: 'Passwort',
        signIn: 'Anmelden',
        username: 'Benutzername'
      },
      messages: {
        error: 'Benutzername oder Passwort falsch.',
        signIn: 'Bitte anmelden'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: '',
        returnedMessage: '',
        returnedTitle: '',
        savedMessage: '',
        savedTitle: ''
      },
      buttons: {
        dispenseMedication: '',
        newButton: '',
        returnMedication: ''
      },
      labels: {
        adjustmentDate: '',
        creditToAccount: '',
        quantityDispensed: '',
        quantityDistributed: '',
        quantityRequested: '',
        quantityToReturn: '',
        refills: '',
        returnAisle: '',
        returnLocation: '',
        returnReason: ''
      },
      messages: { createNew: '' },
      pageTitle: '',
      returnMedication: '',
      sectionTitle: '',
      titles: {
        completedMedication: '',
        editMedicationRequest: '',
        newMedicationRequest: ''
      }
    },
    messages: {
      createNewRecord: 'Neuen Eintrag erstellen?',
      createNewUser: 'Neuen Benutzer hinzufügen?',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Dieser Bericht ist nur für autorisierte Personen.',
      newPatientHasToBeCreated: '',
      noHistoryAvailable: '',
      noItemsFound: 'Keine Einträge gefunden.',
      noNotesAvailable: '',
      noUsersFound: 'Keine Benutzer gefunden.',
      onBehalfOf: '',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: '',
      userHasBeenSaved: 'Der Benutzer wurde gespeichert.',
      userSaved: 'Benutzer gespeichert'
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: 'Über HospitalRun',
      actions: {
        login: 'Anmelden',
        logout: 'Abmelden'
      },
      administration: 'Administration',
      billing: 'Abrechnung',
      imaging: 'Bildgebung',
      incident: '',
      inventory: 'Inventar',
      labs: 'Labore',
      medication: 'Medikation',
      patients: 'Patienten',
      scheduling: '',
      subnav: {
        actions: '',
        addAppointment: 'Termin eintragen',
        addressFields: 'Adressfelder',
        admittedPatients: '',
        appointmentSearch: '',
        appointmentsCalendar: '',
        appointmentsThisWeek: '',
        completed: 'Erledigt',
        currentIncidents: '',
        customForms: '',
        dispense: 'Verabreichen',
        history: '',
        incidentCategories: '',
        inventoryReceived: 'Eingeganges Inventar',
        invoices: 'Rechnungen',
        items: 'Einheiten',
        loadDB: '',
        lookupLists: 'Nachschlagelisten',
        missedAppointments: '',
        newIncident: '',
        newInvoice: 'Neue Rechnung',
        newPatient: 'Neuer Patient',
        newRequest: 'Neue Anfrage',
        newUser: 'Neuer Benutzer',
        outpatient: '',
        patientListing: 'Patietenliste',
        priceProfiles: 'Preisprofile',
        prices: 'Kosten',
        printHeader: '',
        reports: 'Berichte',
        requests: 'Anfragen',
        returnMedication: 'Medikamente zurückgeben',
        scheduleSurgery: '',
        theaterSchedule: '',
        "today'sAppointments": '',
        userRoles: '',
        users: 'Benutzer',
        workflow: ''
      }
    },
    operationReport: {
      labels: {
        additionalNotes: '',
        assistant: '',
        caseComplexity: '',
        operationDescription: '',
        preOpPrimaryDiagnosis: '',
        preOpSecondaryDiagnosis: '',
        surgeon: '',
        surgeryDate: ''
      },
      messages: { reportSaved: '' },
      titles: {
        editTitle: '',
        newTitle: '',
        reportSaved: ''
      }
    },
    operativePlan: {
      buttons: { completePlan: '' },
      labels: {
        additionalNotes: '',
        admissionInstructions: '',
        caseComplexity: '',
        completedStatus: '',
        droppedStatus: '',
        operationDescription: '',
        plannedStatus: '',
        status: '',
        surgeon: ''
      },
      messages: {
        planCompleted: '',
        planSaved: ''
      },
      titles: {
        editTitle: '',
        newTitle: '',
        planCompleted: '',
        planSaved: ''
      }
    },
    patients: {
      buttons: {
        addContact: '',
        addExpense: '',
        addFamilyMember: '',
        addOperativePlan: '',
        backToPatients: '',
        download: '',
        editOperativePlan: '',
        newAppointment: '',
        newImaging: '',
        newLab: '',
        newMedication: '',
        newPatient: '',
        newPhoto: '',
        newVisit: '',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: '',
        admit: '',
        bloodType: '',
        caption: '',
        civilStatus: '',
        clinic: '',
        contacts: '',
        cost: '',
        dateOfBirth: '',
        dateProcessed: '',
        dischargeDate: '',
        dob: '',
        education: '',
        email: '',
        externalPatientId: '',
        firstName: '',
        income: '',
        insurance: '',
        lastName: '',
        middleName: '',
        monthlyCost: '',
        occupation: '',
        operativePlan: '',
        parent: '',
        patientDays: '',
        patientType: '',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: '',
        placeOfBirth: '',
        primaryDiagnosis: '',
        referredBy: '',
        referredDate: '',
        relationship: '',
        relationships: '',
        religion: '',
        secondaryDiagnosis: '',
        sex: '',
        sexNotEntered: '',
        sources: '',
        status: '',
        totalMontlyExpense: ''
      },
      messages: {
        areYouSureDelete: '',
        createNewPatient: '',
        deletingPatient: '',
        noPatientsFound: '',
        notFoundQuickAdd: '',
        photoFileRequired: '',
        savedPatient: ''
      },
      navigation: {
        appointments: '',
        general: '',
        history: '',
        imaging: '',
        labs: '',
        medication: '',
        photos: '',
        socialWork: '',
        visits: ''
      },
      notes: {
        newNote: '',
        onBehalfOfCopy: '',
        onBehalfOfLabel: '',
        pleaseSelectAVisit: '',
        updateNote: ''
      },
      titles: {
        addContact: '',
        addPhoto: '',
        additionalContacts: '',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': '',
        deleteContact: '',
        deleteExpense: '',
        deleteFamilyMember: '',
        deletePatientRecord: '',
        deletePhoto: '',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: '',
        editPhoto: '',
        expenses: '',
        familyInfo: '',
        familyInformation: '',
        'new': '',
        outpatientsForDate: '',
        patient: '',
        patientListing: '',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: '',
        socialWork: '',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: '',
          billedDate: '',
          dateAdmitted: '',
          dateDischarged: '',
          dischargeNotes: '',
          patientAddress: '',
          patientAge: '',
          patientId: '',
          patientName: '',
          remarks: '',
          spacer: ''
        },
        messages: { whereConducted: '' },
        titles: {
          billingStatement: '',
          patientMember: '',
          patients: '',
          relContact: ''
        }
      } },
    procedures: {
      buttons: { addMedication: '' },
      labels: { medicationUsed: '' },
      messages: { saved: '' },
      titles: {
        addChargeItem: '',
        addMedicationUsed: '',
        deleteChargeItem: '',
        deleteMedicationUsed: '',
        edit: '',
        editChargeItem: '',
        editMedicationUsed: '',
        medicationUsed: '',
        'new': '',
        saved: ''
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '+ Neuer Benutzer',
      usersPageTile: 'Benutzerliste'
    },
    visits: {
      buttons: {
        addDiagnosis: '',
        checkIn: '',
        checkOut: '',
        discharge: '',
        newAppointment: '',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: '',
        newVitals: ''
      },
      labels: {
        appointment: '',
        authoredBy: '',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: '',
        examiner: '',
        finalDiagnosis: '',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: '',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: '',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: '',
        visitType: ''
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: '',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: '',
        dbp: '',
        heartRate: '',
        height: '',
        respiratoryRate: '',
        sbp: '',
        temperature: '',
        weight: ''
      } }
  };
});
define('hospitalrun/tests/locales/de/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/de/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/de/translations.js should pass ESLint.\n');
  });
});
define("hospitalrun/tests/locales/en/config", ["exports"], function (exports) {
  // Ember-I18n includes configuration for common locales. Most users
  // can safely delete this file. Use it if you need to override behavior
  // for a locale or define behavior for a locale that Ember-I18n
  // doesn't know about.
  "use strict";

  exports["default"] = {
    // rtl: [true|FALSE],
    //
    // pluralForm: function(count) {
    //   if (count === 0) { return 'zero'; }
    //   if (count === 1) { return 'one'; }
    //   if (count === 2) { return 'two'; }
    //   if (count < 5) { return 'few'; }
    //   if (count >= 5) { return 'many'; }
    //   return 'other';
    // }
  };
});
define('hospitalrun/tests/locales/en/config.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/en/config.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/en/config.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/en/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: 'Address 1 Label',
        address2Label: 'Address 2 Label',
        address3Label: 'Address 3 Label',
        address4Label: 'Address 4 Label',
        addressLabel: 'Address',
        editTitle: 'Address Options',
        include1Label: 'Include 1 Label',
        include2Label: 'Include 2 Label',
        include3Label: 'Include 3 Label',
        include4Label: 'Include 4 Label',
        messages: { addressSaved: 'The address options have been saved' },
        newTitle: 'Address Options',
        titles: { optionsSaved: 'Options Saved' }
      },
      addressOptions: 'Address Options',
      customForms: {
        buttons: {
          addField: 'Add Field',
          moveDown: 'Move Down',
          moveUp: 'Move Up',
          newForm: '+ new form',
          preview: 'Preview'
        },
        labels: {
          alwaysInclude: 'Always Include',
          checkbox: 'Checkbox',
          colSpan: 'Number of Columns To Span',
          columns: 'Columns',
          customForm: 'Custom Form',
          dischargeReportFormType: 'Discharge Report',
          expenseTo: 'Expense To',
          formName: 'Form Name',
          formType: 'Form Type',
          incidentFormType: 'Incident',
          includeOtherOption: 'Include Other Option',
          labFormType: 'Lab',
          label: 'Label',
          newForm: 'New Form',
          opdReportFormType: 'Outpatient Report',
          operativePlanFormType: 'Operative Plan and Report',
          otherOptionLabel: 'Other Option Label',
          patientFormType: 'Patient',
          property: 'Property',
          radio: 'Radio',
          select: 'Dropdown',
          socialworkFormType: 'Social Work',
          text: 'Text',
          textarea: 'Large Text',
          visitFormType: 'Visit'
        },
        messages: { formSaved: 'The {{name}} form has been saved.' },
        titles: {
          checkboxValues: 'Checkbox Values',
          customForms: 'Custom Forms',
          deleteForm: 'Delete Custom Form',
          dropDownValues: 'Dropdown Values',
          editCustomForm: 'Edit Custom Form',
          fields: 'Fields',
          formSaved: 'Form Saved',
          newCustomForm: 'New Custom Form',
          radioValues: 'Radio Values'
        }
      },
      header: {
        editTitle: 'Header Options',
        facilityName: 'Facility Name',
        headerLabel: 'Header',
        headerLine1: 'Header Line 1',
        headerLine2: 'Header Line 2',
        headerLine3: 'Header Line 3',
        logoURL: 'Logo URL',
        messages: { headerSaved: 'The header options have been saved' },
        newTitle: 'Header Options',
        titles: { optionsSaved: 'Options Saved' }
      },
      loadDb: 'Load DB',
      loaddb: {
        displayAlertMessage: 'Please select file to load.',
        displayAlertTitle: 'Select File To Load',
        editTitle: 'Load DB',
        errorDisplayAlertMessage: 'The database could not be imported. The error was: {{error}}',
        errorDisplayAlertTitle: 'Error Loading',
        progressMessage: 'Please wait while your database is loaded.',
        progressTitle: 'Loading Database'
      },
      lookup: {
        aisleLocationList: 'Inventory Aisle Locations',
        alertImportListMessage: 'Please select file to import.',
        alertImportListSaveMessage: 'The lookup list has been imported.',
        alertImportListSaveTitle: 'List Imported',
        alertImportListTitle: 'Select File To Import',
        alertImportListUpdateMessage: 'The lookup list has been saved.',
        alertImportListUpdateTitle: 'List Saved',
        anesthesiaTypes: 'Anesthesia Types',
        anesthesiologists: 'Anesthesiologists',
        billingCategories: 'Billing Categories',
        clinicList: 'Clinic Locations',
        countryList: 'Countries',
        cptCodeList: 'CPT Codes',
        diagnosisList: 'Diagnoses',
        edit: { template: {
            addTitle: 'Add Value',
            editTitle: 'Edit Value',
            labelTitle: 'Value',
            updateButtonTextAdd: 'Add',
            updateButtonTextUpdate: 'Update'
          } },
        expenseAccountList: 'Expense Accounts',
        imagingPricingTypes: 'Imaging Pricing Types',
        incidentDepartments: 'Incident Departments',
        inventoryTypes: 'Inventory Types',
        labPricingTypes: 'Lab Pricing Types',
        pageTitle: 'Lookup Lists',
        patientStatusList: 'Patient Status List',
        physicianList: 'Physicians',
        procedureList: 'Procedures',
        procedureLocations: 'Procedures Locations',
        procedurePricingTypes: 'Procedure Pricing Types',
        radiologists: 'Radiologists',
        titles: { deleteLookupValue: 'Delete Value' },
        unitTypes: 'Unit Types',
        vendorList: 'Vendor',
        visitLocationList: 'Visit Locations',
        visitTypes: 'Visit Types',
        wardPricingTypes: 'Ward Pricing Types',
        warehouseList: 'Inventory Locations'
      },
      lookupLists: 'Lookup Lists',
      roles: {
        capability: {
          addAllergy: 'Add Allergy',
          addAppointment: 'Add Appointment',
          addBillingDiagnosis: 'Add Billing Diagnosis',
          addCharge: 'Add Charge',
          addDiagnosis: 'Add Diagnosis',
          addImaging: 'Add Imaging',
          addIncident: 'Add Incident',
          addIncidentCategory: 'Add Incident Category',
          addInventoryItem: 'Add Inventory Item',
          addInventoryPurchase: 'Add Inventory Purchase',
          addInventoryRequest: 'Add Inventory Request',
          addInvoice: 'Add Invoice',
          addLab: 'Add Lab',
          addMedication: 'Add Medication',
          addNote: 'Add Note',
          addOperationReport: 'Add Operation Report',
          addOperativePlan: 'Add Operative Plan',
          addPatient: 'Add Patient',
          addPayment: 'Add Payment',
          addPhoto: 'Add Photo',
          addPricing: 'Add Pricing',
          addPricingProfile: 'Add Pricing Profile',
          addProcedure: 'Add Procedure',
          addSocialwork: 'Add Social Work',
          addVisit: 'Add Visit',
          addVitals: 'Add Vitals',
          adjustInventoryLocation: 'Adjust Inventory Location',
          admin: 'Administration',
          admitPatient: 'Admit Patient',
          appointments: 'Appointments',
          billing: 'Billing',
          cashier: 'Cashier',
          completeImaging: 'Complete Imaging',
          completeLab: 'Complete Lab',
          defineUserRoles: 'Define User Roles',
          deleteAppointment: 'Delete Appointment',
          deleteDiagnosis: 'Delete Diagnosis',
          deleteImaging: 'Delete Imaging',
          deleteIncident: 'Delete Incident',
          deleteIncidentCategory: 'Delete Incident Category',
          deleteInventoryItem: 'Delete Inventory Item',
          deleteInvoice: 'Delete Invoice',
          deleteLab: 'Delete Lab',
          deleteMedication: 'Delete Medication',
          deleteNote: 'Delete Note',
          deletePatient: 'Delete Patient',
          deletePhoto: 'Delete Photo',
          deletePricing: 'Delete Pricing',
          deletePricingProfile: 'Delete Pricing Profile',
          deleteProcedure: 'Delete Procedure',
          deleteSocialwork: 'Delete Social Work',
          deleteVisit: 'Delete Visit',
          deleteVitals: 'Delete Vitals',
          dischargePatient: 'Discharge Patient',
          editInvoice: 'Edit Invoice',
          fulfillInventory: 'Fulfill Inventory',
          fulfillMedication: 'Fulfill Medication',
          generateIncidentReport: 'Generate Incident Report',
          imaging: 'Imaging',
          incident: 'Incident',
          inventory: 'Inventory',
          invoices: 'Invoices',
          labs: 'Labs',
          listPaidInvoices: 'List Paid Invoices',
          loadDb: 'Load Database',
          manageIncidents: 'Manage Incidents',
          medication: 'Medication',
          overrideInvoice: 'Override Invoice',
          patientReports: 'Patient Reports',
          patients: 'Patients',
          pricing: 'Pricing',
          updateConfig: 'Update Configurations',
          visits: 'Visits'
        },
        messages: { roleSaved: 'The {{roleName}} role has been saved.' },
        titles: { roleSaved: 'Role Saved' }
      },
      textReplacements: {
        createNew: 'Create a new shortcode',
        existingRepl: 'Existing Shortcodes',
        replDesc: 'When entering text, these shortcuts allow you to replace a short sequence of characters with a longer phrase.',
        pageTitle: 'Shortcodes',
        toReplace: 'Text to replace',
        replaceWith: 'Replace with',
        performExpand: "Press Enter to replace #{{from}} with '{{to}}'",
        possibleExpansions: 'Possible replacements: {{possible}}',
        noMatches: "No replacements match '{{term}}'"
      },
      userRoles: 'User Roles',
      users: 'Users',
      visitForms: {
        labels: {
          followup: 'Followup',
          form: 'Form',
          initial: 'Initial',
          visitType: 'Visit Type'
        },
        titles: { visitForms: 'Visit Forms' }
      },
      workflow: {
        admissionDepositLabel: 'Admission deposit required',
        clinicPrepaymentLabel: 'Clinic prepayment required',
        editTitle: 'Workflow Options',
        followupPrepaymentLabel: 'Followup prepayment required',
        messages: { optionsSaved: 'The workflow options have been saved' },
        newTitle: 'Workflow Options',
        outpatientImagingLabel: 'Outpatient Imaging prepayment required',
        outpatientLabLabel: 'Outpatient Lab prepayment required',
        outpatientMedicationLabel: 'Outpatient Medication prepayment required',
        titles: { optionsSaved: 'Options Saved' },
        workflowLabel: 'Workflow'
      }
    },
    alerts: {
      errorExclamation: 'Error!!!!',
      pleaseWait: 'Please Wait',
      reportError: 'Error Generating Report',
      warningExclamation: 'Warning!!!!'
    },
    allergies: {
      buttons: { addAllergy: 'Add Allergy' },
      labels: {
        allergyName: 'Name',
        patientAllergy: 'Patient Allergies'
      },
      titles: {
        addAllergy: 'Add Allergy',
        editAllergy: 'Edit Allergy'
      }
    },
    application: {
      messages: { sessionExpired: 'Your session has expired.  Please login to continue.' },
      titles: { sessionExpired: 'Session Expired' }
    },
    appointments: {
      buttons: {
        newButton: '+ new appointment',
        scheduleSurgery: '+ schedule surgery'
      },
      calendarTitle: 'Appointments Calendar',
      currentScreenTitle: 'Appointment List',
      editTitle: 'Edit Appointment',
      labels: {
        noLocation: 'No Location',
        selectedStartingDate: 'Show Appointments On Or After'
      },
      messages: {
        appointmentSaved: 'The appointment for {{patient}} has been saved.',
        endTimeLaterThanStart: 'Please select an end time later than the start time.'
      },
      missed: 'Missed Appointments',
      newTitle: 'New Appointment',
      searchTitle: 'Search Appointments',
      sectionTitle: 'Appointments',
      thisWeek: 'Appointments This Week',
      titles: {
        appointmentSaved: 'Appointment Saved',
        editSurgicalAppointment: 'Edit Surgical Appointment',
        newSurgicalAppointment: 'New Surgical Appointment',
        theaterSchedule: 'Theater Schedule'
      },
      todayTitle: "Today's Appointments"
    },
    billing: {
      alerts: {
        noInvoiceFound: 'No invoices found',
        noPricingItems: 'No pricing items found.',
        noPricingProfiles: 'No pricing profiles found.'
      },
      buttons: {
        addOverride: 'Add Override',
        createInvoice: 'Create an invoice?'
      },
      labels: {
        actualCharges: 'Actual Charges',
        discountAmount: 'Discount Amount',
        discountPercentage: 'Discount Percentage',
        externalInvoiceNumber: 'External Invoice #',
        hmoCom: 'HMO/COM',
        insurance: 'National Insurance',
        paymentProfile: 'Payment Profile',
        paymentsDeposits: 'Payments/Deposits',
        pricingPanelOverrides: 'Pricing profile overrides',
        pricingProfile: 'Pricing Profile',
        setFee: 'Set Fee'
      },
      messages: {
        flatFeeMsg: 'There is a flat fee for patient financial responsibility of {{currency}}{{setFee}}.',
        flatDiscountMsg: 'There is a flat discount amount applied to the patient financial responsibility of {{currency}}{{discountAmount}}.'
      }
    },
    buttons: {
      add: 'Add',
      addItem: 'Add Item',
      addLineItem: 'Add Line Item',
      addValue: 'Add Value',
      addVisit: 'Add Visit',
      allRequests: 'All Requests',
      barcode: 'Barcode',
      cancel: 'Cancel',
      clear: 'Clear',
      close: 'Close',
      complete: 'Complete',
      'delete': 'Delete',
      dispense: 'Dispense',
      edit: 'Edit',
      filter: 'Filter',
      fulfill: 'Fulfill',
      'import': 'Import',
      loadFile: 'Load File',
      newItem: '+ new item',
      newNote: 'New Note',
      newRequest: 'New Request',
      newRequestPlus: '+ new request',
      newUser: 'New User',
      ok: 'Ok',
      remove: 'Remove',
      returnButton: 'Return',
      search: 'Search',
      showAll: 'Show All',
      showFewer: 'Show Fewer',
      update: 'Update'
    },
    components: {
      chargesByTypeTab: { charges: 'charges' },
      customFormManager: { buttons: { addForm: 'Add Form' } },
      dateTimePicker: {
        amHour: '{{hour}} AM',
        midnight: 'Midnight',
        noon: 'Noon',
        pmHour: '{{hour}} PM'
      },
      imageUpload: { messages: { selectValidImageFile: 'Please select a valid image file.' } },
      operativeProcedures: {
        buttons: { addProcedure: 'Add Procedure' },
        labels: { procedure: 'Procedure' },
        titles: { procedures: 'Procedures' }
      },
      patientOrders: {
        buttons: {
          newImaging: 'New Imaging',
          newLab: 'New Lab',
          newMedication: 'New Medication'
        },
        labels: {
          imagingOrderType: 'Imaging',
          labOrderType: 'Lab',
          medicationOrderType: 'Medication',
          orderType: 'Order Type'
        }
      },
      priceList: { charges: '{{pricingType}} charges' },
      quantityCalc: { result: '{{targetUnit}} total: {{calculated}}' },
      quantityConv: {
        conversion: 'What does 1 {{name}} contain?',
        unit: 'Unit'
      },
      sortableColumn: { labels: { selectAll: '(Select All)' } },
      takePhoto: {
        camera: 'Camera',
        how: 'How Do You Want To Add A Photo?',
        labels: {
          takeAPicture: 'Take a Picture',
          uploadAFile: 'Upload a File'
        },
        photo: 'photo',
        preview: 'preview',
        takePhoto: 'Take photo',
        uploadFile: 'Upload File'
      },
      upcomingAppointments: {
        labels: {
          date: 'Date',
          location: 'Location',
          type: 'Type',
          'with': 'With'
        },
        titles: { upcomingAppointments: 'Upcoming Appointments' }
      }
    },
    customForms: {
      buttons: { addForm: 'Add Form' },
      labels: { formToAdd: 'Form To Add' },
      titles: { addCustomForm: 'Add Custom Form' }
    },
    dashboard: {
      needs_user_setup: 'We recommend that you setup a User account.',
      standalone_welcome: '<h4>Thanks for downloading HospitalRun</h4><p>You are running HospitalRun in stand alone mode. This mode allows you to support multiple users on a single, desktop/laptop instance of HospitalRun. This is ideal for:</p><ul><li>Evaluating HospitalRun for an eventual server deployment.</li><li>Using the platform to support a clinic / facility where a single instance is sufficient.</li></ul><p>If you\'re considering a multi-device deployment of HospitalRun, we\'re <a href="https://github.com/HospitalRun/hospitalrun-frontend/issues/1048" target="_blank">working on features</a> that will allow you to "graduate" from this single instance into a traditional cloud / server-based deployment.</p>',
      title: 'Welcome to HospitalRun!'
    },
    dates: {
      'long': '{{years}} year {{months}} months {{days}} days',
      longOmitDays: '{{years}} year {{months}} months',
      longOmitDaysPlural: '{{years}} years {{months}} months',
      longOmitDaysYears: '{{months}} months',
      longOmitYears: '{{months}} months {{days}} days',
      longPlural: '{{years}} years {{months}} months {{days}} days',
      'short': '{{years}}y {{months}}m {{days}}d',
      shortOmitYears: '{{months}}m {{days}}d'
    },
    diagnosis: {
      labels: {
        activeDiagnosis: 'Active Diagnosis',
        date: 'Date',
        diagnosis: 'Diagnosis',
        secondaryDiagnosis: 'Secondary Diagnosis'
      },
      titles: {
        addDiagnosis: 'Add Diagnosis',
        editDiagnosis: 'Edit Diagnosis'
      }
    },
    errors: {
      accepted: 'must be accepted',
      blank: "can't be blank",
      confirmation: "doesn't match {{attribute}}",
      empty: "can't be empty",
      equalTo: 'must be equal to {{count}}',
      even: 'must be even',
      exclusion: 'is reserved',
      greaterThan: 'must be greater than {{count}}',
      greaterThanOrEqualTo: 'must be greater than or equal to {{count}}',
      inclusion: 'is not included in the list',
      invalid: 'is invalid',
      invalidNumber: 'not a valid number',
      lessThan: 'must be less than {{count}}',
      lessThanOrEqualTo: 'must be less than or equal to {{count}}',
      notANumber: 'is not a number',
      notAnInteger: 'must be an integer',
      odd: 'must be odd',
      otherThan: 'must be other than {{count}}',
      present: 'must be blank',
      result: 'Please enter a result before completing',
      tooLong: 'is too long (maximum is {{count}} characters)',
      tooShort: 'is too short (minimum is {{count}} characters)',
      wrongLength: 'is the wrong length (should be {{count}} characters)'
    },
    headings: { chargedItems: 'Charged Items' },
    imaging: {
      alerts: {
        completedMessage: 'The imaging request has been completed.',
        completedTitle: 'Imaging Request Completed',
        savedMessage: 'The imaging request has been saved.',
        savedTitle: 'Imaging Request Saved'
      },
      buttons: { newButton: '+ new imaging' },
      labels: {
        addNewVisit: '--Add New Visit--',
        radiologist: 'Radiologist'
      },
      messages: { noCompleted: 'No completed items found.' },
      pageTitle: 'Imaging Requests',
      sectionTitle: 'Imaging',
      titles: {
        completedImaging: 'Completed Imaging',
        editTitle: 'Edit Imaging Request',
        newTitle: 'New Imaging Request'
      }
    },
    incident: {
      buttons: {
        add: 'Add',
        addForm: '+ Add Form',
        addItem: 'Add Item',
        cancel: 'Cancel',
        'delete': 'Delete',
        download: 'Download',
        edit: 'Edit',
        'export': 'Export Report',
        generateRep: 'Generate Report',
        newAttachment: '+ New Attachment',
        newCategory: '+ new category',
        newIncident: '+ new incident',
        newNote: '+ New Note'
      },
      labels: {
        actions: 'Actions',
        addedBy: 'Added By',
        category: 'Category',
        categoryItem: 'Category Item',
        date: 'Date',
        dateRecorded: 'Date Recorded',
        department: 'Department',
        description: 'Incident Description',
        endDate: 'End Date',
        givenBy: 'Given By',
        howToAddAttachment: 'How Do You Want To Add An Attachment?',
        incidentDate: 'Date of Incident',
        incidentId: 'Incident ID',
        item: 'Item',
        lastUpdated: 'Last Updated',
        note: 'Note',
        patientId: 'Patient Id',
        patientImpacted: 'Patient Impacted',
        reportType: 'Report Type',
        reportedBy: 'Reported By',
        reportedDate: 'Reported Date',
        reportedTo: 'Incident Reported to (Full Name)',
        sentinelEvent: 'Sentinel Event',
        startDate: 'Start Date',
        status: 'Status',
        statusActive: 'Active',
        statusClosed: 'Closed',
        statusFollowup: 'Follow-up',
        statusReported: 'Reported',
        title: 'Title',
        total: 'Total',
        updatedBy: 'Updated By'
      },
      messages: {
        attachmentFileRequired: 'Please upload a file or take a picture or before saving this attachment.',
        createNew: 'Create a new incident?',
        createNewIncidentCategory: 'Create a new Incident Category?',
        fillIn: 'Fill in the above options to calculate score',
        incidentCategorySaved: 'The {{name}} category has been saved.',
        noClosedIncidents: 'No closed incidents found.',
        noIncidentCategoriesFound: 'No Incident Categories found.',
        noIncidents: 'No incidents found.',
        saved: 'The incident report has been saved.',
        selectExistingPatient: 'Please select an existing patient or leave this field blank.'
      },
      titles: {
        addAttachment: 'Add Attachment',
        addCategoryItem: 'Add Category Item',
        addNote: 'Add Note',
        attachments: 'Attachments',
        closed: 'Closed Incidents',
        current: 'Current',
        deleteAttachment: 'Delete Attachment',
        deleteIncident: 'Delete Incident',
        deleteIncidentCategory: 'Delete Incident Category',
        deleteItem: 'Delete Item',
        deleteNote: 'Delete Note',
        editAttachment: 'Edit Attachment',
        editIncident: 'Edit Incident',
        editIncidentCategory: 'Edit Incident Category',
        editNote: 'Edit Note',
        general: 'General Information',
        history: 'History',
        incidentCategories: 'Incident Categories',
        incidentCategoryItem: 'Incident Category Item',
        incidentCategoryName: 'Incident Category Name',
        incidentCategorySaved: 'Incident Category Saved',
        incidentSaved: 'Incident Saved',
        incidents: 'Incidents',
        incidentsByCategory: 'Incidents By Category',
        incidentsByDepartment: 'Incidents By Department',
        newIncident: 'New Incident',
        newIncidentCategory: 'New Incident Category',
        notes: 'Notes',
        reports: 'Reports'
      }
    },
    inventory: {
      edit: {
        cost: 'Cost Per Unit:',
        delivered: 'Delievered To:',
        location: 'Location Adjusted:',
        prescription: 'Prescription For:',
        pulled: 'Pulled From:',
        quantity: 'Quantity at Completion:',
        reason: 'Reason:',
        returned: 'Returned from Patient:',
        transferredFrom: 'Transferred From:',
        transferredTo: 'Transferred To:'
      },
      labels: {
        action: 'Action',
        add: 'Add',
        addAdjustmentType: 'Add',
        adjust: 'Adjust',
        adjustmentDate: 'Adjustment Date',
        adjustmentFor: 'Adjustment For',
        adjustmentType: 'Adjustment Type',
        aisle: 'Aisle',
        aisleLocation: 'Aisle Location',
        allInventory: 'All Inventory',
        allItems: 'All Items',
        availableQuantity: '{{quantity}} available',
        billTo: 'Bill To',
        consumePurchases: 'Consume Purchases',
        consumptionRate: 'Consumption Rate',
        cost: 'Cost',
        costPerUnit: 'Cost per Unit',
        crossReference: 'Cross Reference',
        currentQuantity: 'Current Quantity',
        dateCompleted: 'Date Completed',
        dateEffective: 'Effective Date',
        dateEnd: 'End Date',
        dateReceived: 'Date Received',
        dateStart: 'Start Date',
        dateTransferred: 'Date Transferred',
        daysLeft: 'Days Left',
        deleteItem: 'Delete Item',
        deliveryAisle: 'Delivery Aisle',
        deliveryLocation: 'Delivery Location',
        details: 'Details',
        distributionUnit: 'Distribution Unit',
        editItem: 'Edit Item',
        expense: 'Expense To',
        expirationDate: 'Expiration Date',
        fulfillRequest: 'Fulfill Request',
        fulfillRequestNow: 'Fulfill Request Now',
        gift: 'Gift in Kind',
        giftInKindNo: 'N',
        giftInKindYes: 'Y',
        giftUsage: 'Gift in Kind Usage',
        inventoryConsumed: 'Inventory Consumed',
        inventoryItem: 'Inventory Item',
        inventoryObsolence: 'Inventory Obsolence',
        invoiceItems: 'Invoice Items',
        invoiceLineItem: 'Invoice Line Item',
        invoiceNumber: 'Invoice Number',
        item: 'Item',
        itemNumber: 'Item Number',
        items: 'Items',
        location: 'Location',
        locations: 'Locations',
        markAsConsumed: 'Mark as Consumed',
        name: 'Name',
        newItem: 'New Item',
        originalQuantity: 'Original Quantity',
        print: 'Print',
        printBarcode: 'Print Barcode',
        printer: 'Printer',
        pullFrom: 'Pull From',
        purchaseCost: 'Purchase Cost',
        purchaseInfo: 'Purchase Information',
        purchases: 'Purchases',
        quantity: 'Quantity ({{unit}})',
        quantityAvailable: 'Quantity Available',
        quantityOnHand: 'Quantity on Hand',
        quantityRequested: 'Quantity Requested',
        rank: 'Rank',
        reason: 'Reason',
        remove: 'Remove',
        removeAdjustmentType: 'Remove',
        reorderPoint: 'Reorder Point',
        requestedItems: 'Requested Items',
        returnAdjustmentType: 'Return',
        returnToVendorAdjustmentType: 'Return To Vendor',
        salePricePerUnit: 'Sale Price per Unit',
        save: 'Save',
        serialNumber: 'Serial/Lot Number',
        total: 'Total',
        totalCost: 'Total Cost',
        totalReceived: 'Total Received: {{total}}',
        transaction: 'Transaction',
        transactions: 'Transactions',
        transfer: 'Transfer',
        transferFrom: 'Transfer From',
        transferTo: 'Transfer To Location',
        transferToAisle: 'Transfer to Aisle Location',
        unit: 'Unit',
        unitCost: 'Unit Cost',
        vendor: 'Vendor',
        vendorItemNumber: 'Vendor Item Number',
        writeOffAdjustmentType: 'Write Off',
        xref: 'XRef'
      },
      messages: {
        adjust: 'Please adjust the quantities on the appropriate location(s) to account for the difference of {{difference}}.',
        createRequest: 'Create a new request?',
        itemNotFound: 'The inventory item <strong>{{item}}</strong> could not be found.<br>If you would like to create a new inventory item, fill in the information below.<br>Otherwise, press the Cancel button to return.',
        loading: 'Loading transactions ...',
        noItems: 'No items found.',
        noRequests: 'No requests found.',
        purchaseSaved: 'The inventory purchases have been successfully saved.',
        quantity: 'The total quantity of <strong>({{quantity}})</strong> does not match the total quantity in the locations <strong>({{locationQuantity}})</strong>.',
        removeItem: 'Are you sure you want to remove this item from this invoice?',
        removeItemRequest: 'Are you sure you want to remove this item from this request?',
        requestFulfilled: 'The inventory request has been fulfilled.',
        requestUpdated: 'The inventory request has been updated.',
        warning: 'Please fill in required fields (marked with *) and correct the errors before adding.'
      },
      reports: {
        adjustment: 'Detailed Adjustment',
        daysSupply: 'Days Supply Left In Stock',
        expenseDetail: 'Detailed Expenses',
        expenseSum: 'Summary Expenses',
        expiration: 'Expiration Date',
        'export': 'Export Report',
        fields: 'Fields to Include',
        finance: 'Finance Summary',
        generate: 'Generate Report',
        invLocation: 'Inventory By Location',
        invValuation: 'Inventory Valuation',
        purchaseDetail: 'Detailed Purchase',
        purchaseSum: 'Summary Purchase',
        reportType: 'Report Type',
        rows: {
          adjustments: 'Adjustments',
          adjustmentsTotal: 'Total Adjustments',
          balanceBegin: 'Beginning Balance',
          balanceEnd: 'Ending Balance',
          category: 'Category',
          consumed: 'Consumed',
          consumedGik: 'GiK Consumed',
          consumedGikTotal: 'Total GiK Consumed',
          consumedPuchases: 'Purchases Consumed',
          consumedPurchasesTotal: 'Total Purchases Consumed',
          consumedTotal: 'Total Consumed',
          errInFinSum: 'Error in _generateFinancialSummaryReport: ',
          errInFindPur: 'Error in _findInventoryItemsByPurchase: ',
          errInFindReq: 'Error in _findInventoryItemsByRequest: ',
          expensesFor: 'Expenses For: ',
          noAccount: '(No Account)',
          subtotal: 'Subtotal: ',
          subtotalFor: 'Subtotal for {{category}} - {{account}}: ',
          total: 'Total: ',
          totalFor: 'Total for {{var}}: ',
          totalPurchases: 'Total Purchases',
          transfer1: '{{quantity}} from {{location}}',
          trasnfer2: 'From: {{source}} To: {{target}}'
        },
        stockTransferDetail: 'Detailed Stock Transfer',
        stockTransferSum: 'Summary Stock Transfer',
        stockUsageDetail: 'Detailed Stock Usage',
        stockUsageSum: 'Summary Stock Usage',
        titleDateRange: '{{name}} Report {{startDate}} - {{endDate}}',
        titleSingleDate: '{{name}} Report {{date}}'
      },
      titles: {
        addPurchase: 'Add Purchase',
        addRequest: 'New Request',
        adjustment: 'Adjustment',
        editPurchase: 'Edit Purchase',
        editRequest: 'Edit Request',
        inventoryItem: 'New Inventory Item',
        inventoryReport: 'Inventory Report',
        purchaseSaved: 'Inventory Purchases Saved',
        quickAddTitle: 'New Inventory Item',
        removeItem: 'Remove Item',
        requestFulfilled: 'Request Fulfilled',
        requestUpdated: 'Request Updated',
        transfer: 'Transfer Items',
        warning: 'Warning!!!!!'
      }
    },
    labels: {
      action: 'Action',
      actions: 'Actions',
      addNewOutpatientVisit: '--Add New Outpatient Visit--',
      address: 'Address',
      age: 'Age',
      allDay: 'All Day',
      amount: 'Amount',
      anesthesia: 'Anesthesia',
      assisting: 'Assisting',
      balanceDue: 'Balance Due',
      billDate: 'Bill Date',
      billTo: 'Bill To',
      category: 'Category',
      completed: 'Completed',
      country: 'Country',
      cptcode: 'CPT Code',
      creditTo: 'Credit To',
      currencySymbol: '$',
      date: 'Date',
      dateCompleted: 'Date Completed',
      dateOfBirth: 'Date of Birth',
      dateOfBirthShort: 'DoB',
      datePaid: 'Date Paid',
      dateRequested: 'Date Requested',
      'delete': 'Delete',
      deleteRequest: 'Delete Request',
      deleteUser: 'Delete User',
      department: 'Department',
      description: 'Description',
      discount: 'Discount',
      displayName: 'Display Name',
      docRead: 'Docs Read',
      docWritten: 'Docs Written',
      edit: 'Edit',
      editUser: 'Edit User',
      email: 'Email',
      endDate: 'End Date',
      endTime: 'End Time',
      excess: 'Excess',
      expenseTo: 'Expense To',
      fileLoadSuccessful: 'File To Load Successful',
      fileName: 'File Name',
      fileToLoad: 'File Load',
      from: 'From',
      fulfill: 'Fulfill',
      fulfillRequest: 'Fulfill Request',
      fulfillRequestNow: 'Fulfill Request Now',
      fulfilled: 'Fulfilled',
      grandTotal: 'Grand Total',
      id: 'Id',
      imageOrders: 'Image Orders',
      imagingType: 'Imaging Type',
      importFile: 'Import File',
      invoiceId: 'Invoice ID',
      labOrders: 'Lab Orders',
      lineItems: 'Line Items',
      loading: 'Loading',
      location: 'Location',
      lookupType: 'Lookup Type',
      medication: 'Medication',
      name: 'Name',
      newUser: 'New User',
      note: 'Note',
      notes: 'Notes',
      number: 'Number',
      on: 'on',
      password: 'Password',
      patient: 'Patient',
      payments: 'Payments',
      physician: 'Physician',
      prescriber: 'Prescriber',
      prescription: 'Prescription',
      prescriptionDate: 'Prescription Date',
      price: 'Price',
      print: 'Print',
      procedures: 'Procedures',
      provider: 'Provider',
      pullFrom: 'Pull From',
      quantity: 'Quantity',
      remarks: 'Remarks',
      requestedBy: 'Requested By',
      requestedOn: 'Requested On',
      requests: 'Requests',
      result: 'Result',
      results: 'Results',
      role: 'Role',
      search: 'Search',
      sex: 'Sex',
      startDate: 'Start Date',
      startTime: 'Start Time',
      status: 'Status',
      takenBy: 'Taken By',
      to: 'To',
      total: 'Total',
      type: 'Type',
      userCanAddNewValue: 'User Can Add New Values',
      username: 'Username',
      value: 'Value',
      view: 'View',
      visit: 'Visit',
      'with': 'With'
    },
    labs: {
      alerts: {
        requestCompletedMessage: 'The lab request has been completed.',
        requestCompletedTitle: 'Lab Request Completed',
        requestSavedMessage: 'The lab request has been saved.',
        requestSavedTitle: 'Lab Request Saved'
      },
      buttons: { newButton: '+ new lab' },
      completedTitle: 'Completed Labs',
      deleteTitle: 'Delete Request',
      editTitle: 'Edit Lab Request',
      labels: {
        addNewVisit: '--Add New Visit--',
        labType: 'Lab Type'
      },
      messages: {
        createNewRecord: 'Create a new record?',
        noCompleted: 'No completed items found.',
        noItemsFound: 'No labs found.'
      },
      newTitle: 'New Lab Request',
      requestsTitle: 'Lab Requests',
      sectionTitle: 'Labs'
    },
    loading: {
      messages: {
        '0': 'The top butterfly flight speed is 12 miles per hour. Some moths can fly 25 miles per hour!',
        '1': 'Owls are the only birds that can see the color blue.',
        '2': 'Cats have over 100 vocal sounds; dogs only have 10.',
        '3': 'Humans use a total of 72 different muscles in speech.',
        '4': 'More than 1,000 different languages are spoken on the continent of Africa.',
        '5': 'An erythrophobe is someone who blushes easily.',
        '6': 'The most common phobia in the world is odynophobia which is the fear of pain.',
        '7': 'Your body uses 300 muscles to balance itself when you are standing still.',
        '8': 'Certain frogs can be frozen solid then thawed, and continue living.',
        '9': 'Our eyes are always the same size from birth, but our nose and ears never stop growing.',
        '10': 'Your tongue is the only muscle in your body that is attached at only one end.',
        '11': 'Camels have three eyelids to protect themselves from blowing sand.'
      },
      progressBar: { progress: '{{progressBarValue}}% Complete' }
    },
    login: {
      labels: {
        password: 'Password',
        signIn: 'Sign in',
        username: 'Username'
      },
      messages: {
        error: 'Username or password is incorrect.',
        offlineError: 'Cannot login while offline.  Please establish a network connection and retry login.',
        signIn: 'please sign in'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: 'Medication Request Fulfilled',
        returnedMessage: 'The medication has been marked as returned.',
        returnedTitle: 'Medication Returned',
        savedMessage: 'The medication record has been saved.',
        savedTitle: 'Medication Request Saved'
      },
      buttons: {
        dispenseMedication: 'dispense medication',
        newButton: '+ new request',
        returnMedication: 'return medication'
      },
      labels: {
        adjustmentDate: 'Adjustment Date',
        creditToAccount: 'Credit To Account',
        quantityDispensed: 'Quantity Dispensed',
        quantityDistributed: 'Quantity Distributed',
        quantityRequested: 'Quantity Requested',
        quantityToReturn: 'Quantity To Return',
        refills: 'Refills',
        returnAisle: 'Return Aisle',
        returnLocation: 'Return Location',
        returnReason: 'Return Reason/Notes'
      },
      messages: { createNew: 'Create a new medication request?' },
      pageTitle: 'Medication Requests',
      returnMedication: 'Return Medication',
      sectionTitle: 'Medication',
      titles: {
        completedMedication: 'Completed Medication',
        editMedicationRequest: 'Edit Medication Request',
        newMedicationRequest: 'New Medication Request'
      }
    },
    messages: {
      createNewRecord: 'Create a new record?',
      createNewUser: 'Create a new user?',
      'delete': 'Are you sure you wish to delete {{name}}?',
      delete_plural: 'Are you sure you wish to delete these {{name}}?',
      delete_singular: 'Are you sure you wish to delete this {{name}}?',
      forAuthorizedPersons: 'This report is for authorized persons only.',
      newPatientHasToBeCreated: 'A new patient needs to be created...Please wait..',
      noHistoryAvailable: 'No history available.',
      noItemsFound: 'No items found.',
      noNotesAvailable: 'No additional clinical notes are available for this visit.',
      noUsersFound: 'No users found.',
      onBehalfOf: 'on behalf of',
      reportError: 'An error was encountered while generating the requested report.  Please let your system administrator know that you have encountered an error.',
      requiredFieldsCorrectErrors: 'Please fill in required fields (marked with *) and correct the errors before saving.',
      saveActionException: 'An error occurred while attempting to save: {{message}}',
      sorry: 'Sorry, something went wrong...',
      userHasBeenSaved: 'The user has been saved.',
      userSaved: 'User Saved'
    },
    models: {
      appointment: {
        labels: {
          allDay: 'All Day',
          appointmentDate: 'Date',
          appointmentType: 'Type',
          endDate: 'End Date',
          location: 'Location',
          notes: 'Notes',
          patient: 'Patient',
          provider: 'With',
          startDate: 'Start Date',
          status: 'Status',
          type: 'Type'
        },
        names: {
          plural: 'appointments',
          singular: 'appointment'
        }
      },
      attachment: { names: {
          plural: 'attachments',
          singular: 'attachment'
        } },
      form: { names: {
          plural: 'forms',
          singular: 'form'
        } },
      imaging: {
        names: 'imaging',
        request: {
          plural: 'imaging requests',
          singular: 'imaging request'
        }
      },
      incident: { names: {
          plural: 'incidents',
          singular: 'incident'
        } },
      item: { names: {
          plural: 'items',
          singular: 'item'
        } },
      lab: {
        names: {
          plural: 'labs',
          singular: 'lab'
        },
        request: {
          plural: 'lab requests',
          singular: 'lab request'
        }
      },
      medication: {
        names: {
          plural: 'medications',
          singular: 'medication'
        },
        request: {
          plural: 'medication requests',
          singular: 'medication request'
        }
      },
      note: { names: {
          plural: 'notes',
          singular: 'note'
        } },
      patient: {
        labels: { name: 'Name' },
        names: { singular: 'Patient' }
      },
      procedure: { names: {
          plural: 'procedures',
          singular: 'procedure'
        } },
      user: { names: {
          plural: 'users',
          singular: 'user'
        } },
      visit: { names: {
          plural: 'visits',
          singular: 'visit'
        } },
      vital: { names: {
          plural: 'vitals',
          singular: 'vital'
        } }
    },
    navigation: {
      about: 'About HospitalRun',
      actions: {
        login: 'Login',
        logout: 'Logout'
      },
      administration: 'Administration',
      billing: 'Billing',
      imaging: 'Imaging',
      incident: 'Incident',
      inventory: 'Inventory',
      labs: 'Labs',
      medication: 'Medication',
      messages: {
        logoutFailed: 'Could not logout at this time.  Logout is not available while offline.'
      },
      patients: 'Patients',
      scheduling: 'Scheduling',
      subnav: {
        actions: 'Actions',
        addAppointment: 'Add Appointment',
        addressFields: 'Address Fields',
        admittedPatients: 'Admitted Patients',
        appointmentSearch: 'Appointment Search',
        appointmentsCalendar: 'Appointments Calendar',
        appointmentsThisWeek: 'Appointments This Week',
        cashier: 'Cashier',
        completed: 'Completed',
        currentIncidents: 'Current Incidents',
        customForms: 'Custom Forms',
        dispense: 'Dispense',
        history: 'History',
        incidentCategories: 'Incident Categories',
        inventoryReceived: 'Inventory Received',
        invoices: 'Invoices',
        items: 'Items',
        loadDB: 'Load DB',
        lookupLists: 'Lookup Lists',
        newIncident: 'New Incident',
        newInvoice: 'New Invoice',
        newPatient: 'New Patient',
        newRequest: 'New Request',
        newUser: 'New User',
        outpatient: 'Outpatient',
        patientListing: 'Patient Listing',
        priceProfiles: 'Price Profiles',
        prices: 'Prices',
        printHeader: 'Print Header',
        reports: 'Reports',
        requests: 'Requests',
        returnMedication: 'Return Medication',
        scheduleSurgery: 'Schedule Surgery',
        textReplacements: 'Shortcodes',
        theaterSchedule: 'Theater Schedule',
        "today'sAppointments": "Today's Appointments",
        userRoles: 'User Roles',
        users: 'Users',
        workflow: 'Workflow'
      },
      titles: {
        logoutFailed: 'Logout Failed'
      }
    },
    operationReport: {
      labels: {
        additionalNotes: 'Additional Notes',
        assistant: 'Assistant',
        caseComplexity: 'Case Complexity',
        operationDescription: 'Operation Description',
        preOpPrimaryDiagnosis: 'Pre-op Primary Diagnosis',
        preOpSecondaryDiagnosis: 'Pre-op Secondary Diagnosis',
        surgeon: 'Surgeon',
        surgeryDate: 'Surgery Date'
      },
      messages: { reportSaved: 'The operation report has been saved.' },
      titles: {
        editTitle: 'Edit Operation Report',
        newTitle: 'New Operation Report',
        reportSaved: 'Report Saved'
      }
    },
    operativePlan: {
      buttons: { completePlan: 'Complete Plan' },
      labels: {
        additionalNotes: 'Additional Notes',
        admissionInstructions: 'Instructions Upon Admission',
        caseComplexity: 'Case Complexity',
        completedStatus: 'Completed',
        droppedStatus: 'Dropped',
        operationDescription: 'Operation Description',
        plannedStatus: 'Planned',
        status: 'Status',
        surgeon: 'Surgeon'
      },
      messages: {
        planCompleted: 'The operative plan has been completed.  You will now be directed to the operation report.',
        planSaved: 'The operative plan has been saved.'
      },
      titles: {
        editTitle: 'Edit Operative Plan',
        newTitle: 'New Operative Plan',
        planCompleted: 'Plan Completed',
        planSaved: 'Plan Saved'
      }
    },
    patients: {
      buttons: {
        addContact: 'Add Contact',
        addExpense: 'Add Expense',
        addFamilyMember: 'Add Family Member',
        addOperativePlan: 'Add Operative Plan',
        backToPatients: 'Back to Patient List',
        download: 'Download',
        editOperativePlan: 'Current Operative Plan',
        newAppointment: 'New Appointment',
        newImaging: 'New Imaging',
        newLab: 'New Lab',
        newMedication: 'New Medication',
        newPatient: '+ new patient',
        newPhoto: 'New Photo',
        newVisit: 'New Visit',
        patientCheckIn: 'Patient Check In',
        scheduleSurgery: 'Schedule Surgery'
      },
      labels: {
        admissionDate: 'Admission Date',
        admit: 'Admit',
        bloodType: 'Blood Type',
        caption: 'Caption',
        civilStatus: 'Civil Status',
        clinic: 'Clinic Site',
        contacts: 'Contacts',
        cost: 'Cost',
        dateOfBirth: 'Date Of Birth',
        dateProcessed: 'Date Processed',
        dischargeDate: 'Discharge Date',
        dob: 'DOB',
        education: 'Education',
        email: 'Email',
        externalPatientId: 'External Patient Id',
        firstName: 'First Name',
        income: 'Income',
        insurance: 'Insurance',
        lastName: 'Last Name',
        middleName: 'Middle Name',
        monthlyCost: 'Monthly Cost',
        occupation: 'Occupation',
        operativePlan: 'Operative Plan',
        parent: 'Parent/Guardian',
        patientDays: 'Patient Days',
        patientType: 'Patient Type',
        patientTypeCharity: 'Charity',
        patientTypePrivate: 'Private',
        phone: 'Phone',
        placeOfBirth: 'Place Of Birth',
        primaryDiagnosis: 'Primary Diagnoses',
        referredBy: 'Referred By',
        referredDate: 'Referred Date',
        relationship: 'Relationship To Patient',
        relationships: 'Relationships',
        religion: 'Religion',
        secondaryDiagnosis: 'Secondary Diagnoses',
        sex: 'Sex',
        sexNotEntered: 'Sex Not Entered',
        sources: 'Sources',
        status: 'Patient Status',
        totalMontlyExpense: 'Total Monthly Expenses'
      },
      messages: {
        areYouSureDelete: 'Are you sure you want to delete this {{object}}?',
        createNewPatient: 'Create a new patient record?',
        deletingPatient: 'Deleting patient and all associated records',
        noPatientsFound: 'No patients found.',
        notFoundQuickAdd: 'The patient <strong>{{patientFullName}}</strong> could not be found.  If you would like to create a new patient, fill in the information below.  Otherwise press the Cancel button to return.',
        photoFileRequired: 'Please take a picture or upload a file before saving this photo.',
        savedPatient: 'The patient record for {{displayName}} has been saved.'
      },
      navigation: {
        appointments: 'Appointments',
        general: 'General',
        history: 'History',
        imaging: 'Imaging',
        labs: 'Labs',
        medication: 'Medication',
        photos: 'Photos',
        socialWork: 'Social Work',
        visits: 'Visits'
      },
      notes: {
        newNote: 'New Note for',
        onBehalfOfCopy: 'on behalf of',
        onBehalfOfLabel: 'On Behalf Of',
        pleaseSelectAVisit: 'Please select a visit',
        updateNote: 'Updating Note from'
      },
      titles: {
        addContact: 'Add Contact',
        addPhoto: 'Add Photo',
        additionalContacts: 'Additional Contacts',
        admissionsDetail: 'Admissions Detail',
        admissionsSummary: 'Admissions Summary',
        admittedPatients: 'Admitted Patients',
        'delete': 'Delete Patient',
        deleteContact: 'Delete Contact',
        deleteExpense: 'Delete Expense',
        deleteFamilyMember: 'Delete Family Member',
        deletePatientRecord: 'Delete Patient Record',
        deletePhoto: 'Delete Photo',
        diagnosticTesting: 'Diagnostic Testing',
        dischargesDetail: 'Discharges Detail',
        dischargesSummary: 'Discharges Summary',
        edit: 'Edit Patient',
        editPhoto: 'Edit Photo',
        expenses: 'Expenses',
        familyInfo: 'Family Info',
        familyInformation: 'Family Information',
        'new': 'New Patient',
        outpatientsForDate: 'Outpatients for {{visitDate}}',
        patient: 'Patient Report',
        patientListing: 'Patient Listing',
        patientReport: 'Patient Report',
        patientStatus: 'Patient Status',
        proceduresDetail: 'Procedures Detail',
        proceduresSummary: 'Procedures Summary',
        savedPatient: 'Patient Saved',
        socialWork: 'Expense',
        todaysOutpatients: "Today's Outpatients",
        totalPatientDays: 'Total Patient Days',
        totalPatientDaysDetailed: 'Total Patient Days (Detailed)',
        visit: 'Visit'
      }
    },
    pricing: {
      labels: {
        discountAmount: 'Discount Amount',
        discountPercentage: 'Discount Percentage',
        setFee: 'Set Fee'
      }
    },
    print: { invoice: {
        labels: {
          billedBy: 'Billed by:',
          billedDate: 'Bill Date:',
          dateAdmitted: 'ADMITTED:',
          dateDischarged: 'DISCHARGE:',
          dischargeNotes: 'Discharge Notes:',
          patientAddress: 'ADDRESS:',
          patientAge: 'AGE:',
          patientId: 'PATIENT #:',
          patientName: 'NAME OF PATIENT:',
          remarks: 'Remarks:',
          spacer: '__________________________________________'
        },
        messages: { whereConducted: 'were deducted during my confinement' },
        titles: {
          billingStatement: 'BILLING STATEMENT',
          patientMember: 'Patient-Member',
          patients: "PATIENT'S",
          relContact: 'Relationship/Contact no.'
        }
      } },
    procedures: {
      buttons: { addMedication: 'Add Medication' },
      labels: { medicationUsed: 'Medication Used' },
      messages: { saved: 'The procedure record has been saved.' },
      titles: {
        addChargeItem: 'Add Charge Item',
        addMedicationUsed: 'Add Medication Used',
        deleteChargeItem: 'Delete Charge Item',
        deleteMedicationUsed: 'Delete Medication Used',
        edit: 'Edit Procedure',
        editChargeItem: 'Edit Charge Item',
        editMedicationUsed: 'Edit Medication Used',
        medicationUsed: 'Medication Used',
        'new': 'New Procedure',
        saved: 'Procedure Saved'
      }
    },
    reports: {
      labels: {
        admissionDate: 'Admission Date',
        allProcedures: 'All Procedures Performed',
        completedBy: 'Completed By',
        dischargeDate: 'Discharge Date',
        examiner: 'Examiner',
        images: 'Images',
        labs: 'Labs',
        location: 'Visit Location',
        medications: 'Medications',
        nextAppointment: 'Next Appointment',
        nextAppointments: 'Next Appointments',
        notes: {
          author: 'Author',
          date: 'Date',
          title: 'Notes'
        },
        operativePlan: {
          description: 'Operation Description',
          instructions: 'Instructions upon Admission',
          procedures: 'Planned Procedures',
          title: 'Operative Plan'
        },
        primaryDiagnosis: 'Primary Diagnosis',
        procedures: 'Procedures',
        secondaryDiagnosis: 'Secondary Diagnosis',
        visitDate: 'Date of Visit',
        visitType: 'Visit Type'
      },
      messages: {
        'delete': 'Are you sure you wish to delete this report?',
        saved: 'The report has been saved.'
      },
      titles: {
        dischargeReport: 'Discharge Report',
        newDischargeReport: 'New Discharge Report',
        newOPDReport: 'New OPD Report',
        opdReport: 'OPD Report',
        saved: 'Report saved'
      }
    },
    user: {
      plusNewUser: '+ new user',
      usersPageTile: 'User Listing'
    },
    visits: {
      buttons: {
        addDiagnosis: 'Add Diagnosis',
        checkIn: 'Check In',
        checkOut: 'Check Out',
        discharge: 'Discharge',
        newAppointment: 'New Appointment',
        newDischargeReport: 'New Discharge Report',
        newOPDReport: 'New OPD Report',
        newProcedure: 'New Procedure',
        newVitals: 'New Vitals'
      },
      labels: {
        appointment: 'Appointment',
        authoredBy: 'Authored By',
        checkInTime: 'Check In',
        checkOutTime: 'Check Out',
        createNewPatient: 'Create New Patient',
        diagnosis: 'Diagnosis',
        examiner: 'Examiner',
        finalDiagnosis: 'Final/Billing Diagnosis',
        haveAppointment: 'Y',
        haveDoneOrders: 'Y',
        noAppointment: 'N',
        ordersDone: 'Orders Done',
        ordersNotDone: 'N',
        patientToCheckIn: 'Patient To Check In',
        procedure: 'Procedure',
        procedureDate: 'Procedure Date',
        reasonForVisit: 'Reason For Visit',
        reportType: 'Report type',
        status: 'Visit Status',
        statusAdmitted: 'Admitted',
        statusCheckedIn: 'Checked In',
        statusCheckedOut: 'Checked Out',
        statusDischarged: 'Discharged',
        visitDate: 'Visit Date',
        visitInformation: 'Visit Information',
        visitType: 'Visit Type'
      },
      messages: {
        checkOut: 'Are you sure you wish to check out {{patientName}}?',
        checkedOut: '{{patientName}} has been checked out.',
        discharged: '{{patientName}} has been discharged.',
        patientCheckedIn: '{{patientName}} has been checked in.',
        patientCreatedAndCheckedIn: '{{patientName}} has been created and checked in.',
        visitAndPatientSaved: 'The visit and patient records have been saved.',
        visitSaved: 'The visit record has been saved.'
      },
      navigation: {
        charges: 'Charges',
        notes: 'Notes',
        orders: 'Orders',
        procedures: 'Procedures',
        reports: 'Reports',
        vitals: 'Vitals'
      },
      titles: {
        additionalDiagnoses: 'Additional Diagnoses',
        checkOut: 'Patient Check Out',
        checkedIn: 'Patient Checked In',
        checkedOut: 'Patient Checked Out',
        discharged: 'Patient Discharged',
        editVisit: 'Edit Visit',
        newVisit: 'New Visit',
        patientCheckIn: 'Patient Check In',
        visitSaved: 'Visit Saved'
      }
    },
    vitals: {
      labels: {
        dateRecorded: 'Date Recorded',
        dbp: 'DBP',
        heartRate: 'Heart Rate',
        height: 'Height',
        respiratoryRate: 'Respiratory Rate',
        sbp: 'SBP',
        temperature: 'Temperature',
        weight: 'Weight'
      }
    }
  };
});
define('hospitalrun/tests/locales/en/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/en/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/en/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/es-CO/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: 'Texto direccion 1',
        address2Label: 'Texto direccion 2',
        address3Label: 'Texto direccion 3',
        address4Label: 'Texto direccion 4',
        addressLabel: 'Direcciones',
        editTitle: 'Opciones de dirección',
        include1Label: 'Incluir 1',
        include2Label: 'Incluir 2',
        include3Label: 'Incluir 3',
        include4Label: 'Incluir 4',
        messages: { addressSaved: 'las opciones de dirección han sido guardadas' },
        newTitle: 'Opciones de dirección',
        titles: { optionsSaved: 'Opciones guardadas' }
      },
      addressOptions: 'Opciones de direcciones',
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: 'Cargar Base de datos',
      loaddb: {
        displayAlertMessage: 'Por favor seleccione un archivo para ser cargado.',
        displayAlertTitle: 'Seleccione un archivo para cargar',
        editTitle: 'Cargar bd',
        errorDisplayAlertMessage: 'La base de datos no fue cargada el error fue: {{error}}',
        errorDisplayAlertTitle: 'Error cargando',
        progressMessage: 'Por favor espere mientras la base de datos es cargada.',
        progressTitle: 'Cargando ase de datos'
      },
      lookup: {
        aisleLocationList: 'Ubicacion de inventario de pasillo',
        alertImportListMessage: 'Por favor seleccione un archivo para importar.',
        alertImportListSaveMessage: 'Lista de busqueda importada.',
        alertImportListSaveTitle: 'Lista importada',
        alertImportListTitle: 'Seleccione un archivo para importar',
        alertImportListUpdateMessage: 'La lista de busqueda ha sido salvada.',
        alertImportListUpdateTitle: 'Lista salvada',
        anesthesiaTypes: 'Tipos de anestesia',
        anesthesiologists: 'Anestesiologo',
        billingCategories: 'Categorias de facturacion',
        clinicList: 'Ubicacion de las clinicas',
        countryList: 'Paises',
        cptCodeList: 'Codigos CPT',
        diagnosisList: 'Diagnosticos',
        edit: { template: {
            addTitle: 'Adicionar valor',
            editTitle: 'Editar valor',
            labelTitle: 'Valor',
            updateButtonTextAdd: 'Adicionar',
            updateButtonTextUpdate: 'Actualizar'
          } },
        expenseAccountList: 'Cuentas de gastos',
        imagingPricingTypes: 'Tipos de precios de radiografias',
        incidentDepartments: '',
        inventoryTypes: 'Tipos de inventarios',
        labPricingTypes: 'Precios de laboratorio',
        pageTitle: 'Listas de busqueda',
        patientStatusList: 'Lista de estado de pacientes',
        physicianList: 'Medicos',
        procedureList: 'Procedimientos',
        procedureLocations: 'Ubicacion de los procedimientos',
        procedurePricingTypes: 'Tipos de procedimientos y precios',
        radiologists: 'Radiologo',
        titles: { deleteLookupValue: '' },
        unitTypes: 'Tipos de unidad',
        vendorList: 'Proveedor',
        visitLocationList: 'Lugares de visista',
        visitTypes: 'Tipos de visita',
        wardPricingTypes: 'Tipos de las tarifas',
        warehouseList: 'Ubicacciones de inventarios'
      },
      lookupLists: 'Lista de busqueda',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: 'Adicionar cita',
          addBillingDiagnosis: '',
          addCharge: 'Adicionar cargo (valor)',
          addDiagnosis: 'Adicionar diagnostico',
          addImaging: 'Adicionar radiografia',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: 'Adicionar elemento al inventario',
          addInventoryPurchase: 'Adicionar compra',
          addInventoryRequest: 'Pedido de inventario',
          addInvoice: 'Adicionar factura',
          addLab: 'Adicionar laboratorio',
          addMedication: 'Adicionar medicación',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: 'Adicionar paciente',
          addPayment: 'Adicionar pago',
          addPhoto: 'Adicionar foto',
          addPricing: 'Adicionar precio',
          addPricingProfile: 'Adicionar perfil de precios',
          addProcedure: '',
          addSocialwork: '',
          addVisit: 'Adicionar visita',
          addVitals: 'Adicionar partes vitales',
          adjustInventoryLocation: 'Ajustar lugar elemento en el inventario',
          admin: 'Administracion',
          admitPatient: 'Admitir paciente',
          appointments: 'Citas',
          billing: 'Facturacion',
          completeImaging: 'Completar radiografia',
          completeLab: 'Completar laboratorio',
          defineUserRoles: 'Roles de usuario',
          deleteAppointment: 'Eliminar cita',
          deleteDiagnosis: 'Eliminar diagnostico',
          deleteImaging: 'Eliminar radiografia',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: 'Eliminar elemento del inventario',
          deleteInvoice: 'Eliminar factura',
          deleteLab: 'Eliminar laboratorio',
          deleteMedication: 'Eliminar medicación',
          deleteNote: '',
          deletePatient: 'Eliminar paciente',
          deletePhoto: 'Eliminar foto',
          deletePricing: 'Eliminar precio',
          deletePricingProfile: 'Eliminar perfil de precio',
          deleteProcedure: 'Eliminar procedimiento',
          deleteSocialwork: 'Eliminar trabajo social',
          deleteVisit: 'Eliminar visita',
          deleteVitals: 'Eliminar organo vital',
          dischargePatient: 'Descartar paciente',
          editInvoice: 'Editar factura',
          fulfillInventory: 'Cumplimiento de inventario',
          fulfillMedication: 'Cumplir la medicación',
          generateIncidentReport: '',
          imaging: 'Radiografia',
          incident: '',
          inventory: 'Inventario',
          invoices: 'Facturas',
          labs: 'Laboratorios',
          loadDb: 'Cargar base de datos',
          manageIncidents: '',
          medication: 'Medicación',
          overrideInvoice: 'Sobreescribir factura',
          patientReports: 'Reportes por paciente',
          patients: 'Pacientes',
          pricing: 'Precio',
          updateConfig: 'Actualizar configuracion',
          visits: 'Visitas'
        },
        messages: { roleSaved: 'El {{roleName}} rol ha sido salvado.' },
        titles: { roleSaved: 'Role salvado' }
      },
      userRoles: 'Roles',
      users: 'Usuarios',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: '',
        clinicPrepaymentLabel: '',
        editTitle: '',
        followupPrepaymentLabel: '',
        messages: { optionsSaved: '' },
        newTitle: '',
        outpatientImagingLabel: '',
        outpatientLabLabel: '',
        outpatientMedicationLabel: '',
        titles: { optionsSaved: '' },
        workflowLabel: ''
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: 'Por favor espere',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: '' },
      labels: {
        allergyName: '',
        patientAllergy: ''
      },
      titles: {
        addAllergy: '',
        editAllergy: ''
      }
    },
    application: {
      messages: { sessionExpired: '' },
      titles: { sessionExpired: '' }
    },
    appointments: {
      buttons: {
        newButton: '+ nueva cita',
        scheduleSurgery: ''
      },
      calendarTitle: '',
      currentScreenTitle: 'Listado de citas',
      editTitle: 'Editar cita',
      labels: {
        noLocation: '',
        selectedStartingDate: ''
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: 'Seleccione una hora de finalizacion despues de la de inicio.'
      },
      missed: 'Citas perdidas',
      newTitle: 'Nueva cita',
      searchTitle: 'Buscar citas',
      sectionTitle: 'Citas',
      thisWeek: 'Citas esta semana',
      titles: {
        appointmentSaved: '',
        editSurgicalAppointment: '',
        newSurgicalAppointment: '',
        theaterSchedule: ''
      },
      todayTitle: 'Citas para hoy'
    },
    billing: {
      alerts: {
        noInvoiceFound: '',
        noPricingItems: '',
        noPricingProfiles: ''
      },
      buttons: {
        addOverride: '',
        createInvoice: ''
      },
      labels: {
        actualCharges: '',
        discountAmount: '',
        discountPercentage: '',
        externalInvoiceNumber: '',
        hmoCom: '',
        insurance: '',
        paymentProfile: '',
        paymentsDeposits: '',
        pricingPanelOverrides: '',
        pricingProfile: ''
      }
    },
    buttons: {
      add: 'Adicionar',
      addItem: '',
      addLineItem: '',
      addValue: 'Adicionar valor',
      addVisit: 'Adicionar visita',
      allRequests: 'Todas las solicitudes',
      barcode: 'Codigo de barras',
      cancel: 'Cancelar',
      clear: '',
      close: 'Cerrar',
      complete: 'Completado',
      'delete': 'Eliminar',
      dispense: 'Repartir',
      edit: '',
      filter: '',
      fulfill: 'Cumplimiento',
      'import': 'Importar',
      loadFile: 'Cargar archivo',
      newItem: '+ nuevo elemento',
      newNote: 'Nueva nota',
      newRequest: 'Nueva solicitud',
      newRequestPlus: '+ nuevo pedido',
      newUser: 'Nuevo usuario',
      ok: 'Ok',
      remove: 'Remover',
      returnButton: 'Regresar',
      search: 'Buscar',
      showAll: '',
      showFewer: '',
      update: 'Actualizar'
    },
    components: {
      chargesByTypeTab: { charges: '' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '',
        midnight: '',
        noon: '',
        pmHour: ''
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: '' },
      quantityCalc: { result: '' },
      quantityConv: {
        conversion: '',
        unit: ''
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: '',
        how: '',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: '',
        preview: '',
        takePhoto: '',
        uploadFile: ''
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: '' },
      labels: { formToAdd: '' },
      titles: { addCustomForm: '' }
    },
    dashboard: {
      setup: '',
      title: 'Que deseas hacer?'
    },
    dates: {
      'long': '',
      longOmitDays: '',
      longOmitDaysPlural: '',
      longOmitDaysYears: '',
      longOmitYears: '',
      longPlural: '',
      'short': '',
      shortOmitYears: ''
    },
    diagnosis: {
      labels: {
        activeDiagnosis: '',
        date: '',
        diagnosis: '',
        secondaryDiagnosis: ''
      },
      titles: {
        addDiagnosis: '',
        editDiagnosis: ''
      }
    },
    errors: {
      accepted: '',
      blank: '',
      confirmation: '',
      empty: '',
      equalTo: '',
      even: '',
      exclusion: '',
      greaterThan: '',
      greaterThanOrEqualTo: '',
      inclusion: '',
      invalid: '',
      invalidNumber: '',
      lessThan: '',
      lessThanOrEqualTo: '',
      notANumber: '',
      notAnInteger: '',
      odd: '',
      otherThan: '',
      present: '',
      result: '',
      tooLong: '',
      tooShort: '',
      wrongLength: ''
    },
    headings: { chargedItems: '' },
    imaging: {
      alerts: {
        completedMessage: 'El pedido de radiografia ha sido completado.',
        completedTitle: 'Pedido de radiografia completado',
        savedMessage: 'El pedido de radiografia ha sido guardado.',
        savedTitle: 'Pedido de radiografia salvado'
      },
      buttons: { newButton: '+ new radiografia' },
      labels: {
        addNewVisit: '--Adicionar nueva visita--',
        radiologist: 'Radiologo'
      },
      messages: { noCompleted: 'No de items encontrados.' },
      pageTitle: 'Pedido de radriografia',
      sectionTitle: 'Radiografias',
      titles: {
        completedImaging: 'Radiografia completada',
        editTitle: 'Pedido de edicion de radiografia',
        newTitle: 'Nuevo pedido de radiografia'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    inventory: {
      edit: {
        cost: 'Costo por unidad:',
        delivered: 'Enviado A:',
        location: 'Cambio de ubicación:',
        prescription: 'Recetado por:',
        pulled: 'Pulled From:',
        quantity: 'Quantity at Completion:',
        reason: 'Razón:',
        returned: 'Regresado al paciente:',
        transferredFrom: 'Transferido a:',
        transferredTo: 'Transferido a:'
      },
      labels: {
        action: 'Acción',
        add: 'Adicionar',
        addAdjustmentType: '',
        adjust: 'Adjustar',
        adjustmentDate: 'Fecha de ajuste',
        adjustmentFor: 'Ajustado para',
        adjustmentType: 'Tipo de ajuste',
        aisle: 'Pasillo',
        aisleLocation: 'Ubicación pasillo',
        allInventory: 'Todo el inventario',
        allItems: '',
        availableQuantity: '',
        billTo: 'Facturao a',
        consumePurchases: 'Consume Purchases',
        consumptionRate: 'Tasa de consumo',
        cost: 'Costo',
        costPerUnit: 'Costo por Unidad',
        crossReference: 'Referencia cruzada',
        currentQuantity: 'Cantidad actual',
        dateCompleted: 'Fecha completado',
        dateEffective: 'Gecha efectiva',
        dateEnd: 'Fecha final',
        dateReceived: 'Fecha recibido',
        dateStart: 'Fecha inicial',
        dateTransferred: 'Fecha transferencia',
        daysLeft: 'Dias restantes',
        deleteItem: 'Eliminar elemento',
        deliveryAisle: 'Enviado a pasillo',
        deliveryLocation: 'Ubicación del envio',
        details: 'Detalles',
        distributionUnit: 'Unidad de distribución',
        editItem: 'Editar elemento',
        expense: 'Gastos a',
        expirationDate: 'Fecha de vencimiento',
        fulfillRequest: 'Pedido de cumplimiento',
        fulfillRequestNow: 'Pedido de incumplimiento para hoy',
        gift: 'Regalo en especie',
        giftInKindNo: 'N',
        giftInKindYes: 'Y',
        giftUsage: 'Uso del regalo en especie',
        inventoryConsumed: 'Inventario consumido',
        inventoryItem: 'Elemento del inventario',
        inventoryObsolence: 'Obsolescencia de inventario',
        invoiceItems: 'Articulos de factura',
        invoiceLineItem: 'Elemento de la factura linea',
        invoiceNumber: 'Factura numero',
        item: 'Elemento',
        itemNumber: 'Numero de elemento',
        items: 'Elementos',
        location: 'Ubicación',
        locations: 'Ubicaciones',
        markAsConsumed: 'Marcar como consumido',
        name: 'Nombre',
        newItem: 'Nuevo elemento',
        originalQuantity: 'Cantidad original',
        print: 'Imprimir',
        printBarcode: 'Imprimir codigo de  barras',
        printer: 'Impresora',
        pullFrom: 'Traido de',
        purchaseCost: 'Costo de compra',
        purchaseInfo: 'Informacion de la compra',
        purchases: 'Compras',
        quantity: 'Cantidad ({{unit}})',
        quantityAvailable: 'Cantidad disponible',
        quantityOnHand: 'Cantidad a la mano',
        quantityRequested: 'Cantidad pedida',
        rank: 'Ranking',
        reason: 'Razón',
        remove: 'Remover',
        removeAdjustmentType: '',
        reorderPoint: 'Reordenar punto',
        requestedItems: 'Elementos solicitados',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        salePricePerUnit: 'Costo de venta por unidad',
        save: 'Guardar',
        serialNumber: 'Serial/Numero de lote',
        total: 'Total',
        totalCost: 'Costo total',
        totalReceived: 'Total Recivido: {{total}}',
        transaction: 'Transaccion',
        transactions: 'Transacciones',
        transfer: 'Translados',
        transferFrom: 'Translado desde',
        transferTo: 'Translado a ubicación',
        transferToAisle: 'Translado a pasillo',
        unit: 'Unidad',
        unitCost: 'Unidad Costo',
        vendor: 'Proveedor',
        vendorItemNumber: 'Proveedor numero de elemento',
        writeOffAdjustmentType: '',
        xref: 'XRef'
      },
      messages: {
        adjust: 'Por favor ajust las cantidades en la ubicación adecuada(s) la diferencia de la cuenta es {{difference}}.',
        createRequest: 'Crear un nuevo pedido?',
        itemNotFound: 'El elemento del inventario <strong>{{item}}</strong> no se pudo encontrar.<br>Si desea crear un nuevo elemento, Ingrese la información abajo.<br>De lo contrario opria cancelar para volver.',
        loading: 'Cargando transacciones ...',
        noItems: 'No se encontraron elementos.',
        noRequests: 'No se encontraron pedidos.',
        purchaseSaved: 'La compra de inventario ha sido salvada.',
        quantity: 'La cantidad total <strong>({{quantity}})</strong> no encaja con la cantidad total en las ubicaciones <strong>({{locationQuantity}})</strong>.',
        removeItem: 'Esta seguro de eliminar este elemento de la factura?',
        removeItemRequest: 'Seguro que quiere eliminar este elemento del pedido?',
        requestFulfilled: 'El pedido de inventario ha sido procesado.',
        requestUpdated: 'El pedido de inventario ha sido actualizado.',
        warning: 'Valide los campos requeridos (marcados con *) corrija los errores antes de adicionar.'
      },
      reports: {
        adjustment: 'Ajuste detallado',
        daysSupply: 'Dias de inventario restante',
        expenseDetail: 'Gastos detallados',
        expenseSum: 'Resumen de gastos',
        expiration: 'Fecha de expiracion',
        'export': 'Exportar reporte',
        fields: 'Campos a incluir',
        finance: 'Resumen de finanzas',
        generate: 'Generar reporte',
        invLocation: 'Inventario por ubicacion',
        invValuation: 'Inventario por valoracion',
        purchaseDetail: 'Compras detalladas',
        purchaseSum: 'Resumen de compras',
        reportType: 'Tipo de reporte',
        rows: {
          adjustments: 'Ajustes',
          adjustmentsTotal: 'Ajustes totales',
          balanceBegin: 'Balance inicial',
          balanceEnd: 'Balance Final',
          category: 'Categoria',
          consumed: 'Consumado',
          consumedGik: 'GiK Consumido',
          consumedGikTotal: 'Total GiK Consumido',
          consumedPuchases: 'Total de lo comprado consumido',
          consumedPurchasesTotal: 'Total de lo comprado consumido',
          consumedTotal: 'Total consumido',
          errInFinSum: 'Error en _generateFinancialSummaryReport: ',
          errInFindPur: 'Error en _findInventoryItemsByPurchase: ',
          errInFindReq: 'Error en _findInventoryItemsByRequest: ',
          expensesFor: 'Gatos para: ',
          noAccount: '(No Cuenta)',
          subtotal: 'Subtotal: ',
          subtotalFor: 'Subtotal para {{category}} - {{account}}: ',
          total: 'Total: ',
          totalFor: 'Total para {{var}}: ',
          totalPurchases: 'Compras Totales',
          transfer1: '{{quantity}} de {{location}}',
          trasnfer2: 'De: {{source}} A: {{target}}'
        },
        stockTransferDetail: 'Detalle de traslado de stock',
        stockTransferSum: 'Resumen traslado de stock',
        stockUsageDetail: 'Detalle de uso de stock',
        stockUsageSum: 'Resumen uso de stock',
        titleDateRange: '',
        titleSingleDate: ''
      },
      titles: {
        addPurchase: 'Adicionar compra',
        addRequest: 'Nuevo pedido',
        adjustment: 'Ajuste',
        editPurchase: 'Editar compra',
        editRequest: 'Editar pedido',
        inventoryItem: 'Nuevo elemento de inventario',
        inventoryReport: 'Reporte de inventario',
        purchaseSaved: 'Compras de inventario guardadas',
        quickAddTitle: 'Nuevo elemento de inventario',
        removeItem: 'Remover elemento',
        requestFulfilled: 'Pedido cumplido',
        requestUpdated: 'Pedido actualizado',
        transfer: 'Trasladar elementos',
        warning: 'Peligro!!!!!'
      }
    },
    labels: {
      action: 'Accion',
      actions: 'Acciones',
      addNewOutpatientVisit: '--Nueva visita a paciente externo--',
      address: '',
      age: 'Edad',
      allDay: 'Todo el dia',
      amount: '',
      anesthesia: 'Anestesia',
      assisting: 'Asistencia',
      balanceDue: '',
      billDate: '',
      billTo: 'Facturar a',
      category: '',
      completed: 'Completado',
      country: '',
      cptcode: 'Codigo CPT',
      creditTo: '',
      date: 'Fecha',
      dateCompleted: 'Fecha completada',
      dateOfBirth: 'Fecha de nacimiento',
      dateOfBirthShort: 'FDN',
      datePaid: '',
      dateRequested: 'Fecha de pedido',
      'delete': 'Eliminar',
      deleteRequest: 'Eliminar pedido',
      deleteUser: 'Eliminar usuario',
      department: '',
      description: 'Descripción',
      discount: '',
      displayName: 'Nombre para mostrar',
      docRead: 'Leer documento',
      docWritten: 'Documento escrito',
      edit: 'Editar',
      editUser: 'Editar usuario',
      email: 'Email',
      endDate: 'Fecha final',
      endTime: 'Hora de finalización',
      excess: '',
      expenseTo: '',
      fileLoadSuccessful: 'Archivo cargado exitosamente',
      fileName: '',
      fileToLoad: 'Archivo cargado',
      fulfill: 'Cumplomiento',
      fulfillRequest: 'Pedido de cumplimiento',
      fulfillRequestNow: 'Pedido de cumplimiento ahora',
      fulfilled: 'Cumplido',
      grandTotal: '',
      id: 'Id',
      imageOrders: 'Ordenes de radiografias',
      imagingType: 'Tipo de radiografia',
      importFile: 'Importar archivo',
      invoiceId: '',
      labOrders: 'Ordenes de laboratorio',
      lineItems: '',
      loading: 'Cargando',
      location: 'Ubicacion',
      lookupType: 'Tipo de busqueda',
      medication: 'Medicación',
      name: 'Nombre',
      newUser: 'Nuevo usuario',
      note: '',
      notes: 'Notas',
      number: '',
      on: 'on',
      password: 'Contraseña',
      patient: 'Paciente',
      payments: '',
      physician: 'Médico',
      prescriber: '',
      prescription: 'Receta medica',
      prescriptionDate: 'Fecha de la receta medica',
      price: '',
      print: '',
      procedures: 'Procedimiento',
      provider: 'Proveedor',
      pullFrom: 'Traer de',
      quantity: 'Cantidada',
      remarks: '',
      requestedBy: 'Pedido por|',
      requestedOn: 'Pedido On',
      requests: 'Pedido',
      result: 'Resultado',
      results: 'Resultados',
      role: 'Rol',
      search: '',
      sex: 'Genero',
      startDate: 'Fecha de inicio',
      startTime: 'Hora de inicio',
      status: 'Estado',
      takenBy: '',
      total: '',
      type: 'Tipo',
      userCanAddNewValue: 'Los usuarios pueden agregar nuevos valores',
      username: 'Nombre de usuario',
      value: 'Valor',
      view: '',
      visit: 'Visita',
      'with': 'con'
    },
    labs: {
      alerts: {
        requestCompletedMessage: 'El pedido de laboratorio ha sido completado.',
        requestCompletedTitle: 'Pedido de laboratorio competado',
        requestSavedMessage: 'El pedido de laboratorio ha sido guardado.',
        requestSavedTitle: 'Silicitud de laboratorio guardado'
      },
      buttons: { newButton: '+ nuevo laboratorio' },
      completedTitle: 'Completar laboratorio',
      deleteTitle: 'Eliminar pedido',
      editTitle: 'Editar pedido de laboratorio',
      labels: {
        addNewVisit: '--Adicionar nueva visita--',
        labType: 'Tipo de laboratorio'
      },
      messages: {
        createNewRecord: 'Crear un registro?',
        noCompleted: 'No elementos completados encontrados.',
        noItemsFound: 'No boratorios encontrados.'
      },
      newTitle: 'Nuevo pedido de laboratorio',
      requestsTitle: 'Pedido de laboratorio',
      sectionTitle: 'Laboratorios'
    },
    loading: {
      messages: {
        '0': '',
        '1': '',
        '2': '',
        '3': '',
        '4': '',
        '5': '',
        '6': '',
        '7': '',
        '8': '',
        '9': '',
        '10': '',
        '11': ''
      },
      progressBar: { progress: '' }
    },
    login: {
      labels: {
        password: 'Clave',
        signIn: 'Ingresar',
        username: 'Nombre de usuario'
      },
      messages: {
        error: 'Nombre de usuario o clave incorrectos.',
        signIn: 'por favor ingrese'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: 'Pedido de medicación cumplido',
        returnedMessage: 'La medicacion ha sido marcada para devolver.',
        returnedTitle: 'Medicacion devuelta',
        savedMessage: 'La elemento de medicación ha sido guardado.',
        savedTitle: 'Pedido de medicacion guardado'
      },
      buttons: {
        dispenseMedication: 'dispensar medicación',
        newButton: '+ nuevo pedido',
        returnMedication: 'debolver medicacion'
      },
      labels: {
        adjustmentDate: 'Fecha de ajuste',
        creditToAccount: 'Credito a cuenta',
        quantityDispensed: 'Cantidad dispensada',
        quantityDistributed: 'Cantidad distribuida',
        quantityRequested: 'Cantidad solicitada',
        quantityToReturn: 'Cantidad a devolver',
        refills: 'Recargas',
        returnAisle: 'Devolve a pasillo',
        returnLocation: 'Retornar a ubicación',
        returnReason: 'Razon por la que se devuelve/Nota'
      },
      messages: { createNew: 'Crear un nuevo pedido de medicacion?' },
      pageTitle: 'Pedido de medicación',
      returnMedication: 'Retorno de medicación',
      sectionTitle: 'Medication',
      titles: {
        completedMedication: 'Medicacion completada',
        editMedicationRequest: 'Editar pedido de medicacion',
        newMedicationRequest: 'Nuevo pedido de medicacion'
      }
    },
    messages: {
      createNewRecord: 'Crear un nuevo registro?',
      createNewUser: 'Crear un nuevo usuario?',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Este informe es sólo para personas autorizadas.',
      newPatientHasToBeCreated: 'Un nuevo paciente debe ser creado...Por favor espere..',
      noHistoryAvailable: 'Historia no disponible.',
      noItemsFound: 'Elementos no encontrados.',
      noNotesAvailable: 'No hay notas clínicas adicionales están disponibles para esta visita.',
      noUsersFound: 'Ningun usuario encontrado.',
      onBehalfOf: 'a nombre de',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: 'Lo sentimos, un error ha ocurrido...',
      userHasBeenSaved: 'El usuario ha sido salvado.',
      userSaved: 'Usuario salvado'
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: 'Información de HospitalRun',
      actions: {
        login: 'Ingresar',
        logout: 'Salir'
      },
      administration: 'Administracion',
      billing: 'Facturas',
      imaging: 'Radiografia',
      incident: '',
      inventory: 'Inventario',
      labs: 'Laboratorio',
      medication: 'Recetas medicas',
      patients: 'Pacientes',
      scheduling: '',
      subnav: {
        actions: '',
        addAppointment: 'Nueva cita',
        addressFields: 'Campos de dirección',
        admittedPatients: '',
        appointmentSearch: '',
        appointmentsCalendar: '',
        appointmentsThisWeek: '',
        completed: 'Completado',
        currentIncidents: '',
        customForms: '',
        dispense: 'Dispense',
        history: '',
        incidentCategories: '',
        inventoryReceived: 'Inventario recibido',
        invoices: 'Facturas',
        items: 'Items',
        loadDB: '',
        lookupLists: 'Lista de busuedas',
        missedAppointments: '',
        newIncident: '',
        newInvoice: 'Nueva factura',
        newPatient: 'Nuevo paciente',
        newRequest: 'New pedido',
        newUser: 'Nuevo usuario',
        outpatient: '',
        patientListing: 'Lista de pacientes',
        priceProfiles: 'Perfil de precios',
        prices: 'Precios',
        printHeader: '',
        reports: 'Reportes',
        requests: 'Pedidos',
        returnMedication: 'Devolver medicamento',
        scheduleSurgery: '',
        theaterSchedule: '',
        "today'sAppointments": '',
        userRoles: 'Roles',
        users: 'Usuarios',
        workflow: ''
      }
    },
    operationReport: {
      labels: {
        additionalNotes: '',
        assistant: '',
        caseComplexity: '',
        operationDescription: '',
        preOpPrimaryDiagnosis: '',
        preOpSecondaryDiagnosis: '',
        surgeon: '',
        surgeryDate: ''
      },
      messages: { reportSaved: '' },
      titles: {
        editTitle: '',
        newTitle: '',
        reportSaved: ''
      }
    },
    operativePlan: {
      buttons: { completePlan: '' },
      labels: {
        additionalNotes: '',
        admissionInstructions: '',
        caseComplexity: '',
        completedStatus: '',
        droppedStatus: '',
        operationDescription: '',
        plannedStatus: '',
        status: '',
        surgeon: ''
      },
      messages: {
        planCompleted: '',
        planSaved: ''
      },
      titles: {
        editTitle: '',
        newTitle: '',
        planCompleted: '',
        planSaved: ''
      }
    },
    patients: {
      buttons: {
        addContact: '',
        addExpense: '',
        addFamilyMember: '',
        addOperativePlan: '',
        backToPatients: '',
        download: '',
        editOperativePlan: '',
        newAppointment: '',
        newImaging: '',
        newLab: '',
        newMedication: '',
        newPatient: '',
        newPhoto: '',
        newVisit: '',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: '',
        admit: '',
        bloodType: '',
        caption: '',
        civilStatus: '',
        clinic: '',
        contacts: '',
        cost: '',
        dateOfBirth: '',
        dateProcessed: '',
        dischargeDate: '',
        dob: '',
        education: '',
        email: '',
        externalPatientId: '',
        firstName: '',
        income: '',
        insurance: '',
        lastName: '',
        middleName: '',
        monthlyCost: '',
        occupation: '',
        operativePlan: '',
        parent: '',
        patientDays: '',
        patientType: '',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: '',
        placeOfBirth: '',
        primaryDiagnosis: '',
        referredBy: '',
        referredDate: '',
        relationship: '',
        relationships: '',
        religion: '',
        secondaryDiagnosis: '',
        sex: '',
        sexNotEntered: '',
        sources: '',
        status: '',
        totalMontlyExpense: ''
      },
      messages: {
        areYouSureDelete: '',
        createNewPatient: '',
        deletingPatient: '',
        noPatientsFound: '',
        notFoundQuickAdd: '',
        photoFileRequired: '',
        savedPatient: ''
      },
      navigation: {
        appointments: '',
        general: '',
        history: '',
        imaging: '',
        labs: '',
        medication: '',
        photos: '',
        socialWork: '',
        visits: ''
      },
      notes: {
        newNote: '',
        onBehalfOfCopy: 'a nombre de',
        onBehalfOfLabel: 'A nombre de',
        pleaseSelectAVisit: 'Por favor seleccione una visista',
        updateNote: ''
      },
      titles: {
        addContact: '',
        addPhoto: '',
        additionalContacts: '',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': '',
        deleteContact: '',
        deleteExpense: '',
        deleteFamilyMember: '',
        deletePatientRecord: '',
        deletePhoto: '',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: '',
        editPhoto: '',
        expenses: '',
        familyInfo: '',
        familyInformation: '',
        'new': '',
        outpatientsForDate: '',
        patient: '',
        patientListing: '',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: '',
        socialWork: '',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: '',
          billedDate: '',
          dateAdmitted: '',
          dateDischarged: '',
          dischargeNotes: '',
          patientAddress: '',
          patientAge: '',
          patientId: '',
          patientName: '',
          remarks: '',
          spacer: ''
        },
        messages: { whereConducted: '' },
        titles: {
          billingStatement: '',
          patientMember: '',
          patients: '',
          relContact: ''
        }
      } },
    procedures: {
      buttons: { addMedication: '' },
      labels: { medicationUsed: '' },
      messages: { saved: '' },
      titles: {
        addChargeItem: '',
        addMedicationUsed: '',
        deleteChargeItem: '',
        deleteMedicationUsed: '',
        edit: '',
        editChargeItem: '',
        editMedicationUsed: '',
        medicationUsed: '',
        'new': '',
        saved: ''
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '+ nuevo usuario',
      usersPageTile: 'Listado de usuarios'
    },
    visits: {
      buttons: {
        addDiagnosis: '',
        checkIn: '',
        checkOut: '',
        discharge: '',
        newAppointment: '',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: '',
        newVitals: ''
      },
      labels: {
        appointment: '',
        authoredBy: '',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: '',
        examiner: '',
        finalDiagnosis: '',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: '',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: '',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: '',
        visitType: ''
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: '',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: '',
        dbp: '',
        heartRate: '',
        height: '',
        respiratoryRate: '',
        sbp: '',
        temperature: '',
        weight: ''
      } }
  };
});
define('hospitalrun/tests/locales/es-CO/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/es-CO/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/es-CO/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/es/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: 'Texto direccion 1',
        address2Label: 'Texto direccion 2',
        address3Label: 'Texto direccion 3',
        address4Label: 'Texto direccion 4',
        addressLabel: 'Direcciones',
        editTitle: 'Opciones de dirección',
        include1Label: 'Incluir 1',
        include2Label: 'Incluir 2',
        include3Label: 'Incluir 3',
        include4Label: 'Incluir 4',
        messages: { addressSaved: 'las opciones de dirección han sido guardadas' },
        newTitle: 'Opciones de dirección',
        titles: { optionsSaved: 'Opciones guardadas' }
      },
      addressOptions: 'Opciones de direcciones',
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: 'Cargar Base de datos',
      loaddb: {
        displayAlertMessage: 'Por favor seleccione un archivo para ser cargado.',
        displayAlertTitle: 'Seleccione un archivo para cargar',
        editTitle: 'Cargar bd',
        errorDisplayAlertMessage: 'La base de datos no fue cargada el error fue: {{error}}',
        errorDisplayAlertTitle: 'Error cargando',
        progressMessage: 'Por favor espere mientras la base de datos es cargada.',
        progressTitle: 'Cargando ase de datos'
      },
      lookup: {
        aisleLocationList: 'Ubicacion de inventario de pasillo',
        alertImportListMessage: 'Por favor seleccione un archivo para importar.',
        alertImportListSaveMessage: 'Lista de busqueda importada.',
        alertImportListSaveTitle: 'Lista importada',
        alertImportListTitle: 'Seleccione un archivo para importar',
        alertImportListUpdateMessage: 'La lista de busqueda ha sido salvada.',
        alertImportListUpdateTitle: 'Lista salvada',
        anesthesiaTypes: 'Tipos de anestesia',
        anesthesiologists: 'Anestesiologo',
        billingCategories: 'Categorias de facturacion',
        clinicList: 'Ubicacion de las clinicas',
        countryList: 'Paises',
        cptCodeList: 'Codigos CPT',
        diagnosisList: 'Diagnosticos',
        edit: { template: {
            addTitle: 'Adicionar valor',
            editTitle: 'Editar valor',
            labelTitle: 'Valor',
            updateButtonTextAdd: 'Adicionar',
            updateButtonTextUpdate: 'Actualizar'
          } },
        expenseAccountList: 'Cuentas de gastos',
        imagingPricingTypes: 'Tipos de precios de radiografias',
        incidentDepartments: '',
        inventoryTypes: 'Tipos de inventarios',
        labPricingTypes: 'Precios de laboratorio',
        pageTitle: 'Listas de busqueda',
        patientStatusList: 'Lista de estado de pacientes',
        physicianList: 'Medicos',
        procedureList: 'Procedimientos',
        procedureLocations: 'Ubicacion de los procedimientos',
        procedurePricingTypes: 'Tipos de procedimientos y precios',
        radiologists: 'Radiologo',
        titles: { deleteLookupValue: '' },
        unitTypes: 'Tipos de unidad',
        vendorList: 'Proveedor',
        visitLocationList: 'Lugares de visista',
        visitTypes: 'Tipos de visita',
        wardPricingTypes: 'Tipos de las tarifas',
        warehouseList: 'Ubicacciones de inventarios'
      },
      lookupLists: 'Lista de busqueda',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: 'Adicionar cita',
          addBillingDiagnosis: '',
          addCharge: 'Adicionar cargo (valor)',
          addDiagnosis: 'Adicionar diagnostico',
          addImaging: 'Adicionar radiografia',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: 'Adicionar elemento al inventario',
          addInventoryPurchase: 'Adicionar compra',
          addInventoryRequest: 'Pedido de inventario',
          addInvoice: 'Adicionar factura',
          addLab: 'Adicionar laboratorio',
          addMedication: 'Adicionar medicación',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: 'Adicionar paciente',
          addPayment: 'Adicionar pago',
          addPhoto: 'Adicionar foto',
          addPricing: 'Adicionar precio',
          addPricingProfile: 'Adicionar perfil de precios',
          addProcedure: '',
          addSocialwork: '',
          addVisit: 'Adicionar visita',
          addVitals: 'Adicionar partes vitales',
          adjustInventoryLocation: 'Ajustar lugar elemento en el inventario',
          admin: 'Administracion',
          admitPatient: 'Admitir paciente',
          appointments: 'Citas',
          billing: 'Facturacion',
          completeImaging: 'Completar radiografia',
          completeLab: 'Completar laboratorio',
          defineUserRoles: 'Roles de usuario',
          deleteAppointment: 'Eliminar cita',
          deleteDiagnosis: 'Eliminar diagnostico',
          deleteImaging: 'Eliminar radiografia',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: 'Eliminar elemento del inventario',
          deleteInvoice: 'Eliminar factura',
          deleteLab: 'Eliminar laboratorio',
          deleteMedication: 'Eliminar medicación',
          deleteNote: '',
          deletePatient: 'Eliminar paciente',
          deletePhoto: 'Eliminar foto',
          deletePricing: 'Eliminar precio',
          deletePricingProfile: 'Eliminar perfil de precio',
          deleteProcedure: 'Eliminar procedimiento',
          deleteSocialwork: 'Eliminar trabajo social',
          deleteVisit: 'Eliminar visita',
          deleteVitals: 'Eliminar organo vital',
          dischargePatient: 'Descartar paciente',
          editInvoice: 'Editar factura',
          fulfillInventory: 'Cumplimiento de inventario',
          fulfillMedication: 'Cumplir la medicación',
          generateIncidentReport: '',
          imaging: 'Radiografia',
          incident: '',
          inventory: 'Inventario',
          invoices: 'Facturas',
          labs: 'Laboratorios',
          loadDb: 'Cargar base de datos',
          manageIncidents: '',
          medication: 'Medicación',
          overrideInvoice: 'Sobreescribir factura',
          patientReports: 'Reportes por paciente',
          patients: 'Pacientes',
          pricing: 'Precio',
          updateConfig: 'Actualizar configuracion',
          visits: 'Visitas'
        },
        messages: { roleSaved: 'El {{roleName}} rol ha sido salvado.' },
        titles: { roleSaved: 'Role salvado' }
      },
      userRoles: 'Roles',
      users: 'Usuarios',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: '',
        clinicPrepaymentLabel: '',
        editTitle: '',
        followupPrepaymentLabel: '',
        messages: { optionsSaved: '' },
        newTitle: '',
        outpatientImagingLabel: '',
        outpatientLabLabel: '',
        outpatientMedicationLabel: '',
        titles: { optionsSaved: '' },
        workflowLabel: ''
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: 'Por favor espere',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: '' },
      labels: {
        allergyName: '',
        patientAllergy: ''
      },
      titles: {
        addAllergy: '',
        editAllergy: ''
      }
    },
    application: {
      messages: { sessionExpired: '' },
      titles: { sessionExpired: '' }
    },
    appointments: {
      buttons: {
        newButton: '+ nueva cita',
        scheduleSurgery: ''
      },
      calendarTitle: '',
      currentScreenTitle: 'Listado de citas',
      editTitle: 'Editar cita',
      labels: {
        noLocation: '',
        selectedStartingDate: ''
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: 'Seleccione una hora de finalizacion despues de la de inicio.'
      },
      missed: 'Citas perdidas',
      newTitle: 'Nueva cita',
      searchTitle: 'Buscar citas',
      sectionTitle: 'Citas',
      thisWeek: 'Citas esta semana',
      titles: {
        appointmentSaved: '',
        editSurgicalAppointment: '',
        newSurgicalAppointment: '',
        theaterSchedule: ''
      },
      todayTitle: 'Citas para hoy'
    },
    billing: {
      alerts: {
        noInvoiceFound: '',
        noPricingItems: '',
        noPricingProfiles: ''
      },
      buttons: {
        addOverride: '',
        createInvoice: ''
      },
      labels: {
        actualCharges: '',
        discountAmount: '',
        discountPercentage: '',
        externalInvoiceNumber: '',
        hmoCom: '',
        insurance: '',
        paymentProfile: '',
        paymentsDeposits: '',
        pricingPanelOverrides: '',
        pricingProfile: ''
      }
    },
    buttons: {
      add: 'Adicionar',
      addItem: '',
      addLineItem: '',
      addValue: 'Adicionar valor',
      addVisit: 'Adicionar visita',
      allRequests: 'Todas las solicitudes',
      barcode: 'Codigo de barras',
      cancel: 'Cancelar',
      clear: '',
      close: 'Cerrar',
      complete: 'Completado',
      'delete': 'Eliminar',
      dispense: 'Repartir',
      edit: '',
      filter: '',
      fulfill: 'Cumplimiento',
      'import': 'Importar',
      loadFile: 'Cargar archivo',
      newItem: '+ nuevo elemento',
      newNote: 'Nueva nota',
      newRequest: 'Nueva solicitud',
      newRequestPlus: '+ nuevo pedido',
      newUser: 'Nuevo usuario',
      ok: 'Ok',
      remove: 'Remover',
      returnButton: 'Regresar',
      search: 'Buscar',
      showAll: '',
      showFewer: '',
      update: 'Actualizar'
    },
    components: {
      chargesByTypeTab: { charges: '' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '',
        midnight: '',
        noon: '',
        pmHour: ''
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: '' },
      quantityCalc: { result: '' },
      quantityConv: {
        conversion: '',
        unit: ''
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: '',
        how: '',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: '',
        preview: '',
        takePhoto: '',
        uploadFile: ''
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: '' },
      labels: { formToAdd: '' },
      titles: { addCustomForm: '' }
    },
    dashboard: {
      setup: '',
      title: 'Que deseas hacer?'
    },
    dates: {
      'long': '',
      longOmitDays: '',
      longOmitDaysPlural: '',
      longOmitDaysYears: '',
      longOmitYears: '',
      longPlural: '',
      'short': '',
      shortOmitYears: ''
    },
    diagnosis: {
      labels: {
        activeDiagnosis: '',
        date: '',
        diagnosis: '',
        secondaryDiagnosis: ''
      },
      titles: {
        addDiagnosis: '',
        editDiagnosis: ''
      }
    },
    errors: {
      accepted: '',
      blank: '',
      confirmation: '',
      empty: '',
      equalTo: '',
      even: '',
      exclusion: '',
      greaterThan: '',
      greaterThanOrEqualTo: '',
      inclusion: '',
      invalid: '',
      invalidNumber: '',
      lessThan: '',
      lessThanOrEqualTo: '',
      notANumber: '',
      notAnInteger: '',
      odd: '',
      otherThan: '',
      present: '',
      result: '',
      tooLong: '',
      tooShort: '',
      wrongLength: ''
    },
    headings: { chargedItems: '' },
    imaging: {
      alerts: {
        completedMessage: 'El pedido de radiografia ha sido completado.',
        completedTitle: 'Pedido de radiografia completado',
        savedMessage: 'El pedido de radiografia ha sido guardado.',
        savedTitle: 'Pedido de radiografia salvado'
      },
      buttons: { newButton: '+ new radiografia' },
      labels: {
        addNewVisit: '--Adicionar nueva visita--',
        radiologist: 'Radiologo'
      },
      messages: { noCompleted: 'No de items encontrados.' },
      pageTitle: 'Pedido de radriografia',
      sectionTitle: 'Radiografias',
      titles: {
        completedImaging: 'Radiografia completada',
        editTitle: 'Pedido de edicion de radiografia',
        newTitle: 'Nuevo pedido de radiografia'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    inventory: {
      edit: {
        cost: 'Costo por unidad:',
        delivered: 'Enviado A:',
        location: 'Cambio de ubicación:',
        prescription: 'Recetado por:',
        pulled: 'Pulled From:',
        quantity: 'Quantity at Completion:',
        reason: 'Razón:',
        returned: 'Regresado al paciente:',
        transferredFrom: 'Transferido a:',
        transferredTo: 'Transferido a:'
      },
      labels: {
        action: 'Acción',
        add: 'Adicionar',
        addAdjustmentType: '',
        adjust: 'Adjustar',
        adjustmentDate: 'Fecha de ajuste',
        adjustmentFor: 'Ajustado para',
        adjustmentType: 'Tipo de ajuste',
        aisle: 'Pasillo',
        aisleLocation: 'Ubicación pasillo',
        allInventory: 'Todo el inventario',
        allItems: '',
        availableQuantity: '',
        billTo: 'Facturao a',
        consumePurchases: 'Consume Purchases',
        consumptionRate: 'Tasa de consumo',
        cost: 'Costo',
        costPerUnit: 'Costo por Unidad',
        crossReference: 'Referencia cruzada',
        currentQuantity: 'Cantidad actual',
        dateCompleted: 'Fecha completado',
        dateEffective: 'Gecha efectiva',
        dateEnd: 'Fecha final',
        dateReceived: 'Fecha recibido',
        dateStart: 'Fecha inicial',
        dateTransferred: '',
        daysLeft: 'Dias restantes',
        deleteItem: 'Eliminar elemento',
        deliveryAisle: 'Enviado a pasillo',
        deliveryLocation: 'Ubicación del envio',
        details: 'Detalles',
        distributionUnit: 'Unidad de distribución',
        editItem: 'Editar elemento',
        expense: 'Gastos a',
        expirationDate: 'Fecha de vencimiento',
        fulfillRequest: 'Pedido de cumplimiento',
        fulfillRequestNow: 'Pedido de incumplimiento para hoy',
        gift: 'Regalo en especie',
        giftInKindNo: 'N',
        giftInKindYes: 'Y',
        giftUsage: 'Uso del regalo en especie',
        inventoryConsumed: 'Inventario consumido',
        inventoryItem: 'Elemento del inventario',
        inventoryObsolence: 'Obsolescencia de inventario',
        invoiceItems: 'Articulos de factura',
        invoiceLineItem: 'Elemento de la factura linea',
        invoiceNumber: 'Factura numero',
        item: 'Elemento',
        itemNumber: 'Numero de elemento',
        items: 'Elementos',
        location: 'Ubicación',
        locations: 'Ubicaciones',
        markAsConsumed: 'Marcar como consumido',
        name: 'Nombre',
        newItem: 'Nuevo elemento',
        originalQuantity: 'Cantidad original',
        print: 'Imprimir',
        printBarcode: 'Imprimir codigo de  barras',
        printer: 'Impresora',
        pullFrom: 'Traido de',
        purchaseCost: 'Costo de compra',
        purchaseInfo: 'Informacion de la compra',
        purchases: 'Compras',
        quantity: 'Cantidad ({{unit}})',
        quantityAvailable: 'Cantidad disponible',
        quantityOnHand: 'Cantidad a la mano',
        quantityRequested: 'Cantidad pedida',
        rank: 'Ranking',
        reason: 'Razón',
        remove: 'Remover',
        removeAdjustmentType: '',
        reorderPoint: 'Reordenar punto',
        requestedItems: 'Elementos solicitados',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        salePricePerUnit: 'Costo de venta por unidad',
        save: 'Guardar',
        serialNumber: 'Serial/Numero de lote',
        total: 'Total',
        totalCost: 'Costo total',
        totalReceived: 'Total Recivido: {{total}}',
        transaction: 'Transaccion',
        transactions: 'Transacciones',
        transfer: 'Translados',
        transferFrom: 'Translado desde',
        transferTo: 'Translado a ubicación',
        transferToAisle: 'Translado a pasillo',
        unit: 'Unidad',
        unitCost: 'Unidad Costo',
        vendor: 'Proveedor',
        vendorItemNumber: 'Proveedor numero de elemento',
        writeOffAdjustmentType: '',
        xref: 'XRef'
      },
      messages: {
        adjust: 'Por favor ajust las cantidades en la ubicación adecuada(s) la diferencia de la cuenta es {{difference}}.',
        createRequest: 'Crear un nuevo pedido?',
        itemNotFound: 'El elemento del inventario <strong>{{item}}</strong> no se pudo encontrar.<br>Si desea crear un nuevo elemento, Ingrese la información abajo.<br>De lo contrario opria cancelar para volver.',
        loading: 'Cargando transacciones ...',
        noItems: 'No se encontraron elementos.',
        noRequests: 'No se encontraron pedidos.',
        purchaseSaved: 'La compra de inventario ha sido salvada.',
        quantity: 'La cantidad total <strong>({{quantity}})</strong> no encaja con la cantidad total en las ubicaciones <strong>({{locationQuantity}})</strong>.',
        removeItem: 'Esta seguro de eliminar este elemento de la factura?',
        removeItemRequest: 'Seguro que quiere eliminar este elemento del pedido?',
        requestFulfilled: 'El pedido de inventario ha sido procesado.',
        requestUpdated: 'El pedido de inventario ha sido actualizado.',
        warning: 'Valide los campos requeridos (marcados con *) corrija los errores antes de adicionar.'
      },
      reports: {
        adjustment: 'Ajuste detallado',
        daysSupply: 'Dias de inventario restante',
        expenseDetail: 'Gastos detallados',
        expenseSum: 'Resumen de gastos',
        expiration: 'Fecha de expiracion',
        'export': 'Exportar reporte',
        fields: 'Campos a incluir',
        finance: 'Resumen de finanzas',
        generate: 'Generar reporte',
        invLocation: 'Inventario por ubicacion',
        invValuation: 'Inventario por valoracion',
        purchaseDetail: 'Compras detalladas',
        purchaseSum: 'Resumen de compras',
        reportType: 'Tipo de reporte',
        rows: {
          adjustments: 'Ajustes',
          adjustmentsTotal: 'Ajustes totales',
          balanceBegin: 'Balance inicial',
          balanceEnd: 'Balance Final',
          category: 'Categoria',
          consumed: 'Consumado',
          consumedGik: 'GiK Consumido',
          consumedGikTotal: 'Total GiK Consumido',
          consumedPuchases: 'Total de lo comprado consumido',
          consumedPurchasesTotal: 'Total de lo comprado consumido',
          consumedTotal: 'Total consumido',
          errInFinSum: 'Error en _generateFinancialSummaryReport: ',
          errInFindPur: 'Error en _findInventoryItemsByPurchase: ',
          errInFindReq: 'Error en _findInventoryItemsByRequest: ',
          expensesFor: 'Gatos para: ',
          noAccount: '(No Cuenta)',
          subtotal: 'Subtotal: ',
          subtotalFor: 'Subtotal para {{category}} - {{account}}: ',
          total: 'Total: ',
          totalFor: 'Total para {{var}}: ',
          totalPurchases: 'Compras Totales',
          transfer1: '{{quantity}} de {{location}}',
          trasnfer2: 'De: {{source}} A: {{target}}'
        },
        stockTransferDetail: 'Detalle de traslado de stock',
        stockTransferSum: 'Resumen traslado de stock',
        stockUsageDetail: 'Detalle de uso de stock',
        stockUsageSum: 'Resumen uso de stock',
        titleDateRange: '',
        titleSingleDate: ''
      },
      titles: {
        addPurchase: 'Adicionar compra',
        addRequest: 'Nuevo pedido',
        adjustment: 'Ajuste',
        editPurchase: 'Editar compra',
        editRequest: 'Editar pedido',
        inventoryItem: 'Nuevo elemento de inventario',
        inventoryReport: 'Reporte de inventario',
        purchaseSaved: 'Compras de inventario guardadas',
        quickAddTitle: 'Nuevo elemento de inventario',
        removeItem: 'Remover elemento',
        requestFulfilled: 'Pedido cumplido',
        requestUpdated: 'Pedido actualizado',
        transfer: 'Trasladar elementos',
        warning: 'Peligro!!!!!'
      }
    },
    labels: {
      action: 'Accion',
      actions: 'Acciones',
      addNewOutpatientVisit: '--Nueva visita a paciente externo--',
      address: '',
      age: 'Edad',
      allDay: 'Todo el dia',
      amount: '',
      anesthesia: 'Anestesia',
      assisting: 'Asistencia',
      balanceDue: '',
      billDate: '',
      billTo: 'Facturar a',
      category: '',
      completed: 'Completado',
      country: '',
      cptcode: 'Codigo CPT',
      creditTo: '',
      date: 'Fecha',
      dateCompleted: 'Fecha completada',
      dateOfBirth: 'Fecha de nacimiento',
      dateOfBirthShort: 'FDN',
      datePaid: '',
      dateRequested: 'Fecha de pedido',
      'delete': 'Eliminar',
      deleteRequest: 'Eliminar pedido',
      deleteUser: 'Eliminar usuario',
      department: '',
      description: 'Descripción',
      discount: '',
      displayName: 'Nombre para mostrar',
      docRead: 'Leer documento',
      docWritten: 'Documento escrito',
      edit: 'Editar',
      editUser: 'Editar usuario',
      email: 'Email',
      endDate: 'Fecha final',
      endTime: 'Hora de finalización',
      excess: '',
      expenseTo: '',
      fileLoadSuccessful: 'Archivo cargado exitosamente',
      fileName: '',
      fileToLoad: 'Archivo cargado',
      fulfill: 'Cumplomiento',
      fulfillRequest: 'Pedido de cumplimiento',
      fulfillRequestNow: 'Pedido de cumplimiento ahora',
      fulfilled: 'Cumplido',
      grandTotal: '',
      id: 'Id',
      imageOrders: 'Ordenes de radiografias',
      imagingType: 'Tipo de radiografia',
      importFile: 'Importar archivo',
      invoiceId: '',
      labOrders: 'Ordenes de laboratorio',
      lineItems: '',
      loading: 'Cargando',
      location: 'Ubicacion',
      lookupType: 'Tipo de busqueda',
      medication: 'Medicación',
      name: 'Nombre',
      newUser: 'Nuevo usuario',
      note: '',
      notes: 'Notas',
      number: '',
      on: 'on',
      password: 'Contraseña',
      patient: 'Paciente',
      payments: '',
      physician: 'Médico',
      prescriber: '',
      prescription: 'Receta medica',
      prescriptionDate: 'Fecha de la receta medica',
      price: '',
      print: '',
      procedures: 'Procedimiento',
      provider: 'Proveedor',
      pullFrom: 'Traer de',
      quantity: 'Cantidada',
      remarks: '',
      requestedBy: 'Pedido por|',
      requestedOn: 'Pedido On',
      requests: 'Pedido',
      result: 'Resultado',
      results: 'Resultados',
      role: 'Rol',
      search: '',
      sex: 'Genero',
      startDate: 'Fecha de inicio',
      startTime: 'Hora de inicio',
      status: 'Estado',
      takenBy: '',
      total: '',
      type: 'Tipo',
      userCanAddNewValue: 'Los usuarios pueden agregar nuevos valores',
      username: 'Nombre de usuario',
      value: 'Valor',
      view: '',
      visit: 'Visita',
      'with': 'con'
    },
    labs: {
      alerts: {
        requestCompletedMessage: 'El pedido de laboratorio ha sido completado.',
        requestCompletedTitle: 'Pedido de laboratorio competado',
        requestSavedMessage: 'El pedido de laboratorio ha sido guardado.',
        requestSavedTitle: 'Silicitud de laboratorio guardado'
      },
      buttons: { newButton: '+ nuevo laboratorio' },
      completedTitle: 'Completar laboratorio',
      deleteTitle: 'Eliminar pedido',
      editTitle: 'Editar pedido de laboratorio',
      labels: {
        addNewVisit: '--Adicionar nueva visita--',
        labType: 'Tipo de laboratorio'
      },
      messages: {
        createNewRecord: 'Crear un registro?',
        noCompleted: 'No elementos completados encontrados.',
        noItemsFound: 'No boratorios encontrados.'
      },
      newTitle: 'Nuevo pedido de laboratorio',
      requestsTitle: 'Pedido de laboratorio',
      sectionTitle: 'Laboratorios'
    },
    loading: {
      messages: {
        '0': '',
        '1': '',
        '2': '',
        '3': '',
        '4': '',
        '5': '',
        '6': '',
        '7': '',
        '8': '',
        '9': '',
        '10': '',
        '11': ''
      },
      progressBar: { progress: '' }
    },
    login: {
      labels: {
        password: 'Clave',
        signIn: 'Ingresar',
        username: 'Nombre de usuario'
      },
      messages: {
        error: 'Nombre de usuario o clave incorrectos.',
        signIn: 'por favor ingrese'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: 'Pedido de medicación cumplido',
        returnedMessage: 'La medicacion ha sido marcada para devolver.',
        returnedTitle: 'Medicacion devuelta',
        savedMessage: 'La elemento de medicación ha sido guardado.',
        savedTitle: 'Pedido de medicacion guardado'
      },
      buttons: {
        dispenseMedication: 'dispensar medicación',
        newButton: '+ nuevo pedido',
        returnMedication: 'debolver medicacion'
      },
      labels: {
        adjustmentDate: 'Fecha de ajuste',
        creditToAccount: 'Credito a cuenta',
        quantityDispensed: 'Cantidad dispensada',
        quantityDistributed: 'Cantidad distribuida',
        quantityRequested: 'Cantidad solicitada',
        quantityToReturn: 'Cantidad a devolver',
        refills: 'Recargas',
        returnAisle: 'Devolve a pasillo',
        returnLocation: 'Retornar a ubicación',
        returnReason: 'Razon por la que se devuelve/Nota'
      },
      messages: { createNew: 'Crear un nuevo pedido de medicacion?' },
      pageTitle: 'Pedido de medicación',
      returnMedication: 'Retorno de medicación',
      sectionTitle: 'Medication',
      titles: {
        completedMedication: 'Medicacion completada',
        editMedicationRequest: 'Editar pedido de medicacion',
        newMedicationRequest: 'Nuevo pedido de medicacion'
      }
    },
    messages: {
      createNewRecord: 'Crear un nuevo registro?',
      createNewUser: 'Crear un nuevo usuario?',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Este informe es sólo para personas autorizadas.',
      newPatientHasToBeCreated: 'Un nuevo paciente debe ser creado...Por favor espere..',
      noHistoryAvailable: 'Historia no disponible.',
      noItemsFound: 'Elementos no encontrados.',
      noNotesAvailable: 'No hay notas clínicas adicionales están disponibles para esta visita.',
      noUsersFound: 'Ningun usuario encontrado.',
      onBehalfOf: 'a nombre de',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: 'Lo sentimos, un error ha ocurrido...',
      userHasBeenSaved: 'El usuario ha sido salvado.',
      userSaved: 'Usuario salvado'
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: 'Información de HospitalRun',
      actions: {
        login: 'Ingresar',
        logout: 'Salir'
      },
      administration: 'Administracion',
      billing: 'Facturas',
      imaging: 'Radiografia',
      incident: '',
      inventory: 'Inventario',
      labs: 'Laboratorio',
      medication: 'Recetas medicas',
      patients: 'Pacientes',
      scheduling: '',
      subnav: {
        actions: '',
        addAppointment: 'Nueva cita',
        addressFields: 'Campos de dirección',
        admittedPatients: '',
        appointmentSearch: '',
        appointmentsCalendar: '',
        appointmentsThisWeek: '',
        completed: 'Completado',
        currentIncidents: '',
        customForms: '',
        dispense: 'Dispense',
        history: '',
        incidentCategories: '',
        inventoryReceived: 'Inventario recibido',
        invoices: 'Facturas',
        items: 'Items',
        loadDB: '',
        lookupLists: 'Lista de busuedas',
        missedAppointments: '',
        newIncident: '',
        newInvoice: 'Nueva factura',
        newPatient: 'Nuevo paciente',
        newRequest: 'New pedido',
        newUser: 'Nuevo usuario',
        outpatient: '',
        patientListing: 'Lista de pacientes',
        priceProfiles: 'Perfil de precios',
        prices: 'Precios',
        printHeader: '',
        reports: 'Reportes',
        requests: 'Pedidos',
        returnMedication: 'Devolver medicamento',
        scheduleSurgery: '',
        theaterSchedule: '',
        "today'sAppointments": '',
        userRoles: 'Roles',
        users: 'Usuarios',
        workflow: ''
      }
    },
    operationReport: {
      labels: {
        additionalNotes: '',
        assistant: '',
        caseComplexity: '',
        operationDescription: '',
        preOpPrimaryDiagnosis: '',
        preOpSecondaryDiagnosis: '',
        surgeon: '',
        surgeryDate: ''
      },
      messages: { reportSaved: '' },
      titles: {
        editTitle: '',
        newTitle: '',
        reportSaved: ''
      }
    },
    operativePlan: {
      buttons: { completePlan: '' },
      labels: {
        additionalNotes: '',
        admissionInstructions: '',
        caseComplexity: '',
        completedStatus: '',
        droppedStatus: '',
        operationDescription: '',
        plannedStatus: '',
        status: '',
        surgeon: ''
      },
      messages: {
        planCompleted: '',
        planSaved: ''
      },
      titles: {
        editTitle: '',
        newTitle: '',
        planCompleted: '',
        planSaved: ''
      }
    },
    patients: {
      buttons: {
        addContact: '',
        addExpense: '',
        addFamilyMember: '',
        addOperativePlan: '',
        backToPatients: '',
        download: '',
        editOperativePlan: '',
        newAppointment: '',
        newImaging: '',
        newLab: '',
        newMedication: '',
        newPatient: '',
        newPhoto: '',
        newVisit: '',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: '',
        admit: '',
        bloodType: '',
        caption: '',
        civilStatus: '',
        clinic: '',
        contacts: '',
        cost: '',
        dateOfBirth: '',
        dateProcessed: '',
        dischargeDate: '',
        dob: '',
        education: '',
        email: '',
        externalPatientId: '',
        firstName: '',
        income: '',
        insurance: '',
        lastName: '',
        middleName: '',
        monthlyCost: '',
        occupation: '',
        operativePlan: '',
        parent: '',
        patientDays: '',
        patientType: '',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: '',
        placeOfBirth: '',
        primaryDiagnosis: '',
        referredBy: '',
        referredDate: '',
        relationship: '',
        relationships: '',
        religion: '',
        secondaryDiagnosis: '',
        sex: '',
        sexNotEntered: '',
        sources: '',
        status: '',
        totalMontlyExpense: ''
      },
      messages: {
        areYouSureDelete: '',
        createNewPatient: '',
        deletingPatient: '',
        noPatientsFound: '',
        notFoundQuickAdd: '',
        photoFileRequired: '',
        savedPatient: ''
      },
      navigation: {
        appointments: '',
        general: '',
        history: '',
        imaging: '',
        labs: '',
        medication: '',
        photos: '',
        socialWork: '',
        visits: ''
      },
      notes: {
        newNote: '',
        onBehalfOfCopy: 'a nombre de',
        onBehalfOfLabel: 'A nombre de',
        pleaseSelectAVisit: 'Por favor seleccione una visista',
        updateNote: ''
      },
      titles: {
        addContact: '',
        addPhoto: '',
        additionalContacts: '',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': '',
        deleteContact: '',
        deleteExpense: '',
        deleteFamilyMember: '',
        deletePatientRecord: '',
        deletePhoto: '',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: '',
        editPhoto: '',
        expenses: '',
        familyInfo: '',
        familyInformation: '',
        'new': '',
        outpatientsForDate: '',
        patient: '',
        patientListing: '',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: '',
        socialWork: '',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: '',
          billedDate: '',
          dateAdmitted: '',
          dateDischarged: '',
          dischargeNotes: '',
          patientAddress: '',
          patientAge: '',
          patientId: '',
          patientName: '',
          remarks: '',
          spacer: ''
        },
        messages: { whereConducted: '' },
        titles: {
          billingStatement: '',
          patientMember: '',
          patients: '',
          relContact: ''
        }
      } },
    procedures: {
      buttons: { addMedication: '' },
      labels: { medicationUsed: '' },
      messages: { saved: '' },
      titles: {
        addChargeItem: '',
        addMedicationUsed: '',
        deleteChargeItem: '',
        deleteMedicationUsed: '',
        edit: '',
        editChargeItem: '',
        editMedicationUsed: '',
        medicationUsed: '',
        'new': '',
        saved: ''
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '+ nuevo usuario',
      usersPageTile: 'Listado de usuarios'
    },
    visits: {
      buttons: {
        addDiagnosis: '',
        checkIn: '',
        checkOut: '',
        discharge: '',
        newAppointment: '',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: '',
        newVitals: ''
      },
      labels: {
        appointment: '',
        authoredBy: '',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: '',
        examiner: '',
        finalDiagnosis: '',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: '',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: '',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: '',
        visitType: ''
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: '',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: '',
        dbp: '',
        heartRate: '',
        height: '',
        respiratoryRate: '',
        sbp: '',
        temperature: '',
        weight: ''
      } }
  };
});
define('hospitalrun/tests/locales/es/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/es/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/es/translations.js should pass ESLint.\n');
  });
});
define("hospitalrun/tests/locales/fr/translations", ["exports"], function (exports) {
  "use strict";

  exports["default"] = {
    admin: {
      address: {
        address1Label: "Label de l'adresse 1",
        address2Label: "Label de l'adresse 2",
        address3Label: "Label de l'adresse 3",
        address4Label: "Label de l'adresse 4",
        addressLabel: 'Adresse',
        editTitle: "Options d'adresse",
        include1Label: "Label de l'include 1",
        include2Label: "Label de l'include 2",
        include3Label: "Label de l'include 3",
        include4Label: "Label de l'include 4",
        messages: { addressSaved: "Les options d'adresse ont été enregistrées" },
        newTitle: "Options d'adresse",
        titles: { optionsSaved: 'Options enregistrées' }
      },
      addressOptions: "Options d'adresse",
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: 'Importer une BD',
      loaddb: {
        displayAlertMessage: 'Veuillez sélectionner le fichier à télécharger.',
        displayAlertTitle: 'Sélectionner le fichier à télécharger.',
        editTitle: 'Importer une BD',
        errorDisplayAlertMessage: "La base de données ne pouvait pas être importée. L'erreur etait: {{error}}",
        errorDisplayAlertTitle: 'Erreur de chargement',
        progressMessage: 'Veuillez patienter durant le chargement de la base de données.',
        progressTitle: 'Chargement de la base de données en cours'
      },
      lookup: {
        aisleLocationList: "Emplacements de rayon d'inventaire",
        alertImportListMessage: 'Veuillez sélectionner le fichier à importer.',
        alertImportListSaveMessage: 'La liste de référence a été importée.',
        alertImportListSaveTitle: 'Liste importée',
        alertImportListTitle: 'Sélectionner le fichier à importer',
        alertImportListUpdateMessage: 'La liste de référence a été enregistrée.',
        alertImportListUpdateTitle: 'Liste enregistrée',
        anesthesiaTypes: "Types d'Anesthésie",
        anesthesiologists: 'Anesthésiologistes',
        billingCategories: 'Catégories de facturation',
        clinicList: 'Emplacements de la clinique',
        countryList: 'Pays',
        cptCodeList: 'Codes CPT',
        diagnosisList: 'Diagnostics',
        edit: { template: {
            addTitle: 'Ajouter une valeur',
            editTitle: 'Modifier la valeur',
            labelTitle: 'Valeur',
            updateButtonTextAdd: 'Ajouter',
            updateButtonTextUpdate: 'Mettre à jour'
          } },
        expenseAccountList: 'Comptes de dépense',
        imagingPricingTypes: "Types de prix d'imagerie",
        incidentDepartments: '',
        inventoryTypes: "Types d'inventaire",
        labPricingTypes: 'Types de prix de labo',
        pageTitle: 'Listes de référence',
        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',
        titles: { deleteLookupValue: '' },
        unitTypes: "Types d'unité",
        vendorList: 'Fournisseur',
        visitLocationList: 'Emplacements de visite',
        visitTypes: 'Types de visite',
        wardPricingTypes: 'Types de prix de service',
        warehouseList: "Emplacements d'inventaire"
      },
      lookupLists: 'Listes de référence',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: 'Ajouter un Rendez-vous',
          addBillingDiagnosis: '',
          addCharge: 'Ajouter une charge',
          addDiagnosis: 'Ajouter un diagnostic',
          addImaging: 'Ajouter une imagerie',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: "Ajouter un article d'inventaire",
          addInventoryPurchase: "Ajouter un achat d'inventaire",
          addInventoryRequest: "Ajouter une demande d'inventaire",
          addInvoice: 'Ajouter une facture',
          addLab: 'Ajouter un test labo',
          addMedication: 'Ajouter un médicament',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: 'Ajouter un patient',
          addPayment: 'Ajouter un paiement',
          addPhoto: 'Ajouter une photo',
          addPricing: 'Ajouter un Prix',
          addPricingProfile: 'Ajouter le profil de prix',
          addProcedure: '',
          addSocialwork: '',
          addVisit: 'Ajouter une visite',
          addVitals: 'Ajouter les signes vitaux',
          adjustInventoryLocation: "Ajuster la localisation de l'inventaire",
          admin: 'Administration',
          admitPatient: 'Admettre un patient',
          appointments: 'Rendez-vous',
          billing: 'Facturation',
          completeImaging: 'Completer une imagerie',
          completeLab: 'Completer un test labo',
          defineUserRoles: "Rôles d'utilisateur",
          deleteAppointment: 'Supprimer un rendez-vous',
          deleteDiagnosis: 'Supprimer un diagnostic',
          deleteImaging: 'Supprimer une Imagerie',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: "Supprimer un article d'inventaire",
          deleteInvoice: 'Supprimer une facture',
          deleteLab: 'Supprimer un test labo',
          deleteMedication: 'Supprimer un médicament',
          deleteNote: '',
          deletePatient: 'Supprimer un patient',
          deletePhoto: 'Supprimer une photo',
          deletePricing: 'Supprimer un Prix',
          deletePricingProfile: 'Supprimer le profil de prix',
          deleteProcedure: 'Supprimer une procédure',
          deleteSocialwork: 'Supprimer un travail social',
          deleteVisit: 'Supprimer une Visite',
          deleteVitals: 'Supprimer des signes vitaux',
          dischargePatient: 'Liberer un patient',
          editInvoice: 'Modifier la facture',
          fulfillInventory: "Traiter l'inventaire",
          fulfillMedication: 'Traiter une demande de médicaments',
          generateIncidentReport: '',
          imaging: 'Imagerie',
          incident: '',
          inventory: 'Inventaire',
          invoices: 'Factures',
          labs: 'Test Labo',
          loadDb: 'Charger la Base de données',
          manageIncidents: '',
          medication: 'Médicament',
          overrideInvoice: 'Remplacer la facture',
          patientReports: 'Rapports des patients',
          patients: 'Patients',
          pricing: 'Tarification',
          updateConfig: 'Mettre à jour les Configurations',
          visits: 'Visites'
        },
        messages: { roleSaved: 'Le rôle {{roleName}}  a été enregistré.' },
        titles: { roleSaved: 'Rôle enregistré' }
      },
      userRoles: '',
      users: 'Utilisateurs',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: '',
        clinicPrepaymentLabel: '',
        editTitle: '',
        followupPrepaymentLabel: '',
        messages: { optionsSaved: '' },
        newTitle: '',
        outpatientImagingLabel: '',
        outpatientLabLabel: '',
        outpatientMedicationLabel: '',
        titles: { optionsSaved: '' },
        workflowLabel: ''
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: 'Veuillez attendre',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: '' },
      labels: {
        allergyName: '',
        patientAllergy: ''
      },
      titles: {
        addAllergy: '',
        editAllergy: ''
      }
    },
    application: {
      messages: { sessionExpired: '' },
      titles: { sessionExpired: '' }
    },
    appointments: {
      buttons: {
        newButton: '+ nouveau rendez-vous',
        scheduleSurgery: ''
      },
      calendarTitle: '',
      currentScreenTitle: 'Liste des rendez-vous',
      editTitle: 'Modifier le rendez-vous',
      labels: {
        noLocation: '',
        selectedStartingDate: ''
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: "Veuillez sélectionnez une heure de fin plus tard que l'heure de début."
      },
      missed: 'Rendez-vous manqués',
      newTitle: 'Nouveau rendez-vous',
      searchTitle: 'Rechercher les rendez-vous',
      sectionTitle: 'Rendez-vous',
      thisWeek: 'Rendez-vous de la semaine',
      titles: {
        appointmentSaved: '',
        editSurgicalAppointment: '',
        newSurgicalAppointment: '',
        theaterSchedule: ''
      },
      todayTitle: "Rendez-vous d'aujourd'hui"
    },
    billing: {
      alerts: {
        noInvoiceFound: '',
        noPricingItems: '',
        noPricingProfiles: ''
      },
      buttons: {
        addOverride: '',
        createInvoice: ''
      },
      labels: {
        actualCharges: '',
        discountAmount: '',
        discountPercentage: '',
        externalInvoiceNumber: '',
        hmoCom: '',
        insurance: '',
        paymentProfile: '',
        paymentsDeposits: '',
        pricingPanelOverrides: '',
        pricingProfile: ''
      }
    },
    buttons: {
      add: 'Ajouter',
      addItem: '',
      addLineItem: '',
      addValue: 'Ajouter une valeur',
      addVisit: 'Ajouter une visite',
      allRequests: 'Toutes les demandes',
      barcode: 'Code barre',
      cancel: 'Annuler',
      clear: '',
      close: 'Fermer',
      complete: 'Traiter',
      'delete': 'Supprimer',
      dispense: 'Dispenser',
      edit: '',
      filter: '',
      fulfill: 'Traiter',
      'import': 'Importer',
      loadFile: 'Télécharger le fichier',
      newItem: '+ nouvel article',
      newNote: 'Nouvelle note',
      newRequest: 'Nouvelle demande',
      newRequestPlus: '+ nouvelle demande',
      newUser: 'Nouvel utilisateur',
      ok: 'Ok',
      remove: 'Retirer',
      returnButton: 'Retourner',
      search: 'Rechercher',
      showAll: '',
      showFewer: '',
      update: 'Mettre à jour'
    },
    components: {
      chargesByTypeTab: { charges: '' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '',
        midnight: '',
        noon: '',
        pmHour: ''
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: '' },
      quantityCalc: { result: '' },
      quantityConv: {
        conversion: '',
        unit: ''
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: '',
        how: '',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: '',
        preview: '',
        takePhoto: '',
        uploadFile: ''
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: '' },
      labels: { formToAdd: '' },
      titles: { addCustomForm: '' }
    },
    dashboard: {
      setup: '',
      title: 'Que voulez-vous faire?'
    },
    dates: {
      'long': '',
      longOmitDays: '',
      longOmitDaysPlural: '',
      longOmitDaysYears: '',
      longOmitYears: '',
      longPlural: '',
      'short': '',
      shortOmitYears: ''
    },
    diagnosis: {
      labels: {
        activeDiagnosis: '',
        date: '',
        diagnosis: '',
        secondaryDiagnosis: ''
      },
      titles: {
        addDiagnosis: '',
        editDiagnosis: ''
      }
    },
    errors: {
      accepted: '',
      blank: '',
      confirmation: '',
      empty: '',
      equalTo: '',
      even: '',
      exclusion: '',
      greaterThan: '',
      greaterThanOrEqualTo: '',
      inclusion: '',
      invalid: '',
      invalidNumber: '',
      lessThan: '',
      lessThanOrEqualTo: '',
      notANumber: '',
      notAnInteger: '',
      odd: '',
      otherThan: '',
      present: '',
      result: '',
      tooLong: '',
      tooShort: '',
      wrongLength: ''
    },
    headings: { chargedItems: '' },
    imaging: {
      alerts: {
        completedMessage: "La demande d'imagerie a été traitée.",
        completedTitle: "Demande d'imagerie traitée",
        savedMessage: "La demande d'imagerie a été enregistrée.",
        savedTitle: "Demande d'imagerie enregistrée"
      },
      buttons: { newButton: '+ nouvelle imagerie' },
      labels: {
        addNewVisit: '--Ajouter une nouvelle visite--',
        radiologist: 'Radiologiste'
      },
      messages: { noCompleted: 'Aucun article traité retrouvé.' },
      pageTitle: "Demandes d'imagerie",
      sectionTitle: 'Imagerie',
      titles: {
        completedImaging: 'Imagerie traitée',
        editTitle: "Modifier la demande d'imagerie",
        newTitle: "Nouvelle demande d'imagerie"
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    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',
        addAdjustmentType: '',
        adjust: 'Ajuster',
        adjustmentDate: "Date d'ajustement",
        adjustmentFor: 'Ajustement pour',
        adjustmentType: "Type d'ajustement",
        aisle: 'Rayon',
        aisleLocation: 'Emplacement du rayon',
        allInventory: "Toute l'inventaire",
        allItems: '',
        availableQuantity: '',
        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',
        dateReceived: 'Date de réception',
        dateStart: 'Date de debut',
        dateTransferred: 'Date  de transfert',
        daysLeft: 'Nombre de jours restant',
        deleteItem: "Supprimer l'article",
        deliveryAisle: 'Rayon de livraison',
        deliveryLocation: 'Emplacement de livraison',
        details: 'Détails',
        distributionUnit: 'Unité de distribution',
        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',
        giftInKindNo: 'N',
        giftInKindYes: 'O',
        giftUsage: 'Utilisation de don en nature',
        inventoryConsumed: 'Inventaire utilisé',
        inventoryItem: 'Article à inventorier',
        inventoryObsolence: 'Inventory Obsolence',
        invoiceItems: 'Articles de facture',
        invoiceLineItem: 'Article de facture',
        invoiceNumber: 'Numero de facture',
        item: 'Article',
        itemNumber: "Numero d'article",
        items: 'Articles',
        location: 'Emplacement',
        locations: 'Emplacements',
        markAsConsumed: 'Marqué comme utilisé',
        name: 'Nom',
        newItem: 'Nouvel article',
        originalQuantity: 'Quantité originale',
        print: 'Imprimer',
        printBarcode: 'Imprimer le code barre',
        printer: 'Imprimante',
        pullFrom: 'Tirer de',
        purchaseCost: "Coût d'achat",
        purchaseInfo: "Détails de l'achat",
        purchases: 'Achats',
        quantity: 'Quantité ({{unit}})',
        quantityAvailable: 'Quantité disponible',
        quantityOnHand: 'Quantité en main',
        quantityRequested: 'Quantité demandée',
        rank: 'Rang',
        reason: 'Motif',
        remove: 'Retirer',
        removeAdjustmentType: '',
        reorderPoint: 'Point de commande',
        requestedItems: 'Articles demandés',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        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",
        writeOffAdjustmentType: '',
        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?',
        itemNotFound: "L'article d'inventaire <strong>{{item}}</strong> ne pouvait pas être retrouvé.<br>Si vous voulez créer un nouvel article d'inventaire, veuillez saisir les informations ci-dessous. <br>Sinon, appuyez sur le bouton Annuler pour retourner.",
        loading: 'Chargement des transactions en cours…',
        noItems: 'Aucun article retrouvé.',
        noRequests: 'Aucune demande retrouvée.',
        purchaseSaved: "Les achats d'inventaire ont été enregistrés avec succès.",
        quantity: 'La quantité totale de <strong>({{quantity}})</strong> ne correspond pas à la quantité totale dans les emplacements <strong>({{locationQuantity}})</strong>.',
        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: {
        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',
        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}}'
        },
        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",
        titleDateRange: '',
        titleSingleDate: ''
      },
      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!!!!!'
      }
    },
    labels: {
      action: 'Action',
      actions: 'Actions',
      addNewOutpatientVisit: '--Ajouter une nouvelle consultation externe--',
      address: '',
      age: 'Age',
      allDay: 'Toute la journée',
      amount: '',
      anesthesia: 'Anesthésie',
      assisting: 'Assistant',
      balanceDue: '',
      billDate: '',
      billTo: 'Facturer à',
      category: '',
      completed: 'Traité',
      country: '',
      cptcode: 'Code CPT',
      creditTo: '',
      date: 'Date',
      dateCompleted: 'Date de traitement',
      dateOfBirth: 'Date de naissance',
      dateOfBirthShort: 'DdN',
      datePaid: '',
      dateRequested: 'Date de demande',
      'delete': 'Supprimer',
      deleteRequest: 'Supprimer la demande',
      deleteUser: 'Supprimer un utilisateur',
      department: '',
      description: 'Description',
      discount: '',
      displayName: 'Nom à afficher',
      docRead: 'Documents lus',
      docWritten: 'Documents écrits',
      edit: 'Modifier',
      editUser: 'Modifier un utilisateur',
      email: 'Email',
      endDate: 'Date de fin',
      endTime: 'Heure de fin',
      excess: '',
      expenseTo: '',
      fileLoadSuccessful: 'Téléchargement reussi',
      fileName: '',
      fileToLoad: 'Téléchargement de fichier',
      fulfill: 'Traiter',
      fulfillRequest: 'Traiter la demande',
      fulfillRequestNow: 'Traiter la demande maintenant',
      fulfilled: 'Traité',
      grandTotal: '',
      id: 'Id',
      imageOrders: "Demandes d'imagerie",
      imagingType: "Type d'imagerie",
      importFile: 'Importer un fichier',
      invoiceId: '',
      labOrders: 'Demandes de labo',
      lineItems: '',
      loading: 'Chargement',
      location: 'Emplacement',
      lookupType: 'Type de référence',
      medication: 'Médicament',
      name: 'Nom',
      newUser: 'Nouvel utilisateur',
      note: '',
      notes: 'Notes',
      number: '',
      on: 'sur',
      password: 'Mot de passe',
      patient: 'Patient',
      payments: '',
      physician: 'Médecin',
      prescriber: 'prescripteur',
      prescription: 'Ordonnance',
      prescriptionDate: 'Date de prescription',
      price: '',
      print: '',
      procedures: 'Procédures',
      provider: 'Fournisseur',
      pullFrom: 'Tirer de',
      quantity: 'Quantité',
      remarks: '',
      requestedBy: 'Demandé par',
      requestedOn: 'Demandé le',
      requests: 'Demandes',
      result: 'Resultat',
      results: 'Resultats',
      role: 'Rôle',
      search: '',
      sex: 'Sexe',
      startDate: 'Date de debut',
      startTime: 'Heure de debut',
      status: 'Statut',
      takenBy: '',
      total: '',
      type: 'Type',
      userCanAddNewValue: 'Utilisateur peut ajouter de nouvelles valeurs',
      username: "Nom d'utilisateur",
      value: 'Valeur',
      view: '',
      visit: 'Visite',
      'with': 'Avec'
    },
    labs: {
      alerts: {
        requestCompletedMessage: 'La demande de labo a été traitée.',
        requestCompletedTitle: 'Demande de labo traitée',
        requestSavedMessage: 'La demande de labo a été enregistrée.',
        requestSavedTitle: 'Demande de labo enregistrée'
      },
      buttons: { newButton: '+ nouveau labo' },
      completedTitle: 'Labos traités',
      deleteTitle: 'Supprimer la demande',
      editTitle: 'Modifier la demande de labo',
      labels: {
        addNewVisit: '--Ajouter une nouvelle visite--',
        labType: 'Type de labo'
      },
      messages: {
        createNewRecord: 'Créer un nouveau dossier?',
        noCompleted: 'Aucun article traité retrouvé.',
        noItemsFound: 'Aucun labo retrouvé.'
      },
      newTitle: 'Nouvelle demande de labo',
      requestsTitle: 'Demandes de labo',
      sectionTitle: 'Labos'
    },
    loading: {
      messages: {
        '0': '',
        '1': '',
        '2': '',
        '3': '',
        '4': '',
        '5': '',
        '6': '',
        '7': '',
        '8': '',
        '9': '',
        '10': '',
        '11': ''
      },
      progressBar: { progress: '' }
    },
    login: {
      labels: {
        password: 'Mot de passe',
        signIn: 'Connexion',
        username: "Nom d'utilisateur"
      },
      messages: {
        error: "Nom d'utilisateur ou mot de passe est incorrect.",
        signIn: 'veuillez-vous connecter'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: 'Demande de médicament traitée',
        returnedMessage: 'Le médicament a été marqué comme retourné.',
        returnedTitle: 'Médicament retourné',
        savedMessage: 'Le dossier de médicament a été enregistré.',
        savedTitle: 'Demande de médicament enregistrée'
      },
      buttons: {
        dispenseMedication: 'dispenser un médicament',
        newButton: '+ nouvelle demande',
        returnMedication: 'retourner un médicament'
      },
      labels: {
        adjustmentDate: "Date d'ajustement",
        creditToAccount: 'Créditer le compte',
        quantityDispensed: 'Quantité dispensé',
        quantityDistributed: 'Quantité distribué',
        quantityRequested: 'Quantité demandé',
        quantityToReturn: 'Quantité à retourner',
        refills: 'Renouvellements',
        returnAisle: 'Rayon de retour',
        returnLocation: 'Emplacement de retour',
        returnReason: 'Motif/notes du retour'
      },
      messages: { createNew: 'Créer une nouvelle demande de médicament?' },
      pageTitle: 'Demandes de médicament',
      returnMedication: 'Retourner un médicament',
      sectionTitle: 'Médicament',
      titles: {
        completedMedication: 'Médicament traitée',
        editMedicationRequest: 'Modifier une demande de médicament',
        newMedicationRequest: 'Nouvelle demande de médicament'
      }
    },
    messages: {
      createNewRecord: 'Créer un nouveau dossier?',
      createNewUser: 'Créer un nouvel utilisateur?',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Ce rapport est destiné uniquement aux personnes autorisées.',
      newPatientHasToBeCreated: 'Un nouveau patient doit être crée...Veuillez attendre...',
      noHistoryAvailable: 'Aucune historique disponible.',
      noItemsFound: 'Aucun article retrouvé.',
      noNotesAvailable: 'Aucune note clinique supplémentaire disponible pour cette visite.',
      noUsersFound: 'Aucun utilisateur retrouvé.',
      onBehalfOf: 'de la part de',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: 'Désolé, quelque chose a mal tourné ...',
      userHasBeenSaved: "L'utilisateur a été enregistré.",
      userSaved: 'Utilisateur enregistré'
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: 'À propos de HospitalRun',
      actions: {
        login: 'Connexion',
        logout: 'Deconnexion'
      },
      administration: 'Administration',
      billing: 'Facturation',
      imaging: 'Imagerie',
      incident: '',
      inventory: 'Inventaire',
      labs: 'Labos',
      medication: 'Médicament',
      patients: 'Patients',
      scheduling: '',
      subnav: {
        actions: '',
        addAppointment: 'Ajouter un rendez-vous',
        addressFields: "Champs d'adresse",
        admittedPatients: 'patients admis',
        appointmentSearch: '',
        appointmentsCalendar: '',
        appointmentsThisWeek: '',
        completed: 'Traité',
        currentIncidents: '',
        customForms: '',
        dispense: 'Dispenser',
        history: '',
        incidentCategories: '',
        inventoryReceived: 'Inventaire reçu',
        invoices: 'Factures',
        items: 'Articles',
        loadDB: '',
        lookupLists: 'Listes de référence',
        missedAppointments: '',
        newIncident: '',
        newInvoice: 'Nouvelle facture',
        newPatient: 'Nouveau patient',
        newRequest: 'Nouvelle demande',
        newUser: 'Nouvel utilisateur',
        outpatient: '',
        patientListing: 'Liste des patients',
        priceProfiles: 'Profils de prix',
        prices: 'Prix',
        printHeader: '',
        reports: 'Rapports',
        requests: 'Demandes',
        returnMedication: 'Retourner un Médicament',
        scheduleSurgery: '',
        theaterSchedule: '',
        "today'sAppointments": '',
        userRoles: "Rôles de l'utilisateur",
        users: 'Utilisateurs',
        workflow: ''
      }
    },
    operationReport: {
      labels: {
        additionalNotes: '',
        assistant: '',
        caseComplexity: '',
        operationDescription: '',
        preOpPrimaryDiagnosis: '',
        preOpSecondaryDiagnosis: '',
        surgeon: '',
        surgeryDate: ''
      },
      messages: { reportSaved: '' },
      titles: {
        editTitle: '',
        newTitle: '',
        reportSaved: ''
      }
    },
    operativePlan: {
      buttons: { completePlan: '' },
      labels: {
        additionalNotes: '',
        admissionInstructions: '',
        caseComplexity: '',
        completedStatus: '',
        droppedStatus: '',
        operationDescription: '',
        plannedStatus: '',
        status: '',
        surgeon: ''
      },
      messages: {
        planCompleted: '',
        planSaved: ''
      },
      titles: {
        editTitle: '',
        newTitle: '',
        planCompleted: '',
        planSaved: ''
      }
    },
    patients: {
      buttons: {
        addContact: '',
        addExpense: '',
        addFamilyMember: '',
        addOperativePlan: '',
        backToPatients: '',
        download: '',
        editOperativePlan: '',
        newAppointment: '',
        newImaging: '',
        newLab: '',
        newMedication: '',
        newPatient: '',
        newPhoto: '',
        newVisit: '',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: '',
        admit: '',
        bloodType: '',
        caption: '',
        civilStatus: '',
        clinic: '',
        contacts: '',
        cost: '',
        dateOfBirth: '',
        dateProcessed: '',
        dischargeDate: '',
        dob: '',
        education: '',
        email: '',
        externalPatientId: '',
        firstName: '',
        income: '',
        insurance: '',
        lastName: '',
        middleName: '',
        monthlyCost: '',
        occupation: '',
        operativePlan: '',
        parent: '',
        patientDays: '',
        patientType: '',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: '',
        placeOfBirth: '',
        primaryDiagnosis: '',
        referredBy: '',
        referredDate: '',
        relationship: '',
        relationships: '',
        religion: '',
        secondaryDiagnosis: '',
        sex: '',
        sexNotEntered: '',
        sources: '',
        status: '',
        totalMontlyExpense: ''
      },
      messages: {
        areYouSureDelete: '',
        createNewPatient: '',
        deletingPatient: '',
        noPatientsFound: '',
        notFoundQuickAdd: '',
        photoFileRequired: '',
        savedPatient: ''
      },
      navigation: {
        appointments: '',
        general: '',
        history: '',
        imaging: '',
        labs: '',
        medication: '',
        photos: '',
        socialWork: '',
        visits: ''
      },
      notes: {
        newNote: '',
        onBehalfOfCopy: 'de la part de',
        onBehalfOfLabel: 'De la part de',
        pleaseSelectAVisit: 'Veuillez sélectionner une visite',
        updateNote: ''
      },
      titles: {
        addContact: '',
        addPhoto: '',
        additionalContacts: '',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': '',
        deleteContact: '',
        deleteExpense: '',
        deleteFamilyMember: '',
        deletePatientRecord: '',
        deletePhoto: '',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: '',
        editPhoto: '',
        expenses: '',
        familyInfo: '',
        familyInformation: '',
        'new': '',
        outpatientsForDate: '',
        patient: '',
        patientListing: '',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: '',
        socialWork: '',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: '',
          billedDate: '',
          dateAdmitted: '',
          dateDischarged: '',
          dischargeNotes: '',
          patientAddress: '',
          patientAge: '',
          patientId: '',
          patientName: '',
          remarks: '',
          spacer: ''
        },
        messages: { whereConducted: '' },
        titles: {
          billingStatement: '',
          patientMember: '',
          patients: '',
          relContact: ''
        }
      } },
    procedures: {
      buttons: { addMedication: '' },
      labels: { medicationUsed: '' },
      messages: { saved: '' },
      titles: {
        addChargeItem: '',
        addMedicationUsed: '',
        deleteChargeItem: '',
        deleteMedicationUsed: '',
        edit: '',
        editChargeItem: '',
        editMedicationUsed: '',
        medicationUsed: '',
        'new': '',
        saved: ''
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '+ nouvel utilisateur',
      usersPageTile: 'Liste des Utilisateurs'
    },
    visits: {
      buttons: {
        addDiagnosis: '',
        checkIn: '',
        checkOut: '',
        discharge: '',
        newAppointment: '',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: '',
        newVitals: ''
      },
      labels: {
        appointment: '',
        authoredBy: '',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: '',
        examiner: '',
        finalDiagnosis: '',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: '',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: '',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: '',
        visitType: ''
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: '',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: '',
        dbp: '',
        heartRate: '',
        height: '',
        respiratoryRate: '',
        sbp: '',
        temperature: '',
        weight: ''
      } }
  };
});
define('hospitalrun/tests/locales/fr/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/fr/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/fr/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/pt-BR/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      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',
        addressLabel: 'Endereço',
        editTitle: 'Opções de Endereço',
        include1Label: 'Rótulo Include 1',
        include2Label: 'Rótulo Include 2',
        include3Label: 'Rótulo Include 3',
        include4Label: 'Rótulo Include 4',
        messages: { addressSaved: 'As opções de endereço foram salvas' },
        newTitle: 'Opções de Endereço',
        titles: { optionsSaved: 'Opções Salvas' }
      },
      addressOptions: 'Opções de Endereço',
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: 'Carregar DB',
      loaddb: {
        displayAlertMessage: 'Por favor Selecione o Arquivo para Carregar.',
        displayAlertTitle: 'Selecione o Arquivo para Carregar',
        editTitle: 'Carregando BD',
        errorDisplayAlertMessage: 'O banco de dados não foi carregado. O erro foi: {{error}}',
        errorDisplayAlertTitle: 'Erro ao carregar',
        progressMessage: 'Por favor aguarde enquanto o seu banco de dados é carregado.',
        progressTitle: 'Carregando Banco de Dados'
      },
      lookup: {
        aisleLocationList: 'Localização de Corredores no Inventário',
        alertImportListMessage: 'Por favor Selecione o arquivo para importação.',
        alertImportListSaveMessage: 'A lista de pesquisa foi importada.',
        alertImportListSaveTitle: 'Lista Importdada',
        alertImportListTitle: 'Selecione o arquivo para importação',
        alertImportListUpdateMessage: 'A lista de pesquisa foi salva.',
        alertImportListUpdateTitle: 'Lista Salva',
        anesthesiaTypes: 'Tipos de Anestesia',
        anesthesiologists: 'Anestesiologista',
        billingCategories: 'Categorias de Faturamento',
        clinicList: 'Localização de Clínicas',
        countryList: 'Países',
        cptCodeList: 'Códigos CPT',
        diagnosisList: 'Diagnósticos',
        edit: { template: {
            addTitle: 'Adicionar Valor',
            editTitle: 'Editar Valor',
            labelTitle: 'Valor',
            updateButtonTextAdd: 'Adicionar',
            updateButtonTextUpdate: 'Atualizar'
          } },
        expenseAccountList: 'Contas de Despesas',
        imagingPricingTypes: 'Tipos de Preço Imagem',
        incidentDepartments: '',
        inventoryTypes: 'Tipos de Inventário',
        labPricingTypes: 'Tipos de Preço Laboratório',
        pageTitle: 'Listas de Pesquisa',
        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',
        titles: { deleteLookupValue: '' },
        unitTypes: 'Tipos de Unidade',
        vendorList: 'Fornecedor',
        visitLocationList: 'Localização dos Visitantes',
        visitTypes: 'Tipos de Visita',
        wardPricingTypes: 'Tipos de Preços Enfermaria',
        warehouseList: 'Locais de Inventário'
      },
      lookupLists: 'Lista de Pesquisas',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: 'Adicionar Compromissos',
          addBillingDiagnosis: '',
          addCharge: 'Adicionar Cobrança',
          addDiagnosis: 'Adicionar Diagnóstico',
          addImaging: 'Adicionar Imagem',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: 'Adicionar Item de Inventário',
          addInventoryPurchase: 'Adicionar Compra de Inventário',
          addInventoryRequest: 'Adicionar Requisição de Inventário',
          addInvoice: 'Adicionar Fatura',
          addLab: 'Adicionar Laboratório',
          addMedication: 'Adicionar Medicação',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: 'Adicionar Paciente',
          addPayment: 'Adicionar Pagamentos',
          addPhoto: 'Adicionar Foto',
          addPricing: 'Adicionar Preço',
          addPricingProfile: 'Adicionar Perfil de Preço',
          addProcedure: 'Adicionar Procedimento',
          addSocialwork: '',
          addVisit: 'Adicionar Visita',
          addVitals: 'Adicionar Sinais Vitais',
          adjustInventoryLocation: 'Ajustar Localização de Inventário',
          admin: 'Administração',
          admitPatient: 'Admitir Paciente',
          appointments: 'Compromissos',
          billing: 'Faturamentos',
          completeImaging: 'Imagem Concluída',
          completeLab: 'Laboratório Concluído',
          defineUserRoles: 'Perfis de Usuários',
          deleteAppointment: 'Excluir Compromisso',
          deleteDiagnosis: 'Excluir Diagnóstico',
          deleteImaging: 'Excluir Imagem',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: 'Excluir Item de Inventário',
          deleteInvoice: 'Excluir Fatura',
          deleteLab: 'Excluir Laboratório',
          deleteMedication: 'Excluir Medicação',
          deleteNote: '',
          deletePatient: 'Excluir Paciente',
          deletePhoto: 'Excluir Paciente',
          deletePricing: 'Excluir Preço',
          deletePricingProfile: 'Excluir Perfil de Preço',
          deleteProcedure: 'Excluir Procedimento',
          deleteSocialwork: 'Excluir Trabalho Social',
          deleteVisit: 'Excluir Visita',
          deleteVitals: 'Excluir Sinais Vitais',
          dischargePatient: 'Alta do Paciente',
          editInvoice: 'Editar Fatura',
          fulfillInventory: 'Preencher Inventário',
          fulfillMedication: 'Preencher Medicação',
          generateIncidentReport: '',
          imaging: 'Imagem',
          incident: '',
          inventory: 'Inventário',
          invoices: 'Faturas',
          labs: 'Laboratório',
          loadDb: 'Carregar Banco de Dados',
          manageIncidents: '',
          medication: 'Medicação',
          overrideInvoice: 'Substituir Fatura',
          patientReports: 'Relatório do Paciente',
          patients: 'Pacientes',
          pricing: 'Preço',
          updateConfig: 'Atualizar Configurações',
          visits: 'Visita'
        },
        messages: { roleSaved: 'O perfil {{roleName}} foi salvo.' },
        titles: { roleSaved: 'Perfil Salvo' }
      },
      userRoles: 'Perfis de Usuários',
      users: 'Usuários',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: 'Depósito de Admissão é exigido',
        clinicPrepaymentLabel: 'Pagamento Antecipado da Clínica é exigido',
        editTitle: 'Opções de Workflow',
        followupPrepaymentLabel: 'Pagamento Antecipado do Acompanhamento é exigido',
        messages: { optionsSaved: 'As opções de WorkFlow foram salvas' },
        newTitle: 'Opções de Workflow',
        outpatientImagingLabel: 'Pagamento Antecipado do Ambulatorio de Imagem é exigido',
        outpatientLabLabel: 'Pagamento Antecipado do Laboratório Ambulatorial é exigido',
        outpatientMedicationLabel: 'Pagamento Antecipado do Ambulatorio de Medicação é exigido',
        titles: { optionsSaved: 'Opções Salvas' },
        workflowLabel: 'Workflow'
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: 'Por Favor Aguarde',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: 'Adicionar alergia' },
      labels: {
        allergyName: 'Nome',
        patientAllergy: 'Alergias do paciente'
      },
      titles: {
        addAllergy: 'Adicionar alergia',
        editAllergy: 'Editar alergia'
      }
    },
    application: {
      messages: { sessionExpired: 'Sua sessaão expirou. Faça login para continuar.' },
      titles: { sessionExpired: 'Sessaão expirada' }
    },
    appointments: {
      buttons: {
        newButton: '+ novo compromisso',
        scheduleSurgery: '+ nova cirurgia'
      },
      calendarTitle: 'Compromissos',
      currentScreenTitle: 'Lista de Compromisso',
      editTitle: 'Editar Compromisso',
      labels: {
        noLocation: 'Sem Localização',
        selectedStartingDate: 'Mostrar Compromisso em ou após'
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: 'Por favor, selecione um horário de término mais tarde do que a hora de início.'
      },
      missed: 'Compromissos Esquecidos',
      newTitle: 'Novo Compromisso',
      searchTitle: 'Pesquisar Compromissos',
      sectionTitle: 'Compromissos',
      thisWeek: 'Compromissos dessa Semana',
      titles: {
        appointmentSaved: 'Compromisso Salvo',
        editSurgicalAppointment: 'Editar cirurgia',
        newSurgicalAppointment: 'Nova cirurgia',
        theaterSchedule: 'Cirurgias'
      },
      todayTitle: 'Compromissos de Hoje'
    },
    billing: {
      alerts: {
        noInvoiceFound: 'Nenhuma fatura encontrada',
        noPricingItems: 'Nenhum item de preço encontrado.',
        noPricingProfiles: 'Nenhum perfil de preço encontrado.'
      },
      buttons: {
        addOverride: 'Adicionar Substituir',
        createInvoice: 'Criar nova fatura?'
      },
      labels: {
        actualCharges: 'Cobranças Atuais',
        discountAmount: 'Quantidade de Desconto',
        discountPercentage: 'Porcentagem de Desconto',
        externalInvoiceNumber: 'Fatura Externa #',
        hmoCom: 'HMO/COM',
        insurance: 'Seguro Nacional',
        paymentProfile: 'Perfil de Pagamento',
        paymentsDeposits: 'Pagamentos/Depositos',
        pricingPanelOverrides: 'Substituição e Perfil de Preços',
        pricingProfile: 'Perfil de Preços'
      }
    },
    buttons: {
      add: 'Adicionar',
      addItem: 'Adicionar Item',
      addLineItem: 'Adicionar Item de Linha',
      addValue: 'Adicionar Valor',
      addVisit: 'Adicionar Visita',
      allRequests: 'Todas as Requisições',
      barcode: 'Código de Barras',
      cancel: 'Cancelar',
      clear: 'Limpar',
      close: 'Fechar',
      complete: 'Completo',
      'delete': 'Excluir',
      dispense: 'Dispensar',
      edit: 'Editar',
      filter: 'Filtrar',
      fulfill: 'Preencher',
      'import': 'Importar',
      loadFile: 'Carregar Arquivo',
      newItem: '+ novo item',
      newNote: 'Nova Nota',
      newRequest: 'Nova Requisição',
      newRequestPlus: '+ nova requisição',
      newUser: 'Novo Usuário',
      ok: 'Ok',
      remove: 'Remover',
      returnButton: 'Retornar',
      search: 'Pesquisa',
      showAll: '',
      showFewer: '',
      update: 'Atualizar'
    },
    components: {
      chargesByTypeTab: { charges: 'cobranças' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '{{hour}} AM',
        midnight: 'Meia-noite',
        noon: 'Meio-dia',
        pmHour: '{{hour}} PM'
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: 'cobranças de {{pricingType}}' },
      quantityCalc: { result: '{{targetUnit}} total: {{calculated}}' },
      quantityConv: {
        conversion: 'O que significa contém 1 {{name}}?',
        unit: 'Unidade'
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: 'Câmera',
        how: 'Como você quer adicionar um Foto?',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: 'foto',
        preview: 'pré visualização',
        takePhoto: 'Tirar um Foto',
        uploadFile: 'Upload de Arquivo'
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: 'Adicionar formulário' },
      labels: { formToAdd: 'Formulário para adicionar' },
      titles: { addCustomForm: 'Adicionar formulário customisado' }
    },
    dashboard: {
      setup: '',
      title: 'O que você gostaria de fazer?'
    },
    dates: {
      'long': '{{years}} ano {{months}} meses {{days}} dias',
      longOmitDays: '{{years}} ano {{months}} meses',
      longOmitDaysPlural: '{{years}} anos {{months}} meses',
      longOmitDaysYears: '{{months}} meses',
      longOmitYears: '{{months}} meses {{days}} dias',
      longPlural: '{{years}} anos {{months}} meses {{days}} dias',
      'short': '{{years}}y {{months}}m {{days}}d',
      shortOmitYears: '{{months}}m {{days}}d'
    },
    diagnosis: {
      labels: {
        activeDiagnosis: 'Diagnóstico ativo',
        date: 'Data',
        diagnosis: 'Diagnóstico',
        secondaryDiagnosis: 'Diagnóstico secundário'
      },
      titles: {
        addDiagnosis: 'Adicionar diagnóstico',
        editDiagnosis: 'Editar diagnóstico'
      }
    },
    errors: {
      accepted: 'deve ser aceito',
      blank: 'não pode ser branco',
      confirmation: '{{attribute}} não corresponde',
      empty: 'não pode ser vazio',
      equalTo: 'deve ser igual à {{count}}',
      even: 'deve ser até',
      exclusion: 'é reservado',
      greaterThan: 'deve ser maior do que {{count}}',
      greaterThanOrEqualTo: 'deve ser maior ou igual à {{count}}',
      inclusion: 'não está na lista',
      invalid: 'é inválido',
      invalidNumber: 'número não é valido',
      lessThan: 'deve ser menor do que {{count}}',
      lessThanOrEqualTo: 'deve ser menor ou igual à {{count}}',
      notANumber: 'não é um número',
      notAnInteger: 'deve ser um número inteiro',
      odd: 'deve ser ímpar',
      otherThan: 'deve ser diferente de {{count}}',
      present: 'pode ser branco',
      result: 'Informe um resultado antes de concluir',
      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)'
    },
    headings: { chargedItems: 'Itens Carregados' },
    imaging: {
      alerts: {
        completedMessage: 'A requisição de imagem esta completa.',
        completedTitle: 'Requisição de Imagem Completa',
        savedMessage: 'A requisição de imagem foi salva.',
        savedTitle: 'Requisição de imagem salva'
      },
      buttons: { newButton: '+ nova imagem' },
      labels: {
        addNewVisit: '--Adicionar novo visitante--',
        radiologist: 'Radiologista'
      },
      messages: { noCompleted: 'Nenhum item completo encontrado.' },
      pageTitle: 'Requisição de imagens',
      sectionTitle: 'Imagem',
      titles: {
        completedImaging: 'Imagem completa',
        editTitle: 'Requisição de edição de imagem',
        newTitle: 'Nova requisição de imagem'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    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',
        addAdjustmentType: '',
        adjust: 'Ajustar',
        adjustmentDate: 'Data de Ajuste',
        adjustmentFor: 'Ajuste Para',
        adjustmentType: 'Tipo de Ajuste',
        aisle: 'Corredor',
        aisleLocation: 'Localização do Corredor',
        allInventory: 'Todo Inventário',
        allItems: 'Todos os Itens',
        availableQuantity: '',
        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',
        dateReceived: 'Data Recebida',
        dateStart: 'Data de Início',
        dateTransferred: 'Data Transferida',
        daysLeft: 'Dias Restantes',
        deleteItem: 'Deletar Item',
        deliveryAisle: 'Corredor de Entrega',
        deliveryLocation: 'Local de Entrega',
        details: 'Detalhes',
        distributionUnit: 'Centro de Distribuição',
        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',
        giftInKindNo: 'N',
        giftInKindYes: 'S',
        giftUsage: 'Uso de Doação em Espécie',
        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',
        itemNumber: 'Número de Item',
        items: 'Itens',
        location: 'Localização',
        locations: 'Localizações',
        markAsConsumed: 'Marcar como Consumido',
        name: 'Nome',
        newItem: 'Novo Item',
        originalQuantity: 'Quantidade Original',
        print: 'Imprimir',
        printBarcode: 'Imprimir Código Barras',
        printer: 'Impressora',
        pullFrom: 'Retirar de',
        purchaseCost: 'Custo da Compra',
        purchaseInfo: 'Informações da Compra',
        purchases: 'Compras',
        quantity: 'Quantity ({{unit}})',
        quantityAvailable: 'Quantity Available',
        quantityOnHand: 'Quantidade on Hand',
        quantityRequested: 'Quantidade Solicitada',
        rank: 'Classificação',
        reason: 'Motivo',
        remove: 'Remover',
        removeAdjustmentType: '',
        reorderPoint: 'Ponto de Reabastecimento',
        requestedItems: 'Itens Solicitados',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        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',
        writeOffAdjustmentType: '',
        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?',
        itemNotFound: 'O item de inventário <strong>{{item}}</strong> não pode ser encontrado.<br>Se você quiser criar um novo item de inventário, preencha as informações abaixo.<br>Caso o contrário, pressione o botão Cancelar para voltar.',
        loading: 'Carregando transações ...',
        noItems: 'Nenhum item encontrado.',
        noRequests: 'Nenhuma requisição encontrada.',
        purchaseSaved: 'As compras de inventário foram salvas com sucesso.',
        quantity: 'A quantidade total de <strong>({{quantity}})</strong> não corresponde com a quantidade total nas localizações<strong>({{locationQuantity}})</strong>.',
        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: {
        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',
        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}}'
        },
        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',
        titleDateRange: '',
        titleSingleDate: ''
      },
      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!!!!!'
      }
    },
    labels: {
      action: 'Ação',
      actions: 'Ações',
      addNewOutpatientVisit: '--Adicionar Nova Visita Ambulatorial--',
      address: 'Endereço',
      age: 'Idade',
      allDay: 'Todo Dia',
      amount: 'Quantidade',
      anesthesia: 'Anestesia',
      assisting: 'Ajudante',
      balanceDue: 'Saldo Devedor',
      billDate: 'Data da Conta',
      billTo: 'Conta Para',
      category: 'Categoria',
      completed: 'Completo',
      country: 'País',
      cptcode: 'Código CPT*',
      creditTo: 'Crédito Para',
      date: 'Data',
      dateCompleted: 'Data da Conclusão',
      dateOfBirth: 'Data de Nascimento',
      dateOfBirthShort: 'DtNasc',
      datePaid: 'Data de Pagamento',
      dateRequested: 'Data da Requisição',
      'delete': 'Excluir',
      deleteRequest: 'Excluir Requisição',
      deleteUser: 'Excluir Usuário',
      department: 'Departamento',
      description: 'Descrição',
      discount: 'Desconto',
      displayName: 'Nome de Exibição',
      docRead: 'Documentos Lidos',
      docWritten: 'Documentos Escritos',
      edit: 'Editar',
      editUser: 'Editar Usuário',
      email: 'Email',
      endDate: 'Data de Término',
      endTime: 'Hora de Término',
      excess: 'Excesso',
      expenseTo: 'Despesa Para',
      fileLoadSuccessful: 'Arquivo Carregado com Sucesso',
      fileName: '',
      fileToLoad: 'Carregar Arquivo',
      fulfill: 'Preencha',
      fulfillRequest: 'Preencha a Requisição',
      fulfillRequestNow: 'Preencha a Requisição Agora',
      fulfilled: 'Preenchido',
      grandTotal: 'Total Geral',
      id: 'Id',
      imageOrders: 'Pedido de Imagem',
      imagingType: 'Tipo de Imagem',
      importFile: 'Importar Arquivo',
      invoiceId: 'ID da Fatura',
      labOrders: 'Pedidos de Laboratório',
      lineItems: 'Itens de Linha',
      loading: 'Carregando',
      location: 'Localização',
      lookupType: 'Tipo de Pesquisa',
      medication: 'Medicação',
      name: 'Nome',
      newUser: 'Novo Usuário',
      note: 'Note',
      notes: 'Notas',
      number: 'Número',
      on: 'ligado',
      password: 'Senha',
      patient: 'Paciente',
      payments: 'Pagamentos',
      physician: 'Médico',
      prescriber: 'Médico Responsável pela Prescrição',
      prescription: 'Prescrição',
      prescriptionDate: 'Data da Prescrição',
      price: 'Preço',
      print: '',
      procedures: 'Procedimentos',
      provider: 'Fornecedor',
      pullFrom: 'Puxar De',
      quantity: 'Quantidade',
      remarks: 'Observações',
      requestedBy: 'Requisitado por',
      requestedOn: 'Solicitado em',
      requests: 'Requisições',
      result: 'Resultado',
      results: 'Resultados',
      role: 'Papel',
      search: 'Pesquisa',
      sex: 'Sexo',
      startDate: 'Data de Início',
      startTime: 'Hora Início',
      status: 'Situação',
      takenBy: '',
      total: 'Total',
      type: 'Tipo',
      userCanAddNewValue: 'O usuário pode adicionar novos valores',
      username: 'Usuário',
      value: 'Valor',
      view: '',
      visit: 'Visita',
      'with': 'Com'
    },
    labs: {
      alerts: {
        requestCompletedMessage: 'Requisição de laboratório foi concluída.',
        requestCompletedTitle: 'Requisições de Laboratório Concluída',
        requestSavedMessage: 'A requisição de laboratório foi salva.',
        requestSavedTitle: 'Requisição de Laboratório Salva'
      },
      buttons: { newButton: '+ novo laboratório' },
      completedTitle: 'Laboratórios Concluídos',
      deleteTitle: 'Excluir Requisição',
      editTitle: 'Editar Requisição de Laboratório',
      labels: {
        addNewVisit: '--Adicionar Nova Visita--',
        labType: 'Tipo de Laboratório'
      },
      messages: {
        createNewRecord: 'Criar novo registro?',
        noCompleted: 'Items concluídos não econtrados.',
        noItemsFound: 'Nenhum laboratório encontrado.'
      },
      newTitle: 'Nova Requisição de Laboratório',
      requestsTitle: 'Requisições de Laboratório',
      sectionTitle: 'Laboratório'
    },
    loading: {
      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.'
      },
      progressBar: { progress: '{{progressBarValue}}% concluído' }
    },
    login: {
      labels: {
        password: 'Senha',
        signIn: 'Entrar',
        username: 'Usuário'
      },
      messages: {
        error: 'Nome de usuário ou senha está incorreta.',
        signIn: 'Entrar'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: 'Requisição de Medicação Preenchido',
        returnedMessage: 'A medicação foi marcada como retornada.',
        returnedTitle: 'Medicação Retornada',
        savedMessage: 'O registro de medicação foi salvo.',
        savedTitle: 'Requisição de Medicação foi Salva'
      },
      buttons: {
        dispenseMedication: 'dispensar medicação',
        newButton: '+ nova requisição',
        returnMedication: 'retorno de medicação'
      },
      labels: {
        adjustmentDate: 'Data de Ajuste',
        creditToAccount: 'Crédito na Conta',
        quantityDispensed: 'Quantidade Dispensada',
        quantityDistributed: 'Quantidade Distribuída',
        quantityRequested: 'Quantidade Requisitada',
        quantityToReturn: 'Quantidade Retornada',
        refills: 'Recargas',
        returnAisle: 'Corredor de Retorno',
        returnLocation: 'Localização de Retorno',
        returnReason: 'Razão/Notas de Retorno'
      },
      messages: { createNew: 'Criar uma nova requisição de medicação?' },
      pageTitle: 'Requisição de Medicação',
      returnMedication: 'Retorno de Medicação',
      sectionTitle: 'Medicação',
      titles: {
        completedMedication: 'Medicação Concluída',
        editMedicationRequest: 'Editar Requisição de Medicação',
        newMedicationRequest: 'Nova Requisição de Medicação'
      }
    },
    messages: {
      createNewRecord: 'Criar uma nova gravação?',
      createNewUser: 'Criar um novo usuário?',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Este relatório é somente para pessoas autorizadas.',
      newPatientHasToBeCreated: 'Um novo paciente precisa ser criado... Por favor aguarde...',
      noHistoryAvailable: 'Histórico não disponível.',
      noItemsFound: 'Nenhum item encontrado',
      noNotesAvailable: 'Nenhuma nota clinica adicional está diponível para essa visita.',
      noUsersFound: 'Nenhum usuário encontrado.',
      onBehalfOf: 'em nome de',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: 'Desculpe, algo deu errado...',
      userHasBeenSaved: 'O usuário foi salvo.',
      userSaved: 'Usuário Salvo'
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: 'Sobre HospitalRun',
      actions: {
        login: 'Entrar',
        logout: 'Sair'
      },
      administration: 'Administração',
      billing: 'Faturamento',
      imaging: 'Imagem',
      incident: '',
      inventory: 'Inventário',
      labs: 'Laboratórios',
      medication: 'Medicação',
      patients: 'Pacientes',
      scheduling: 'Agenda',
      subnav: {
        actions: 'Ações',
        addAppointment: 'Adicionar Compromisso',
        addressFields: 'Campos de Endereço',
        admittedPatients: 'Pacientes Admitidos',
        appointmentSearch: 'Pesquisar compromissos',
        appointmentsCalendar: 'Compromissos',
        appointmentsThisWeek: 'Compromissos dessa Semana',
        completed: 'Concluídos',
        currentIncidents: '',
        customForms: 'Formulários customisados',
        dispense: 'Dispensar',
        history: '',
        incidentCategories: '',
        inventoryReceived: 'Inventário Recebido',
        invoices: 'Faturas',
        items: 'Itens',
        loadDB: 'Carregar BD',
        lookupLists: 'Listas de Pesquisa',
        missedAppointments: 'Compromissos Esquecidos',
        newIncident: '',
        newInvoice: 'Nova Fatura',
        newPatient: 'Novo Paciente',
        newRequest: 'Nova Requisição',
        newUser: 'Novo Usuário',
        outpatient: 'Ambulatório',
        patientListing: 'Lista de Pacientes',
        priceProfiles: 'Perfis de Preços',
        prices: 'Preços',
        printHeader: '',
        reports: 'Relatórios',
        requests: 'Requisições',
        returnMedication: 'Retorno de Medicação',
        scheduleSurgery: 'Agendar Cirurgia',
        theaterSchedule: 'Agenda de Cirurgias',
        "today'sAppointments": 'Compromissos de Hoje',
        userRoles: 'Perfis de Usuário',
        users: 'Usuários',
        workflow: 'Workflow'
      }
    },
    operationReport: {
      labels: {
        additionalNotes: 'Notas adicionais',
        assistant: 'Assistente',
        caseComplexity: 'Complexidade do caso',
        operationDescription: 'Descriçaão da operaçaão',
        preOpPrimaryDiagnosis: 'Pre-op diagnóstico primário',
        preOpSecondaryDiagnosis: 'Pre-op diagnóstico secundário',
        surgeon: 'Cirurgião',
        surgeryDate: 'Data da cirurgia'
      },
      messages: { reportSaved: 'O relatório da operação foi salvo.' },
      titles: {
        editTitle: 'Editar relatório de operação',
        newTitle: 'Novo relatório da operação',
        reportSaved: 'Relatório salvo'
      }
    },
    operativePlan: {
      buttons: { completePlan: 'Plano completo' },
      labels: {
        additionalNotes: 'Notas adicionais',
        admissionInstructions: 'Instruções após admissaão',
        caseComplexity: 'Complexidade do caso',
        completedStatus: 'Completo',
        droppedStatus: 'Desistiu',
        operationDescription: 'Descriçaão da operação',
        plannedStatus: 'Planejado',
        status: 'Estado',
        surgeon: 'Cirurgião'
      },
      messages: {
        planCompleted: 'O plano de operação foi concluído. Agora você será direcionado para o relatório de operação.',
        planSaved: 'O plano de operação foi salvo.'
      },
      titles: {
        editTitle: 'Editar plano de operação',
        newTitle: 'Novo plano de operação',
        planCompleted: 'Plano completo',
        planSaved: 'Plano salvo'
      }
    },
    patients: {
      buttons: {
        addContact: 'Adicionar Contato',
        addExpense: 'Adicionar Despesa',
        addFamilyMember: 'Adicionar Membro Familiar',
        addOperativePlan: '',
        backToPatients: 'Voltar para Lista de Pacientes',
        download: '',
        editOperativePlan: '',
        newAppointment: 'Novo Compromisso',
        newImaging: 'Nova Imagem',
        newLab: 'Novo Laboratório',
        newMedication: 'Nova Medicação',
        newPatient: '+ novo paciente',
        newPhoto: 'Nova Foto',
        newVisit: 'Nova Visita',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: 'Data de Admissão',
        admit: 'Admitir',
        bloodType: 'Tipo Sanguíneo',
        caption: '',
        civilStatus: 'Estado Civil',
        clinic: 'Site(Filial) da Clínica',
        contacts: '',
        cost: 'Custo',
        dateOfBirth: 'Data de Nascimento',
        dateProcessed: 'Data de Processamento',
        dischargeDate: 'Data de Pagamento',
        dob: 'DatNasc',
        education: 'Educação',
        email: 'Email',
        externalPatientId: 'ID de Paciente Externo',
        firstName: 'Primeiro Nome',
        income: 'Renda',
        insurance: 'Seguro',
        lastName: 'Último Nome',
        middleName: 'Nome do meio',
        monthlyCost: 'Custo Mensal',
        occupation: 'Ocupação',
        operativePlan: '',
        parent: 'Responsável Legal',
        patientDays: 'Dias do Paciente',
        patientType: 'Tipo de Paciente',
        patientTypeCharity: 'Caridade',
        patientTypePrivate: 'Privado',
        phone: 'Telefone',
        placeOfBirth: 'Local de Nascimento',
        primaryDiagnosis: 'Diagnósticos Primários',
        referredBy: 'Indicado Por',
        referredDate: 'Data de Indicação',
        relationship: 'Relação com Paciente',
        relationships: 'Relação',
        religion: 'Religião',
        secondaryDiagnosis: 'Diagnósticos Secundários',
        sex: 'Sexo',
        sexNotEntered: '',
        sources: 'Fontes',
        status: 'Situação do Paciente',
        totalMontlyExpense: 'Total de Despesas Mensais'
      },
      messages: {
        areYouSureDelete: 'Você tem certeza que deseja excluir este(a) {{object}}?',
        createNewPatient: 'Criar novos registro de paciente?',
        deletingPatient: '',
        noPatientsFound: 'Nenhum paciente encontrado.',
        notFoundQuickAdd: 'O paciente <strong>{{patientFullName}}</strong> 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.',
        photoFileRequired: '',
        savedPatient: 'O registro de paciente para {{displayName}} foi salvo.'
      },
      navigation: {
        appointments: 'Compromissos',
        general: 'Geral',
        history: 'Histórico',
        imaging: 'Imagem',
        labs: 'Laboratórios',
        medication: 'Medicação',
        photos: 'Fotos',
        socialWork: 'Assitência Social',
        visits: 'Visitas'
      },
      notes: {
        newNote: 'Nova Nota para',
        onBehalfOfCopy: 'em nome de',
        onBehalfOfLabel: 'Em Nome de',
        pleaseSelectAVisit: 'Por favor selecione uma visita',
        updateNote: 'Atualizando Nota de'
      },
      titles: {
        addContact: '',
        addPhoto: 'Adicionar Foto',
        additionalContacts: 'Contatos Adicionais',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': 'Excluir Paciente',
        deleteContact: 'Excluir Contato',
        deleteExpense: 'Excluir Despesa',
        deleteFamilyMember: 'Excluir Membro Familiar',
        deletePatientRecord: '',
        deletePhoto: 'Excluir Foto',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: 'Editar Paciente',
        editPhoto: 'Editar Foto',
        expenses: 'Despesas',
        familyInfo: 'Informação Familiar',
        familyInformation: 'Informação Familiar',
        'new': 'Novo Paciente',
        outpatientsForDate: '',
        patient: 'Relatório de Paciente',
        patientListing: 'Lista de Pacientes',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: 'Paciente Salvo',
        socialWork: 'Despesa',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: 'Faturado por:',
          billedDate: 'Data de Faturamento:',
          dateAdmitted: 'ADMITIDO:',
          dateDischarged: 'PAGAMENTO:',
          dischargeNotes: 'Notas de Pagamento:',
          patientAddress: 'ENDEREÇO:',
          patientAge: 'IDADE:',
          patientId: 'PACIENTE #:',
          patientName: 'NOME DO PACIENTE:',
          remarks: 'Observações:',
          spacer: '__________________________________________'
        },
        messages: { whereConducted: 'foram deduzidos durante minha internação' },
        titles: {
          billingStatement: 'DECLARAÇÃO DO FATURAMENTO',
          patientMember: 'Paciente-Membro',
          patients: 'DO PACIENTE',
          relContact: 'Relações/Contato'
        }
      } },
    procedures: {
      buttons: { addMedication: 'Adicionar Medicação' },
      labels: { medicationUsed: 'Medicação Usada' },
      messages: { saved: 'O registro de procedimento foi salvo.' },
      titles: {
        addChargeItem: 'Adicionar Item de Cobrança',
        addMedicationUsed: 'Adicionar Medicação Usada',
        deleteChargeItem: 'Excluir Item de Cobrança',
        deleteMedicationUsed: 'Excluir Medicação Usada',
        edit: 'Editar Procedimento',
        editChargeItem: 'Editar Item de Cobrança',
        editMedicationUsed: 'Editar Medicação Usada',
        medicationUsed: 'Medicação Usada',
        'new': 'Novo Procedimento',
        saved: 'Procedimento Salvo'
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '+ novo usuário',
      usersPageTile: 'Lista de Usuários'
    },
    visits: {
      buttons: {
        addDiagnosis: 'Adicionar Diagnóstico',
        checkIn: 'Entrada',
        checkOut: '',
        discharge: '',
        newAppointment: 'Novo Compromisso',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: 'Novo Procedimento',
        newVitals: 'Novos Sinais Vitais'
      },
      labels: {
        appointment: '',
        authoredBy: 'Autorizado Por',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: 'Diagnósticos',
        examiner: 'Examinador',
        finalDiagnosis: 'Diagnósticos de Finais/Faturamento',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: 'Procedimentos',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: 'Situação de Visita',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: 'Imformação de Visita',
        visitType: 'Tipo de Visita'
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: 'Diagnósticos Adicionais',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: 'Data de Gravação',
        dbp: 'PAD',
        heartRate: 'Frequência Cardíaca',
        height: 'Altura',
        respiratoryRate: 'Frequência Respiratória',
        sbp: 'PAS',
        temperature: 'Temperatura',
        weight: 'Peso'
      } }
  };
});
define('hospitalrun/tests/locales/pt-BR/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/pt-BR/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/pt-BR/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/ru/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: '',
        address2Label: '',
        address3Label: '',
        address4Label: '',
        addressLabel: '',
        editTitle: '',
        include1Label: '',
        include2Label: '',
        include3Label: '',
        include4Label: '',
        messages: { addressSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      addressOptions: '',
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: '',
      loaddb: {
        displayAlertMessage: '',
        displayAlertTitle: '',
        editTitle: '',
        errorDisplayAlertMessage: '',
        errorDisplayAlertTitle: '',
        progressMessage: '',
        progressTitle: ''
      },
      lookup: {
        aisleLocationList: '',
        alertImportListMessage: '',
        alertImportListSaveMessage: '',
        alertImportListSaveTitle: '',
        alertImportListTitle: '',
        alertImportListUpdateMessage: '',
        alertImportListUpdateTitle: '',
        anesthesiaTypes: '',
        anesthesiologists: '',
        billingCategories: '',
        clinicList: '',
        countryList: '',
        cptCodeList: '',
        diagnosisList: '',
        edit: { template: {
            addTitle: '',
            editTitle: '',
            labelTitle: '',
            updateButtonTextAdd: '',
            updateButtonTextUpdate: ''
          } },
        expenseAccountList: '',
        imagingPricingTypes: '',
        incidentDepartments: '',
        inventoryTypes: '',
        labPricingTypes: '',
        pageTitle: '',
        patientStatusList: '',
        physicianList: '',
        procedureList: '',
        procedureLocations: '',
        procedurePricingTypes: '',
        radiologists: '',
        titles: { deleteLookupValue: '' },
        unitTypes: '',
        vendorList: '',
        visitLocationList: '',
        visitTypes: '',
        wardPricingTypes: '',
        warehouseList: ''
      },
      lookupLists: '',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: '',
          addBillingDiagnosis: '',
          addCharge: '',
          addDiagnosis: '',
          addImaging: '',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: '',
          addInventoryPurchase: '',
          addInventoryRequest: '',
          addInvoice: '',
          addLab: '',
          addMedication: '',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: '',
          addPayment: '',
          addPhoto: '',
          addPricing: '',
          addPricingProfile: '',
          addProcedure: '',
          addSocialwork: '',
          addVisit: '',
          addVitals: '',
          adjustInventoryLocation: '',
          admin: '',
          admitPatient: '',
          appointments: '',
          billing: '',
          completeImaging: '',
          completeLab: '',
          defineUserRoles: '',
          deleteAppointment: '',
          deleteDiagnosis: '',
          deleteImaging: '',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: '',
          deleteInvoice: '',
          deleteLab: '',
          deleteMedication: '',
          deleteNote: '',
          deletePatient: '',
          deletePhoto: '',
          deletePricing: '',
          deletePricingProfile: '',
          deleteProcedure: '',
          deleteSocialwork: '',
          deleteVisit: '',
          deleteVitals: '',
          dischargePatient: '',
          editInvoice: '',
          fulfillInventory: '',
          fulfillMedication: '',
          generateIncidentReport: '',
          imaging: '',
          incident: '',
          inventory: '',
          invoices: '',
          labs: '',
          loadDb: '',
          manageIncidents: '',
          medication: '',
          overrideInvoice: '',
          patientReports: '',
          patients: '',
          pricing: '',
          updateConfig: '',
          visits: ''
        },
        messages: { roleSaved: '' },
        titles: { roleSaved: '' }
      },
      userRoles: '',
      users: '',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: '',
        clinicPrepaymentLabel: '',
        editTitle: '',
        followupPrepaymentLabel: '',
        messages: { optionsSaved: '' },
        newTitle: '',
        outpatientImagingLabel: '',
        outpatientLabLabel: '',
        outpatientMedicationLabel: '',
        titles: { optionsSaved: '' },
        workflowLabel: ''
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: '',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: '' },
      labels: {
        allergyName: '',
        patientAllergy: ''
      },
      titles: {
        addAllergy: '',
        editAllergy: ''
      }
    },
    application: {
      messages: { sessionExpired: '' },
      titles: { sessionExpired: '' }
    },
    appointments: {
      buttons: {
        newButton: '',
        scheduleSurgery: ''
      },
      calendarTitle: '',
      currentScreenTitle: '',
      editTitle: '',
      labels: {
        noLocation: '',
        selectedStartingDate: ''
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: ''
      },
      missed: '',
      newTitle: '',
      searchTitle: '',
      sectionTitle: '',
      thisWeek: '',
      titles: {
        appointmentSaved: '',
        editSurgicalAppointment: '',
        newSurgicalAppointment: '',
        theaterSchedule: ''
      },
      todayTitle: ''
    },
    billing: {
      alerts: {
        noInvoiceFound: '',
        noPricingItems: '',
        noPricingProfiles: ''
      },
      buttons: {
        addOverride: '',
        createInvoice: ''
      },
      labels: {
        actualCharges: '',
        discountAmount: '',
        discountPercentage: '',
        externalInvoiceNumber: '',
        hmoCom: '',
        insurance: '',
        paymentProfile: '',
        paymentsDeposits: '',
        pricingPanelOverrides: '',
        pricingProfile: ''
      }
    },
    buttons: {
      add: 'Добавить',
      addItem: '',
      addLineItem: '',
      addValue: '',
      addVisit: '',
      allRequests: '',
      barcode: '',
      cancel: 'Отметить',
      clear: '',
      close: '',
      complete: 'Готово',
      'delete': '',
      dispense: '',
      edit: '',
      filter: '',
      fulfill: '',
      'import': '',
      loadFile: '',
      newItem: '',
      newNote: '',
      newRequest: '',
      newRequestPlus: '',
      newUser: '',
      ok: 'Ок',
      remove: '',
      returnButton: 'Вернутся',
      search: '',
      showAll: '',
      showFewer: '',
      update: 'Обновить'
    },
    components: {
      chargesByTypeTab: { charges: '' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '',
        midnight: '',
        noon: '',
        pmHour: ''
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: '' },
      quantityCalc: { result: '' },
      quantityConv: {
        conversion: '',
        unit: ''
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: '',
        how: '',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: '',
        preview: '',
        takePhoto: '',
        uploadFile: ''
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: '' },
      labels: { formToAdd: '' },
      titles: { addCustomForm: '' }
    },
    dashboard: {
      setup: '',
      title: 'Что вы хотите сделать?'
    },
    dates: {
      'long': '',
      longOmitDays: '',
      longOmitDaysPlural: '',
      longOmitDaysYears: '',
      longOmitYears: '',
      longPlural: '',
      'short': '',
      shortOmitYears: ''
    },
    diagnosis: {
      labels: {
        activeDiagnosis: '',
        date: '',
        diagnosis: '',
        secondaryDiagnosis: ''
      },
      titles: {
        addDiagnosis: '',
        editDiagnosis: ''
      }
    },
    errors: {
      accepted: '',
      blank: '',
      confirmation: '',
      empty: '',
      equalTo: '',
      even: '',
      exclusion: '',
      greaterThan: '',
      greaterThanOrEqualTo: '',
      inclusion: '',
      invalid: '',
      invalidNumber: '',
      lessThan: '',
      lessThanOrEqualTo: '',
      notANumber: '',
      notAnInteger: '',
      odd: '',
      otherThan: '',
      present: '',
      result: '',
      tooLong: '',
      tooShort: '',
      wrongLength: ''
    },
    headings: { chargedItems: '' },
    imaging: {
      alerts: {
        completedMessage: 'Запрос на визуализацию удовлетворён.',
        completedTitle: 'Визуализация выполнена',
        savedMessage: 'Запрос на визуализацию сохранён.',
        savedTitle: 'Запрос сохранён'
      },
      buttons: { newButton: '+ новый запрос' },
      labels: {
        addNewVisit: '--Добавить новый тип осмотра--',
        radiologist: 'Радиолог'
      },
      messages: { noCompleted: 'Не найдено выполненых запросов.' },
      pageTitle: 'Запросы на визуализацию',
      sectionTitle: 'Визуализация',
      titles: {
        completedImaging: 'Выполненые запросы',
        editTitle: 'Редактировать запрос на визуализацию',
        newTitle: 'Новый запрос на визуализацию'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    inventory: {
      edit: {
        cost: '',
        delivered: '',
        location: '',
        prescription: '',
        pulled: '',
        quantity: '',
        reason: '',
        returned: '',
        transferredFrom: '',
        transferredTo: ''
      },
      labels: {
        action: '',
        add: '',
        addAdjustmentType: '',
        adjust: '',
        adjustmentDate: '',
        adjustmentFor: '',
        adjustmentType: '',
        aisle: '',
        aisleLocation: '',
        allInventory: '',
        allItems: '',
        availableQuantity: '',
        billTo: '',
        consumePurchases: '',
        consumptionRate: '',
        cost: '',
        costPerUnit: '',
        crossReference: '',
        currentQuantity: '',
        dateCompleted: '',
        dateEffective: '',
        dateEnd: '',
        dateReceived: '',
        dateStart: '',
        dateTransferred: '',
        daysLeft: '',
        deleteItem: '',
        deliveryAisle: '',
        deliveryLocation: '',
        details: '',
        distributionUnit: '',
        editItem: '',
        expense: '',
        expirationDate: '',
        fulfillRequest: '',
        fulfillRequestNow: '',
        gift: '',
        giftInKindNo: '',
        giftInKindYes: '',
        giftUsage: '',
        inventoryConsumed: '',
        inventoryItem: '',
        inventoryObsolence: '',
        invoiceItems: '',
        invoiceLineItem: '',
        invoiceNumber: '',
        item: '',
        itemNumber: '',
        items: '',
        location: '',
        locations: '',
        markAsConsumed: '',
        name: '',
        newItem: '',
        originalQuantity: '',
        print: '',
        printBarcode: '',
        printer: '',
        pullFrom: '',
        purchaseCost: '',
        purchaseInfo: '',
        purchases: '',
        quantity: '',
        quantityAvailable: '',
        quantityOnHand: '',
        quantityRequested: '',
        rank: '',
        reason: '',
        remove: '',
        removeAdjustmentType: '',
        reorderPoint: '',
        requestedItems: '',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        salePricePerUnit: '',
        save: '',
        serialNumber: '',
        total: '',
        totalCost: '',
        totalReceived: '',
        transaction: '',
        transactions: '',
        transfer: '',
        transferFrom: '',
        transferTo: '',
        transferToAisle: '',
        unit: '',
        unitCost: '',
        vendor: '',
        vendorItemNumber: '',
        writeOffAdjustmentType: '',
        xref: ''
      },
      messages: {
        adjust: '',
        createRequest: 'Создать новый запрос?',
        itemNotFound: '',
        loading: '',
        noItems: '',
        noRequests: 'Запросов не найдено.',
        purchaseSaved: '',
        quantity: '',
        removeItem: '',
        removeItemRequest: '',
        requestFulfilled: '',
        requestUpdated: '',
        warning: ''
      },
      reports: {
        adjustment: '',
        daysSupply: '',
        expenseDetail: '',
        expenseSum: '',
        expiration: '',
        'export': '',
        fields: '',
        finance: '',
        generate: '',
        invLocation: '',
        invValuation: '',
        purchaseDetail: '',
        purchaseSum: '',
        reportType: '',
        rows: {
          adjustments: '',
          adjustmentsTotal: '',
          balanceBegin: '',
          balanceEnd: '',
          category: '',
          consumed: '',
          consumedGik: '',
          consumedGikTotal: '',
          consumedPuchases: '',
          consumedPurchasesTotal: '',
          consumedTotal: '',
          errInFinSum: '',
          errInFindPur: '',
          errInFindReq: '',
          expensesFor: '',
          noAccount: '',
          subtotal: '',
          subtotalFor: '',
          total: '',
          totalFor: '',
          totalPurchases: '',
          transfer1: '',
          trasnfer2: ''
        },
        stockTransferDetail: '',
        stockTransferSum: '',
        stockUsageDetail: '',
        stockUsageSum: '',
        titleDateRange: '',
        titleSingleDate: ''
      },
      titles: {
        addPurchase: '',
        addRequest: '',
        adjustment: '',
        editPurchase: '',
        editRequest: '',
        inventoryItem: '',
        inventoryReport: '',
        purchaseSaved: '',
        quickAddTitle: '',
        removeItem: '',
        requestFulfilled: '',
        requestUpdated: '',
        transfer: '',
        warning: ''
      }
    },
    labels: {
      action: 'Действие',
      actions: 'Действия',
      addNewOutpatientVisit: '',
      address: '',
      age: 'Возраст',
      allDay: '',
      amount: '',
      anesthesia: '',
      assisting: '',
      balanceDue: '',
      billDate: '',
      billTo: '',
      category: '',
      completed: 'Выполненые',
      country: '',
      cptcode: '',
      creditTo: '',
      date: '',
      dateCompleted: 'Дата Выполнения',
      dateOfBirth: '',
      dateOfBirthShort: '',
      datePaid: '',
      dateRequested: 'Дата Запроса',
      'delete': '',
      deleteRequest: '',
      deleteUser: '',
      department: '',
      description: '',
      discount: '',
      displayName: '',
      docRead: '',
      docWritten: '',
      edit: 'Редактировать',
      editUser: '',
      email: '',
      endDate: '',
      endTime: '',
      excess: '',
      expenseTo: '',
      fileLoadSuccessful: '',
      fileName: '',
      fileToLoad: '',
      fulfill: 'Отправить',
      fulfillRequest: '',
      fulfillRequestNow: '',
      fulfilled: '',
      grandTotal: '',
      id: 'Номер',
      imageOrders: '',
      imagingType: 'Тип визуализации',
      importFile: '',
      invoiceId: '',
      labOrders: '',
      lineItems: '',
      loading: '',
      location: '',
      lookupType: '',
      medication: '',
      name: 'Имя',
      newUser: '',
      note: '',
      notes: 'Заметки',
      number: '',
      on: '',
      password: '',
      patient: 'Пациент',
      payments: '',
      physician: '',
      prescriber: '',
      prescription: '',
      prescriptionDate: '',
      price: '',
      print: '',
      procedures: '',
      provider: '',
      pullFrom: '',
      quantity: 'Количество',
      remarks: '',
      requestedBy: 'Запрошен',
      requestedOn: 'Запрошен',
      requests: 'Ожидающие',
      result: 'Результат',
      results: 'Результаты',
      role: '',
      search: '',
      sex: 'Пол',
      startDate: '',
      startTime: '',
      status: '',
      takenBy: '',
      total: '',
      type: '',
      userCanAddNewValue: '',
      username: '',
      value: '',
      view: '',
      visit: 'Осмотр',
      'with': ''
    },
    labs: {
      alerts: {
        requestCompletedMessage: '',
        requestCompletedTitle: '',
        requestSavedMessage: '',
        requestSavedTitle: ''
      },
      buttons: { newButton: '' },
      completedTitle: '',
      deleteTitle: '',
      editTitle: '',
      labels: {
        addNewVisit: '',
        labType: ''
      },
      messages: {
        createNewRecord: '',
        noCompleted: '',
        noItemsFound: ''
      },
      newTitle: '',
      requestsTitle: '',
      sectionTitle: ''
    },
    loading: {
      messages: {
        '0': '',
        '1': '',
        '2': '',
        '3': '',
        '4': '',
        '5': '',
        '6': '',
        '7': '',
        '8': '',
        '9': '',
        '10': '',
        '11': ''
      },
      progressBar: { progress: '' }
    },
    login: {
      labels: {
        password: 'Пароль',
        signIn: 'Войти',
        username: 'Имя пользователя'
      },
      messages: {
        error: 'Неверное имя пользователя или пароль.',
        signIn: 'войдите в систему'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: '',
        returnedMessage: '',
        returnedTitle: '',
        savedMessage: '',
        savedTitle: ''
      },
      buttons: {
        dispenseMedication: '',
        newButton: '',
        returnMedication: ''
      },
      labels: {
        adjustmentDate: '',
        creditToAccount: '',
        quantityDispensed: '',
        quantityDistributed: '',
        quantityRequested: '',
        quantityToReturn: '',
        refills: '',
        returnAisle: '',
        returnLocation: '',
        returnReason: ''
      },
      messages: { createNew: '' },
      pageTitle: '',
      returnMedication: '',
      sectionTitle: '',
      titles: {
        completedMedication: '',
        editMedicationRequest: '',
        newMedicationRequest: ''
      }
    },
    messages: {
      createNewRecord: 'Создать новую запись?',
      createNewUser: '',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Этот отчет предназначен только для уполномоченных лиц.',
      newPatientHasToBeCreated: '',
      noHistoryAvailable: '',
      noItemsFound: 'Ничего не найдено.',
      noNotesAvailable: '',
      noUsersFound: '',
      onBehalfOf: '',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: '',
      userHasBeenSaved: '',
      userSaved: ''
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: '',
      actions: {
        login: '',
        logout: ''
      },
      administration: '',
      billing: '',
      imaging: '',
      incident: '',
      inventory: '',
      labs: '',
      medication: '',
      patients: '',
      scheduling: '',
      subnav: {
        actions: '',
        addAppointment: '',
        addressFields: '',
        admittedPatients: '',
        appointmentSearch: '',
        appointmentsCalendar: '',
        appointmentsThisWeek: '',
        completed: '',
        currentIncidents: '',
        customForms: '',
        dispense: '',
        history: '',
        incidentCategories: '',
        inventoryReceived: '',
        invoices: '',
        items: '',
        loadDB: '',
        lookupLists: '',
        missedAppointments: '',
        newIncident: '',
        newInvoice: '',
        newPatient: '',
        newRequest: '',
        newUser: '',
        outpatient: '',
        patientListing: '',
        priceProfiles: '',
        prices: '',
        printHeader: '',
        reports: '',
        requests: '',
        returnMedication: '',
        scheduleSurgery: '',
        theaterSchedule: '',
        "today'sAppointments": '',
        userRoles: '',
        users: '',
        workflow: ''
      }
    },
    operationReport: {
      labels: {
        additionalNotes: '',
        assistant: '',
        caseComplexity: '',
        operationDescription: '',
        preOpPrimaryDiagnosis: '',
        preOpSecondaryDiagnosis: '',
        surgeon: '',
        surgeryDate: ''
      },
      messages: { reportSaved: '' },
      titles: {
        editTitle: '',
        newTitle: '',
        reportSaved: ''
      }
    },
    operativePlan: {
      buttons: { completePlan: '' },
      labels: {
        additionalNotes: '',
        admissionInstructions: '',
        caseComplexity: '',
        completedStatus: '',
        droppedStatus: '',
        operationDescription: '',
        plannedStatus: '',
        status: '',
        surgeon: ''
      },
      messages: {
        planCompleted: '',
        planSaved: ''
      },
      titles: {
        editTitle: '',
        newTitle: '',
        planCompleted: '',
        planSaved: ''
      }
    },
    patients: {
      buttons: {
        addContact: '',
        addExpense: '',
        addFamilyMember: '',
        addOperativePlan: '',
        backToPatients: '',
        download: '',
        editOperativePlan: '',
        newAppointment: '',
        newImaging: '',
        newLab: '',
        newMedication: '',
        newPatient: '',
        newPhoto: '',
        newVisit: '',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: '',
        admit: '',
        bloodType: '',
        caption: '',
        civilStatus: '',
        clinic: '',
        contacts: '',
        cost: '',
        dateOfBirth: '',
        dateProcessed: '',
        dischargeDate: '',
        dob: '',
        education: '',
        email: '',
        externalPatientId: '',
        firstName: '',
        income: '',
        insurance: '',
        lastName: '',
        middleName: '',
        monthlyCost: '',
        occupation: '',
        operativePlan: '',
        parent: '',
        patientDays: '',
        patientType: '',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: '',
        placeOfBirth: '',
        primaryDiagnosis: '',
        referredBy: '',
        referredDate: '',
        relationship: '',
        relationships: '',
        religion: '',
        secondaryDiagnosis: '',
        sex: '',
        sexNotEntered: '',
        sources: '',
        status: '',
        totalMontlyExpense: ''
      },
      messages: {
        areYouSureDelete: '',
        createNewPatient: '',
        deletingPatient: '',
        noPatientsFound: '',
        notFoundQuickAdd: '',
        photoFileRequired: '',
        savedPatient: ''
      },
      navigation: {
        appointments: '',
        general: '',
        history: '',
        imaging: '',
        labs: '',
        medication: '',
        photos: '',
        socialWork: '',
        visits: ''
      },
      notes: {
        newNote: '',
        onBehalfOfCopy: '',
        onBehalfOfLabel: '',
        pleaseSelectAVisit: '',
        updateNote: ''
      },
      titles: {
        addContact: '',
        addPhoto: '',
        additionalContacts: '',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': '',
        deleteContact: '',
        deleteExpense: '',
        deleteFamilyMember: '',
        deletePatientRecord: '',
        deletePhoto: '',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: '',
        editPhoto: '',
        expenses: '',
        familyInfo: '',
        familyInformation: '',
        'new': '',
        outpatientsForDate: '',
        patient: '',
        patientListing: '',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: '',
        socialWork: '',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: '',
          billedDate: '',
          dateAdmitted: '',
          dateDischarged: '',
          dischargeNotes: '',
          patientAddress: '',
          patientAge: '',
          patientId: '',
          patientName: '',
          remarks: '',
          spacer: ''
        },
        messages: { whereConducted: '' },
        titles: {
          billingStatement: '',
          patientMember: '',
          patients: '',
          relContact: ''
        }
      } },
    procedures: {
      buttons: { addMedication: '' },
      labels: { medicationUsed: '' },
      messages: { saved: '' },
      titles: {
        addChargeItem: '',
        addMedicationUsed: '',
        deleteChargeItem: '',
        deleteMedicationUsed: '',
        edit: '',
        editChargeItem: '',
        editMedicationUsed: '',
        medicationUsed: '',
        'new': '',
        saved: ''
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '',
      usersPageTile: ''
    },
    visits: {
      buttons: {
        addDiagnosis: '',
        checkIn: '',
        checkOut: '',
        discharge: '',
        newAppointment: '',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: '',
        newVitals: ''
      },
      labels: {
        appointment: '',
        authoredBy: '',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: '',
        examiner: '',
        finalDiagnosis: '',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: '',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: '',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: '',
        visitType: ''
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: '',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: '',
        dbp: '',
        heartRate: '',
        height: '',
        respiratoryRate: '',
        sbp: '',
        temperature: '',
        weight: ''
      } }
  };
});
define('hospitalrun/tests/locales/ru/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/ru/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/ru/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/tr/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: '',
        address2Label: '',
        address3Label: '',
        address4Label: '',
        addressLabel: '',
        editTitle: '',
        include1Label: '',
        include2Label: '',
        include3Label: '',
        include4Label: '',
        messages: { addressSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      addressOptions: '',
      customForms: {
        buttons: {
          addField: '',
          moveDown: '',
          moveUp: '',
          newForm: '',
          preview: ''
        },
        labels: {
          alwaysInclude: '',
          checkbox: '',
          colSpan: '',
          columns: '',
          customForm: '',
          dischargeReportFormType: '',
          formName: '',
          formType: '',
          incidentFormType: '',
          includeOtherOption: '',
          labFormType: '',
          label: '',
          newForm: '',
          opdReportFormType: '',
          operativePlanFormType: '',
          otherOptionLabel: '',
          patientFormType: '',
          property: '',
          radio: '',
          select: '',
          socialworkFormType: '',
          text: '',
          textarea: '',
          visitFormType: ''
        },
        messages: { formSaved: '' },
        titles: {
          checkboxValues: '',
          customForms: '',
          deleteForm: '',
          dropDownValues: '',
          editCustomForm: '',
          fields: '',
          formSaved: '',
          newCustomForm: '',
          radioValues: ''
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: '',
      loaddb: {
        displayAlertMessage: '',
        displayAlertTitle: '',
        editTitle: '',
        errorDisplayAlertMessage: '',
        errorDisplayAlertTitle: '',
        progressMessage: '',
        progressTitle: ''
      },
      lookup: {
        aisleLocationList: '',
        alertImportListMessage: '',
        alertImportListSaveMessage: '',
        alertImportListSaveTitle: '',
        alertImportListTitle: '',
        alertImportListUpdateMessage: '',
        alertImportListUpdateTitle: '',
        anesthesiaTypes: '',
        anesthesiologists: '',
        billingCategories: '',
        clinicList: '',
        countryList: '',
        cptCodeList: '',
        diagnosisList: '',
        edit: { template: {
            addTitle: '',
            editTitle: '',
            labelTitle: '',
            updateButtonTextAdd: '',
            updateButtonTextUpdate: ''
          } },
        expenseAccountList: '',
        imagingPricingTypes: '',
        incidentDepartments: '',
        inventoryTypes: '',
        labPricingTypes: '',
        pageTitle: '',
        patientStatusList: '',
        physicianList: '',
        procedureList: '',
        procedureLocations: '',
        procedurePricingTypes: '',
        radiologists: '',
        titles: { deleteLookupValue: '' },
        unitTypes: '',
        vendorList: '',
        visitLocationList: '',
        visitTypes: '',
        wardPricingTypes: '',
        warehouseList: ''
      },
      lookupLists: '',
      roles: {
        capability: {
          addAllergy: '',
          addAppointment: '',
          addBillingDiagnosis: '',
          addCharge: '',
          addDiagnosis: '',
          addImaging: '',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: '',
          addInventoryPurchase: '',
          addInventoryRequest: '',
          addInvoice: '',
          addLab: '',
          addMedication: '',
          addNote: '',
          addOperationReport: '',
          addOperativePlan: '',
          addPatient: '',
          addPayment: '',
          addPhoto: '',
          addPricing: '',
          addPricingProfile: '',
          addProcedure: '',
          addSocialwork: '',
          addVisit: '',
          addVitals: '',
          adjustInventoryLocation: '',
          admin: '',
          admitPatient: '',
          appointments: '',
          billing: '',
          completeImaging: '',
          completeLab: '',
          defineUserRoles: '',
          deleteAppointment: '',
          deleteDiagnosis: '',
          deleteImaging: '',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: '',
          deleteInvoice: '',
          deleteLab: '',
          deleteMedication: '',
          deleteNote: '',
          deletePatient: '',
          deletePhoto: '',
          deletePricing: '',
          deletePricingProfile: '',
          deleteProcedure: '',
          deleteSocialwork: '',
          deleteVisit: '',
          deleteVitals: '',
          dischargePatient: '',
          editInvoice: '',
          fulfillInventory: '',
          fulfillMedication: '',
          generateIncidentReport: '',
          imaging: '',
          incident: '',
          inventory: '',
          invoices: '',
          labs: '',
          loadDb: '',
          manageIncidents: '',
          medication: '',
          overrideInvoice: '',
          patientReports: '',
          patients: '',
          pricing: '',
          updateConfig: '',
          visits: ''
        },
        messages: { roleSaved: '' },
        titles: { roleSaved: '' }
      },
      userRoles: '',
      users: '',
      visitForms: {
        labels: {
          followup: '',
          form: '',
          initial: '',
          visitType: ''
        },
        titles: { visitForms: '' }
      },
      workflow: {
        admissionDepositLabel: '',
        clinicPrepaymentLabel: '',
        editTitle: '',
        followupPrepaymentLabel: '',
        messages: { optionsSaved: '' },
        newTitle: '',
        outpatientImagingLabel: '',
        outpatientLabLabel: '',
        outpatientMedicationLabel: '',
        titles: { optionsSaved: '' },
        workflowLabel: ''
      }
    },
    alerts: {
      errorExclamation: '',
      pleaseWait: '',
      reportError: '',
      warningExclamation: ''
    },
    allergies: {
      buttons: { addAllergy: '' },
      labels: {
        allergyName: '',
        patientAllergy: ''
      },
      titles: {
        addAllergy: '',
        editAllergy: ''
      }
    },
    application: {
      messages: { sessionExpired: '' },
      titles: { sessionExpired: '' }
    },
    appointments: {
      buttons: {
        newButton: '',
        scheduleSurgery: ''
      },
      calendarTitle: '',
      currentScreenTitle: '',
      editTitle: '',
      labels: {
        noLocation: '',
        selectedStartingDate: ''
      },
      messages: {
        appointmentSaved: '',
        endTimeLaterThanStart: ''
      },
      missed: '',
      newTitle: '',
      searchTitle: '',
      sectionTitle: '',
      thisWeek: '',
      titles: {
        appointmentSaved: '',
        editSurgicalAppointment: '',
        newSurgicalAppointment: '',
        theaterSchedule: ''
      },
      todayTitle: ''
    },
    billing: {
      alerts: {
        noInvoiceFound: '',
        noPricingItems: '',
        noPricingProfiles: ''
      },
      buttons: {
        addOverride: '',
        createInvoice: ''
      },
      labels: {
        actualCharges: '',
        discountAmount: '',
        discountPercentage: '',
        externalInvoiceNumber: '',
        hmoCom: '',
        insurance: '',
        paymentProfile: '',
        paymentsDeposits: '',
        pricingPanelOverrides: '',
        pricingProfile: ''
      }
    },
    buttons: {
      add: 'Ekle',
      addItem: '',
      addLineItem: '',
      addValue: '',
      addVisit: '',
      allRequests: '',
      barcode: '',
      cancel: 'Vazgeç',
      clear: '',
      close: '',
      complete: 'Bitir',
      'delete': '',
      dispense: '',
      edit: '',
      filter: '',
      fulfill: '',
      'import': '',
      loadFile: '',
      newItem: '',
      newNote: '',
      newRequest: '',
      newRequestPlus: '',
      newUser: '',
      ok: 'Tamam',
      remove: '',
      returnButton: 'Geri Dön',
      search: '',
      showAll: '',
      showFewer: '',
      update: 'Güncelle'
    },
    components: {
      chargesByTypeTab: { charges: '' },
      customFormManager: { buttons: { addForm: '' } },
      dateTimePicker: {
        amHour: '',
        midnight: '',
        noon: '',
        pmHour: ''
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: '' },
        labels: { procedure: '' },
        titles: { procedures: '' }
      },
      patientOrders: {
        buttons: {
          newImaging: '',
          newLab: '',
          newMedication: ''
        },
        labels: {
          imagingOrderType: '',
          labOrderType: '',
          medicationOrderType: '',
          orderType: ''
        }
      },
      priceList: { charges: '' },
      quantityCalc: { result: '' },
      quantityConv: {
        conversion: '',
        unit: ''
      },
      sortableColumn: { labels: { selectAll: '' } },
      takePhoto: {
        camera: '',
        how: '',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: '',
        preview: '',
        takePhoto: '',
        uploadFile: ''
      },
      upcomingAppointments: {
        labels: {
          date: '',
          location: '',
          type: '',
          'with': ''
        },
        titles: { upcomingAppointments: '' }
      }
    },
    customForms: {
      buttons: { addForm: '' },
      labels: { formToAdd: '' },
      titles: { addCustomForm: '' }
    },
    dashboard: {
      setup: '',
      title: 'Ne yapmak istersiniz?'
    },
    dates: {
      'long': '',
      longOmitDays: '',
      longOmitDaysPlural: '',
      longOmitDaysYears: '',
      longOmitYears: '',
      longPlural: '',
      'short': '',
      shortOmitYears: ''
    },
    diagnosis: {
      labels: {
        activeDiagnosis: '',
        date: '',
        diagnosis: '',
        secondaryDiagnosis: ''
      },
      titles: {
        addDiagnosis: '',
        editDiagnosis: ''
      }
    },
    errors: {
      accepted: '',
      blank: '',
      confirmation: '',
      empty: '',
      equalTo: '',
      even: '',
      exclusion: '',
      greaterThan: '',
      greaterThanOrEqualTo: '',
      inclusion: '',
      invalid: '',
      invalidNumber: '',
      lessThan: '',
      lessThanOrEqualTo: '',
      notANumber: '',
      notAnInteger: '',
      odd: '',
      otherThan: '',
      present: '',
      result: '',
      tooLong: '',
      tooShort: '',
      wrongLength: ''
    },
    headings: { chargedItems: '' },
    imaging: {
      alerts: {
        completedMessage: 'Görüntüleme talebi başarıyla tamamlandı.',
        completedTitle: 'Görüntüleme Talebi Tamamlandı',
        savedMessage: 'Görüntüleme Talebi başarıyla kaydedildi.',
        savedTitle: 'Görüntüleme Talebi Kaydedildi'
      },
      buttons: { newButton: '+ yeni görüntüleme' },
      labels: {
        addNewVisit: '--Yeni Ziyaret Ekle--',
        radiologist: 'Radyolog'
      },
      messages: { noCompleted: 'Tamamlanmayan öğe bulunamadı.' },
      pageTitle: 'Görüntüleme talepleri',
      sectionTitle: 'Görüntüleme',
      titles: {
        completedImaging: 'Görüntüleme Tamamlandı',
        editTitle: 'Görüntüleme Talebini Düzenle',
        newTitle: 'Yeni Görüntüleme Talebi'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    inventory: {
      edit: {
        cost: '',
        delivered: '',
        location: '',
        prescription: '',
        pulled: '',
        quantity: '',
        reason: '',
        returned: '',
        transferredFrom: '',
        transferredTo: ''
      },
      labels: {
        action: '',
        add: '',
        addAdjustmentType: '',
        adjust: '',
        adjustmentDate: '',
        adjustmentFor: '',
        adjustmentType: '',
        aisle: '',
        aisleLocation: '',
        allInventory: '',
        allItems: '',
        availableQuantity: '',
        billTo: '',
        consumePurchases: '',
        consumptionRate: '',
        cost: '',
        costPerUnit: '',
        crossReference: '',
        currentQuantity: '',
        dateCompleted: '',
        dateEffective: '',
        dateEnd: '',
        dateReceived: '',
        dateStart: '',
        dateTransferred: '',
        daysLeft: '',
        deleteItem: '',
        deliveryAisle: '',
        deliveryLocation: '',
        details: '',
        distributionUnit: '',
        editItem: '',
        expense: '',
        expirationDate: '',
        fulfillRequest: '',
        fulfillRequestNow: '',
        gift: '',
        giftInKindNo: '',
        giftInKindYes: '',
        giftUsage: '',
        inventoryConsumed: '',
        inventoryItem: '',
        inventoryObsolence: '',
        invoiceItems: '',
        invoiceLineItem: '',
        invoiceNumber: '',
        item: '',
        itemNumber: '',
        items: '',
        location: '',
        locations: '',
        markAsConsumed: '',
        name: '',
        newItem: '',
        originalQuantity: '',
        print: '',
        printBarcode: '',
        printer: '',
        pullFrom: '',
        purchaseCost: '',
        purchaseInfo: '',
        purchases: '',
        quantity: '',
        quantityAvailable: '',
        quantityOnHand: '',
        quantityRequested: '',
        rank: '',
        reason: '',
        remove: '',
        removeAdjustmentType: '',
        reorderPoint: '',
        requestedItems: '',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        salePricePerUnit: '',
        save: '',
        serialNumber: '',
        total: '',
        totalCost: '',
        totalReceived: '',
        transaction: '',
        transactions: '',
        transfer: '',
        transferFrom: '',
        transferTo: '',
        transferToAisle: '',
        unit: '',
        unitCost: '',
        vendor: '',
        vendorItemNumber: '',
        writeOffAdjustmentType: '',
        xref: ''
      },
      messages: {
        adjust: '',
        createRequest: 'Yeni talep oluştur?',
        itemNotFound: '',
        loading: '',
        noItems: '',
        noRequests: 'Talep bulunamadı',
        purchaseSaved: '',
        quantity: '',
        removeItem: '',
        removeItemRequest: '',
        requestFulfilled: '',
        requestUpdated: '',
        warning: ''
      },
      reports: {
        adjustment: '',
        daysSupply: '',
        expenseDetail: '',
        expenseSum: '',
        expiration: '',
        'export': '',
        fields: '',
        finance: '',
        generate: '',
        invLocation: '',
        invValuation: '',
        purchaseDetail: '',
        purchaseSum: '',
        reportType: '',
        rows: {
          adjustments: '',
          adjustmentsTotal: '',
          balanceBegin: '',
          balanceEnd: '',
          category: '',
          consumed: '',
          consumedGik: '',
          consumedGikTotal: '',
          consumedPuchases: '',
          consumedPurchasesTotal: '',
          consumedTotal: '',
          errInFinSum: '',
          errInFindPur: '',
          errInFindReq: '',
          expensesFor: '',
          noAccount: '',
          subtotal: '',
          subtotalFor: '',
          total: '',
          totalFor: '',
          totalPurchases: '',
          transfer1: '',
          trasnfer2: ''
        },
        stockTransferDetail: '',
        stockTransferSum: '',
        stockUsageDetail: '',
        stockUsageSum: '',
        titleDateRange: '',
        titleSingleDate: ''
      },
      titles: {
        addPurchase: '',
        addRequest: '',
        adjustment: '',
        editPurchase: '',
        editRequest: '',
        inventoryItem: '',
        inventoryReport: '',
        purchaseSaved: '',
        quickAddTitle: '',
        removeItem: '',
        requestFulfilled: '',
        requestUpdated: '',
        transfer: '',
        warning: ''
      }
    },
    labels: {
      action: 'İşlem',
      actions: 'İşlemler',
      addNewOutpatientVisit: '',
      address: '',
      age: 'Yaş',
      allDay: '',
      amount: '',
      anesthesia: '',
      assisting: '',
      balanceDue: '',
      billDate: '',
      billTo: '',
      category: '',
      completed: 'Tamamlandı',
      country: '',
      cptcode: '',
      creditTo: '',
      date: '',
      dateCompleted: 'Bitiş tarihi',
      dateOfBirth: '',
      dateOfBirthShort: '',
      datePaid: '',
      dateRequested: 'Talep Tarihi',
      'delete': '',
      deleteRequest: '',
      deleteUser: '',
      department: '',
      description: '',
      discount: '',
      displayName: '',
      docRead: '',
      docWritten: '',
      edit: 'Düzenle',
      editUser: '',
      email: '',
      endDate: '',
      endTime: '',
      excess: '',
      expenseTo: '',
      fileLoadSuccessful: '',
      fileName: '',
      fileToLoad: '',
      fulfill: 'Fulfill',
      fulfillRequest: '',
      fulfillRequestNow: '',
      fulfilled: '',
      grandTotal: '',
      id: 'Id',
      imageOrders: '',
      imagingType: 'Görüntüleme Tipi',
      importFile: '',
      invoiceId: '',
      labOrders: '',
      lineItems: '',
      loading: '',
      location: '',
      lookupType: '',
      medication: '',
      name: 'Ad',
      newUser: '',
      note: '',
      notes: 'Notlar',
      number: '',
      on: '',
      password: '',
      patient: 'Hasta',
      payments: '',
      physician: '',
      prescriber: '',
      prescription: '',
      prescriptionDate: '',
      price: '',
      print: '',
      procedures: '',
      provider: '',
      pullFrom: '',
      quantity: 'Miktar',
      remarks: '',
      requestedBy: 'Talep sahibi',
      requestedOn: 'Açık Talep',
      requests: 'Talepler',
      result: 'Sonuç',
      results: 'Sonuçlar',
      role: '',
      search: '',
      sex: 'Cinsiyet',
      startDate: '',
      startTime: '',
      status: '',
      takenBy: '',
      total: '',
      type: '',
      userCanAddNewValue: '',
      username: '',
      value: '',
      view: '',
      visit: 'Ziyaret',
      'with': ''
    },
    labs: {
      alerts: {
        requestCompletedMessage: '',
        requestCompletedTitle: '',
        requestSavedMessage: '',
        requestSavedTitle: ''
      },
      buttons: { newButton: '' },
      completedTitle: '',
      deleteTitle: '',
      editTitle: '',
      labels: {
        addNewVisit: '',
        labType: ''
      },
      messages: {
        createNewRecord: '',
        noCompleted: '',
        noItemsFound: ''
      },
      newTitle: '',
      requestsTitle: '',
      sectionTitle: ''
    },
    loading: {
      messages: {
        '0': '',
        '1': '',
        '2': '',
        '3': '',
        '4': '',
        '5': '',
        '6': '',
        '7': '',
        '8': '',
        '9': '',
        '10': '',
        '11': ''
      },
      progressBar: { progress: '' }
    },
    login: {
      labels: {
        password: 'Parola',
        signIn: 'Giriş yap',
        username: 'Kullanıcı Adı'
      },
      messages: {
        error: 'Kullanıcı adı veya parola hatalı.',
        signIn: 'GİRİŞ YAPIN'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: '',
        returnedMessage: '',
        returnedTitle: '',
        savedMessage: '',
        savedTitle: ''
      },
      buttons: {
        dispenseMedication: '',
        newButton: '',
        returnMedication: ''
      },
      labels: {
        adjustmentDate: '',
        creditToAccount: '',
        quantityDispensed: '',
        quantityDistributed: '',
        quantityRequested: '',
        quantityToReturn: '',
        refills: '',
        returnAisle: '',
        returnLocation: '',
        returnReason: ''
      },
      messages: { createNew: '' },
      pageTitle: '',
      returnMedication: '',
      sectionTitle: '',
      titles: {
        completedMedication: '',
        editMedicationRequest: '',
        newMedicationRequest: ''
      }
    },
    messages: {
      createNewRecord: 'Yeni bir kayıt oluştur?',
      createNewUser: '',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'Bu rapor yetkili kişiler içindir.',
      newPatientHasToBeCreated: '',
      noHistoryAvailable: '',
      noItemsFound: 'Hiçbir öğe bulunamadı.',
      noNotesAvailable: '',
      noUsersFound: '',
      onBehalfOf: '',
      reportError: '',
      requiredFieldsCorrectErrors: '',
      saveActionException: '',
      sorry: '',
      userHasBeenSaved: '',
      userSaved: ''
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: '',
      actions: {
        login: '',
        logout: ''
      },
      administration: '',
      billing: '',
      imaging: '',
      incident: '',
      inventory: '',
      labs: '',
      medication: '',
      patients: '',
      scheduling: '',
      subnav: {
        actions: '',
        addAppointment: '',
        addressFields: '',
        admittedPatients: '',
        appointmentSearch: '',
        appointmentsCalendar: '',
        appointmentsThisWeek: '',
        completed: '',
        currentIncidents: '',
        customForms: '',
        dispense: '',
        history: '',
        incidentCategories: '',
        inventoryReceived: '',
        invoices: '',
        items: '',
        loadDB: '',
        lookupLists: '',
        missedAppointments: '',
        newIncident: '',
        newInvoice: '',
        newPatient: '',
        newRequest: '',
        newUser: '',
        outpatient: '',
        patientListing: '',
        priceProfiles: '',
        prices: '',
        printHeader: '',
        reports: '',
        requests: '',
        returnMedication: '',
        scheduleSurgery: '',
        theaterSchedule: '',
        "today'sAppointments": '',
        userRoles: '',
        users: '',
        workflow: ''
      }
    },
    operationReport: {
      labels: {
        additionalNotes: '',
        assistant: '',
        caseComplexity: '',
        operationDescription: '',
        preOpPrimaryDiagnosis: '',
        preOpSecondaryDiagnosis: '',
        surgeon: '',
        surgeryDate: ''
      },
      messages: { reportSaved: '' },
      titles: {
        editTitle: '',
        newTitle: '',
        reportSaved: ''
      }
    },
    operativePlan: {
      buttons: { completePlan: '' },
      labels: {
        additionalNotes: '',
        admissionInstructions: '',
        caseComplexity: '',
        completedStatus: '',
        droppedStatus: '',
        operationDescription: '',
        plannedStatus: '',
        status: '',
        surgeon: ''
      },
      messages: {
        planCompleted: '',
        planSaved: ''
      },
      titles: {
        editTitle: '',
        newTitle: '',
        planCompleted: '',
        planSaved: ''
      }
    },
    patients: {
      buttons: {
        addContact: '',
        addExpense: '',
        addFamilyMember: '',
        addOperativePlan: '',
        backToPatients: '',
        download: '',
        editOperativePlan: '',
        newAppointment: '',
        newImaging: '',
        newLab: '',
        newMedication: '',
        newPatient: '',
        newPhoto: '',
        newVisit: '',
        patientCheckIn: '',
        scheduleSurgery: ''
      },
      labels: {
        admissionDate: '',
        admit: '',
        bloodType: '',
        caption: '',
        civilStatus: '',
        clinic: '',
        contacts: '',
        cost: '',
        dateOfBirth: '',
        dateProcessed: '',
        dischargeDate: '',
        dob: '',
        education: '',
        email: '',
        externalPatientId: '',
        firstName: '',
        income: '',
        insurance: '',
        lastName: '',
        middleName: '',
        monthlyCost: '',
        occupation: '',
        operativePlan: '',
        parent: '',
        patientDays: '',
        patientType: '',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: '',
        placeOfBirth: '',
        primaryDiagnosis: '',
        referredBy: '',
        referredDate: '',
        relationship: '',
        relationships: '',
        religion: '',
        secondaryDiagnosis: '',
        sex: '',
        sexNotEntered: '',
        sources: '',
        status: '',
        totalMontlyExpense: ''
      },
      messages: {
        areYouSureDelete: '',
        createNewPatient: '',
        deletingPatient: '',
        noPatientsFound: '',
        notFoundQuickAdd: '',
        photoFileRequired: '',
        savedPatient: ''
      },
      navigation: {
        appointments: '',
        general: '',
        history: '',
        imaging: '',
        labs: '',
        medication: '',
        photos: '',
        socialWork: '',
        visits: ''
      },
      notes: {
        newNote: '',
        onBehalfOfCopy: '',
        onBehalfOfLabel: '',
        pleaseSelectAVisit: '',
        updateNote: ''
      },
      titles: {
        addContact: '',
        addPhoto: '',
        additionalContacts: '',
        admissionsDetail: '',
        admissionsSummary: '',
        admittedPatients: '',
        'delete': '',
        deleteContact: '',
        deleteExpense: '',
        deleteFamilyMember: '',
        deletePatientRecord: '',
        deletePhoto: '',
        diagnosticTesting: '',
        dischargesDetail: '',
        dischargesSummary: '',
        edit: '',
        editPhoto: '',
        expenses: '',
        familyInfo: '',
        familyInformation: '',
        'new': '',
        outpatientsForDate: '',
        patient: '',
        patientListing: '',
        patientReport: '',
        patientStatus: '',
        proceduresDetail: '',
        proceduresSummary: '',
        savedPatient: '',
        socialWork: '',
        todaysOutpatients: '',
        totalPatientDays: '',
        totalPatientDaysDetailed: '',
        visit: ''
      }
    },
    print: { invoice: {
        labels: {
          billedBy: '',
          billedDate: '',
          dateAdmitted: '',
          dateDischarged: '',
          dischargeNotes: '',
          patientAddress: '',
          patientAge: '',
          patientId: '',
          patientName: '',
          remarks: '',
          spacer: ''
        },
        messages: { whereConducted: '' },
        titles: {
          billingStatement: '',
          patientMember: '',
          patients: '',
          relContact: ''
        }
      } },
    procedures: {
      buttons: { addMedication: '' },
      labels: { medicationUsed: '' },
      messages: { saved: '' },
      titles: {
        addChargeItem: '',
        addMedicationUsed: '',
        deleteChargeItem: '',
        deleteMedicationUsed: '',
        edit: '',
        editChargeItem: '',
        editMedicationUsed: '',
        medicationUsed: '',
        'new': '',
        saved: ''
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '',
      usersPageTile: ''
    },
    visits: {
      buttons: {
        addDiagnosis: '',
        checkIn: '',
        checkOut: '',
        discharge: '',
        newAppointment: '',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: '',
        newVitals: ''
      },
      labels: {
        appointment: '',
        authoredBy: '',
        checkInTime: '',
        checkOutTime: '',
        createNewPatient: '',
        diagnosis: '',
        examiner: '',
        finalDiagnosis: '',
        haveAppointment: '',
        haveDoneOrders: '',
        noAppointment: '',
        ordersDone: '',
        ordersNotDone: '',
        patientToCheckIn: '',
        procedure: '',
        procedureDate: '',
        reasonForVisit: '',
        reportType: '',
        status: '',
        statusAdmitted: '',
        statusCheckedIn: '',
        statusCheckedOut: '',
        statusDischarged: '',
        visitDate: '',
        visitInformation: '',
        visitType: ''
      },
      messages: {
        checkOut: '',
        checkedOut: '',
        discharged: '',
        patientCheckedIn: '',
        patientCreatedAndCheckedIn: '',
        visitAndPatientSaved: '',
        visitSaved: ''
      },
      navigation: {
        charges: '',
        notes: '',
        orders: '',
        procedures: '',
        reports: '',
        vitals: ''
      },
      titles: {
        additionalDiagnoses: '',
        checkOut: '',
        checkedIn: '',
        checkedOut: '',
        discharged: '',
        editVisit: '',
        newVisit: '',
        patientCheckIn: '',
        visitSaved: ''
      }
    },
    vitals: { labels: {
        dateRecorded: '',
        dbp: '',
        heartRate: '',
        height: '',
        respiratoryRate: '',
        sbp: '',
        temperature: '',
        weight: ''
      } }
  };
});
define('hospitalrun/tests/locales/tr/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/tr/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/tr/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/locales/ur/translations', ['exports'], function (exports) {
  'use strict';

  exports['default'] = {
    admin: {
      address: {
        address1Label: 'ایڈریس 1 لیبل',
        address2Label: 'ایڈریس 2 لیبل',
        address3Label: 'ایڈریس 3 لیبل',
        address4Label: 'ایڈریس 4 لیبل',
        addressLabel: 'ایڈریس',
        editTitle: 'ایڈریس آپشنز',
        include1Label: '1 لیبل شامل کریں',
        include2Label: '2 لیبل شامل کریں',
        include3Label: '3 لیبل شامل کریں',
        include4Label: '4 لیبل شامل کریں',
        messages: { addressSaved: 'ایڈریس آپشنز محفوظ کرلیے گۓ ہیں' },
        newTitle: 'ایڈریس آپشنز',
        titles: { optionsSaved: 'آپشنز محفوظ ہوگۓ' }
      },
      addressOptions: 'ایڈرس آپشنز',
      customForms: {
        buttons: {
          addField: 'فیلڈ کا اضافہ کریں',
          moveDown: 'نیچے منتقل کریں',
          moveUp: 'اوپر منتقل کریں',
          newForm: '+ نیا فام',
          preview: 'مشاہدہ کریں'
        },
        labels: {
          alwaysInclude: 'ہمیشہ شامل',
          checkbox: 'چیک باکس',
          colSpan: 'پھیلاؤ کے کالموں کی تعداد',
          columns: 'کالم',
          customForm: 'کسٹم فام',
          dischargeReportFormType: '',
          formName: 'فارم کا نام',
          formType: 'فارم کی قسم',
          incidentFormType: '',
          includeOtherOption: 'دیگر آپشن شامل کریں',
          labFormType: '',
          label: 'لیبل',
          newForm: 'نیا فارم',
          opdReportFormType: '',
          operativePlanFormType: 'آپریٹو پلان اور رپورٹ',
          otherOptionLabel: 'دیگر آپشن لیبل',
          patientFormType: 'مریض',
          property: 'خصوصیت',
          radio: 'ریڈیو',
          select: 'ڈراپ ڈاؤن',
          socialworkFormType: 'سماجی کام',
          text: 'عبارت',
          textarea: 'بڑی عبارت',
          visitFormType: 'دورہ'
        },
        messages: { formSaved: 'فارم محفوظ ہوگیا ہے {{name}} ' },
        titles: {
          checkboxValues: 'چیک باکس میں قیمتیں',
          customForms: 'کسٹم فارمز',
          deleteForm: 'کسٹم فارم حذف کریں',
          dropDownValues: 'ڈراپ ڈاؤن فہرست',
          editCustomForm: 'کسٹم فارم میں ترمیم کریں',
          fields: 'قطعات',
          formSaved: 'فارم محفوظ ہوگیا',
          newCustomForm: 'نئے کسٹم فارم',
          radioValues: 'ریڈیو میں قیمتیں'
        }
      },
      header: {
        editTitle: '',
        facilityName: '',
        headerLabel: '',
        headerLine1: '',
        headerLine2: '',
        headerLine3: '',
        logoURL: '',
        messages: { headerSaved: '' },
        newTitle: '',
        titles: { optionsSaved: '' }
      },
      loadDb: 'DB لوڈ کریں',
      loaddb: {
        displayAlertMessage: 'لوڈ کرنے کے لئے فائل کو منتخب کیجیے.',
        displayAlertTitle: 'لوڈ کرنے کے لئے فائل کو منتخب کریں',
        editTitle: 'DB لوڈ کریں',
        errorDisplayAlertMessage: 'ڈیٹا بیس امپورٹ نہیں ہوسکتی. یہ خامی  ہے {{error}}',
        errorDisplayAlertTitle: 'لوڈ کرنے میں خامی',
        progressMessage: 'آپ کا ڈیٹابیس لوڈ کیا جا رہا ہے، براۂ مہربانی انتظار کریں.',
        progressTitle: 'ڈیٹابیس لوڈ ہو رہا ہے'
      },
      lookup: {
        aisleLocationList: 'انوینٹری راہداری مقامات',
        alertImportListMessage: 'امپورٹ کرنے کے لئے فائل کو منتخب کیجیے',
        alertImportListSaveMessage: 'تلاش فہرست امپورٹ ہو گئی ہے.',
        alertImportListSaveTitle: 'لسٹ امپورٹ ہوگئ',
        alertImportListTitle: 'امپورٹ کرنے کے لئے فائل کو منتخب کریں',
        alertImportListUpdateMessage: 'تلاش فہرست محفوظ ہو گئی ہے.',
        alertImportListUpdateTitle: 'فہرست محفوظ',
        anesthesiaTypes: 'اینستھیزیا کی اقسام',
        anesthesiologists: 'اینستھیسیالوجسٹس',
        billingCategories: 'بلنگ کی اقسام',
        clinicList: 'کلینک مقامات',
        countryList: 'ممالک',
        cptCodeList: 'CPT کوڈز',
        diagnosisList: 'تشخیص',
        edit: { template: {
            addTitle: 'قیمت شامل کریں',
            editTitle: 'قیمت ترمیم کریں',
            labelTitle: 'قدر',
            updateButtonTextAdd: 'شامل کریں',
            updateButtonTextUpdate: 'اپ ڈیٹ'
          } },
        expenseAccountList: 'اخراجات اکاؤنٹس',
        imagingPricingTypes: 'امیجنگ قیمتوں کا تعین کی اقسام',
        incidentDepartments: '',
        inventoryTypes: 'انوینٹری کی اقسا م',
        labPricingTypes: 'لیب کی قیمتوں کا تعین کی اقسام',
        pageTitle: 'تلاش فہرستیں',
        patientStatusList: 'مریض سٹیٹس کی فہرست',
        physicianList: 'ڈاکٹر',
        procedureList: 'طریقہ کار',
        procedureLocations: 'طریقہ کار مقامات',
        procedurePricingTypes: 'ضابطے کی قیمتوں کا تعین کی اقسام',
        radiologists: 'ریڈیولوجسٹ',
        titles: { deleteLookupValue: 'قدر حذف کریں' },
        unitTypes: 'یونٹ کی اقسام',
        vendorList: 'وینڈر',
        visitLocationList: 'دورہ مقامات',
        visitTypes: 'دورہ کی اقسا م',
        wardPricingTypes: 'وارڈ کی قیمتوں کا تعین کی اقسام',
        warehouseList: 'انوینٹری مقامات'
      },
      lookupLists: 'تلاش فہرستیں',
      roles: {
        capability: {
          addAllergy: 'الرجی کا اضافہ کریں',
          addAppointment: 'ملاقات اضافہ',
          addBillingDiagnosis: 'بلنگ تشخیص شامل کریں',
          addCharge: 'چارج شامل کریں',
          addDiagnosis: 'تشخیص کے لئے شامل کریں',
          addImaging: 'امیجنگ کا اضافہ کریں',
          addIncident: '',
          addIncidentCategory: '',
          addInventoryItem: 'انوینٹری آئٹم شامل کریں',
          addInventoryPurchase: 'انوینٹری کی خریداری شامل کریں',
          addInventoryRequest: 'انوینٹری کی درخواست شامل کریں',
          addInvoice: 'رسید شامل کریں',
          addLab: 'لیب شامل کریں',
          addMedication: 'ادویات شامل',
          addNote: 'نوٹ شامل',
          addOperationReport: 'آپریشن رپورٹ شامل کریں',
          addOperativePlan: 'آپریٹو پلان شامل کریں',
          addPatient: 'مریض شامل کریں',
          addPayment: 'ادائیگی شامل کریں',
          addPhoto: 'تصویر کا اضافہ کریں',
          addPricing: 'قیمتوں کا تعین شامل کریں',
          addPricingProfile: 'قیمتوں کا تعین پروفائل شامل کریں',
          addProcedure: 'ضابطے شامل کریں',
          addSocialwork: 'سوشل ورک شامل',
          addVisit: 'دورہ شامل کریں',
          addVitals: 'vitals شامل کریں',
          adjustInventoryLocation: 'انوینٹری مقام کو درست کریں',
          admin: 'انتظامیہ',
          admitPatient: 'مریض جمع کریں',
          appointments: 'ملاقاتیں',
          billing: 'بلنگ',
          completeImaging: 'مکمل امیجنگ',
          completeLab: 'مکمل لیب',
          defineUserRoles: 'صارف کے کردار کی وضاحت کریں',
          deleteAppointment: 'ملاقات حذف کریں',
          deleteDiagnosis: 'تشخیس حذف کریں',
          deleteImaging: 'امیجنگ حذف کریں',
          deleteIncident: '',
          deleteIncidentCategory: '',
          deleteInventoryItem: 'حذف انوینٹری آئٹم',
          deleteInvoice: 'رسید کو حذف کریں',
          deleteLab: 'لیب حذف کریں',
          deleteMedication: 'ادویات حذف کریں',
          deleteNote: 'نوٹ حذف کریں',
          deletePatient: 'مریض کو حذف کریں',
          deletePhoto: 'تصویر حذف',
          deletePricing: 'قیمتوں کا تعین حذف کریں',
          deletePricingProfile: 'قیمتوں کا تعین پروفائل حذف کریں',
          deleteProcedure: 'ضابطہ حذف کریں',
          deleteSocialwork: 'سماجی کام حذف کریں',
          deleteVisit: ' دورہ حذف کریں',
          deleteVitals: ' vitals حذف کریں',
          dischargePatient: 'تخریج مریض',
          editInvoice: 'رسید میں ترمیم کریں',
          fulfillInventory: 'انوینٹری پورا کریں',
          fulfillMedication: 'ادویات پورا کریں',
          generateIncidentReport: '',
          imaging: 'امیجنگ',
          incident: '',
          inventory: 'انوینٹری',
          invoices: 'رسیدیں',
          labs: 'لیبز',
          loadDb: 'لوڈ کریں ڈیٹا بیس',
          manageIncidents: '',
          medication: 'ادویات',
          overrideInvoice: 'رسید کو منسوخ کردے',
          patientReports: 'مریض کی رپورٹیں',
          patients: 'مریض',
          pricing: 'قیمتوں کا تعین',
          updateConfig: 'اپ ڈیٹ کی ترتیب',
          visits: 'دورے'
        },
        messages: { roleSaved: '{{roleName}} کردار محفوظ ہوگیا ہے.' },
        titles: { roleSaved: 'کردار محفوظ ہوگیا ہے' }
      },
      userRoles: 'صارف کے کردار',
      users: 'صارفین',
      visitForms: {
        labels: {
          followup: 'فالواپ',
          form: 'فارم',
          initial: 'ابتدائی',
          visitType: 'دورہ کی قسم'
        },
        titles: { visitForms: 'دورہ فارم' }
      },
      workflow: {
        admissionDepositLabel: 'داخلہ جمع کی ضرورت',
        clinicPrepaymentLabel: 'کلینک قبل از استعمال ادائیگی کی ضرورت',
        editTitle: 'ورک فلو آپشنز',
        followupPrepaymentLabel: 'تعاقب قبل از استعمال ادائیگی کی ضرورت',
        messages: { optionsSaved: 'ورک فلو آپشنز محفوظ ہوگۓ ہیں' },
        newTitle: 'ورک فلو آپشنز',
        outpatientImagingLabel: 'بیرونی مریض کی امیجنگ قبل از استعمال ادائیگی کی ضرورت',
        outpatientLabLabel: 'بیرونی مریضوں کی لیب قبل از استعمال ادائیگی کی ضرورت',
        outpatientMedicationLabel: 'بیرونی مریضوں کی ادویات قبل از استعمال ادائیگی کی ضرورت',
        titles: { optionsSaved: 'آپشنز محفوظ ہوگۓ' },
        workflowLabel: 'فلو آپشنز'
      }
    },
    alerts: {
      errorExclamation: 'خرابی !!!!',
      pleaseWait: 'برائے مہربانی انتظار کریں',
      reportError: ' رپورٹ کی تیاری میں خرابی',
      warningExclamation: 'انتباہ !!!!'
    },
    allergies: {
      buttons: { addAllergy: 'الرجی شامل کریں' },
      labels: {
        allergyName: 'نام',
        patientAllergy: 'مریض کی الرجی'
      },
      titles: {
        addAllergy: 'الرجی شامل کریں',
        editAllergy: 'الرجی میں ترمیم کریں'
      }
    },
    application: {
      messages: { sessionExpired: 'آپ کا سیشن متروک ہو گیا ہے۔ کاروائی جاری رکھنے کے لاگ ان کریں' },
      titles: { sessionExpired: 'سیشن کی مدت ختم ہوگئی' }
    },
    appointments: {
      buttons: {
        newButton: '+ نئی ملاقات',
        scheduleSurgery: ' + سرجری کا وقت مقرر کریں'
      },
      calendarTitle: ' ملاقات کا کیلنڈر',
      currentScreenTitle: 'ملاقات کی فہرست',
      editTitle: 'ملاقات میں ترمیم کریں',
      labels: {
        noLocation: 'کوئی مقام نہیں',
        selectedStartingDate: 'اس تاریخ پر یا اس کے بعد کی ملاقاتیں دیکھیں'
      },
      messages: {
        appointmentSaved: '  - مریض کے  ساتھ ملاقات محفوظ کر لی گئی ہے {{patient}}',
        endTimeLaterThanStart: 'براہ مہربانی وقت آغاز کے بعد کا ختم وقت منتخب کریں۔'
      },
      missed: 'چوک جانے والی ملاقاتیں',
      newTitle: 'نئی ملاقات',
      searchTitle: 'ملاقاتیں تلاش کریں',
      sectionTitle: 'ملاقاتیں',
      thisWeek: 'اس ہفتہ کی ملاقاتیں',
      titles: {
        appointmentSaved: 'ملاقات محفوظ کر لی گئی',
        editSurgicalAppointment: 'سرجری کی ملاقات میں ترمیم کریں',
        newSurgicalAppointment: 'نئی سرجری کی ملاقات',
        theaterSchedule: 'تھیٹر اوقات نامہ'
      },
      todayTitle: 'آج کی ملاقاتیں'
    },
    billing: {
      alerts: {
        noInvoiceFound: 'کوئی رسید نہیں ملی',
        noPricingItems: 'کوئی قیمتوں کے تعیں والی اشیاء نہیں ملی',
        noPricingProfiles: 'کوئی قیمتوں کے تعیں والی پروفائل نہیں ملی'
      },
      buttons: {
        addOverride: 'منسوخ شامل کریں',
        createInvoice: 'ایک رسید بنائیں؟'
      },
      labels: {
        actualCharges: 'اصل قیمت',
        discountAmount: 'ڈسکاؤنٹ رقم',
        discountPercentage: 'رعایت فی صد',
        externalInvoiceNumber: 'بیرونی رسید #',
        hmoCom: 'HMO / COM',
        insurance: 'قومی بیمہ',
        paymentProfile: 'ادائیگی پروفائل',
        paymentsDeposits: 'ادائیگی / جمع کھاتہ',
        pricingPanelOverrides: 'قیمتوں کا تعین پروفائل کی منسوخی',
        pricingProfile: 'قیمتوں کا تعین پروفائل'
      }
    },
    buttons: {
      add: 'شامل کریں',
      addItem: 'آئٹم شامل کریں',
      addLineItem: 'لائن آئٹم شامل کریں',
      addValue: 'قیمت جمع کریں',
      addVisit: 'دورہ میں شامل کریں',
      allRequests: 'تمام درخواستیں',
      barcode: 'بارکوڈ',
      cancel: 'منسوخ کریں',
      clear: 'صاف',
      close: 'بند کریں',
      complete: 'مکمل',
      'delete': 'حذف کریں',
      dispense: 'تقسیم',
      edit: 'تصیح',
      filter: 'فلٹر',
      fulfill: 'پورا کریں',
      'import': ' امپورٹ کریں',
      loadFile: 'فائل لوڈ کریں',
      newItem: '+ نیا آئٹم',
      newNote: 'نیا نوٹ',
      newRequest: 'نئی درخواست',
      newRequestPlus: '+ نئی درخواست',
      newUser: 'نیا صارف',
      ok: 'ٹھیک ہے',
      remove: 'دور کریں',
      returnButton: 'واپسی',
      search: 'تلاش کریں',
      showAll: 'سارے دکھائیں',
      showFewer: 'کم دکھائیں',
      update: 'اپ ڈیٹ'
    },
    components: {
      chargesByTypeTab: { charges: 'چارجز' },
      customFormManager: { buttons: { addForm: 'فارم کا اضافہ کریں' } },
      dateTimePicker: {
        amHour: '{{hour}} AM',
        midnight: 'آدھی رات',
        noon: 'دوپہر',
        pmHour: '{{hour}} PM'
      },
      imageUpload: { messages: { selectValidImageFile: '' } },
      operativeProcedures: {
        buttons: { addProcedure: 'ضابطے شامل کریں' },
        labels: { procedure: 'طریقہ کار' },
        titles: { procedures: 'طریقہ کار/ ضابطے' }
      },
      patientOrders: {
        buttons: {
          newImaging: 'نئی امیجنگ',
          newLab: 'نئی لیب',
          newMedication: 'نئی ادویات'
        },
        labels: {
          imagingOrderType: 'امیجنگ',
          labOrderType: 'لیب',
          medicationOrderType: 'ادویات',
          orderType: 'آرڈر کی قسم'
        }
      },
      priceList: { charges: '{{pricingType}} چارجز' },
      quantityCalc: { result: '{{targetUnit}} کل: {{calculated}}' },
      quantityConv: {
        conversion: ' میں کیا شامل ہے؟ {{name}} 1',
        unit: 'اکائی'
      },
      sortableColumn: { labels: { selectAll: '(تمام منتخب کریں)' } },
      takePhoto: {
        camera: 'کیمرہ',
        how: 'آپ ایک تصویر کو کس طرح شامل کرنا چاہتے ہیں؟',
        labels: {
          takeAPicture: '',
          uploadAFile: ''
        },
        photo: 'تصویر',
        preview: 'پیش نظارہ',
        takePhoto: 'تصویر کھینچیں',
        uploadFile: 'فائل اپ لوڈ کریں'
      },
      upcomingAppointments: {
        labels: {
          date: 'تاریخ',
          location: 'مقام',
          type: 'قسم',
          'with': 'کے ساتھ'
        },
        titles: { upcomingAppointments: 'عنقریب آنے والی ملاقاتیں' }
      }
    },
    customForms: {
      buttons: { addForm: 'فارم شامل کریں' },
      labels: { formToAdd: 'شامل کرنے کے لئے فارم' },
      titles: { addCustomForm: 'کسٹم فارم شامل کریں' }
    },
    dashboard: {
      setup: '',
      title: 'آپ کیا کرنا چاہیں گے؟'
    },
    dates: {
      'long': 'دن {{days}} مہینے {{months}} سال {{years}}',
      longOmitDays: 'مہینے {{months}} سال {{years}}',
      longOmitDaysPlural: 'مہینے {{months}} سال {{years}}',
      longOmitDaysYears: 'مہینے {{months}}',
      longOmitYears: 'دن {{days}} مہینے {{months}}',
      longPlural: 'دن {{days}} مہینے {{months}} سال {{years}}',
      'short': 'د{{days} م{{months}} س{{years}}',
      shortOmitYears: 'د{{days} م{{months}}'
    },
    diagnosis: {
      labels: {
        activeDiagnosis: 'فعال تشخیص',
        date: 'تاریخ',
        diagnosis: 'تشخیص',
        secondaryDiagnosis: 'ثانوی تشخیص'
      },
      titles: {
        addDiagnosis: 'تشخیص کے لئے شامل کریں',
        editDiagnosis: 'تشخیص میں ترمیم کریں'
      }
    },
    errors: {
      accepted: 'قبول کرنا ضروری',
      blank: 'خالی نہیں رہ سکتی',
      confirmation: 'کے مماثل نہیں ہے {{attribute}}',
      empty: 'خالی نہیں ہو سکتا',
      equalTo: 'کے برابر ہونا چاہیے {{count}}',
      even: 'جفت ہونا ضروری ہے',
      exclusion: 'مخصوص ہے',
      greaterThan: 'سے زیادہ ہونا چاہیے {{count}}',
      greaterThanOrEqualTo: 'سے زیادہ یا برابر ہونا چاہیے {{count}}',
      inclusion: 'فہرست میں شامل نہیں ہے',
      invalid: 'غلط ہے',
      invalidNumber: 'درست نمبر نہیں',
      lessThan: 'سے کم ہونا چاہیے {{count}}',
      lessThanOrEqualTo: 'سے کم یا برابر ہونا چاہیے {{count}}',
      notANumber: 'ایک نمبر نہیں ہے',
      notAnInteger: 'ایک عددی ہونا لازمی ہے',
      odd: 'طاق ہونا ضروری ہے',
      otherThan: 'سے مختلف ہونا چاہیے {{count}}',
      present: 'خالی ہونا ضروری ہے',
      result: 'براے مہربانی مکمل کرنے سے پہلے نتیجہ درج کریں',
      tooLong: 'حروف {{count}}بہت طویل ہے، زیادہ سے زیادہ ',
      tooShort: 'حروف{{count}}بہت مختصر ہے کم از کم ',
      wrongLength: 'حروف ہونے چاہئے{{count}}غلط لمبائی ہے '
    },
    headings: { chargedItems: 'چارج اشیا' },
    imaging: {
      alerts: {
        completedMessage: 'امیجنگ درخواست کو مکمل کیا گیا ہے',
        completedTitle: 'امیجنگ درخواست مکمل',
        savedMessage: 'امیجنگ درخواست کو محفوظ کر لیا گیا ہے۔',
        savedTitle: 'امیجنگ گذارش بچا لیا'
      },
      buttons: { newButton: '+ نئے امیجنگ' },
      labels: {
        addNewVisit: '--- نیا دورہ شامل کریں ---',
        radiologist: 'ریڈیولوجسٹ'
      },
      messages: { noCompleted: 'کوئی مکمل اشیاء نہیں موجود۔' },
      pageTitle: 'امیجنگ درخواستیں',
      sectionTitle: 'امیجنگ',
      titles: {
        completedImaging: 'امیجنگ مکمل',
        editTitle: 'امیجنگ ترمیم کی گذارش',
        newTitle: 'نئے امیجنگ گذارش'
      }
    },
    incident: {
      buttons: {
        add: '',
        addForm: '',
        addItem: '',
        cancel: '',
        'delete': '',
        download: '',
        edit: '',
        'export': '',
        generateRep: '',
        newAttachment: '',
        newCategory: '',
        newIncident: '',
        newNote: ''
      },
      labels: {
        actions: '',
        addedBy: '',
        category: '',
        categoryItem: '',
        date: '',
        dateRecorded: '',
        department: '',
        description: '',
        endDate: '',
        givenBy: '',
        howToAddAttachment: '',
        incidentDate: '',
        incidentId: '',
        item: '',
        lastUpdated: '',
        note: '',
        patientId: '',
        patientImpacted: '',
        reportType: '',
        reportedBy: '',
        reportedDate: '',
        reportedTo: '',
        sentinelEvent: '',
        startDate: '',
        status: '',
        statusActive: '',
        statusClosed: '',
        statusFollowup: '',
        statusReported: '',
        title: '',
        total: '',
        updatedBy: ''
      },
      messages: {
        attachmentFileRequired: '',
        createNew: '',
        createNewIncidentCategory: '',
        fillIn: '',
        incidentCategorySaved: '',
        noClosedIncidents: '',
        noIncidentCategoriesFound: '',
        noIncidents: '',
        saved: '',
        selectExistingPatient: ''
      },
      titles: {
        addAttachment: '',
        addCategoryItem: '',
        addNote: '',
        attachments: '',
        closed: '',
        current: '',
        deleteAttachment: '',
        deleteIncident: '',
        deleteIncidentCategory: '',
        deleteItem: '',
        deleteNote: '',
        editAttachment: '',
        editIncident: '',
        editIncidentCategory: '',
        editNote: '',
        general: '',
        history: '',
        incidentCategories: '',
        incidentCategoryItem: '',
        incidentCategoryName: '',
        incidentCategorySaved: '',
        incidentSaved: '',
        incidents: '',
        incidentsByCategory: '',
        incidentsByDepartment: '',
        newIncident: '',
        newIncidentCategory: '',
        notes: '',
        reports: ''
      }
    },
    inventory: {
      edit: {
        cost: 'فی یونٹ لاگت:',
        delivered: 'وصول کنندہ:',
        location: 'مقام کی درستگی:',
        prescription: 'نسخہ براۓ:',
        pulled: 'سے نکالا:',
        quantity: 'تکمیل پر مقدار:',
        reason: 'وجہ:',
        returned: 'مریض سے واپس',
        transferredFrom: 'سے منتقل:',
        transferredTo: 'میں منتقل کر دیا:'
      },
      labels: {
        action: 'عمل',
        add: 'شامل کریں',
        addAdjustmentType: '',
        adjust: 'درست کریں',
        adjustmentDate: 'درستگی کی تاریخ',
        adjustmentFor: 'درستگی براۓ',
        adjustmentType: 'درستگی کی قسم',
        aisle: 'راہداری',
        aisleLocation: 'راہداری مقام',
        allInventory: 'تمام انوینٹری',
        allItems: 'تمام چیزیں',
        availableQuantity: '{{quantity}} دستیاب',
        billTo: 'کا بل',
        consumePurchases: 'کھپت خریداریاں',
        consumptionRate: 'کھپت کی شرح',
        cost: 'لاگت',
        costPerUnit: 'فی یونٹ لاگت',
        crossReference: 'دوطرفی حوالہ',
        currentQuantity: 'موجودہ مقدار',
        dateCompleted: 'تاریخ مکمل',
        dateEffective: 'تاریخ نافذ',
        dateEnd: 'آخری تاریخ',
        dateReceived: 'تاریخ موصولی',
        dateStart: 'شروع کرنے کی تاریخ',
        dateTransferred: 'تاریخ منتقل',
        daysLeft: 'دن باقی',
        deleteItem: 'آٹم حذف کریں',
        deliveryAisle: 'ڈلیوری راہداری',
        deliveryLocation: 'ترسیل کے محل وقوع',
        details: 'تفصیلات دیکھیں',
        distributionUnit: 'تقسیم کا یونٹ',
        editItem: 'آٹم میں ترمیم',
        expense: 'کرنے کے اخراجات',
        expirationDate: 'میعاد ختم ہونے کی تاریخ',
        fulfillRequest: 'درخواست کو پورا کریں',
        fulfillRequestNow: 'ابھی درخواست کو پورا کریں',
        gift: 'خیراتی تحفہ',
        giftInKindNo: 'نہیں',
        giftInKindYes: 'ہاں',
        giftUsage: 'خیراتی تحفہ کا استعمال',
        inventoryConsumed: 'انوینٹری کھپت',
        inventoryItem: 'انوینٹری آئٹم',
        inventoryObsolence: 'متروک انوینٹری',
        invoiceItems: 'رسید اشیاء',
        invoiceLineItem: 'رسید لائن آئٹم',
        invoiceNumber: 'رسید نمبر',
        item: 'آئٹم',
        itemNumber: 'آئٹم نمبر',
        items: 'اشیاء',
        location: 'مقام',
        locations: 'مقامات',
        markAsConsumed: 'خرچ شدہ کے طور پر درج کریں',
        name: 'نام',
        newItem: 'نئی آٹم',
        originalQuantity: 'اصل مقدار',
        print: 'پرنٹ',
        printBarcode: 'پرنٹ بارکوڈ',
        printer: 'پرنٹر',
        pullFrom: 'سے ھیںچو',
        purchaseCost: 'خریداری کی لاگت',
        purchaseInfo: 'خریداری کی معلومات',
        purchases: 'خریداری',
        quantity: 'مقدار ({{unit}})',
        quantityAvailable: 'دستیاب مقدار',
        quantityOnHand: 'موجودہ مقدار',
        quantityRequested: ' درخواست کی گئی مقدار',
        rank: 'درجہ',
        reason: 'وجہ',
        remove: 'دور کریں',
        removeAdjustmentType: '',
        reorderPoint: ' پوائنٹ پھر ترتیب کریں',
        requestedItems: 'درخواست کی گئی اشیاء',
        returnAdjustmentType: '',
        returnToVendorAdjustmentType: '',
        salePricePerUnit: 'فی یونٹ فروخت کی قیمت',
        save: 'محفوظ کریں',
        serialNumber: 'سیریل / لوٹ نمبر',
        total: 'کل',
        totalCost: 'کل لاگت',
        totalReceived: 'کل موصول: {{total}}',
        transaction: 'ٹرانزیکشن',
        transactions: 'ٹرانزیکشنز',
        transfer: 'منتقلی',
        transferFrom: 'سے منتقلی',
        transferTo: 'مقام پر منتقلی',
        transferToAisle: 'مقام راہداری پر منتقلی',
        unit: 'یونٹ',
        unitCost: 'یونٹ کی لاگت',
        vendor: 'وینڈر',
        vendorItemNumber: 'وینڈر آئٹم نمبر',
        writeOffAdjustmentType: '',
        xref: 'XRef'
      },
      messages: {
        adjust: ' فرق کے تخمینہ کے لئے مناسب جگہ (جگہوں) پر مقدار کو ٹھیک کریں {{difference }}.',
        createRequest: 'ایک نئی درخواست بنائیں؟',
        itemNotFound: '<br> ورنہ واپس جانے کے لیے منسوخ کا بٹن دبائیں  <br> اگر آپ ایک نیا انونٹری آئٹم تخلیق کرنا چاہتے ہیں تو ذیل میں معلومات درج کریں۔  <strong>{{item}}</strong>انونٹری آئٹم نہیں ملا۔ ',
        loading: 'ٹراسیکشنر لوڈ ہو رہی ہے۔۔۔',
        noItems: 'کوئی آئٹم نہیں ملا۔',
        noRequests: 'کوئی درخواستیں نہیں ملی۔',
        purchaseSaved: 'انونٹری کی خریداری کو کامیابی سے محفوظ کر لیا گیا ہے۔',
        quantity: ' کے مقامات میں کل مقدار سے مماثل نہیں ہے <strong>({{locationQuantity}})</strong>کی کل مقدار <strong>({{quantity}})</strong>',
        removeItem: ' آپ کو یقین ہے کہ آپ اس آٹم کو رسید سے ہٹانا چاہتے ہیں؟',
        removeItemRequest: ' آپ کو یقین ہے کہ آپ اس آٹم کو درخواست سے ہٹانا چاہتے ہیں؟',
        requestFulfilled: 'انونٹری کی درخواست پوری ہو گئی.',
        requestUpdated: 'انونٹری درخواست کو اپ ڈیٹ کر دیا گیا ہے.',
        warning: 'ضروری ہے (* کے نشان والے) قطعات میں بھرنا اور شامل کرنے سے پہلے غلطیوں کو درست کریں۔'
      },
      reports: {
        adjustment: 'تفصیلی درستگی',
        daysSupply: 'اسٹاک میں دنوں کی فراہمی',
        expenseDetail: 'تفصیلی اخراجات',
        expenseSum: 'خلاصہ اخراجات',
        expiration: 'میعاد ختم ہونے کی تاریخ',
        'export': 'ایکسپورٹ رپورٹ',
        fields: ' شامل کرنے کے قطعات',
        finance: 'مالیات کا خلاصہ',
        generate: 'رپورٹ بنائیں',
        invLocation: 'محل وقوع کے اعتبار انوینٹری',
        invValuation: 'انوینٹری کی مالیت',
        purchaseDetail: 'تفصیلی خرید',
        purchaseSum: 'خلاصہ خرید',
        reportType: 'رپورٹ کی قسم',
        rows: {
          adjustments: 'درستگیاں',
          adjustmentsTotal: 'کل درستگیاں',
          balanceBegin: 'ابتدائی بقایا رقم',
          balanceEnd: 'اختمام پر بقایا رقم',
          category: 'قسم',
          consumed: 'کھپت',
          consumedGik: 'کی کھپت GiK',
          consumedGikTotal: 'کی کھپت GiK کل',
          consumedPuchases: 'خریداری کی کھپت',
          consumedPurchasesTotal: 'کل خریداری کی کھپت',
          consumedTotal: 'کل کھپت',
          errInFinSum: '_generateFinancialSummaryReport میں خرابی: ',
          errInFindPur: '_findInventoryItemsByPurchase میں خرابی: ',
          errInFindReq: '_findInventoryItemsByRequest میں خرابی: ',
          expensesFor: 'کے لئے اخراجات: ',
          noAccount: '(کوئی اکاؤنٹ نہیں)',
          subtotal: 'ذیلی کل: ',
          subtotalFor: '{{account}} - {{category}}ذیلی کل ',
          total: 'کل: ',
          totalFor: ' کل براۓ {{var}}: ',
          totalPurchases: 'کل خریداری',
          transfer1: '{{quantity }} سے {{location }}',
          trasnfer2: '{{target}} :براۓ{{source}} :منجانب'
        },
        stockTransferDetail: 'تفصیلی اسٹاک کی منتقلی',
        stockTransferSum: 'خلاصہ اسٹاک کی منتقلی',
        stockUsageDetail: 'تفصیلی اسٹاک استعمال',
        stockUsageSum: 'خلاصہ اسٹاک استعمال',
        titleDateRange: '{{startDate}} - {{endDate}} رپورٹ {{name}}',
        titleSingleDate: '{{date}} رپورٹ {{name}}'
      },
      titles: {
        addPurchase: 'خریداری شامل کریں',
        addRequest: 'نئی درخواست',
        adjustment: 'درستگی',
        editPurchase: 'خریداری میں ترمیم کریں',
        editRequest: 'تصیح کی گذارش',
        inventoryItem: 'نئے انوینٹری آئٹم',
        inventoryReport: 'انوینٹری کی رپورٹ',
        purchaseSaved: 'انوینٹری خریداریاں محفوظ کرلی',
        quickAddTitle: 'نئے انوینٹری آئٹم',
        removeItem: 'آئٹم ہٹائیں',
        requestFulfilled: 'درخواست پوری',
        requestUpdated: 'درخواست اپ ڈیٹ ہوگئی',
        transfer: ' اشیا منتقل کریں',
        warning: 'انتباہ!!!'
      }
    },
    labels: {
      action: 'عمل',
      actions: 'عوامل',
      addNewOutpatientVisit: 'نۓ بیرنی مریض کے لیے دورہ کا اضافہ کریں',
      address: 'ایڈریس',
      age: 'عمر',
      allDay: 'تمام دن',
      amount: 'رقم',
      anesthesia: 'اینستھیزیا',
      assisting: 'مدد',
      balanceDue: 'واجب الادا',
      billDate: 'بل تاریخ',
      billTo: 'کا بل',
      category: 'قسم',
      completed: 'مکمل',
      country: 'ملک',
      cptcode: 'CPT کوڈ',
      creditTo: 'کرنے کے لئے کریڈٹ',
      date: 'تاریخ',
      dateCompleted: 'تاریخ مکمل',
      dateOfBirth: 'پیدائش کی تاریخ',
      dateOfBirthShort: 'DOB',
      datePaid: 'تاریخ ادا',
      dateRequested: 'درخواست کی تاریخ',
      'delete': 'حذف کریں',
      deleteRequest: 'درخواست حذف کریں',
      deleteUser: 'صارف حذف کریں',
      department: 'محکمہ',
      description: 'تفصیل',
      discount: 'رعایت',
      displayName: 'دکھانے کے لیے نام',
      docRead: 'دستاویزات پڑھیں',
      docWritten: 'ڈاکس سے تحریری',
      edit: 'تصیح',
      editUser: 'صارف میں ترمیم کریں',
      email: 'ای میل',
      endDate: 'تاریخ اختتام',
      endTime: 'آخر وقت',
      excess: 'اضافی',
      expenseTo: 'کرنے کے اخراجات',
      fileLoadSuccessful: ' فائل لوڈ کامیابی سے ہو گئ',
      fileName: 'فائل کا نام',
      fileToLoad: ' لوڈ کے لیے فائل',
      fulfill: 'پورا کریں',
      fulfillRequest: 'درخواست کو پورا کریں',
      fulfillRequestNow: 'ابھی درخواست کو پورا کریں',
      fulfilled: 'پوری کر دی گئ',
      grandTotal: 'مجموعی عدد',
      id: 'آئی ڈی',
      imageOrders: 'امیج آرڈرز',
      imagingType: 'امیجنگ قسم',
      importFile: 'امپورٹ فائل',
      invoiceId: 'رسید کی آئی ڈی',
      labOrders: 'لیب آرڈرز',
      lineItems: 'لائن آئٹمز',
      loading: 'لوڈ کر رہا ہے',
      location: 'مقام',
      lookupType: 'تلاش قسم',
      medication: 'ادویات',
      name: 'نام',
      newUser: 'نیا صارف',
      note: 'نوٹ',
      notes: 'نوٹس',
      number: 'نمبر',
      on: 'پر',
      password: 'پاس ورڈ',
      patient: 'مریض',
      payments: 'ادائیگیاں',
      physician: 'فزیشن',
      prescriber: 'تجویز کنندہ',
      prescription: 'نسخے',
      prescriptionDate: 'نسخے تاریخ',
      price: 'قیمت',
      print: '',
      procedures: 'طریقہ کار',
      provider: 'مھیا کرنے والا',
      pullFrom: 'سے کھیںچو',
      quantity: 'تعداد',
      remarks: 'تبصرہ',
      requestedBy: 'کی طرف سے درخواست',
      requestedOn: 'پر درخواست',
      requests: 'درخواستیں',
      result: 'نتیجہ',
      results: 'نتائج',
      role: 'کردار',
      search: 'تلاش کریں',
      sex: 'جنس',
      startDate: 'شروع کرنے کی تاریخ',
      startTime: 'وقت آغاز',
      status: 'صورتحال',
      takenBy: '',
      total: 'کل',
      type: 'قسم',
      userCanAddNewValue: 'صارف نئی اقدار کا اضافہ کر سکتے ہیں',
      username: 'یوزر نیم',
      value: 'قدر',
      view: '',
      visit: 'دورہ',
      'with': 'ساتھ'
    },
    labs: {
      alerts: {
        requestCompletedMessage: 'لیب کی درخواست مکمل ہو گئی ہے',
        requestCompletedTitle: 'لیب درخواست مکمل',
        requestSavedMessage: 'لیب کی درخواست محفوظ ہو گئی ہے۔',
        requestSavedTitle: 'لیب کی درخواست محفوظ'
      },
      buttons: { newButton: '+ نئی لیب' },
      completedTitle: 'مکمل لیبز',
      deleteTitle: 'درخواست حذف کریں',
      editTitle: 'لیب میں ترمیم کی درخواست',
      labels: {
        addNewVisit: '۔۔ نیا دورہ شامل کریں ۔۔',
        labType: 'لیب کی قسم'
      },
      messages: {
        createNewRecord: 'ایک نیا ریکارڈ بنائیں؟',
        noCompleted: 'کوئی مکمل آئٹم موجود نہیں',
        noItemsFound: 'کوئی لیب موجود نہیں'
      },
      newTitle: 'نئے لیب کی گذارش',
      requestsTitle: 'لیب درخواستیں',
      sectionTitle: 'لیبز'
    },
    loading: {
      messages: {
        '0': 'سب سے تیز تیتلی پرواز کی رفتار فی گھنٹہ 12 میل ہے. کچھ کیڑے 25 میل فی گھنٹہ کی رفتار سے پرواز کر سکتے ہیں',
        '1': ' پرندے میں صرف اللو ہیں جو نیلا رنگ دیکھ سکتے ہیں',
        '2': 'بلی کی 100 مختلف آوازیں ہیں؛ کتے کی صرف 10 ہیں',
        '3': 'انسان تقریر میں 72 مختلف پٹھوں کی کل استعمال کرتے ہیں',
        '4': ' افریقہ کے براعظم میں 1،000 سے زائد مختلف زبانیں بولی جاتی ہیں',
        '5': ' اراۓتھروفوب وہ ہے جو آسانی سے شرما جاۓ ',
        '6': 'دنیا میں سب سے زیادہ عام فوبیا درد کا خوف ہے جو اوڈاۓنوفوبیا ہے',
        '7': ' آپ جب بھی کھڑے ہوتے ہیں آپ کا جسم خود کو متوازن کرنے کے لیے 300 پٹھوں کا استعمال کرتا',
        '8': 'بعض میںڈک منجمد ٹھوس ہوسکتے ہیں پھر پگھل  جائیں تو بھی جی سکتے ہیں',
        '9': 'ہماری آنکھیں پیدائش سے ہی اسی ہجم کی ہیں، لیکن ہماری ناک اور کان کبھی بڑھنا نہیں رکتی',
        '10': 'آپ کی زبان آپ کے جسم میں واحد پٹھہ ہے جو صرف ایک طرف سے منسلک ہے',
        '11': 'اونٹ کی تین پلکیں ہوتی ہیں جو اڑتی ریت سے بچانے کے لئے ہیں۔'
      },
      progressBar: { progress: '{{progressBarValue}}٪ مکمل' }
    },
    login: {
      labels: {
        password: 'پاس ورڈ',
        signIn: 'سائن ان ',
        username: 'یوزر نیم'
      },
      messages: {
        error: 'یوزر نیم یا پاس ورڈ غلط ہے.',
        signIn: 'سائن ان کریں'
      }
    },
    medication: {
      alerts: {
        fulfilledTitle: 'ادویات درخواست پوری',
        returnedMessage: 'ادویات پر واپس کر دی گئی کا نشان لگا دیا گیا ہے۔',
        returnedTitle: 'واپس کی گئی ادویات',
        savedMessage: 'ادویات کا ریکارڈ محفوظ ہوگیا ہے۔',
        savedTitle: 'ادویات کی درخواست محفوظ کر لی گئی'
      },
      buttons: {
        dispenseMedication: 'ادویات تقسیم',
        newButton: '+ نئی درخواست',
        returnMedication: 'واپسی دوا'
      },
      labels: {
        adjustmentDate: 'تاریخ درستگی',
        creditToAccount: 'اکاؤنٹ کو کریڈٹ',
        quantityDispensed: 'تقسیم یا استعمال کی گئی مقدار',
        quantityDistributed: 'تقسیم کی گئی مقدار',
        quantityRequested: ' درخواست کی گئی مقدار',
        quantityToReturn: 'مقدار براۓ واپسی',
        refills: 'دوبارہ بھریں',
        returnAisle: 'واپسی راہداری',
        returnLocation: ' مقام واپسی',
        returnReason: 'واپسی کی وجہ / نوٹس'
      },
      messages: { createNew: 'ایک نئی دوا کی درخواست بنائیں؟' },
      pageTitle: 'ادویات کی درخواستیں',
      returnMedication: 'واپس دوا',
      sectionTitle: 'ادویات',
      titles: {
        completedMedication: 'مکمل دوا',
        editMedicationRequest: 'ادویات میں ترمیم کی درخواست',
        newMedicationRequest: 'نئی دوا کی گذارش'
      }
    },
    messages: {
      createNewRecord: 'ایک نیا ریکارڈ بنائیں؟',
      createNewUser: 'ایک نیا صارف بنائیں؟',
      'delete': '',
      delete_plural: '',
      delete_singular: '',
      forAuthorizedPersons: 'یہ رپورٹ صرف مجاز افراد کے لئے ہے.',
      newPatientHasToBeCreated: 'ایک نیا مریض بنایا جانا ضروری ہے ... براہ کرم انتظار کریں ...',
      noHistoryAvailable: 'کوئی سرگزشت دستیاب نہیں',
      noItemsFound: 'کوئی آئٹم نہیں ملا.',
      noNotesAvailable: 'کوئی اضافی کلینکل نوٹ اس دورے کے لئے دستیاب نہیں.',
      noUsersFound: 'کوئی صارف دستیاب نہیں',
      onBehalfOf: 'کی جانب سے',
      reportError: 'درخواست کی رپورٹ کو پیدا کرتے وقت ایک خرابی کا سامنا ہوا۔ براہ مہربانی اپنے سسٹم ایڈمنسٹریٹر کے علم میں لائیں کہ آپ کو خرابی کا سامنا ہوا',
      requiredFieldsCorrectErrors: 'ضرورت ہے کہ خالی قطعات (* کے نشان) میں بھریں اور محفوظ کرنے سے پہلے غلطیوں کو درست کریں.',
      saveActionException: 'محفوظ کرنے کی کوشش کرتے ہوئے ایک خرابی واقع ہوئی ہے: {{message}}',
      sorry: 'معاف کرنا، کچھ غلط ہوگیا...',
      userHasBeenSaved: 'صارف محفوظ ہوگیا ہے.',
      userSaved: ' صارف محفوظ'
    },
    models: {
      appointment: {
        labels: {
          allDay: '',
          appointmentDate: '',
          appointmentType: '',
          endDate: '',
          location: '',
          notes: '',
          patient: '',
          provider: '',
          startDate: '',
          status: '',
          type: ''
        },
        names: {
          plural: '',
          singular: ''
        }
      },
      attachment: { names: {
          plural: '',
          singular: ''
        } },
      form: { names: {
          plural: '',
          singular: ''
        } },
      imaging: {
        names: '',
        request: {
          plural: '',
          singular: ''
        }
      },
      incident: { names: {
          plural: '',
          singular: ''
        } },
      item: { names: {
          plural: '',
          singular: ''
        } },
      lab: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      medication: {
        names: {
          plural: '',
          singular: ''
        },
        request: {
          plural: '',
          singular: ''
        }
      },
      note: { names: {
          plural: '',
          singular: ''
        } },
      patient: {
        labels: { name: '' },
        names: { singular: '' }
      },
      procedure: { names: {
          plural: '',
          singular: ''
        } },
      user: { names: {
          plural: '',
          singular: ''
        } },
      visit: { names: {
          plural: '',
          singular: ''
        } },
      vital: { names: {
          plural: '',
          singular: ''
        } }
    },
    navigation: {
      about: 'HospitalRun  کے بارے',
      actions: {
        login: 'لاگ ان',
        logout: 'لاگ آوٹ'
      },
      administration: 'انتظامیہ',
      billing: 'بلنگ',
      imaging: 'امیجنگ',
      incident: '',
      inventory: 'انوینٹری',
      labs: 'لیبز',
      medication: 'ادویات',
      patients: 'مریض',
      scheduling: 'اوقات نامہ',
      subnav: {
        actions: 'عوامل',
        addAppointment: 'ملاقات اضافہ',
        addressFields: 'ایڈریس قطعات',
        admittedPatients: 'جمع شدہ مریض',
        appointmentSearch: ' ملاقاتیں تلاش کریں',
        appointmentsCalendar: 'ملاقاتوں کا کیلنڈر',
        appointmentsThisWeek: 'اس ہفتے کی ملاقاتیں',
        completed: 'مکمل',
        currentIncidents: '',
        customForms: 'کسٹم فام',
        dispense: 'تقسیم',
        history: '',
        incidentCategories: '',
        inventoryReceived: 'انوینٹری موصول',
        invoices: 'رسیدیں',
        items: 'اشیاء',
        loadDB: 'DB لوڈ کریں',
        lookupLists: 'تلاش فہرستیں',
        missedAppointments: 'ضائع شدہ',
        newIncident: '',
        newInvoice: 'نئے رسید',
        newPatient: 'نئے مریض',
        newRequest: 'نئی درخواست',
        newUser: 'نیا صارف',
        outpatient: 'آؤٹ پیشنٹ',
        patientListing: 'مریض کی فہرست سازی',
        priceProfiles: 'قیمت پروفائلز',
        prices: 'قیمتیں',
        printHeader: '',
        reports: 'رپورٹس',
        requests: 'درخواستیں',
        returnMedication: 'واپس دوا',
        scheduleSurgery: 'سرجری اوقات نامہ',
        theaterSchedule: 'تھیٹر اوقات نامہ',
        "today'sAppointments": '',
        userRoles: 'صارف کے کردار',
        users: 'صارفین',
        workflow: 'ورک فلو'
      }
    },
    operationReport: {
      labels: {
        additionalNotes: 'اضافی نوٹس',
        assistant: 'مددگار',
        caseComplexity: 'کیس پیچیدگی',
        operationDescription: 'آپریشن کی تفصیل',
        preOpPrimaryDiagnosis: 'آپریشن سے پہلے بنیادی تشخیص',
        preOpSecondaryDiagnosis: 'آپریشن سے پہلے ثانوی تشخیص',
        surgeon: 'سرجن',
        surgeryDate: 'سرجری تاریخ'
      },
      messages: { reportSaved: 'آپریشن رپورٹ محفوظ ہوگئی ہے۔' },
      titles: {
        editTitle: 'آپریشن رپورٹ میں ترمیم کریں',
        newTitle: 'نئے آپریشن کی رپورٹ',
        reportSaved: 'رپورٹ محفوظ ہوگئی'
      }
    },
    operativePlan: {
      buttons: { completePlan: 'مکمل حکمت عمل' },
      labels: {
        additionalNotes: 'اضافی نوٹس',
        admissionInstructions: 'داخلے کی ہدایات',
        caseComplexity: 'کیس پیچیدگی',
        completedStatus: 'مکمل',
        droppedStatus: 'گرا دیا',
        operationDescription: 'آپریشن کی تفصیل',
        plannedStatus: 'منصوبہ بندی کر لی گئی',
        status: 'صورتحال',
        surgeon: 'سرجن'
      },
      messages: {
        planCompleted: 'آپریٹو پلان مکمل ہو چکا ہے۔ اب آپریشن رپورٹ کی طرف آپ کی رہنمائی کی جائے گی۔',
        planSaved: 'آپریٹو پلان محفوظ ہوگیا ہے۔'
      },
      titles: {
        editTitle: 'آپریٹو پلان میں ترمیم کریں',
        newTitle: 'نیا آپریٹو پلان',
        planCompleted: 'پلان مکمل',
        planSaved: 'پلان محفوظ'
      }
    },
    patients: {
      buttons: {
        addContact: 'رابطہ شامل کریں',
        addExpense: 'اخراجات میں شامل کریں',
        addFamilyMember: 'خاندان کا فرد شامل کریں',
        addOperativePlan: 'آپریٹو پلان میں شامل کریں',
        backToPatients: 'مریض کی فہرست پر واپس جائیں',
        download: '',
        editOperativePlan: 'موجودہ آپریٹو پلان',
        newAppointment: 'نئی ملاقات',
        newImaging: 'نئی امیجنگ',
        newLab: 'نئی لیب',
        newMedication: 'نئی دوا',
        newPatient: '+ نیا مریض',
        newPhoto: 'نئی تصویر',
        newVisit: 'نیا دورہ',
        patientCheckIn: 'مریض کا چیک ان',
        scheduleSurgery: 'سرجری کا وقت مقرر کریں'
      },
      labels: {
        admissionDate: 'داخلے کی تاریخ',
        admit: 'داخل کریں',
        bloodType: 'خون کی قسم',
        caption: '',
        civilStatus: 'سول حیثیت',
        clinic: 'کلینک کی جگہ',
        contacts: 'رابطے',
        cost: 'لاگت',
        dateOfBirth: 'پیدائش کی تاریخ',
        dateProcessed: 'عمل درآمد کی تاریخ',
        dischargeDate: 'فارغ کرنے کی تاریخ',
        dob: 'DOB',
        education: 'تعلیم',
        email: 'ای میل',
        externalPatientId: 'بیرونی مریض کی شناخت',
        firstName: 'نام کا پہلا حصہ',
        income: 'آمدن',
        insurance: 'بیمہ',
        lastName: 'نام کا آخری حصہ',
        middleName: 'نام کا درمیانی حصہ',
        monthlyCost: 'ماہانہ اخراجات',
        occupation: 'پیشہ',
        operativePlan: 'آپریٹو پلان',
        parent: 'والدین / سرپرست',
        patientDays: 'مریض کے دن',
        patientType: 'مریضوں کی اقسام',
        patientTypeCharity: '',
        patientTypePrivate: '',
        phone: 'فون',
        placeOfBirth: 'جائے پیدائش',
        primaryDiagnosis: 'بنیادی تشخیص',
        referredBy: 'کی طرف سے بھیجا گیا',
        referredDate: 'حوالہ دینے کی تاریخ',
        relationship: 'مریض سے تعلق',
        relationships: 'تعلقات',
        religion: 'مذہب',
        secondaryDiagnosis: 'ثانوی تشخیص',
        sex: 'جنس',
        sexNotEntered: 'جنس داخل نہیں کیا گیا',
        sources: 'ذرائع',
        status: 'مریض کی صورتحال',
        totalMontlyExpense: 'مجموعی ماہانہ اخراجات'
      },
      messages: {
        areYouSureDelete: ' کو حذف کرنا چاہتے ہیں؟ {{object}} آپ کو یقین ہے کہ آپ اس ',
        createNewPatient: 'ایک نیا مریض ریکارڈ بنائیں؟',
        deletingPatient: 'مریض اور سارے متعلقہ ریکارڈز حذف کیا جا رہا ہے',
        noPatientsFound: 'کوئی مریض نہیں ملا۔',
        notFoundQuickAdd: ' مریض نہیں مل سکا۔ اگر آپ کو ایک نیا مریض بنانا چاہتے ہیں تو ذیل میں معلومات درج کیجے۔ ورنہ واپس جانے کے کیے منسوخ کا بٹن دبائیں۔ <strong>{{patientFullName}}</strong> ',
        photoFileRequired: '',
        savedPatient: ' کے لئے مریض کا ریکارڈ محفوظ ہوگیا ہے۔ {{displayName}} '
      },
      navigation: {
        appointments: 'ملاقاتیں',
        general: 'عمومی',
        history: 'سرگزشت',
        imaging: 'امیجنگ',
        labs: 'لیبز',
        medication: 'ادویات',
        photos: 'تصاویر',
        socialWork: 'سماجی کام',
        visits: 'دورے'
      },
      notes: {
        newNote: 'نیا نوٹ برائے',
        onBehalfOfCopy: 'کی جانب سے',
        onBehalfOfLabel: 'کی جانب سے',
        pleaseSelectAVisit: 'ایک دورے براہ مہربانی منتخب کریں',
        updateNote: 'کی صرف سے نوٹ اپ ڈیٹ ہورہے ہیں'
      },
      titles: {
        addContact: 'رابطہ شامل کریں',
        addPhoto: 'تصویر کا اضافہ کریں',
        additionalContacts: 'اضافی رابطے',
        admissionsDetail: 'داخلوں کی تفصیل',
        admissionsSummary: 'داخلوں کا خلاصہ',
        admittedPatients: 'داخل کیے گئے مریض',
        'delete': 'مریض کو حذف کریں',
        deleteContact: 'رابطہ کریں حذف کریں',
        deleteExpense: 'خرچہ حذف کریں',
        deleteFamilyMember: 'خاندان کے فرد کو حذف کریں',
        deletePatientRecord: 'مریض ریکارڈ حذف کریں',
        deletePhoto: 'تصویر حذف کریں',
        diagnosticTesting: 'تشخیصی جانچ',
        dischargesDetail: 'فارغ کرنے کی تفصیل',
        dischargesSummary: 'فارغ کرنے کا خلاصہ',
        edit: 'مریض میں ترمیم کریں',
        editPhoto: 'تصویر میں ترمیم کریں',
        expenses: 'اخراجات',
        familyInfo: 'خاندانی معلومات',
        familyInformation: 'خاندان کی معلومات',
        'new': 'نئے مریض',
        outpatientsForDate: '{{visitDate}} بیرونی مریض برائے ',
        patient: 'مریض رپورٹ',
        patientListing: 'مریض کی فہرست سازی',
        patientReport: 'مریض رپورٹ',
        patientStatus: 'مریض کی صورتحال',
        proceduresDetail: 'طریقہ کار کی تفصیل',
        proceduresSummary: 'طریقہ کار کا خلاصہ',
        savedPatient: 'مریض محفوظ ہو گیا',
        socialWork: 'خرچہ',
        todaysOutpatients: 'آج کے بیرونی مریضوں',
        totalPatientDays: 'مریض کے کل دن',
        totalPatientDaysDetailed: 'مریض کے کل دن(تفصیلی) ۔',
        visit: 'دورہ'
      }
    },
    print: { invoice: {
        labels: {
          billedBy: 'بل منجانب:',
          billedDate: 'بل کی تاریخ:',
          dateAdmitted: 'داخلہ کی تاریخ:',
          dateDischarged: 'فارغ کرنے کی تاریخ:',
          dischargeNotes: 'فارغ کرنے کے نوٹس:',
          patientAddress: 'پتہ:',
          patientAge: 'عمر:',
          patientId: 'مریض #:',
          patientName: 'مریض کا نام:',
          remarks: 'خیالات:',
          spacer: '__________________________________________'
        },
        messages: { whereConducted: 'میری محدودیت کے دوران کاٹ لیے گئے تھے' },
        titles: {
          billingStatement: 'بلنگ کی عبارت',
          patientMember: 'مریض رکن',
          patients: 'مریض کا',
          relContact: 'تعلق / رابطہ نمبر'
        }
      } },
    procedures: {
      buttons: { addMedication: 'ادویات شامل کریں' },
      labels: { medicationUsed: 'استعمال کی گئی ادویات' },
      messages: { saved: ' آپ کو یقین ہے کہ آپ اس طریقہ کار کو حذف کرنا چاہتے ہیں؟' },
      titles: {
        addChargeItem: 'چارج آئٹم شامل کریں',
        addMedicationUsed: 'استعمال کی گئی ادویات شامل کریں',
        deleteChargeItem: 'چارج آئٹم حذف کریں',
        deleteMedicationUsed: 'استعمال کی گئی ادویات حذف کریں',
        edit: 'ضابطے میں ترمیم کریں',
        editChargeItem: 'چارج آئٹم میں ترمیم کریں',
        editMedicationUsed: 'استعمال کی گئی ادویات میں ترمیم کریں',
        medicationUsed: 'استعمال کی گئی ادویات',
        'new': 'نیا طریقہ کار',
        saved: 'ضابطے محفوظ'
      }
    },
    reports: {
      labels: {
        admissionDate: '',
        allProcedures: '',
        completedBy: '',
        dischargeDate: '',
        examiner: '',
        images: '',
        labs: '',
        location: '',
        medications: '',
        nextAppointment: '',
        nextAppointments: '',
        notes: {
          author: '',
          date: '',
          title: ''
        },
        operativePlan: {
          description: '',
          instructions: '',
          procedures: '',
          title: ''
        },
        primaryDiagnosis: '',
        procedures: '',
        secondaryDiagnosis: '',
        visitDate: '',
        visitType: ''
      },
      messages: {
        'delete': '',
        saved: ''
      },
      titles: {
        dischargeReport: '',
        newDischargeReport: '',
        newOPDReport: '',
        opdReport: '',
        saved: ''
      }
    },
    user: {
      plusNewUser: '+ نیا صارف',
      usersPageTile: 'صارفین کی فہرست سازی'
    },
    visits: {
      buttons: {
        addDiagnosis: 'تشخیص کے لئے شامل کریں',
        checkIn: 'چیک ان',
        checkOut: 'چیک آٹ',
        discharge: 'فارغ کر دیں',
        newAppointment: 'نئی ملاقات',
        newDischargeReport: '',
        newOPDReport: '',
        newProcedure: 'نئے طریقہ کار',
        newVitals: 'نئے vitals'
      },
      labels: {
        appointment: 'ملاقات',
        authoredBy: 'کی طرف سے تحریر',
        checkInTime: 'چیک ان',
        checkOutTime: 'چیک آٹ',
        createNewPatient: 'نیا مریض بنائیں',
        diagnosis: 'تشخیص',
        examiner: 'معائنہ کار',
        finalDiagnosis: 'حتمی / بلنگ تشخیص',
        haveAppointment: 'ہاں',
        haveDoneOrders: 'ہاں',
        noAppointment: 'نہیں',
        ordersDone: 'آرڈرز مکمل کر دیے گئے',
        ordersNotDone: 'نہیں',
        patientToCheckIn: 'مریض کا چیک ان کرنا',
        procedure: 'ضابطے',
        procedureDate: 'ضابطے کی تاریخ',
        reasonForVisit: 'دورے کی وجہ',
        reportType: '',
        status: 'دورہ کی صورتحال',
        statusAdmitted: 'داخل کر دیا گیا',
        statusCheckedIn: 'چیک ان کر دیا گیا',
        statusCheckedOut: 'چیک آٹ کر دیا گیا',
        statusDischarged: 'فارغ کر دیا گیا',
        visitDate: 'دورہ کی تاریخ',
        visitInformation: 'دورہ معلومات',
        visitType: 'دورہ کی قسم'
      },
      messages: {
        checkOut: 'کو چیک آٹ کرنا چاہتے ہیں؟ {{patientName}} آپ کو یقین ہے کہ آپ ',
        checkedOut: 'چیک آٹ کر دیا گیا ہے {{patientName}} ',
        discharged: ' کو فارغ کر دیا گیا ہے  {{patientName}} ',
        patientCheckedIn: 'چیک ان کر دیا گیا ہے {{patientName}} ',
        patientCreatedAndCheckedIn: ' ۔  (مریض) بنا دیا گیا ہے اور چیک ان کر دیا گیا ہے {{patientName}} ',
        visitAndPatientSaved: 'دورے اور مریض ریکارڈ محفوظ کیا گیا ہے۔',
        visitSaved: 'دورہ کا ریکارڈ کو محفوظ کیا گیا ہے۔'
      },
      navigation: {
        charges: 'چارجز',
        notes: 'نوٹس',
        orders: 'آرڈرز',
        procedures: 'طریقہ کار',
        reports: '',
        vitals: 'Vitals'
      },
      titles: {
        additionalDiagnoses: 'اضافی تشخیص',
        checkOut: 'مریض چیک آٹ',
        checkedIn: 'مریض چیک ان مکمل',
        checkedOut: 'مریض چیک آٹ مکمل',
        discharged: 'مریض فارغ کر دیا گیا',
        editVisit: 'دورہ ترمیم کریں',
        newVisit: 'نیا دورہ',
        patientCheckIn: 'مریض چیک ان',
        visitSaved: 'دورہ محفوظ'
      }
    },
    vitals: { labels: {
        dateRecorded: 'تاریخ اندراج',
        dbp: 'DBP',
        heartRate: 'دل کی دھڑکن کی شرح',
        height: 'اونچائی',
        respiratoryRate: 'سانس کی شرح',
        sbp: 'SBP',
        temperature: 'درجہ حرارت',
        weight: 'وزن'
      } }
  };
});
define('hospitalrun/tests/locales/ur/translations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - locales/ur/translations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'locales/ur/translations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/completed/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    showActions: false,
    startKey: []
  });
});
define('hospitalrun/tests/medication/completed/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/completed/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/completed/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/completed/route', ['exports', 'ember-i18n', 'hospitalrun/medication/index/route'], function (exports, _emberI18n, _hospitalrunMedicationIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunMedicationIndexRoute['default'].extend({
    modelName: 'medication',
    pageTitle: (0, _emberI18n.translationMacro)('medication.titles.completedMedication'),
    searchStatus: 'Fulfilled'
  });
});
define('hospitalrun/tests/medication/completed/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/completed/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/completed/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/delete/controller', ['exports', 'ember-i18n', 'hospitalrun/controllers/abstract-delete-controller', 'hospitalrun/mixins/patient-submodule'], function (exports, _emberI18n, _hospitalrunControllersAbstractDeleteController, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend(_hospitalrunMixinsPatientSubmodule['default'], {
    title: (0, _emberI18n.translationMacro)('labels.delete_request'),

    actions: {
      'delete': function _delete() {
        this.deleteChildFromVisit('medication');
      }
    }
  });
});
define('hospitalrun/tests/medication/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/add-new-patient', 'ember', 'hospitalrun/mixins/fulfill-request', 'hospitalrun/mixins/inventory-locations', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsAddNewPatient, _ember, _hospitalrunMixinsFulfillRequest, _hospitalrunMixinsInventoryLocations, _hospitalrunMixinsPatientSubmodule, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsAddNewPatient['default'], _hospitalrunMixinsFulfillRequest['default'], _hospitalrunMixinsInventoryLocations['default'], _hospitalrunMixinsPatientSubmodule['default'], _hospitalrunMixinsUserSession['default'], {
    medicationController: _ember['default'].inject.controller('medication'),
    expenseAccountList: _ember['default'].computed.alias('medicationController.expenseAccountList'),

    canFulfill: (function () {
      return this.currentUserCan('fulfill_medication');
    }).property(),

    isFulfilled: (function () {
      var status = this.get('model.status');
      return status === 'Fulfilled';
    }).property('model.status'),

    isFulfilling: (function () {
      var canFulfill = this.get('canFulfill');
      var isRequested = this.get('model.isRequested');
      var fulfillRequest = this.get('model.shouldFulfillRequest');
      var isFulfilling = canFulfill && (isRequested || fulfillRequest);
      this.get('model').set('isFulfilling', isFulfilling);
      return isFulfilling;
    }).property('canFulfill', 'model.isRequested', 'model.shouldFulfillRequest'),

    isFulfilledOrRequested: (function () {
      return this.get('isFulfilled') || this.get('model.isRequested');
    }).property('isFulfilled', 'model.isRequested'),

    prescriptionClass: (function () {
      var quantity = this.get('model.quantity');
      if (_ember['default'].isEmpty(quantity)) {
        return 'required test-medication-prescription';
      }
    }).property('model.quantity'),

    quantityClass: (function () {
      var prescription = this.get('model.prescription');
      var returnClass = 'col-xs-3';
      var isFulfilling = this.get('isFulfilling');
      if (isFulfilling || _ember['default'].isEmpty(prescription)) {
        returnClass += ' required';
      }
      return returnClass + ' test-quantity-input';
    }).property('isFulfilling', 'model.prescription'),

    quantityLabel: (function () {
      var i18n = this.get('i18n');
      var returnLabel = i18n.t('medication.labels.quantityRequested');
      var isFulfilled = this.get('isFulfilled');
      var isFulfilling = this.get('isFulfilling');
      if (isFulfilling) {
        returnLabel = i18n.t('medication.labels.quantityDispensed');
      } else if (isFulfilled) {
        returnLabel = i18n.t('medication.labels.quantityDistributed');
      }
      return returnLabel;
    }).property('isFulfilled'),

    medicationList: [],
    updateCapability: 'add_medication',

    afterUpdate: function afterUpdate() {
      var i18n = this.get('i18n');
      var alertTitle = undefined,
          alertMessage = undefined;
      var isFulfilled = this.get('isFulfilled');
      if (isFulfilled) {
        alertTitle = i18n.t('medication.alerts.fulfilledTitle');
        alertMessage = 'The medication request has been fulfilled.';
        this.set('model.selectPatient', false);
      } else {
        alertTitle = i18n.t('medication.alerts.savedTitle');
        alertMessage = i18n.t('medication.alerts.savedMessage');
      }
      this.saveVisitIfNeeded(alertTitle, alertMessage);
    },

    beforeUpdate: function beforeUpdate() {
      var isFulfilling = this.get('isFulfilling');
      var isNew = this.get('model.isNew');
      if (isNew || isFulfilling) {
        return new _ember['default'].RSVP.Promise((function (resolve, reject) {
          var newMedication = this.get('model');
          newMedication.validate().then((function () {
            if (newMedication.get('isValid')) {
              if (isNew) {
                if (_ember['default'].isEmpty(newMedication.get('patient'))) {
                  this.addNewPatient();
                  reject({
                    ignore: true,
                    message: 'creating new patient first'
                  });
                } else {
                  newMedication.set('medicationTitle', newMedication.get('inventoryItem.name'));
                  newMedication.set('priceOfMedication', newMedication.get('inventoryItem.price'));
                  newMedication.set('status', 'Requested');
                  newMedication.set('requestedBy', newMedication.getUserName());
                  newMedication.set('requestedDate', new Date());
                  this.addChildToVisit(newMedication, 'medication', 'Pharmacy').then((function () {
                    this.finishBeforeUpdate(isFulfilling, resolve);
                  }).bind(this), reject);
                }
              } else {
                this.finishBeforeUpdate(isFulfilling, resolve);
              }
            } else {
              this.send('showDisabledDialog');
              reject('invalid model');
            }
          }).bind(this))['catch']((function () {
            this.send('showDisabledDialog');
            reject('invalid model');
          }).bind(this));
        }).bind(this));
      } else {
        return _ember['default'].RSVP.resolve();
      }
    },

    finishBeforeUpdate: function finishBeforeUpdate(isFulfilling, resolve) {
      if (isFulfilling) {
        var inventoryLocations = this.get('model.inventoryLocations');
        var inventoryRequest = this.get('store').createRecord('inv-request', {
          expenseAccount: this.get('model.expenseAccount'),
          dateCompleted: new Date(),
          inventoryItem: this.get('model.inventoryItem'),
          inventoryLocations: inventoryLocations,
          quantity: this.get('model.quantity'),
          transactionType: 'Fulfillment',
          patient: this.get('model.patient'),
          markAsConsumed: true
        });
        this.performFulfillRequest(inventoryRequest, false, false, true).then((function () {
          this.set('model.status', 'Fulfilled');
          resolve();
        }).bind(this));
      } else {
        resolve();
      }
    },

    showUpdateButton: (function () {
      var isFulfilled = this.get('isFulfilled');
      if (isFulfilled) {
        return false;
      } else {
        return this._super();
      }
    }).property('updateCapability', 'isFulfilled'),

    updateButtonText: (function () {
      var i18n = this.get('i18n');
      if (this.get('model.hideFulfillRequest')) {
        return i18n.t('buttons.dispense');
      } else if (this.get('isFulfilling')) {
        return i18n.t('labels.fulfill');
      }
      return this._super();
    }).property('model.isNew', 'isFulfilling', 'model.hideFulfillRequest')

  });
});
// inventory-locations mixin is needed for fulfill-request mixin!
define('hospitalrun/tests/medication/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/edit/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'ember', 'hospitalrun/mixins/fulfill-request', 'hospitalrun/mixins/inventory-locations', 'moment', 'hospitalrun/mixins/patient-list-route', 'npm:uuid'], function (exports, _emberI18n, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _ember, _hospitalrunMixinsFulfillRequest, _hospitalrunMixinsInventoryLocations, _moment, _hospitalrunMixinsPatientListRoute, _npmUuid) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], _hospitalrunMixinsFulfillRequest['default'], _hospitalrunMixinsInventoryLocations['default'], _hospitalrunMixinsPatientListRoute['default'], {
    editTitle: (0, _emberI18n.translationMacro)('medication.titles.editMedicationRequest'),
    modelName: 'medication',
    newTitle: (0, _emberI18n.translationMacro)('medication.titles.newMedicationRequest'),
    database: _ember['default'].inject.service(),
    getNewData: function getNewData(params) {
      var idParam = this.get('idParam');
      var newData = {
        selectPatient: true,
        prescriptionDate: (0, _moment['default'])().startOf('day').toDate()
      };
      if (params[idParam] === 'dispense') {
        newData.shouldFulfillRequest = true;
        newData.hideFulfillRequest = true;
      }
      newData.id = _npmUuid['default'].v4();
      return _ember['default'].RSVP.resolve(newData);
    },

    model: function model(params) {
      var idParam = this.get('idParam');
      var modelPromise = this._super(params);
      if (!_ember['default'].isEmpty(idParam) && params[idParam] === 'new' || params[idParam] === 'dispense') {
        if (!isEmpty(params.forPatientId)) {
          return this._setPatientOnModel(modelPromise, params.forPatientId);
        } else if (!isEmpty(params.forVisitId)) {
          return this._setVisitOnModel(modelPromise, params.forVisitId);
        } else {
          return this._createNewRecord(params);
        }
      } else {
        return this._super(params);
      }
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      var inventoryQuery = {
        key: 'Medication',
        include_docs: true
      };
      var inventoryItemId = model.get('inventoryItem.id');
      var patient = model.get('patient');
      if (_ember['default'].isEmpty(inventoryItemId)) {
        this.get('database').queryMainDB(inventoryQuery, 'inventory_by_type').then(function (result) {
          var medicationList = result.rows.map(function (medication) {
            return medication.doc;
          });
          controller.set('medicationList', medicationList);
        });
      }
      if (_ember['default'].isEmpty(patient)) {
        this._fetchPatientList(controller);
      }
    }
  });
});
// inventory-locations mixin is needed for fulfill-request mixin!
define('hospitalrun/tests/medication/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    startKey: [],
    canAdd: (function () {
      return this.currentUserCan('add_medication');
    }).property(),

    showActions: (function () {
      return this.currentUserCan('fulfill_medication');
    }).property()
  });
});
define('hospitalrun/tests/medication/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/index/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-index-route'], function (exports, _emberI18n, _hospitalrunRoutesAbstractIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    modelName: 'medication',
    pageTitle: (0, _emberI18n.translationMacro)('medication.pageTitle'),
    searchStatus: 'Requested',

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var prescriptionDateAsTime = item.get('prescriptionDateAsTime');
      var id = this._getPouchIdFromItem(item);
      var requestedDateAsTime = item.get('requestedDateAsTime');
      var searchStatus = this.get('searchStatus');
      return [searchStatus, requestedDateAsTime, prescriptionDateAsTime, id];
    },

    _modelQueryParams: function _modelQueryParams() {
      var maxId = this._getMaxPouchId();
      var maxValue = this.get('maxValue');
      var minId = this._getMinPouchId();
      var searchStatus = this.get('searchStatus');
      return {
        options: {
          startkey: [searchStatus, null, null, minId],
          endkey: [searchStatus, maxValue, maxValue, maxId]
        },
        mapReduce: 'medication_by_status'
      };
    }
  });
});
define('hospitalrun/tests/medication/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/return/controller', ['exports', 'ember-i18n', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/fulfill-request', 'hospitalrun/mixins/inventory-locations', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/utils/select-values'], function (exports, _emberI18n, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsFulfillRequest, _hospitalrunMixinsInventoryLocations, _hospitalrunMixinsPatientSubmodule, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsFulfillRequest['default'], _hospitalrunMixinsInventoryLocations['default'], _hospitalrunMixinsPatientSubmodule['default'], {
    medicationController: _ember['default'].inject.controller('medication'),
    medicationList: [],

    lookupListsToUpdate: [{
      name: 'aisleLocationList', // Name of property containing lookup list
      property: 'model.aisleLocation', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'aisle_location_list' // Id of the lookup list to update
    }, {
      name: 'expenseAccountList', // Name of property containing lookup list
      property: 'model.expenseAccount', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'expense_account_list' // Id of the lookup list to update
    }, {
      name: 'warehouseList', // Name of property containing lookup list
      property: 'model.location', // Corresponding property on model that potentially contains a new value to add to the list
      id: 'warehouse_list' // Id of the lookup list to update
    }],

    patientMedicationList: [],
    setNewMedicationList: false,

    aisleLocationList: _ember['default'].computed.alias('medicationController.aisleLocationList'),
    expenseAccountList: _ember['default'].computed.alias('medicationController.expenseAccountList'),
    warehouseList: _ember['default'].computed.alias('medicationController.warehouseList'),
    updateCapability: 'add_medication',

    medicationChanged: (function () {
      var medication = this.get('model.medication');
      if (!_ember['default'].isEmpty(medication)) {
        var inventoryItem = medication.get('inventoryItem');
        this.set('model.inventoryItemTypeAhead', inventoryItem.get('name') + ' - ' + inventoryItem.get('friendlyId'));
        this.set('model.inventoryItem', inventoryItem);
      } else {
        this.set('model.inventoryItem');
      }
      _ember['default'].run.later((function () {
        this.get('model').validate()['catch'](_ember['default'].K);
      }).bind(this));
    }).observes('model.medication'),

    patientVisitsChanged: (function () {
      var patientVisits = this.get('patientVisits');
      if (!_ember['default'].isEmpty(patientVisits)) {
        this.set('model.visit', patientVisits.get('firstObject'));
      }
    }).observes('patientVisits'),

    showPatientMedicationList: (function () {
      var patientMedicationList = this.get('patientMedicationList');
      this.get('patientMedication'); // Request patient medication be updated
      return !_ember['default'].isEmpty(patientMedicationList);
    }).property('patientMedicationList', 'model.patient', 'model.visit'),

    patientMedication: (function () {
      var setNewMedicationList = this.get('setNewMedicationList');
      var visit = this.get('model.visit');
      if (setNewMedicationList) {
        this.set('setNewMedicationList', false);
      } else if (!_ember['default'].isEmpty(visit)) {
        visit.get('medication').then((function (medication) {
          medication = medication.filterBy('status', 'Fulfilled');
          this.set('model.medication', medication.get('firstObject'));
          this.set('patientMedicationList', medication.map(_hospitalrunUtilsSelectValues['default'].selectObjectMap));
          this.set('setNewMedicationList', true);
        }).bind(this));
      }
      return this.get('patientMedicationList');
    }).property('setNewMedicationList', 'model.patient', 'model.visit'),

    _finishUpdate: function _finishUpdate() {
      var aisle = this.get('model.deliveryAisle');
      var location = this.get('model.deliveryLocation');
      var inventoryItem = this.get('model.inventoryItem');

      // find location on inventoryItem
      this._findOrCreateLocation(inventoryItem, location, aisle).then((function (inventoryLocation) {
        this.set('model.adjustPurchases', true);
        this.set('model.inventoryLocations', [inventoryLocation]);
        this.set('model.markAsConsumed', true);
        // Make sure inventory item is resolved first.
        this.get('model.inventoryItem').then((function () {
          this.send('fulfillRequest', this.get('model'), false, true, true);
        }).bind(this));
      }).bind(this));
    },

    actions: {
      doneFulfillRequest: function doneFulfillRequest() {
        var i18n = this.get('i18n');
        this.updateLookupLists();
        this.displayAlert(i18n.t('medication.alerts.returnedTitle'), i18n.t('medication.alerts.returnedMessage'), 'allItems');
      },
      update: function update() {
        var medication = this.get('model.medication');
        var quantity = this.get('model.quantity');
        if (!_ember['default'].isEmpty(medication)) {
          medication.reload().then((function () {
            medication.decrementProperty('quantity', quantity);
            if (medication.get('quantity') < 0) {
              medication.set('quantity', 0);
            }
            medication.save().then(this._finishUpdate.bind(this));
          }).bind(this));
        } else {
          this._finishUpdate();
        }
      }
    },

    updateButtonText: (0, _emberI18n.translationMacro)('medication.returnMedication')
  });
});
// inventory-locations mixin is needed for fulfill-request mixin!
define('hospitalrun/tests/medication/return/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/return/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/return/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/return/route', ['exports', 'ember-i18n', 'hospitalrun/tests/medication/edit/route', 'ember'], function (exports, _emberI18n, _hospitalrunTestsMedicationEditRoute, _ember) {
  'use strict';

  exports['default'] = _hospitalrunTestsMedicationEditRoute['default'].extend({
    editTitle: (0, _emberI18n.translationMacro)('medication.returnMedication'),
    modelName: 'inv-request',
    newTitle: (0, _emberI18n.translationMacro)('medication.returnMedication'),
    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        dateCompleted: new Date(),
        selectPatient: true,
        transactionType: 'Return'
      });
    }
  });
});
define('hospitalrun/tests/medication/return/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/return/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/return/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-module-route', 'ember'], function (exports, _emberI18n, _hospitalrunRoutesAbstractModuleRoute, _ember) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_medication',
    moduleName: 'medication',
    newButtonText: (0, _emberI18n.translationMacro)('medication.buttons.newButton'),
    sectionTitle: (0, _emberI18n.translationMacro)('medication.sectionTitle'),

    additionalButtons: (function () {
      var i18n = this.get('i18n');
      var additionalButtons = [];
      if (this.currentUserCan('fulfill_medication')) {
        additionalButtons.push({
          buttonIcon: 'octicon octicon-checklist',
          buttonAction: 'dispenseMedication',
          buttonText: i18n.t('medication.buttons.dispenseMedication'),
          'class': 'btn btn-primary'
        });
      }
      if (this.currentUserCan(this.get('addCapability'))) {
        additionalButtons.push({
          buttonIcon: 'octicon octicon-mail-reply',
          buttonAction: 'returnMedication',
          buttonText: i18n.t('medication.buttons.returnMedication'),
          'class': 'btn btn-primary'
        });
      }
      if (!_ember['default'].isEmpty(additionalButtons)) {
        return additionalButtons;
      }
    }).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 dispenseMedication() {
        if (this.currentUserCan('fulfill_medication')) {
          this.transitionTo('medication.edit', 'dispense');
        }
      },

      returnMedication: function returnMedication() {
        if (this.currentUserCan(this.get('addCapability'))) {
          this.transitionTo('medication.return', 'new');
        }
      }
    }
  });
});
define('hospitalrun/tests/medication/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/medication/search/route', ['exports', 'hospitalrun/routes/abstract-search-route'], function (exports, _hospitalrunRoutesAbstractSearchRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractSearchRoute['default'].extend({
    moduleName: 'medication',
    searchKeys: [{
      name: 'prescription',
      type: 'contains'
    }],
    searchModel: 'medication'
  });
});
define('hospitalrun/tests/medication/search/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - medication/search/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'medication/search/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/add-new-patient', ['exports', 'ember', 'hospitalrun/mixins/patient-id'], function (exports, _ember, _hospitalrunMixinsPatientId) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create(_hospitalrunMixinsPatientId['default'], {
    customForms: _ember['default'].inject.service(),
    addedNewPatient: false,
    newPatientId: null,

    actions: {
      addedNewPatient: function addedNewPatient(record) {
        this.send('closeModal');
        this.set('addedNewPatient', true);
        this.set('model.patient', record);
        this.set('newPatientId');
        this.send('update');
      }
    },

    addNewPatient: function addNewPatient() {
      var _this = this;

      var i18n = this.get('i18n');
      this.displayAlert(i18n.t('alerts.pleaseWait'), i18n.t('messages.newPatientHasToBeCreated'));
      this._getNewPatientId().then(function (friendlyId) {
        var patientTypeAhead = _this.get('model.patientTypeAhead');
        var nameParts = patientTypeAhead.split(' ');
        var patientDetails = {
          customForms: _ember['default'].Object.create(),
          friendlyId: friendlyId,
          patientFullName: patientTypeAhead,
          requestingController: _this
        };
        var customForms = _this.get('customForms');
        return customForms.setDefaultCustomForms(['patient', 'socialwork'], patientDetails).then(function () {
          var patient = undefined;
          if (nameParts.length >= 3) {
            patientDetails.firstName = nameParts[0];
            patientDetails.middleName = nameParts[1];
            patientDetails.lastName = nameParts.splice(2, nameParts.length).join(' ');
          } else if (nameParts.length === 2) {
            patientDetails.firstName = nameParts[0];
            patientDetails.lastName = nameParts[1];
          } else {
            patientDetails.firstName = patientTypeAhead;
          }
          patient = _this.store.createRecord('patient', patientDetails);
          _this.send('openModal', 'patients.quick-add', patient);
        });
      });
    },

    _getNewPatientId: function _getNewPatientId() {
      var newPatientId = this.get('newPatientId');
      if (_ember['default'].isEmpty(newPatientId)) {
        return new _ember['default'].RSVP.Promise((function (resolve, reject) {
          this.generateFriendlyId('patient').then((function (friendlyId) {
            this.set('newPatientId', friendlyId);
            resolve(friendlyId);
          }).bind(this), reject);
        }).bind(this));
      } else {
        return _ember['default'].RSVP.resolve(newPatientId);
      }
    }
  });
});
define('hospitalrun/tests/mixins/add-new-patient.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/add-new-patient.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/add-new-patient.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/add-to-patient-route', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var Mixin = _ember['default'].Mixin;
  exports['default'] = Mixin.create({
    queryParams: {
      forPatientId: {
        refreshModel: false
      },
      forVisitId: {
        refreshModel: false
      }
    },

    model: function model(params) {
      var idParam = get(this, 'idParam');
      var modelPromise = this._super(params);
      if (params[idParam] === 'new') {
        if (!isEmpty(params.forPatientId)) {
          return this._setPatientOnModel(modelPromise, params.forPatientId);
        } else if (!isEmpty(params.forVisitId)) {
          return this._setVisitOnModel(modelPromise, params.forVisitId);
        } else {
          return this._createNewRecord(params);
        }
      } else {
        return modelPromise;
      }
    },

    /**
     * Resolves the model promise and then sets the patient information on the model.
     */
    _setPatientOnModel: function _setPatientOnModel(modelPromise, patientId) {
      var store = get(this, 'store');
      return modelPromise.then(function (model) {
        return store.find('patient', patientId).then(function (patient) {
          model.set('patient', patient);
          model.set('returnToPatient', patientId);
          model.set('selectPatient', false);
          return model;
        });
      });
    },

    /**
     * Resolves the model promise and then sets the visit information on the model.
     */
    _setVisitOnModel: function _setVisitOnModel(modelPromise, visitId) {
      var store = get(this, 'store');
      return modelPromise.then(function (model) {
        return store.find('visit', visitId).then(function (visit) {
          model.set('visit', visit);
          model.set('returnToVisit', visitId);
          model.set('selectPatient', false);
          model.set('patient', visit.get('patient'));
          return model;
        });
      });
    }
  });
});
define('hospitalrun/tests/mixins/add-to-patient-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/add-to-patient-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/add-to-patient-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/allergy-actions', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Mixin.create({
    openAllergyModal: function openAllergyModal(allergy) {
      set(allergy, 'editController', this);
      this.send('openModal', 'allergy.edit', allergy);
    },

    savePatientAllergy: function savePatientAllergy(patient, allergy) {
      var _this = this;

      get(patient, 'allergies').pushObject(allergy);
      patient.save().then(function () {
        _this.silentUpdate('closeModal');
      });
    },

    deletePatientAllergy: function deletePatientAllergy(patient, allergy) {
      var _this2 = this;

      var patientAllergies = get(patient, 'allergies');
      allergy.destroyRecord().then(function () {
        patientAllergies.removeObject(allergy);
        patient.save().then(function () {
          _this2.send('closeModal');
        });
      });
    },

    actions: {
      editAllergy: function editAllergy(allergy) {
        this.openAllergyModal(allergy);
      },

      showAddAllergy: function showAddAllergy() {
        var newAllergy = get(this, 'store').createRecord('allergy');
        this.openAllergyModal(newAllergy);
      }
    }
  });
});
define('hospitalrun/tests/mixins/allergy-actions.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/allergy-actions.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/allergy-actions.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/appointment-statuses', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    appointmentStatusList: ['Attended', 'Scheduled', 'Canceled', 'Missed'],
    appointmentStatuses: _ember['default'].computed.map('appointmentStatusList', _hospitalrunUtilsSelectValues['default'].selectValuesMap),

    appointmentStatusesWithEmpty: (function () {
      return _hospitalrunUtilsSelectValues['default'].selectValues(this.get('appointmentStatusList'), true);
    }).property()
  });
});
define('hospitalrun/tests/mixins/appointment-statuses.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/appointment-statuses.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/appointment-statuses.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/billing-categories', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    defaultBillingCategories: ['Hospital Charges']
  });
});
define('hospitalrun/tests/mixins/billing-categories.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/billing-categories.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/billing-categories.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/blood-types', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    bloodTypes: ['A+', 'A-', 'AB-', 'AB+', 'B+', 'B-', 'O+', 'O-'].map(_hospitalrunUtilsSelectValues['default'].selectValuesMap)
  });
});
define('hospitalrun/tests/mixins/blood-types.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/blood-types.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/blood-types.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/can-edit-requested', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    canEdit: (function () {
      var status = this.get('status');
      return status === 'Requested';
    }).property('status')
  });
});
define('hospitalrun/tests/mixins/can-edit-requested.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/can-edit-requested.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/can-edit-requested.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/charge-actions', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    chargePricingCategory: null,
    pricingList: null,
    pricingTypeForObjectType: null,
    pricingTypes: null,
    _createNewChargeRecord: function _createNewChargeRecord(quantityCharged, pricingId) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        this.store.find('pricing', pricingId).then((function (item) {
          var newCharge = this.store.createRecord('proc-charge', {
            dateCharged: new Date(),
            quantity: quantityCharged,
            pricingItem: item
          });
          newCharge.save().then((function (chargeRecord) {
            var charges = this.get('model.charges');
            charges.addObject(chargeRecord);
            resolve();
          }).bind(this), reject);
        }).bind(this), reject);
      }).bind(this), '_createNewChargeRecord with pricingId:' + pricingId);
    },

    actions: {
      addCharge: function addCharge(charge) {
        var charges = this.get('model.charges');
        charges.addObject(charge);
        var from = 'addCharge_' + charge.get('id');
        if (charge.get('medicationCharge')) {
          from = 'addMedication_' + charge.get('id');
        }
        this.silentUpdate('closeModal', from);
      },

      deleteCharge: function deleteCharge(model) {
        var _this = this;

        var chargeToDelete = model.get('chargeToDelete');
        var charges = this.get('model.charges');
        charges.removeObject(chargeToDelete);
        chargeToDelete.destroyRecord().then(function () {
          _this.silentUpdate('closeModal', 'deleteCharge');
        });
      },

      showAddCharge: function showAddCharge() {
        var newCharge = this.get('store').createRecord('proc-charge', {
          dateCharged: new Date(),
          quantity: 1,
          pricingCategory: this.get('chargePricingCategory')
        });
        this.send('openModal', this.get('chargeRoute'), newCharge);
      },

      showEditCharge: function showEditCharge(charge) {
        charge.set('itemName', charge.get('pricingItem.name'));
        charge.set('pricingCategory', this.get('chargePricingCategory'));
        this.send('openModal', this.get('chargeRoute'), charge);
      },

      showDeleteCharge: function showDeleteCharge(charge) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          closeModalOnConfirm: false,
          confirmAction: 'deleteCharge',
          title: 'Delete Charge Item',
          message: 'Are you sure you want to delete this charged item?',
          chargeToDelete: charge,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      },

      setChargeQuantity: function setChargeQuantity(id, quantity) {
        var model = this.get('model');
        model.set(id, quantity);
      }
    },

    canAddCharge: (function () {
      return this.currentUserCan('add_charge');
    }).property(),

    /**
     * Returns pricing list without object types
     * Used for labs and imaging where the labs and imaging types are
     * directly in the price list.
     */
    chargesPricingList: (function () {
      var pricingList = this.get('pricingList');
      var pricingTypeForObjectType = this.get('pricingTypeForObjectType');
      return pricingList.filter(function (item) {
        return item.type !== pricingTypeForObjectType;
      });
    }).property('pricingList', 'pricingTypeForObjectType'),

    chargeRoute: null,

    findChargeForPricingItem: function findChargeForPricingItem(pricingItem, charges) {
      var chargeForItem = charges.find(function (charge) {
        var chargePricingItemId = charge.get('pricingItem.id');
        return pricingItem.id === chargePricingItemId;
      });
      return chargeForItem;
    },
    /**
     * Returns object types out of the pricing list.
     * Used for labs and imaging where the labs and imaging types are
     * directly in the price list.
     */
    objectTypeList: (function () {
      var pricingList = this.get('pricingList');
      var pricingTypeForObjectType = this.get('pricingTypeForObjectType');
      var userCanAddPricingTypes = this.get('userCanAddPricingTypes');
      var returnList = _ember['default'].Object.create({
        value: [],
        userCanAdd: userCanAddPricingTypes
      });
      if (!_ember['default'].isEmpty(pricingList)) {
        returnList.set('value', pricingList.filterBy('pricingType', pricingTypeForObjectType));
      }
      return returnList;
    }).property('pricingList', 'pricingTypeForObjectType', 'pricingTypeValues'),

    organizeByType: _ember['default'].computed.alias('pricingTypes.organizeByType'),

    pricingTypeList: (function () {
      var pricingList = this.get('pricingList');
      var pricingTypeValues = this.get('pricingTypeValues');
      var pricingTypeForObjectType = this.get('pricingTypeForObjectType');
      if (!_ember['default'].isEmpty(pricingTypeValues)) {
        pricingTypeValues = pricingTypeValues.filter(function (pricingType) {
          var havePricing = false;
          if (!_ember['default'].isEmpty(pricingList)) {
            havePricing = !_ember['default'].isEmpty(pricingList.findBy('pricingType', pricingType));
          }
          return havePricing && pricingType !== pricingTypeForObjectType;
        });
        pricingTypeValues = pricingTypeValues.sortBy('name');
        return pricingTypeValues;
      }
    }).property('pricingTypeValues', 'pricingTypeForObjectType', 'pricingList'),

    pricingTypeValues: _ember['default'].computed.alias('pricingTypes.value'),

    /**
     * Create multiple new request records from the pricing records passed in.  This function
     * will also add those new records to the specified visit.
     * @param {array} pricingRecords the list of pricing records to use to create request records from.
     * @param {string} pricingField the name of the field on the request record to set the pricing record on.
     * @param {string} visitChildName the name of the child object on the visit to add to.
     * @param {string} newVisitType if a new visit needs to be created, what type of visit
     * should be created.
     */
    createMultipleRequests: function createMultipleRequests(pricingRecords, pricingField, visitChildName, newVisitType) {
      var firstRecord = pricingRecords.get('firstObject');
      var modelToSave = this.get('model');
      modelToSave.set(pricingField, firstRecord);
      this.addChildToVisit(modelToSave, visitChildName, newVisitType).then((function (visit) {
        modelToSave.save().then((function () {
          this._finishCreateMultipleRequests(pricingRecords, pricingField, visitChildName, newVisitType, visit);
        }).bind(this));
      }).bind(this));
    },

    _finishCreateMultipleRequests: function _finishCreateMultipleRequests(pricingRecords, pricingField, visitChildName, newVisitType, visit) {
      var attributesToSave = {};
      var baseModel = this.get('model');
      var modelToSave = undefined;
      var modelsToAdd = [];
      var patient = this.get('model.patient');
      var savePromises = [];

      baseModel.eachAttribute(function (name) {
        attributesToSave[name] = baseModel.get(name);
      });

      pricingRecords.forEach((function (pricingRecord, index) {
        if (index > 0) {
          modelToSave = this.store.createRecord(newVisitType.toLowerCase(), attributesToSave);
          modelToSave.set(pricingField, pricingRecord);
          modelToSave.set('patient', patient);
          modelToSave.set('visit', visit);
          modelsToAdd.push(modelToSave);
          savePromises.push(modelToSave.save());
        }
      }).bind(this));

      _ember['default'].RSVP.all(savePromises).then((function () {
        var addPromises = [];
        modelsToAdd.forEach((function (modelToSave) {
          addPromises.push(this.addChildToVisit(modelToSave, visitChildName, newVisitType));
        }).bind(this));
        _ember['default'].RSVP.all(addPromises).then((function (addResults) {
          this.afterUpdate(addResults, true);
        }).bind(this));
      }).bind(this));
    },

    saveNewPricing: function saveNewPricing(pricingName, pricingCategory, priceObjectToSet) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var newPricing = undefined;
        var pricingTypeForObjectType = this.get('pricingTypeForObjectType');
        newPricing = this.store.createRecord('pricing', {
          name: pricingName,
          category: pricingCategory,
          pricingType: pricingTypeForObjectType
        });
        newPricing.save().then((function (savedNewPricing) {
          this.get('pricingList').addObject({
            id: savedNewPricing.get('id'),
            name: newPricing.get('name')
          });
          this.set(priceObjectToSet, newPricing);
          resolve();
        }).bind(this), reject);
      }).bind(this), 'saveNewPricing for: ' + pricingName);
    },

    getSelectedPricing: function getSelectedPricing(selectedField) {
      var selectedItem = this.get(selectedField);
      if (!_ember['default'].isEmpty(selectedItem)) {
        return new _ember['default'].RSVP.Promise((function (resolve, reject) {
          if (_ember['default'].isArray(selectedItem)) {
            this.store.findByIds('pricing', selectedItem).then(resolve, reject);
          } else {
            this.store.find('pricing', selectedItem.id).then(resolve, reject);
          }
        }).bind(this));
      } else {
        return _ember['default'].RSVP.resolve();
      }
    },

    showAddCharge: (function () {
      var canAddCharge = this.get('canAddCharge');
      var organizeByType = this.get('organizeByType');
      if (canAddCharge) {
        return !organizeByType;
      } else {
        return false;
      }
    }).property('canAddCharge', 'organizeByType'),

    showEditCharges: (function () {
      var canAddCharge = this.get('canAddCharge');
      var organizeByType = this.get('organizeByType');
      if (canAddCharge) {
        return organizeByType;
      } else {
        return false;
      }
    }).property('canAddCharge', 'organizeByType'),

    showPricingTypeTabs: (function () {
      var pricingTypeList = this.get('pricingTypeList');
      return !_ember['default'].isEmpty(pricingTypeList) && pricingTypeList.get('length') > 1;
    }).property('pricingTypeList'),

    userCanAddPricingTypes: (function () {
      var pricingTypes = this.get('pricingTypes');
      if (_ember['default'].isEmpty(pricingTypes)) {
        return true;
      } else {
        return pricingTypes.get('userCanAdd');
      }
    }).property('pricingTypes'),

    /**
     * When using organizeByType charges need to be mapped over from the price lists
     */
    updateCharges: function updateCharges() {
      var organizeByType = this.get('organizeByType');
      if (!organizeByType) {
        return _ember['default'].RSVP.resolve();
      }
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var charges = this.get('model.charges');
        var chargePromises = [];
        var model = this.get('model');
        var pricingList = this.get('pricingList');
        pricingList.forEach((function (pricingItem) {
          var currentCharge = this.findChargeForPricingItem(pricingItem, model.get('charges'));
          var quantityCharged = model.get(pricingItem.id);
          if (_ember['default'].isEmpty(quantityCharged)) {
            if (currentCharge) {
              // Remove existing charge because quantity is blank
              charges.removeObject(currentCharge);
              chargePromises.push(currentCharge.destroyRecord());
            }
          } else {
            if (currentCharge) {
              if (currentCharge.get('quantity') !== quantityCharged) {
                currentCharge.set('quantity', quantityCharged);
                chargePromises.push(currentCharge.save());
              }
            } else {
              chargePromises.push(this._createNewChargeRecord(quantityCharged, pricingItem.id));
            }
          }
        }).bind(this));
        _ember['default'].RSVP.all(chargePromises, 'Charges updated for current record: ' + this.get('model.id')).then(resolve, reject);
      }).bind(this), 'updateCharges for current record: ' + this.get('model.id'));
    }
  });
});
define('hospitalrun/tests/mixins/charge-actions.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/charge-actions.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/charge-actions.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/charge-route', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    database: _ember['default'].inject.service(),
    actions: {
      deleteCharge: function deleteCharge(model) {
        this.controller.send('deleteCharge', model);
      }
    },
    pricingList: null,

    afterModel: function afterModel() {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var database = this.get('database');
        var maxId = database.getMaxPouchId('pricing');
        var minId = database.getMinPouchId('pricing');
        var pricingCategory = this.get('pricingCategory');
        var pricingQuery = {
          startkey: [pricingCategory, null, null, minId],
          endkey: [pricingCategory, {}, {}, maxId],
          include_docs: true
        };
        database.queryMainDB(pricingQuery, 'pricing_by_category').then((function (result) {
          var pricingList = result.rows.map(function (item) {
            return item.doc;
          });
          this.set('pricingList', pricingList);
          resolve();
        }).bind(this))['catch'](reject);
      }).bind(this));
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      controller.set('pricingList', this.get('pricingList'));
    }
  });
});
define('hospitalrun/tests/mixins/charge-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/charge-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/charge-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/check-for-errors', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var Mixin = _ember['default'].Mixin;
  var RSVP = _ember['default'].RSVP;
  exports['default'] = Mixin.create({
    _checkForErrors: function _checkForErrors(callPromise) {
      var _this = this;

      return new RSVP.Promise(function (resolve, reject) {
        callPromise.then(resolve, function (err) {
          var database = get(_this, 'database');
          reject(database.handleErrorResponse(err));
        });
      });
    }
  });
});
define('hospitalrun/tests/mixins/check-for-errors.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/check-for-errors.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/check-for-errors.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/custom-field-types', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _ember['default'].Mixin.create({

    fieldTypeValues: ['checkbox', 'radio', 'select', 'text', 'textarea'],

    fieldTypes: computed(function () {
      var i18n = this.get('i18n');
      var fieldTypeValues = this.get('fieldTypeValues');
      return fieldTypeValues.map(function (fieldTypeId) {
        return {
          id: fieldTypeId,
          value: i18n.t('admin.customForms.labels.' + fieldTypeId)
        };
      }).sort(function (a, b) {
        return _ember['default'].compare(a.value.toString(), b.value.toString());
      });
    })
  });
});
define('hospitalrun/tests/mixins/custom-field-types.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/custom-field-types.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/custom-field-types.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/date-format', ['exports', 'ember', 'moment'], function (exports, _ember, _moment) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    _dateFormat: function _dateFormat(value, dateFormat) {
      if (_ember['default'].isEmpty(dateFormat)) {
        dateFormat = 'l';
      }
      if (!_ember['default'].isEmpty(value)) {
        return (0, _moment['default'])(value).format(dateFormat);
      }
    },

    dateToTime: function dateToTime(date) {
      if (!_ember['default'].isEmpty(date) && date.getTime) {
        return date.getTime();
      }
    }
  });
});
define('hospitalrun/tests/mixins/date-format.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/date-format.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/date-format.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/diagnosis-actions', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    editDiagnosis: function editDiagnosis(diagnosis) {
      diagnosis.set('editController', this);
      this.send('openModal', 'diagnosis.edit', diagnosis);
    },

    actions: {
      deleteDiagnosis: function deleteDiagnosis(diagnosis) {
        var _this = this;

        var diagnoses = this.get('model.diagnoses');
        diagnoses.removeObject(diagnosis);
        diagnosis.set('archived', true);
        diagnosis.save().then(function () {
          _this.silentUpdate('closeModal');
        });
      },

      editDiagnosis: function editDiagnosis(diagnosis) {
        this.editDiagnosis(diagnosis);
      },

      showAddDiagnosis: function showAddDiagnosis() {
        var newDiagnosis = this.get('store').createRecord('diagnosis', {
          date: new Date()
        });
        this.editDiagnosis(newDiagnosis);
      }
    }

  });
});
define('hospitalrun/tests/mixins/diagnosis-actions.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/diagnosis-actions.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/diagnosis-actions.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/dob-days', ['exports', 'ember', 'moment'], function (exports, _ember, _moment) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    convertDOBToText: function convertDOBToText(birthDate, shortFormat, omitDays) {
      var today = new Date();
      var years = 0;
      var months = 0;
      var days = 0;

      if (birthDate) {
        if (birthDate.getFullYear === undefined) {
          birthDate = (0, _moment['default'])(birthDate, 'l').toDate();
        }
        if (birthDate.getFullYear !== undefined) {
          years = today.getFullYear() - birthDate.getFullYear();
          if (today.getMonth() < birthDate.getMonth() || today.getMonth() === birthDate.getMonth() && today.getDate() < birthDate.getDate()) {
            years--;
          }
        }

        if (birthDate.getMonth) {
          months = today.getMonth() - birthDate.getMonth();
          days = today.getDate() - birthDate.getDate();
          if (months <= 0) {
            if (days < 0) {
              months += 11;
            } else if (months < 0) {
              months += 12;
            }
          } else {
            if (days < 0) {
              months = months - 1;
            }
          }
        }

        if (birthDate.getDate) {
          days = today.getDate() - birthDate.getDate();
          if (days < 0) {
            days += 30;
          }
        }
      }

      var formatString = '';
      var options = {
        years: years,
        days: days,
        months: months
      };
      var i18n = this.get('i18n');
      if (shortFormat) {
        if (years > 0) {
          formatString = i18n.t('dates.short', options);
        } else {
          formatString = i18n.t('dates.shortOmitYears', options);
        }
      } else if (omitDays) {
        if (years > 1) {
          formatString = i18n.t('dates.longOmitDaysPlural', options);
        } else if (years === 1) {
          formatString = i18n.t('dates.longOmitDays', options);
        } else {
          formatString = i18n.t('dates.longOmitDaysYears', options);
        }
      } else {
        if (years > 1) {
          formatString = i18n.t('dates.longPlural', options);
        } else if (years === 1) {
          formatString = i18n.t('dates.long', options);
        } else {
          formatString = i18n.t('dates.longOmitYears', options);
        }
      }
      return formatString;
    }
  });
});
define('hospitalrun/tests/mixins/dob-days.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/dob-days.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/dob-days.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/edit-panel-props', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;

  var ALL_PROPS = ['actionForUpdateButton', 'additionalButtons', 'cancelButtonText', 'disabledAction', 'hideCancelButton', 'showUpdateButton', 'updateButtonAction', 'updateButtonIcon', 'updateButtonText'];

  exports['default'] = _ember['default'].Mixin.create({

    additionalButtons: null,
    cancelButtonText: null,
    disabledAction: null,
    hideCancelButton: null,
    showUpdateButton: null,
    updateButtonAction: null,
    updateButtonIcon: null,
    updateButtonText: null,

    actionForUpdateButton: computed('disabledAction', function () {
      var disabledAction = this.get('disabledAction');
      if (isEmpty(disabledAction) || disabledAction === false) {
        return 'updateButtonAction';
      } else {
        return 'disabledAction';
      }
    }),

    editPanelProps: computed.apply(undefined, ALL_PROPS.concat([function () {
      return this.getProperties(ALL_PROPS);
    }]))

  });
});
define('hospitalrun/tests/mixins/edit-panel-props.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/edit-panel-props.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/edit-panel-props.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/filter-list', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }

  var compare = _ember['default'].compare;
  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var isHTMLSafe = _ember['default'].String.isHTMLSafe;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Mixin.create({
    filterBy: null,
    filterValue: null,
    filteredBy: new _ember['default'].Map(),
    sortByDesc: null,
    sortByKey: null,

    filterList: function filterList(list, filterBy, filterValue) {
      var filteredBy = get(this, 'filteredBy');
      if (isEmpty(filterBy) && isEmpty(filteredBy)) {
        return list;
      }
      if (!isEmpty(filterBy)) {
        filteredBy.set(filterBy, filterValue);
      }
      this.set('filteredBy', filteredBy);
      var filteredList = list.filter(function (listItem) {
        var includeRecord = true;
        filteredBy.forEach(function (filterValue, filterBy) {
          var itemValue = listItem.get(filterBy);
          if (!isEmpty(filterValue)) {
            if (isHTMLSafe(filterValue)) {
              filterValue = filterValue.toString();
            } else if (_instanceof(filterValue, Date)) {
              filterValue = filterValue.getTime();
            }
            if (isHTMLSafe(itemValue)) {
              itemValue = itemValue.toString();
            } else if (_instanceof(itemValue, Date)) {
              itemValue = itemValue.getTime();
            }
            if (itemValue !== filterValue) {
              includeRecord = false;
            }
          }
        });
        return includeRecord;
      });
      return filteredList;
    },

    sortFilteredList: function sortFilteredList(filteredList) {
      var sortDesc = get(this, 'sortByDesc');
      var sortBy = get(this, 'sortByKey');
      if (isEmpty(filteredList) || isEmpty(sortBy)) {
        return filteredList;
      }
      filteredList = filteredList.toArray().sort(function (a, b) {
        var compareA = a.get(sortBy);
        var compareB = b.get(sortBy);
        if (sortBy === 'orderType') {
          compareA = compareA.toString();
          compareB = compareB.toString();
        }
        if (sortDesc) {
          return compare(compareB, compareA);
        } else {
          return compare(compareA, compareB);
        }
      });
      return filteredList;
    },

    actions: {
      filter: function filter(filterBy, filterValue) {
        set(this, 'filterBy', filterBy);
        set(this, 'filterValue', filterValue);
      },

      sortByKey: function sortByKey(sortKey, sortDesc) {
        this.setProperties({
          sortByDesc: sortDesc,
          sortByKey: sortKey
        });
      }
    }
  });
});
define('hospitalrun/tests/mixins/filter-list.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/filter-list.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/filter-list.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/friendly-id', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports.sequenceId = sequenceId;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Mixin.create({
    database: inject.service(),
    sequenceName: null,
    sequenceView: null,

    /**
    * Override this function to generate an id for a new record
    * @return a generated id;default is null which means that an
    * id will be automatically generated via Ember data.
    */
    generateFriendlyId: function generateFriendlyId(modelName) {
      var _this = this;

      var sequenceName = get(this, 'sequenceName');
      return this.sequencePrefix().then(function (prefix) {
        return _this.store.find('sequence', sequenceName).then(function (sequence) {
          return _this._findUnusedId(sequence, prefix, modelName);
        })['catch'](function () {
          var store = _this.get('store');
          var sequence = store.push(store.normalize('sequence', {
            id: sequenceName,
            value: 1,
            prefix: prefix
          }));
          return sequence.save().then(function (sequence) {
            return _this._findUnusedId(sequence, prefix, modelName);
          });
        });
      });
    },

    sequencePrefix: function sequencePrefix() {
      var _this2 = this;

      var sequenceName = get(this, 'sequenceName');
      return this.store.find('sequence', sequenceName).then(function (sequence) {
        return get(sequence, 'prefix');
      })['catch'](function () {
        var type = sequenceName;
        if (type.indexOf('_') > -1) {
          type = type.substr(type.indexOf('_') + 1);
        }
        return _this2._findNextPrefix(type, 0);
      });
    },

    _findNextPrefix: function _findNextPrefix(type, prefixChars) {
      var _this3 = this;

      prefixChars++;
      return this._findSequenceByPrefix(type, prefixChars).then(function (records) {
        if (_ember['default'].isEmpty(records.rows)) {
          return type.toLowerCase().substr(0, prefixChars);
        } else {
          return _this3._findNextSequence(type, prefixChars);
        }
      })['catch'](function () {
        return prefixChars;
      });
    },

    _findSequenceByPrefix: function _findSequenceByPrefix(type, prefixChars) {
      var database = this.get('database');
      var sequenceQuery = {
        key: type.toLowerCase().substr(0, prefixChars)
      };
      return database.queryMainDB(sequenceQuery, 'sequence_by_prefix');
    },

    _findUnusedId: function _findUnusedId(sequence, prefix, modelName) {
      var _this4 = this;

      var database = get(this, 'database');
      var maxValue = database.getMaxPouchId(modelName);
      var current = undefined,
          id = undefined;
      var sequenceView = get(this, 'sequenceView');
      current = sequence.get('value');
      id = sequenceId(prefix, current);
      var query = {
        startkey: [id, null],
        endkey: [id, maxValue]
      };
      return database.queryMainDB(query, sequenceView).then(function (found) {
        if (!isEmpty(found.rows)) {
          sequence.incrementProperty('value');
          return _this4._findUnusedId(sequence, prefix, modelName);
        }
        if (sequence.get('hasDirtyAttributes')) {
          return sequence.save().then(function () {
            return id;
          });
        }
        return id;
      });
    }
  });

  function sequenceId(prefix, sequence) {
    if (sequence < 100000) {
      sequence = ('00000' + sequence).slice(-5);
    }
    return '' + prefix + sequence;
  }
});
define('hospitalrun/tests/mixins/friendly-id.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/friendly-id.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/friendly-id.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/fulfill-request', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  // NOTE!!! inventory-locations mixin is needed for fulfill-request mixin!
  exports['default'] = _ember['default'].Mixin.create({
    actions: {
      doneFulfillRequest: function doneFulfillRequest() {
        // Placeholder function; override if you need to know when fulfillrequest is complete.
      },

      fulfillRequest: function fulfillRequest(request, closeModal, increment, skipTransition) {
        this.performFulfillRequest(request, closeModal, increment, skipTransition);
      }
    },

    performFulfillRequest: function performFulfillRequest(request, closeModal, increment, skipTransition) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var markAsConsumed = request.get('markAsConsumed');
        var transactionType = request.get('transactionType');
        if (transactionType === 'Request') {
          transactionType = null; // reset the transaction type so that it gets set below.
        }
        request.get('inventoryItem').then((function (inventoryItem) {
          if (markAsConsumed) {
            request.set('adjustPurchases', true);
            if (_ember['default'].isEmpty(transactionType)) {
              request.set('transactionType', 'Fulfillment');
            }
            this._performFulfillment(request, inventoryItem, increment).then((function () {
              this._finishFulfillRequest(request, inventoryItem, closeModal, increment, skipTransition);
              resolve();
            }).bind(this), reject);
          } else {
            request.set('adjustPurchases', false);
            if (_ember['default'].isEmpty(transactionType)) {
              request.set('transactionType', 'Transfer');
            }
            this._finishFulfillRequest(request, inventoryItem, closeModal, increment, skipTransition);
            resolve();
          }
        }).bind(this), reject);
      }).bind(this));
    },

    /**
     * @private
     */
    _findQuantity: function _findQuantity(request, purchases, item, increment) {
      var costPerUnit = undefined;
      var requestPurchases = [];
      var quantityOnHand = item.get('quantity');
      var quantityRequested = parseInt(request.get('quantity'));
      var quantityNeeded = quantityRequested;
      var purchaseInfo = [];
      var totalCost = 0;
      if (increment) {
        var purchase = purchases.get('lastObject');
        costPerUnit = purchase.get('costPerUnit');
        purchase.incrementProperty('currentQuantity', quantityRequested);
        totalCost += costPerUnit * quantityNeeded;
        purchaseInfo.push({
          id: purchase.get('id'),
          quantity: quantityRequested
        });
        requestPurchases.addObject(purchase);
      } else {
        var foundQuantity = purchases.any(function (purchase) {
          var currentQuantity = purchase.get('currentQuantity');
          if (purchase.get('expired') || currentQuantity <= 0) {
            return false;
          }
          costPerUnit = purchase.get('costPerUnit');
          if (increment) {

            return true;
          } else {
            if (quantityNeeded > currentQuantity) {
              totalCost += costPerUnit * currentQuantity;
              quantityNeeded = quantityNeeded - currentQuantity;
              purchaseInfo.push({
                id: purchase.get('id'),
                quantity: parseInt(currentQuantity)
              });
              currentQuantity = 0;
            } else {
              totalCost += costPerUnit * quantityNeeded;
              currentQuantity = currentQuantity - quantityNeeded;
              purchaseInfo.push({
                id: purchase.get('id'),
                quantity: parseInt(quantityNeeded)
              });
              quantityNeeded = 0;
            }
            purchase.set('currentQuantity', currentQuantity);
            requestPurchases.addObject(purchase);
            return quantityNeeded === 0;
          }
        });
        if (!foundQuantity) {
          return 'Could not find any purchases that had the required quantity: ' + quantityRequested;
        }
      }
      request.set('costPerUnit', (totalCost / quantityRequested).toFixed(2));
      request.set('quantityAtCompletion', quantityOnHand);
      request.set('purchasesAffected', purchaseInfo);
      request.set('purchases', requestPurchases); // Not saved permanently, just set here so that purchases get saved later.
      item.updateQuantity();
      return true;
    },

    /**
     * @private
     * Finish the fulfillment request.
     * @param {object} request the request to fulfill.
     * @param {object} inventoryItem the inventoryItem that should be used for fulfillment.
     * @param {boolean} closeModal if the modal should be closed.
     * @param {boolean} increment if the request should increment, not decrement
     * @param {boolean} skipTransition if the transition should not run after fulfillment.
     */
    _finishFulfillRequest: function _finishFulfillRequest(request, inventoryItem, closeModal, increment, skipTransition) {
      var inventoryLocations = request.get('inventoryLocations');
      var locationsAffected = [];
      var markAsConsumed = request.get('markAsConsumed');
      var promises = [];
      var quantity = parseInt(request.get('quantity'));
      var requestPurchases = request.get('purchases');
      if (increment) {
        var locationToIncrement = inventoryLocations.get('firstObject');
        locationToIncrement.incrementProperty('quantity', quantity);
        promises.push(locationToIncrement.save());
        locationsAffected.push({
          name: locationToIncrement.get('locationName'),
          quantity: quantity
        });
      } else {
        inventoryLocations.reduce((function (quantityNeeded, location) {
          var deliveryLocation = request.get('deliveryLocation');
          var deliveryAisle = request.get('deliveryAisle');
          var locationQuantity = parseInt(location.get('quantity'));
          if (quantityNeeded > 0) {
            if (!markAsConsumed) {
              location.set('transferAisleLocation', deliveryAisle);
              location.set('transferLocation', deliveryLocation);
            }
            if (locationQuantity >= quantityNeeded) {
              if (markAsConsumed) {
                location.decrementProperty('quantity', quantityNeeded);
                promises.push(location.save());
              } else {
                location.set('adjustmentQuantity', quantityNeeded);
                promises.push(this.transferToLocation(inventoryItem, location));
              }
              locationsAffected.push({
                name: location.get('locationName'),
                quantity: quantityNeeded
              });
              return 0;
            } else {
              if (markAsConsumed) {
                location.decrementProperty('quantity', locationQuantity);
                promises.push(location.save());
              } else {
                location.set('adjustmentQuantity', locationQuantity);
                promises.push(this.transferToLocation(inventoryItem, location));
              }
              locationsAffected.push({
                name: location.get('locationName'),
                quantity: locationQuantity
              });
              return quantityNeeded - locationQuantity;
            }
          }
        }).bind(this), quantity);
      }
      request.set('locationsAffected', locationsAffected);
      if (markAsConsumed) {
        requestPurchases.forEach(function (purchase) {
          promises.push(purchase.save());
        });
      }
      _ember['default'].RSVP.all(promises, 'Preliminary saving done for inventory fulfillment').then((function () {
        var savePromises = [];
        savePromises.push(inventoryItem.save());
        request.set('status', 'Completed');
        request.set('completedBy', request.getUserName());
        savePromises.push(request.save());
        _ember['default'].RSVP.all(savePromises, 'All saving done for inventory fulfillment').then((function () {
          this.send('doneFulfillRequest');
          if (closeModal) {
            this.send('closeModal');
          }
          if (!skipTransition) {
            this.transitionTo('inventory.index');
          }
        }).bind(this));
      }).bind(this));
    },

    /**
     * @private
     * Fulfill the request, decrementing from the purchases available on the inventory item
     * This function doesn't save anything, it just updates the objects in memory, so
     * a route will need to ensure that the models affected here get updated.
     * @param {object} request the request to fulfill.
     * @param {object} inventoryItem the inventoryItem that should be used for fulfillment.
     * @param {boolean} increment if the request should increment, not decrement
     * @returns true if the request is fulfilled; false if it cannot be fulfilled due to a lack
     * of stock.
     */
    _performFulfillment: function _performFulfillment(request, inventoryItem, increment) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var purchases = inventoryItem.get('purchases');
        var quantityOnHand = inventoryItem.get('quantity');
        var quantityRequested = request.get('quantity');
        if (increment || quantityOnHand >= quantityRequested) {
          var findResult = this._findQuantity(request, purchases, inventoryItem, increment);
          if (findResult === true) {
            resolve();
          } else {
            reject(findResult);
          }
        } else {
          reject('The quantity on hand, ' + quantityOnHand + ' is less than the requested quantity of ' + quantityRequested + '.');
        }
      }).bind(this));
    }

  });
});
define('hospitalrun/tests/mixins/fulfill-request.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/fulfill-request.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/fulfill-request.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/hospitalrun-version', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    version: '1.0.0-beta'
  });
});
define('hospitalrun/tests/mixins/hospitalrun-version.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/hospitalrun-version.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/hospitalrun-version.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/incident-statuses', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var ACTIVE = 'Active';
  exports.ACTIVE = ACTIVE;
  var CLOSED = 'Closed';
  exports.CLOSED = CLOSED;
  var FOLLOW_UP = 'Followup';
  exports.FOLLOW_UP = FOLLOW_UP;
  var REPORTED = 'Reported';

  exports.REPORTED = REPORTED;
  exports['default'] = _ember['default'].Mixin.create({
    statusList: [ACTIVE, CLOSED, FOLLOW_UP, REPORTED],
    getLocalizedStatus: function getLocalizedStatus(status) {
      var i18n = get(this, 'i18n');
      return i18n.t('incident.labels.status' + status);
    }
  });
});
define('hospitalrun/tests/mixins/incident-statuses.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/incident-statuses.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/incident-statuses.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/inventory-adjustment-types', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    adjustmentTypes: (function () {
      var i18n = this.get('i18n');
      return [{
        name: i18n.t('inventory.labels.addAdjustmentType').toString(),
        type: 'Adjustment (Add)'
      }, {
        name: i18n.t('inventory.labels.removeAdjustmentType').toString(),
        type: 'Adjustment (Remove)'
      }, {
        name: i18n.t('inventory.labels.returnToVendorAdjustmentType').toString(),
        type: 'Return To Vendor'
      }, {
        name: i18n.t('inventory.labels.returnAdjustmentType').toString(),
        type: 'Return'
      }, {
        name: i18n.t('inventory.labels.writeOffAdjustmentType').toString(),
        type: 'Write Off'
      }];
    }).property()
  });
});
define('hospitalrun/tests/mixins/inventory-adjustment-types.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/inventory-adjustment-types.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/inventory-adjustment-types.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/inventory-id', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    /**
     * Calculate a new id based on time stamp and randomized number
     * @return a generated id in base 36 so that its a shorter barcode.
     */
    generateId: function generateId() {
      var min = 1;
      var max = 999;
      var part1 = new Date().getTime();
      var part2 = Math.floor(Math.random() * (max - min + 1)) + min;
      return _ember['default'].RSVP.resolve(part1.toString(36) + '_' + part2.toString(36));
    }
  });
});
define('hospitalrun/tests/mixins/inventory-id.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/inventory-id.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/inventory-id.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/inventory-locations', ['exports', 'ember', 'npm:uuid'], function (exports, _ember, _npmUuid) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    aisleToFind: null,
    locationToFind: null,

    _addQuantityToLocation: function _addQuantityToLocation(inventoryItem, quantity, location, aisle) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        this._findOrCreateLocation(inventoryItem, location, aisle).then(function (foundLocation) {
          foundLocation.incrementProperty('quantity', quantity);
          foundLocation.save().then(resolve, reject);
        });
      }).bind(this));
    },

    _findOrCreateLocation: function _findOrCreateLocation(inventoryItem, location, aisle) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var _this = this;

        var foundLocation = false;
        var locations = inventoryItem.get('locations');
        this.set('aisleToFind', aisle);
        this.set('locationToFind', location);

        foundLocation = locations.find(this.findLocation, this);
        if (foundLocation) {
          resolve(foundLocation);
        } else {
          (function () {
            var locationRecord = _this.get('store').createRecord('inv-location', {
              id: _npmUuid['default'].v4(),
              aisleLocation: aisle,
              location: location,
              quantity: 0
            });
            locations.addObject(locationRecord);
            locationRecord.save().then(function () {
              resolve(locationRecord);
            }, reject);
          })();
        }
      }).bind(this));
    },

    findLocation: function findLocation(inventoryLocation) {
      var aisleLocation = inventoryLocation.get('aisleLocation');
      var aisleToFind = this.get('aisleToFind');
      var itemLocation = inventoryLocation.get('location');
      var locationToFind = this.get('locationToFind');
      if ((_ember['default'].isEmpty(aisleLocation) && _ember['default'].isEmpty(aisleToFind) || aisleLocation === aisleToFind) && (_ember['default'].isEmpty(itemLocation) && _ember['default'].isEmpty(locationToFind) || itemLocation === locationToFind)) {
        return true;
      }
    },

    /**
     * Process a new purchase, updating the corresponding location
     * with the number of items available.
     * @returns {Promise} a promise that fulfills once location has been updated.
     */
    newPurchaseAdded: function newPurchaseAdded(inventoryItem, newPurchase) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var aisle = newPurchase.get('aisleLocation');
        var location = newPurchase.get('location');
        var quantity = parseInt(newPurchase.get('originalQuantity'));
        this._addQuantityToLocation(inventoryItem, quantity, location, aisle).then(resolve, reject);
      }).bind(this));
    },

    /**
     * Save the location if the quantity is greater than zero, otherwise remove the empty location.
     * @param {Object} location the location to update or remove.
     * @param {Object} inventoryItem the inventory item the location belongs to.
     * @return {Promise} promise for save or remove
     */
    saveLocation: function saveLocation(location, inventoryItem) {
      if (location.get('quantity') === 0) {
        var locations = inventoryItem.get('locations');
        locations.removeObject(location);
        return location.destroyRecord();
      } else {
        return location.save();
      }
    },

    /**
     * Transfer items from the current location to the specified location.
     * @param {Object} inventoryItem the inventory item that items are being transferred from
     * @param {Object} transferLocation the inventory location to transfer from (also includes
     * attributes about where to transfer to.
     * @returns {Promise} a promise that fulfills once the transfer to location has been saved.
     */
    transferToLocation: function transferToLocation(inventoryItem, transferLocation) {
      var aisle = transferLocation.get('transferAisleLocation');
      var location = transferLocation.get('transferLocation');
      var quantity = parseInt(transferLocation.get('adjustmentQuantity'));
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        this._addQuantityToLocation(inventoryItem, quantity, location, aisle).then(function () {
          transferLocation.decrementProperty('quantity', quantity);
          transferLocation.save().then(resolve, reject);
        }, reject);
      }).bind(this));
    }
  });
});
define('hospitalrun/tests/mixins/inventory-locations.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/inventory-locations.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/inventory-locations.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/inventory-type-list', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    defaultInventoryTypes: ['Medication', 'Supply'],

    inventoryTypes: (function () {
      var defaultInventoryTypes = this.get('defaultInventoryTypes');
      var inventoryTypeList = this.get('inventoryTypeList');
      var typeList = undefined;
      if (_ember['default'].isEmpty(inventoryTypeList)) {
        typeList = defaultInventoryTypes;
      } else {
        typeList = inventoryTypeList;
      }
      typeList = _hospitalrunUtilsSelectValues['default'].selectValues(typeList);
      return typeList;
    }).property('inventoryTypeList', 'defaultInventoryTypes')
  });
});
define('hospitalrun/tests/mixins/inventory-type-list.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/inventory-type-list.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/inventory-type-list.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/is-update-disabled', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    isUpdateDisabled: (function () {
      if (!_ember['default'].isNone(this.get('model.isValid'))) {
        return !this.get('model.isValid');
      } else {
        return false;
      }
    }).property('model.isValid')
  });
});
define('hospitalrun/tests/mixins/is-update-disabled.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/is-update-disabled.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/is-update-disabled.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/location-name', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    getDisplayLocationName: function getDisplayLocationName(location, aisleLocation) {
      var locationName = this.formatLocationName(location, aisleLocation);
      if (_ember['default'].isEmpty(locationName)) {
        locationName = 'No Location';
      }
      return locationName;
    },

    formatLocationName: function formatLocationName(location, aisleLocation) {
      var locationName = '';
      if (!_ember['default'].isEmpty(location)) {
        locationName += location;
        if (!_ember['default'].isEmpty(aisleLocation)) {
          locationName += ' : ';
        }
      }
      if (!_ember['default'].isEmpty(aisleLocation)) {
        locationName += aisleLocation;
      }
      return locationName;
    },

    locationName: (function () {
      var aisleLocation = this.get('aisleLocation');
      var location = this.get('location');
      return this.getDisplayLocationName(location, aisleLocation);
    }).property('location', 'aisleLocation')
  });
});
define('hospitalrun/tests/mixins/location-name.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/location-name.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/location-name.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/map-oauth-params', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var Mixin = _ember['default'].Mixin;
  exports['default'] = Mixin.create({
    mapOauthParams: function mapOauthParams(params) {
      return {
        config_consumer_key: params.k,
        config_consumer_secret: params.s1,
        config_oauth_token: params.t,
        config_token_secret: params.s2
      };
    }
  });
});
define('hospitalrun/tests/mixins/map-oauth-params.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/map-oauth-params.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/map-oauth-params.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/medication-details', ['exports', 'ember', 'ember-data'], function (exports, _ember, _emberData) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Mixin.create({
    // Denormalized medication details so that inventory records do not need to be retrieved

    /**
     * Does not return name on first call if medicationName is
     * not set and name is obtained via inventoryAttribute
     * Additional calls will return the name as medicationName
     * will then be set
     */
    getMedicationName: function getMedicationName(inventoryAttribute) {
      var _this = this;

      var medicationTitle = this.get('medicationTitle');
      if (!_ember['default'].isEmpty(medicationTitle)) {
        return medicationTitle;
      } else {
        var inventoryObject = this.get(inventoryAttribute);
        if (inventoryObject.then) {
          inventoryObject.then(function (inventoryItem) {
            if (!isEmpty(inventoryItem)) {
              _this.set('medicationTitle', inventoryItem.get('name'));
            }
          })['catch'](function (err) {
            console.log('error getting inventory item for medication name:', err);
          });
        } else {
          this.set('medicationTitle', inventoryObject.get('name'));
        }
      }
    },

    /**
     * Does not return name on first call if priceOfMedication is
     * not set and price is obtained via inventoryAttribute
     * Additional calls will return the price as priceOfMedication
     * will then be set
     */
    getMedicationPrice: function getMedicationPrice(inventoryAttribute) {
      var _this2 = this;

      var priceOfMedication = this.get('priceOfMedication');
      if (!_ember['default'].isEmpty(priceOfMedication)) {
        return priceOfMedication;
      } else {
        var inventoryObject = this.get(inventoryAttribute);
        if (inventoryObject.then) {
          inventoryObject.then(function (inventoryItem) {
            _this2.set('priceOfMedication', inventoryItem.get('price'));
          });
        } else {
          this.set('priceOfMedication', inventoryObject.get('price'));
        }
      }
    },

    getMedicationDetails: function getMedicationDetails(inventoryAttribute) {
      var _this3 = this;

      return new _ember['default'].RSVP.Promise(function (resolve) {
        var medicationTitle = _this3.get('medicationTitle');
        var priceOfMedication = _this3.get('priceOfMedication');
        if (!_ember['default'].isEmpty(medicationTitle) && !_ember['default'].isEmpty(priceOfMedication)) {
          resolve({
            name: medicationTitle,
            price: priceOfMedication
          });
        } else {
          var objectInventoryItem = _this3.get(inventoryAttribute);
          if (objectInventoryItem.then) {
            objectInventoryItem.then(function (inventoryItem) {
              resolve({
                name: inventoryItem.get('name'),
                price: inventoryItem.get('price')
              });
            });
          } else {
            resolve({
              name: objectInventoryItem.get('name'),
              price: objectInventoryItem.get('price')
            });
          }
        }
      });
    },

    medicationTitle: _emberData['default'].attr('string'),
    priceOfMedication: _emberData['default'].attr('number'),
    rxNormIdentifier: _emberData['default'].attr('string')
  });
});
define('hospitalrun/tests/mixins/medication-details.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/medication-details.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/medication-details.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/modal-helper', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    /**
     * Display a message in a closable modal.
     * @param title string containing the title to display.
     * @param message string containing the message to display.
     * @param okAction string containing the optional action to fire when the ok button is clicked.
     * @param okContext object containing the context to pass to the okAction.
     * @param cancelAction string containing the optional action to fire when the cancel button is clicked or the escape button is pressed.
     */
    displayAlert: function displayAlert(title, message, okAction, okContext, cancelAction) {
      var i18n = this.get('i18n');
      var modalOptions = _ember['default'].Object.extend({
        updateButtonText: i18n.t('buttons.ok')
      });
      this.send('openModal', 'dialog', modalOptions.create({
        cancelAction: cancelAction,
        hideCancelButton: true,
        message: message,
        okAction: okAction,
        okContext: okContext,
        title: title,
        updateButtonAction: 'ok'
      }));
    },

    displayConfirm: function displayConfirm(title, message, confirmAction, model) {
      var i18n = this.get('i18n');
      if (_ember['default'].isEmpty(model)) {
        model = _ember['default'].Object.create();
      }
      model.set('confirmAction', confirmAction);
      model.set('title', title);
      model.set('message', message);
      model.set('updateButtonAction', 'confirm');
      model.set('updateButtonText', i18n.t('buttons.ok'));
      this.send('openModal', 'dialog', model);
    }
  });
});
define('hospitalrun/tests/mixins/modal-helper.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/modal-helper.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/modal-helper.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/navigation', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var camelize = _ember['default'].String.camelize;
  var get = _ember['default'].get;
  var isEqual = _ember['default'].isEqual;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Mixin.create({
    navItems: [{
      title: 'Inventory',
      iconClass: 'octicon-package',
      route: 'inventory.index',
      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.index',
      capability: 'patients',
      subnav: [{
        title: 'Patient Listing',
        iconClass: 'octicon-chevron-right',
        route: 'patients.index',
        capability: 'patients'
      }, {
        title: 'Admitted Patients',
        iconClass: 'octicon-chevron-right',
        route: 'patients.admitted',
        capability: 'patients'
      }, {
        title: 'Outpatient',
        iconClass: 'octicon-chevron-right',
        route: 'patients.outpatient',
        capability: 'patients'
      }, {
        title: 'New Patient',
        iconClass: 'octicon-plus',
        route: 'patients.edit',
        subroute: 'new',
        capability: 'add_patient'
      }, {
        title: 'Reports',
        iconClass: 'octicon-chevron-right',
        route: 'patients.reports',
        capability: 'patients'
      }]
    }, {
      title: 'Scheduling',
      iconClass: 'octicon-calendar',
      route: 'appointments.index',
      capability: 'appointments',
      subnav: [{
        title: 'Appointments This Week',
        iconClass: 'octicon-chevron-right',
        route: 'appointments.index',
        capability: 'appointments'
      }, {
        title: 'Today\'s Appointments',
        iconClass: 'octicon-chevron-right',
        route: 'appointments.today',
        capability: 'appointments'
      }, {
        title: 'Appointment Search',
        iconClass: 'octicon-search',
        route: 'appointments.search',
        capability: 'appointments'
      }, {
        title: 'Appointments Calendar',
        iconClass: 'octicon-calendar',
        route: 'appointments.calendar',
        capability: 'appointments'
      }, {
        title: 'Add Appointment',
        iconClass: 'octicon-plus',
        route: 'appointments.edit',
        subroute: 'new',
        capability: 'add_appointment'
      }, {
        title: 'Theater Schedule',
        iconClass: 'octicon-calendar',
        route: 'appointments.theater',
        capability: 'appointments'
      }, {
        title: 'Schedule Surgery',
        iconClass: 'octicon-plus',
        route: 'appointments.edit',
        subroute: 'newsurgery',
        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: 'pricing'
      }, {
        title: 'Price Profiles',
        iconClass: 'octicon-chevron-right',
        route: 'pricing.profiles',
        capability: 'pricing'
      }, {
        title: 'Cashier',
        iconClass: 'octicon-chevron-right',
        route: 'invoices.cashier',
        capability: 'invoices'
      }]
    }, {
      title: 'Incident',
      iconClass: 'octicon-package',
      route: 'incident',
      capability: 'incident',
      subnav: [{
        title: 'Current Incidents',
        iconClass: 'octicon-chevron-right',
        route: 'incident.index',
        capability: 'add_incident'
      }, {
        title: 'New Incident',
        iconClass: 'octicon-plus',
        route: 'incident.edit',
        subroute: 'new',
        capability: 'add_incident'
      }, {
        title: 'History',
        iconClass: 'octicon-chevron-right',
        route: 'incident.completed',
        capability: 'add_incident'
      }, {
        title: 'Reports',
        iconClass: 'octicon-chevron-right',
        route: 'incident.reports',
        capability: 'generate_incident_report'
      }]
    }, {
      title: 'Administration',
      iconClass: 'octicon-person',
      route: 'admin.lookup',
      capability: 'admin',
      subnav: [{
        title: 'Address Fields',
        iconClass: 'octicon-chevron-right',
        route: 'admin.address',
        capability: 'update_config'
      }, {
        title: 'Custom Forms',
        iconClass: 'octicon-chevron-right',
        route: 'admin.custom-forms',
        capability: 'update_config'
      }, {
        title: 'Incident Categories',
        iconClass: 'octicon-chevron-right',
        route: 'inc-category',
        capability: 'add_incident_category'
      }, {
        title: 'Load DB',
        iconClass: 'octicon-plus',
        route: 'admin.loaddb',
        capability: 'load_db'
      }, {
        title: 'Lookup Lists',
        iconClass: 'octicon-chevron-right',
        route: 'admin.lookup',
        capability: 'update_config'
      }, {
        title: 'Text Replacements',
        iconClass: 'octicon-plus',
        route: 'admin.textreplace',
        capability: 'update_config'
      }, {
        title: 'Print Header',
        iconClass: 'octicon-chevron-right',
        route: 'admin.print-header',
        capability: 'update_config'
      }, {
        title: 'Users',
        iconClass: 'octicon-chevron-right',
        route: 'users',
        capability: 'users'
      }, {
        title: 'New User',
        iconClass: 'octicon-plus',
        route: 'users.edit',
        subroute: 'new',
        capability: 'add_user'
      }, {
        title: 'User Roles',
        iconClass: 'octicon-chevron-right',
        route: 'admin.roles',
        capability: 'define_user_roles'
      }]
    }],

    // Navigation items get mapped localizations
    localizedNavItems: _ember['default'].computed('navItems.[]', function () {
      var localizationPrefix = 'navigation.';
      // Supports unlocalized keys for now, otherwise we would get:
      // "Missing translation: key.etc.path"
      var translationOrOriginal = function translationOrOriginal(translation, original) {
        // Check for typeof string, because if it's found in localization,
        // i18n will return a SafeString object, not a string
        return typeof translation === 'string' ? original : translation;
      };
      var i18n = get(this, 'i18n');
      var navItems = get(this, 'navItems');
      return navItems.map(function (nav) {
        var sectionKey = localizationPrefix + camelize(nav.title).toLowerCase();
        var navTranslated = i18n.t(sectionKey);

        set(nav, 'localizedTitle', translationOrOriginal(navTranslated, nav.title));
        // Map all of the sub navs, too
        set(nav, 'subnav', nav.subnav.map(function (sub) {
          var subItemKey = localizationPrefix + 'subnav.' + camelize(sub.title);
          var subTranslated = i18n.t(subItemKey);
          set(sub, 'localizedTitle', translationOrOriginal(subTranslated, sub.title));
          return sub;
        }));

        return nav;
      });
    }),

    findNavItemByRoute: function findNavItemByRoute(route) {
      for (var i = 0; i < this.navItems.length; i++) {
        if (isEqual(this.navItems[i].route, route)) {
          return this.navItems[i];
        } else {
          for (var j = 0; j < this.navItems[i].subnav.length; j++) {
            if (isEqual(this.navItems[i].subnav[j].route, route)) {
              return this.navItems[i].subnav[j];
            }
          }
        }
      }
      return null;
    }
  });
});
define('hospitalrun/tests/mixins/navigation.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/navigation.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/navigation.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/number-format', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    /**
     * Given an array and property, total all of the property values in the array and return the value.
     * @param array Array|String either the actual array or the property name of the array on this object.
     * @param propertyName String the property name in the array values to total.
     * @param number that contains at most two decimal places.
     */
    _calculateTotal: function _calculateTotal(array, propertyName) {
      var arrayItems = undefined;
      var total = 0;
      if (_ember['default'].isArray(array)) {
        arrayItems = array;
      } else {
        arrayItems = this.get(array);
      }
      total = arrayItems.reduce((function (previousValue, lineItem) {
        return previousValue += this._getValidNumber(_ember['default'].get(lineItem, propertyName));
      }).bind(this), 0);
      return this._numberFormat(total, true);
    },

    /**
     * Determine if number passed in is actually a number.  If it is, return the number; otherwise return 0.
     * @param number the number to valdiate.
     * @returns number a valid number.
     */
    _getValidNumber: function _getValidNumber(number) {
      if (_ember['default'].isEmpty(number) || isNaN(number)) {
        return 0;
      } else {
        return Number(number);
      }
    },

    /**
     * Return a formatted number with a maximum of two digits
     * @param value number to format
     * @param returnAsNumber boolean to denote if formatted number should be returned
     * as a number instead of a string
     * @returns String|Number a formatted String or number containing the formatted number.
     */
    _numberFormat: function _numberFormat(value, returnAsNumber) {
      var returnValue = undefined;
      if (!_ember['default'].isEmpty(value)) {
        if (isNaN(value)) {
          return;
        }
        if (Math.round(value) === value) {
          returnValue = Number(value).toString();
        } else {
          returnValue = this._round100(value).toFixed(2);
        }
        if (returnAsNumber) {
          return Number(returnValue);
        } else {
          return returnValue.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,');
        }
      }
    },

    _validNumber: function _validNumber(number) {
      return !_ember['default'].isEmpty(number) && !isNaN(number) && number > 0;
    },

    _round100: function _round100(number) {
      var tempNumber = 100 * number;
      return Math.round(tempNumber) / 100;
    }

  });
});
define('hospitalrun/tests/mixins/number-format.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/number-format.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/number-format.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/oauth-headers', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var Mixin = _ember['default'].Mixin;
  exports['default'] = Mixin.create({
    getOAuthHeaders: function getOAuthHeaders(configs) {
      return {
        'x-oauth-consumer-secret': configs.config_consumer_secret,
        'x-oauth-consumer-key': configs.config_consumer_key,
        'x-oauth-token-secret': configs.config_token_secret,
        'x-oauth-token': configs.config_oauth_token
      };
    }
  });
});
define('hospitalrun/tests/mixins/oauth-headers.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/oauth-headers.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/oauth-headers.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/operative-plan-statuses', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var COMPLETED_STATUS = 'completed';
  exports.COMPLETED_STATUS = COMPLETED_STATUS;
  var DROPPED_STATUS = 'dropped';
  exports.DROPPED_STATUS = DROPPED_STATUS;
  var PLANNED_STATUS = 'planned';

  exports.PLANNED_STATUS = PLANNED_STATUS;
  var STATUS_VALUES = [COMPLETED_STATUS, DROPPED_STATUS, PLANNED_STATUS];

  exports['default'] = _ember['default'].Mixin.create({
    planStatuses: computed(function () {
      var i18n = this.get('i18n');

      return STATUS_VALUES.map(function (status) {
        return {
          id: status,
          value: i18n.t('operativePlan.labels.' + status + 'Status')
        };
      }).sort(function (a, b) {
        return _ember['default'].compare(a.value.toString(), b.value.toString());
      });
    })
  });
});
define('hospitalrun/tests/mixins/operative-plan-statuses.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/operative-plan-statuses.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/operative-plan-statuses.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/pagination-props', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    paginationProps: (function () {
      var paginationProperties = ['disableNextPage', 'disablePreviousPage', 'showFirstPageButton', 'showLastPageButton', 'showPagination'];
      return this.getProperties(paginationProperties);
    }).property('disableNextPage', 'disablePreviousPage', 'showFirstPageButton', 'showLastPageButton', 'showPagination')
  });
});
define('hospitalrun/tests/mixins/pagination-props.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/pagination-props.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/pagination-props.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/paging-actions', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    firstPage: 'firstPage',
    lastPage: 'lastPage',
    nextPage: 'nextPage',
    previousPage: 'previousPage',
    actions: {
      firstPage: function firstPage() {
        this.sendAction('firstPage');
      },
      lastPage: function lastPage() {
        this.sendAction('lastPage');
      },
      nextPage: function nextPage() {
        this.sendAction('nextPage');
      },
      previousPage: function previousPage() {
        this.sendAction('previousPage');
      }
    }
  });
});
define('hospitalrun/tests/mixins/paging-actions.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/paging-actions.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/paging-actions.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-appointments', ['exports', 'ember', 'hospitalrun/mixins/pouchdb'], function (exports, _ember, _hospitalrunMixinsPouchdb) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create(_hospitalrunMixinsPouchdb['default'], {
    getPatientAppointments: function getPatientAppointments(patient) {
      var patientId = patient.get('id');
      var maxValue = this.get('maxValue');
      return this.store.query('appointment', {
        options: {
          startkey: [patientId, null, null, 'appointment_'],
          endkey: [patientId, maxValue, maxValue, maxValue]
        },
        mapReduce: 'appointments_by_patient'
      });
    }
  });
});
define('hospitalrun/tests/mixins/patient-appointments.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-appointments.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-appointments.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-diagnosis', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Mixin.create({
    _addDiagnosisToList: function _addDiagnosisToList(diagnosis, diagnosesList) {
      if (!_ember['default'].isEmpty(diagnosis)) {
        if (_ember['default'].isEmpty(diagnosesList.findBy('description', diagnosis))) {
          diagnosesList.addObject(diagnosis);
        }
      }
    },

    getDiagnoses: function getDiagnoses(diagnosisContainer, hideInActiveDiagnoses, secondaryDiagnoses) {
      var _this = this;

      var diagnosisProperty = arguments.length <= 3 || arguments[3] === undefined ? 'diagnoses' : arguments[3];

      var diagnosesList = [];
      if (!isEmpty(diagnosisContainer)) {
        var diagnoses = diagnosisContainer.get(diagnosisProperty);
        diagnoses = diagnoses.filterBy('archived', false);
        if (hideInActiveDiagnoses) {
          diagnoses = diagnoses.filterBy('active', true);
        }
        if (!secondaryDiagnoses) {
          secondaryDiagnoses = false;
        }
        diagnoses = diagnoses.filterBy('secondaryDiagnosis', secondaryDiagnoses);
        diagnoses.forEach(function (diagnosis) {
          _this._addDiagnosisToList(diagnosis, diagnosesList);
        });
        return diagnosesList;
      }
    }
  });
});
define('hospitalrun/tests/mixins/patient-diagnosis.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-diagnosis.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-diagnosis.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-id', ['exports', 'ember', 'hospitalrun/mixins/friendly-id'], function (exports, _ember, _hospitalrunMixinsFriendlyId) {
  'use strict';

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = _ember['default'].Mixin.create(_hospitalrunMixinsFriendlyId['default'], {
    config: inject.service(),
    sequenceName: 'patient',
    sequenceView: 'patient_by_display_id',

    sequencePrefix: function sequencePrefix() {
      var config = get(this, 'config');
      return config.getPatientPrefix();
    }
  });
});
define('hospitalrun/tests/mixins/patient-id.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-id.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-id.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-invoices', ['exports', 'ember', 'hospitalrun/mixins/pouchdb'], function (exports, _ember, _hospitalrunMixinsPouchdb) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create(_hospitalrunMixinsPouchdb['default'], {
    getPatientInvoices: function getPatientInvoices(patient) {
      var patientId = patient.get('id');
      return this.store.query('invoice', {
        options: {
          key: patientId
        },
        mapReduce: 'invoice_by_patient'
      });
    }
  });
});
define('hospitalrun/tests/mixins/patient-invoices.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-invoices.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-invoices.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-list-route', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    database: _ember['default'].inject.service(),

    /**
     * Lazily load patient list so that it doesn't impact performance.
     */
    _fetchPatientList: function _fetchPatientList(controller) {
      var patientQuery = {
        startkey: 'patient_',
        endkey: 'patient_',
        include_docs: true
      };
      var database = this.get('database');
      database.queryMainDB(patientQuery).then(function (result) {
        if (result.rows) {
          var list = result.rows.map(function (row) {
            return row.doc;
          });
          controller.set('patientList', list);
        }
      });
    },

    actions: {
      returnToPatient: function returnToPatient() {
        this.controller.send('returnToPatient');
        this.controller.send('closeModal');
      },

      returnToVisit: function returnToVisit() {
        this.controller.send('returnToVisit');
      }
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      this._fetchPatientList(controller);
    }
  });
});
define('hospitalrun/tests/mixins/patient-list-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-list-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-list-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-name', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    getPatientDisplayId: function getPatientDisplayId(patient) {
      var externalPatientId = _ember['default'].get(patient, 'externalPatientId');
      var friendlyId = _ember['default'].get(patient, 'friendlyId');
      var id = _ember['default'].get(patient, 'id');
      if (!_ember['default'].isEmpty(friendlyId)) {
        return friendlyId;
      } else if (!_ember['default'].isEmpty(externalPatientId)) {
        return externalPatientId;
      } else {
        return id;
      }
    },

    getPatientDisplayName: function getPatientDisplayName(patient, shortName) {
      var firstName = _ember['default'].get(patient, 'firstName');
      var lastName = _ember['default'].get(patient, 'lastName');
      var middleName = _ember['default'].get(patient, 'middleName');
      var nameArray = [];
      if (!_ember['default'].isEmpty(firstName)) {
        nameArray.push(firstName);
      }
      if (!_ember['default'].isEmpty(middleName) && !shortName) {
        nameArray.push(middleName);
      }
      if (!_ember['default'].isEmpty(lastName)) {
        nameArray.push(lastName);
      }
      return nameArray.join(' ');
    }
  });
});
define('hospitalrun/tests/mixins/patient-name.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-name.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-name.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-notes', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({

    canAddNote: function canAddNote() {
      return this.currentUserCan('add_note') && (!_ember['default'].isEmpty(this.get('visits')) || !_ember['default'].isEmpty(this.get('model.visits')));
    },

    canDeleteNote: function canDeleteNote() {
      return this.currentUserCan('delete_note');
    },

    _computeNoteType: function _computeNoteType(visit) {
      switch (visit.get('visitType')) {
        case 'Admission':
          if (_ember['default'].isEmpty(visit.get('procedures'))) {
            return 'Pre-op';
          } else {
            return 'Post-op';
          }
        case 'Clinic':
        case 'Followup':
          return 'General';
        default:
          return visit.get('visitType');
      }
    },

    _setNoteType: function _setNoteType() {
      var model = this.get('model');
      if (model.get('noteType') == null) {
        model.set('noteType', this._computeNoteType(model.get('visit')));
      }
    }
  });
});
define('hospitalrun/tests/mixins/patient-notes.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-notes.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-notes.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-submodule', ['exports', 'ember-data', 'ember', 'hospitalrun/mixins/patient-visits', 'hospitalrun/utils/select-values'], function (exports, _emberData, _ember, _hospitalrunMixinsPatientVisits, _hospitalrunUtilsSelectValues) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Mixin.create(_hospitalrunMixinsPatientVisits['default'], {
    findPatientVisits: true, // Override to false if visits shouldn't be set when patient is selected.
    needToUpdateVisit: false,
    patientList: null,
    selectedPatient: null,
    newVisitAdded: null,

    actions: {
      showPatient: function showPatient(patient) {
        this.transitionToRoute('patients.edit', patient);
      },

      returnToAllItems: function returnToAllItems() {
        this._cancelUpdate();
        this.send('allItems');
      },
      returnToPatient: function returnToPatient() {
        this._cancelUpdate();
        this.transitionToRoute('patients.edit', this.get('model.returnToPatient'));
      },
      returnToVisit: function returnToVisit() {
        this._cancelUpdate();
        this.transitionToRoute('visits.edit', this.get('model.returnToVisit'));
      },

      selectedPatientChanged: function selectedPatientChanged(selectedPatient) {
        var _this = this;

        if (!_ember['default'].isEmpty(selectedPatient)) {
          this.store.find('patient', selectedPatient.id).then(function (item) {
            _this.set('model.patient', item);
            _this.patientSelected(item);
            _ember['default'].run.once(_this, function () {
              this.get('model').validate()['catch'](_ember['default'].K);
            });
          });
        } else {
          this.set('model.patient', null);
          this.patientSelected();
        }
      }
    },

    /**
     * Add the specified child to the current visit and then save the visit.  If a visit
     * has not been selected, create a new visit and add it to the selected patient.
     * @param {Object} objectToAdd the object to add.
     * @param {string} childName the name of the child object on the visit to add to.
     * @param {string} newVisitType if a new visit needs to be created, what type of visit
     * should be created.
     * @returns {Promise} promise that will resolve or reject depending on whether or
     * not the add and subsequent saves were successful.
     */
    addChildToVisit: function addChildToVisit(objectToAdd, childName, newVisitType) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var visit = this.get('model.visit');
        if (_ember['default'].isEmpty(visit)) {
          visit = this.createNewVisit(newVisitType).then((function (savedVisit) {
            this._finishAddChildToVisit(objectToAdd, childName, savedVisit, resolve, reject);
          }).bind(this), reject);
        } else {
          this._finishAddChildToVisit(objectToAdd, childName, visit, resolve, reject);
        }
      }).bind(this));
    },

    addDiagnosisToModelAndPatient: function addDiagnosisToModelAndPatient(newDiagnosis) {
      var _this2 = this;

      var diagnoses = this.get('model.diagnoses');
      diagnoses.addObject(newDiagnosis);
      var patientDiagnoses = this.get('model.patient.diagnoses');
      var diagnosisExists = patientDiagnoses.any(function (diagnosis) {
        return diagnosis.get('active') === true && diagnosis.get('diagnosis') === newDiagnosis.get('diagnosis') && diagnosis.get('secondaryDiagnosis') === newDiagnosis.get('secondaryDiagnosis');
      });
      if (!diagnosisExists) {
        (function () {
          var newPatientDiagnosis = _this2._copyDiagnosis(newDiagnosis);
          newPatientDiagnosis.save().then(function () {
            patientDiagnoses.addObject(newPatientDiagnosis);
            var patient = _this2.get('model.patient');
            patient.save().then(function () {
              _this2.silentUpdate('closeModal');
            });
          });
        })();
      } else {
        this.silentUpdate('closeModal');
      }
    },

    _finishAddChildToVisit: function _finishAddChildToVisit(objectToAdd, childName, visit, resolve, reject) {
      visit.get(childName).then((function (visitChildren) {
        visitChildren.addObject(objectToAdd);
        this.set('needToUpdateVisit', true);
        resolve(visit);
      }).bind(this), reject);
    },

    cancelAction: (function () {
      var returnToPatient = this.get('model.returnToPatient');
      var returnToVisit = this.get('model.returnToVisit');
      if (!isEmpty(returnToVisit)) {
        return 'returnToVisit';
      } else if (!isEmpty(returnToPatient)) {
        return 'returnToPatient';
      } else {
        return 'returnToAllItems';
      }
    }).property('model.returnToPatient', 'model.returnToVisit'),

    createNewVisit: function createNewVisit(newVisitType) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var model = this.get('model');
        var patient = model.get('patient');
        var visit = this.get('store').createRecord('visit', {
          startDate: new Date(),
          endDate: new Date(),
          outPatient: true,
          patient: patient,
          visitType: newVisitType
        });
        model.set('visit', visit);
        visit.save().then((function () {
          visit.reload().then((function (updatedVisit) {
            this.set('newVisitAdded', updatedVisit);
            model.set('visit', updatedVisit);
            resolve(updatedVisit);
          }).bind(this), reject);
        }).bind(this), reject)['catch']((function (err) {
          console.log('Error creating new visit');
          reject(err);
        }).bind(this));
      }).bind(this));
    },

    deleteChildFromVisit: function deleteChildFromVisit(childName) {
      var _this3 = this;

      var recordToDelete = this.get('model');
      recordToDelete.set('archived', true);
      this.removeChildFromVisit(recordToDelete, childName).then(function () {
        recordToDelete.save().then(function () {
          recordToDelete.unloadRecord();
          _this3.send('closeModal');
        });
      });
    },

    getPatientDiagnoses: function getPatientDiagnoses(patient, model) {
      var _this4 = this;

      var diagnoses = patient.get('diagnoses');
      var activeDiagnoses = undefined;
      if (!isEmpty(diagnoses)) {
        activeDiagnoses = diagnoses.filterBy('active', true).map(function (diagnosis) {
          return _this4._copyDiagnosis(diagnosis);
        });
      }
      var currentDiagnoses = get(model, 'diagnoses');
      currentDiagnoses.clear();
      if (!isEmpty(activeDiagnoses)) {
        currentDiagnoses.addObjects(activeDiagnoses);
      }
    },

    patientId: _ember['default'].computed.alias('model.patient.id'),

    patientSelected: function patientSelected() /* patient */{},

    patientVisits: (function () {
      var patient = this.get('model.patient');
      var visitPromise = undefined;

      if (!_ember['default'].isEmpty(patient) && this.get('findPatientVisits')) {
        visitPromise = this.getPatientVisits(patient);
      } else {
        visitPromise = _ember['default'].RSVP.resolve([]);
      }
      return _emberData['default'].PromiseArray.create({
        promise: visitPromise
      });
    }).property('model.patient.id', 'newVisitAdded'),

    patientProcedures: _ember['default'].computed('patientVisits.[]', function () {
      var _this5 = this;

      var patient = get(this, 'model.patient');
      return _emberData['default'].PromiseArray.create({
        promise: get(this, 'patientVisits').then(function (patientVisits) {
          return get(patient, 'operationReports').then(function (operationReports) {
            return _this5._getPatientProcedures(operationReports, patientVisits);
          });
        })
      });
    }),

    patientVisitsForSelect: (function () {
      return _emberData['default'].PromiseArray.create({
        promise: this.get('patientVisits').then(function (patientVisits) {
          return patientVisits.map(_hospitalrunUtilsSelectValues['default'].selectObjectMap);
        })
      });
    }).property('patientVisits.[]'),

    /**
     * Removes the specified child from the current visit object and then saves the visit.
     * @param {Object} objectToRemove the object to remove.
     * @param {string} childName the name of the child object on the visit to remove from.
     * @returns {Promise} promise that will resolve or reject depending on whether or
     * not the remove and subsequent save were successful.
     */
    removeChildFromVisit: function removeChildFromVisit(objectToRemove, childName) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var childPromises = [];
        var visit = this.get('model.visit');
        childPromises.addObjects(this.resolveVisitChildren());
        _ember['default'].RSVP.all(childPromises, 'Resolved visit children before removing ' + childName).then((function () {
          visit.get(childName).then((function (visitChildren) {
            visitChildren.removeObject(objectToRemove);
            visit.save().then(resolve, reject);
          }).bind(this), reject);
        }).bind(this), reject);
      }).bind(this));
    },

    /**
     * Observer on visits to make sure async relationships are resolved.
     * @returns {array} of promises which can be used to ensure
     * all relationships have resolved.
     */
    resolveVisitChildren: function resolveVisitChildren() {
      var promises = [];
      var visit = this.get('model.visit');
      if (!_ember['default'].isEmpty(visit)) {
        // Make sure all the async relationships are resolved
        promises.push(visit.get('imaging'));
        promises.push(visit.get('labs'));
        promises.push(visit.get('medication'));
        promises.push(visit.get('procedures'));
        promises.push(visit.get('vitals'));
        promises.push(visit.get('reports'));
      }
      return promises;
    },

    saveNewDiagnoses: function saveNewDiagnoses() {
      var diagnoses = this.get('model.diagnoses');
      diagnoses = diagnoses.filterBy('isNew', true);
      if (!isEmpty(diagnoses)) {
        var savePromises = diagnoses.map(function (diagnoses) {
          return diagnoses.save();
        });
        return _ember['default'].RSVP.all(savePromises);
      } else {
        return _ember['default'].RSVP.resolve();
      }
    },

    /**
     * If visit needs to saved, save it and then display an alert message; otherwise
     * just display the alert message.
     * @param alertTitle String the title to use on the alert.
     * @param alertMessage String the message to display in the alert.
     */
    saveVisitIfNeeded: function saveVisitIfNeeded(alertTitle, alertMessage, alertAction) {
      if (this.get('needToUpdateVisit')) {
        this.get('model.visit').save().then((function () {
          this.set('needToUpdateVisit', false);
          this.displayAlert(alertTitle, alertMessage, alertAction);
        }).bind(this));
      } else {
        this.displayAlert(alertTitle, alertMessage, alertAction);
      }
    },

    visitId: _ember['default'].computed.alias('model.visit.id'),
    visitsController: _ember['default'].computed.alias('controllers.visits'),

    _copyDiagnosis: function _copyDiagnosis(diagnosisToCopy) {
      var attributesToCopy = ['date', 'diagnosis', 'secondaryDiagnosis'];
      return this.store.createRecord('diagnosis', diagnosisToCopy.getProperties(attributesToCopy));
    }
  });
});
define('hospitalrun/tests/mixins/patient-submodule.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-submodule.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-submodule.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/patient-visits', ['exports', 'ember', 'hospitalrun/mixins/pouchdb', 'hospitalrun/utils/visit-statuses', 'ember-data', 'moment'], function (exports, _ember, _hospitalrunMixinsPouchdb, _hospitalrunUtilsVisitStatuses, _emberData, _moment) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  var isEmpty = _ember['default'].isEmpty;
  var get = _ember['default'].get;
  exports['default'] = _ember['default'].Mixin.create(_hospitalrunMixinsPouchdb['default'], {
    getPatientVisits: function getPatientVisits(patient) {
      var maxValue = this.get('maxValue');
      var patientId = patient.get('id');
      return this.store.query('visit', {
        options: {
          startkey: [patientId, null, null, null, 'visit_'],
          endkey: [patientId, maxValue, maxValue, maxValue, maxValue]
        },
        mapReduce: 'visit_by_patient',
        debug: true
      });
    },

    getPatientFutureAppointment: function getPatientFutureAppointment(visit, outPatient) {
      var patientId = get(visit, 'patient.id');
      var visitDate = get(visit, 'startDate');
      var maxValue = get(this, 'maxValue');
      var promise = this.store.query('appointment', {
        options: {
          startkey: [patientId, null, null, 'appointment_'],
          endkey: [patientId, maxValue, maxValue, maxValue]
        },
        mapReduce: 'appointments_by_patient'
      }).then(function (result) {
        var futureAppointments = result.filter(function (data) {
          var startDate = get(data, 'startDate');
          return startDate && (0, _moment['default'])(startDate).isAfter((0, _moment['default'])(visitDate), 'day');
        }).sortBy('startDate');
        if (!futureAppointments.length) {
          return null;
        }
        if (!outPatient) {
          var _futureAppointments = _slicedToArray(futureAppointments, 1);

          var appointment = _futureAppointments[0];

          return appointment;
        } else {
          return futureAppointments.slice(0, 3);
        }
      });
      return outPatient ? _emberData['default'].PromiseArray.create({ promise: promise }) : _emberData['default'].PromiseObject.create({ promise: promise });
    },

    _getVisitCollection: function _getVisitCollection(visits, name) {
      var returnList = [];
      if (!_ember['default'].isEmpty(visits)) {
        visits.forEach(function (visit) {
          get(visit, name).then(function (items) {
            returnList.addObjects(items);
          });
        });
      }
      return returnList;
    },

    _getPatientProcedures: function _getPatientProcedures(operationReports, visits) {
      var patientProcedures = this._getVisitCollection(visits, 'procedures');
      operationReports.forEach(function (report) {
        var reportedProcedures = get(report, 'procedures');
        var surgeryDate = get(report, 'surgeryDate');
        reportedProcedures.forEach(function (procedure) {
          patientProcedures.addObject({
            description: get(procedure, 'description'),
            procedureDate: surgeryDate,
            report: report
          });
        });
      });
      return patientProcedures;
    },

    checkoutVisit: function checkoutVisit(visit, status) {
      var _this = this;

      visit.set('status', status);
      visit.set('endDate', new Date());
      return visit.save().then(function (savedVisit) {
        return _this.updatePatientVisitFlags(savedVisit).then(function () {
          var i18n = _this.get('i18n');
          var patientDetails = { patientName: visit.get('patient.displayName') };
          var message = undefined,
              title = undefined;
          if (status === _hospitalrunUtilsVisitStatuses['default'].CHECKED_OUT) {
            message = i18n.t('visits.messages.checkedOut', patientDetails);
            title = i18n.t('visits.titles.checkedOut');
          } else {
            message = i18n.t('visits.messages.discharged', patientDetails);
            title = i18n.t('visits.titles.discharged');
          }
          _this.displayAlert(title, message);
        });
      });
    },

    updatePatientVisitFlags: function updatePatientVisitFlags(visit) {
      var patient = visit.get('patient');
      var patientAdmitted = patient.get('admitted');
      var patientCheckedIn = patient.get('checkedIn');
      var status = this.get('model.status');
      if (status === _hospitalrunUtilsVisitStatuses['default'].ADMITTED && !patientAdmitted) {
        patient.set('admitted', true);
        return patient.save();
      } else if (status === _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN && !patientCheckedIn) {
        patient.set('checkedIn', true);
        return patient.save();
      } else if (status === _hospitalrunUtilsVisitStatuses['default'].CHECKED_OUT && patientCheckedIn) {
        return this._updateUnlessVisitStatusExists(patient, _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN, 'checkedIn');
      } else if (status === _hospitalrunUtilsVisitStatuses['default'].DISCHARGED && patientAdmitted) {
        return this._updateUnlessVisitStatusExists(patient, _hospitalrunUtilsVisitStatuses['default'].ADMITTED, 'admitted');
      } else {
        return _ember['default'].RSVP.resolve();
      }
    },

    _updateUnlessVisitStatusExists: function _updateUnlessVisitStatusExists(patient, statusToLookFor, patientStatusToSet) {
      return this.getPatientVisits(patient).then(function (visits) {
        if (isEmpty(visits.findBy('status', statusToLookFor))) {
          patient.set(patientStatusToSet, false);
          return patient.save();
        }
      });
    }

  });
});
define('hospitalrun/tests/mixins/patient-visits.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/patient-visits.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/patient-visits.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/payment-profiles', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    paymentProfiles: ['Private', 'Discounted', 'Free']
  });
});
define('hospitalrun/tests/mixins/payment-profiles.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/payment-profiles.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/payment-profiles.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/pikaday-component', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Mixin.create({
    _picker: null,
    currentDate: null,
    dateSetAction: null, // Specify an action to fire when a date is selected
    format: 'l',
    maxDate: null,
    minDate: null,
    originalPropery: null,
    showTime: false,
    yearRange: 10,

    // Override with logic to fire when date is set
    dateSet: function dateSet() {
      var picker = get(this, '_picker');
      var newDate = picker.getDate();
      var dateSetAction = get(this, 'dateSetAction');
      set(this, 'currentDate', newDate);
      if (!isEmpty(dateSetAction)) {
        this.sendAction('dateSetAction', newDate);
      }
    },

    didInsertElement: function didInsertElement() {
      var _this = this;

      var currentDate = get(this, 'currentDate');
      var $input = this.$('input');
      $input.on('input', function () {
        if (isEmpty($input.val())) {
          set(_this, 'currentDate', null);
        }
      });
      var picker = null;
      var props = this.getProperties('format', 'yearRange', 'showTime');

      props.onSelect = this.dateSet.bind(this);

      if (!isEmpty(get(this, 'minDate'))) {
        props.minDate = get(this, 'minDate');
        if (props.minDate === 'now') {
          props.minDate = new Date();
        }
      }
      if (!isEmpty(get(this, 'maxDate'))) {
        props.maxDate = get(this, 'maxDate');
        if (props.maxDate === 'now') {
          props.maxDate = new Date();
        }
      }
      props.field = $input[0];
      picker = new Pikaday(props);
      _ember['default'].run.next(this, function () {
        picker.setDate(currentDate);
      });
      set(this, '_picker', picker);
    },

    willDestroyElement: function willDestroyElement() {
      var picker = get(this, '_picker');
      if (picker) {
        picker.destroy();
      }
      set(this, '_picker', null);
    }

  });
});
define('hospitalrun/tests/mixins/pikaday-component.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/pikaday-component.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/pikaday-component.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/pouch-find-indexes', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var Mixin = _ember['default'].Mixin;
  exports['default'] = Mixin.create({
    buildPouchFindIndexes: function buildPouchFindIndexes(db) {
      var indexesToBuild = [{
        name: 'inventory',
        fields: ['data.crossReference', 'data.description', 'data.friendlyId', 'data.name']
      }, {
        name: 'invoices',
        fields: ['data.externalInvoiceNumber', 'data.patientInfo']
      }, {
        name: 'patient',
        fields: ['data.externalPatientId', 'data.firstName', 'data.friendlyId', 'data.lastName', 'data.phone']
      }, {
        name: 'medication',
        fields: ['data.prescription']
      }, {
        name: 'pricing',
        fields: ['data.name']
      }];
      indexesToBuild.forEach(function (index) {
        db.createIndex({
          index: {
            fields: index.fields,
            name: index.name
          }
        });
      });
    }
  });
});
define('hospitalrun/tests/mixins/pouch-find-indexes.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/pouch-find-indexes.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/pouch-find-indexes.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/pouchdb', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    maxValue: ''
  });
});
define('hospitalrun/tests/mixins/pouchdb.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/pouchdb.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/pouchdb.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/progress-dialog', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    progressDialog: null,
    progressDialogDefaults: {
      showProgress: true,
      hideCancelButton: true,
      hideUpdateButton: true,
      progressBarValue: 0,
      progressBarStyle: 'width: 0%;'
    },
    progressInterval: 500,
    progressMessage: null,
    progressTimer: null,
    progressTitle: null,

    scheduleProgress: function scheduleProgress(f) {
      return _ember['default'].run.later(this, function () {
        f.apply(this);
        this.set('progressTimer', this.scheduleProgress(f));
      }, this.get('progressInterval'));
    },

    updateProgressBar: function updateProgressBar() {
      var progressDialog = this.get('progressDialog');
      var progressBarValue = progressDialog.get('progressBarValue');
      progressBarValue += 10;
      if (progressBarValue > 100) {
        progressBarValue = 0;
      }
      progressDialog.set('progressBarValue', progressBarValue);
      var progressBarStyle = _ember['default'].String.htmlSafe('width: ' + progressBarValue + '%');
      progressDialog.set('progressBarStyle', progressBarStyle);
    },

    closeProgressModal: function closeProgressModal() {
      _ember['default'].run.cancel(this.get('progressTimer'));
      this.send('closeModal');
    },

    showProgressModal: function showProgressModal() {
      var progressDialog = _ember['default'].Object.create(this.get('progressDialogDefaults'));
      progressDialog.progressBarStyle = _ember['default'].String.htmlSafe(progressDialog.progressBarStyle);
      progressDialog.set('title', this.get('progressTitle'));
      progressDialog.set('message', this.get('progressMessage'));
      this.set('progressDialog', progressDialog);
      this.set('progressTimer', this.scheduleProgress(this.get('updateProgressBar')));
      this.send('openModal', 'dialog', progressDialog);
    }
  });
});
define('hospitalrun/tests/mixins/progress-dialog.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/progress-dialog.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/progress-dialog.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/publish-statuses', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    publishStatuses: ['Draft', 'Published', 'Private', 'Archived']
  });
});
define('hospitalrun/tests/mixins/publish-statuses.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/publish-statuses.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/publish-statuses.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/result-validation', ['exports', 'ember', 'ember-i18n'], function (exports, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    validations: {
      result: {
        acceptance: {
          accept: true,
          'if': function _if(object) {
            if (!object.get('hasDirtyAttributes')) {
              return false;
            }
            var status = object.get('status');
            var result = object.get('result');
            if (status === 'Completed' && _ember['default'].isEmpty(result)) {
              // force validation to fail
              return true;
            }
            return false;
          },
          message: (0, _emberI18n.translationMacro)('errors.result')
        }
      }
    }
  });
});
define('hospitalrun/tests/mixins/result-validation.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/result-validation.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/result-validation.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/return-to', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    cancelAction: (function () {
      var returnTo = this.get('model.returnTo');
      if (_ember['default'].isEmpty(returnTo)) {
        return 'allItems';
      } else {
        return 'returnTo';
      }
    }).property('returnTo')
  });
});
define('hospitalrun/tests/mixins/return-to.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/return-to.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/return-to.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/setup-user-role', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    setupUserRole: function setupUserRole() {
      var session = this.get('session');
      var userRole = session.get('data.authenticated.role');
      return this.get('store').find('user-role', userRole.dasherize()).then(function (userCaps) {
        session.set('data.authenticated.userCaps', userCaps.get('capabilities'));
        var sessionStore = session.get('store');
        var sessionData = session.get('data');
        sessionStore.persist(sessionData);
        return true;
      })['catch'](_ember['default'].K);
    }
  });
});
define('hospitalrun/tests/mixins/setup-user-role.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/setup-user-role.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/setup-user-role.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/typeahead', ['exports', 'ember-data', 'ember'], function (exports, _emberData, _ember) {
  'use strict';

  function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }

  var computed = _ember['default'].computed;
  var observer = _ember['default'].observer;
  exports['default'] = _ember['default'].Mixin.create({
    _mapContentItems: function _mapContentItems() {
      var _this = this;

      var content = this.get('content');
      if (content) {
        var mapped = content.filter(function (item) {
          return !_ember['default'].isEmpty(item);
        });
        if (_instanceof(content, _emberData['default'].RecordArray)) {
          mapped = mapped.map(function (item) {
            var returnObj = item.getProperties(_this.get('displayKey'));
            returnObj[_this.get('selectionKey')] = item;
            return returnObj;
          });
        } else {
          mapped = mapped.map(function (item) {
            var returnObj = {};
            returnObj[_this.get('displayKey')] = item;
            return returnObj;
          });
        }
        return mapped;
      } else {
        return [];
      }
    },

    mappedContent: computed('content', function () {
      return this._mapContentItems();
    }),

    contentChanged: observer('content.[]', function () {
      var bloodhound = this.get('bloodhound');
      if (bloodhound) {
        bloodhound.clear();
        bloodhound.add(this._mapContentItems());
      }
    }),

    bloodhound: null,
    displayKey: 'value',
    selectionKey: 'value',
    hint: true,
    highlight: true,
    lastHint: null,
    limit: 500,
    minlength: 1,
    selectedItem: false,
    inputElement: null,
    typeAhead: null,
    setOnBlur: true,
    templates: null,
    selectedAction: null,

    _getSource: function _getSource() {
      var typeAheadBloodhound = new Bloodhound({
        datumTokenizer: Bloodhound.tokenizers.obj.whitespace(this.get('displayKey')),
        queryTokenizer: Bloodhound.tokenizers.whitespace,
        local: this.get('mappedContent')
      });
      typeAheadBloodhound.initialize();
      this.set('bloodhound', typeAheadBloodhound);
      return typeAheadBloodhound.ttAdapter();
    },

    didInsertElement: function didInsertElement() {
      var _this2 = this;

      var $input = this.$('input');
      this.set('inputElement', $input);
      var $typeahead = $input.typeahead({
        autoselect: true,
        hint: this.get('hint'),
        highlight: this.get('highlight'),
        minLength: this.get('minlength')
      }, {
        displayKey: this.get('displayKey'),
        limit: this.get('limit'),
        source: this._getSource(),
        templates: this.get('templates')
      });
      this.set('typeAhead', $typeahead);

      $typeahead.on('typeahead:selected', function (event, item) {
        _this2.itemSelected(item[_this2.get('selectionKey')]);
      });

      $typeahead.on('typeahead:autocompleted', function (event, item) {
        _this2.itemSelected(item[_this2.get('selectionKey')]);
      });

      if (this.get('setOnBlur')) {
        $input.on('keyup', function () {
          var $hint = _this2.$('.tt-hint');
          var hintValue = $hint.val();
          _this2.set('lastHint', hintValue);
          _this2.set('selectedItem', false);
        });

        $input.on('blur', function (event) {
          var selection = _this2.get('selection');
          var targetValue = event.target.value.trim();
          if (!_ember['default'].isEmpty(selection)) {
            if (selection.trim) {
              selection = selection.trim();
            }
            _this2.set('selection', selection);
          }
          if (!_this2.get('selectedItem')) {
            (function () {
              var lastHint = _this2.get('lastHint');
              var exactMatch = false;
              if (_ember['default'].isEmpty(lastHint)) {
                lastHint = targetValue;
                exactMatch = true;
              }
              if (!_ember['default'].isEmpty(targetValue) && !_ember['default'].isEmpty(lastHint)) {
                _this2.get('bloodhound').search(lastHint, function (suggestions) {
                  if (suggestions.length > 0) {
                    if (!exactMatch || lastHint.toLowerCase() === suggestions[0][_this2.get('displayKey')].toLowerCase()) {
                      _this2.itemSelected(suggestions[0][_this2.get('selectionKey')]);
                      event.target.value = suggestions[0][_this2.get('displayKey')];
                      _this2.get('model').set(_this2.get('propertyName'), event.target.value);
                    }
                  } else if (targetValue !== selection) {
                    _this2.itemSelected();
                  }
                });
              } else if (_ember['default'].isEmpty(targetValue)) {
                _this2.itemSelected();
              }
            })();
          }
        });
      }
    },

    itemSelected: function itemSelected(itemSelection) {
      this.set('selection', itemSelection);
      this.set('selectedItem', true);
      var selectedAction = this.get('selectedAction');
      if (!_ember['default'].isEmpty(selectedAction)) {
        this.sendAction('selectedAction', itemSelection);
      }
    },

    willDestroyElement: function willDestroyElement() {
      this.get('inputElement').typeahead('destroy');
    }

  });
});
define('hospitalrun/tests/mixins/typeahead.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/typeahead.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/typeahead.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/unit-types', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['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 defaultUnitList = this.get('defaultUnitList');
      var inventoryUnitList = this.get('inventoryUnitList');
      if (_ember['default'].isEmpty(inventoryUnitList)) {
        return defaultUnitList;
      } else {
        return inventoryUnitList;
      }
    }).property('inventoryUnitList', 'defaultUnitList'),

    unitListForSelect: _ember['default'].computed.map('unitList', _hospitalrunUtilsSelectValues['default'].selectValuesMap)
  });
});
define('hospitalrun/tests/mixins/unit-types.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/unit-types.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/unit-types.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/user-roles', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var PREDEFINED_USER_ROLES = [{ name: 'Data Entry', roles: ['Data Entry', 'user'], defaultRoute: 'patients.index' }, { name: 'Doctor', roles: ['Doctor', 'user'], defaultRoute: 'patients.index' }, { name: 'Finance', roles: ['Finance', 'user'], defaultRoute: 'invoices.index' }, { name: 'Finance Manager', roles: ['Finance Manager', 'user'], defaultRoute: 'invoices.index' }, { name: 'Hospital Administrator', roles: ['Hospital Administrator', 'user'], defaultRoute: 'invoices.index' }, { name: 'Inventory Manager', roles: ['Inventory Manager', 'user'], defaultRoute: 'inventory.index' }, { name: 'Imaging Technician', roles: ['Imaging Technician', 'user'], defaultRoute: 'imaging.index' }, { name: 'Lab Technician', roles: ['Lab Technician', 'user'], defaultRoute: 'labs.index' }, { name: 'Medical Records Officer', roles: ['Medical Records Officer', 'user'], defaultRoute: 'patients.index' }, { name: 'Nurse', roles: ['Nurse', 'user'], defaultRoute: 'patients.index' }, { name: 'Nurse Manager', roles: ['Nurse Manager', 'user'], defaultRoute: 'patients.index' }, { name: 'Patient Administration', roles: ['Patient Administration', 'user'], defaultRoute: 'patients.index' }, { name: 'Pharmacist', roles: ['Pharmacist', 'user'], defaultRoute: 'medication.index' }, { name: 'Social Worker', roles: ['Social Worker', 'user'], defaultRoute: 'patients.index' }, { name: 'System Administrator', roles: ['System Administrator', 'admin', 'user'] }, { name: 'User Administrator', roles: ['User Administrator', 'admin', 'user'], defaultRoute: 'users' }, { name: 'Cashier', roles: ['Cashier', 'user'], defaultRoute: 'invoices.index' }];

  exports.PREDEFINED_USER_ROLES = PREDEFINED_USER_ROLES;
  exports['default'] = _ember['default'].Mixin.create({
    userRoles: PREDEFINED_USER_ROLES,

    findUserRole: function findUserRole(name) {
      return this.userRoles.findBy('name', name);
    }
  });
});
define('hospitalrun/tests/mixins/user-roles.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/user-roles.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/user-roles.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/user-session', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    session: _ember['default'].inject.service(),
    defaultCapabilities: {
      admin: ['User Administrator', 'System Administrator', 'Quality'],
      add_allergy: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'System Administrator'],
      appointments: ['Data Entry', 'Finance', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'Social Worker', 'System Administrator', 'Cashier'],
      add_appointment: ['Data Entry', 'Finance', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'Social Worker', 'System Administrator', 'Cashier'],
      add_charge: ['Data Entry', 'Hospital Administrator', 'Medical Records Officer', 'System Administrator'],
      add_billing_diagnosis: ['Data Entry', 'Hospital Administrator', 'Medical Records Officer', 'System Administrator'],
      add_diagnosis: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'System Administrator'],
      add_medication: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Pharmacist', 'System Administrator'],
      add_operative_plan: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'System Administrator'],
      add_operation_report: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'System Administrator'],
      add_photo: ['Data Entry', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'Social Worker', 'System Administrator'],
      add_patient: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Patient Administration', 'Social Worker', 'System Administrator'],
      add_pricing: ['Data Entry', 'Finance', 'Hospital Administrator', 'Medical Records Officer', 'System Administrator'],
      add_pricing_profile: ['Data Entry', 'Finance', 'Hospital Administrator', 'Medical Records Officer', 'System Administrator'],
      add_lab: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Medical Records Officer', 'Lab Technician', 'System Administrator'],
      add_imaging: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Imaging Technician', 'Medical Records Officer', 'System Administrator'],
      add_inventory_request: ['Data Entry', 'Hospital Administrator', 'Inventory Manager', 'Medical Records Officer', 'Nurse Manager', 'Pharmacist', 'System Administrator'],
      add_inventory_item: ['Data Entry', 'Hospital Administrator', 'Inventory Manager', 'Medical Records Officer', 'System Administrator'],
      add_inventory_purchase: ['Data Entry', 'Hospital Administrator', 'Inventory Manager', 'Medical Records Officer', 'System Administrator'],
      add_invoice: ['Data Entry', 'Hospital Administrator', 'Medical Records Officer', 'System Administrator', 'Cashier'],
      add_payment: ['Hospital Administrator', 'Medical Records Officer', 'System Administrator', 'Cashier'],
      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'],
      add_report: ['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', 'Cashier'],
      cashier: ['Cashier', '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_report: ['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', 'Cashier'],
      labs: ['Data Entry', 'Doctor', 'Hospital Administrator', 'Lab Technician', 'Medical Records Officer', 'System Administrator'],
      list_paid_invoices: ['Data Entry', 'Hospital Administrator', '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', 'Cashier'],
      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'],
      incident: ['Hospital Staff', 'User Administrator', 'Quality', 'System Administrator'],
      add_incident: ['Hospital Staff', 'User Administrator', 'Quality', 'System Administrator'],
      delete_incident: ['Quality', 'System Administrator'],
      generate_incident_report: ['User Administrator', 'Quality', 'System Administrator'],
      add_incident_category: ['User Administrator', 'Quality', 'System Administrator'],
      delete_incident_category: ['Quality', 'System Administrator'],
      manage_incidents: ['Quality', 'System Administrator'],
      update_config: ['System Administrator'],
      users: ['User Administrator', 'System Administrator', 'Quality'],
      add_note: ['Doctor', 'Medical Records Officer', 'Nurse', 'Nurse Manager', 'Patient Administration', 'System Administrator'],
      delete_note: ['Medical Records Officer', 'Nurse Manager', 'Patient Administration', 'System Administrator'],
      'define_user_roles': ['System Administrator']
    },

    _getUserSessionVars: function _getUserSessionVars() {
      var session = this.get('session');
      if (!_ember['default'].isEmpty(session) && session.get('isAuthenticated')) {
        return session.get('data.authenticated');
      }
    },

    currentUserCan: function currentUserCan(capability) {
      var sessionVars = this._getUserSessionVars();
      if (!_ember['default'].isEmpty(sessionVars) && !_ember['default'].isEmpty(sessionVars.role)) {
        var userCaps = this.get('session').get('data.authenticated.userCaps');
        if (_ember['default'].isEmpty(userCaps)) {
          var capabilities = this.get('defaultCapabilities');
          var supportedRoles = capabilities[capability];
          if (!_ember['default'].isEmpty(supportedRoles)) {
            return supportedRoles.includes(sessionVars.role);
          }
        } else {
          return userCaps.includes(capability.camelize()); // User defined capabilities are camelcased.
        }
      }
      return false;
    },

    /**
     * Returns the display name of the user or the username if
     * the display name is not set or if the username is explictly requested.
     * @param {boolean} returnUserName if true, always return the username instead
     * of the display name even if the display name is set.
     */
    getUserName: function getUserName(returnUserName) {
      var returnName = undefined;
      var sessionVars = this._getUserSessionVars();
      if (!_ember['default'].isEmpty(sessionVars)) {
        if (returnUserName) {
          returnName = sessionVars.name;
        } else if (!_ember['default'].isEmpty(sessionVars.displayName)) {
          returnName = sessionVars.displayName;
        } else if (!_ember['default'].isEmpty(sessionVars.name)) {
          returnName = sessionVars.name;
        }
      }
      return returnName;
    }
  });
});
define('hospitalrun/tests/mixins/user-session.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/user-session.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/user-session.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/mixins/visit-types', ['exports', 'ember', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Mixin.create({
    defaultVisitTypes: ['Admission', 'Clinic', 'Followup', 'Imaging', 'Lab', 'Pharmacy'],

    _getVisitTypes: function _getVisitTypes(includeEmpty) {
      var defaultVisitTypes = this.get('defaultVisitTypes');
      var visitTypesList = this.get('visitTypesList');
      var visitList = undefined;
      if (_ember['default'].isEmpty(visitTypesList)) {
        visitList = defaultVisitTypes;
      } else {
        visitList = visitTypesList.get('value');
      }
      visitList = _hospitalrunUtilsSelectValues['default'].selectValues(visitList, includeEmpty);
      return visitList;
    },

    visitTypes: (function () {
      return this._getVisitTypes();
    }).property('visitTypesList', 'defaultVisitTypes').volatile(),

    visitTypesWithEmpty: (function () {
      return this._getVisitTypes(true);
    }).property('visitTypesList', 'defaultVisitTypes').volatile()
  });
});
define('hospitalrun/tests/mixins/visit-types.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - mixins/visit-types.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'mixins/visit-types.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/abstract', ['exports', 'ember-data', 'ember', 'ember-validations', 'ember-pouch', 'hospitalrun/mixins/user-session'], function (exports, _emberData, _ember, _emberValidations, _emberPouch, _hospitalrunMixinsUserSession) {
  'use strict';

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _emberPouch.Model.extend(_hospitalrunMixinsUserSession['default'], _emberValidations['default'], {
    session: inject.service(),
    archived: _emberData['default'].attr('boolean', { defaultValue: false }),
    lastModified: _emberData['default'].attr('date'),
    modifiedBy: _emberData['default'].attr(),
    modifiedFields: _emberData['default'].attr(),

    loadedCustomForms: null,

    didLoad: function didLoad() {
      var loadedCustomForms = this.get('customForms');
      if (!isEmpty(loadedCustomForms)) {
        loadedCustomForms = JSON.parse(JSON.stringify(loadedCustomForms));
      }
      this.set('loadedCustomForms', loadedCustomForms);
    },

    changedAttributes: function changedAttributes() {
      var changedAttributes = this._super();
      var currentCustomForms = this.get('customForms');
      var loadedCustomForms = this.get('loadedCustomForms');
      if (!isEmpty(currentCustomForms)) {
        if (isEmpty(loadedCustomForms)) {
          loadedCustomForms = {};
        }
        var newKeys = Object.keys(currentCustomForms);
        newKeys.forEach(function (customFormId) {
          var oldCustomForm = loadedCustomForms[customFormId];
          var customFormPrefix = 'customForms.' + customFormId;
          if (isEmpty(oldCustomForm)) {
            oldCustomForm = {};
          }
          var newForm = get(currentCustomForms, customFormId);
          var newFormKeys = Object.keys(newForm);
          newFormKeys.forEach(function (newFormProperty) {
            var oldValue = get(oldCustomForm, newFormProperty);
            var newValue = get(newForm, newFormProperty);
            if (oldValue != newValue) {
              changedAttributes[customFormPrefix + '.' + newFormProperty] = [oldValue, newValue];
            }
          });
        });
      }
      return changedAttributes;
    },

    /**
    * Before saving the record, update the modifiedFields attribute to denote what fields were changed when.
    * Also, if the save failed because of a conflict, reload the record and reapply the changed attributes and
    * attempt to save again.
    */
    save: function save(options) {
      var attribute = undefined;
      var changedAttributes = this.changedAttributes();
      var modifiedDate = new Date();
      var modifiedFields = this.get('modifiedFields');
      var session = this.get('session');

      if (!session || !session.get('isAuthenticated')) {
        return new _ember['default'].RSVP.Promise(function (resolve, reject) {
          _ember['default'].run(null, reject, 'ERROR you must be logged in to save');
        });
      }

      if (this.get('hasDirtyAttributes') && !this.get('isDeleted')) {
        if (isEmpty(modifiedFields)) {
          modifiedFields = {};
        }
        this.set('lastModified', modifiedDate);
        for (attribute in changedAttributes) {
          modifiedFields[attribute] = modifiedDate;
        }
        this.set('modifiedFields', modifiedFields);
        this.set('modifiedBy', this.getUserName());
      }
      return this._super(options)['catch']((function (error) {
        if (!isEmpty(options) && options.retry) {
          throw error;
        } else {
          if (error.name && error.name.indexOf && error.name.indexOf('conflict') > -1) {
            // Conflict encountered, so rollback, reload and then save the record with the changed attributes.
            this.rollbackAttributes();
            return this.reload().then(function (record) {
              for (var _attribute in changedAttributes) {
                record.set(_attribute, changedAttributes[_attribute][1]);
              }
              if (_ember['default'].isEmpty(options)) {
                options = {};
              }
              options.retry = true;
              return record.save(options);
            });
          } else {
            throw error;
          }
        }
      }).bind(this));
    }
  });
});
define('hospitalrun/tests/models/abstract.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/abstract.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/abstract.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/add-diagnosis', ['exports', 'ember-data', 'ember-validations', 'ember-pouch'], function (exports, _emberData, _emberValidations, _emberPouch) {
  /**
   * Stub model for adding new patient diagnoses; needed for validation.
   */
  'use strict';

  exports['default'] = _emberPouch.Model.extend(_emberValidations['default'], {
    diagnosis: _emberData['default'].attr('string'),
    validations: {
      diagnosis: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/add-diagnosis.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/add-diagnosis.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/add-diagnosis.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/allergy', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    name: _emberData['default'].attr('string'),
    icd9CMCode: _emberData['default'].attr('string'),
    icd10Code: _emberData['default'].attr('string'),
    // Associations
    patient: _emberData['default'].belongsTo('patient'),

    validations: {
      name: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/allergy.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/allergy.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/allergy.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/appointment', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'moment', 'hospitalrun/utils/patient-validation'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _moment, _hospitalrunUtilsPatientValidation) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    allDay: _emberData['default'].attr(),
    provider: _emberData['default'].attr('string'),
    location: _emberData['default'].attr('string'),
    appointmentType: _emberData['default'].attr('string'),
    startDate: _emberData['default'].attr('date'),
    endDate: _emberData['default'].attr('date'),
    notes: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string', { defaultValue: 'Scheduled' }),

    // Associations
    patient: _emberData['default'].belongsTo('patient', { async: false }),
    visits: _emberData['default'].hasMany('visit'),

    // Formats
    longDateFormat: 'l h:mm A',
    shortDateFormat: 'l',
    timeFormat: 'h:mm A',

    _getDateSpan: function _getDateSpan(startDate, endDate, format) {
      var formattedStart = startDate.format(format);
      var formattedEnd = endDate.format(format);
      return formattedStart + ' - ' + formattedEnd;
    },

    appointmentDate: (function () {
      var startDate = this.get('startDate');
      return startDate;
    }).property('startDate'),

    displayStatus: (function () {
      var status = this.get('status');
      if (_ember['default'].isEmpty(status)) {
        status = 'Scheduled';
      }
      return status;
    }).property('status'),

    formattedAppointmentDate: (function () {
      var allDay = this.get('allDay');
      var endDate = (0, _moment['default'])(this.get('endDate'));
      var dateFormat = '';
      var formattedDate = '';
      var startDate = (0, _moment['default'])(this.get('startDate'));

      if (startDate.isSame(endDate, 'day')) {
        formattedDate = startDate.format(this.get('shortDateFormat'));
        if (!allDay) {
          formattedDate += ' ';
          formattedDate += this._getDateSpan(startDate, endDate, this.get('timeFormat'));
        }
      } else {
        if (allDay) {
          dateFormat = this.get('shortDateFormat');
        } else {
          dateFormat = this.get('longDateFormat');
        }
        formattedDate = this._getDateSpan(startDate, endDate, dateFormat);
      }
      return formattedDate;
    }).property('startDate', 'endDate'),

    validations: {
      appointmentDate: {
        presence: {
          'if': function _if(object) {
            var appointmentType = object.get('appointmentType');
            return appointmentType !== 'Admission';
          }
        }
      },

      patientTypeAhead: _hospitalrunUtilsPatientValidation['default'].patientTypeAhead,

      patient: {
        presence: true
      },
      appointmentType: {
        presence: true
      },
      startDate: {
        presence: true
      },
      endDate: {
        acceptance: {
          accept: true,
          'if': function _if(object) {
            if (!object.get('hasDirtyAttributes')) {
              return false;
            }
            var allDay = object.get('allDay');
            var startDate = object.get('startDate');
            var endDate = object.get('endDate');
            if (_ember['default'].isEmpty(endDate) || _ember['default'].isEmpty(startDate)) {
              // force validation to fail
              return true;
            } else {
              if (allDay) {
                if (endDate.getTime() < startDate.getTime()) {
                  return true;
                }
              } else {
                if (endDate.getTime() <= startDate.getTime()) {
                  return true;
                }
              }
            }
            // patient is properly selected; don't do any further validation
            return false;
          },
          message: 'Please select an end date later than the start date'
        }
      }
    }
  });
});
define('hospitalrun/tests/models/appointment.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/appointment.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/appointment.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/attachment', ['exports', 'hospitalrun/models/photo', 'ember-data'], function (exports, _hospitalrunModelsPhoto, _emberData) {
  'use strict';

  var attr = _emberData['default'].attr;
  exports['default'] = _hospitalrunModelsPhoto['default'].extend({
    addedBy: attr('string'),
    addedByDisplayName: attr('string'),
    dateAdded: attr('date'),
    title: attr('string')
  });
});
define('hospitalrun/tests/models/attachment.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/attachment.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/attachment.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/billing-line-item', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/number-format'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsNumberFormat) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsNumberFormat['default'], {
    // Attributes
    amountOwed: _emberData['default'].attr('number'),
    category: _emberData['default'].attr('string'),
    description: _emberData['default'].attr('string'),
    discount: _emberData['default'].attr('number'),
    name: _emberData['default'].attr('string'),
    nationalInsurance: _emberData['default'].attr('number'),
    privateInsurance: _emberData['default'].attr('number'),
    // Associations
    /* The individual objects that make up this line item. */
    details: _emberData['default'].hasMany('line-item-detail', { async: false }),

    amountOwedChanged: (function () {
      _ember['default'].run.debounce(this, function () {
        var discount = this._getValidNumber(this.get('discount'));
        var nationalInsurance = this._getValidNumber(this.get('nationalInsurance'));
        var privateInsurance = this._getValidNumber(this.get('privateInsurance'));
        var amountOwed = this._getValidNumber(this.get('total'));
        amountOwed = amountOwed - discount - nationalInsurance - privateInsurance;
        if (amountOwed < 0) {
          amountOwed = 0;
        }
        if (!this.get('isDestroyed')) {
          this.set('amountOwed', this._numberFormat(amountOwed, true));
        }
      }, 500);
    }).observes('discount', 'nationalInsurance', 'privateInsurance', 'total'),

    detailTotals: _ember['default'].computed.mapBy('details', 'amountOwed'),
    total: _ember['default'].computed.sum('detailTotals'),

    validations: {
      category: {
        presence: true
      },
      discount: {
        numericality: {
          allowBlank: true
        }
      },
      nationalInsurance: {
        numericality: {
          allowBlank: true
        }
      },
      name: {
        presence: true
      },
      privateInsurance: {
        numericality: {
          allowBlank: true
        }
      },
      total: {
        numericality: {
          allowBlank: true
        }
      }
    }
  });
});
define('hospitalrun/tests/models/billing-line-item.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/billing-line-item.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/billing-line-item.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/custom-field', ['exports', 'ember-validations', 'ember-data'], function (exports, _emberValidations, _emberData) {
  'use strict';

  exports['default'] = _emberData['default'].Model.extend(_emberValidations['default'], {
    checkboxes: _emberData['default'].attr(),
    classNames: _emberData['default'].attr('string'),
    colSpan: _emberData['default'].attr('number'),
    includeOtherOption: _emberData['default'].attr('boolean'),
    label: _emberData['default'].attr('string'),
    otherOptionLabel: _emberData['default'].attr('string'),
    prompt: _emberData['default'].attr('string'),
    property: _emberData['default'].attr('string'),
    type: _emberData['default'].attr('string'),
    values: _emberData['default'].attr('string'),
    validations: {
      colSpan: {
        numericality: {
          allowBlank: true,
          onlyInteger: true
        }
      },
      label: {
        presence: true
      },
      type: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/custom-field.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/custom-field.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/custom-field.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/custom-form', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  function defaultFields() {
    return [];
  }

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    alwaysInclude: _emberData['default'].attr('boolean'),
    columns: _emberData['default'].attr('number', { defaultValue: 1 }),
    fields: _emberData['default'].attr('custom-fields', { defaultValue: defaultFields }),
    formType: _emberData['default'].attr('string'),
    name: _emberData['default'].attr('string'),

    validations: {
      formType: {
        presence: true
      },
      name: {
        presence: true
      },
      columns: {
        numericality: {
          allowBlank: true,
          onlyInteger: true,
          lessThanOrEqualTo: 12
        }
      }
    }
  });
});
define('hospitalrun/tests/models/custom-form.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/custom-form.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/custom-form.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/diagnosis', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    active: _emberData['default'].attr('boolean', { defaultValue: true }),
    date: _emberData['default'].attr('date'),
    diagnosis: _emberData['default'].attr('string'),
    secondaryDiagnosis: _emberData['default'].attr('boolean', { defaultValue: false }),

    validations: {
      date: {
        presence: true
      },
      diagnosis: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/diagnosis.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/diagnosis.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/diagnosis.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/family-info', ['exports', 'ember-data', 'ember-validations', 'ember-pouch'], function (exports, _emberData, _emberValidations, _emberPouch) {
  /**
   * Model for social worker family info
   */
  'use strict';

  exports['default'] = _emberPouch.Model.extend(_emberValidations['default'], {
    age: _emberData['default'].attr('number'),
    civilStatus: _emberData['default'].attr('string'),
    education: _emberData['default'].attr('string'),
    income: _emberData['default'].attr('string'),
    insurance: _emberData['default'].attr('string'),
    name: _emberData['default'].attr('string'),
    occupation: _emberData['default'].attr('string'),
    relationship: _emberData['default'].attr('string'),
    validations: {
      age: {
        numericality: {
          allowBlank: true
        }
      },
      name: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/family-info.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/family-info.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/family-info.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/imaging', ['exports', 'hospitalrun/models/abstract', 'hospitalrun/mixins/can-edit-requested', 'hospitalrun/mixins/date-format', 'ember-data', 'ember', 'hospitalrun/utils/patient-validation', 'hospitalrun/mixins/result-validation'], function (exports, _hospitalrunModelsAbstract, _hospitalrunMixinsCanEditRequested, _hospitalrunMixinsDateFormat, _emberData, _ember, _hospitalrunUtilsPatientValidation, _hospitalrunMixinsResultValidation) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsCanEditRequested['default'], _hospitalrunMixinsDateFormat['default'], _hospitalrunMixinsResultValidation['default'], {
    // Attributes
    imagingDate: _emberData['default'].attr('date'),
    notes: _emberData['default'].attr('string'),
    radiologist: _emberData['default'].attr('string'),
    requestedBy: _emberData['default'].attr('string'),
    requestedDate: _emberData['default'].attr('date'),
    result: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string'),

    // Associations
    charges: _emberData['default'].hasMany('proc-charge', { async: false }),
    imagingType: _emberData['default'].belongsTo('pricing', { async: false }),
    patient: _emberData['default'].belongsTo('patient', { async: false }),
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    imagingDateAsTime: computed('imagingDate', function () {
      return this.dateToTime(this.get('imagingDate'));
    }),

    requestedDateAsTime: computed('requestedDate', function () {
      return this.dateToTime(this.get('requestedDate'));
    }),

    validations: {
      imagingTypeName: {
        presence: {
          'if': function _if(object) {
            if (object.get('isNew')) {
              return true;
            }
          },
          message: 'Please select an imaging type'
        }
      },
      patientTypeAhead: _hospitalrunUtilsPatientValidation['default'].patientTypeAhead,
      patient: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/imaging.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/imaging.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/imaging.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/inc-category', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    incidentCategoryName: _emberData['default'].attr('string'),
    incidentCategoryItems: _emberData['default'].attr()

  });
});
define('hospitalrun/tests/models/inc-category.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/inc-category.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/inc-category.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/incident-note', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    givenBy: _emberData['default'].attr('string'),
    givenByDisplayName: _emberData['default'].attr('string'),
    description: _emberData['default'].attr('string'),
    dateRecorded: _emberData['default'].attr('date')
  });
});
define('hospitalrun/tests/models/incident-note.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/incident-note.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/incident-note.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/incident', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/incident-statuses', 'moment', 'ember-validations'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsIncidentStatuses, _moment, _emberValidations) {
  'use strict';

  var attr = _emberData['default'].attr;
  var belongsTo = _emberData['default'].belongsTo;
  var hasMany = _emberData['default'].hasMany;
  var computed = _ember['default'].computed;
  var _get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var _set = _ember['default'].set;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsIncidentStatuses['default'], {
    categoryItem: attr('string'),
    categoryName: attr('string'),
    customForms: _emberData['default'].attr('custom-forms'),
    dateOfIncident: attr('date'),
    department: attr('string'),
    description: attr('string'),
    friendlyId: attr('string'),
    modifiedByDisplayName: _emberData['default'].attr('string'),
    notificationSend: attr('boolean', { defaultValue: false }),
    reportedBy: attr('string'),
    reportedByDisplayName: attr('string'),
    reportedDate: attr('date'),
    reportedTo: attr('string'),
    sentinelEvent: attr('boolean'),
    status: attr('string', { defaultValue: _hospitalrunMixinsIncidentStatuses.REPORTED }),

    incidentAttachments: hasMany('attachment', { async: true }),
    notes: hasMany('incident-note', { async: true }),
    patient: belongsTo('patient', { async: false }),

    dateForFilter: computed('dateOfIncident', function () {
      var dateOfIncident = _get(this, 'dateOfIncident');
      return (0, _moment['default'])(dateOfIncident).startOf('day').toDate();
    }),

    localizedStatus: computed('status', function () {
      var status = _get(this, 'status');
      return this.getLocalizedStatus(status);
    }),

    patientTypeAhead: computed('patient', {
      get: function get() {
        var patient = _get(this, 'patient');
        if (!isEmpty(patient)) {
          return _get(patient, 'displayName') + ' - ' + _get(patient, 'displayPatientId');
        } else {
          return _get(this, 'typeAheadPatientName');
        }
      },
      set: function set(key, value) {
        _set(this, 'typeAheadPatientName', value);
        return value;
      }

    }),

    validations: {
      categoryName: {
        presence: true
      },
      dateOfIncident: {
        presence: true
      },
      department: {
        presence: true
      },
      description: {
        presence: true
      },
      patientTypeAhead: {
        inline: (0, _emberValidations.validator)(function () {
          var patientTypeAhead = _get(this, 'patientTypeAhead');
          var isValid = true;
          if (isEmpty(patientTypeAhead)) {
            return;
          }
          var patientName = _get(this, 'patient.displayName');
          if (isEmpty(patientName)) {
            isValid = false;
          } else {
            var typeAheadName = patientTypeAhead.substr(0, patientName.length).toLowerCase();
            if (patientName.toLowerCase().indexOf(typeAheadName) !== 0) {
              isValid = false;
            }
          }
          if (!isValid) {
            var i18n = _get(this, 'i18n');
            return i18n.t('incident.messages.selectExistingPatient').toString();
          }
        })
      }
    }
  });
});
define('hospitalrun/tests/models/incident.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/incident.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/incident.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/inv-location', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/location-name'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsLocationName) {
  'use strict';

  /**
   * Model to represent the location(s) of inventory items.
   * File/model name is inv-location because using inv-location will cause location
   * items to be shown as inventory items since the pouchdb adapter does a
   * retrieve for keys starting with 'inventory' to fetch inventory items.
   */
  var InventoryLocation = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsLocationName['default'], {
    quantity: _emberData['default'].attr('number'),
    location: _emberData['default'].attr('string'),
    aisleLocation: _emberData['default'].attr('string'),
    i18n: _ember['default'].inject.service(),

    locationNameWithQuantity: (function () {
      var quantity = this.get('quantity');
      var locationName = this.get('locationName');
      return locationName + ' (' + this.get('i18n').t('inventory.labels.availableQuantity', { quantity: quantity }) + ')';
    }).property('locationName', 'quantity'),

    validations: {
      adjustmentQuantity: {
        numericality: {
          greaterThan: 0,
          messages: {
            greaterThan: 'must be greater than 0'
          }
        },
        acceptance: {
          /**
           * Validate that the adjustment quantity is a number and that if a deduction there are enough items to deduct
           */
          accept: true,
          'if': function _if(object) {
            var adjustmentQuantity = object.get('adjustmentQuantity');
            var transactionType = object.get('transactionType');
            var locationQuantity = object.get('quantity');
            if (_ember['default'].isEmpty(adjustmentQuantity) || isNaN(adjustmentQuantity)) {
              return true;
            }
            if (transactionType !== 'Adjustment (Add)' && adjustmentQuantity > locationQuantity) {
              return true;
            }
            return false;
          },
          message: 'Invalid quantity'
        }
      },

      dateCompleted: {
        presence: {
          message: 'Please provide a date'
        }
      },

      transferLocation: {
        acceptance: {
          accept: true,
          'if': function _if(object) {
            var transferLocation = object.get('transferLocation');
            var transferItem = object.get('transferItem');
            // If we don't have a transfer item, then a transfer is not occurring.
            if (!_ember['default'].isEmpty(transferItem) && _ember['default'].isEmpty(transferLocation)) {
              return true;
            }
            return false;
          },
          message: 'Please select a location to transfer to'
        }
      }
    }
  });

  exports['default'] = InventoryLocation;
});
define('hospitalrun/tests/models/inv-location.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/inv-location.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/inv-location.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/inv-purchase', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/location-name', 'hospitalrun/mixins/number-format'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsLocationName, _hospitalrunMixinsNumberFormat) {
  'use strict';

  function defaultQuantityGroups() {
    return [];
  }

  /**
   * Model to represent a purchase within an inventory item.
   * File/model name is inv-purchase because using inventory-purchase will cause purchase
   * items to be shown as inventory items since the pouchdb adapter does a
   * retrieve for keys starting with 'inventory' to fetch inventory items.
   */
  var InventoryPurchaseItem = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsLocationName['default'], _hospitalrunMixinsNumberFormat['default'], {
    purchaseCost: _emberData['default'].attr('number'),
    lotNumber: _emberData['default'].attr('string'),
    dateReceived: _emberData['default'].attr('date'),
    costPerUnit: (function () {
      var purchaseCost = this.get('purchaseCost');
      var quantity = parseInt(this.get('originalQuantity'));
      if (_ember['default'].isEmpty(purchaseCost) || _ember['default'].isEmpty(quantity) || purchaseCost === 0 || quantity === 0) {
        return 0;
      }
      return this._numberFormat(purchaseCost / quantity, true);
    }).property('purchaseCost', 'originalQuantity'),
    originalQuantity: _emberData['default'].attr('number'),
    currentQuantity: _emberData['default'].attr('number'),
    expirationDate: _emberData['default'].attr('date'),
    expired: _emberData['default'].attr('boolean'),
    location: _emberData['default'].attr('string'),
    aisleLocation: _emberData['default'].attr('string'),
    giftInKind: _emberData['default'].attr('boolean'),
    inventoryItem: _emberData['default'].attr('string'), // Currently just storing id instead of DS.belongsTo('inventory', { async: true }),
    vendor: _emberData['default'].attr('string'),
    vendorItemNo: _emberData['default'].attr('string'),
    distributionUnit: _emberData['default'].attr('string'),
    invoiceNo: _emberData['default'].attr('string'),
    quantityGroups: _emberData['default'].attr({ defaultValue: defaultQuantityGroups }),
    validations: {
      purchaseCost: {
        numericality: true
      },
      originalQuantity: {
        numericality: {
          greaterThanOrEqualTo: 0
        }
      },
      vendor: {
        presence: true
      }
    }
  });

  exports['default'] = InventoryPurchaseItem;
});
define('hospitalrun/tests/models/inv-purchase.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/inv-purchase.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/inv-purchase.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/inv-request', ['exports', 'hospitalrun/models/abstract', 'hospitalrun/mixins/inventory-adjustment-types', 'ember-data', 'ember', 'hospitalrun/mixins/location-name'], function (exports, _hospitalrunModelsAbstract, _hospitalrunMixinsInventoryAdjustmentTypes, _emberData, _ember, _hospitalrunMixinsLocationName) {
  'use strict';

  /**
   * Model to represent a request for inventory items.
   */
  var InventoryRequest = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsInventoryAdjustmentTypes['default'], _hospitalrunMixinsLocationName['default'], {
    adjustPurchases: _emberData['default'].attr('boolean'),
    completedBy: _emberData['default'].attr('string'),
    costPerUnit: _emberData['default'].attr('number'),
    dateCompleted: _emberData['default'].attr('date'),
    dateRequested: _emberData['default'].attr('date'),
    deliveryAisle: _emberData['default'].attr('string'),
    deliveryLocation: _emberData['default'].attr('string'),
    expenseAccount: _emberData['default'].attr('string'),
    inventoryItem: _emberData['default'].belongsTo('inventory', { async: true }),
    locationsAffected: _emberData['default'].attr(),
    markAsConsumed: _emberData['default'].attr('boolean', { defaultValue: true }),
    patient: _emberData['default'].belongsTo('patient', {
      async: false
    }),
    purchasesAffected: _emberData['default'].attr(),
    quantity: _emberData['default'].attr('number'),
    quantityAtCompletion: _emberData['default'].attr('number'),
    reason: _emberData['default'].attr('string'),
    requestedBy: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string'),
    transactionType: _emberData['default'].attr('string'),
    visit: _emberData['default'].belongsTo('visit', {
      async: false
    }),

    deliveryLocationName: (function () {
      var aisle = this.get('deliveryAisle');
      var location = this.get('deliveryLocation');
      return this.formatLocationName(location, aisle);
    }).property('deliveryAisle', 'deliveryLocation'),

    deliveryDetails: (function () {
      var locationName = this.get('deliveryLocationName');
      var patient = this.get('patient');
      if (_ember['default'].isEmpty(patient)) {
        return locationName;
      } else {
        return patient.get('displayName');
      }
    }).property('deliveryAisle', 'deliveryLocation', 'patient'),

    haveReason: (function () {
      return !_ember['default'].isEmpty(this.get('reason'));
    }).property('reason'),

    isAdjustment: (function () {
      var adjustmentTypes = this.get('adjustmentTypes');
      var transactionType = this.get('transactionType');
      var adjustmentType = adjustmentTypes.findBy('type', transactionType);
      return !_ember['default'].isEmpty(adjustmentType);
    }).property('transactionType'),

    isFulfillment: (function () {
      return this.get('transactionType') === 'Fulfillment';
    }).property('transactionType'),

    isTransfer: (function () {
      return this.get('transactionType') === 'Transfer';
    }).property('transactionType'),

    validations: {
      inventoryItemTypeAhead: {
        acceptance: {
          accept: true,
          'if': function _if(object) {
            if (!object.get('hasDirtyAttributes')) {
              return false;
            }
            var itemName = object.get('inventoryItem.name');
            var itemTypeAhead = object.get('inventoryItemTypeAhead');
            var requestedItems = object.get('requestedItems');
            var status = object.get('status');
            if (status === 'Requested') {
              // Requested items don't show the type ahead and therefore don't need validation.
              return false;
            }
            if (_ember['default'].isEmpty(itemName) || _ember['default'].isEmpty(itemTypeAhead)) {
              // force validation to fail if fields are empty and requested items are empty
              return _ember['default'].isEmpty(requestedItems);
            } else {
              var typeAheadName = itemTypeAhead.substr(0, itemName.length);
              if (itemName !== typeAheadName) {
                return true;
              }
            }
            // Inventory item is properly selected; don't do any further validation
            return false;
          },
          message: 'Please select a valid inventory item'
        }
      },
      quantity: {
        numericality: {
          greaterThan: 0,
          messages: {
            greaterThan: 'must be greater than 0'
          },
          'if': function _if(object) {
            var requestedItems = object.get('requestedItems');
            return _ember['default'].isEmpty(requestedItems);
          }
        },
        acceptance: {
          accept: true,
          'if': function _if(object) {
            var isNew = object.get('isNew');
            var requestQuantity = parseInt(object.get('quantity'));
            var transactionType = object.get('transactionType');
            var quantityToCompare = null;
            if (transactionType === 'Return') {
              // no validation needed for returns
              return false;
            } else if (isNew && transactionType === 'Request') {
              quantityToCompare = object.get('inventoryItem.quantity');
            } else {
              quantityToCompare = object.get('inventoryLocation.quantity');
            }
            if (requestQuantity > quantityToCompare) {
              // force validation to fail
              return true;
            } else {
              // Diagnosis is properly set; don't do any further validation
              return false;
            }
          },
          message: 'The quantity must be less than or equal to the number of available items.'
        }
      }
    }
  });

  exports['default'] = InventoryRequest;
});
define('hospitalrun/tests/models/inv-request.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/inv-request.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/inv-request.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/inventory-batch', ['exports', 'hospitalrun/models/abstract', 'ember'], function (exports, _hospitalrunModelsAbstract, _ember) {
  'use strict';

  /**
   * Model to represent a request for inventory items.
   */
  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    haveInvoiceItems: function haveInvoiceItems() {
      var invoiceItems = this.get('invoiceItems');
      return !_ember['default'].isEmpty(invoiceItems);
    },

    validations: {
      dateReceived: {
        presence: true
      },
      inventoryItemTypeAhead: {
        presence: {
          unless: function unless(object) {
            return object.haveInvoiceItems();
          }
        }
      },
      purchaseCost: {
        numericality: {
          greaterThan: 0,
          messages: {
            greaterThan: 'must be greater than 0'
          },
          unless: function unless(object) {
            return object.haveInvoiceItems();
          }
        }
      },
      quantity: {
        numericality: {
          greaterThan: 0,
          messages: {
            greaterThan: 'must be greater than 0'
          },
          unless: function unless(object) {
            return object.haveInvoiceItems();
          }
        }
      },
      vendor: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/inventory-batch.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/inventory-batch.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/inventory-batch.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/inventory', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'ember-computed', 'hospitalrun/mixins/location-name', 'hospitalrun/utils/item-condition'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _emberComputed, _hospitalrunMixinsLocationName, _hospitalrunUtilsItemCondition) {
  'use strict';

  var get = _ember['default'].get;
  var set = _ember['default'].set;

  var validateIfNewItem = {
    'if': function validateNewItem(object) {
      var skipSavePurchase = get(object, 'skipSavePurchase');
      // Only validate on new items and only if we are saving a purchase.
      return !skipSavePurchase && get(object, 'isNew');
    }
  };

  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsLocationName['default'], {
    // Attributes
    crossReference: _emberData['default'].attr('string'),
    description: _emberData['default'].attr('string'),
    distributionUnit: _emberData['default'].attr('string'),
    friendlyId: _emberData['default'].attr('string'),
    inventoryType: _emberData['default'].attr('string'),
    keywords: _emberData['default'].attr(),
    name: _emberData['default'].attr('string'),
    price: _emberData['default'].attr('number'),
    quantity: _emberData['default'].attr('number'),
    rank: _emberData['default'].attr('string'),
    reorderPoint: _emberData['default'].attr('number'),

    // Associations
    locations: _emberData['default'].hasMany('inv-location', { async: false }),
    purchases: _emberData['default'].hasMany('inv-purchase', { async: false }),

    // TODO: this value should be server calcuated property on model!
    estimatedDaysOfStock: 14,

    availableLocations: (0, _emberComputed['default'])('locations.@each.quantity', function () {
      var locations = get(this, 'locations').filter(function (location) {
        return get(location, 'quantity') > 0;
      });
      return locations;
    }),

    displayLocations: (0, _emberComputed['default'])('availableLocations', function () {
      var _this = this;

      var locations = get(this, 'availableLocations');
      var returnLocations = [];
      locations.forEach(function (currentLocation) {
        var aisleLocationName = get(currentLocation, 'aisleLocation');
        var locationName = get(currentLocation, 'location');
        var displayLocationName = _this.formatLocationName(locationName, aisleLocationName);
        if (!_ember['default'].isEmpty(displayLocationName)) {
          returnLocations.push(displayLocationName);
        }
      });
      return returnLocations.toString();
    }),

    condition: (0, _emberComputed['default'])('rank', 'estimatedDaysOfStock', function () {
      var estimatedDaysOfStock = get(this, 'estimatedDaysOfStock');
      var multiplier = (0, _hospitalrunUtilsItemCondition.rankToMultiplier)(get(this, 'rank'));

      return (0, _hospitalrunUtilsItemCondition.getCondition)(estimatedDaysOfStock, multiplier);
    }),

    validations: {
      distributionUnit: {
        presence: true
      },
      purchaseCost: {
        numericality: validateIfNewItem
      },
      name: {
        presence: true
      },
      quantity: {
        numericality: {
          validateIfNewItem: validateIfNewItem,
          greaterThanOrEqualTo: 0
        }
      },
      price: {
        numericality: {
          allowBlank: true
        }
      },
      originalQuantity: {
        presence: validateIfNewItem
      },
      reorderPoint: {
        numericality: {
          allowBlank: true
        }
      },
      inventoryType: {
        presence: true
      },
      vendor: {
        presence: validateIfNewItem
      }
    },

    updateQuantity: function updateQuantity() {
      var purchases = get(this, 'purchases');
      var newQuantity = purchases.reduce(function (previousItem, currentItem) {
        var currentQuantity = 0;
        if (!currentItem.get('expired')) {
          currentQuantity = currentItem.get('currentQuantity');
        }
        return previousItem + currentQuantity;
      }, 0);
      set(this, 'quantity', newQuantity);
    }
  });
});
define('hospitalrun/tests/models/inventory.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/inventory.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/inventory.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/invoice', ['exports', 'hospitalrun/models/abstract', 'hospitalrun/mixins/date-format', 'ember-data', 'ember', 'hospitalrun/mixins/number-format', 'hospitalrun/utils/patient-validation'], function (exports, _hospitalrunModelsAbstract, _hospitalrunMixinsDateFormat, _emberData, _ember, _hospitalrunMixinsNumberFormat, _hospitalrunUtilsPatientValidation) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsDateFormat['default'], _hospitalrunMixinsNumberFormat['default'], {
    // Attributes
    billDate: _emberData['default'].attr('date'),
    externalInvoiceNumber: _emberData['default'].attr('string'),
    paidTotal: _emberData['default'].attr('number'),
    patientInfo: _emberData['default'].attr('string'), // Needed for searching
    remarks: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string'),

    // Associations
    /* the individual line items of the invoice */
    lineItems: _emberData['default'].hasMany('billing-line-item', { async: false }),
    patient: _emberData['default'].belongsTo('patient', { async: false }),
    paymentProfile: _emberData['default'].belongsTo('price-profile', { async: false }),
    /* payments track the number of payment events attached to an invoice. */
    payments: _emberData['default'].hasMany('payment', { async: false }),
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    addPayment: function addPayment(payment) {
      var payments = get(this, 'payments');
      payments.addObject(payment);
      this.paymentAmountChanged();
    },

    billDateAsTime: computed('billDate', function () {
      return this.dateToTime(get(this, 'billDate'));
    }),

    discountTotals: _ember['default'].computed.mapBy('lineItemsByCategory', 'discount'),
    discount: _ember['default'].computed.sum('discountTotals'),

    nationalInsuranceTotals: _ember['default'].computed.mapBy('lineItemsByCategory', 'nationalInsurance'),
    nationalInsurance: _ember['default'].computed.sum('nationalInsuranceTotals'),

    paidFlag: computed('status', function () {
      return get(this, 'status') === 'Paid';
    }),

    remainingBalance: computed('finalPatientResponsibility', 'paidTotal', function () {
      var patientResponsibility = get(this, 'finalPatientResponsibility');
      var paidTotal = get(this, 'paidTotal');
      return this._numberFormat(patientResponsibility - paidTotal, true);
    }),

    privateInsuranceTotals: _ember['default'].computed.mapBy('lineItemsByCategory', 'privateInsurance'),
    privateInsurance: _ember['default'].computed.sum('privateInsuranceTotals'),

    lineTotals: _ember['default'].computed.mapBy('lineItems', 'total'),
    total: _ember['default'].computed.sum('lineTotals'),

    displayInvoiceNumber: computed('externalInvoiceNumber', 'id', function () {
      var externalInvoiceNumber = get(this, 'externalInvoiceNumber');
      var id = get(this, 'id');
      return _ember['default'].isEmpty(externalInvoiceNumber) ? id : externalInvoiceNumber;
    }),

    lineItemsByCategory: computed('lineItems.@each.amountOwed', function () {
      var lineItems = get(this, 'lineItems');
      var byCategory = [];
      lineItems.forEach((function (lineItem) {
        var category = get(lineItem, 'category');
        var categoryList = byCategory.findBy('category', category);
        if (_ember['default'].isEmpty(categoryList)) {
          categoryList = {
            category: category,
            items: []
          };
          byCategory.push(categoryList);
        }
        categoryList.items.push(lineItem);
      }).bind(this));
      byCategory.forEach((function (categoryList) {
        categoryList.amountOwed = this._calculateTotal(categoryList.items, 'amountOwed');
        categoryList.discount = this._calculateTotal(categoryList.items, 'discount');
        categoryList.nationalInsurance = this._calculateTotal(categoryList.items, 'nationalInsurance');
        categoryList.privateInsurance = this._calculateTotal(categoryList.items, 'privateInsurance');
        categoryList.total = this._calculateTotal(categoryList.items, 'total');
      }).bind(this));
      return byCategory;
    }),

    patientIdChanged: (function () {
      if (!_ember['default'].isEmpty(get(this, 'patient'))) {
        var patientDisplayName = get(this, 'patient.displayName');
        var patientDisplayId = get(this, 'patient.displayPatientId');
        set(this, 'patientInfo', patientDisplayName + ' - ' + patientDisplayId);
      }
    }).observes('patient.displayName', 'patient.id', 'patient.displayPatientId'),

    patientResponsibilityTotals: _ember['default'].computed.mapBy('lineItems', 'amountOwed'),
    patientResponsibility: _ember['default'].computed.sum('patientResponsibilityTotals'),
    finalPatientResponsibility: computed('patientResponsibility', 'paymentProfile', function () {
      var setFee = this._getValidNumber(this.get('paymentProfile.setFee'));
      var discountAmount = this._getValidNumber(this.get('paymentProfile.discountAmount'));
      var patientResponsibility = this._getValidNumber(this.get('patientResponsibility'));
      if (setFee > 0) {
        if (setFee < patientResponsibility) {
          return setFee;
        } else {
          return patientResponsibility;
        }
      } else if (discountAmount > 0) {
        if (patientResponsibility - discountAmount > 0) {
          return patientResponsibility - discountAmount;
        } else {
          return 0;
        }
      } else {
        return patientResponsibility;
      }
    }),

    paymentAmountChanged: (function () {
      var payments = get(this, 'payments').filter(function (payment) {
        return !get(payment, 'isNew');
      });
      if (payments.length === 0) {
        return;
      }
      var paidTotal = payments.reduce((function (previousValue, payment) {
        return previousValue += this._getValidNumber(payment.get('amount'));
      }).bind(this), 0);
      set(this, 'paidTotal', this._numberFormat(paidTotal, true));
      var remainingBalance = get(this, 'remainingBalance');
      if (remainingBalance <= 0) {
        set(this, 'status', 'Paid');
      }
    }).observes('payments.[]', 'payments.@each.amount'),

    validations: {
      patientTypeAhead: _hospitalrunUtilsPatientValidation['default'].patientTypeAhead,
      patient: {
        presence: true
      },
      visit: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/invoice.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/invoice.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/invoice.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/lab', ['exports', 'hospitalrun/models/abstract', 'hospitalrun/mixins/can-edit-requested', 'hospitalrun/mixins/date-format', 'ember-data', 'ember', 'hospitalrun/utils/patient-validation', 'hospitalrun/mixins/result-validation'], function (exports, _hospitalrunModelsAbstract, _hospitalrunMixinsCanEditRequested, _hospitalrunMixinsDateFormat, _emberData, _ember, _hospitalrunUtilsPatientValidation, _hospitalrunMixinsResultValidation) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsCanEditRequested['default'], _hospitalrunMixinsDateFormat['default'], _hospitalrunMixinsResultValidation['default'], {
    // Attributes
    labDate: _emberData['default'].attr('date'),
    notes: _emberData['default'].attr('string'),
    requestedBy: _emberData['default'].attr('string'),
    requestedDate: _emberData['default'].attr('date'),
    result: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string'),

    // Associations
    charges: _emberData['default'].hasMany('proc-charge', { async: false }),
    labType: _emberData['default'].belongsTo('pricing', { async: false }),
    patient: _emberData['default'].belongsTo('patient', { async: false }),
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    labDateAsTime: computed('labDate', function () {
      return this.dateToTime(get(this, 'labDate'));
    }),

    requestedDateAsTime: computed('requestedDate', function () {
      return this.dateToTime(get(this, 'requestedDate'));
    }),

    validations: {
      labTypeName: {
        presence: {
          'if': function _if(object) {
            if (object.get('isNew')) {
              return true;
            }
          },
          message: 'Please select a lab type'
        }
      },
      patientTypeAhead: _hospitalrunUtilsPatientValidation['default'].patientTypeAhead,
      patient: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/lab.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/lab.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/lab.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/line-item-detail', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/number-format'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsNumberFormat) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsNumberFormat['default'], {
    // Attributes
    department: _emberData['default'].attr('string'),
    expenseAccount: _emberData['default'].attr('string'),
    name: _emberData['default'].attr('string'),
    price: _emberData['default'].attr('number'),
    quantity: _emberData['default'].attr('number'),
    total: _emberData['default'].attr('number'),

    // Associations
    pricingItem: _emberData['default'].belongsTo('pricing', { async: false }),

    amountOwed: computed('price', 'quantity', function () {
      var price = get(this, 'price');
      var quantity = get(this, 'quantity');
      var total = 0;
      if (this._validNumber(price) && this._validNumber(quantity)) {
        total = this._numberFormat(price * quantity, true);
      }
      return total;
    })
  });
});
define('hospitalrun/tests/models/line-item-detail.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/line-item-detail.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/line-item-detail.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/lookup', ['exports', 'ember-pouch', 'ember-data'], function (exports, _emberPouch, _emberData) {
  'use strict';

  var attr = _emberData['default'].attr;
  exports['default'] = _emberPouch.Model.extend({
    organizeByType: attr('boolean'),
    userCanAdd: attr('boolean'),
    value: attr('')
  });
});
define('hospitalrun/tests/models/lookup.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/lookup.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/lookup.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/medication', ['exports', 'hospitalrun/models/abstract', 'hospitalrun/mixins/can-edit-requested', 'ember-data', 'hospitalrun/mixins/date-format', 'ember', 'hospitalrun/mixins/medication-details'], function (exports, _hospitalrunModelsAbstract, _hospitalrunMixinsCanEditRequested, _emberData, _hospitalrunMixinsDateFormat, _ember, _hospitalrunMixinsMedicationDetails) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsCanEditRequested['default'], _hospitalrunMixinsDateFormat['default'], _hospitalrunMixinsMedicationDetails['default'], {
    // Attributes
    notes: _emberData['default'].attr('string'),
    prescription: _emberData['default'].attr('string'),
    prescriptionDate: _emberData['default'].attr('date'),
    quantity: _emberData['default'].attr('number'),
    refills: _emberData['default'].attr('number'),
    requestedDate: _emberData['default'].attr('date'),
    requestedBy: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string'),

    // Associations
    inventoryItem: _emberData['default'].belongsTo('inventory', { async: true }),
    patient: _emberData['default'].belongsTo('patient', { async: false }),
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    isRequested: computed('status', function () {
      return get(this, 'status') === 'Requested';
    }),

    medicationName: computed('medicationTitle', 'inventoryItem', function () {
      return this.getMedicationName('inventoryItem');
    }),

    medicationPrice: computed('priceOfMedication', 'inventoryItem', function () {
      return this.getMedicationPrice('inventoryItem');
    }),

    prescriptionDateAsTime: computed('prescriptionDate', function () {
      return this.dateToTime(get(this, 'prescriptionDate'));
    }),

    requestedDateAsTime: computed('requestedDate', function () {
      return this.dateToTime(get(this, 'requestedDate'));
    }),

    validations: {
      prescription: {
        acceptance: {
          accept: true,
          'if': function _if(object) {
            if (!get(object, 'hasDirtyAttributes') || get(object, 'isFulfilling')) {
              return false;
            }
            var prescription = get(object, 'prescription');
            var quantity = get(object, 'quantity');
            return _ember['default'].isEmpty(prescription) && _ember['default'].isEmpty(quantity);
          },
          message: 'Please enter a prescription or a quantity'
        }
      },

      inventoryItemTypeAhead: {
        acceptance: {
          accept: true,
          'if': function _if(object) {
            if (!get(object, 'hasDirtyAttributes') || !get(object, 'isNew')) {
              return false;
            }
            var itemName = get(object, 'inventoryItem.name');
            var itemTypeAhead = get(object, 'inventoryItemTypeAhead');
            if (_ember['default'].isEmpty(itemName) || _ember['default'].isEmpty(itemTypeAhead)) {
              // force validation to fail
              return true;
            } else {
              var typeAheadName = itemTypeAhead.substr(0, itemName.length);
              if (itemName !== typeAheadName) {
                return true;
              }
            }
            // Inventory item is properly selected; don't do any further validation
            return false;
          },
          message: 'Please select a valid medication'
        }
      },

      patientTypeAhead: {
        presence: {
          'if': function _if(object) {
            return get(object, 'selectPatient');
          }
        }
      },

      quantity: {
        numericality: {
          allowBlank: true,
          greaterThan: 0,
          messages: {
            greaterThan: 'must be greater than 0'
          }
        },
        presence: {
          'if': function _if(object) {
            return get(object, 'isFulfilling');
          }
        },
        acceptance: {
          accept: true,
          'if': function _if(object) {
            var isFulfilling = get(object, 'isFulfilling');
            var requestQuantity = parseInt(get(object, 'quantity'));
            var quantityToCompare = null;

            if (!isFulfilling) {
              // no validation needed when not fulfilling
              return false;
            } else {
              quantityToCompare = object.get('inventoryItem.quantity');
            }

            if (requestQuantity > quantityToCompare) {
              // force validation to fail
              return true;
            } else {
              // There is enough quantity on hand
              return false;
            }
          },
          message: 'The quantity must be less than or equal to the number of available medication.'
        }
      },

      refills: {
        numericality: {
          allowBlank: true
        }
      }
    }
  });
});
define('hospitalrun/tests/models/medication.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/medication.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/medication.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/operation-report', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;

  function defaultProcedures() {
    return [];
  }

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    additionalNotes: _emberData['default'].attr('string'),
    caseComplexity: _emberData['default'].attr('number'),
    customForms: _emberData['default'].attr('custom-forms'),
    procedures: _emberData['default'].attr('operative-procedures', { defaultValue: defaultProcedures }),
    operationDescription: _emberData['default'].attr('string'),
    surgeon: _emberData['default'].attr('string'),
    surgeryDate: _emberData['default'].attr('date'),

    // Associations
    preOpDiagnoses: _emberData['default'].hasMany('diagnosis'),
    diagnoses: _emberData['default'].hasMany('diagnosis'), // Post op diagnosis
    operativePlan: _emberData['default'].belongsTo('operative-plan', { async: true }),
    patient: _emberData['default'].belongsTo('patient', { async: false }),

    validations: {
      caseComplexity: {
        numericality: {
          allowBlank: true,
          onlyInteger: true
        }
      },
      procedureDescription: {
        presence: {
          'if': function _if(object) {
            return isEmpty(get(object, 'procedures'));
          }
        }
      }
    }
  });
});
define('hospitalrun/tests/models/operation-report.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/operation-report.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/operation-report.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/operative-plan', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/operative-plan-statuses'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsOperativePlanStatuses) {
  'use strict';

  var computed = _ember['default'].computed;
  var _get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;

  function defaultProcedures() {
    return [];
  }

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    additionalNotes: _emberData['default'].attr('string'),
    admissionInstructions: _emberData['default'].attr('string'),
    caseComplexity: _emberData['default'].attr('number'),
    customForms: _emberData['default'].attr('custom-forms'),
    operationDescription: _emberData['default'].attr('string'),
    procedures: _emberData['default'].attr('operative-procedures', { defaultValue: defaultProcedures }),
    status: _emberData['default'].attr('string', { defaultValue: _hospitalrunMixinsOperativePlanStatuses.PLANNED_STATUS }),
    surgeon: _emberData['default'].attr('string'),

    // Associations
    diagnoses: _emberData['default'].hasMany('diagnosis'),
    patient: _emberData['default'].belongsTo('patient', { async: false }),

    isPlanned: computed('status', {
      get: function get() {
        var status = _get(this, 'status');
        return status === _hospitalrunMixinsOperativePlanStatuses.PLANNED_STATUS;
      }
    }),

    validations: {
      caseComplexity: {
        numericality: {
          allowBlank: true,
          onlyInteger: true
        }
      },

      procedureDescription: {
        presence: {
          'if': function _if(object) {
            return isEmpty(_get(object, 'procedures'));
          }
        }
      }
    }
  });
});
define('hospitalrun/tests/models/operative-plan.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/operative-plan.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/operative-plan.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/option', ['exports', 'ember-pouch', 'ember-data'], function (exports, _emberPouch, _emberData) {
  'use strict';

  exports['default'] = _emberPouch.Model.extend({
    value: _emberData['default'].attr('')
  });
});
define('hospitalrun/tests/models/option.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/option.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/option.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/override-price', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    price: _emberData['default'].attr('number'),

    // Associations
    profile: _emberData['default'].belongsTo('price-profile', { async: false }),

    validations: {
      profile: {
        presence: true
      },
      price: {
        numericality: true
      }
    }
  });
});
define('hospitalrun/tests/models/override-price.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/override-price.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/override-price.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/patient-note', ['exports', 'hospitalrun/models/abstract', 'ember', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _ember, _emberData) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    /*
     * if the note was written by one person but dictated or
     * given on behalf of another, otherwise, this and createdBy are the same.
     */
    attribution: _emberData['default'].attr('string'),

    content: _emberData['default'].attr('string'),
    createdBy: _emberData['default'].attr('string'),
    date: _emberData['default'].attr('date'),
    /* custom list of noteTypes of mixins/patient-note-types */
    noteType: _emberData['default'].attr(),
    /* who is this note about? */
    patient: _emberData['default'].belongsTo('patient', { async: false }),
    /* if this note is related to a visit, make sure it's noted. */
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    authoredBy: computed('attribution', 'createdBy', function () {
      if (!_ember['default'].isEmpty(this.get('attribution'))) {
        var i18n = this.get('i18n');
        return this.get('createdBy') + ' ' + i18n.t('patients.notes.onBehalfOfCopy') + ' ' + this.get('attribution');
      } else {
        return this.get('createdBy');
      }
    }),

    validations: {
      patient: {
        presence: true
      },
      visit: {
        presence: true
      },
      content: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/patient-note.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/patient-note.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/patient-note.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/patient', ['exports', 'hospitalrun/models/abstract', 'hospitalrun/mixins/dob-days', 'hospitalrun/utils/email-validation', 'ember', 'ember-data', 'hospitalrun/mixins/patient-name'], function (exports, _hospitalrunModelsAbstract, _hospitalrunMixinsDobDays, _hospitalrunUtilsEmailValidation, _ember, _emberData, _hospitalrunMixinsPatientName) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsDobDays['default'], _hospitalrunMixinsPatientName['default'], {
    // Attributes
    admitted: _emberData['default'].attr('boolean', { defaultValue: false }),
    additionalContacts: _emberData['default'].attr(),
    address: _emberData['default'].attr('string'),
    address2: _emberData['default'].attr('string'),
    address3: _emberData['default'].attr('string'),
    address4: _emberData['default'].attr('string'),
    bloodType: _emberData['default'].attr('string'),
    clinic: _emberData['default'].attr('string'),
    country: _emberData['default'].attr('string'),
    checkedIn: _emberData['default'].attr('boolean', { defaultValue: false }),
    customForms: _emberData['default'].attr('custom-forms'),
    dateOfBirth: _emberData['default'].attr('date'),
    economicClassification: _emberData['default'].attr('string'),
    email: _emberData['default'].attr('string'),
    expenses: _emberData['default'].attr(),
    externalPatientId: _emberData['default'].attr('string'),
    familySupport1: _emberData['default'].attr('string'),
    familySupport2: _emberData['default'].attr('string'),
    familySupport3: _emberData['default'].attr('string'),
    familySupport4: _emberData['default'].attr('string'),
    familySupport5: _emberData['default'].attr('string'),
    friendlyId: _emberData['default'].attr('string'),
    familyInfo: _emberData['default'].attr(),
    firstName: _emberData['default'].attr('string'),
    sex: _emberData['default'].attr('string'),
    occupation: _emberData['default'].attr('string'),
    history: _emberData['default'].attr('string'), // No longer used
    insurance: _emberData['default'].attr('string'),
    lastName: _emberData['default'].attr('string'),
    livingArrangement: _emberData['default'].attr('string'),
    middleName: _emberData['default'].attr('string'),
    notes: _emberData['default'].attr('string'),
    otherIncome: _emberData['default'].attr('string'),
    patientType: _emberData['default'].attr('string'),
    parent: _emberData['default'].attr('string'),
    phone: _emberData['default'].attr('string'),
    placeOfBirth: _emberData['default'].attr('string'),
    referredDate: _emberData['default'].attr('date'),
    referredBy: _emberData['default'].attr('string'),
    religion: _emberData['default'].attr('string'),
    socialActionTaken: _emberData['default'].attr('string'),
    socialRecommendation: _emberData['default'].attr('string'),
    status: _emberData['default'].attr('string'),
    // Associations
    allergies: _emberData['default'].hasMany('allergy', { async: true }),
    diagnoses: _emberData['default'].hasMany('diagnosis', { async: false }),
    operationReports: _emberData['default'].hasMany('operation-report', { async: true }),
    operativePlans: _emberData['default'].hasMany('operative-plan', { async: true }),
    payments: _emberData['default'].hasMany('payment', { async: true }),
    paymentProfile: _emberData['default'].belongsTo('price-profile', { async: false }),

    age: computed('dateOfBirth', function () {
      var dob = get(this, 'dateOfBirth');
      return this.convertDOBToText(dob);
    }),

    displayAddress: computed('address', 'address2', 'address3', 'address4', function () {
      var addressFields = this.getProperties('address', 'address2', 'address3', 'address4');
      var displayAddress = '';
      for (var prop in addressFields) {
        if (!_ember['default'].isEmpty(addressFields[prop])) {
          if (!_ember['default'].isEmpty(displayAddress)) {
            displayAddress += ', ';
          }
          displayAddress += addressFields[prop];
        }
      }
      return displayAddress;
    }),

    displayName: computed('firstName', 'lastName', 'middleName', function () {
      return this.getPatientDisplayName(this);
    }),

    displayPatientId: computed('id', 'externalPatientId', 'friendlyId', function () {
      return this.getPatientDisplayId(this);
    }),

    shortAge: computed('dateOfBirth', function () {
      var dob = get(this, 'dateOfBirth');
      return this.convertDOBToText(dob, true);
    }),

    shortDisplayName: computed('firstName', 'lastName', function () {
      return this.getPatientDisplayName(this, true);
    }),

    validations: {
      email: {
        format: {
          'with': _hospitalrunUtilsEmailValidation['default'].emailRegex,
          allowBlank: true,
          message: 'please enter a valid email address'
        }
      },
      firstName: {
        presence: true
      },
      lastName: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/patient.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/patient.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/patient.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/payment', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    amount: _emberData['default'].attr('number'),
    /* Is patient a charity case */
    charityPatient: _emberData['default'].attr('boolean'),
    datePaid: _emberData['default'].attr('date'),
    expenseAccount: _emberData['default'].attr('string'),
    notes: _emberData['default'].attr('string'),
    paymentType: _emberData['default'].attr('string'),

    // Associations
    invoice: _emberData['default'].belongsTo('invoice', { async: false }),

    canRemovePayment: computed('paymentType', function () {
      return get(this, 'paymentType') === 'Deposit';
    }),

    validations: {
      amount: {
        numericality: true
      },
      datePaid: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/payment.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/payment.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/payment.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/photo', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember) {
  'use strict';

  var attr = _emberData['default'].attr;
  var belongsTo = _emberData['default'].belongsTo;
  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    /* Temporarily store file as attachment until it gets uploaded to the server */
    caption: attr('string'),
    coverImage: attr('boolean'),
    files: attr('attachments', {
      defaultValue: function defaultValue() {
        return [];
      }
    }),
    fileName: attr('string'),
    isImage: _emberData['default'].attr('boolean', { defaultValue: false }),
    localFile: _emberData['default'].attr('boolean', { defaultValue: false }),
    url: attr('string'),

    // Associations
    patient: belongsTo('patient', { async: false }),

    shortFileName: computed('fileName', function () {
      var fileName = get(this, 'fileName');
      if (!isEmpty(fileName)) {
        fileName = fileName.substr(fileName.lastIndexOf('/') + 1);
      }
      return fileName;
    })
  });
});
define('hospitalrun/tests/models/photo.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/photo.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/photo.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/price-profile', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    name: _emberData['default'].attr('string'),
    discountAmount: _emberData['default'].attr('number'),
    discountPercentage: _emberData['default'].attr('number'),
    setFee: _emberData['default'].attr('number'),

    validations: {
      name: {
        presence: true
      },
      discountAmount: {
        numericality: {
          allowBlank: true
        }
      },
      discountPercentage: {
        numericality: {
          allowBlank: true
        }
      },
      setFee: {
        numericality: {
          allowBlank: true
        }
      }
    }
  });
});
define('hospitalrun/tests/models/price-profile.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/price-profile.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/price-profile.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/pricing', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    category: _emberData['default'].attr('string'),
    expenseAccount: _emberData['default'].attr('string'),
    name: _emberData['default'].attr('string'),
    price: _emberData['default'].attr('number'),
    pricingType: _emberData['default'].attr('string'),

    // Associations
    pricingOverrides: _emberData['default'].hasMany('override-price', { async: false }),

    validations: {
      category: {
        presence: true
      },
      name: {
        presence: true
      },
      price: {
        numericality: true
      }
    }
  });
});
define('hospitalrun/tests/models/pricing.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/pricing.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/pricing.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/proc-charge', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'hospitalrun/mixins/medication-details'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _hospitalrunMixinsMedicationDetails) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;

  /**
   * Procedure charges
   */
  exports['default'] = _hospitalrunModelsAbstract['default'].extend(_hospitalrunMixinsMedicationDetails['default'], {
    // Attributes
    quantity: _emberData['default'].attr('number'),
    dateCharged: _emberData['default'].attr('date'),

    // Associations
    medication: _emberData['default'].belongsTo('inventory', { async: false }),
    pricingItem: _emberData['default'].belongsTo('pricing', { async: false }),

    medicationCharge: computed('medication', 'newMedicationCharge', function () {
      var medication = get(this, 'medication');
      var newMedicationCharge = get(this, 'newMedicationCharge');
      return !_ember['default'].isEmpty(medication) || !_ember['default'].isEmpty(newMedicationCharge);
    }),

    medicationName: computed('medication', function () {
      return this.get('medication.name');
    }),

    medicationPrice: computed('medication', function () {
      return this.get('medication.price');
    }),

    validations: {
      itemName: {
        presence: true,
        acceptance: {
          accept: true,
          'if': function _if(object) {
            var medicationCharge = get(object, 'medicationCharge');
            if (!medicationCharge || !get(object, 'hasDirtyAttributes')) {
              return false;
            }
            var itemName = get(object, 'inventoryItem.name');
            var itemTypeAhead = get(object, 'itemName');
            if (_ember['default'].isEmpty(itemName) || _ember['default'].isEmpty(itemTypeAhead)) {
              // force validation to fail
              return true;
            } else {
              var typeAheadName = itemTypeAhead.substr(0, itemName.length);
              if (itemName !== typeAheadName) {
                return true;
              }
            }
            // Inventory item is properly selected; don't do any further validation
            return false;
          },
          message: 'Please select a valid medication'
        }

      },

      quantity: {
        numericality: {
          greaterThan: 0,
          messages: {
            greaterThan: 'must be greater than 0'
          }
        }
      }
    }
  });
});
define('hospitalrun/tests/models/proc-charge.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/proc-charge.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/proc-charge.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/procedure', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    anesthesiaType: _emberData['default'].attr('string'),
    anesthesiologist: _emberData['default'].attr('string'),
    assistant: _emberData['default'].attr('string'),
    description: _emberData['default'].attr('string'),
    cptCode: _emberData['default'].attr('string'),
    location: _emberData['default'].attr('string'),
    notes: _emberData['default'].attr('string'),
    physician: _emberData['default'].attr('string'),
    procedureDate: _emberData['default'].attr('date'),
    timeStarted: _emberData['default'].attr('string'),
    timeEnded: _emberData['default'].attr('string'),

    // Associations
    charges: _emberData['default'].hasMany('proc-charge', { async: false }),
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    validations: {
      description: {
        presence: true
      },

      oxygenHours: {
        numericality: {
          allowBlank: true
        }
      },
      pacuHours: {
        numericality: {
          allowBlank: true
        }
      },
      physician: {
        presence: true
      },
      procedureDate: {
        presence: true
      },
      display_procedureDate: {
        presence: {
          message: 'Please select a valid date'
        }
      }
    }
  });
});
define('hospitalrun/tests/models/procedure.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/procedure.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/procedure.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/report', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    reportDate: _emberData['default'].attr('date'),
    customForms: _emberData['default'].attr('custom-forms'),
    reportType: _emberData['default'].attr('string'),

    // Associations
    visit: _emberData['default'].belongsTo('visit', { async: false }),

    validations: {
      visit: {
        presence: true
      },

      reportDate: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/report.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/report.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/report.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/sequence', ['exports', 'ember-pouch', 'ember-data'], function (exports, _emberPouch, _emberData) {
  'use strict';

  exports['default'] = _emberPouch.Model.extend({
    // Attributes
    prefix: _emberData['default'].attr('string'),
    value: _emberData['default'].attr('number')
  });
});
define('hospitalrun/tests/models/sequence.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/sequence.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/sequence.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/social-expense', ['exports', 'ember-data', 'ember-validations', 'ember-pouch'], function (exports, _emberData, _emberValidations, _emberPouch) {
  /**
   * Model for social worker family info
   */
  'use strict';

  exports['default'] = _emberPouch.Model.extend(_emberValidations['default'], {
    // Attributes
    category: _emberData['default'].attr('string'),
    sources: _emberData['default'].attr('string'),
    cost: _emberData['default'].attr(),

    validations: {
      category: {
        presence: true
      },
      cost: {
        numericality: true
      }
    }
  });
});
define('hospitalrun/tests/models/social-expense.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/social-expense.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/social-expense.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/text-expansion', ['exports', 'ember-data', 'ember-validations', 'ember-pouch'], function (exports, _emberData, _emberValidations, _emberPouch) {
  'use strict';

  exports['default'] = _emberPouch.Model.extend(_emberValidations['default'], {
    from: _emberData['default'].attr('string'),
    to: _emberData['default'].attr('string'),

    validations: {
      from: {
        presence: true
      },
      to: {
        presence: true
      }
    }
  });
});
define('hospitalrun/tests/models/text-expansion.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/text-expansion.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/text-expansion.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/user-role', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    name: _emberData['default'].attr('string'),
    capabilities: _emberData['default'].attr(),
    navRoute: _emberData['default'].attr()
  });
});
define('hospitalrun/tests/models/user-role.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/user-role.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/user-role.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/user', ['exports', 'ember-data', 'hospitalrun/utils/email-validation', 'ember', 'ember-validations'], function (exports, _emberData, _hospitalrunUtilsEmailValidation, _ember, _emberValidations) {
  'use strict';

  var computed = _ember['default'].computed;

  var User = _emberData['default'].Model.extend(_emberValidations['default'], {
    // Attributes
    derived_key: _emberData['default'].attr('string'),
    deleted: _emberData['default'].attr('boolean'),
    displayName: _emberData['default'].attr('string'),
    email: _emberData['default'].attr('string'),
    iterations: _emberData['default'].attr(),
    name: _emberData['default'].attr('string'),
    password: _emberData['default'].attr('string'),
    password_scheme: _emberData['default'].attr('string'),
    password_sha: _emberData['default'].attr('string'),
    rev: _emberData['default'].attr('string'),
    roles: _emberData['default'].attr(),
    salt: _emberData['default'].attr('string'),
    userPrefix: _emberData['default'].attr('string'),

    displayRole: computed('roles', function () {
      var roles = this.get('roles');
      if (!_ember['default'].isEmpty(roles)) {
        return roles[0];
      }
    }),

    validations: {
      email: {
        format: {
          'with': _hospitalrunUtilsEmailValidation['default'].emailRegex,
          message: 'Please, enter a valid email address'
        }
      }
    }
  });

  exports['default'] = User;
});
define('hospitalrun/tests/models/user.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/user.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/user.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/visit', ['exports', 'hospitalrun/models/abstract', 'ember-data', 'ember', 'moment'], function (exports, _hospitalrunModelsAbstract, _emberData, _ember, _moment) {
  'use strict';

  function dateAcceptance(object) {
    if (!object.get('hasDirtyAttributes')) {
      return false;
    }
    var startDate = object.get('startDate');
    var endDate = object.get('endDate');
    if (_ember['default'].isEmpty(endDate) || _ember['default'].isEmpty(startDate)) {
      // Can't validate if empty
      return false;
    } else {
      if (endDate.getTime() < startDate.getTime()) {
        return true;
      }
    }
    return false;
  }

  var computed = _ember['default'].computed;

  var PAYMENT_STATES = {
    CLEAR: 'clear',
    PENDING: 'pending'
  };
  var COMPLETED_STATUS = 'Completed';
  var FULFILLED_STATUS = 'Fulfilled';
  var REQUESTED_STATUS = 'Requested';
  var STATUS_FIELD = 'status';

  function paymentStateAcceptance(object) {
    return !Object.keys(PAYMENT_STATES).some(function (state) {
      return PAYMENT_STATES[state] === object.get('paymentState');
    });
  }

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    additionalDiagnoses: _emberData['default'].attr(), // Yes, the plural of diagnosis is diagnoses!
    charges: _emberData['default'].hasMany('proc-charge', {
      async: false
    }),
    customForms: _emberData['default'].attr('custom-forms'),
    diagnoses: _emberData['default'].hasMany('diagnosis', { async: false }),
    dischargeInfo: _emberData['default'].attr('string'),
    endDate: _emberData['default'].attr('date'), // if visit type is outpatient, startDate and endDate are equal
    examiner: _emberData['default'].attr('string'),
    hasAppointment: _emberData['default'].attr('boolean', { defaultValue: false }),
    history: _emberData['default'].attr('string'), // No longer used
    historySince: _emberData['default'].attr('string'), // History of the Present Illness -- no longer used
    imaging: _emberData['default'].hasMany('imaging', { async: true }),
    labs: _emberData['default'].hasMany('lab', { async: true }),
    location: _emberData['default'].attr('string'),
    medication: _emberData['default'].hasMany('medication', { async: true }),
    // this field is being deprecated in favor of patient-note
    notes: _emberData['default'].attr('string'),
    patientNotes: _emberData['default'].hasMany('patient-note', { async: true }),
    outPatient: _emberData['default'].attr('boolean'),
    patient: _emberData['default'].belongsTo('patient', {
      async: false
    }),
    paymentState: _emberData['default'].attr('string', { defaultValue: PAYMENT_STATES.PENDING }),
    primaryDiagnosis: _emberData['default'].attr('string'), // No longer used -- diagnoses are stored in diagnoses hasMany relationship
    primaryBillingDiagnosis: _emberData['default'].attr('string'), // AKA final diagnosis
    primaryBillingDiagnosisId: _emberData['default'].attr('string'),
    procedures: _emberData['default'].hasMany('procedure', { async: true }),
    reasonForVisit: _emberData['default'].attr('string'),
    startDate: _emberData['default'].attr('date'),
    status: _emberData['default'].attr('string'),
    visitType: _emberData['default'].attr(),
    vitals: _emberData['default'].hasMany('vital', { async: true }),
    reports: _emberData['default'].hasMany('report', { async: true }),

    diagnosisList: computed('diagnoses.[]', function () {
      var diagnoses = this.get('diagnoses');
      var diagnosisList = diagnoses.map(function (diagnosis) {
        return diagnosis.get('diagnosis');
      });
      return diagnosisList;
    }),

    hasAppointmentLabel: computed('hasAppointment', function () {
      var hasAppointment = this.get('hasAppointment');
      var i18n = this.get('i18n');
      if (hasAppointment === true) {
        return i18n.t('visits.labels.haveAppointment');
      } else {
        return i18n.t('visits.labels.noAppointment');
      }
    }),

    hasCompletedImaging: computed('imaging.@each.status', function () {
      var imaging = this.get('imaging');
      return imaging.isAny(STATUS_FIELD, COMPLETED_STATUS);
    }),

    hasCompletedLabs: computed('labs.@each.status', function () {
      var labs = this.get('labs');
      return labs.isAny(STATUS_FIELD, COMPLETED_STATUS);
    }),

    hasCompletedMedication: computed('medication.@each.status', function () {
      var medication = this.get('medication');
      return medication.isAny(STATUS_FIELD, FULFILLED_STATUS);
    }),

    hasDoneOrders: computed('imaging.@each.status', 'labs.@each.status', function () {
      var i18n = this.get('i18n');
      var imaging = this.get('imaging');
      var labs = this.get('labs');
      if (imaging.isAny(STATUS_FIELD, REQUESTED_STATUS) || labs.isAny(STATUS_FIELD, REQUESTED_STATUS)) {
        return i18n.t('visits.labels.ordersNotDone');
      } else {
        return i18n.t('visits.labels.haveDoneOrders');
      }
    }),

    primaryDiagnoses: computed('diagnoses.[].secondaryDiagnosis', function () {
      var diagnoses = this.get('diagnoses');
      var diagnosisList = diagnoses.filterBy('secondaryDiagnosis', false).map(function (diagnosis) {
        return diagnosis.get('diagnosis');
      });
      return diagnosisList.join(', ');
    }),

    visitDate: (function () {
      var endDate = this.get('endDate');
      var startDate = (0, _moment['default'])(this.get('startDate'));
      var visitDate = startDate.format('l');
      if (!_ember['default'].isEmpty(endDate) && !startDate.isSame(endDate, 'day')) {
        visitDate += ' - ' + (0, _moment['default'])(endDate).format('l');
      }
      return visitDate;
    }).property('startDate', 'endDate'),

    visitDescription: (function () {
      var visitDate = this.get('visitDate');
      var visitType = this.get('visitType');
      return visitDate + ' (' + visitType + ')';
    }).property('visitDate', 'visitType'),

    validations: {
      endDate: {
        acceptance: {
          accept: true,
          'if': dateAcceptance,
          message: 'Please select an end date later than the start date'
        }
      },
      patientTypeAhead: {
        presence: {
          'if': function _if(object) {
            return object.get('checkIn') && !object.get('hidePatientSelection');
          }
        }
      },
      paymentState: {
        acceptance: {
          accept: true,
          'if': paymentStateAcceptance
        },
        presence: true
      },
      startDate: {
        acceptance: {
          accept: true,
          'if': dateAcceptance,
          message: 'Please select a start date earlier than the end date'
        },
        presence: true
      },
      visitType: {
        presence: true
      }

    }

  });
});
define('hospitalrun/tests/models/visit.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/visit.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/visit.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/models/vital', ['exports', 'hospitalrun/models/abstract', 'ember-data'], function (exports, _hospitalrunModelsAbstract, _emberData) {
  'use strict';

  exports['default'] = _hospitalrunModelsAbstract['default'].extend({
    // Attributes
    dateRecorded: _emberData['default'].attr('date'),
    dbp: _emberData['default'].attr('number'),
    heartRate: _emberData['default'].attr('number'),
    height: _emberData['default'].attr('string'),
    respiratoryRate: _emberData['default'].attr('number'),
    sbp: _emberData['default'].attr('number'),
    temperature: _emberData['default'].attr('number'),
    weight: _emberData['default'].attr('string'),

    validations: {
      temperature: {
        numericality: true
      },
      sbp: {
        numericality: true
      },
      dbp: {
        numericality: true
      },
      heartRate: {
        numericality: true
      },
      respiratoryRate: {
        numericality: true
      }
    }
  });
});
define('hospitalrun/tests/models/vital.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - models/vital.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'models/vital.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/add-contact/controller', ['exports', 'ember', 'hospitalrun/mixins/is-update-disabled', 'ember-i18n'], function (exports, _ember, _hospitalrunMixinsIsUpdateDisabled, _emberI18n) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsIsUpdateDisabled['default'], {
    patientsEdit: _ember['default'].inject.controller('patients/edit'),
    editController: _ember['default'].computed.alias('patientsEdit'),
    title: (0, _emberI18n.translationMacro)('patients.titles.addContact'),
    updateButtonText: (0, _emberI18n.translationMacro)('buttons.add'),
    updateButtonAction: 'add',
    showUpdateButton: true,

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      add: function add() {
        var newContact = this.getProperties('name', 'phone', 'email', 'relationship');
        this.get('editController').send('addContact', newContact);
      }
    }
  });
});
define('hospitalrun/tests/patients/add-contact/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/add-contact/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/add-contact/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/admitted/controller', ['exports', 'hospitalrun/patients/index/controller'], function (exports, _hospitalrunPatientsIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPatientsIndexController['default'].extend({});
});
define('hospitalrun/tests/patients/admitted/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/admitted/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/admitted/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/admitted/route', ['exports', 'ember-i18n', 'hospitalrun/patients/index/route'], function (exports, _emberI18n, _hospitalrunPatientsIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunPatientsIndexRoute['default'].extend({
    pageTitle: (0, _emberI18n.translationMacro)('patients.titles.admittedPatients'),

    _modelQueryParams: function _modelQueryParams() {
      return {
        mapReduce: 'patient_by_admission'
      };
    }
  });
});
define('hospitalrun/tests/patients/admitted/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/admitted/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/admitted/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'hospitalrun/mixins/patient-visits', 'hospitalrun/mixins/patient-appointments', 'hospitalrun/mixins/patient-invoices', 'hospitalrun/mixins/pouchdb', 'hospitalrun/mixins/progress-dialog', 'ember', 'ember-i18n', 'ember-concurrency'], function (exports, _hospitalrunControllersAbstractDeleteController, _hospitalrunMixinsPatientVisits, _hospitalrunMixinsPatientAppointments, _hospitalrunMixinsPatientInvoices, _hospitalrunMixinsPouchdb, _hospitalrunMixinsProgressDialog, _ember, _emberI18n, _emberConcurrency) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend(_hospitalrunMixinsPatientVisits['default'], _hospitalrunMixinsPatientInvoices['default'], _hospitalrunMixinsPouchdb['default'], _hospitalrunMixinsProgressDialog['default'], _hospitalrunMixinsPatientAppointments['default'], {
    title: (0, _emberI18n.translationMacro)('patients.titles.delete'),
    progressTitle: (0, _emberI18n.translationMacro)('patients.titles.deletePatientRecord'),
    progressMessage: (0, _emberI18n.translationMacro)('patients.messages.deletingPatient'),
    deleting: (0, _emberConcurrency.taskGroup)(),

    deleteMany: function deleteMany(manyArray) {
      return this.get('deleteManyTask').perform(manyArray);
    },

    deleteManyTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(manyArray) {
      var resolvedArray, deleteRecordTask, archivePromises;
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            if (manyArray) {
              context$1$0.next = 2;
              break;
            }

            return context$1$0.abrupt('return');

          case 2:
            context$1$0.next = 4;
            return manyArray;

          case 4:
            resolvedArray = context$1$0.sent;

            if (!_ember['default'].isEmpty(resolvedArray)) {
              context$1$0.next = 7;
              break;
            }

            return context$1$0.abrupt('return');

          case 7:
            deleteRecordTask = this.get('deleteRecordTask');
            archivePromises = [];

            resolvedArray.forEach(function (recordToDelete) {
              archivePromises.push(deleteRecordTask.perform(recordToDelete));
            });
            context$1$0.next = 12;
            return (0, _emberConcurrency.all)(archivePromises, 'async array deletion');

          case 12:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 13:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    })).group('deleting'),

    deleteRecordTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(recordToDelete) {
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            recordToDelete.set('archived', true);
            context$1$0.next = 3;
            return recordToDelete.save();

          case 3:
            context$1$0.next = 5;
            return recordToDelete.unloadRecord();

          case 5:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 6:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    })).group('deleting'),

    // Override delete action on controller; we must delete
    // all related records before deleting patient record
    // otherwise errors will occur
    deletePatient: function deletePatient() {
      return this.get('deletePatientTask').perform();
    },

    deletePatientTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0() {
      var patient, visits, invoices, appointments, payments;
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            patient = this.get('model');
            context$1$0.next = 3;
            return this.getPatientVisits(patient);

          case 3:
            visits = context$1$0.sent;
            context$1$0.next = 6;
            return this.getPatientInvoices(patient);

          case 6:
            invoices = context$1$0.sent;
            context$1$0.next = 9;
            return this.getPatientAppointments(patient);

          case 9:
            appointments = context$1$0.sent;
            context$1$0.next = 12;
            return patient.get('payments');

          case 12:
            payments = context$1$0.sent;
            context$1$0.next = 15;
            return (0, _emberConcurrency.all)([this.deleteVisits(visits), this.deleteInvoices(invoices), this.deleteMany(appointments), this.deleteMany(payments)]);

          case 15:
            context$1$0.next = 17;
            return patient.destroyRecord();

          case 17:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 18:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    })).group('deleting'),

    deleteVisits: function deleteVisits(visits) {
      return this.get('deleteVisitsTask').perform(visits);
    },

    deleteVisitsTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(visits) {
      var pendingTasks;
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        var _this = this;

        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            pendingTasks = [];

            visits.forEach(function (visit) {
              var labs = visit.get('labs');
              var procedures = visit.get('procedures');
              var imaging = visit.get('imaging');
              var procCharges = procedures.get('charges');
              var labCharges = labs.get('charges');
              var imagingCharges = imaging.get('charges');
              var visitCharges = visit.get('charges');
              pendingTasks.push(_this.deleteMany(labs));
              pendingTasks.push(_this.deleteMany(labCharges));
              pendingTasks.push(_this.deleteMany(visit.get('patientNotes')));
              pendingTasks.push(_this.deleteMany(visit.get('vitals')));
              pendingTasks.push(_this.deleteMany(procedures));
              pendingTasks.push(_this.deleteMany(procCharges));
              pendingTasks.push(_this.deleteMany(visit.get('medication')));
              pendingTasks.push(_this.deleteMany(imaging));
              pendingTasks.push(_this.deleteMany(imagingCharges));
              pendingTasks.push(_this.deleteMany(visitCharges));
            });
            context$1$0.next = 4;
            return (0, _emberConcurrency.all)(pendingTasks);

          case 4:
            context$1$0.next = 6;
            return this.deleteMany(visits);

          case 6:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 7:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    })).group('deleting'),

    deleteInvoices: function deleteInvoices(patientInvoices) {
      return this.get('deleteInvoicesTask').perform(patientInvoices);
    },

    deleteInvoicesTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(patientInvoices) {
      var invoices, lineItems, lineItemDetails;
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            context$1$0.next = 2;
            return patientInvoices;

          case 2:
            invoices = context$1$0.sent;
            context$1$0.next = 5;
            return (0, _emberConcurrency.all)(invoices.mapBy('lineItems'));

          case 5:
            lineItems = context$1$0.sent;
            context$1$0.next = 8;
            return (0, _emberConcurrency.all)(lineItems.mapBy('details'));

          case 8:
            lineItemDetails = context$1$0.sent;
            context$1$0.next = 11;
            return (0, _emberConcurrency.all)([this.deleteMany(invoices), this.deleteMany(lineItems), this.deleteMany(lineItemDetails)]);

          case 11:
            return context$1$0.abrupt('return', context$1$0.sent);

          case 12:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    })).group('deleting'),

    deleteActionTask: (0, _emberConcurrency.task)(regeneratorRuntime.mark(function callee$0$0(patient) {
      return regeneratorRuntime.wrap(function callee$0$0$(context$1$0) {
        while (1) switch (context$1$0.prev = context$1$0.next) {
          case 0:
            // delete related records without modal dialogs
            this.send('closeModal');
            this.showProgressModal();
            context$1$0.next = 4;
            return this.deletePatient(patient);

          case 4:
            this.closeProgressModal();
            this.send(this.get('afterDeleteAction'), patient);

          case 6:
          case 'end':
            return context$1$0.stop();
        }
      }, callee$0$0, this);
    })).drop(),

    actions: {
      'delete': function _delete(patient) {
        this.get('deleteActionTask').perform(patient);
      }
    }
  });
});

// empty array: no records to delete
define('hospitalrun/tests/patients/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/allergy-actions', 'hospitalrun/mixins/blood-types', 'hospitalrun/mixins/diagnosis-actions', 'ember', 'hospitalrun/mixins/patient-id', 'hospitalrun/mixins/patient-notes', 'hospitalrun/mixins/return-to', 'hospitalrun/utils/select-values', 'hospitalrun/mixins/user-session', 'hospitalrun/utils/visit-statuses', 'hospitalrun/mixins/patient-visits'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsAllergyActions, _hospitalrunMixinsBloodTypes, _hospitalrunMixinsDiagnosisActions, _ember, _hospitalrunMixinsPatientId, _hospitalrunMixinsPatientNotes, _hospitalrunMixinsReturnTo, _hospitalrunUtilsSelectValues, _hospitalrunMixinsUserSession, _hospitalrunUtilsVisitStatuses, _hospitalrunMixinsPatientVisits) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsAllergyActions['default'], _hospitalrunMixinsBloodTypes['default'], _hospitalrunMixinsDiagnosisActions['default'], _hospitalrunMixinsReturnTo['default'], _hospitalrunMixinsUserSession['default'], _hospitalrunMixinsPatientId['default'], _hospitalrunMixinsPatientNotes['default'], _hospitalrunMixinsPatientVisits['default'], {

    canAddAppointment: (function () {
      return this.currentUserCan('add_appointment');
    }).property(),

    canAddContact: (function () {
      return this.currentUserCan('add_patient');
    }).property(),

    canAddImaging: (function () {
      return this.currentUserCan('add_imaging');
    }).property(),

    canAddLab: (function () {
      return this.currentUserCan('add_lab');
    }).property(),

    canAddMedication: (function () {
      return this.currentUserCan('add_medication');
    }).property(),

    canAddPhoto: (function () {
      var isFileSystemEnabled = this.get('isFileSystemEnabled');
      return this.currentUserCan('add_photo') && isFileSystemEnabled;
    }).property(),

    canAddSocialWork: (function () {
      return this.currentUserCan('add_socialwork');
    }).property(),

    canAddVisit: (function () {
      return this.currentUserCan('add_visit');
    }).property(),

    canDeleteAppointment: (function () {
      return this.currentUserCan('delete_appointment');
    }).property(),

    canDeleteContact: (function () {
      return this.currentUserCan('add_patient');
    }).property(),

    canDeleteImaging: (function () {
      return this.currentUserCan('delete_imaging');
    }).property(),

    canDeleteLab: (function () {
      return this.currentUserCan('delete_lab');
    }).property(),

    canDeleteMedication: (function () {
      return this.currentUserCan('delete_medication');
    }).property(),

    canDeletePhoto: (function () {
      return this.currentUserCan('delete_photo');
    }).property(),

    canDeleteSocialWork: (function () {
      return this.currentUserCan('delete_socialwork');
    }).property(),

    canDeleteVisit: (function () {
      return this.currentUserCan('delete_visit');
    }).property(),

    patientTypes: _ember['default'].computed(function () {
      var i18n = get(this, 'i18n');
      var types = ['Charity', 'Private'];
      return types.map(function (type) {
        return i18n.t('patients.labels.patientType' + type);
      });
    }),

    config: _ember['default'].inject.service(),
    filesystem: _ember['default'].inject.service(),
    database: _ember['default'].inject.service(),
    patientController: _ember['default'].inject.controller('patients'),

    addressOptions: _ember['default'].computed.alias('patientController.addressOptions'),
    address1Include: _ember['default'].computed.alias('patientController.addressOptions.value.address1Include'),
    address1Label: _ember['default'].computed.alias('patientController.addressOptions.value.address1Label'),
    address2Include: _ember['default'].computed.alias('patientController.addressOptions.value.address2Include'),
    address2Label: _ember['default'].computed.alias('patientController.addressOptions.value.address2Label'),
    address3Include: _ember['default'].computed.alias('patientController.addressOptions.value.address3Include'),
    address3Label: _ember['default'].computed.alias('patientController.addressOptions.value.address3Label'),
    address4Include: _ember['default'].computed.alias('patientController.addressOptions.value.address4Include'),
    address4Label: _ember['default'].computed.alias('patientController.addressOptions.value.address4Label'),

    clinicList: _ember['default'].computed.alias('patientController.clinicList'),
    countryList: _ember['default'].computed.alias('patientController.countryList'),
    diagnosisList: _ember['default'].computed.alias('patientController.diagnosisList'),
    isFileSystemEnabled: _ember['default'].computed.alias('filesystem.isFileSystemEnabled'),
    pricingProfiles: _ember['default'].computed.map('patientController.pricingProfiles', _hospitalrunUtilsSelectValues['default'].selectObjectMap),
    sexList: _ember['default'].computed.alias('patientController.sexList'),
    statusList: _ember['default'].computed.alias('patientController.statusList'),

    haveAdditionalContacts: (function () {
      var additionalContacts = this.get('model.additionalContacts');
      return !_ember['default'].isEmpty(additionalContacts);
    }).property('model.additionalContacts'),

    haveAddressOptions: (function () {
      var addressOptions = this.get('addressOptions');
      return !_ember['default'].isEmpty(addressOptions);
    }).property('addressOptions'),

    lookupListsToUpdate: [{
      name: 'countryList',
      property: 'model.country',
      id: 'country_list'
    }, {
      name: 'clinicList',
      property: 'model.clinic',
      id: 'clinic_list'
    }, {
      name: 'sexList',
      property: 'model.sex',
      id: 'sex'
    }, {
      name: 'statusList',
      property: 'model.status',
      id: 'patient_status_list'
    }],

    patientImaging: (function () {
      return this.getVisitCollection('imaging');
    }).property('model.visits.[].imaging'),

    patientLabs: (function () {
      return this.getVisitCollection('labs');
    }).property('model.visits.[].labs'),

    patientMedications: (function () {
      return this.getVisitCollection('medication');
    }).property('model.visits.[].medication'),

    patientProcedures: (function () {
      var visits = this.get('model.visits');
      var operationReports = get(this, 'model.operationReports');
      return this._getPatientProcedures(operationReports, visits);
    }).property('model.visits.[].procedures', 'model.operationReports.[].procedures'),

    showExpenseTotal: (function () {
      var expenses = this.get('model.expenses');
      return !_ember['default'].isEmpty(expenses);
    }).property('model.expenses.[]'),

    totalExpenses: (function () {
      var expenses = this.get('model.expenses');
      if (!_ember['default'].isEmpty(expenses)) {
        var total = expenses.reduce(function (previousValue, expense) {
          if (!_ember['default'].isEmpty(expense.cost)) {
            return previousValue + parseInt(expense.cost);
          }
        }, 0);
        return total;
      }
    }).property('model.expenses.@each.cost'),

    updateCapability: 'add_patient',

    actions: {
      addAllergy: function addAllergy(newAllergy) {
        var patient = get(this, 'model');
        this.savePatientAllergy(patient, newAllergy);
      },

      addContact: function addContact(newContact) {
        var additionalContacts = this.getWithDefault('model.additionalContacts', []);
        var model = this.get('model');
        additionalContacts.addObject(newContact);
        model.set('additionalContacts', additionalContacts);
        this.send('update', true);
        this.send('closeModal');
      },

      addDiagnosis: function addDiagnosis(newDiagnosis) {
        var diagnoses = this.get('model.diagnoses');
        diagnoses.addObject(newDiagnosis);
        this.send('update', true);
        this.send('closeModal');
      },

      returnToPatient: function returnToPatient() {
        this.transitionToRoute('patients.index');
      },
      /**
       * Add the specified photo to the patient's record.
       */
      addPhoto: function addPhoto(savedPhotoRecord) {
        var photos = this.get('model.photos');
        photos.addObject(savedPhotoRecord);
        this.send('closeModal');
      },

      appointmentDeleted: function appointmentDeleted(deletedAppointment) {
        var appointments = this.get('model.appointments');
        appointments.removeObject(deletedAppointment);
        this.send('closeModal');
      },

      deleteAllergy: function deleteAllergy(allergy) {
        var patient = get(this, 'model');
        this.deletePatientAllergy(patient, allergy);
      },

      deleteContact: function deleteContact(model) {
        var contact = model.get('contactToDelete');
        var additionalContacts = this.get('model.additionalContacts');
        additionalContacts.removeObject(contact);
        this.send('update', true);
      },

      deleteExpense: function deleteExpense(model) {
        var expense = model.get('expenseToDelete');
        var expenses = this.get('model.expenses');
        expenses.removeObject(expense);
        this.send('update', true);
      },

      deleteFamily: function deleteFamily(model) {
        var family = model.get('familyToDelete');
        var familyInfo = this.get('model.familyInfo');
        familyInfo.removeObject(family);
        this.send('update', true);
      },

      deletePhoto: function deletePhoto(model) {
        var photo = model.get('photoToDelete');
        var photoId = photo.get('id');
        var photos = this.get('model.photos');
        var filePath = photo.get('fileName');
        photos.removeObject(photo);
        photo.destroyRecord().then((function () {
          var fileSystem = this.get('filesystem');
          var isFileSystemEnabled = this.get('isFileSystemEnabled');
          if (isFileSystemEnabled) {
            var pouchDbId = this.get('database').getPouchId(photoId, 'photo');
            fileSystem.deleteFile(filePath, pouchDbId);
          }
        }).bind(this));
      },

      editAppointment: function editAppointment(appointment) {
        if (this.get('canAddAppointment')) {
          appointment.set('returnToPatient', this.get('model.id'));
          appointment.set('returnTo', null);
          this.transitionToRoute('appointments.edit', appointment);
        }
      },

      editImaging: function editImaging(imaging) {
        if (this.get('canAddImaging')) {
          if (imaging.get('canEdit')) {
            imaging.set('returnToPatient', this.get('model.id'));
            this.transitionToRoute('imaging.edit', imaging);
          }
        }
      },

      editLab: function editLab(lab) {
        if (this.get('canAddLab')) {
          if (lab.get('canEdit')) {
            lab.setProperties('returnToPatient', this.get('model.id'));
            this.transitionToRoute('labs.edit', lab);
          }
        }
      },

      editMedication: function editMedication(medication) {
        if (this.get('canAddMedication')) {
          if (medication.get('canEdit')) {
            medication.set('returnToPatient', this.get('model.id'));
            this.transitionToRoute('medication.edit', medication);
          }
        }
      },

      editOperativePlan: function editOperativePlan(operativePlan) {
        var _this = this;

        var model = operativePlan;
        if (isEmpty(model)) {
          this._addChildObject('patients.operative-plan', function (route) {
            route.controller.getPatientDiagnoses(_this.get('model'), route.currentModel);
          });
        } else {
          model.set('returnToVisit');
          model.set('returnToPatient', this.get('model.id'));
          this.transitionToRoute('patients.operative-plan', model);
        }
      },

      editOperationReport: function editOperationReport(operationReport) {
        operationReport.set('returnToPatient', this.get('model.id'));
        this.transitionToRoute('patients.operation-report', operationReport);
      },

      editPhoto: function editPhoto(photo) {
        this.send('openModal', 'patients.photo', photo);
      },

      editProcedure: function editProcedure(procedure) {
        if (this.get('canAddVisit')) {
          procedure.set('patient', this.get('model'));
          procedure.set('returnToVisit');
          procedure.set('returnToPatient', this.get('model.id'));
          this.transitionToRoute('procedures.edit', procedure);
        }
      },

      editVisit: function editVisit(visit) {
        if (this.get('canAddVisit')) {
          visit.set('returnToPatient', this.get('model.id'));
          this.transitionToRoute('visits.edit', visit);
        }
      },

      newAppointment: function newAppointment() {
        this._addChildObject('appointments.edit');
      },

      newImaging: function newImaging() {
        this._addChildObject('imaging.edit');
      },

      newLab: function newLab() {
        this._addChildObject('labs.edit');
      },

      newMedication: function newMedication() {
        this._addChildObject('medication.edit');
      },

      newSurgicalAppointment: function newSurgicalAppointment() {
        var _this2 = this;

        this.transitionToRoute('appointments.edit', 'newsurgery').then(function (newRoute) {
          newRoute.currentModel.setProperties({
            patient: _this2.get('model'),
            returnToPatient: _this2.get('model.id'),
            selectPatient: false
          });
        });
      },

      newVisit: function newVisit() {
        var patient = this.get('model');
        this.send('createNewVisit', patient, true);
      },

      showAddContact: function showAddContact() {
        this.send('openModal', 'patients.add-contact', {});
      },

      showAddPhoto: function showAddPhoto() {
        var newPatientPhoto = this.get('store').createRecord('photo', {
          patient: this.get('model'),
          saveToDir: this.get('model.id') + '/photos/'
        });
        this.send('openModal', 'patients.photo', newPatientPhoto);
      },

      showAddPatientNote: function showAddPatientNote(model) {
        if (this.get('canAddNote')) {
          if (_ember['default'].isEmpty(model)) {
            model = this.get('store').createRecord('patient-note', {
              patient: this.get('model'),
              createdBy: this.getUserName()
            });
          }
          this.send('openModal', 'patients.notes', model);
        }
      },

      showDeleteAppointment: function showDeleteAppointment(appointment) {
        appointment.set('deleteFromPatient', true);
        this.send('openModal', 'appointments.delete', appointment);
      },

      showDeleteContact: function showDeleteContact(contact) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          confirmAction: 'deleteContact',
          title: this.get('i18n').t('patients.titles.deleteContact'),
          message: this.get('i18n').t('patients.titles.deletePhoto', { object: 'contact' }),
          contactToDelete: contact,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      },

      showDeleteExpense: function showDeleteExpense(expense) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          confirmAction: 'deleteExpense',
          title: this.get('i18n').t('patients.titles.deleteExpense'),
          message: this.get('i18n').t('patients.titles.deletePhoto', { object: 'expense' }),
          expenseToDelete: expense,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      },

      showDeleteFamily: function showDeleteFamily(familyInfo) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          confirmAction: 'deleteFamily',
          title: this.get('i18n').t('patients.titles.deleteFamilyMember'),
          message: this.get('i18n').t('patients.titles.deletePhoto', { object: 'family member' }),
          familyToDelete: familyInfo,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      },

      showDeleteImaging: function showDeleteImaging(imaging) {
        this.send('openModal', 'imaging.delete', imaging);
      },

      showDeleteLab: function showDeleteLab(lab) {
        this.send('openModal', 'labs.delete', lab);
      },

      showDeleteMedication: function showDeleteMedication(medication) {
        this.send('openModal', 'medication.delete', medication);
      },

      showDeletePhoto: function showDeletePhoto(photo) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          confirmAction: 'deletePhoto',
          title: this.get('i18n').t('patients.titles.deletePhoto'),
          message: this.get('i18n').t('patients.titles.deletePhoto', { object: 'photo' }),
          photoToDelete: photo,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      },

      showDeleteVisit: function showDeleteVisit(visit) {
        visit.set('deleteFromPatient', true);
        this.send('openModal', 'visits.delete', visit);
      },

      showEditExpense: function showEditExpense(expenseInfo) {
        this._showEditSocial(expenseInfo, 'social-expense', 'expense');
      },

      showEditFamily: function showEditFamily(familyInfo) {
        this._showEditSocial(familyInfo, 'family-info', 'family-info');
      },

      updateExpense: function updateExpense(model) {
        this._updateSocialRecord(model, 'expenses');
      },

      updateFamilyInfo: function updateFamilyInfo(model) {
        this._updateSocialRecord(model, 'familyInfo');
      },

      visitDeleted: function visitDeleted(deletedVisit) {
        var _this3 = this;

        var visits = this.get('model.visits');
        var patient = this.get('model');
        var patientCheckedIn = patient.get('checkedIn');
        var patientAdmitted = patient.get('admitted');
        visits.removeObject(deletedVisit);
        if (patientAdmitted || patientCheckedIn) {
          var patientUpdate = false;
          if (patientAdmitted && _ember['default'].isEmpty(visits.findBy('status', _hospitalrunUtilsVisitStatuses['default'].ADMITTED))) {
            patient.set('admitted', false);
            patientUpdate = true;
          }
          if (patientCheckedIn && _ember['default'].isEmpty(visits.findBy('status', _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN))) {
            patient.set('checkedIn', false);
            patientUpdate = true;
          }
          if (patientUpdate === true) {
            patient.save().then(function () {
              return _this3.send('closeModal');
            });
          } else {
            this.send('closeModal');
          }
        } else {
          this.send('closeModal');
        }
      }

    },

    _addChildObject: function _addChildObject(route, afterTransition) {
      var options = {
        queryParams: {
          forPatientId: this.get('model.id')
        }
      };
      this.transitionToRoute(route, 'new', options).then(function (newRoute) {
        if (afterTransition) {
          afterTransition(newRoute);
        }
      });
    },

    _showEditSocial: function _showEditSocial(editAttributes, modelName, route) {
      var model = undefined;
      if (_ember['default'].isEmpty(editAttributes)) {
        model = this.get('store').createRecord(modelName, {
          newRecord: true
        });
      } else {
        model = this.get('store').push({
          data: {
            id: _ember['default'].get(editAttributes, 'id'),
            type: modelName,
            attributes: editAttributes
          }
        });
      }
      this.send('openModal', 'patients.socialwork.' + route, model);
    },

    getVisitCollection: function getVisitCollection(name) {
      var visits = this.get('model.visits');
      return this._getVisitCollection(visits, name);
    },

    _updateSocialRecord: function _updateSocialRecord(recordToUpdate, name) {
      var socialRecords = this.getWithDefault('model.' + name, []);
      var isNew = recordToUpdate.get('isNew');
      var patient = this.get('model');
      var objectToUpdate = recordToUpdate.serialize();
      objectToUpdate.id = recordToUpdate.get('id');
      if (isNew) {
        socialRecords.addObject(_ember['default'].Object.create(objectToUpdate));
      } else {
        var updateRecord = socialRecords.findBy('id', objectToUpdate.id);
        _ember['default'].setProperties(updateRecord, objectToUpdate);
      }
      patient.set(name, socialRecords);
      this.send('update', true);
      this.send('closeModal');
    },

    _updateSequence: function _updateSequence(record) {
      var _this4 = this;

      var config = this.get('config');
      var friendlyId = record.get('friendlyId');
      return config.getPatientPrefix().then(function (prefix) {
        var re = new RegExp('^' + prefix + '\\d{5}$');
        if (!re.test(friendlyId)) {
          return;
        }
        return _this4.store.find('sequence', 'patient').then(function (sequence) {
          var sequenceNumber = sequence.get('value');
          var patientNumber = parseInt(friendlyId.slice(prefix.length));
          if (patientNumber > sequenceNumber) {
            sequence.set('value', patientNumber);
            return sequence.save();
          }
        });
      });
    },

    beforeUpdate: function beforeUpdate() {
      var _this5 = this;

      if (!this.get('model.isNew')) {
        return _ember['default'].RSVP.resolve();
      }
      return this.generateFriendlyId('patient').then(function (friendlyId) {
        _this5.model.set('friendlyId', friendlyId);
      });
    },

    afterUpdate: function afterUpdate(record) {
      var _this6 = this;

      this._updateSequence(record).then(function () {
        $('.message').show();
        $('.message').text(_this6.get('i18n').t('patients.messages.savedPatient', record));
        $('.message').delay(3000).fadeOut(100);
      });
    }

  });
});
define('hospitalrun/tests/patients/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'hospitalrun/mixins/patient-visits', 'hospitalrun/mixins/patient-notes', 'hospitalrun/mixins/pouchdb', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _hospitalrunMixinsPatientVisits, _hospitalrunMixinsPatientNotes, _hospitalrunMixinsPouchdb, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsPatientVisits['default'], _hospitalrunMixinsPouchdb['default'], _hospitalrunMixinsPatientNotes['default'], {
    customForms: _ember['default'].inject.service(),
    editTitle: (0, _emberI18n.translationMacro)('patients.titles.edit'),
    modelName: 'patient',
    newTitle: (0, _emberI18n.translationMacro)('patients.titles.new'),
    photos: null,

    actions: {
      updateNote: function updateNote(note) {
        note.get('visit').save().then(function () {
          // noop
        });
      },
      appointmentDeleted: function appointmentDeleted(model) {
        this.controller.send('appointmentDeleted', model);
      },
      returnToPatient: function returnToPatient() {
        this.controller.send('returnToPatient');
      },
      deleteContact: function deleteContact(model) {
        this.controller.send('deleteContact', model);
      },

      deleteExpense: function deleteExpense(model) {
        this.controller.send('deleteExpense', model);
      },

      deleteFamily: function deleteFamily(model) {
        this.controller.send('deleteFamily', model);
      },

      deletePhoto: function deletePhoto(model) {
        this.controller.send('deletePhoto', model);
      },

      updateExpense: function updateExpense(model) {
        this.controller.send('updateExpense', model);
      },

      updateFamilyInfo: function updateFamilyInfo(model) {
        this.controller.send('updateFamilyInfo', model);
      },

      visitDeleted: function visitDeleted(model) {
        this.controller.send('visitDeleted', model);
      }
    },

    getNewData: function getNewData() {
      var customForms = this.get('customForms');
      var newPatientData = {
        customForms: _ember['default'].Object.create()
      };
      return customForms.setDefaultCustomForms(['patient', 'socialwork'], newPatientData);
    },

    setupController: function setupController(controller, model) {
      // Load appointments, photos and visits asynchronously.
      var friendlyId = model.get('friendlyId');
      var externalId = model.get('externalPatientId');
      var maxValue = this.get('maxValue');
      var patientId = model.get('id');
      if (_ember['default'].isEmpty(friendlyId) && !_ember['default'].isEmpty(externalId)) {
        model.set('friendlyId', externalId);
      }
      this._super(controller, model);
      this.getPatientVisits(model).then(function (visits) {
        model.set('visits', visits);
      });
      this.store.query('appointment', {
        options: {
          startkey: [patientId, null, null, 'appointment_'],
          endkey: [patientId, maxValue, maxValue, maxValue]
        },
        mapReduce: 'appointments_by_patient'
      }).then(function (appointments) {
        model.set('appointments', appointments);
      });
      this.store.query('photo', {
        options: {
          key: patientId
        },
        mapReduce: 'photo_by_patient'
      }).then(function (photos) {
        var patientPhotos = [];
        patientPhotos.addObjects(photos);
        model.set('photos', patientPhotos);
      });
    }

  });
});
define('hospitalrun/tests/patients/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/patient-visits', 'hospitalrun/utils/visit-statuses'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsPatientVisits, _hospitalrunUtilsVisitStatuses) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsPatientVisits['default'], {
    addPermission: 'add_patient',
    deletePermission: 'delete_patient',
    canAdmitPatient: (function () {
      return this.currentUserCan('admit_patient');
    }).property(),

    canDischargePatient: (function () {
      return this.currentUserCan('discharge_patient');
    }).property(),

    startKey: [],
    actions: {
      checkInPatient: function checkInPatient(patient) {
        this.send('createNewVisit', patient);
      },

      checkoutPatient: function checkoutPatient(patient) {
        this.editPatientVisitWithStatus(patient, _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN);
      },

      dischargePatient: function dischargePatient(patient) {
        this.editPatientVisitWithStatus(patient, _hospitalrunUtilsVisitStatuses['default'].ADMITTED);
      }
    },

    editPatientVisitWithStatus: function editPatientVisitWithStatus(patient, status) {
      var _this = this;

      this.getPatientVisits(patient).then(function (visits) {
        var visitToEdit = visits.findBy('status', status);
        if (visitToEdit) {
          visitToEdit.set('endDate', new Date());
          _this.transitionToRoute('visits.edit', visitToEdit);
        }
      });
    }
  });
});
define('hospitalrun/tests/patients/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember', 'ember-i18n', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember, _emberI18n, _hospitalrunMixinsUserSession) {
  'use strict';

  var computed = _ember['default'].computed;
  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    modelName: 'patient',
    newButtonAction: computed(function () {
      if (this.currentUserCan('add_patient')) {
        return 'newItem';
      } else {
        return null;
      }
    }),
    newButtonText: (0, _emberI18n.translationMacro)('patients.buttons.newPatient'),
    pageTitle: (0, _emberI18n.translationMacro)('patients.titles.patientListing'),

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var displayPatientId = item.get('displayPatientId');
      var id = this._getPouchIdFromItem(item);
      return [displayPatientId, id];
    },

    _modelQueryParams: function _modelQueryParams() {
      return {
        mapReduce: 'patient_by_display_id'
      };
    }

  });
});
define('hospitalrun/tests/patients/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/notes/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/is-update-disabled', 'moment', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/mixins/patient-notes', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsIsUpdateDisabled, _moment, _hospitalrunMixinsPatientSubmodule, _hospitalrunMixinsPatientNotes, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsIsUpdateDisabled['default'], _hospitalrunMixinsUserSession['default'], _hospitalrunMixinsPatientSubmodule['default'], _hospitalrunMixinsPatientNotes['default'], {
    cancelAction: 'closeModal',
    updateAction: 'updateNote',
    moduleController: _ember['default'].inject.controller('patients'),
    physicianList: _ember['default'].computed.alias('moduleController.physicianList'),
    lookupListsToUpdate: [{
      name: 'physicianList',
      property: 'model.attribution',
      id: 'physician_list'
    }],
    title: (function () {
      if (this.get('model.isNew')) {
        return this.get('i18n').t('patients.notes.newNote') + ' ' + this.get('model.patient.displayName');
      } else {
        return this.get('i18n').t('patients.notes.newNote') + ' ' + (0, _moment['default'])(this.get('model.date')).format('MM/DD/YYYY') + ' for ' + this.get('model.patient.displayName');
      }
    }).property('model.patient.displayName'),
    updateCapability: 'add_note',
    beforeUpdate: function beforeUpdate() {
      this._setNoteType();
      this.set('model.date', new Date());
      this.set('model.createdBy', this.getUserName());
      return _ember['default'].RSVP.Promise.resolve();
    },
    afterUpdate: function afterUpdate() {
      this.send(this.get('updateAction'), this.get('model'));
      this.send(this.get('cancelAction'));
    }
  });
});
define('hospitalrun/tests/patients/notes/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/notes/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/notes/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/operation-report/controller', ['exports', 'ember', 'hospitalrun/patients/operative-plan/controller'], function (exports, _ember, _hospitalrunPatientsOperativePlanController) {
  'use strict';

  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  exports['default'] = _hospitalrunPatientsOperativePlanController['default'].extend({
    additionalButtons: null,
    lookupListsToUpdate: [{
      name: 'physicianList',
      property: 'model.assistant',
      id: 'physician_list'
    }, {
      name: 'physicianList',
      property: 'model.surgeon',
      id: 'physician_list'
    }, {
      name: 'procedureList',
      property: 'modelProcedures',
      id: 'procedure_list'
    }],
    updateCapability: 'add_operation_report',

    diagnosisList: alias('patientController.diagnosisList'),

    _finishAfterUpdate: function _finishAfterUpdate() {
      var i18n = get(this, 'i18n');
      var updateMessage = i18n.t('operationReport.messages.reportSaved');
      var updateTitle = i18n.t('operationReport.titles.reportSaved');
      this.displayAlert(updateTitle, updateMessage);
    },

    actions: {
      addDiagnosis: function addDiagnosis(newDiagnosis) {
        this.addDiagnosisToModelAndPatient(newDiagnosis);
      }
    }

  });
});
define('hospitalrun/tests/patients/operation-report/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/operation-report/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/operation-report/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/operation-report/route', ['exports', 'hospitalrun/patients/operative-plan/route', 'ember-i18n'], function (exports, _hospitalrunPatientsOperativePlanRoute, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunPatientsOperativePlanRoute['default'].extend({
    editTitle: (0, _emberI18n.translationMacro)('operationReport.titles.editTitle'),
    modelName: 'operation-report',
    newTitle: (0, _emberI18n.translationMacro)('operationReport.titles.newTitle')
  });
});
define('hospitalrun/tests/patients/operation-report/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/operation-report/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/operation-report/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/operative-plan/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/components/operative-procedures', 'hospitalrun/mixins/operative-plan-statuses', 'hospitalrun/mixins/patient-submodule'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunComponentsOperativeProcedures, _hospitalrunMixinsOperativePlanStatuses, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var RSVP = _ember['default'].RSVP;
  var set = _ember['default'].set;

  // Properties to copy from plan to operative report
  var PLAN_KEYS_TO_COPY = ['additionalNotes', 'caseComplexity', 'customForms', 'patient', 'procedures', 'operationDescription', 'surgeon'];

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsOperativePlanStatuses['default'], _hospitalrunMixinsPatientSubmodule['default'], {
    completedPlan: false,
    lookupListsToUpdate: [{
      name: 'physicianList',
      property: 'model.surgeon',
      id: 'physician_list'
    }, {
      name: 'procedureList',
      property: 'modelProcedures',
      id: 'procedure_list'
    }],
    newPlan: false,
    updateCapability: 'add_operative_plan',

    patientsController: inject.controller('patients'),

    physicianList: alias('patientsController.physicianList'),
    procedureList: alias('patientsController.procedureList'),

    additionalButtons: computed('model.{isNew,status}', function () {
      var i18n = get(this, 'i18n');
      var isNew = get(this, 'model.isNew');
      var status = get(this, 'model.status');
      if (!isNew && status !== _hospitalrunMixinsOperativePlanStatuses.COMPLETED_STATUS) {
        return [{
          'class': 'btn btn-primary on-white',
          buttonAction: 'completePlan',
          buttonIcon: 'octicon octicon-check',
          buttonText: i18n.t('operativePlan.buttons.completePlan')
        }];
      }
    }),

    modelProcedures: computed.map('model.procedures', function (procedure) {
      return get(procedure, 'description');
    }),

    afterUpdate: function afterUpdate() {
      var _this = this;

      var newPlan = get(this, 'newPlan');
      if (newPlan) {
        var patient = get(this, 'model.patient');
        patient.save().then(this._finishAfterUpdate.bind(this)).then(function () {
          var editTitle = get(_this, 'i18n').t('operativePlan.titles.editTitle');
          var sectionDetails = {};
          sectionDetails.currentScreenTitle = editTitle;
          _this.send('setSectionHeader', sectionDetails);
        });
      } else {
        this._finishAfterUpdate();
      }
    },

    beforeUpdate: function beforeUpdate() {
      var model = get(this, 'model');
      var isNew = get(model, 'isNew');
      var status = get(model, 'status');
      (0, _hospitalrunComponentsOperativeProcedures.addProcedure)(model);
      set(this, 'newPlan', isNew);
      if (status === _hospitalrunMixinsOperativePlanStatuses.COMPLETED_STATUS) {
        var changedAttributes = model.changedAttributes();
        if (changedAttributes.status) {
          set(this, 'completedPlan', true);
        }
      } else {
        set(this, 'completedPlan', false);
      }
      if (isNew) {
        return this.saveNewDiagnoses();
      } else {
        return RSVP.resolve();
      }
    },

    _createOperationReport: function _createOperationReport() {
      var _this2 = this;

      var store = get(this, 'store');
      var operativePlan = get(this, 'model');
      var propertiesToCopy = operativePlan.getProperties.apply(operativePlan, PLAN_KEYS_TO_COPY);
      var diagnoses = get(operativePlan, 'diagnoses');
      var patient = get(operativePlan, 'patient');
      set(propertiesToCopy, 'operativePlan', operativePlan);
      set(propertiesToCopy, 'preOpDiagnosis', diagnoses);
      set(propertiesToCopy, 'surgeryDate', new Date());
      set(propertiesToCopy, 'returnToPatient', get(patient, 'id'));
      var operationReport = store.createRecord('operation-report', propertiesToCopy);
      this.getPatientDiagnoses(patient, operationReport);
      operationReport.save().then(function (newReport) {
        patient.save().then(function () {
          var i18n = get(_this2, 'i18n');
          var updateMessage = i18n.t('operativePlan.messages.planCompleted');
          var updateTitle = i18n.t('operativePlan.titles.planCompleted');
          _this2.displayAlert(updateTitle, updateMessage, 'showOperationReport', newReport, 'ok');
        });
      });
    },

    _finishAfterUpdate: function _finishAfterUpdate() {
      var completedPlan = get(this, 'completedPlan');
      if (completedPlan) {
        this._createOperationReport();
      } else {
        var i18n = get(this, 'i18n');
        var updateMessage = i18n.t('operativePlan.messages.planSaved');
        var updateTitle = i18n.t('operativePlan.titles.planSaved');
        this.displayAlert(updateTitle, updateMessage);
      }
    },

    actions: {
      completePlan: function completePlan() {
        var model = get(this, 'model');
        set(model, 'status', _hospitalrunMixinsOperativePlanStatuses.COMPLETED_STATUS);
        this.send('update');
      }
    }
  });
});
define('hospitalrun/tests/patients/operative-plan/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/operative-plan/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/operative-plan/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/operative-plan/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'ember', 'moment', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _ember, _moment, _emberI18n) {
  'use strict';

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], {
    editTitle: (0, _emberI18n.translationMacro)('operativePlan.titles.editTitle'),
    modelName: 'operative-plan',
    newTitle: (0, _emberI18n.translationMacro)('operativePlan.titles.newTitle'),

    customForms: inject.service(),
    database: inject.service(),

    getNewData: function getNewData() {
      var customForms = get(this, 'customForms');
      var newData = {
        customForms: _ember['default'].Object.create()
      };
      return customForms.setDefaultCustomForms(['operativePlan'], newData);
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      var database = get(this, 'database');
      var maxApptId = database.getMaxPouchId('appointment');
      var minApptId = database.getMinPouchId('appointment');
      var patientId = get(model, 'patient.id');
      var startDate = (0, _moment['default'])().toDate().getTime();
      var endDate = (0, _moment['default'])().add(10, 'years').toDate().getTime();

      this.store.query('appointment', {
        options: {
          startkey: [patientId, startDate, startDate, minApptId],
          endkey: [patientId, endDate, endDate, maxApptId]
        },
        mapReduce: 'appointments_by_patient'
      }).then(function (appointments) {
        model.set('appointments', appointments);
      });
    },

    actions: {
      showOperationReport: function showOperationReport(report) {
        this.transitionTo('patients.operation-report', report);
      }
    }
  });
});
define('hospitalrun/tests/patients/operative-plan/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/operative-plan/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/operative-plan/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/outpatient/controller', ['exports', 'ember', 'hospitalrun/mixins/filter-list', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/patient-visits', 'hospitalrun/utils/select-values', 'hospitalrun/mixins/user-session', 'hospitalrun/utils/visit-statuses', 'hospitalrun/mixins/visit-types'], function (exports, _ember, _hospitalrunMixinsFilterList, _hospitalrunMixinsModalHelper, _hospitalrunMixinsPatientVisits, _hospitalrunUtilsSelectValues, _hospitalrunMixinsUserSession, _hospitalrunUtilsVisitStatuses, _hospitalrunMixinsVisitTypes) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsFilterList['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsPatientVisits['default'], _hospitalrunUtilsSelectValues['default'], _hospitalrunMixinsUserSession['default'], _hospitalrunMixinsVisitTypes['default'], {
    addPermission: 'add_patient',
    deletePermission: 'delete_patient',
    queryParams: ['visitDate', 'visitLocation'],
    visitLocation: null,
    visitDate: null,
    canAddVisit: computed(function () {
      return this.currentUserCan('add_visit');
    }),
    hasAppointmentLabels: computed(function () {
      var i18n = this.get('i18n');
      return [i18n.t('visits.labels.haveAppointment'), i18n.t('visits.labels.noAppointment')];
    }),
    doneOrdersValues: computed(function () {
      var i18n = this.get('i18n');
      return [i18n.t('visits.labels.ordersNotDone'), i18n.t('visits.labels.haveDoneOrders')];
    }),
    locationList: _ember['default'].computed.map('patientController.locationList.value', _hospitalrunUtilsSelectValues['default'].selectValuesMap).volatile(),
    patientNames: computed.map('model', function (visit) {
      return visit.get('patient.shortDisplayName');
    }),
    patientController: _ember['default'].inject.controller('patients'),
    sexList: computed.alias('patientController.sexList.value'),
    visitTypesList: computed.alias('patientController.visitTypesList'),
    visitTypesValues: computed.map('visitTypes', function (visitType) {
      return visitType.value;
    }),

    checkedInVisits: computed.filter('model.@each.status', function (visit) {
      return visit.get('visitType') !== 'Admission' && visit.get('status') === _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN;
    }),

    filteredVisits: computed('checkedInVisits', 'filterBy', 'filterValue', 'visitLocation', function () {
      var filterBy = this.get('filterBy');
      var filterValue = this.get('filterValue');
      var filteredBy = this.get('filteredBy');
      var visitLocation = this.get('visitLocation');
      var visits = this.get('checkedInVisits');
      if (isEmpty(visitLocation)) {
        filteredBy['delete']('location');
      } else {
        filteredBy.set('location', visitLocation);
      }
      return this.filterList(visits, filterBy, filterValue);
    }),

    sortedVisits: computed('filteredVisits', 'sortByKey', 'sortByDesc', function () {
      var filteredList = this.get('filteredVisits');
      return this.sortFilteredList(filteredList);
    }),

    startKey: [],
    actions: {
      checkOut: function checkOut(visit) {
        var i18n = this.get('i18n');
        var patientDetails = { patientName: visit.get('patient.displayName') };
        var confirmMessage = i18n.t('visits.messages.checkOut', patientDetails);
        this.displayConfirm(i18n.t('visits.titles.checkOut'), confirmMessage, 'finishCheckOut', visit);
      },

      editVisit: function editVisit(visit) {
        if (this.get('canAddVisit')) {
          visit.set('returnTo', 'patients.outpatient');
          this.transitionToRoute('visits.edit', visit);
        }
      },

      finishCheckOut: function finishCheckOut(visit) {
        this.checkoutVisit(visit, _hospitalrunUtilsVisitStatuses['default'].CHECKED_OUT);
      },

      search: function search() {
        var visitDate = this.get('model.selectedVisitDate');
        var visitLocation = this.get('model.selectedLocation');
        if (!isEmpty(visitDate)) {
          this.set('visitDate', visitDate.getTime());
        }
        if (isEmpty(visitLocation)) {
          this.set('visitLocation', null);
        } else {
          this.set('visitLocation', visitLocation);
        }
      },

      patientCheckIn: function patientCheckIn() {
        this.transitionToRoute('visits.edit', 'checkin').then(function (newRoute) {
          var visitProps = {
            outPatient: true,
            visitType: null,
            returnTo: 'patients.outpatient'
          };
          newRoute.currentModel.setProperties(visitProps);
        });
      }

    }
  });
});
define('hospitalrun/tests/patients/outpatient/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/outpatient/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/outpatient/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/outpatient/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'hospitalrun/mixins/date-format', 'ember', 'moment', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _hospitalrunMixinsDateFormat, _ember, _moment, _emberI18n) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsDateFormat['default'], {
    database: _ember['default'].inject.service(),
    itemsPerPage: null, // Fetch all outpatient visits as one page
    modelName: 'visit',
    newButtonAction: 'patientCheckIn',
    newButtonText: (0, _emberI18n.translationMacro)('patients.buttons.patientCheckIn'),
    selectedVisitDate: null,
    showingTodaysPatients: true,
    pageTitle: computed('showingTodaysPatients', 'selectedVisitDate', function () {
      var i18n = this.get('i18n');
      var showingTodaysPatients = this.get('showingTodaysPatients');
      if (showingTodaysPatients) {
        return i18n.t('patients.titles.todaysOutpatients');
      } else {
        var selectedVisitDate = this._dateFormat(this.get('selectedVisitDate'));
        return i18n.t('patients.titles.outpatientsForDate', { visitDate: selectedVisitDate });
      }
    }),

    queryParams: {
      visitDate: { refreshModel: true },
      visitLocation: { refreshModel: false }
    },

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var displayPatientId = item.get('displayPatientId');
      return [displayPatientId, 'patient_' + item.get('id')];
    },

    _modelQueryParams: function _modelQueryParams(params) {
      var database = this.get('database');
      var maxId = database.getMaxPouchId('visit');
      var minId = database.getMinPouchId('visit');
      var visitDate = params.visitDate;

      if (isEmpty(visitDate)) {
        visitDate = (0, _moment['default'])();
      } else {
        visitDate = (0, _moment['default'])(parseInt(visitDate));
      }
      if (visitDate.isSame((0, _moment['default'])(), 'day')) {
        this.set('showingTodaysPatients', true);
      } else {
        this.set('showingTodaysPatients', false);
        this.set('selectedVisitDate', visitDate.toDate());
      }
      var endOfDay = visitDate.endOf('day').valueOf();
      var startOfDay = visitDate.startOf('day').valueOf();
      return {
        mapReduce: 'visit_by_date',
        options: {
          endkey: [endOfDay, endOfDay, maxId],
          startkey: [startOfDay, null, minId]
        }
      };
    },

    model: function model(params) {
      var _this = this;

      return this._super(params).then(function (model) {
        var visitDate = new Date();
        if (!isEmpty(params.visitDate)) {
          visitDate.setTime(params.visitDate);
        }
        model.set('selectedVisitDate', visitDate);
        model.set('display_selectedVisitDate', _this._dateFormat(visitDate));
        model.set('selectedLocation', params.visitLocation);
        return model;
      });
    },

    actions: {
      finishCheckOut: function finishCheckOut(visit) {
        this.controller.send('finishCheckOut', visit);
      },

      patientCheckIn: function patientCheckIn() {
        this.controller.send('patientCheckIn');
      }
    }

  });
});
define('hospitalrun/tests/patients/outpatient/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/outpatient/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/outpatient/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/photo/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _emberI18n) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var RSVP = _ember['default'].RSVP;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    addAction: 'addPhoto',
    editTitle: (0, _emberI18n.translationMacro)('patients.titles.editPhoto'),
    fileRequiredMessage: (0, _emberI18n.translationMacro)('patients.messages.photoFileRequired'),
    modelName: 'photo',
    newTitle: (0, _emberI18n.translationMacro)('patients.titles.addPhoto'),
    newModel: false,
    showFileRequired: false,
    showUpdateButton: true,

    database: inject.service(),
    editController: inject.controller('patients/edit'),
    filesystem: inject.service(),

    photoFileNotSet: computed('model.photoFile', function () {
      var model = get(this, 'model');
      var isNew = get(model, 'isNew');
      var photoFile = get(model, 'photoFile');
      return isNew && isEmpty(photoFile);
    }),

    title: computed('model.isNew', function () {
      var isNew = get(this, 'model.isNew');
      if (isNew) {
        return get(this, 'newTitle');
      } else {
        return get(this, 'editTitle');
      }
    }),

    updateButtonAction: computed('photoFileNotSet', function () {
      var photoFileNotSet = get(this, 'photoFileNotSet');
      if (photoFileNotSet) {
        return 'showFileRequired';
      } else {
        set(this, 'showFileRequired', false);
        return 'update';
      }
    }),

    updateButtonClass: computed('photoFileNotSet', function () {
      var photoFileNotSet = get(this, 'photoFileNotSet');
      if (photoFileNotSet) {
        return 'disabled-btn';
      }
    }),

    afterUpdate: function afterUpdate(model) {
      var _this = this;

      var isNew = get(this, 'newModel');
      var editController = get(this, 'editController');
      if (isNew) {
        var photoFile = get(model, 'photoFile');
        var saveToDir = get(model, 'saveToDir');
        var fileSystem = get(this, 'filesystem');
        var modelName = get(this, 'modelName');
        var pouchDbId = get(this, 'database').getPouchId(get(model, 'id'), modelName);
        fileSystem.addFile(photoFile, saveToDir, pouchDbId).then(function (fileEntry) {
          model.setProperties({
            localFile: true,
            fileName: fileEntry.fullPath,
            url: fileEntry.toURL()
          });
          model.save().then(function () {
            editController.send(get(_this, 'addAction'), model);
          })['catch'](function (err) {
            throw err;
          });
        });
      } else {
        this.send('closeModal');
      }
    },

    beforeUpdate: function beforeUpdate() {
      var model = get(this, 'model');
      var photoFile = get(model, 'photoFile');
      var isImage = get(model, 'isImage');
      var isNew = get(model, 'isNew');
      set(this, 'newModel', isNew);
      if (isNew) {
        model.setProperties({
          files: [_ember['default'].Object.create({
            content_type: photoFile.type,
            data: photoFile,
            name: 'file'
          })],
          isImage: isImage
        });
      }
      return RSVP.resolve();
    },

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      showFileRequired: function showFileRequired() {
        set(this, 'showFileRequired', true);
      }
    }
  });
});
define('hospitalrun/tests/patients/photo/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/photo/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/photo/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/quick-add/controller', ['exports', 'ember', 'hospitalrun/controllers/abstract-edit-controller', 'ember-i18n'], function (exports, _ember, _hospitalrunControllersAbstractEditController, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    sexList: _ember['default'].computed.alias('model.requestingController.sexList'),
    title: (0, _emberI18n.translationMacro)('patients.titles.new'),

    updateCapability: 'add_patient',

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      }
    },

    afterUpdate: function afterUpdate(record) {
      var requestingController = this.get('model.requestingController');
      requestingController.send('addedNewPatient', record);
    }
  });
});
define('hospitalrun/tests/patients/quick-add/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/quick-add/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/quick-add/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/reports/controller', ['exports', 'ember', 'hospitalrun/controllers/abstract-report-controller', 'moment', 'hospitalrun/mixins/patient-diagnosis', 'hospitalrun/mixins/patient-visits', 'hospitalrun/utils/select-values', 'hospitalrun/mixins/visit-types'], function (exports, _ember, _hospitalrunControllersAbstractReportController, _moment, _hospitalrunMixinsPatientDiagnosis, _hospitalrunMixinsPatientVisits, _hospitalrunUtilsSelectValues, _hospitalrunMixinsVisitTypes) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractReportController['default'].extend(_hospitalrunMixinsPatientDiagnosis['default'], _hospitalrunMixinsPatientVisits['default'], _hospitalrunMixinsVisitTypes['default'], {
    patientsController: _ember['default'].inject.controller('patients'),

    clinicList: _ember['default'].computed.map('patientsController.clinicList.value', _hospitalrunUtilsSelectValues['default'].selectValuesMap),
    diagnosisList: _ember['default'].computed.alias('patientsController.diagnosisList'),
    physicianList: _ember['default'].computed.map('patientsController.physicianList.value', _hospitalrunUtilsSelectValues['default'].selectValuesMap),
    locationList: _ember['default'].computed.map('patientsController.locationList.value', _hospitalrunUtilsSelectValues['default'].selectValuesMap),
    statusList: _ember['default'].computed.map('patientsController.statusList.value', _hospitalrunUtilsSelectValues['default'].selectValuesMap),
    visitTypesList: _ember['default'].computed.alias('patientsController.visitTypesList'),
    reportType: 'detailedAdmissions',
    patientDetails: {},

    admissionReportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        sex: {
          label: i18n.t('labels.sex'),
          include: true,
          property: 'sex'
        },
        total: {
          label: i18n.t('labels.total'),
          include: true,
          property: 'total',
          format: '_numberFormat'
        }
      };
    }),
    admissionDetailReportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        id: {
          label: i18n.t('labels.id'),
          include: true,
          property: 'patientId'
        },
        name: {
          label: i18n.t('labels.name'),
          include: true,
          property: 'patientName'
        },
        admissionDate: {
          label: i18n.t('patients.labels.admissionDate'),
          include: true,
          property: 'admissionDate',
          format: '_dateTimeFormat'
        },
        dischargeDate: {
          label: i18n.t('patients.labels.dischargeDate'),
          include: false,
          property: 'dischargeDate',
          format: '_dateTimeFormat'
        },
        patientDays: {
          label: i18n.t('patients.labels.patientDays'),
          include: false,
          property: 'patientDays',
          format: '_numberFormat'
        }
      };
    }),
    diagnosticReportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        type: {
          label: i18n.t('labels.type'),
          include: true,
          property: 'type'
        },
        total: {
          label: i18n.t('labels.total'),
          include: true,
          property: 'total',
          format: '_numberFormat'
        }
      };
    }),
    procedureDetailReportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        id: {
          label: i18n.t('labels.id'),
          include: true,
          property: 'patient.displayPatientId'
        },
        name: {
          label: i18n.t('labels.name'),
          include: true,
          property: 'patient.displayName'
        },
        procedure: {
          label: i18n.t('visits.labels.procedure'),
          include: true,
          property: 'procedure'
        },
        procedureDate: {
          label: i18n.t('visits.labels.procedureDate'),
          include: true,
          property: 'procedureDate',
          format: '_dateTimeFormat'
        }
      };
    }),
    reportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        visitDate: {
          label: i18n.t('visits.labels.visitDate'),
          include: true,
          property: 'visitDate'
        },
        visitType: {
          label: i18n.t('visits.labels.visitType'),
          include: true,
          property: 'visitType'
        },
        visitLocation: {
          label: i18n.t('labels.location'),
          include: false,
          property: 'location'
        },
        examiner: {
          label: i18n.t('visits.labels.examiner'),
          include: true,
          property: 'examiner'
        },
        name: {
          label: i18n.t('labels.name'),
          include: true,
          property: 'patient.displayName'
        },
        id: {
          label: i18n.t('labels.id'),
          include: true,
          property: 'patient.displayPatientId'
        },
        sex: {
          label: i18n.t('patients.labels.sex'),
          include: true,
          property: 'patient.sex'
        },
        dateOfBirth: {
          label: i18n.t('patients.labels.dateOfBirth'),
          include: true,
          property: 'patient.dateOfBirth',
          format: '_dateFormat'
        },
        age: {
          label: i18n.t('labels.age'),
          include: false,
          property: 'patient.age'
        },
        primaryDiagnosis: {
          label: i18n.t('patients.labels.primaryDiagnosis'),
          include: false,
          property: 'primaryDiagnosis'
        },
        secondaryDiagnoses: {
          label: i18n.t('patients.labels.secondaryDiagnosis'),
          include: false,
          property: 'additionalDiagnoses',
          format: '_diagnosisListToString'
        },
        procedures: {
          label: i18n.t('labels.procedures'),
          include: false,
          property: 'resolvedProcedures',
          format: '_procedureListToString'
        },
        contacts: {
          label: i18n.t('patients.labels.contacts'),
          include: false,
          property: 'patient',
          format: '_contactListToString'
        },
        referredBy: {
          label: i18n.t('patients.labels.referredBy'),
          include: false,
          property: 'patient.referredBy'
        },
        referredDate: {
          label: i18n.t('patients.labels.referredDate'),
          include: false,
          property: 'patient.referredDate',
          format: '_dateFormat'
        }
      };
    }),
    statusReportColumns: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return {
        id: {
          label: i18n.t('labels.id'),
          include: true,
          property: 'patient.displayPatientId'
        },
        name: {
          label: i18n.t('labels.name'),
          include: true,
          property: 'patient.displayName'
        },
        status: {
          label: i18n.t('labels.status'),
          include: true,
          property: 'patient.status'
        },
        primaryDiagnosis: {
          label: i18n.t('patients.labels.primaryDiagnosis'),
          include: true,
          property: 'patient',
          format: '_formatPrimaryDiagnosis'
        },
        secondaryDiagnoses: {
          label: i18n.t('patients.labels.secondaryDiagnosis'),
          include: true,
          property: 'patient',
          format: '_formatSecondaryDiagnosis'
        }
      };
    }),
    reportTypes: _ember['default'].computed(function () {
      var i18n = this.get('i18n');
      return [{
        name: i18n.t('patients.titles.admissionsDetail'),
        value: 'detailedAdmissions'
      }, {
        name: i18n.t('patients.titles.admissionsSummary'),
        value: 'admissions'
      }, {
        name: i18n.t('patients.titles.diagnosticTesting'),
        value: 'diagnostic'
      }, {
        name: i18n.t('patients.titles.dischargesDetail'),
        value: 'detailedDischarges'
      }, {
        name: i18n.t('patients.titles.dischargesSummary'),
        value: 'discharges'
      }, {
        name: i18n.t('patients.titles.proceduresDetail'),
        value: 'detailedProcedures'
      }, {
        name: i18n.t('patients.titles.proceduresSummary'),
        value: 'procedures'
      }, {
        name: i18n.t('patients.titles.patientStatus'),
        value: 'status'
      }, {
        name: i18n.t('patients.titles.totalPatientDays'),
        value: 'patientDays'
      }, {
        name: i18n.t('patients.titles.totalPatientDaysDetailed'),
        value: 'detailedPatientDays'
      }, {
        name: i18n.t('patients.titles.visit'),
        value: 'visit'
      }];
    }),

    isDischargeReport: (function () {
      var reportType = this.get('reportType');
      return reportType.toLowerCase().indexOf('discharges') > -1;
    }).property('reportType'),

    isStatusReport: (function () {
      var reportType = this.get('reportType');
      return reportType === 'status';
    }).property('reportType'),

    isVisitReport: (function () {
      var reportType = this.get('reportType');
      return reportType === 'visit';
    }).property('reportType'),

    _addContactToList: function _addContactToList(phone, email, prefix, contactList) {
      var contactArray = [];
      if (!_ember['default'].isEmpty(email) || !_ember['default'].isEmpty(phone)) {
        if (!_ember['default'].isEmpty(phone)) {
          contactArray.push(phone);
        }
        if (!_ember['default'].isEmpty(email)) {
          contactArray.push(email);
        }
        contactList.push(prefix + contactArray.join(', '));
      }
    },

    _addReportRow: function _addReportRow(row, skipFormatting, reportColumns, rowAction) {
      if (_ember['default'].isEmpty(rowAction) && !_ember['default'].isEmpty(row.patient)) {
        var patientId = null;
        if (row.get) {
          patientId = row.get('patient.id');
        } else {
          patientId = row.patient.get('id');
        }
        if (!_ember['default'].isEmpty(patientId)) {
          rowAction = {
            action: 'viewPatient',
            model: patientId
          };
        }
      }
      this._super(row, skipFormatting, reportColumns, rowAction);
    },

    /**
     * Given a list of records, organize and total by them by type and then add them to the report.
     * @param records {Array} list of records to total.
     * @param typeField {String} the field in the records containing the type.
     * @param totalLabel {String} the label for the grand total.
     * @param reportColumns
     */
    _addRowsByType: function _addRowsByType(records, typeField, totalLabel, reportColumns) {
      var types = this._totalByType(records, typeField, totalLabel);
      types.forEach((function (type) {
        this._addReportRow(type, true, reportColumns);
      }).bind(this));
    },

    _addPatientProcedureRows: function _addPatientProcedureRows(procedureTotals, reportColumns) {
      procedureTotals.forEach((function (procedureTotal) {
        if (!_ember['default'].isEmpty(procedureTotal.records)) {
          procedureTotal.records.forEach((function (patientProcedure, index) {
            this._addReportRow({
              patient: patientProcedure.get('patient'),
              procedure: patientProcedure.get('description'),
              procedureDate: patientProcedure.get('procedureDate')
            }, false, reportColumns);
            if (index + 1 === procedureTotal.records.length) {
              this._addReportRow({
                procedure: 'Total for ' + procedureTotal.type + ': ' + procedureTotal.total
              }, true, reportColumns);
            }
          }).bind(this));
        } else {
          this._addReportRow({
            procedure: 'Total for ' + procedureTotal.type + ': ' + procedureTotal.total
          }, true, reportColumns);
        }
      }).bind(this));
    },

    _contactListToString: function _contactListToString(patient) {
      var additionalContacts = patient.get('additionalContacts');
      var contactDesc = undefined;
      var contactList = [];
      var email = patient.get('email');
      var phone = patient.get('phone');
      this._addContactToList(phone, email, 'Primary: ', contactList);
      if (!_ember['default'].isEmpty(additionalContacts)) {
        additionalContacts.forEach((function (contact) {
          contactDesc = '';
          if (!_ember['default'].isEmpty(contact.name) && !_ember['default'].isEmpty(contact.relationship)) {
            if (!_ember['default'].isEmpty(contact.name)) {
              contactDesc += contact.name;
            }
            if (!_ember['default'].isEmpty(contact.relationship)) {
              if (!_ember['default'].isEmpty(contactDesc)) {
                contactDesc += ' - ';
              }
              contactDesc += contact.relationship;
            }
            contactDesc += ': ';
          }
          this._addContactToList(contact.phone, contact.email, contactDesc, contactList);
        }).bind(this));
      }
      return contactList.join(';\n');
    },

    _dateTimeFormat: function _dateTimeFormat(value) {
      return this._dateFormat(value, 'l h:mm A');
    },

    _diagnosisListToString: function _diagnosisListToString(diagnoses) {
      return this._listToString(diagnoses, 'diagnosis', 'date');
    },
    /**
       * Find diagnostics by the specified dates and the record's start and (optional) end dates.
       */
    _findDiagnosticsByDate: function _findDiagnosticsByDate() {
      var filterEndDate = this.get('endDate');
      var filterStartDate = this.get('startDate');
      var findParams = {
        options: {},
        mapReduce: 'imaging_by_status'
      };
      var maxValue = this.get('maxValue');
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        findParams.options.startkey = ['Completed', null, filterStartDate.getTime(), null];

        if (!_ember['default'].isEmpty(filterEndDate)) {
          filterEndDate = (0, _moment['default'])(filterEndDate).endOf('day').toDate();
          findParams.options.endkey = ['Completed', maxValue, filterEndDate.getTime(), maxValue];
        }
        this.store.query('imaging', findParams).then((function (imagingRecords) {
          var returnRecords = {
            imaging: imagingRecords
          };
          findParams.mapReduce = 'lab_by_status';
          this.store.query('lab', findParams).then(function (labRecords) {
            returnRecords.labs = labRecords;
            resolve(returnRecords);
          }, reject);
        }).bind(this), reject);
      }).bind(this));
    },

    /**
     * Find procedures by the specified dates and the record's start and (optional) end dates.
     */
    _findPatientsByStatus: function _findPatientsByStatus() {
      var status = this.get('status');
      var findParams = {
        options: {
          key: status
        },
        mapReduce: 'patient_by_status'
      };
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        this.store.query('patient', findParams).then(resolve, reject);
      }).bind(this));
    },

    /**
     * Find procedures by the specified dates and the record's start and (optional) end dates.
     */
    _findProceduresByDate: function _findProceduresByDate() {
      var filterEndDate = this.get('endDate');
      var filterStartDate = this.get('startDate');
      var findParams = {
        options: {},
        mapReduce: 'procedure_by_date'
      };
      var maxValue = this.get('maxValue');
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        findParams.options.startkey = [filterStartDate.getTime(), null];

        if (!_ember['default'].isEmpty(filterEndDate)) {
          filterEndDate = (0, _moment['default'])(filterEndDate).endOf('day').toDate();
          findParams.options.endkey = [filterEndDate.getTime(), maxValue];
        }
        this.store.query('procedure', findParams).then(resolve, reject);
      }).bind(this));
    },

    /**
     * Find visits by the specified dates and the record's start and (optional) end dates.
     * @param {String} reportType the type of report to find visits for.
     */
    _findVisitsByDate: function _findVisitsByDate() {
      var filterEndDate = this.get('endDate');
      var filterStartDate = this.get('startDate');
      var findParams = {
        options: {},
        mapReduce: 'visit_by_date'
      };
      var isDischargeReport = this.get('isDischargeReport');
      var maxValue = this.get('maxValue');
      if (isDischargeReport) {
        findParams.mapReduce = 'visit_by_discharge_date';
      }

      /**
       * Admissions - start date between start and end date
       * Discharge end date between start and end date
       */
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var isDischargeReport = this.get('isDischargeReport');
        findParams.options.startkey = [filterStartDate.getTime(), null];
        if (!_ember['default'].isEmpty(filterEndDate)) {
          filterEndDate = (0, _moment['default'])(filterEndDate).endOf('day').toDate();
          if (isDischargeReport) {
            findParams.options.endkey = [filterEndDate.getTime(), maxValue];
          } else {
            findParams.options.endkey = [filterEndDate.getTime(), maxValue, maxValue];
          }
        }
        this.store.query('visit', findParams).then(resolve, reject);
      }).bind(this));
    },

    _filterByLike: function _filterByLike(records, field, likeCondition) {
      return records.filter(function (record) {
        var fieldValue = record.get('field');
        if (_ember['default'].isEmpty(fieldValue)) {
          return false;
        } else {
          if (_ember['default'].isArray(fieldValue)) {
            var foundValue = fieldValue.find((function (value) {
              return this._haveLikeValue(value, likeCondition);
            }).bind(this));
            return !_ember['default'].isEmpty(foundValue);
          } else {
            return this._haveLikeValue(fieldValue, likeCondition);
          }
        }
      });
    },

    _filterInPatientVisit: function _filterInPatientVisit(visit) {
      var outPatient = visit.get('outPatient');
      var status = visit.get('status');
      return !outPatient && !_ember['default'].isEmpty(status);
    },

    _finishVisitReport: function _finishVisitReport(visits) {
      var visitTypes = this._totalByType(visits, 'visitType', 'total');
      visitTypes.forEach((function (visitType) {
        if (visitType.type === 'total') {
          this._addReportRow({
            visitDate: 'Total visits: ' + visitType.total
          });
        } else {
          visitType.records.forEach((function (visit) {
            this._addReportRow(visit);
          }).bind(this));
          this._addReportRow({
            visitDate: 'Total for ' + visitType.type + ': ' + visitType.total
          });
        }
      }).bind(this));
      this._finishReport();
    },
    _formatPrimaryDiagnosis: function _formatPrimaryDiagnosis(patient) {
      var primaryDiagnoses = this.getDiagnoses(patient, true, false);
      return this._diagnosisListToString(primaryDiagnoses);
    },

    _formatSecondaryDiagnosis: function _formatSecondaryDiagnosis(patient) {
      var secondaryDiagnoses = this.getDiagnoses(patient, true, true);
      return this._diagnosisListToString(secondaryDiagnoses);
    },

    _generateAdmissionOrDischargeReport: function _generateAdmissionOrDischargeReport(visits, reportType) {
      var _this = this;

      var detailedReport = false;
      var reportColumns = undefined;
      var patientBySex = {};
      var sexNotEnteredLabel = this.get('i18n').t('patients.labels.sexNotEntered');

      if (reportType.indexOf('detailed') > -1) {
        detailedReport = true;
        reportColumns = this.get('admissionDetailReportColumns');
        reportColumns.patientDays.include = false;
        if (reportType === 'detailedDischarges') {
          reportColumns.dischargeDate.include = true;
        } else {
          reportColumns.dischargeDate.include = false;
        }
      } else {
        reportColumns = this.get('admissionReportColumns');
      }
      visits = visits.filter(this._filterInPatientVisit);
      visits.forEach((function (visit) {
        if (!this.get('isDischargeReport') || !_ember['default'].isEmpty(visit.get('endDate'))) {
          var reportRow = {
            patient: visit.get('patient'),
            patientId: visit.get('patient.displayPatientId'),
            patientName: visit.get('patient.displayName'),
            admissionDate: visit.get('startDate'),
            dischargeDate: visit.get('endDate')
          };
          var sex = visit.get('patient.sex');
          if (!sex) {
            sex = sexNotEnteredLabel;
          }
          var sexGrouping = patientBySex[sex];
          if (!sexGrouping) {
            sexGrouping = {
              count: 0,
              rows: []
            };
            patientBySex[sex] = sexGrouping;
          }
          sexGrouping.count++;
          sexGrouping.rows.push(reportRow);
        }
      }).bind(this));
      var sexTotal = 0;
      var addPatientBySexRows = function addPatientBySexRows(reportRow) {
        _this._addReportRow(reportRow, false, reportColumns);
      };
      for (var sex in patientBySex) {
        if (detailedReport) {
          patientBySex[sex].rows.forEach(addPatientBySexRows);
          this._addReportRow({ patientId: sex + ' Total: ' + patientBySex[sex].count }, true, reportColumns);
        } else {
          this._addReportRow({ sex: sex, total: patientBySex[sex].count }, true, reportColumns);
        }
        sexTotal += patientBySex[sex].count;
      }
      this._addReportRow({ patientId: 'Grand Total: ' + sexTotal }, true, reportColumns);
      this._finishReport(reportColumns);
    },

    _generateDiagnosticReport: function _generateDiagnosticReport() {
      this._findDiagnosticsByDate().then((function (diagnostics) {
        var reportColumns = this.get('diagnosticReportColumns');
        this._addRowsByType(diagnostics.imaging, 'imagingType.name', 'Total for imaging: ', reportColumns);
        this._addRowsByType(diagnostics.labs, 'labType.name', 'Total for labs: ', reportColumns);
        this._finishReport(reportColumns);
      }).bind(this), (function (err) {
        this._notifyReportError('Error in _generateDiagnosticReport: ' + err);
      }).bind(this));
    },

    _generatePatientDaysReport: function _generatePatientDaysReport(visits, reportType) {
      visits = visits.filter(this._filterInPatientVisit);
      var detailed = reportType.indexOf('detailed') === 0;
      var reportEndDate = this.get('endDate');
      var reportColumns = undefined;
      var reportStartDate = (0, _moment['default'])(this.get('startDate')).startOf('day');
      if (detailed) {
        reportColumns = this.get('admissionDetailReportColumns');
        reportColumns.patientDays.include = true;
        reportColumns.dischargeDate.include = true;
      } else {
        reportColumns = {
          total: {
            label: 'Total',
            include: true,
            property: 'total',
            format: '_numberFormat'
          }
        };
      }
      if (_ember['default'].isEmpty(reportEndDate)) {
        reportEndDate = (0, _moment['default'])().endOf('day');
      } else {
        reportEndDate = (0, _moment['default'])(reportEndDate).endOf('day');
      }
      var patientDays = visits.reduce((function (previousValue, visit) {
        var calcEndDate = visit.get('endDate');
        var calcStartDate = (0, _moment['default'])(visit.get('startDate')).startOf('day');
        if (_ember['default'].isEmpty(calcEndDate)) {
          calcEndDate = (0, _moment['default'])().endOf('day');
        } else {
          calcEndDate = (0, _moment['default'])(calcEndDate).endOf('day');
        }
        if (calcStartDate.isBefore(reportStartDate)) {
          calcStartDate = reportStartDate;
        }
        if (calcEndDate.isAfter(reportEndDate)) {
          calcEndDate = reportEndDate;
        }
        var daysDiff = calcEndDate.diff(calcStartDate, 'days', true);
        if (detailed) {
          this._addReportRow({
            patient: visit.get('patient'),
            patientId: visit.get('patient.displayPatientId'),
            patientName: visit.get('patient.displayName'),
            admissionDate: visit.get('startDate'),
            dischargeDate: visit.get('endDate'),
            patientDays: daysDiff
          }, false, reportColumns);
        }
        return previousValue += daysDiff;
      }).bind(this), 0);
      if (detailed) {
        this._addReportRow({ patientDays: 'Total: ' + this._numberFormat(patientDays) }, true, reportColumns);
      } else {
        this._addReportRow({ total: patientDays }, false, reportColumns);
      }
      this._finishReport(reportColumns);
    },

    _generateProcedureReport: function _generateProcedureReport(reportType) {
      this._findProceduresByDate().then((function (procedures) {
        var reportColumns = undefined;
        procedures = procedures.filter(function (procedure) {
          var visit = procedure.get('visit');
          if (_ember['default'].isEmpty(visit) || _ember['default'].isEmpty(visit.get('patient.id')) || visit.get('patient.archived') === true) {
            return false;
          } else {
            return true;
          }
        });
        if (reportType.indexOf('detailed') === 0) {
          reportColumns = this.get('procedureDetailReportColumns');
          procedures.forEach(function (procedure) {
            procedure.set('patient', procedure.get('visit.patient'));
          });
          var procedureTotals = this._totalByType(procedures, 'description', 'all procedures');
          this._addPatientProcedureRows(procedureTotals, reportColumns);
          this._finishReport(reportColumns);
        } else {
          reportColumns = this.get('diagnosticReportColumns');
          this._addRowsByType(procedures, 'description', 'Total procedures: ', reportColumns);
          this._finishReport(reportColumns);
        }
      }).bind(this), (function (err) {
        this._notifyReportError('Error in _generateProcedureReport: ' + err);
      }).bind(this));
    },

    _generateStatusReport: function _generateStatusReport() {
      this._findPatientsByStatus().then((function (patients) {
        var reportColumns = this.get('statusReportColumns');
        var sortedPatients = patients.sortBy('lastName', 'firstName');
        this._getPatientVisits(sortedPatients).then((function (resolvedPatients) {
          resolvedPatients.forEach((function (patient) {
            this._addReportRow({ patient: patient }, false, reportColumns);
          }).bind(this));
          this._finishReport(reportColumns);
        }).bind(this))['catch']((function (err) {
          this._notifyReportError('Error in _generateStatusReport: ' + err);
        }).bind(this));
      }).bind(this))['catch']((function (err) {
        this._notifyReportError('Error in _generateStatusReport: ' + err);
      }).bind(this));
    },

    _generateVisitReport: function _generateVisitReport(visits) {
      var _this2 = this;

      var reportColumns = this.get('reportColumns');
      var visitFilters = this.getProperties('examiner', 'visitDate', 'visitType', 'location', 'clinic', 'primaryDiagnosis', 'secondaryDiagnosis');
      for (var filter in visitFilters) {
        if (!_ember['default'].isEmpty(visitFilters[filter])) {
          switch (filter) {
            case 'diagnosis':
              {
                visits = this._filterByLike(visits, 'diagnosisList', visitFilters[filter]);
                break;
              }
            default:
              {
                visits = visits.filterBy(filter, visitFilters[filter]);
                break;
              }
          }
        }
      }
      if (reportColumns.procedures.include) {
        (function () {
          var promisesMap = {};
          visits.forEach(function (visit) {
            promisesMap[visit.get('id')] = visit.get('procedures');
          });
          _ember['default'].RSVP.hash(promisesMap).then((function (resolutionHash) {
            visits.forEach(function (visit) {
              visit.set('resolvedProcedures', resolutionHash[visit.get('id')]);
            });
            this._finishVisitReport(visits);
          }).bind(_this2));
        })();
      } else {
        this._finishVisitReport(visits);
      }
    },

    _getPatientVisits: function _getPatientVisits(patients) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var visitHash = {};
        patients.forEach((function (patient) {
          visitHash[patient.get('id')] = this.getPatientVisits(patient);
        }).bind(this));
        _ember['default'].RSVP.hash(visitHash).then(function (resolvedHash) {
          patients.forEach(function (patient) {
            patient.set('visits', resolvedHash[patient.get('id')]);
          });
          resolve(patients);
        }, reject);
      }).bind(this));
    },

    _haveLikeValue: function _haveLikeValue(valueToCompare, likeCondition) {
      return valueToCompare.toLowerCase().indexOf(likeCondition.toLowerCase()) > -1;
    },

    _listToString: function _listToString(items, descField, dateField) {
      var itemList = [];
      if (!_ember['default'].isEmpty(items)) {
        itemList = items.map((function (item) {
          return _ember['default'].get(item, descField) + ' ( ' + this._dateFormat(_ember['default'].get(item, dateField)) + ')';
        }).bind(this));
      }
      return itemList.join(',\n');
    },

    /**
     * Given a list of records, total them by type and also add a grand total.
     * @param records {Array} list of records to total.
     * @param typeField {String} the field in the records containing the type.
     * @param totalLabel {String} the label for the grand total.
     * @param reportColumns
     */
    _totalByType: function _totalByType(records, typeField, totalLabel) {
      var total = 0;
      var types = [];
      records.forEach(function (record) {
        var type = record.get(typeField);
        var typeObject = undefined;
        if (!_ember['default'].isEmpty(type)) {
          typeObject = types.find(function (item) {
            var itemType = item.type;
            return itemType.trim().toLowerCase() === type.toLowerCase();
          });
          if (_ember['default'].isEmpty(typeObject)) {
            typeObject = {
              type: type.trim(),
              total: 0,
              records: []
            };
            types.push(typeObject);
          }
          typeObject.total++;
          typeObject.records.push(record);
          total++;
        }
      });
      types = types.sortBy('type');
      types.push({ type: totalLabel, total: total });
      return types;
    },

    _procedureListToString: function _procedureListToString(procedures) {
      return this._listToString(procedures, 'description', 'procedureDate');
    },

    _validateDates: function _validateDates() {
      var alertMessage = undefined;
      var endDate = this.get('endDate');
      var isValid = true;
      var reportType = this.get('reportType');
      var startDate = this.get('startDate');
      if (reportType === 'status') {
        return true;
      }
      if (_ember['default'].isEmpty(startDate)) {
        alertMessage = 'Please enter a start date.';
        isValid = false;
      } else if (!_ember['default'].isEmpty(endDate) && endDate.getTime() < startDate.getTime()) {
        alertMessage = 'Please enter an end date after the start date.';
        isValid = false;
      }
      if (!isValid) {
        this.displayAlert('Error Generating Report', alertMessage);
      }
      return isValid;
    },

    actions: {
      generateReport: function generateReport() {
        var _this3 = this;

        if (this._validateDates()) {
          (function () {
            var reportRows = _this3.get('reportRows');
            var reportType = _this3.get('reportType');
            reportRows.clear();
            _this3.showProgressModal();
            switch (reportType) {
              case 'diagnostic':
                {
                  _this3._generateDiagnosticReport();
                  break;
                }
              case 'detailedProcedures':
              case 'procedures':
                {
                  _this3._generateProcedureReport(reportType);
                  break;
                }
              case 'admissions':
              case 'discharges':
              case 'detailedAdmissions':
              case 'detailedDischarges':
              case 'detailedPatientDays':
              case 'patientDays':
              case 'visit':
                {
                  _this3._findVisitsByDate().then((function (visits) {
                    switch (reportType) {
                      case 'admissions':
                      case 'detailedAdmissions':
                      case 'detailedDischarges':
                      case 'discharges':
                        {
                          this._generateAdmissionOrDischargeReport(visits, reportType);
                          break;
                        }
                      case 'detailedPatientDays':
                      case 'patientDays':
                        {
                          this._generatePatientDaysReport(visits, reportType);
                          break;
                        }
                      case 'visit':
                        {
                          this._generateVisitReport(visits);
                          break;
                        }
                    }
                  }).bind(_this3), (function (err) {
                    this._notifyReportError('Error in _findVisitsByDate: ' + err);
                  }).bind(_this3));
                  break;
                }
              case 'status':
                {
                  _this3._generateStatusReport();
                  break;
                }
            }
          })();
        }
      },
      viewPatient: function viewPatient(id) {
        this.store.find('patient', id).then((function (item) {
          item.set('returnTo', 'patients.reports');
          this.transitionToRoute('patients.edit', item);
        }).bind(this));
      }

    }
  });
});
define('hospitalrun/tests/patients/reports/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/reports/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/reports/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/reports/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend({
    pageTitle: (0, _emberI18n.translationMacro)('patients.titles.patientReport'),

    // No model for reports; data gets retrieved when report is run.
    model: function model() {
      return _ember['default'].RSVP.resolve(_ember['default'].Object.create({}));
    }

  });
});
define('hospitalrun/tests/patients/reports/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/reports/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/reports/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/route', ['exports', 'hospitalrun/routes/abstract-module-route', 'hospitalrun/mixins/patient-id', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractModuleRoute, _hospitalrunMixinsPatientId, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend(_hospitalrunMixinsPatientId['default'], {
    addCapability: 'add_patient',
    additionalModels: [{
      name: 'addressOptions',
      findArgs: ['option', 'address_options']
    }, {
      name: 'clinicList',
      findArgs: ['lookup', 'clinic_list']
    }, {
      name: 'countryList',
      findArgs: ['lookup', 'country_list']
    }, {
      name: 'diagnosisList',
      findArgs: ['lookup', 'diagnosis_list']
    }, {
      name: 'locationList',
      findArgs: ['lookup', 'visit_location_list']
    }, {
      name: 'physicianList',
      findArgs: ['lookup', 'physician_list']
    }, {
      name: 'pricingProfiles',
      findArgs: ['price-profile']
    }, {
      name: 'procedureList',
      findArgs: ['lookup', 'procedure_list']
    }, {
      name: 'sexList',
      findArgs: ['lookup', 'sex']
    }, {
      name: 'socialCustomForms',
      queryArgs: ['custom-form', {
        options: {
          key: 'socialwork'
        },
        mapReduce: 'custom_form_by_type'
      }]
    }, {
      name: 'statusList',
      findArgs: ['lookup', 'patient_status_list']
    }, {
      name: 'visitTypesList',
      findArgs: ['lookup', 'visit_types']
    }],

    actions: {
      createNewVisit: function createNewVisit(patient, requestedFromPatient) {
        var typeOfNewVisit = 'checkin';
        if (requestedFromPatient) {
          typeOfNewVisit = 'new';
        }
        this.transitionTo('visits.edit', typeOfNewVisit).then(function (newRoute) {
          if (requestedFromPatient) {
            newRoute.currentModel.set('returnToPatient', patient.get('id'));
          } else {
            newRoute.currentModel.set('returnTo', 'patients');
          }
          newRoute.currentModel.set('patient', patient);
          newRoute.currentModel.set('hidePatientSelection', true);
          newRoute.controller.getPatientDiagnoses(patient, newRoute.currentModel);
        });
      }
    },
    newButtonText: (0, _emberI18n.translationMacro)('patients.buttons.newPatient'),
    moduleName: 'patients'
  });
});
define('hospitalrun/tests/patients/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/search/controller', ['exports', 'hospitalrun/patients/index/controller'], function (exports, _hospitalrunPatientsIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPatientsIndexController['default'].extend();
});
define('hospitalrun/tests/patients/search/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/search/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/search/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/search/route', ['exports', 'hospitalrun/routes/abstract-search-route'], function (exports, _hospitalrunRoutesAbstractSearchRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractSearchRoute['default'].extend({
    moduleName: 'patients',
    searchKeys: [{
      name: 'friendlyId',
      type: 'contains'
    }, {
      name: 'externalPatientId',
      type: 'contains'
    }, {
      name: 'firstName',
      type: 'fuzzy'
    }, {
      name: 'lastName',
      type: 'fuzzy'
    }, {
      name: 'phone',
      type: 'contains'
    }],
    searchModel: 'patient'
  });
});
define('hospitalrun/tests/patients/search/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/search/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/search/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/socialwork/expense/controller', ['exports', 'ember', 'hospitalrun/mixins/is-update-disabled', 'hospitalrun/utils/select-values', 'ember-i18n'], function (exports, _ember, _hospitalrunMixinsIsUpdateDisabled, _hospitalrunUtilsSelectValues, _emberI18n) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsIsUpdateDisabled['default'], {
    patientsController: _ember['default'].inject.controller('patients'),

    categoryTypes: ['Clothing', 'Education', 'Electricity', 'Food', 'Fuel', 'Other', 'Rent', 'Transportation', 'Water'].map(_hospitalrunUtilsSelectValues['default'].selectValuesMap),

    editController: _ember['default'].computed.alias('patientsController'),
    showUpdateButton: true,
    title: (0, _emberI18n.translationMacro)('patients.titles.socialWork'),
    updateButtonAction: 'update',

    updateButtonText: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return this.get('i18n').t('buttons.add');
      } else {
        return this.get('i18n').t('buttons.update');
      }
    }).property('model.isNew'),

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      update: function update() {
        var model = this.get('model');
        this.get('editController').send('updateExpense', model);
      }
    }
  });
});
define('hospitalrun/tests/patients/socialwork/expense/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/socialwork/expense/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/socialwork/expense/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/patients/socialwork/family-info/controller', ['exports', 'ember', 'hospitalrun/mixins/is-update-disabled', 'ember-i18n'], function (exports, _ember, _hospitalrunMixinsIsUpdateDisabled, _emberI18n) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsIsUpdateDisabled['default'], {
    patientsController: _ember['default'].inject.controller('patients'),

    editController: _ember['default'].computed.alias('patientsController'),
    showUpdateButton: true,
    title: (0, _emberI18n.translationMacro)('patients.titles.familyInfo'),
    updateButtonAction: 'update',

    updateButtonText: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return this.get('i18n').t('buttons.add');
      } else {
        return this.get('i18n').t('buttons.update');
      }
    }).property('model.isNew'),

    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      },

      update: function update() {
        var model = this.get('model');
        this.get('editController').send('updateFamilyInfo', model);
      }
    }
  });
});
define('hospitalrun/tests/patients/socialwork/family-info/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - patients/socialwork/family-info/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'patients/socialwork/family-info/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller'], function (exports, _hospitalrunControllersAbstractDeleteController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: 'Delete Pricing Item'
  });
});
define('hospitalrun/tests/pricing/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/return-to', 'hospitalrun/utils/select-values'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsReturnTo, _hospitalrunUtilsSelectValues) {
  'use strict';

  var computed = _ember['default'].computed;
  var isEmpty = _ember['default'].isEmpty;

  var IMAGING_PRICING_TYPE = 'Imaging Procedure';
  var LAB_PRICING_TYPE = 'Lab Procedure';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsReturnTo['default'], {
    pricingController: _ember['default'].inject.controller('pricing'),

    actions: {
      addOverride: function addOverride(override) {
        var pricingOverrides = this.get('model.pricingOverrides');
        pricingOverrides.addObject(override);
        this.send('update', true);
        this.send('closeModal');
      },
      categoryChanged: function categoryChanged(category) {
        var model = this.get('model');
        var pricingType = model.get('pricingType');
        model.set('category', category);
        if (!isEmpty(category)) {
          if (category === 'Imaging') {
            model.set('pricingType', IMAGING_PRICING_TYPE);
          } else if (category === 'Lab') {
            model.set('pricingType', LAB_PRICING_TYPE);
          } else {
            var pricingTypeValues = this.get('pricingTypes.value');
            if (isEmpty(pricingTypeValues) || !pricingTypeValues.includes(pricingType)) {
              model.set('pricingType');
            }
          }
        }
      },
      deleteOverride: function deleteOverride(model) {
        var overrideToDelete = model.overrideToDelete;

        var pricingOverrides = this.get('model.pricingOverrides');
        pricingOverrides.removeObject(overrideToDelete);
        overrideToDelete.destroyRecord().then((function () {
          this.send('update', true);
          this.send('closeModal');
        }).bind(this));
      },
      editOverride: function editOverride(overrideToEdit) {
        if (isEmpty(overrideToEdit)) {
          overrideToEdit = this.store.createRecord('override-price');
        }
        this.send('openModal', 'pricing.override', overrideToEdit);
      },
      showDeleteOverride: function showDeleteOverride(overrideToDelete) {
        var message = 'Are you sure you want to delete this override?';
        var model = _ember['default'].Object.create({
          overrideToDelete: overrideToDelete
        });
        var title = 'Delete Override';
        this.displayConfirm(title, message, 'deleteOverride', model);
      }
    },

    categories: ['Imaging', 'Lab', 'Procedure', 'Ward'].map(_hospitalrunUtilsSelectValues['default'].selectValuesMap),
    expenseAccountList: computed.alias('pricingController.expenseAccountList'),
    procedurePricingTypes: computed.alias('pricingController.procedurePricingTypes'),
    wardPricingTypes: computed.alias('pricingController.wardPricingTypes'),

    lookupListsToUpdate: computed('model.category', function () {
      var category = this.get('model.category').toLowerCase();
      var listsToUpdate = [{
        name: 'expenseAccountList',
        property: 'model.expenseAccount',
        id: 'expense_account_list'
      }];
      var showPricingType = this.get('showPricingType');
      if (showPricingType) {
        listsToUpdate.push({
          name: category + 'PricingTypes',
          property: 'model.pricingType',
          id: category + '_pricing_types'
        });
      }
      return listsToUpdate;
    }),

    pricingTypes: computed('model.category', function () {
      var category = this.get('model.category');
      if (!isEmpty(category)) {
        var typesList = this.get(category.toLowerCase() + 'PricingTypes');
        return typesList;
      }
    }),

    showPricingType: computed('model.category', function () {
      var model = this.get('model');
      var category = model.get('category');
      if (category === 'Imaging' || category === 'Lab') {
        return false;
      } else {
        return true;
      }
    }),

    updateCapability: 'add_pricing',

    afterUpdate: function afterUpdate(record) {
      var message = 'The pricing record for ' + record.get('name') + ' has been saved.';
      this.displayAlert('Pricing Item Saved', message);
    }
  });
});
define('hospitalrun/tests/pricing/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    editTitle: 'Edit Pricing Item',
    modelName: 'pricing',
    newTitle: 'New Pricing Item',

    actions: {
      deleteOverride: function deleteOverride(overrideToDelete) {
        this.controller.send('deleteOverride', overrideToDelete);
      }
    },

    getNewData: function getNewData(params) {
      var newCategory = params.pricing_id.substr(3);
      if (_ember['default'].isEmpty(newCategory)) {
        newCategory = 'Imaging';
      }
      return _ember['default'].RSVP.resolve({
        category: newCategory
      });
    },

    model: function model(params) {
      var idParam = this.get('idParam');
      if (!_ember['default'].isEmpty(idParam) && params[idParam].indexOf('new') === 0) {
        return this._createNewRecord(params);
      } else {
        return this._super(params);
      }
    }

  });
});
define('hospitalrun/tests/pricing/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/imaging/controller', ['exports', 'hospitalrun/pricing/index/controller'], function (exports, _hospitalrunPricingIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexController['default'].extend();
});
define('hospitalrun/tests/pricing/imaging/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/imaging/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/imaging/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/imaging/route', ['exports', 'hospitalrun/pricing/index/route'], function (exports, _hospitalrunPricingIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexRoute['default'].extend({
    category: 'Imaging',
    pageTitle: 'Imaging Pricing',

    actions: {
      editItem: function editItem(item) {
        item.set('returnTo', 'pricing.imaging');
        this.transitionTo('pricing.edit', item);
      }
    }
  });
});
define('hospitalrun/tests/pricing/imaging/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/imaging/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/imaging/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    addPermission: 'add_pricing',
    deletePermission: 'delete_pricing',
    showCategory: true,
    startKey: []
  });
});
define('hospitalrun/tests/pricing/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    category: null,
    modelName: 'pricing',
    pageTitle: 'All Pricing Items',

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      var category = item.get('category');
      var id = this._getPouchIdFromItem(item);
      var name = item.get('name');
      var pricingType = item.get('pricingType');
      return [category, name, pricingType, id];
    },

    _modelQueryParams: function _modelQueryParams() {
      var category = this.get('category');
      var maxId = this._getMaxPouchId();
      var queryParams = {
        mapReduce: 'pricing_by_category'
      };
      if (!_ember['default'].isEmpty(category)) {
        queryParams.options = {
          startkey: [category, null, null, null],
          endkey: [category, {}, {}, maxId]
        };
      }
      return queryParams;
    },

    actions: {
      newItem: function newItem() {
        if (this.currentUserCan('add_pricing')) {
          var routeId = 'new';
          var routeParts = this.routeName.split('.');
          if (routeParts.length === 2 && routeParts[1] !== 'index') {
            routeId += routeParts[1].capitalize();
          }
          this.transitionTo('pricing.edit', routeId);
        }
      }
    }
  });
});
define('hospitalrun/tests/pricing/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/lab/controller', ['exports', 'hospitalrun/pricing/index/controller'], function (exports, _hospitalrunPricingIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexController['default'].extend();
});
define('hospitalrun/tests/pricing/lab/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/lab/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/lab/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/lab/route', ['exports', 'hospitalrun/pricing/index/route'], function (exports, _hospitalrunPricingIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexRoute['default'].extend({
    category: 'Lab',
    pageTitle: 'Lab Pricing',

    actions: {
      editItem: function editItem(item) {
        item.set('returnTo', 'pricing.lab');
        this.transitionTo('pricing.edit', item);
      }
    }
  });
});
define('hospitalrun/tests/pricing/lab/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/lab/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/lab/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/override/controller', ['exports', 'ember', 'hospitalrun/mixins/is-update-disabled', 'hospitalrun/utils/select-values'], function (exports, _ember, _hospitalrunMixinsIsUpdateDisabled, _hospitalrunUtilsSelectValues) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend(_hospitalrunMixinsIsUpdateDisabled['default'], {
    pricingController: _ember['default'].inject.controller('pricing'),

    actions: {
      cancel: function cancel() {
        this.get('model').rollbackAttributes();
        this.send('closeModal');
      },

      update: function update() {
        var isNew = this.get('model.isNew');
        var override = this.get('model');
        override.save().then((function () {
          if (isNew) {
            this.get('editController').send('addOverride', override);
          } else {
            this.send('closeModal');
          }
        }).bind(this));
      }
    },

    editController: _ember['default'].inject.controller('pricing/edit'),
    pricingProfiles: _ember['default'].computed.map('pricingController.pricingProfiles', _hospitalrunUtilsSelectValues['default'].selectObjectMap),
    showUpdateButton: true,

    title: (function () {
      if (this.get('model.isNew')) {
        return 'Add Override';
      } else {
        return 'Edit Override';
      }
    }).property('model.isNew'),

    updateButtonAction: 'update',
    updateButtonText: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return 'Add';
      } else {
        return 'Update';
      }
    }).property('model.isNew')

  });
});
define('hospitalrun/tests/pricing/override/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/override/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/override/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/procedure/controller', ['exports', 'hospitalrun/pricing/index/controller'], function (exports, _hospitalrunPricingIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexController['default'].extend();
});
define('hospitalrun/tests/pricing/procedure/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/procedure/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/procedure/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/procedure/route', ['exports', 'hospitalrun/pricing/index/route'], function (exports, _hospitalrunPricingIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexRoute['default'].extend({
    category: 'Procedure',
    pageTitle: 'Procedure Pricing',

    actions: {
      editItem: function editItem(item) {
        item.set('returnTo', 'pricing.procedure');
        this.transitionTo('pricing.edit', item);
      }
    }
  });
});
define('hospitalrun/tests/pricing/procedure/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/procedure/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/procedure/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/profiles/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller'], function (exports, _hospitalrunControllersAbstractPagedController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend({
    addPermission: 'add_pricing_profile',
    deletePermission: 'delete_pricing_profile'
  });
});
define('hospitalrun/tests/pricing/profiles/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/profiles/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/profiles/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/profiles/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller'], function (exports, _hospitalrunControllersAbstractEditController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    actions: {
      cancel: function cancel() {
        this.send('closeModal');
      }
    },

    afterUpdate: function afterUpdate(record) {
      var message = 'The pricing profile ' + record.get('name') + ' has been saved.';
      this.displayAlert('Pricing Profile Saved', message, 'refreshProfiles');
    },

    title: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return 'New Pricing Profile';
      } else {
        return 'Edit Pricing Profile';
      }
    }).property('model.isNew')
  });
});
define('hospitalrun/tests/pricing/profiles/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/profiles/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/profiles/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/profiles/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'ember', 'hospitalrun/mixins/modal-helper'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _ember, _hospitalrunMixinsModalHelper) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsModalHelper['default'], {
    category: null,
    modelName: 'price-profile',
    pageTitle: 'Pricing Profiles',

    actions: {
      editItem: function editItem(item) {
        this.send('openModal', 'pricing.profiles.edit', item);
      },

      deleteItem: function deleteItem(item) {
        var message = 'Are you sure you want to delete this profile?';
        var model = _ember['default'].Object.create({
          itemToDelete: item
        });
        var title = 'Delete Profile';
        this.displayConfirm(title, message, 'deletePricingProfile', model);
      },

      deletePricingProfile: function deletePricingProfile(model) {
        model.itemToDelete.set('archived', true);
        model.itemToDelete.save().then(function () {
          model.itemToDelete.unloadRecord();
        });
      },

      newItem: function newItem() {
        var newItem = this.store.createRecord('price-profile');
        this.send('openModal', 'pricing.profiles.edit', newItem);
      },

      refreshProfiles: function refreshProfiles() {
        this.refresh();
      }
    }
  });
});
define('hospitalrun/tests/pricing/profiles/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/profiles/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/profiles/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/route', ['exports', 'hospitalrun/routes/abstract-module-route'], function (exports, _hospitalrunRoutesAbstractModuleRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_pricing',
    additionalModels: [{
      name: 'expenseAccountList',
      findArgs: ['lookup', 'expense_account_list']
    }, {
      name: 'procedurePricingTypes',
      findArgs: ['lookup', 'procedure_pricing_types']
    }, {
      name: 'pricingProfiles',
      findArgs: ['price-profile']
    }, {
      name: 'wardPricingTypes',
      findArgs: ['lookup', 'ward_pricing_types']
    }],
    allowSearch: true,
    moduleName: 'pricing',
    newButtonText: '+ new item',
    sectionTitle: 'Pricing',
    subActions: [{
      text: 'All Pricing Items',
      linkTo: 'pricing.index'
    }, {
      text: 'Imaging Pricing',
      linkTo: 'pricing.imaging'
    }, {
      text: 'Lab Pricing',
      linkTo: 'pricing.lab'
    }, {
      text: 'Procedure Pricing',
      linkTo: 'pricing.procedure'
    }, {
      text: 'Ward Pricing',
      linkTo: 'pricing.ward'
    }, {
      text: 'Pricing Profiles',
      linkTo: 'pricing.profiles'
    }]
  });
});
define('hospitalrun/tests/pricing/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/search/controller', ['exports', 'hospitalrun/patients/index/controller'], function (exports, _hospitalrunPatientsIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPatientsIndexController['default'].extend();
});
define('hospitalrun/tests/pricing/search/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/search/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/search/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/search/route', ['exports', 'hospitalrun/routes/abstract-search-route'], function (exports, _hospitalrunRoutesAbstractSearchRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractSearchRoute['default'].extend({
    moduleName: 'pricing',
    searchKeys: [{
      'name': 'fuzzy'
    }],
    searchModel: 'pricing'
  });
});
define('hospitalrun/tests/pricing/search/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/search/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/search/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/ward/controller', ['exports', 'hospitalrun/pricing/index/controller'], function (exports, _hospitalrunPricingIndexController) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexController['default'].extend();
});
define('hospitalrun/tests/pricing/ward/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/ward/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/ward/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/pricing/ward/route', ['exports', 'hospitalrun/pricing/index/route'], function (exports, _hospitalrunPricingIndexRoute) {
  'use strict';

  exports['default'] = _hospitalrunPricingIndexRoute['default'].extend({
    category: 'Ward',
    pageTitle: 'Ward Pricing',

    actions: {
      editItem: function editItem(item) {
        item.set('returnTo', 'pricing.ward');
        this.transitionTo('pricing.edit', item);
      }
    }
  });
});
define('hospitalrun/tests/pricing/ward/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - pricing/ward/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'pricing/ward/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/print/invoice/controller', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Controller.extend({
    actions: {
      returnToInvoice: function returnToInvoice() {
        this.transitionTo('invoices.edit', this.get('model'));
      }
    }
  });
});
define('hospitalrun/tests/print/invoice/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - print/invoice/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'print/invoice/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/procedures/charge/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    cancelAction: 'closeModal',
    newCharge: false,
    newPricingItem: false,
    requestingController: _ember['default'].inject.controller('procedures/edit'),
    database: _ember['default'].inject.service(),
    pricingList: _ember['default'].computed.alias('requestingController.pricingList'),
    selectedItem: null,
    updateCapability: 'add_charge',

    title: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return this.get('i18n').t('procedures.titles.addChargeItem');
      }
      return this.get('i18n').t('procedures.titles.editChargeItem');
    }).property('model.isNew'),

    beforeUpdate: function beforeUpdate() {
      var _this = this;

      this.set('newCharge', this.get('model.isNew'));
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        var model = _this.get('model');
        var pricingItem = model.get('pricingItem');
        var selectedItem = _this.get('selectedItem');
        if (!_ember['default'].isEmpty(selectedItem) && (_ember['default'].isEmpty(pricingItem) || selectedItem.id !== pricingItem.get('id'))) {
          _this.store.find('pricing', selectedItem.id).then(function (item) {
            model.set('pricingItem', item);
            resolve();
          });
        } else {
          (function () {
            var newItem = false;
            var saveItem = false;
            if (_ember['default'].isEmpty(pricingItem)) {
              pricingItem = _this.store.createRecord('pricing', {
                name: model.get('itemName'),
                category: model.get('pricingCategory')
              });
              newItem = true;
              saveItem = true;
            } else {
              if (pricingItem.get('name') !== model.get('itemName')) {
                pricingItem.set('name', model.get('itemName'));
                saveItem = true;
              }
            }
            if (saveItem) {
              pricingItem.save().then(function () {
                var pricingList = _this.get('pricingList');
                if (newItem) {
                  pricingList.addObject({
                    id: pricingItem.get('id'),
                    name: pricingItem.get('name')
                  });
                  model.set('pricingItem', pricingItem);
                } else {
                  var itemToUpdate = pricingList.findBy('id', pricingItem.get('id'));
                  itemToUpdate.name = pricingItem.get('name');
                }
                resolve();
              }, reject);
            } else {
              resolve();
            }
          })();
        }
      });
    },

    afterUpdate: function afterUpdate(record) {
      if (this.get('newCharge') === true) {
        this.get('requestingController').send('addCharge', record);
      } else {
        this.send('closeModal');
      }
    }
  });
});
define('hospitalrun/tests/procedures/charge/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - procedures/charge/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'procedures/charge/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/procedures/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/charge-actions', 'ember', 'hospitalrun/mixins/patient-submodule'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsChargeActions, _ember, _hospitalrunMixinsPatientSubmodule) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsChargeActions['default'], _hospitalrunMixinsPatientSubmodule['default'], {
    visitsController: _ember['default'].inject.controller('visits'),

    chargePricingCategory: 'Procedure',
    chargeRoute: 'procedures.charge',

    anesthesiaTypes: _ember['default'].computed.alias('visitsController.anesthesiaTypes'),
    anesthesiologistList: _ember['default'].computed.alias('visitsController.anesthesiologistList'),
    cptCodeList: _ember['default'].computed.alias('visitsController.cptCodeList'),
    medicationList: null,
    physicianList: _ember['default'].computed.alias('visitsController.physicianList'),
    procedureList: _ember['default'].computed.alias('visitsController.procedureList'),
    procedureLocations: _ember['default'].computed.alias('visitsController.procedureLocations'),
    lookupListsToUpdate: [{
      name: 'anesthesiaTypes',
      property: 'model.anesthesiaType',
      id: 'anesthesia_types'
    }, {
      name: 'anesthesiologistList',
      property: 'model.anesthesiologist',
      id: 'anesthesiologists'
    }, {
      name: 'cptCodeList',
      property: 'model.cptCode',
      id: 'cpt_code_list'
    }, {
      name: 'physicianList',
      property: 'model.assistant',
      id: 'physician_list'
    }, {
      name: 'physicianList',
      property: 'model.physician',
      id: 'physician_list'
    }, {
      name: 'procedureList',
      property: 'model.description',
      id: 'procedure_list'
    }, {
      name: 'procedureLocations',
      property: 'model.location',
      id: 'procedure_locations'
    }],

    editController: _ember['default'].inject.controller('visits/edit'),
    pricingList: null, // This gets filled in by the route
    pricingTypes: _ember['default'].computed.alias('visitsController.procedurePricingTypes'),
    newProcedure: false,

    title: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return this.get('i18n').t('procedures.titles.add');
      }
      return this.get('i18n').t('procedures.titles.edit');
    }).property('model.isNew'),

    updateCapability: 'add_procedure',

    actions: {
      showAddMedication: function showAddMedication() {
        var newCharge = this.get('store').createRecord('proc-charge', {
          dateCharged: new Date(),
          newMedicationCharge: true,
          quantity: 1
        });
        this.send('openModal', 'procedures.medication', newCharge);
      },

      showEditMedication: function showEditMedication(charge) {
        var medicationList = this.get('medicationList');
        var selectedMedication = medicationList.findBy('id', charge.get('medication.id'));
        charge.set('itemName', selectedMedication.name);
        this.send('openModal', 'procedures.medication', charge);
      },

      showDeleteMedication: function showDeleteMedication(charge) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          closeModalOnConfirm: false,
          confirmAction: 'deleteCharge',
          title: this.get('i18n').t('procedures.titles.deleteMedicationUsed'),
          name: this.get('i18n').t('models.medication.names.singular'),
          message: this.get('i18n').t('messages.delete_singular', { name: this.name }),
          chargeToDelete: charge,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      }
    },

    beforeUpdate: function beforeUpdate() {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        this.updateCharges().then((function () {
          if (this.get('model.isNew')) {
            this.addChildToVisit(this.get('model'), 'procedures').then(resolve, reject);
          } else {
            resolve();
          }
        }).bind(this), reject);
      }).bind(this));
    },

    afterUpdate: function afterUpdate() {
      var alertTitle = this.get('i18n').t('procedures.titles.saved');
      var alertMessage = this.get('i18n').t('procedures.messages.saved');
      this.saveVisitIfNeeded(alertTitle, alertMessage);
    }
  });
});
define('hospitalrun/tests/procedures/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - procedures/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'procedures/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/procedures/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'hospitalrun/mixins/charge-route', 'ember', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _hospitalrunMixinsChargeRoute, _ember, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], _hospitalrunMixinsChargeRoute['default'], {
    editTitle: (0, _emberI18n.translationMacro)('procedures.titles.edit'),
    modelName: 'procedure',
    newTitle: (0, _emberI18n.translationMacro)('procedures.titles.new'),
    pricingCategory: 'Procedure',
    database: _ember['default'].inject.service(),

    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        procedureDate: new Date()
      });
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      var medicationQuery = {
        key: 'Medication',
        include_docs: true
      };
      this.get('database').queryMainDB(medicationQuery, 'inventory_by_type').then(function (result) {
        var medicationList = result.rows.map(function (medication) {
          return medication.doc;
        });
        controller.set('medicationList', medicationList);
      });
    }
  });
});
define('hospitalrun/tests/procedures/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - procedures/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'procedures/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/procedures/medication/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    cancelAction: 'closeModal',
    newCharge: false,
    requestingController: _ember['default'].inject.controller('procedures/edit'),
    medicationList: _ember['default'].computed.alias('requestingController.medicationList'),

    updateCapability: 'add_charge',

    title: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return this.get('i18n').t('procedures.titles.addMedicationUsed');
      }
      return this.get('i18n').t('procedures.titles.editMedicationUsed');
    }).property('model.isNew'),

    beforeUpdate: function beforeUpdate() {
      var isNew = this.get('model.isNew');
      if (isNew) {
        this.set('newCharge', true);
        var model = this.get('model');
        var inventoryItem = model.get('inventoryItem');
        model.set('medication', inventoryItem);
        model.set('medicationTitle', inventoryItem.get('name'));
        model.set('priceOfMedication', inventoryItem.get('price'));
      }
      return _ember['default'].RSVP.Promise.resolve();
    },

    afterUpdate: function afterUpdate(record) {
      if (this.get('newCharge')) {
        this.get('requestingController').send('addCharge', record);
      } else {
        this.send('closeModal');
      }
    }
  });
});
define('hospitalrun/tests/procedures/medication/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - procedures/medication/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'procedures/medication/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/resolver', ['exports', 'ember-resolver'], function (exports, _emberResolver) {
  'use strict';

  exports['default'] = _emberResolver['default'];
});
define('hospitalrun/tests/resolver.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - resolver.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'resolver.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/router', ['exports', 'ember', 'hospitalrun/tests/config/environment'], function (exports, _ember, _hospitalrunTestsConfigEnvironment) {
  'use strict';

  var Router = _ember['default'].Router.extend({
    location: _hospitalrunTestsConfigEnvironment['default'].locationType,
    rootURL: _hospitalrunTestsConfigEnvironment['default'].rootURL
  });

  Router.map(function () {
    this.route('admin', function () {
      this.route('address');
      this.route('print-header');
      this.route('custom-forms', function () {
        this.route('edit', { path: '/edit/:custom-form_id' });
      });
      this.route('loaddb');
      this.route('inc-category', {
        resetNamespace: true
      }, function () {
        this.route('edit', { path: '/edit/:inc-category_id' });
      });
      this.route('lookup', { path: '/' });
      this.route('textreplace');
      this.route('users', {
        resetNamespace: true
      }, function () {
        this.route('edit', { path: '/edit/:user_id' });
      });
      this.route('roles');
      this.route('query');
      this.route('visit-forms');
      this.route('workflow');
    });

    this.route('appointments', function () {
      this.route('edit', { path: '/edit/:appointment_id' });
      this.route('search');
      this.route('today');
      this.route('calendar');
      this.route('theater');
    });

    this.route('finishgauth', { path: '/finishgauth/:s1/:s2/:k/:t/:i/:p' });

    this.route('index', { path: '/' });

    this.route('imaging', function () {
      this.route('completed');
      this.route('edit', { path: '/edit/:imaging_id' });
    });

    this.route('inventory', function () {
      this.route('barcode', { path: '/barcode/:inventory_id' });
      this.route('edit', { path: '/edit/:inventory_id' });
      this.route('batch', { path: '/batch/:inventory-batch_id' });
      this.route('listing');
      this.route('reports');
      this.route('request', { path: '/request/:inv-request_id' });
      this.route('search', { path: '/search/:search_text' });
    });

    this.route('incident', function () {
      this.route('completed');
      this.route('edit', { path: '/edit/:incident_id' });
      this.route('reports');
    });

    this.route('invoices', function () {
      this.route('cashier');
      this.route('edit', { path: '/edit/:invoice_id' });
      this.route('search', { path: '/search/:search_text' });
    });

    this.route('labs', function () {
      this.route('completed');
      this.route('edit', { path: '/edit/:lab_id' });
    });

    this.route('login');

    this.route('medication', function () {
      this.route('completed');
      this.route('edit', { path: '/edit/:medication_id' });
      this.route('return', { path: '/return/:inv-request_id' });
      this.route('search', { path: '/search/:search_text' });
    });

    this.route('patients', function () {
      this.route('edit', { path: '/edit/:patient_id' });
      this.route('reports');
      this.route('admitted');
      this.route('search', { path: '/search/:search_text' });
      this.route('operative-plan', { path: '/operative-plan/:operative-plan_id' });
      this.route('operation-report', { path: '/operation-report/:operation-report_id' });
      this.route('outpatient');
    });

    this.route('pricing', function () {
      this.route('imaging');
      this.route('lab');
      this.route('procedure');
      this.route('ward');
      this.route('edit', { path: '/edit/:pricing_id' });
      this.route('search', { path: '/search/:search_text' });
      this.route('profiles');
    });

    this.route('print', function () {
      this.route('invoice', { path: '/invoice/:invoice_id' });
    });

    this.route('visits', function () {
      this.route('edit', { path: '/edit/:visit_id' });
      this.route('procedures', {
        resetNamespace: true
      }, function () {
        this.route('edit', { path: '/edit/:procedure_id' });
      });
      this.route('reports', function () {
        this.route('edit', { path: '/edit/:report_id' });
      });
    });
  });

  exports['default'] = Router;
});
define('hospitalrun/tests/router.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - router.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'router.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/abstract-edit-route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _ember) {
  'use strict';

  var get = _ember['default'].get;
  exports['default'] = _ember['default'].Route.extend(_emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    editTitle: null,
    hideNewButton: false,
    modelName: null,
    newTitle: null,

    _createNewRecord: function _createNewRecord(params) {
      return new _ember['default'].RSVP.Promise((function (resolve) {
        this.generateId().then((function (newId) {
          this.getNewData(params).then((function (data) {
            var modelName = get(this, 'modelName');
            if (newId) {
              data.id = newId;
            }
            if (newId && this.store.hasRecordForId(modelName, newId)) {
              resolve(this.store.push(this.store.normalize(modelName, data)));
            } else {
              resolve(this.store.createRecord(modelName, data));
            }
          }).bind(this));
        }).bind(this));
      }).bind(this));
    },

    idParam: (function () {
      var modelName = get(this, 'modelName');
      return modelName + '_id';
    }).property('modelName'),

    /**
     * Override this function to generate an id for a new record
     * @return a promise that will resolved to a generated id;default is null which means that an
     * id will be automatically generated via Ember data.
     */
    generateId: function generateId() {
      return _ember['default'].RSVP.resolve(null);
    },

    /**
     * Override this function to define what data a new model should be instantiated with.
     * @return a promise that will resolve with the data for a new record; defaults to empty object.
     */
    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({});
    },

    getScreenTitle: function getScreenTitle(model) {
      if (get(model, 'isNew')) {
        return get(this, 'newTitle');
      } else {
        return get(this, 'editTitle');
      }
    },

    model: function model(params) {
      var idParam = get(this, 'idParam');
      if (!_ember['default'].isEmpty(idParam) && params[idParam] === 'new') {
        return this._createNewRecord(params);
      } else {
        return this._super(params);
      }
    },

    setupController: function setupController(controller, model) {
      var sectionDetails = {};
      sectionDetails.currentScreenTitle = this.getScreenTitle(model);
      if (get(this, 'hideNewButton')) {
        sectionDetails.newButtonAction = null;
      }
      this.send('setSectionHeader', sectionDetails);
      this._super(controller, model);
    }
  });
});
define('hospitalrun/tests/routes/abstract-edit-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/abstract-edit-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/abstract-edit-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/abstract-index-route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember', 'hospitalrun/mixins/pouchdb', 'hospitalrun/mixins/progress-dialog'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _ember, _hospitalrunMixinsPouchdb, _hospitalrunMixinsProgressDialog) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Route.extend(_hospitalrunMixinsPouchdb['default'], _hospitalrunMixinsProgressDialog['default'], _emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    database: _ember['default'].inject.service(),
    filterParams: null,
    firstKey: null,
    hideNewButton: false,
    itemsPerPage: 25,
    modelName: null,
    newButtonAction: null,
    newButtonText: null,
    nextStartKey: null,
    pageTitle: null,

    _getFilterParams: function _getFilterParams(params) {
      var filterByList = [];
      var filterParams = this.get('filterParams');
      if (!isEmpty(filterParams)) {
        filterParams.forEach(function (paramName) {
          if (!isEmpty(params[paramName])) {
            filterByList.push({
              name: paramName,
              value: params[paramName]
            });
          }
        });
      }
      return filterByList;
    },

    _getMaxPouchId: function _getMaxPouchId() {
      return this.get('database').getMaxPouchId(this.get('modelName').camelize());
    },

    _getMinPouchId: function _getMinPouchId() {
      return this.get('database').getMinPouchId(this.get('modelName').camelize());
    },

    _getPouchIdFromItem: function _getPouchIdFromItem(item) {
      return this.get('database').getPouchId(item.get('id'), this.get('modelName').camelize());
    },

    _getStartKeyFromItem: function _getStartKeyFromItem(item) {
      return item.get('id');
    },

    _modelQueryParams: function _modelQueryParams() {
      return {};
    },

    model: function model(params) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var filterParams = this._getFilterParams(params);
        var modelName = this.get('modelName');
        var itemsPerPage = this.get('itemsPerPage');
        var queryParams = this._modelQueryParams(params);
        if (!isEmpty(params.sortKey)) {
          queryParams.sortKey = params.sortKey;
          if (!isEmpty(params.sortDesc)) {
            queryParams.sortDesc = params.sortDesc;
          }
        }
        if (!isEmpty(filterParams)) {
          queryParams.filterBy = filterParams;
        }
        if (isEmpty(queryParams.options)) {
          queryParams.options = {};
        }
        if (!isEmpty(itemsPerPage)) {
          queryParams.options.limit = itemsPerPage + 1;
        }
        if (!isEmpty(params.startKey)) {
          queryParams.options.startkey = params.startKey;
        }
        this.store.query(modelName, queryParams).then((function (model) {
          if (!isEmpty(itemsPerPage)) {
            if (model.get('length') > 0) {
              this.set('firstKey', this._getStartKeyFromItem(model.get('firstObject')));
            }
            if (model.get('length') > itemsPerPage) {
              var lastItem = model.popObject();
              this.set('nextStartKey', this._getStartKeyFromItem(lastItem));
            } else {
              this.set('nextStartKey');
            }
          }
          resolve(model);
        }).bind(this), reject);
      }).bind(this));
    },

    queryParams: {
      sortDesc: { refreshModel: true },
      sortKey: { refreshModel: true },
      startKey: { refreshModel: true }
    },

    setupController: function setupController(controller, model) {
      var props = this.getProperties('firstKey', 'nextStartKey');
      controller.setProperties(props);
      var sectionDetails = {
        currentScreenTitle: this.get('pageTitle')
      };
      if (this.get('hideNewButton')) {
        sectionDetails.newButtonAction = null;
      } else if (!isEmpty(this.get('newButtonAction'))) {
        sectionDetails.newButtonAction = this.get('newButtonAction');
      }
      if (!isEmpty(this.get('newButtonText'))) {
        sectionDetails.newButtonText = this.get('newButtonText');
      }
      this.send('setSectionHeader', sectionDetails);
      this.closeProgressModal();
      this._super(controller, model);
    }
  });
});
define('hospitalrun/tests/routes/abstract-index-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/abstract-index-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/abstract-index-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/abstract-module-route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember', 'hospitalrun/mixins/user-session'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _ember, _hospitalrunMixinsUserSession) {
  'use strict';

  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }

  /**
   * Abstract route for top level modules (eg patients, inventory, users)
   */
  exports['default'] = _ember['default'].Route.extend(_hospitalrunMixinsUserSession['default'], _emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    addCapability: null,
    additionalModels: null,
    allowSearch: true,
    currentScreenTitle: null,
    moduleName: null,
    newButtonText: null,
    sectionTitle: null,
    subActions: null,

    editPath: (function () {
      var module = this.get('moduleName');
      return module + '.edit';
    }).property('moduleName'),

    deletePath: (function () {
      var module = this.get('moduleName');
      return module + '.delete';
    }).property('moduleName'),

    newButtonAction: (function () {
      if (this.currentUserCan(this.get('addCapability'))) {
        return 'newItem';
      } else {
        return null;
      }
    }).property(),

    searchRoute: (function () {
      var module = this.get('moduleName');
      return '/' + module + '/search';
    }).property('moduleName'),

    actions: {
      allItems: function allItems() {
        this.transitionTo(this.get('moduleName') + '.index');
      },
      deleteItem: function deleteItem(item) {
        var deletePath = this.get('deletePath');
        this.send('openModal', deletePath, item);
      },
      editItem: function editItem(item) {
        this.transitionTo(this.get('editPath'), item);
      },
      newItem: function newItem() {
        if (this.currentUserCan(this.get('addCapability'))) {
          this.transitionTo(this.get('editPath'), 'new');
        }
      },

      /**
       * Action to set items in the section header.
       * @param details an object containing details to set on the section header.
       * The following parameters are supported:
       * - currentScreenTitle - The current screen title.
       * - newButtonText - The text to display for the "new" button.
       * - newButtonAction - The action to fire for the "new" button.
       */
      setSectionHeader: function setSectionHeader(details) {
        var currentController = this.controllerFor(this.get('moduleName'));
        currentController.setProperties(details);
      }

    },

    /**
     * Make sure the user has permissions to the module; if not reroute to index.
     */
    beforeModel: function beforeModel(transition) {
      var moduleName = this.get('moduleName');
      if (this.currentUserCan(moduleName)) {
        return this._super(transition);
      } else {
        this.transitionTo('index');
        return _ember['default'].RSVP.reject('Not available');
      }
    },

    model: function model() {
      if (!_ember['default'].isEmpty(this.additionalModels)) {
        return new _ember['default'].RSVP.Promise((function (resolve, reject) {
          var promises = this.additionalModels.map((function (modelMap) {

            if (modelMap.queryArgs) {
              var _store;

              return (_store = this.store).query.apply(_store, _toConsumableArray(modelMap.queryArgs));
            } else if (modelMap.findArgs.length === 1) {
              var _store2;

              return (_store2 = this.store).findAll.apply(_store2, _toConsumableArray(modelMap.findArgs));
            } else {
              var _store3;

              return (_store3 = this.store).find.apply(_store3, _toConsumableArray(modelMap.findArgs));
            }
          }).bind(this));
          _ember['default'].RSVP.allSettled(promises, 'All additional Models for ' + this.get('moduleName')).then((function (array) {
            array.forEach((function (item, index) {
              if (item.state === 'fulfilled') {
                this.set(this.additionalModels[index].name, item.value);
              }
            }).bind(this));
            resolve();
          }).bind(this), reject);
        }).bind(this), 'Additional Models for ' + this.get('moduleName'));
      } else {
        return _ember['default'].RSVP.resolve();
      }
    },

    renderTemplate: function renderTemplate() {
      this.render('section');
    },

    setupController: function setupController(controller, model) {
      var navigationController = this.controllerFor('navigation');
      if (this.get('allowSearch') === true) {
        navigationController.set('allowSearch', true);
        navigationController.set('searchRoute', this.get('searchRoute'));
      } else {
        navigationController.set('allowSearch', false);
      }
      var currentController = this.controllerFor(this.get('moduleName'));
      var propsToSet = this.getProperties('additionalButtons', 'currentScreenTitle', 'newButtonAction', 'newButtonText', 'sectionTitle', 'subActions');
      currentController.setProperties(propsToSet);
      if (!_ember['default'].isEmpty(this.additionalModels)) {
        this.additionalModels.forEach((function (item) {
          controller.set(item.name, this.get(item.name));
        }).bind(this));
      }
      this._super(controller, model);
    }

  });
});
define('hospitalrun/tests/routes/abstract-module-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/abstract-module-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/abstract-module-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/abstract-search-route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember-data', 'ember'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _emberData, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Route.extend(_emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    searchKeys: null,
    searchModel: null,
    searchText: null,

    _findByContains: function _findByContains(searchText) {
      var searchKeys = this.get('searchKeys');
      var searchModel = this.get('searchModel');
      var queryParams = {
        containsValue: {
          value: searchText,
          keys: searchKeys
        }
      };
      return this.store.query(searchModel, queryParams);
    },

    model: function model(params) {
      return new _ember['default'].RSVP.Promise((function (resolve) {
        var searchText = params.search_text;
        this.controllerFor('navigation').set('currentSearchText', searchText);
        this.set('searchText', searchText);
        this._findByContains(searchText).then(resolve, (function (err) {
          resolve(new _emberData['default'].AdapterPopulatedRecordArray());
          throw new Error(err);
        }).bind(this));
      }).bind(this));
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      if (!_ember['default'].isEmpty(model)) {
        controller.set('hasRecords', model.get('length') > 0);
      } else {
        controller.set('hasRecords', false);
      }
      controller.set('searchText', this.get('searchText'));
      this.controllerFor('navigation').closeProgressModal();
      var parentController = this.controllerFor(this.get('moduleName'));
      var searchTitle = 'Search Results for <i>' + _ember['default'].Handlebars.Utils.escapeExpression(this.get('searchText')) + '</i>';
      parentController.set('currentScreenTitle', searchTitle.htmlSafe());
    }

  });
});
define('hospitalrun/tests/routes/abstract-search-route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/abstract-search-route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/abstract-search-route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/application', ['exports', 'ember-simple-auth/mixins/application-route-mixin', 'ember', 'hospitalrun/mixins/modal-helper', 'hospitalrun/mixins/setup-user-role', 'hospitalrun/utils/unauthorized-error'], function (exports, _emberSimpleAuthMixinsApplicationRouteMixin, _ember, _hospitalrunMixinsModalHelper, _hospitalrunMixinsSetupUserRole, _hospitalrunUtilsUnauthorizedError) {
  'use strict';

  function _instanceof(left, right) { if (right != null && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }

  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var Route = _ember['default'].Route;
  var set = _ember['default'].set;

  var TRANSITION_AFTER_LOGIN = 'transitionAfterLogin';

  var ApplicationRoute = Route.extend(_emberSimpleAuthMixinsApplicationRouteMixin['default'], _hospitalrunMixinsModalHelper['default'], _hospitalrunMixinsSetupUserRole['default'], {
    database: inject.service(),
    config: inject.service(),
    session: inject.service(),
    shouldSetupUserRole: true,

    actions: {
      closeModal: function closeModal() {
        this.render('empty', {
          outlet: 'modal',
          into: 'application'
        });
      },

      error: function error(reason, transition) {
        var _this = this;

        if (_instanceof(reason, _hospitalrunUtilsUnauthorizedError['default'])) {
          (function () {
            var i18n = _this.get('i18n');
            var message = i18n.t('application.messages.sessionExpired');
            var session = get(_this, 'session');
            var title = i18n.t('application.titles.sessionExpired');
            if (!isEmpty(transition)) {
              var sessionStore = session.get('store');
              var sessionData = session.get('data');
              var transitionName = undefined;
              if (transition.targetName) {
                transitionName = transition.targetName;
              } else {
                transitionName = transition;
              }
              set(sessionData, TRANSITION_AFTER_LOGIN, transitionName);
              sessionStore.persist(sessionData).then(function () {
                _this.displayAlert(title, message, 'unauthorizeSession');
              });
            } else {
              _this.displayAlert(title, message, 'unauthorizeSession');
            }
          })();
        } else {
          this._super(reason);
        }
      },

      /**
       * Render a modal using the specifed path and optionally set a model.
       * @param modalPath the path to use for the controller and template.
       * @param model (optional) the model to set on the controller for the modal.
       */
      openModal: function openModal(modalPath, model) {
        if (model) {
          set(this.controllerFor(modalPath), 'model', model);
        }
        this.renderModal(modalPath);
      },

      unauthorizeSession: function unauthorizeSession() {
        var session = get(this, 'session');
        if (get(session, 'isAuthenticated')) {
          session.invalidate();
        }
      },

      /**
       * Update an open modal using the specifed model.
       * @param modalPath the path to use for the controller and template.
       * @param model (optional) the model to set on the controller for the modal.
       */
      updateModal: function updateModal(modalPath, model) {
        set(this.controllerFor(modalPath), 'model', model);
      }
    },

    model: function model(params, transition) {
      var _this2 = this;

      var session = get(this, 'session');
      var isAuthenticated = session && get(session, 'isAuthenticated');
      var config = get(this, 'config');
      var database = get(this, 'database');

      return config.setup().then(function () {
        var standAlone = config.get('standAlone');
        if (transition.targetName !== 'finishgauth' && transition.targetName !== 'login') {
          set(_this2, 'shouldSetupUserRole', true);
          if (isAuthenticated || standAlone) {
            return database.setup()['catch'](function () {
              // Error thrown indicates missing auth, so invalidate session.
              session.invalidate();
            });
          }
        } else if (transition.targetName === 'login' && standAlone) {
          return database.createUsersDB();
        } else if (transition.targetName === 'finishgauth') {
          set(_this2, 'shouldSetupUserRole', false);
        }
      });
    },

    afterModel: function afterModel() {
      set(this.controllerFor('navigation'), 'allowSearch', false);
      $('#apploading').remove();
    },

    renderModal: function renderModal(template) {
      this.render(template, {
        into: 'application',
        outlet: 'modal'
      });
    },

    sessionAuthenticated: function sessionAuthenticated() {
      var _this3 = this;

      if (get(this, 'shouldSetupUserRole') === true) {
        this.setupUserRole();
      }
      var session = get(this, 'session');
      var sessionData = session.get('data');
      var transitionAfterLogin = get(sessionData, TRANSITION_AFTER_LOGIN);
      if (!isEmpty(transitionAfterLogin)) {
        var sessionStore = session.get('store');
        set(sessionData, 'transitionAfterLogin', null);
        sessionStore.persist(sessionData).then(function () {
          _this3.transitionTo(transitionAfterLogin);
        });
      } else {
        this._super();
      }
    }
  });
  exports['default'] = ApplicationRoute;
});
define('hospitalrun/tests/routes/application.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/application.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/application.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/index', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'hospitalrun/mixins/navigation', 'hospitalrun/mixins/user-roles', 'ember'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _hospitalrunMixinsNavigation, _hospitalrunMixinsUserRoles, _ember) {
  'use strict';

  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _ember['default'].Route.extend(_emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], _hospitalrunMixinsNavigation['default'], _hospitalrunMixinsUserRoles['default'], {
    session: inject.service(),
    beforeModel: function beforeModel() {
      var session = this.get('session');
      if (!isEmpty(session)) {
        var role = session.get('data.authenticated.role');
        if (!isEmpty(role)) {
          var userRole = this.findUserRole(role);
          if (!isEmpty(userRole) && !isEmpty(userRole.defaultRoute)) {
            var navelement = this.findNavItemByRoute(userRole.defaultRoute);
            // validate that there really is a navigation element that matches that route.
            if (!isEmpty(navelement)) {
              return this.transitionTo(navelement.route);
            }
          }
        }
      }
      return this._super.apply(this, arguments);
    },

    afterModel: function afterModel() {
      this.controllerFor('navigation').set('allowSearch', false);
    },

    actions: {
      createNewUser: function createNewUser() {
        return this.transitionTo('users.edit', 'new');
      }
    }
  });
});
define('hospitalrun/tests/routes/index.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/index.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/index.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/routes/login', ['exports', 'ember', 'ember-simple-auth/mixins/unauthenticated-route-mixin'], function (exports, _ember, _emberSimpleAuthMixinsUnauthenticatedRouteMixin) {
  'use strict';

  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var Route = _ember['default'].Route;
  exports['default'] = Route.extend(_emberSimpleAuthMixinsUnauthenticatedRouteMixin['default'], {
    config: inject.service(),
    database: inject.service(),

    requireLogin: alias('database.requireLogin'),
    standAlone: alias('config.standAlone'),

    beforeModel: function beforeModel(transition) {
      var session = get(this, 'session');
      if (get(session, 'isAuthenticated')) {
        this._super(transition);
      } else {
        var requireLogin = get(this, 'requireLogin');
        var standAlone = get(this, 'standAlone');
        if (standAlone === true && requireLogin === false) {
          return this.get('session').authenticate('authenticator:custom', {
            identification: 'hradmin',
            password: 'test'
          });
        } else {
          return get(this, 'config').useGoogleAuth().then(function (useGoogleAuth) {
            if (useGoogleAuth) {
              window.location.replace('/auth/google');
            }
          });
        }
      }
    }
  });
});
define('hospitalrun/tests/routes/login.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - routes/login.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'routes/login.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/serializers/application', ['exports', 'ember-pouch'], function (exports, _emberPouch) {
  'use strict';

  exports['default'] = _emberPouch.Serializer.extend();
});
define('hospitalrun/tests/serializers/application.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - serializers/application.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'serializers/application.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/serializers/user', ['exports', 'ember-data'], function (exports, _emberData) {
  'use strict';

  var couchSerializer = _emberData['default'].JSONSerializer.extend({
    attrs: {
      rev: '_rev'
    },
    primaryKey: '_id',

    isNewSerializerAPI: true,

    normalizeArrayResponse: function normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
      var newPayload = payload.rows.map((function (row) {
        return row.doc;
      }).bind(this));
      return this._super(store, primaryModelClass, newPayload, id, requestType);
    },

    normalizeSaveResponse: function normalizeSaveResponse(store, primaryModelClass, payload) {
      return {
        data: {
          id: payload.id,
          type: 'user',
          attrs: {
            rev: payload.rev
          }
        }
      };
    }

  });

  exports['default'] = couchSerializer;
});
define('hospitalrun/tests/serializers/user.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - serializers/user.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'serializers/user.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/services/config', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var RSVP = _ember['default'].RSVP;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var run = _ember['default'].run;
  var set = _ember['default'].set;
  exports['default'] = _ember['default'].Service.extend({
    configDB: null,
    database: inject.service(),
    session: inject.service(),
    sessionData: _ember['default'].computed.alias('session.data'),
    standAlone: false,
    needsUserSetup: false,
    markUserSetupComplete: function markUserSetupComplete() {
      var _this = this;

      if (get(this, 'needsUserSetup') === true) {
        var _ret = (function () {
          set(_this, 'needsUserSetup', false);
          var config = _this.get('configDB');
          return {
            v: new RSVP.Promise(function (resolve, reject) {
              config.put({ _id: 'config_user_setup_flag', value: false }, function (err, doc) {
                if (err) {
                  reject(err);
                }
                resolve(doc);
              });
            })
          };
        })();

        if (typeof _ret === 'object') return _ret.v;
      } else {
        return RSVP.resolve(true);
      }
    },
    setup: function setup() {
      var replicateConfigDB = this.replicateConfigDB.bind(this);
      var loadConfig = this.loadConfig.bind(this);
      var db = this.createDB();
      this.set('configDB', db);
      this.setCurrentUser();
      if (window.ELECTRON) {
        this.set('standAlone', true);
      }
      if (this.get('standAlone') === false) {
        return replicateConfigDB(db).then(loadConfig);
      } else {
        return loadConfig();
      }
    },
    createDB: function createDB() {
      return new PouchDB('config');
    },
    replicateConfigDB: function replicateConfigDB(db) {
      var promise = new RSVP.Promise(function (resolve) {
        var url = document.location.protocol + '//' + document.location.host + '/db/config';
        db.replicate.from(url).then(resolve)['catch'](resolve);
      });
      return promise;
    },
    loadConfig: function loadConfig() {
      var config = this.get('configDB');
      var options = {
        include_docs: true,
        keys: ['config_consumer_key', 'config_consumer_secret', 'config_disable_offline_sync', 'config_external_search', 'config_oauth_token', 'config_token_secret', 'config_use_google_auth']
      };
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        config.allDocs(options, function (err, response) {
          if (err) {
            console.log('Could not get configDB configs:', err);
            reject(err);
          }
          var configObj = {};
          for (var i = 0; i < response.rows.length; i++) {
            if (!response.rows[i].error && response.rows[i].doc) {
              configObj[response.rows[i].id] = response.rows[i].doc.value;
            }
          }
          resolve(configObj);
        });
      }, 'getting configuration from the database');
    },
    getFileLink: function getFileLink(id) {
      var config = this.get('configDB');
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        config.get('file-link_' + id, function (err, doc) {
          if (err) {
            reject(err);
          }
          resolve(doc);
        });
      });
    },
    removeFileLink: function removeFileLink(id) {
      var config = this.get('configDB');
      return this.getFileLink(id).then(function (fileLink) {
        config.remove(fileLink);
      });
    },
    saveFileLink: function saveFileLink(fileName, id) {
      var config = this.get('configDB');
      return new _ember['default'].RSVP.Promise(function (resolve, reject) {
        config.put({ fileName: fileName, _id: 'file-link_' + id }, function (err, doc) {
          if (err) {
            reject(err);
          }
          resolve(doc);
        });
      });
    },
    saveOauthConfigs: function saveOauthConfigs(configs) {
      var configDB = this.get('configDB');
      var configKeys = Object.keys(configs);
      var savePromises = [];
      return this._getOauthConfigs(configKeys).then(function (records) {
        configKeys.forEach(function (key) {
          var configRecord = records.rows.findBy('key', key);
          if (!configRecord || !configRecord.doc) {
            configRecord = {
              _id: key,
              value: configs[key]
            };
          } else {
            configRecord = configRecord.doc;
            configRecord.value = configs[key];
          }
          savePromises.push(configDB.put(configRecord));
        });
        return _ember['default'].RSVP.all(savePromises);
      });
    },
    useGoogleAuth: function useGoogleAuth() {
      return this.getConfigValue('use_google_auth', false);
    },

    getPatientPrefix: function getPatientPrefix() {
      return this.getConfigValue('patient_id_prefix', 'P');
    },

    getConfigDB: function getConfigDB() {
      return this.get('configDB');
    },

    getConfigValue: function getConfigValue(id, defaultValue) {
      var configDB = this.get('configDB');
      return new _ember['default'].RSVP.Promise(function (resolve) {
        configDB.get('config_' + id).then(function (doc) {
          run(null, resolve, doc.value);
        })['catch'](function () {
          run(null, resolve, defaultValue);
        });
      }, 'get ' + id + ' from config database');
    },

    _getOauthConfigs: function _getOauthConfigs(configKeys) {
      var configDB = this.get('configDB');
      var options = {
        include_docs: true,
        keys: configKeys
      };
      return configDB.allDocs(options);
    },

    setCurrentUser: function setCurrentUser(userName) {
      var config = this.get('configDB');
      var sessionData = this.get('sessionData');
      if (!userName && sessionData.authenticated) {
        userName = sessionData.authenticated.name;
      }
      config.get('current_user').then(function (doc) {
        doc.value = userName;
        config.put(doc);
      })['catch'](function () {
        config.put({
          _id: 'current_user',
          value: userName
        });
      });
    }

  });
});
define('hospitalrun/tests/services/config.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - services/config.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'services/config.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/services/custom-forms', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var Service = _ember['default'].Service;
  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;
  exports['default'] = Service.extend({
    currentModel: null,
    customForms: {},
    formsForType: null,
    store: inject.service(),

    formsForSelect: computed('formsForType', 'usedForms', function () {
      var formsForType = get(this, 'formsForType');
      var usedForms = get(this, 'usedForms');
      if (!isEmpty(formsForType)) {
        var formsForSelect = formsForType.filter(function (customForm) {
          return !usedForms.includes(get(customForm, 'id'));
        });
        formsForSelect = formsForSelect.map(function (customForm) {
          return {
            id: get(customForm, 'id'),
            value: get(customForm, 'name')
          };
        });
        return formsForSelect;
      }
    }),

    formsToDisplay: computed('formsForType', 'currentModel.customForms', function () {
      var formsForType = get(this, 'formsForType');
      var modelForms = get(this, 'currentModel.customForms');
      if (!isEmpty(modelForms) && !isEmpty(formsForType)) {
        return Object.keys(modelForms).map(function (formId) {
          return {
            form: formsForType.findBy('id', formId),
            propertyPrefix: 'customForms.' + formId + '.'
          };
        });
      }
    }),

    showAddButton: computed('formsForSelect', function () {
      var formsForSelect = get(this, 'formsForSelect');
      return !isEmpty(formsForSelect);
    }),

    usedForms: computed('currentModel.customForms', function () {
      var modelForms = get(this, 'currentModel.customForms');
      if (isEmpty(modelForms)) {
        return [];
      } else {
        return Object.keys(modelForms);
      }
    }),

    getCustomForms: function getCustomForms(formTypes) {
      var _this = this;

      var customForms = get(this, 'customForms');
      var store = get(this, 'store');
      var formTypesToQuery = formTypes.filter(function (formType) {
        if (isEmpty(customForms[formType])) {
          return true;
        }
      });
      if (isEmpty(formTypesToQuery)) {
        return _ember['default'].RSVP.resolve(this._getCustomFormsFromCache(formTypes));
      } else {
        return store.query('custom-form', {
          options: {
            keys: formTypesToQuery
          },
          mapReduce: 'custom_form_by_type'
        }).then(function (forms) {
          formTypesToQuery.forEach(function (formType) {
            customForms[formType] = forms.filterBy('formType', formType);
          });
          return _this._getCustomFormsFromCache(formTypes);
        });
      }
    },

    resetCustomFormByType: function resetCustomFormByType(formType) {
      var customForms = get(this, 'customForms');
      delete customForms[formType];
    },

    setDefaultCustomForms: function setDefaultCustomForms(customFormNames, model) {
      return this.getCustomForms(customFormNames).then(function (customForms) {
        if (!isEmpty(customForms)) {
          customForms.forEach(function (customForm) {
            if (get(customForm, 'alwaysInclude')) {
              set(model, 'customForms.' + get(customForm, 'id'), _ember['default'].Object.create());
            }
          });
        }
        return model;
      });
    },

    setupForms: function setupForms(formType, model) {
      var _this2 = this;

      this.getCustomForms([formType]).then(function (forms) {
        set(_this2, 'currentModel', model);
        set(_this2, 'formsForType', forms);
      });
    },

    _getCustomFormsFromCache: function _getCustomFormsFromCache(formTypes) {
      var customForms = get(this, 'customForms');
      var returnForms = [];
      formTypes.forEach(function (formType) {
        returnForms.addObjects(customForms[formType]);
      });
      return returnForms;
    }

  });
});
define('hospitalrun/tests/services/custom-forms.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - services/custom-forms.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'services/custom-forms.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/services/database', ['exports', 'ember', 'hospitalrun/utils/pouch-views', 'npm:pouchdb-list', 'hospitalrun/mixins/oauth-headers', 'npm:pouchdb-adapter-memory', 'hospitalrun/mixins/pouch-find-indexes', 'npm:pouchdb-users', 'npm:worker-pouch/client', 'hospitalrun/utils/unauthorized-error'], function (exports, _ember, _hospitalrunUtilsPouchViews, _npmPouchdbList, _hospitalrunMixinsOauthHeaders, _npmPouchdbAdapterMemory, _hospitalrunMixinsPouchFindIndexes, _npmPouchdbUsers, _npmWorkerPouchClient, _hospitalrunUtilsUnauthorizedError) {
  'use strict';

  var alias = _ember['default'].computed.alias;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var RSVP = _ember['default'].RSVP;
  var Service = _ember['default'].Service;
  var set = _ember['default'].set;
  exports['default'] = Service.extend(_hospitalrunMixinsOauthHeaders['default'], _hospitalrunMixinsPouchFindIndexes['default'], {
    mainDB: null, // Server DB
    oauthHeaders: null,
    requireLogin: true,
    setMainDB: false,
    usePouchFind: false,
    usersDB: null, // local users database for standAlone mode

    config: inject.service(),
    standAlone: alias('config.standAlone'),

    createDB: function createDB(configs) {
      var standAlone = get(this, 'standAlone');
      if (standAlone || !configs.config_external_search) {
        set(this, 'usePouchFind', true);
      }
      if (standAlone) {
        var localDb = this._createLocalDB();
        return RSVP.resolve(localDb);
      }
      return this._createMainDB(configs);
    },

    getDBInfo: function getDBInfo() {
      var mainDB = get(this, 'mainDB');
      return mainDB.info();
    },

    getDocFromMainDB: function getDocFromMainDB(docId) {
      var _this = this;

      return new RSVP.Promise(function (resolve, reject) {
        var mainDB = get(_this, 'mainDB');
        mainDB.get(docId, function (err, doc) {
          if (err) {
            reject(_this.handleErrorResponse(err));
          } else {
            resolve(doc);
          }
        });
      }, 'getDocFromMainDB ' + docId);
    },

    /**
    * Given an pouchDB doc id, return the corresponding ember record id.
    * @param {String} docId the pouchDB doc id.
    * @returns {String} the corresponding Ember id.
    */
    getEmberId: function getEmberId(docId) {
      var parsedId = get(this, 'mainDB').rel.parseDocID(docId);
      if (!isEmpty(parsedId.id)) {
        return parsedId.id;
      }
    },

    /**
     * Given an record type, return back the maximum pouchdb id.  Useful for endkeys.
     * @param {String} type the record type.
     * @returns {String} the max pouch id for the type.
     */
    getMaxPouchId: function getMaxPouchId(type) {
      return this.getPouchId({}, type);
    },

    /**
    * Given an record type, return back the minimum pouchdb id.  Useful for startkeys.
    * @param {String} type the record type.
    * @returns {String} the min pouch id for the type.
    */
    getMinPouchId: function getMinPouchId(type) {
      return this.getPouchId(null, type);
    },

    /**
    * Given an Ember record id and type, return back the corresponding pouchDB id.
    * @param {String} emberId the ember record id.
    * @param {String} type the record type.
    * @returns {String} the corresponding pouch id.
    */
    getPouchId: function getPouchId(emberId, type) {
      var idInfo = {
        type: type
      };
      if (!isEmpty(emberId)) {
        idInfo.id = emberId;
      }
      return get(this, 'mainDB').rel.makeDocID(idInfo);
    },

    getRemoteDBUrl: function getRemoteDBUrl() {
      return document.location.protocol + '//' + document.location.host + '/db/main';
    },

    handleErrorResponse: function handleErrorResponse(err) {
      if (!err.status) {
        if (err.errors && err.errors.length > 0) {
          err.status = parseInt(err.errors[0].status);
        }
      }
      if (err.status === 401 || err.status === 403) {
        var detailedMessage = JSON.stringify(err, null, 2);
        return new _hospitalrunUtilsUnauthorizedError['default'](err, detailedMessage);
      } else {
        return err;
      }
    },

    /**
     * Load the specified db dump into the database.
     * @param {String} dbDump A couchdb dump string produced by pouchdb-dump-cli.
     * @returns {Promise} A promise that resolves once the dump has been loaded.
     */
    loadDBFromDump: function loadDBFromDump(dbDump) {
      var _this2 = this;

      return new RSVP.Promise(function (resolve, reject) {
        PouchDB.plugin(_npmPouchdbAdapterMemory['default']);
        var db = new PouchDB('dbdump', {
          adapter: 'memory'
        });
        db.load(dbDump).then(function () {
          var mainDB = get(_this2, 'mainDB');
          db.replicate.to(mainDB).on('complete', function (info) {
            resolve(info);
          }).on('error', function (err) {
            reject(err);
          });
        }, reject);
      }, 'loadDBFromDump');
    },

    queryMainDB: function queryMainDB(queryParams, mapReduce) {
      var _this3 = this;

      return new RSVP.Promise(function (resolve, reject) {
        var mainDB = get(_this3, 'mainDB');
        if (mapReduce) {
          mainDB.query(mapReduce, queryParams, function (err, response) {
            if (err) {
              reject(_this3.handleErrorResponse(err));
            } else {
              response.rows = _this3._mapPouchData(response.rows);
              resolve(response);
            }
          });
        } else {
          mainDB.allDocs(queryParams, function (err, response) {
            if (err) {
              reject(_this3.handleErrorResponse(err));
            } else {
              response.rows = _this3._mapPouchData(response.rows);
              resolve(response);
            }
          });
        }
      }, 'queryMainDB');
    },

    setup: function setup() {
      var _this4 = this;

      PouchDB.plugin(_npmPouchdbList['default']);
      var config = get(this, 'config');
      return config.loadConfig().then(function (configs) {
        return _this4.createDB(configs).then(function (db) {
          set(_this4, 'mainDB', db);
          set(_this4, 'setMainDB', true);
          if (get(_this4, 'standAlone')) {
            return _this4.createUsersDB();
          } else {
            _this4.setupSubscription(configs);
          }
        });
      });
    },

    setupSubscription: function setupSubscription(configs) {
      var _this5 = this;

      if (!configs.config_disable_offline_sync && navigator.serviceWorker) {
        var _ret = (function () {
          var config = get(_this5, 'config');
          var localDB = _this5._createLocalDB();
          return {
            v: config.getConfigValue('push_subscription').then(function (pushSub) {
              if (isEmpty(pushSub)) {
                return localDB.id().then(function (dbId) {
                  var dbInfo = {
                    id: dbId,
                    remoteSeq: 0
                  };
                  return _this5._getPermissionAndSubscribe(dbInfo);
                }).then(function () {
                  return _this5._requestSync();
                });
              } else {
                return _this5._requestSync();
              }
            })
          };
        })();

        if (typeof _ret === 'object') return _ret.v;
      }
    },

    _askPermission: function _askPermission() {
      return new RSVP.Promise(function (resolve, reject) {
        var permissionResult = Notification.requestPermission(function (result) {
          resolve(result);
        });

        if (permissionResult) {
          permissionResult.then(resolve, reject);
        }
      }).then(function (permissionResult) {
        if (permissionResult !== 'granted') {
          throw new Error('We weren\'t granted permission.');
        }
        return permissionResult;
      }, 'Ask for notification permisson');
    },

    _createLocalDB: function _createLocalDB(pouchOptions) {
      var localDB = new PouchDB('localMainDB', pouchOptions);
      (0, _hospitalrunUtilsPouchViews['default'])(localDB);
      this.buildPouchFindIndexes(localDB);
      return localDB;
    },

    _createMainDB: function _createMainDB(configs) {
      var _this6 = this;

      this._setOAuthHeaders(configs);
      if (!configs.config_disable_offline_sync && navigator.serviceWorker) {
        // Use pouch-worker to run the DB in the service worker
        return navigator.serviceWorker.ready.then(function () {
          if (navigator.serviceWorker.controller && navigator.serviceWorker.controller.postMessage) {
            PouchDB.adapter('worker', _npmWorkerPouchClient['default']);
            var localDB = _this6._createLocalDB({
              adapter: 'worker',
              worker: function worker() {
                return navigator.serviceWorker;
              }
            });
            return localDB;
          } else {
            return _this6._createRemoteDB(configs);
          }
        });
      } else {
        return this._createRemoteDB(configs);
      }
    },

    _createRemoteDB: function _createRemoteDB(configs) {
      var remoteUrl = this.getRemoteDBUrl();
      var pouchOptions = this._getOptions(configs);
      var remoteDB = new PouchDB(remoteUrl, pouchOptions);
      return remoteDB.info().then(function () {
        (0, _hospitalrunUtilsPouchViews['default'])(remoteDB);
        return remoteDB;
      })['catch'](function (err) {
        console.log('error with remote db:', JSON.stringify(err, null, 2));
        throw err;
      });
    },

    _getNotificationPermissionState: function _getNotificationPermissionState() {
      if (navigator.permissions) {
        return navigator.permissions.query({ name: 'notifications' }).then(function (result) {
          return result.state;
        });
      }
      return RSVP.resolve(Notification.permission);
    },

    _getPermissionAndSubscribe: function _getPermissionAndSubscribe(dbInfo) {
      var _this7 = this;

      return new RSVP.Promise(function (resolve, reject) {
        navigator.serviceWorker.ready.then(function (registration) {
          return _this7._getNotificationPermissionState().then(function (permission) {
            if (permission !== 'granted') {
              return _this7._askPermission().then(function () {
                return _this7._subscribeUserToPush(registration, dbInfo).then(resolve, reject);
              });
            } else {
              return _this7._subscribeUserToPush(registration, dbInfo).then(resolve, reject);
            }
          });
        });
      }, 'Get notification permission and subscribe to push');
    },

    _urlBase64ToUint8Array: function _urlBase64ToUint8Array(base64String) {
      var padding = '='.repeat((4 - base64String.length % 4) % 4);
      var base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/');

      var rawData = window.atob(base64);
      var outputArray = new Uint8Array(rawData.length);

      for (var i = 0; i < rawData.length; ++i) {
        outputArray[i] = rawData.charCodeAt(i);
      }
      return outputArray;
    },

    _sendSubscriptionToServer: function _sendSubscriptionToServer(subscription, dbInfo) {
      return new RSVP.Promise(function (resolve, reject) {
        return fetch('/save-subscription/', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({
            dbInfo: dbInfo,
            subscription: subscription
          })
        }).then(function (response) {
          if (!response.ok) {
            throw new Error('Bad status code from server.');
          }
          return response.json();
        }).then(function (responseData) {
          if (responseData.ok !== true) {
            throw new Error('There was a bad response from server.', JSON.stringify(responseData, null, 2));
          }
          resolve(responseData);
        })['catch'](reject);
      }, 'Send push subscription to server');
    },

    _subscribeUserToPush: function _subscribeUserToPush(registration, dbInfo) {
      var _this8 = this;

      var config = get(this, 'config');
      return config.getConfigValue('push_public_key').then(function (serverKey) {
        if (!serverKey) {
          return;
        }
        var subscribeOptions = {
          userVisibleOnly: true,
          applicationServerKey: _this8._urlBase64ToUint8Array(serverKey)
        };
        return new RSVP.Promise(function (resolve, reject) {
          return registration.pushManager.subscribe(subscribeOptions).then(function (pushSubscription) {
            var subInfo = JSON.stringify(pushSubscription);
            subInfo = JSON.parse(subInfo);
            return _this8._sendSubscriptionToServer(subInfo, dbInfo);
          }).then(function (savedSubscription) {
            var configDB = config.getConfigDB();
            return configDB.put({
              _id: 'config_push_subscription',
              value: savedSubscription.id
            }).then(resolve, reject);
          })['catch'](reject);
        });
      }, 'Subscribe user to push service.');
    },

    _requestSync: function _requestSync() {
      return new RSVP.Promise(function (resolve, reject) {
        var messageChannel = new MessageChannel();
        messageChannel.port1.onmessage = function (event) {
          if (event.data.error) {
            reject(event.data.error);
          } else {
            resolve(event.data);
          }
        };
        navigator.serviceWorker.controller.postMessage('remotesync', [messageChannel.port2]);
      }, 'Request offline sync');
    },

    createUsersDB: function createUsersDB() {
      var _this9 = this;

      PouchDB.plugin(_npmPouchdbUsers['default']);
      var usersDB = new PouchDB('_users');
      return usersDB.installUsersBehavior().then(function () {
        set(_this9, 'usersDB', usersDB);
        return usersDB.allDocs().then(function (results) {
          if (results.total_rows < 2) {
            set(_this9, 'requireLogin', false);
            if (results.total_rows === 0) {

              return usersDB.put({
                _id: 'org.couchdb.user:hradmin',
                type: 'user',
                name: 'hradmin',
                password: 'test',
                roles: ['System Administrator', 'admin', 'user'],
                userPrefix: 'p1'
              });
            }
          }
        });
      });
    },

    _getOptions: function _getOptions(configs) {
      var pouchOptions = {};
      if (configs) {
        pouchOptions.ajax = {
          timeout: 30000
        };
        // If we don't have the proper credentials, throw error to force login.
        if (isEmpty(configs.config_consumer_key) || isEmpty(configs.config_consumer_secret) || isEmpty(configs.config_oauth_token) || isEmpty(configs.config_token_secret)) {
          throw Error('login required');
        } else {
          var headers = get(this, 'oauthHeaders');
          pouchOptions.ajax.headers = headers;
        }
      }
      return pouchOptions;
    },

    _mapPouchData: function _mapPouchData(rows) {
      var _this10 = this;

      var mappedRows = [];
      if (rows) {
        mappedRows = rows.map(function (row) {
          if (row.doc) {
            var rowValues = {
              doc: row.doc.data
            };
            rowValues.doc.id = _this10.getEmberId(row.id);
            return rowValues;
          } else {
            return row;
          }
        });
      }
      return mappedRows;
    },

    _setOAuthHeaders: function _setOAuthHeaders(configs) {
      var headers = this.getOAuthHeaders(configs);
      set(this, 'oauthHeaders', headers);
    }

  });
});
define('hospitalrun/tests/services/database.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - services/database.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'services/database.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/services/filesystem', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Service.extend({
    config: _ember['default'].inject.service(),

    filer: null, // Injected via initializer
    fileSystemSize: 1024 * 1024 * 1024 * 8, // 8GB max size for local filesystem;chrome only,

    _onError: function _onError(e) {
      console.log('Filer filesystem error: ' + e);
    },

    _downloadFiles: function _downloadFiles() {
      this.store.find('photo').then((function (photos) {
        photos.forEach((function (photo) {
          this.downloadIfNeeded(photo);
        }).bind(this));
      }).bind(this));
    },

    /**
     * Downloads the file from the server and saves it to the local filesystem.
     * @param {Object} fileRecord Record to use to download the file.
     */
    _downloadFileFromServer: function _downloadFileFromServer(fileRecord) {
      var fileName = _ember['default'].get(fileRecord, 'fileName');
      var pouchDbId = _ember['default'].get(fileRecord, 'id');
      var url = _ember['default'].get(fileRecord, 'url');
      var xhr = new XMLHttpRequest();
      if (!_ember['default'].isEmpty(url)) {
        xhr.open('GET', url, true);
        xhr.responseType = 'blob';
        xhr.onload = (function () {
          var file = new Blob([xhr.response]);
          this.addFile(file, fileName, pouchDbId);
        }).bind(this);
        xhr.send();
      }
    },

    setup: function setup() {
      var size = this.get('fileSystemSize');
      var filer = new Filer();
      filer.init({ persistent: true, size: size }, (function () {
        try {
          this.set('filer', filer);
        } catch (ignored) {
          // Exception may happen during testing an can be ignored.
        }
      }).bind(this));
    },

    /**
     * Add the specified file to the local filesystem
     * @param {File} file the file to save.
     * @param {String} path the file path to save the file to.
     * @param {String} pouchDbId database id that the file is associated with.
     * The pouch DB ids are prefixed with the type of record (eg patient record is
     * prefixed by 'patient_'.
     * @returns {Promise} returns a Promise that resolves once the file is saved.
     */
    addFile: function addFile(file, path, pouchDbId) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var currentDate = new Date();
        var filer = this.get('filer');
        var fileName = file.name || currentDate.getTime();
        var newFileName = path + fileName;
        var config = this.get('config');
        if (path.indexOf('.') > -1) {
          newFileName = path;
          // If a full file path was provided, figure out the path and file name.
          var pathParts = path.split('/');
          fileName = pathParts.pop();
          path = pathParts.join('/');
          path += '/';
        }

        if (newFileName.indexOf('.') === -1) {
          if (file.type) {
            var typeParts = file.type.split('/');
            newFileName += '.' + typeParts.pop();
          } else {
            // Default to png extension
            newFileName += '.png';
          }
        }

        this.fileExists(newFileName).then((function (exists) {
          if (exists) {
            // Make sure a unique name is used.
            newFileName = path + currentDate.getTime() + fileName;
          }
          if (_ember['default'].isEmpty(filer)) {
            reject('Local filesystem unavailable, please use Google Chrome browser');
          }
          if (_ember['default'].isEmpty(fileName) && !_ember['default'].isEmpty(file.type)) {
            var typeParts = file.type.split('/');
            if (typeParts.length > 1) {
              newFileName += '.' + typeParts[1];
            }
          }
          filer.mkdir(path, false, function () {
            filer.write(newFileName, { data: file, type: file.type }, function (fileEntry) {
              config.saveFileLink(newFileName, pouchDbId);
              resolve(fileEntry);
            }, function (e) {
              reject(e);
            });
          }, function (e) {
            reject(e);
          });
        }).bind(this));
      }).bind(this));
    },

    /**
     * Delete the specified file
     * @param {String} filePath path of file to delete.
     * @param {String} pouchId database id that the file is associated with.
     * The pouch DB ids are prefixed with the type of record (eg patient record is
     * prefixed by 'patient_'.
     * @returns {Promise} returns a Promise that resolves once the file is deleted.
     */
    deleteFile: function deleteFile(filePath, pouchDbId) {
      return new _ember['default'].RSVP.Promise((function (resolve, reject) {
        var filer = this.get('filer');
        var config = this.get('config');
        try {
          filer.ls(filePath, function () {
            filer.rm(filePath, function () {
              config.removeFileLink(pouchDbId);
              resolve();
            }, reject);
          }, function (err) {
            if (err.name === 'NotFoundError') {
              resolve();
            } else {
              reject(err);
            }
          });
        } catch (ex) {
          reject(ex);
        }
      }).bind(this));
    },

    downloadIfNeeded: function downloadIfNeeded(fileRecord) {
      var fileName = _ember['default'].get(fileRecord, 'fileName');
      this.fileExists(fileName).then((function (exists) {
        if (!exists) {
          this._downloadFileFromServer(fileRecord);
        }
      }).bind(this));
    },

    /**
     * Determine if specified file exists
     * @param {String} the path of the file to determine if it exists.
     * @returns {Promise} returns a Promise that resolves with a boolean indicating
     * if the file exists.
     */
    fileExists: function fileExists(filePath) {
      return new _ember['default'].RSVP.Promise((function (resolve) {
        var filer = this.get('filer');
        filer.fs.root.getFile(filePath, {}, function () {
          resolve(true);
        }, function () {
          // if ls errs, file doesn't exist.
          resolve(false);
        });
      }).bind(this));
    },

    /**
     * Convert specified file to a data url
     * @param {File} file to convert
     * @returns {Promise} returns a Promise that resolves with the data url
     * for the file.
     */
    fileToDataURL: function fileToDataURL(file) {
      return new _ember['default'].RSVP.Promise(function (resolve) {
        var reader = new FileReader();
        reader.onloadend = function (e) {
          resolve(e.target.result);
        };
        reader.readAsDataURL(file);
      });
    },

    /**
     * Read the specified file into a string
     * @param {File} file to read
     * @returns {Promise} returns a Promise that resolves with the data url
     * for the file.
     */
    fileToString: function fileToString(file) {
      return new _ember['default'].RSVP.Promise(function (resolve) {
        var reader = new FileReader();
        reader.onloadend = function (e) {
          resolve(e.target.result);
        };
        reader.readAsText(file);
      });
    },

    /**
     * Property to determine if file system API is available.
     */
    isFileSystemEnabled: (function () {
      var filer = this.get('filer');
      return !_ember['default'].isEmpty(filer);
    }).property('filer'),

    /**
     * Get filesystem url from specified path.
     * @param {String} the path of the file to get the url for.
     * @returns {Promise} returns a Promise that resolves with the file system
     * url or null if the file doesn't exist.
     */
    pathToFileSystemURL: function pathToFileSystemURL(path) {
      return new _ember['default'].RSVP.Promise((function (resolve) {
        var filer = this.get('filer');
        filer.fs.root.getFile(path, {}, function (fileEntry) {
          resolve(fileEntry.toURL());
        }, function () {
          // if ls errs, just return empty, file doesn't exist.
          resolve();
        });
      }).bind(this));
    }
  });
});
define('hospitalrun/tests/services/filesystem.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - services/filesystem.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'services/filesystem.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/services/lookup-lists', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  var Service = _ember['default'].Service;
  var get = _ember['default'].get;
  var inject = _ember['default'].inject;
  var isEmpty = _ember['default'].isEmpty;
  var RSVP = _ember['default'].RSVP;
  exports['default'] = Service.extend({
    lookupLists: {},
    store: inject.service(),

    /*
     * Get a lookup list by name
     * @param listName String containing the name of the lookup list to retrieve.
     * Usually the id of a lookup object, but the special value of 'incidentCategories'
     * will retrieve incident categories
     */
    getLookupList: function getLookupList(listName) {
      return this.getLookupLists([listName]).then(function (lists) {
        return lists[listName];
      });
    },

    /*
     * Given a list of lookup names, return the specified lists.
     * @param listName Array containg the names of the lookup lists to retrieve.
     * Can be the ids of lookup objects, and/or the special value of 'incidentCategories'
     * will retrieve incident categories.
     */
    getLookupLists: function getLookupLists(listNames) {
      var _this = this;

      var lookupLists = get(this, 'lookupLists');
      var store = get(this, 'store');
      var listsToQuery = listNames.filter(function (listName) {
        if (isEmpty(lookupLists[listName])) {
          return true;
        }
      });
      if (isEmpty(listsToQuery)) {
        return _ember['default'].RSVP.resolve(this._getLookupListsFromCache(listNames));
      } else {
        var queryHash = {};
        if (listsToQuery.includes('incidentCategories')) {
          queryHash.incidentCategories = store.findAll('inc-category');
          listsToQuery.removeObject('incidentCategories');
        }
        if (!isEmpty(listsToQuery)) {
          queryHash.lookup = store.query('lookup', {
            options: {
              keys: listsToQuery
            }
          });
        }
        return RSVP.hash(queryHash).then(function (hash) {
          if (!isEmpty(hash.incidentCategories)) {
            lookupLists.incidentCategories = hash.incidentCategories.filterBy('archived', false);
          }
          if (!isEmpty(hash.lookup)) {
            listsToQuery.forEach(function (list) {
              lookupLists[list] = hash.lookup.findBy('id', list);
            });
          }
          return _this._getLookupListsFromCache(listNames);
        });
      }
    },

    resetLookupList: function resetLookupList(listName) {
      var lookupLists = get(this, 'lookupLists');
      delete lookupLists[listName];
    },

    _getIncidentCategories: function _getIncidentCategories() {
      var store = get(this, 'store');
      return store.findAll('inc-category');
    },

    _getLookupListsFromCache: function _getLookupListsFromCache(listNames) {
      var lookupLists = get(this, 'lookupLists');
      var returnLists = {};
      listNames.forEach(function (listName) {
        if (!isEmpty(lookupLists[listName])) {
          returnLists[listName] = lookupLists[listName];
        }
      });
      return returnLists;
    }
  });
});
define('hospitalrun/tests/services/lookup-lists.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - services/lookup-lists.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'services/lookup-lists.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/serviceworkers/pouchdb-sync', ['exports'], function (exports) {
  'use strict';

  var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();

  function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }

  function _typeof(obj) { return obj && obj.constructor === Symbol ? 'symbol' : typeof obj; }

  var allChanges = {};
  var configs = false;
  var syncingRemote = false;
  var configDB = new PouchDB('config');
  var localMainDB = new PouchDB('localMainDB');
  var lastServerSeq = undefined;

  function PouchError(opts) {
    Error.call(opts.reason);
    this.status = opts.status;
    this.name = opts.error;
    this.message = opts.reason;
    this.error = true;
  }

  function createError(err) {
    var status = err.status || 500;

    // last argument is optional
    if (err.name && err.message) {
      if (err.name === 'Error' || err.name === 'TypeError') {
        if (err.message.indexOf('Bad special document member') !== -1) {
          err.name = 'doc_validation';
          // add more clauses here if the error name is too general
        } else {
            err.name = 'bad_request';
          }
      }
      err = {
        error: err.name,
        name: err.name,
        reason: err.message,
        message: err.message,
        status: status
      };
    }
    return err;
  }

  function safeEval(str) {
    var target = {};
    /* jshint evil: true */
    eval('target.target = (' + str + ');');
    return target.target;
  }

  function decodeArgs(args) {
    var funcArgs = ['filter', 'map', 'reduce'];
    args.forEach(function (arg) {
      if ((typeof arg === 'undefined' ? 'undefined' : _typeof(arg)) === 'object' && arg !== null && !Array.isArray(arg)) {
        funcArgs.forEach(function (funcArg) {
          if (!(funcArg in arg) || arg[funcArg] === null) {
            delete arg[funcArg];
          } else if (arg[funcArg].type === 'func' && arg[funcArg].func) {
            arg[funcArg] = safeEval(arg[funcArg].func);
          }
        });
      }
    });
    return args;
  }

  function postMessage(msg, event) {
    event.ports[0].postMessage(msg);
  }

  function sendError(clientId, messageId, data, event) {
    logDebug(' -> sendError', clientId, messageId, data);
    postMessage({
      type: 'error',
      id: clientId,
      messageId: messageId,
      content: createError(data)
    }, event);
  }

  function sendSuccess(clientId, messageId, data, event) {
    logDebug(' -> sendSuccess', clientId, messageId);
    postMessage({
      type: 'success',
      id: clientId,
      messageId: messageId,
      content: data
    }, event);
  }

  function sendUpdate(clientId, messageId, data, event) {
    logDebug(' -> sendUpdate', clientId, messageId);
    postMessage({
      type: 'update',
      id: clientId,
      messageId: messageId,
      content: data
    }, event);
  }

  function getCurrentDB(clientId) {
    switch (clientId) {
      case 'localMainDB':
        {
          return Promise.resolve(localMainDB);
        }
      case 'hospitalrun-test-database':
        {
          return Promise.resolve(new PouchDB('hospitalrun-test-database', {
            adapter: 'memory'
          }));
        }
      default:
        {
          return getRemoteDB();
        }
    }
  }

  function dbMethod(clientId, methodName, messageId, args, event) {
    var dbAdapter = undefined;
    return getCurrentDB(clientId).then(function (db) {
      if (!db) {
        return sendError(clientId, messageId, { error: 'db not found' }, event);
      }
      dbAdapter = db.adapter;
      return db[methodName].apply(db, _toConsumableArray(args));
    }).then(function (res) {
      sendSuccess(clientId, messageId, res, event);
      switch (methodName) {
        case 'put':
        case 'bulkDocs':
        case 'post':
        case 'remove':
        case 'removeAttachment':
        case 'putAttachment':
          remoteSync();
      }
    })['catch'](function (err) {
      if (dbAdapter === 'http') {
        // If the failure was on http, retry with local db.
        return dbMethod('localMainDB', methodName, messageId, args, event);
      } else {
        sendError(clientId, messageId, err, event);
      }
    });
  }

  function changes(clientId, messageId, args, event) {
    var _args = _slicedToArray(args, 1);

    var opts = _args[0];

    if (opts && (typeof opts === 'undefined' ? 'undefined' : _typeof(opts)) === 'object') {
      // just send all the docs anyway because we need to emit change events
      // TODO: be smarter about emitting changes without building up an array
      opts.returnDocs = true;
      opts.return_docs = true;
    }
    dbMethod(clientId, 'changes', messageId, args, event);
  }

  function createDatabase(clientId, messageId, args, event) {
    return sendSuccess(clientId, messageId, { ok: true, exists: true }, event);
  }

  function getAttachment(clientId, messageId, args, event) {
    return getCurrentDB(clientId).then(function (db) {
      if (!db) {
        return sendError(clientId, messageId, { error: 'db not found' }, event);
      }

      var _args2 = _slicedToArray(args, 3);

      var docId = _args2[0];
      var attId = _args2[1];
      var opts = _args2[2];

      if ((typeof opts === 'undefined' ? 'undefined' : _typeof(opts)) !== 'object') {
        opts = {};
      }
      return db.get(docId, opts).then(function (doc) {
        if (!doc._attachments || !doc._attachments[attId]) {
          throw new PouchError({
            status: 404,
            error: 'not_found',
            reason: 'missing'
          });
        }
        return db.getAttachment.apply(db, _toConsumableArray(args)).then(function (buff) {
          sendSuccess(clientId, messageId, buff, event);
        });
      });
    })['catch'](function (err) {
      sendError(clientId, messageId, err, event);
    });
  }

  function destroy(clientId, messageId, args, event) {
    if (clientId === 'hospitalrun-test-database') {
      getCurrentDB(clientId).then(function (db) {
        if (!db) {
          return sendError(clientId, messageId, { error: 'db not found' }, event);
        }
        Promise.resolve().then(function () {
          return db.destroy.apply(db, _toConsumableArray(args));
        }).then(function (res) {
          sendSuccess(clientId, messageId, res, event);
        })['catch'](function (err) {
          sendError(clientId, messageId, err, event);
        });
      });
    } else {
      return sendError(clientId, messageId, { error: 'permission denied' }, event);
    }
  }

  function liveChanges(clientId, messageId, args, event) {
    getCurrentDB(clientId).then(function (db) {
      if (!db) {
        return sendError(clientId, messageId, { error: 'db not found' }, event);
      }
      var changes = db.changes(args[0]);
      allChanges[messageId] = changes;
      changes.on('change', function (change) {
        sendUpdate(clientId, messageId, change, event);
      }).on('complete', function (change) {
        changes.removeAllListeners();
        delete allChanges[messageId];
        sendSuccess(clientId, messageId, change, event);
      }).on('error', function (change) {
        changes.removeAllListeners();
        delete allChanges[messageId];
        sendError(clientId, messageId, change, event);
      });
    });
  }

  function cancelChanges(messageId) {
    var changes = allChanges[messageId];
    if (changes) {
      changes.cancel();
    }
  }

  function onReceiveMessage(clientId, type, messageId, args, event) {
    switch (type) {
      case 'createDatabase':
        return createDatabase(clientId, messageId, args, event);
      case 'id':
        sendSuccess(clientId, messageId, clientId, event);
        return;
      case 'info':
      case 'put':
      case 'allDocs':
      case 'bulkDocs':
      case 'post':
      case 'get':
      case 'remove':
      case 'revsDiff':
      case 'compact':
      case 'viewCleanup':
      case 'removeAttachment':
      case 'putAttachment':
      case 'query':
        return dbMethod(clientId, type, messageId, args, event);
      case 'changes':
        return changes(clientId, messageId, args, event);
      case 'getAttachment':
        return getAttachment(clientId, messageId, args, event);
      case 'liveChanges':
        return liveChanges(clientId, messageId, args, event);
      case 'cancelChanges':
        return cancelChanges(messageId);
      case 'destroy':
        return destroy(clientId, messageId, args, event);
      default:
        return sendError(clientId, messageId, { error: 'unknown API method: ' + type }, event);
    }
  }

  function handleMessage(message, clientId, event) {
    var type = message.type;
    var messageId = message.messageId;

    var args = decodeArgs(message.args);
    onReceiveMessage(clientId, type, messageId, args, event);
  }

  self.addEventListener('push', function (event) {
    if (event.data) {
      var pushData = event.data.json();
      if (pushData.type === 'couchDBChange') {
        logDebug('Got couchDBChange pushed, attempting to sync to: ' + pushData.seq);
        event.waitUntil(remoteSync(pushData.seq).then(function (resp) {
          logDebug('Response from sync ' + JSON.stringify(resp, null, 2));
        }));
      } else {
        logDebug('Unknown push event has data and here it is: ', pushData);
      }
    }
  });

  self.addEventListener('message', function (event) {
    logDebug('got message', event);
    if (event.data === 'remotesync') {
      remoteSync();
      return;
    }
    if (!event.data || !event.data.id || !event.data.args || !event.data.type || !event.data.messageId) {
      // assume this is not a message from worker-pouch
      // (e.g. the user is using the custom API instead)
      return;
    }
    var clientId = event.data.id;
    if (event.data.type === 'close') {
      // logDebug('closing worker', clientId);
    } else {
        handleMessage(event.data, clientId, event);
      }
  });

  self.addEventListener('sync', function (event) {
    if (event.tag === 'remoteSync') {
      event.waitUntil(remoteSync(null, true)['catch'](function (err) {
        if (event.lastChance) {
          logDebug('Sync failed for the last time, so give up for now.', err);
        } else {
          logDebug('Sync failed, will try again later', err);
        }
      }));
    }
  });

  function getRemoteDB() {
    return setupConfigs().then(function () {
      var pouchOptions = {
        ajax: {
          headers: {},
          timeout: 30000
        }
      };
      if (configs.config_consumer_secret && configs.config_token_secret && configs.config_consumer_key && configs.config_oauth_token) {
        pouchOptions.ajax.headers['x-oauth-consumer-secret'] = configs.config_consumer_secret;
        pouchOptions.ajax.headers['x-oauth-consumer-key'] = configs.config_consumer_key;
        pouchOptions.ajax.headers['x-oauth-token-secret'] = configs.config_token_secret;
        pouchOptions.ajax.headers['x-oauth-token'] = configs.config_oauth_token;
      }
      var remoteURL = self.location.protocol + '//' + self.location.host + '/db/main';
      return new PouchDB(remoteURL, pouchOptions);
    });
  }

  function remoteSync(remoteSequence, retryingSync) {
    lastServerSeq = remoteSequence;
    if (!syncingRemote && configs.config_disable_offline_sync !== true) {
      logDebug('Synching local db to remoteSequence: ' + remoteSequence + ' at: ' + new Date());
      syncingRemote = true;
      return getRemoteDB().then(function (remoteDB) {
        return localMainDB.sync(remoteDB);
      }).then(function (info) {
        syncingRemote = false;
        logDebug('local sync complete:', info, configs);

        // Update push subscription with latest sync info
        fetch('/update-subscription/', {
          method: 'POST',
          headers: {
            'Content-Type': 'application/json'
          },
          body: JSON.stringify({
            subscriptionId: configs.config_push_subscription,
            remoteSeq: info.pull.last_seq
          })
        });
        // handle complete
        if (info.pull.last_seq < lastServerSeq) {
          return remoteSync(lastServerSeq);
        } else {

          return true;
        }
      })['catch'](function (err) {
        syncingRemote = false;
        logDebug('local sync error, register remote sync: ' + new Date(), err);
        if (retryingSync) {
          throw err;
        } else {
          self.registration.sync.register('remoteSync');
        }
      });
    } else {
      if (syncingRemote) {
        logDebug('Skipping sync to: ' + remoteSequence + ' because sync is in process');
      }
      return Promise.resolve(false);
    }
  }

  function setupConfigs() {
    return new Promise(function (resolve, reject) {
      if (configs) {
        resolve();
      } else {
        configDB.allDocs({
          include_docs: true
        }).then(function (result) {
          configs = {};
          result.rows.forEach(function (row) {
            configs[row.id] = row.doc.value;
          });
          resolve();
        }, reject);
      }
    });
  }
});
define('hospitalrun/tests/serviceworkers/pouchdb-sync.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - serviceworkers/pouchdb-sync.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'serviceworkers/pouchdb-sync.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/styles/_base.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/_base.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/_bootstrap.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/_bootstrap.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/_layout.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/_layout.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/_print.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/_print.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/_typography.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/_typography.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/_variables_mixins.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/_variables_mixins.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/app.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/app.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_align.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_align.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_border.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_border.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_flexbox.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_flexbox.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_hide.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_hide.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_layout.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_layout.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_margin.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_margin.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_padding.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_padding.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_position.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_position.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_type-scale.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_type-scale.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/_typography.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/_typography.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/grid/_index.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/grid/_index.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/grid/lib/_grid.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/grid/lib/_grid.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/grid/lib/_lg-grid.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/grid/lib/_lg-grid.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/grid/lib/_md-grid.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/grid/lib/_md-grid.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/basscss/grid/lib/_sm-grid.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/basscss/grid/lib/_sm-grid.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_alert.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_alert.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_buttons.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_buttons.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_calendar.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_calendar.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_dropdown.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_dropdown.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_form_styles.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_form_styles.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_imaging.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_imaging.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_labs.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_labs.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_loading_notice.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_loading_notice.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_pagination.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_pagination.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_panel.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_panel.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_patient_history.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_patient_history.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_patient_summary.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_patient_summary.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_progress-bar.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_progress-bar.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_sidebar_nav.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_sidebar_nav.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_tab_content.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_tab_content.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_tab_nav.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_tab_nav.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_tables.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_tables.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/components/_typeahead.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/components/_typeahead.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define('hospitalrun/tests/styles/views/_sign_in_screen.stylelint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module(' Style Lint ');
  QUnit.test('styles/views/_sign_in_screen.scss should pass style lint', function (assert) {
    assert.expect(1);
    assert.ok(true, '');
  });
});
define("hospitalrun/tests/template-deprecations-test", ["exports"], function (exports) {
  "use strict";
});
define('hospitalrun/tests/test-helper', ['exports', 'hospitalrun/tests/helpers/resolver', 'ember-qunit'], function (exports, _hospitalrunTestsHelpersResolver, _emberQunit) {
  'use strict';

  (0, _emberQunit.setResolver)(_hospitalrunTestsHelpersResolver['default']);
});
define('hospitalrun/tests/test-helper.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - test-helper.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'test-helper.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/transforms/custom-fields', ['exports', 'ember-data', 'ember', 'npm:uuid'], function (exports, _emberData, _ember, _npmUuid) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _emberData['default'].Transform.extend({
    store: _ember['default'].inject.service(),

    deserialize: function deserialize(serialized) {
      var _this = this;

      if (isEmpty(serialized)) {
        return serialized;
      }
      return serialized.map(function (customField) {
        var store = _this.get('store');
        var record = store.push({
          data: {
            id: _npmUuid['default'].v4(),
            type: 'custom-field',
            attributes: customField
          }
        });
        return record;
      });
    },

    serialize: function serialize(deserialized) {
      if (isEmpty(deserialized)) {
        return deserialized;
      }
      var serializedField = deserialized.map(function (customField) {
        var serializedValue = customField.serialize();
        var deserializedValues = customField.get('values');
        if (!isEmpty(deserializedValues)) {
          var serializedValues = deserializedValues.map(function (value) {
            var property = get(value, 'property');
            var serializedValue = {
              label: get(value, 'label')
            };
            if (!isEmpty(property)) {
              serializedValue.property = property;
            }
            return serializedValue;
          });
          serializedValue.values = serializedValues;
        }
        return serializedValue;
      });
      return serializedField;
    }
  });
});
define('hospitalrun/tests/transforms/custom-fields.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - transforms/custom-fields.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'transforms/custom-fields.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/transforms/custom-forms', ['exports', 'ember-data', 'ember'], function (exports, _emberData, _ember) {
  'use strict';

  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _emberData['default'].Transform.extend({
    store: _ember['default'].inject.service(),

    deserialize: function deserialize(serialized) {
      if (isEmpty(serialized)) {
        return serialized;
      }
      var customFormKeys = Object.keys(serialized);
      var deserialized = _ember['default'].Object.create();
      customFormKeys.forEach(function (customFormId) {
        deserialized.set(customFormId, _ember['default'].Object.create(serialized[customFormId]));
      });
      return deserialized;
    },

    serialize: function serialize(deserialized) {
      return deserialized;
    }
  });
});
define('hospitalrun/tests/transforms/custom-forms.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - transforms/custom-forms.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'transforms/custom-forms.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/transforms/operative-procedures', ['exports', 'ember-data', 'ember'], function (exports, _emberData, _ember) {
  'use strict';

  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _emberData['default'].Transform.extend({

    deserialize: function deserialize(serialized) {
      if (isEmpty(serialized)) {
        return [];
      }
      return serialized.map(function (description) {
        return {
          description: description
        };
      });
    },

    serialize: function serialize(deserialized) {
      if (isEmpty(deserialized)) {
        return [];
      }
      return deserialized.map(function (procedure) {
        return get(procedure, 'description');
      });
    }

  });
});
define('hospitalrun/tests/transforms/operative-procedures.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - transforms/operative-procedures.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'transforms/operative-procedures.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/components/nav-menu-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForComponent)('nav-menu', 'NavMenuComponent', {
    unit: true
  });

  (0, _emberQunit.test)('it renders', function (assert) {

    assert.expect(2);

    var startingMenu = {
      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'
      }]
    };

    // creates the component instance
    var navMenuProperties = { nav: startingMenu };
    var navMenu = this.subject(navMenuProperties);
    assert.equal(navMenu._state, 'preRender');

    // appends the navMenu to the page
    this.render();
    assert.equal(navMenu._state, 'inDOM');
  });
});
define('hospitalrun/tests/unit/components/nav-menu-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/components/nav-menu-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/components/nav-menu-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/controllers/abstract-delete-controller-test', ['exports', 'ember-qunit', 'ember-sinon-qunit/test-support/test', 'ember', 'ember-data'], function (exports, _emberQunit, _emberSinonQunitTestSupportTest, _ember, _emberData) {
  'use strict';

  (0, _emberQunit.moduleFor)('controller:abstract-delete-controller', 'Unit | Controller | abstract-delete-controller', {
    unit: true,
    testModel: function testModel(attrs) {
      var _this = this;

      return _ember['default'].run(function () {
        _this.register('model:test', _emberData['default'].Model);
        return _this.store().createRecord('test', attrs);
      });
    },
    store: function store() {
      return this.container.lookup('service:store');
    },
    sendStub: function sendStub(controller) {
      var once = false;
      var originalSend = controller.send.bind(controller);
      return function (arg) {
        if (once) {
          return;
        }

        once = true;
        originalSend(arg);
      };
    }
  });

  (0, _emberSinonQunitTestSupportTest['default'])('actions.cancel', function (assert) {
    var controller = this.subject();
    var send = this.stub(controller, 'send', this.sendStub(controller));

    controller.send('cancel');

    assert.equal(send.getCall(0).args[0], 'cancel');
    assert.equal(send.getCall(1).args[0], 'closeModal', 'Should close modal');
  });

  (0, _emberSinonQunitTestSupportTest['default'])('actions.delete', function (assert) {
    var controller = this.subject({
      model: this.testModel({
        save: function save() {},
        unloadRecord: function unloadRecord() {}
      })
    });
    var send = this.stub(controller, 'send', this.sendStub(controller));
    var save = this.stub(controller.get('model'), 'save', function () {
      return new _ember['default'].RSVP.Promise(function (resolve) {
        return resolve();
      });
    });
    var unloadRecord = this.stub(controller.get('model'), 'unloadRecord');

    _ember['default'].run(function () {
      return controller.send('delete');
    });

    assert.equal(send.getCall(0).args[0], 'delete');
    assert.ok(save.calledOnce, 'Should save model');
    assert.strictEqual(controller.get('model.archived'), true, 'Should archive model');
    assert.ok(unloadRecord.calledOnce, 'Should unload record of model');
    assert.equal(send.getCall(1).args[0], 'closeModal', 'Should close modal');
  });
});
define('hospitalrun/tests/unit/controllers/abstract-delete-controller-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/controllers/abstract-delete-controller-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/controllers/abstract-delete-controller-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/controllers/abstract-edit-controller-test', ['exports', 'ember-qunit', 'ember', 'ember-i18n/helper', 'ember-i18n/config/en'], function (exports, _emberQunit, _ember, _emberI18nHelper, _emberI18nConfigEn) {
  'use strict';

  (0, _emberQunit.moduleFor)('controller:abstract-edit-controller', 'Unit | Controller | abstract-edit-controller', {
    needs: ['service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      // manually inject the i18n service as initialzer does not run
      // in unit test
      _ember['default'].getOwner(this).inject('controller', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    }
  });

  (0, _emberQunit.test)('cancelButtonText', function (assert) {
    assert.equal(this.subject().get('cancelButtonText'), 'Return');
  });

  (0, _emberQunit.test)('cancelButtonText hasDirtyAttributes', function (assert) {
    var controller = this.subject({
      model: {
        hasDirtyAttributes: true
      }
    });

    assert.equal(controller.get('cancelButtonText'), 'Cancel');
  });

  (0, _emberQunit.test)('disabledAction', function (assert) {
    assert.equal(this.subject({
      model: _ember['default'].Object.create()
    }).get('disabledAction'), 'showDisabledDialog');
  });

  (0, _emberQunit.test)('disabledAction invalid', function (assert) {
    var controller = this.subject({
      model: _ember['default'].Object.create({
        isValid: true
      })
    });

    assert.strictEqual(controller.get('disabledAction'), undefined);
  });

  (0, _emberQunit.test)('isNewOrDeleted', function (assert) {
    assert.strictEqual(this.subject().get('isNewOrDeleted'), undefined);
  });

  (0, _emberQunit.test)('isNewOrDeleted new', function (assert) {
    var controller = this.subject({
      model: {
        isNew: true,
        isDeleted: false
      }
    });

    assert.strictEqual(controller.get('isNewOrDeleted'), true);
  });

  (0, _emberQunit.test)('isNewOrDeleted deleted', function (assert) {
    var controller = this.subject({
      model: {
        isNew: false,
        isDeleted: true
      }
    });

    assert.strictEqual(controller.get('isNewOrDeleted'), true);
  });

  (0, _emberQunit.test)('updateButtonText', function (assert) {
    assert.equal(this.subject().get('updateButtonText'), 'Update');
  });

  (0, _emberQunit.test)('updateButtonText isNew', function (assert) {
    var controller = this.subject({
      model: {
        isNew: true
      }
    });

    assert.equal(controller.get('updateButtonText'), 'Add');
  });

  (0, _emberQunit.test)('actions.showDisabledDialog message', function (assert) {
    var alertMessage = undefined,
        alertTitle = undefined;
    var controller = this.subject();

    controller.displayAlert = function stub(title, message) {
      alertTitle = title;
      alertMessage = message;
    };

    controller.send('showDisabledDialog');

    assert.equal(alertTitle, 'Warning!!!!');
    assert.equal(alertMessage, 'Please fill in required fields (marked with *) and correct the errors before saving.');
  });

  (0, _emberQunit.test)('actions.update exception message', function (assert) {
    var alertMessage = undefined,
        alertTitle = undefined;
    var controller = this.subject();

    controller.beforeUpdate = function () {
      throw new Error('Test');
    };
    controller.displayAlert = function stub(title, message) {
      alertTitle = title.toString();
      alertMessage = message.toString();
      assert.equal(alertTitle, 'Error!!!!');
      assert.equal(alertMessage, 'An error occurred while attempting to save: Test');
    };

    _ember['default'].run(function () {
      controller.send('update');
    });
  });
});
define('hospitalrun/tests/unit/controllers/abstract-edit-controller-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/controllers/abstract-edit-controller-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/controllers/abstract-edit-controller-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/controllers/abstract-paged-controller-test', ['exports', 'ember-qunit', 'ember-sinon-qunit/test-support/test', 'ember', 'ember-data'], function (exports, _emberQunit, _emberSinonQunitTestSupportTest, _ember, _emberData) {
  'use strict';

  (0, _emberQunit.moduleFor)('controller:abstract-paged-controller', 'Unit | Controller | abstract-paged-controller', {
    unit: true,
    testModel: function testModel(attrs) {
      var _this = this;

      return _ember['default'].run(function () {
        _this.register('model:test', _emberData['default'].Model);
        return _this.store().createRecord('test', attrs);
      });
    },
    store: function store() {
      return this.container.lookup('service:store');
    }
  });

  (0, _emberQunit.test)('showActions', function (assert) {
    var controller = this.subject({
      canAdd: false,
      canEdit: true,
      canDelete: false
    });

    assert.strictEqual(controller.get('showActions'), true);
  });

  (0, _emberQunit.test)('disablePreviousPage', function (assert) {
    var controller = this.subject();

    assert.strictEqual(controller.get('disablePreviousPage'), true);
  });

  (0, _emberQunit.test)('disablePreviousPage false', function (assert) {
    var controller = this.subject({
      previousStartKey: 'test'
    });

    assert.strictEqual(controller.get('disablePreviousPage'), false);
  });

  (0, _emberQunit.test)('disableNextPage', function (assert) {
    var controller = this.subject();

    assert.strictEqual(controller.get('disableNextPage'), true);
  });

  (0, _emberQunit.test)('disableNextPage false', function (assert) {
    var controller = this.subject({
      nextStartKey: 'test'
    });

    assert.strictEqual(controller.get('disableNextPage'), false);
  });

  (0, _emberQunit.test)('showPagination', function (assert) {
    var controller = this.subject({
      previousStartKey: 'test'
    });

    assert.strictEqual(controller.get('showPagination'), true);
  });

  (0, _emberQunit.test)('showPagination false', function (assert) {
    var controller = this.subject();

    assert.strictEqual(controller.get('showPagination'), false);
  });

  (0, _emberQunit.test)('hasRecords', function (assert) {
    var controller = this.subject({
      model: this.testModel({
        length: 1
      })
    });

    assert.strictEqual(controller.get('hasRecords'), true);
  });

  (0, _emberQunit.test)('hasRecords false', function (assert) {
    var controller = this.subject({
      model: this.testModel({
        length: 0
      })
    });

    assert.strictEqual(controller.get('hasRecords'), false);
  });

  (0, _emberQunit.test)('hasRecords false empty', function (assert) {
    assert.strictEqual(this.subject().get('hasRecords'), false);
  });

  (0, _emberSinonQunitTestSupportTest['default'])('actions.nextPage', function (assert) {
    var controller = this.subject({
      nextStartKey: 'next',
      previousStartKeys: ['prev1', 'prev2'],
      firstKey: 'first'
    });
    var showProgressModal = this.stub(controller, 'showProgressModal');

    controller.send('nextPage');

    assert.strictEqual(controller.get('previousStartKey'), 'first', 'Should set previousStartKey');
    assert.deepEqual(controller.get('previousStartKeys'), ['prev1', 'prev2', 'first'], 'Should set previousStartKeys');
    assert.strictEqual(controller.get('startKey'), 'next', 'Should set startKey');
    assert.ok(showProgressModal.calledOnce, 'Should show progress modal');
  });

  (0, _emberSinonQunitTestSupportTest['default'])('actions.previousPage', function (assert) {
    var controller = this.subject({
      previousStartKey: 'prev',
      previousStartKeys: ['prev1', 'prev2', 'prev3']
    });
    var showProgressModal = this.stub(controller, 'showProgressModal');

    controller.send('previousPage');

    assert.strictEqual(controller.get('startKey'), 'prev', 'Should set startKey');
    assert.strictEqual(controller.get('previousStartKey'), 'prev2', 'Should set previousStartKey');
    assert.deepEqual(controller.get('previousStartKeys'), ['prev1'], 'Should set previousStartKey');
    assert.ok(showProgressModal.calledOnce, 'Should show progress modal');
  });

  (0, _emberSinonQunitTestSupportTest['default'])('actions.sortByKey', function (assert) {
    var controller = this.subject({
      nextStartKey: 'next',
      previousStartKey: 'prev',
      previousStartKeys: ['prev1', 'prev2'],
      firstKey: 'first',
      startKey: 'start'
    });
    var showProgressModal = this.stub(controller, 'showProgressModal');

    controller.send('sortByKey', 'sort', 'desc');

    assert.strictEqual(controller.get('nextStartKey'), null, 'Should clear nextStartKey');
    assert.strictEqual(controller.get('firstKey'), null, 'Should clear firstKey');
    assert.strictEqual(controller.get('startKey'), null, 'Should clear startKey');
    assert.deepEqual(controller.get('previousStartKeys'), [], 'Should clear previousStartKeys');
    assert.strictEqual(controller.get('previousStartKey'), null, 'Should clear previousStartKey');

    assert.strictEqual(controller.get('sortDesc'), 'desc', 'Should set sortDesc');
    assert.strictEqual(controller.get('sortKey'), 'sort', 'Should set sortKey');

    assert.ok(showProgressModal.calledOnce, 'Should show progress modal');
  });
});
define('hospitalrun/tests/unit/controllers/abstract-paged-controller-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/controllers/abstract-paged-controller-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/controllers/abstract-paged-controller-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/controllers/abstract-report-controller-test', ['exports', 'ember', 'ember-i18n/config/en', 'moment', 'ember-sinon-qunit/test-support/test', 'ember-i18n/helper', 'ember-qunit'], function (exports, _ember, _emberI18nConfigEn, _moment, _emberSinonQunitTestSupportTest, _emberI18nHelper, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('controller:abstract-report-controller', 'Unit | Controller | abstract-report-controller', {
    needs: ['service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      // manually inject the i18n service as initialzer does not run
      // in unit test
      _ember['default'].getOwner(this).inject('controller', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    }
  });

  (0, _emberSinonQunitTestSupportTest['default'])('_notifyReportError', function (assert) {
    var controller = this.subject();
    var closeProgressModal = this.stub(controller, 'closeProgressModal');
    var displayAlert = this.stub(controller, 'displayAlert');

    assert.throws(function () {
      controller._notifyReportError('error message');
    }, new Error('error message'), 'Should throw error');

    assert.equal(displayAlert.getCall(0).args[0], 'Error Generating Report', 'Should set alert title');
    assert.equal(displayAlert.getCall(0).args[1], 'An error was encountered while generating the requested report.  Please let your system administrator know that you have encountered an error.', 'Should set alert message');
    assert.ok(closeProgressModal.calledOnce, 'Should close progress modal');
  });

  (0, _emberSinonQunitTestSupportTest['default'])('_setReportTitle', function (assert) {
    var endDate = new Date(1482269979422);
    var startDate = new Date(1472269979422);
    var controller = this.subject({
      endDate: endDate,
      startDate: startDate,
      reportTypes: [_ember['default'].Object.create({
        value: 'one',
        name: 'Number One'
      }), _ember['default'].Object.create({
        value: 'two',
        name: 'Number Two'
      })],
      reportType: 'two'
    });
    controller._setReportTitle();

    assert.equal(controller.get('reportTitle').toString(), 'Number Two Report ' + (0, _moment['default'])(startDate).format('l') + ' - ' + (0, _moment['default'])(endDate).format('l'));
  });

  (0, _emberSinonQunitTestSupportTest['default'])('_setReportTitle single date', function (assert) {
    var endDate = new Date(1472269979422);
    var controller = this.subject({
      endDate: endDate,
      reportTypes: [_ember['default'].Object.create({
        value: 'one',
        name: 'Number One'
      }), _ember['default'].Object.create({
        value: 'two',
        name: 'Number Two'
      })],
      reportType: 'one'
    });

    this.stub(window, 'moment', function () {
      return {
        format: function format() {
          return 'April 3rd, 2015';
        }
      };
    });

    controller._setReportTitle();

    assert.equal(controller.get('reportTitle').toString(), 'Number One Report ' + (0, _moment['default'])(endDate).format('l'));
  });

  (0, _emberQunit.test)('actions.firstPage', function (assert) {
    var controller = this.subject();

    controller.send('firstPage');

    assert.strictEqual(controller.get('offset'), 0);
  });

  (0, _emberQunit.test)('actions.nextPage', function (assert) {
    var controller = this.subject({
      offset: 8,
      limit: 4
    });

    controller.send('nextPage');

    assert.strictEqual(controller.get('offset'), 12);
  });

  (0, _emberQunit.test)('actions.previousPage', function (assert) {
    var controller = this.subject({
      offset: 8,
      limit: 2
    });

    controller.send('previousPage');

    assert.strictEqual(controller.get('offset'), 6);
  });

  (0, _emberQunit.test)('actions.lastPage', function (assert) {
    var controller = this.subject({
      limit: 1,
      offset: 0,
      reportRows: ['one', 'two', 'three']
    });

    controller.send('lastPage');

    assert.strictEqual(controller.get('offset'), 3);
  });

  (0, _emberQunit.test)('currentReportRows', function (assert) {
    var controller = this.subject({
      limit: 2,
      offset: 1,
      reportRows: ['one', 'two', 'three', 'four']
    });

    assert.deepEqual(controller.get('currentReportRows'), ['two', 'three']);
  });

  (0, _emberQunit.test)('disablePreviousPage', function (assert) {
    var controller = this.subject({
      offset: 0
    });

    assert.strictEqual(controller.get('disablePreviousPage'), true);
  });

  (0, _emberQunit.test)('disablePreviousPage false', function (assert) {
    var controller = this.subject({
      offset: 2
    });

    assert.strictEqual(controller.get('disablePreviousPage'), false);
  });

  (0, _emberQunit.test)('disableNextPage', function (assert) {
    var controller = this.subject({
      limit: 1,
      offset: 2,
      reportRows: ['one', 'two', 'three']
    });

    assert.strictEqual(controller.get('disableNextPage'), true);
  });

  (0, _emberQunit.test)('disableNextPage false', function (assert) {
    var controller = this.subject({
      limit: 1,
      offset: 1,
      reportRows: ['one', 'two', 'three']
    });

    assert.strictEqual(controller.get('disableNextPage'), false);
  });

  (0, _emberQunit.test)('showPagination', function (assert) {
    var controller = this.subject({
      limit: 1,
      offset: 0,
      reportRows: ['one', 'two', 'three']
    });

    assert.strictEqual(controller.get('showPagination'), true);
  });

  (0, _emberQunit.test)('showPagination false', function (assert) {
    var controller = this.subject({
      limit: 3,
      offset: 0,
      reportRows: ['one', 'two', 'three']
    });

    assert.strictEqual(controller.get('showPagination'), false);
  });
});
define('hospitalrun/tests/unit/controllers/abstract-report-controller-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/controllers/abstract-report-controller-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/controllers/abstract-report-controller-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/appointment-statuses-test', ['exports', 'hospitalrun/mixins/appointment-statuses', 'ember-qunit', 'ember'], function (exports, _hospitalrunMixinsAppointmentStatuses, _emberQunit, _ember) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:appointment-statuses', 'Unit | Mixin | appointment-statuses');

  (0, _emberQunit.test)('appointmentStatusList', function (assert) {
    var appointmentStatuses = _ember['default'].Object.extend(_hospitalrunMixinsAppointmentStatuses['default']).create();
    assert.deepEqual(appointmentStatuses.get('appointmentStatusList'), ['Attended', 'Scheduled', 'Canceled', 'Missed']);
  });

  (0, _emberQunit.test)('appointmentStatuses', function (assert) {
    var appointmentStatuses = _ember['default'].Object.extend(_hospitalrunMixinsAppointmentStatuses['default']).create();
    assert.deepEqual(appointmentStatuses.get('appointmentStatuses'), [{
      id: 'Attended',
      value: 'Attended'
    }, {
      id: 'Scheduled',
      value: 'Scheduled'
    }, {
      id: 'Canceled',
      value: 'Canceled'
    }, {
      id: 'Missed',
      value: 'Missed'
    }]);
  });

  (0, _emberQunit.test)('appointmentStatusesWithEmpty', function (assert) {
    var appointmentStatuses = _ember['default'].Object.extend(_hospitalrunMixinsAppointmentStatuses['default']).create();
    assert.deepEqual(appointmentStatuses.get('appointmentStatusesWithEmpty'), [{
      id: '',
      value: ''
    }, {
      id: 'Attended',
      value: 'Attended'
    }, {
      id: 'Scheduled',
      value: 'Scheduled'
    }, {
      id: 'Canceled',
      value: 'Canceled'
    }, {
      id: 'Missed',
      value: 'Missed'
    }]);
  });
});
define('hospitalrun/tests/unit/mixins/appointment-statuses-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/appointment-statuses-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/appointment-statuses-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/can-edit-requested-test', ['exports', 'hospitalrun/mixins/can-edit-requested', 'ember-qunit', 'ember'], function (exports, _hospitalrunMixinsCanEditRequested, _emberQunit, _ember) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:can-edit-requested', 'Unit | Mixin | can-edit-requested');

  (0, _emberQunit.test)('canEdit', function (assert) {
    var canEditRequested = _ember['default'].Object.extend(_hospitalrunMixinsCanEditRequested['default']).create({
      status: 'Requested'
    });

    assert.strictEqual(canEditRequested.get('canEdit'), true);
  });

  (0, _emberQunit.test)('canEdit false', function (assert) {
    var canEditRequested = _ember['default'].Object.extend(_hospitalrunMixinsCanEditRequested['default']).create();

    assert.strictEqual(canEditRequested.get('canEdit'), false);
  });
});
define('hospitalrun/tests/unit/mixins/can-edit-requested-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/can-edit-requested-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/can-edit-requested-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/date-format-test', ['exports', 'hospitalrun/mixins/date-format', 'ember-qunit', 'ember'], function (exports, _hospitalrunMixinsDateFormat, _emberQunit, _ember) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:date-format', 'Unit | Mixin | date-format');

  (0, _emberQunit.test)('dateToTime', function (assert) {
    var dateFormat = _ember['default'].Object.extend(_hospitalrunMixinsDateFormat['default']).create();

    assert.strictEqual(dateFormat.dateToTime(new Date(1481665085175)), 1481665085175, 'Should return correct time');

    assert.strictEqual(dateFormat.dateToTime(), undefined, 'Should return undefined for no argument');

    assert.strictEqual(dateFormat.dateToTime(1481665085175), undefined, 'Should return undefined for non Date object');
  });
});
define('hospitalrun/tests/unit/mixins/date-format-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/date-format-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/date-format-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/dob-days-test', ['exports', 'hospitalrun/mixins/dob-days', 'ember-qunit', 'ember', 'ember-data', 'ember-i18n/helper', 'ember-i18n/config/en'], function (exports, _hospitalrunMixinsDobDays, _emberQunit, _ember, _emberData, _emberI18nHelper, _emberI18nConfigEn) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:dob-days', 'Unit | Mixin | dob-days', {
    needs: ['service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      // Inject i18n as the intializer does not run in unit test
      _ember['default'].getOwner(this).inject('model', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);

      // eslint-disable-next-line no-undef
      timekeeper.freeze(new Date(1481784419830));
    },
    afterEach: function afterEach() {
      // eslint-disable-next-line no-undef
      timekeeper.reset();
    },
    subject: function subject(attrs) {
      var _this = this;

      var subject = undefined;
      _ember['default'].run(function () {
        var Test = _emberData['default'].Model.extend(_hospitalrunMixinsDobDays['default']);
        _this.register('model:test', Test);
        subject = _this.store().createRecord('test', attrs);
      });

      return subject;
    },
    store: function store() {
      return this.container.lookup('service:store');
    }
  });

  (0, _emberQunit.test)('convertDOBToText', function (assert) {
    var dobDays = this.subject();

    assert.strictEqual(dobDays.convertDOBToText(new Date(789109200000)).toString(), '21 years 11 months 12 days');
  });

  (0, _emberQunit.test)('convertDOBToText date string', function (assert) {
    var dobDays = this.subject();

    assert.strictEqual(dobDays.convertDOBToText('January 3rd, 1995').toString(), '21 years 8 months 26 days');
  });

  (0, _emberQunit.test)('convertDOBToText date string short format', function (assert) {
    var dobDays = this.subject();

    assert.strictEqual(dobDays.convertDOBToText('January 3rd, 1995', true).toString(), '21y 8m 26d');
  });

  (0, _emberQunit.test)('convertDOBToText date string omit days', function (assert) {
    var dobDays = this.subject();

    assert.strictEqual(dobDays.convertDOBToText('January 3rd, 1995', false, true).toString(), '21 years 8 months');
  });
});
define('hospitalrun/tests/unit/mixins/dob-days-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/dob-days-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/dob-days-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/inventory-adjustment-types-test', ['exports', 'hospitalrun/mixins/inventory-adjustment-types', 'ember-qunit', 'ember', 'ember-i18n/helper', 'ember-i18n/config/en'], function (exports, _hospitalrunMixinsInventoryAdjustmentTypes, _emberQunit, _ember, _emberI18nHelper, _emberI18nConfigEn) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:inventory-adjustment-types', 'Unit | Mixin | inventory-adjustment-types', {
    needs: ['service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      // Inject i18n as the intializer does not run in unit test
      _ember['default'].getOwner(this).inject('inventory-adjustment-types', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    },
    subject: function subject() {
      var AdjustmentTypesObject = _ember['default'].Object.extend(_hospitalrunMixinsInventoryAdjustmentTypes['default']);
      this.registry.register('inventory-adjustment-types:main', AdjustmentTypesObject);
      return _ember['default'].getOwner(this).lookup('inventory-adjustment-types:main');
    }
  });

  (0, _emberQunit.test)('checkTranslations', function (assert) {
    var InventoryAdjustmentTypes = this.subject();
    assert.deepEqual(InventoryAdjustmentTypes.get('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/tests/unit/mixins/inventory-adjustment-types-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/inventory-adjustment-types-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/inventory-adjustment-types-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/location-name-test', ['exports', 'hospitalrun/mixins/location-name', 'ember-qunit', 'ember', 'ember-data'], function (exports, _hospitalrunMixinsLocationName, _emberQunit, _ember, _emberData) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:location-name', 'Unit | Mixin | location-name', {
    subject: function subject(attrs) {
      var _this = this;

      var subject = undefined;
      _ember['default'].run(function () {
        var Test = _emberData['default'].Model.extend(_hospitalrunMixinsLocationName['default']);
        _this.register('model:test', Test);
        subject = _this.store().createRecord('test', attrs);
      });

      return subject;
    },
    store: function store() {
      return this.container.lookup('service:store');
    }
  });

  (0, _emberQunit.test)('getDisplayLocationName', function (assert) {
    var locationName = this.subject();

    assert.strictEqual(locationName.getDisplayLocationName('Location', 'Aisle'), 'Location : Aisle', 'Should include both');
    assert.strictEqual(locationName.getDisplayLocationName('Location'), 'Location', 'Should only include location');
    assert.strictEqual(locationName.getDisplayLocationName('', 'Aisle'), 'Aisle', 'Should only include aisle location');
    assert.strictEqual(locationName.getDisplayLocationName('', ''), 'No Location', 'Should return default "No Location" message');
  });

  (0, _emberQunit.test)('locationName', function (assert) {
    var locationName = this.subject({
      location: 'Location',
      aisleLocation: 'Aisle'
    });

    assert.strictEqual(locationName.get('locationName'), 'Location : Aisle');
  });
});
define('hospitalrun/tests/unit/mixins/location-name-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/location-name-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/location-name-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/medication-details-test', ['exports', 'hospitalrun/mixins/medication-details', 'ember-qunit', 'ember', 'ember-data'], function (exports, _hospitalrunMixinsMedicationDetails, _emberQunit, _ember, _emberData) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:medication-details', 'Unit | Mixin | medication-details', {
    needs: ['ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence', 'model:inventory', 'model:inv-purchase', 'model:inv-location'],
    subject: function subject(attrs) {
      var _this = this;

      var subject = undefined;
      _ember['default'].run(function () {
        var Test = _emberData['default'].Model.extend(_hospitalrunMixinsMedicationDetails['default']);
        _this.register('model:test', Test);
        subject = _this.store().createRecord('test', attrs);
      });

      return subject;
    },
    store: function store() {
      return this.container.lookup('service:store');
    }
  });

  (0, _emberQunit.test)('getMedicationName', function (assert) {
    var medicationDetails = this.subject({
      medicationTitle: 'Medication Title'
    });

    assert.strictEqual(medicationDetails.getMedicationName(), 'Medication Title');
  });

  (0, _emberQunit.test)('getMedicationName prefer medicationTitle', function (assert) {
    var _this2 = this;

    var inventoryItem = undefined;
    _ember['default'].run(function () {
      inventoryItem = _this2.store().createRecord('inventory', {
        name: 'Test Item'
      });
    });

    var medicationDetails = this.subject({
      medicationTitle: 'Medication Title',
      inventoryItem: inventoryItem
    });

    assert.strictEqual(medicationDetails.getMedicationName('inventoryItem'), 'Medication Title');
  });

  (0, _emberQunit.test)('getMedicationName attribute', function (assert) {
    var _this3 = this;

    var inventoryItem = undefined;
    _ember['default'].run(function () {
      inventoryItem = _this3.store().createRecord('inventory', {
        name: 'Test Item'
      });
    });

    var medicationDetails = this.subject({ inventoryItem: inventoryItem });
    /**
     * We run this twice because if this gets the value from
     * the attribute it does not actually return the value
     */
    _ember['default'].run(function () {
      return medicationDetails.getMedicationName('inventoryItem');
    });

    assert.strictEqual(medicationDetails.getMedicationName('inventoryItem'), 'Test Item');
  });

  (0, _emberQunit.test)('getMedicationPrice', function (assert) {
    var medicationDetails = this.subject({
      priceOfMedication: 15.50
    });

    assert.strictEqual(medicationDetails.getMedicationPrice(), 15.50);
  });

  (0, _emberQunit.test)('getMedicationPrice prefer priceOfMedication', function (assert) {
    var _this4 = this;

    var inventoryItem = undefined;
    _ember['default'].run(function () {
      inventoryItem = _this4.store().createRecord('inventory', {
        name: 'Test Item',
        price: 12.15
      });
    });

    var medicationDetails = this.subject({
      priceOfMedication: 15.5,
      inventoryItem: inventoryItem
    });

    assert.strictEqual(medicationDetails.getMedicationPrice('inventoryItem'), 15.5);
  });

  (0, _emberQunit.test)('getMedicationPrice attribute', function (assert) {
    var _this5 = this;

    var inventoryItem = undefined;
    _ember['default'].run(function () {
      inventoryItem = _this5.store().createRecord('inventory', {
        name: 'Test Item',
        price: 22.33
      });
    });

    var medicationDetails = this.subject({ inventoryItem: inventoryItem });

    /**
     * We run this twice because if this gets the value from
     * the attribute it does not actually return the value
     */
    _ember['default'].run(function () {
      return medicationDetails.getMedicationPrice('inventoryItem');
    });

    assert.strictEqual(medicationDetails.getMedicationPrice('inventoryItem'), 22.33);
  });

  (0, _emberQunit.test)('getMedicationDetails', function (assert) {
    var done = assert.async();

    var medicationDetails = this.subject({
      medicationTitle: 'Medication Title',
      priceOfMedication: 65.77
    });

    medicationDetails.getMedicationDetails().then(function (result) {
      assert.deepEqual(result, {
        name: 'Medication Title',
        price: 65.77
      });

      done();
    });
  });
});
define('hospitalrun/tests/unit/mixins/medication-details-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/medication-details-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/medication-details-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/number-format-test', ['exports', 'hospitalrun/mixins/number-format', 'ember-qunit', 'ember'], function (exports, _hospitalrunMixinsNumberFormat, _emberQunit, _ember) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:number-format', 'Unit | Mixin | number-format');

  (0, _emberQunit.test)('_calculateTotal', function (assert) {
    var records = [5, 5, 6].map(function (id) {
      return _ember['default'].Object.create({ id: id });
    });
    var numberFormat = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']).create({ records: records });

    assert.strictEqual(numberFormat._calculateTotal('records', 'id'), 16, 'Should add property array');
  });

  (0, _emberQunit.test)('_calculateTotal property name', function (assert) {
    var records = [5, 2, 3].map(function (id) {
      return _ember['default'].Object.create({ id: id });
    });
    var numberFormat = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']).create();

    assert.strictEqual(numberFormat._calculateTotal(records, 'id'), 10, 'Should add passed in array');
  });

  (0, _emberQunit.test)('_calculateTotal invalid number', function (assert) {
    var records = [5, 'test', 3].map(function (id) {
      return _ember['default'].Object.create({ id: id });
    });
    var numberFormat = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']).create({ records: records });

    assert.strictEqual(numberFormat._calculateTotal('records', 'id'), 8, 'Should treat invalid number as 0');
  });

  (0, _emberQunit.test)('_numberFormat', function (assert) {
    var numberFormat = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']).create();

    assert.strictEqual(numberFormat._numberFormat(), undefined, 'Should return undefined for no argument');
    assert.strictEqual(numberFormat._numberFormat('test'), undefined, 'Should return undefined for no number');
    assert.strictEqual(numberFormat._numberFormat(12), '12', 'Should return basic int as string');
    assert.strictEqual(numberFormat._numberFormat(12, true), 12, 'Should return basic int as number');
    assert.strictEqual(numberFormat._numberFormat(12.2, true), 12.2, 'Should round tenths properly');
    assert.strictEqual(numberFormat._numberFormat(12.2), '12.20', 'Should pad decial to two places');
    assert.strictEqual(numberFormat._numberFormat(35.555, true), 35.56, 'Should round 35.555 to 35.56');
    assert.strictEqual(numberFormat._numberFormat(35.555), '35.56', 'Should return 35.555 as string "35.56"');
  });

  (0, _emberQunit.test)('_getValidNumber', function (assert) {
    var numberFormat = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']).create();

    assert.strictEqual(numberFormat._getValidNumber(), 0, 'Should return 0 for no argument');
    assert.strictEqual(numberFormat._getValidNumber('test'), 0, 'Should return 0 for invalid number');
    assert.strictEqual(numberFormat._getValidNumber(NaN), 0, 'Should return 0 for NaN');
    assert.strictEqual(numberFormat._getValidNumber('12.2'), 12.2, 'Should convert string to number');
    assert.strictEqual(numberFormat._getValidNumber(1), 1, 'Should return basic int');
  });

  (0, _emberQunit.test)('_validNumber', function (assert) {
    var numberFormat = _ember['default'].Object.extend(_hospitalrunMixinsNumberFormat['default']).create();

    assert.strictEqual(numberFormat._validNumber(1), true, 'Should return true for basic int');
    assert.strictEqual(numberFormat._validNumber(1.5), true, 'Should return true for float');
    assert.strictEqual(numberFormat._validNumber('1'), true, 'Should return true for numeric string');
    assert.strictEqual(numberFormat._validNumber(-1), false, 'Should return false for negative');
    assert.strictEqual(numberFormat._validNumber('test'), false, 'Should return false for non numeric string');
  });
});
define('hospitalrun/tests/unit/mixins/number-format-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/number-format-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/number-format-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/patient-diagnosis-test', ['exports', 'hospitalrun/mixins/patient-diagnosis', 'ember-qunit', 'ember'], function (exports, _hospitalrunMixinsPatientDiagnosis, _emberQunit, _ember) {
  'use strict';

  var DIAGNOSIS_PROPERTIES = ['active', 'date', 'diagnosis', 'secondaryDiagnosis'];

  function diagnosesDump(diagnoses) {
    return diagnoses.map(function (diagnosis) {
      return diagnosis.getProperties(DIAGNOSIS_PROPERTIES);
    });
  }

  (0, _emberQunit.moduleFor)('mixin:patient-diagnosis', 'Unit | Mixin | patient-diagnosis', {
    needs: ['model:visit', 'model:proc-charge', 'model:patient', 'model:vital', 'model:imaging', 'model:lab', 'model:medication', 'model:patient-note', 'model:procedure', 'model:diagnosis', 'model:report', 'ember-validations@validator:local/acceptance', 'ember-validations@validator:local/presence'],
    store: function store() {
      return this.container.lookup('service:store');
    },
    getVisitData: function getVisitData() {
      var _this = this;

      return _ember['default'].run(function () {
        var visitDate = new Date(1393822800000);
        return _this.store().createRecord('visit', {
          startDate: visitDate,
          diagnoses: [{
            diagnosis: 'primary one',
            date: visitDate
          }, {
            active: false,
            date: new Date(1372822800000),
            diagnosis: 'primary two'
          }, {
            diagnosis: 'additional diag one a',
            secondaryDiagnosis: true,
            date: visitDate,
            active: true
          }, {
            diagnosis: 'additional diag one b',
            secondaryDiagnosis: true,
            date: visitDate,
            active: false
          }].map(function (diagnosis) {
            return _this.store().createRecord('diagnosis', diagnosis);
          })
        });
      });
    }
  });

  (0, _emberQunit.test)('get active primary diagnoses', function (assert) {
    var patientDiagnosis = _ember['default'].Object.extend(_hospitalrunMixinsPatientDiagnosis['default']).create();
    var visit = this.getVisitData();
    var diagnosesList = patientDiagnosis.getDiagnoses(visit, true, false);
    assert.deepEqual(diagnosesDump(diagnosesList), [{
      active: true,
      date: new Date('Mon Mar 03 2014 00:00:00 GMT-0500 (EST)'),
      diagnosis: 'primary one',
      secondaryDiagnosis: false
    }], 'Only active primary diagnoses are returned', assert);
  });

  (0, _emberQunit.test)('get all primary diagnoses', function (assert) {
    var patientDiagnosis = _ember['default'].Object.extend(_hospitalrunMixinsPatientDiagnosis['default']).create();
    var visit = this.getVisitData();
    var diagnosesList = patientDiagnosis.getDiagnoses(visit, false, false);
    assert.deepEqual(diagnosesDump(diagnosesList), [{
      active: true,
      date: new Date('Mon Mar 03 2014 00:00:00 GMT-0500 (EST)'),
      diagnosis: 'primary one',
      secondaryDiagnosis: false
    }, {
      active: false,
      date: new Date('Tue Jul 02 2013 23:40:00 GMT-0400 (EDT)'),
      diagnosis: 'primary two',
      secondaryDiagnosis: false
    }], 'All primary diagnoses are returned', assert);
  });

  (0, _emberQunit.test)('get active secondary diagnoses', function (assert) {
    var patientDiagnosis = _ember['default'].Object.extend(_hospitalrunMixinsPatientDiagnosis['default']).create();
    var visit = this.getVisitData();
    var diagnosesList = patientDiagnosis.getDiagnoses(visit, true, true);
    assert.deepEqual(diagnosesDump(diagnosesList), [{
      active: true,
      date: new Date('Mon Mar 03 2014 00:00:00 GMT-0500 (EST)'),
      diagnosis: 'additional diag one a',
      secondaryDiagnosis: true
    }], 'Only active secondary diagnoses are returned');
  });

  (0, _emberQunit.test)('get all secondary diagnoses', function (assert) {
    var patientDiagnosis = _ember['default'].Object.extend(_hospitalrunMixinsPatientDiagnosis['default']).create();
    var visit = this.getVisitData();
    var diagnosesList = patientDiagnosis.getDiagnoses(visit, false, true);
    assert.deepEqual(diagnosesDump(diagnosesList), [{
      active: true,
      date: new Date('Mon Mar 03 2014 00:00:00 GMT-0500 (EST)'),
      diagnosis: 'additional diag one a',
      secondaryDiagnosis: true
    }, {
      active: false,
      date: new Date('Mon Mar 03 2014 00:00:00 GMT-0500 (EST)'),
      diagnosis: 'additional diag one b',
      secondaryDiagnosis: true
    }], 'All secondary diagnoses are returned');
  });
});
define('hospitalrun/tests/unit/mixins/patient-diagnosis-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/patient-diagnosis-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/patient-diagnosis-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/patient-name-test', ['exports', 'hospitalrun/mixins/patient-name', 'ember-qunit', 'ember', 'ember-data'], function (exports, _hospitalrunMixinsPatientName, _emberQunit, _ember, _emberData) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:patient-name', 'Unit | Mixin | patient-name', {
    needs: ['ember-validations@validator:local/format', 'ember-validations@validator:local/presence', 'model:allergy', 'model:diagnosis', 'model:operation-report', 'model:operative-plan', 'model:patient', 'model:payment', 'model:price-profile'],
    subject: function subject(attrs) {
      var _this = this;

      var subject = undefined;
      _ember['default'].run(function () {
        var Test = _emberData['default'].Model.extend(_hospitalrunMixinsPatientName['default']);
        _this.register('model:test', Test);
        subject = _this.store().createRecord('test', attrs);
      });

      return subject;
    },
    store: function store() {
      return this.container.lookup('service:store');
    }
  });

  (0, _emberQunit.test)('getPatientDisplayId friendlyId', function (assert) {
    var _this2 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this2.store().createRecord('patient', {
        friendlyId: 'test',
        id: '123'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayId(patient), 'test');
  });

  (0, _emberQunit.test)('getPatientDisplayId externalPatientId', function (assert) {
    var _this3 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this3.store().createRecord('patient', {
        externalPatientId: '1234',
        id: '4321'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayId(patient), '1234');
  });

  (0, _emberQunit.test)('getPatientDisplayId id', function (assert) {
    var _this4 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this4.store().createRecord('patient', {
        id: '9876'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayId(patient), '9876');
  });

  (0, _emberQunit.test)('getPatientDisplayName', function (assert) {
    var _this5 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this5.store().createRecord('patient', {
        firstName: 'First',
        lastName: 'Last',
        middleName: 'Middle'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayName(patient), 'First Middle Last');
  });

  (0, _emberQunit.test)('getPatientDisplayName first', function (assert) {
    var _this6 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this6.store().createRecord('patient', {
        firstName: 'First'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayName(patient), 'First');
  });

  (0, _emberQunit.test)('getPatientDisplayName first and last', function (assert) {
    var _this7 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this7.store().createRecord('patient', {
        firstName: 'First',
        lastName: 'Last'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayName(patient), 'First Last');
  });

  (0, _emberQunit.test)('getPatientDisplayName last', function (assert) {
    var _this8 = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this8.store().createRecord('patient', {
        lastName: 'Last'
      });
    });

    assert.strictEqual(this.subject().getPatientDisplayName(patient), 'Last');
  });
});
define('hospitalrun/tests/unit/mixins/patient-name-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/patient-name-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/patient-name-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/mixins/return-to-test', ['exports', 'hospitalrun/mixins/return-to', 'ember-qunit', 'ember', 'ember-data'], function (exports, _hospitalrunMixinsReturnTo, _emberQunit, _ember, _emberData) {
  'use strict';

  (0, _emberQunit.moduleFor)('mixin:return-to', 'Unit | Mixin | return-to', {
    subject: function subject(attrs) {
      var _this = this;

      return _ember['default'].run(function () {
        var Test = _emberData['default'].Model.extend(_hospitalrunMixinsReturnTo['default']);
        _this.register('model:test', Test);
        return _this.store().createRecord('test', attrs);
      });
    },
    store: function store() {
      return this.container.lookup('service:store');
    }
  });

  (0, _emberQunit.test)('cancelAction', function (assert) {
    var returnTo = this.subject({
      model: {
        returnTo: 'test'
      }
    });

    assert.strictEqual(returnTo.get('cancelAction'), 'returnTo');
  });

  (0, _emberQunit.test)('cancelAction allItems', function (assert) {
    var returnTo = this.subject();

    assert.strictEqual(returnTo.get('cancelAction'), 'allItems');
  });
});
define('hospitalrun/tests/unit/mixins/return-to-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/mixins/return-to-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/mixins/return-to-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/add-diagnosis-test', ['exports', 'ember-qunit', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('add-diagnosis', 'Unit | Model | add-diagnosis', {
    // Specify the other units that are required for this test.
    needs: ['ember-validations@validator:local/presence']
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('diagnosis', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('diagnosis', [undefined]);
});
define('hospitalrun/tests/unit/models/add-diagnosis-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/add-diagnosis-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/add-diagnosis-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/appointment-test', ['exports', 'ember-qunit', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('appointment', 'Unit | Model | appointment', {
    needs: ['ember-validations@validator:local/acceptance', 'ember-validations@validator:local/presence', 'model:patient', 'model:visit']
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('appointmentType', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('appointmentType', [undefined]);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('startDate', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('startDate', [undefined]);
});
define('hospitalrun/tests/unit/models/appointment-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/appointment-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/appointment-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/billing-line-item-test', ['exports', 'ember-qunit', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('billing-line-item', 'Unit | Model | billing-line-item', {
    needs: ['ember-validations@validator:local/presence', 'ember-validations@validator:local/numericality', 'model:line-item-detail']
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('category', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('category', [undefined]);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('discount', [123, '123', 0.123, undefined]);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('discount', ['test']);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('nationalInsurance', [123, '123', 0.123, undefined]);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('nationalInsurance', ['test']);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('name', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('name', [undefined]);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('privateInsurance', [123, '123', 0.123, undefined]);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('privateInsurance', ['test']);
});
define('hospitalrun/tests/unit/models/billing-line-item-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/billing-line-item-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/billing-line-item-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/family-info-test', ['exports', 'ember-qunit', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('family-info', 'Unit | Model | family-info', {
    needs: ['ember-validations@validator:local/presence', 'ember-validations@validator:local/numericality']
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('age', [123, 123.0, '123', undefined]);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('age', ['test']);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('name', ['Test Person']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('name', [undefined]);
});
define('hospitalrun/tests/unit/models/family-info-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/family-info-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/family-info-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/imaging-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('imaging', 'Unit | Model | imaging', {
    needs: ['model:proc-charge', 'model:pricing', 'model:patient', 'model:visit', 'ember-validations@validator:local/acceptance', 'ember-validations@validator:local/presence']
  });

  (0, _emberQunit.test)('imagingDateAsTime', function (assert) {
    var imaging = this.subject({
      imagingDate: new Date(1131593040000)
    });

    assert.strictEqual(imaging.get('imagingDateAsTime'), 1131593040000);
  });

  (0, _emberQunit.test)('requestedDateAsTime', function (assert) {
    var imaging = this.subject({
      requestedDate: new Date(1131593040000)
    });

    assert.strictEqual(imaging.get('requestedDateAsTime'), 1131593040000);
  });
});
define('hospitalrun/tests/unit/models/imaging-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/imaging-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/imaging-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/inv-location-test', ['exports', 'ember-qunit', 'ember-i18n/helper', 'ember-i18n/config/en'], function (exports, _emberQunit, _emberI18nHelper, _emberI18nConfigEn) {
  'use strict';

  (0, _emberQunit.moduleForModel)('inv-location', 'Unit | Model | inv-location', {
    needs: ['ember-validations@validator:local/numericality', 'ember-validations@validator:local/acceptance', 'ember-validations@validator:local/presence', 'service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    }
  });

  (0, _emberQunit.test)('locationNameWithQuantity', function (assert) {
    var invLocation = this.subject({
      quantity: 3,
      locationName: 'Test Location'
    });

    assert.equal(invLocation.get('locationNameWithQuantity'), 'Test Location (3 available)');
  });
});
define('hospitalrun/tests/unit/models/inv-location-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/inv-location-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/inv-location-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/inv-purchase-test', ['exports', 'ember-qunit', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('inv-purchase', 'Unit | Model | inv-purchase', {
    needs: ['ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence']
  });

  (0, _emberQunit.test)('costPerUnit', function (assert) {
    var inventoryPurchaseItem = this.subject({
      purchaseCost: 12.50,
      originalQuantity: 5
    });

    assert.strictEqual(inventoryPurchaseItem.get('costPerUnit'), 2.5);
  });

  (0, _emberQunit.test)('costPerUnit properly round', function (assert) {
    var inventoryPurchaseItem = this.subject({
      purchaseCost: 71.11,
      originalQuantity: 2
    });

    assert.strictEqual(inventoryPurchaseItem.get('costPerUnit'), 35.56);
  });

  (0, _emberQunit.test)('costPerUnit invalid input', function (assert) {
    var inventoryPurchaseItem = this.subject({
      purchaseCost: 0,
      originalQuantity: 5
    });

    assert.strictEqual(inventoryPurchaseItem.get('costPerUnit'), 0);
  });

  (0, _emberQunit.test)('costPerUnit 0 input', function (assert) {
    var inventoryPurchaseItem = this.subject({
      purchaseCost: 12.50,
      originalQuantity: 0
    });

    assert.strictEqual(inventoryPurchaseItem.get('costPerUnit'), 0);
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('purchaseCost', [123, 123.0, '123']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('purchaseCost', ['test', undefined]);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('originalQuantity', [0, 123, '0']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('originalQuantity', [-1, '-1', undefined]);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('vendor', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('vendor', [undefined]);
});
define('hospitalrun/tests/unit/models/inv-purchase-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/inv-purchase-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/inv-purchase-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/inv-request-test', ['exports', 'ember-qunit', 'ember', 'ember-i18n/helper', 'ember-i18n/config/en', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _ember, _emberI18nHelper, _emberI18nConfigEn, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('inv-request', 'Unit | Model | inv-request', {
    needs: ['ember-validations@validator:local/acceptance', 'ember-validations@validator:local/format', 'ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence', 'model:allergy', 'model:diagnosis', 'model:inventory', 'model:operation-report', 'model:operative-plan', 'model:patient', 'model:payment', 'model:price-profile', 'model:visit', 'service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      _ember['default'].getOwner(this).inject('model', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    }
  });

  (0, _emberQunit.test)('deliveryLocationName', function (assert) {
    var inventoryRequest = this.subject({
      deliveryAisle: 'Test Aisle',
      deliveryLocation: 'Test Location'
    });

    assert.strictEqual(inventoryRequest.get('deliveryLocationName'), 'Test Location : Test Aisle');
  });

  (0, _emberQunit.test)('deliveryDetails', function (assert) {
    var _this = this;

    var patient = undefined;
    _ember['default'].run(function () {
      patient = _this.store().createRecord('patient', {
        firstName: 'First'
      });
    });

    var inventoryRequest = this.subject({
      deliveryAisle: 'Test Aisle',
      deliveryLocation: 'Test Location',
      patient: patient
    });

    assert.strictEqual(inventoryRequest.get('deliveryDetails'), 'First');
  });

  (0, _emberQunit.test)('deliveryDetails without patient', function (assert) {
    var inventoryRequest = this.subject({
      deliveryAisle: 'Test Aisle',
      deliveryLocation: 'Test Location'
    });

    assert.strictEqual(inventoryRequest.get('deliveryDetails'), 'Test Location : Test Aisle');
  });

  (0, _emberQunit.test)('haveReason', function (assert) {
    var inventoryRequest = this.subject({
      reason: true
    });

    assert.strictEqual(inventoryRequest.get('haveReason'), true);
  });

  (0, _emberQunit.test)('haveReason false', function (assert) {
    assert.strictEqual(this.subject().get('haveReason'), false);
  });

  (0, _emberQunit.test)('isAdjustment', function (assert) {
    var inventoryRequest = this.subject({
      transactionType: 'Return To Vendor'
    });

    assert.strictEqual(inventoryRequest.get('isAdjustment'), true);
  });

  (0, _emberQunit.test)('isAdjustment false', function (assert) {
    var inventoryRequest = this.subject({
      transactionType: 'Fulfillment'
    });

    assert.strictEqual(inventoryRequest.get('isAdjustment'), false);
  });

  (0, _emberQunit.test)('isFulfillment', function (assert) {
    var inventoryRequest = this.subject({
      transactionType: 'Fulfillment'
    });

    assert.strictEqual(inventoryRequest.get('isFulfillment'), true);
  });

  (0, _emberQunit.test)('isTransfet', function (assert) {
    var inventoryRequest = this.subject({
      transactionType: 'Transfer'
    });

    assert.strictEqual(inventoryRequest.get('isTransfer'), true);
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('quantity', [0.5, 1, '123']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('quantity', [-1, -0.00001, undefined]);
});
define('hospitalrun/tests/unit/models/inv-request-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/inv-request-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/inv-request-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/inventory-batch-test', ['exports', 'ember-qunit', 'hospitalrun/tests/helpers/validate-properties'], function (exports, _emberQunit, _hospitalrunTestsHelpersValidateProperties) {
  'use strict';

  (0, _emberQunit.moduleForModel)('inventory-batch', 'Unit | Model | inventory-batch', {
    needs: ['ember-validations@validator:local/presence', 'ember-validations@validator:local/numericality']
  });

  (0, _emberQunit.test)('haveInvoiceItems', function (assert) {
    var inventoryBatch = this.subject({
      invoiceItems: ['test have']
    });

    assert.strictEqual(inventoryBatch.haveInvoiceItems(), true);
  });

  (0, _emberQunit.test)('haveInvoiceItems false', function (assert) {
    var inventoryBatch = this.subject();

    assert.strictEqual(inventoryBatch.haveInvoiceItems(), false);
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('dateReceived', ['test dr']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('dateReceived', [undefined]);

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('inventoryItemTypeAhead', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('inventoryItemTypeAhead', [undefined]);
  // Test skip validation
  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('inventoryItemTypeAhead', [undefined], function (subject) {
    subject.set('invoiceItems', ['item']);
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('quantity', [0.001, 1, '123']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('quantity', [-1, 0, '-1']);
  // Test skip validation
  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('quantity', [-1], function (subject) {
    subject.set('invoiceItems', ['item']);
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('purchaseCost', [0.001, 1, '123']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('purchaseCost', [-1, 0, '-1']);
  // Test skip validation
  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('purchaseCost', [-1], function (subject) {
    subject.set('invoiceItems', ['item']);
  });

  (0, _hospitalrunTestsHelpersValidateProperties.testValidPropertyValues)('vendor', ['test']);
  (0, _hospitalrunTestsHelpersValidateProperties.testInvalidPropertyValues)('vendor', [undefined]);
});
define('hospitalrun/tests/unit/models/inventory-batch-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/inventory-batch-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/inventory-batch-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/inventory-test', ['exports', 'ember', 'ember-qunit'], function (exports, _ember, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('inventory', 'Unit | Model | inventory', {
    // Specify the other units that are required for this test.
    needs: ['ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence', 'model:inv-location', 'model:inv-purchase', 'service:validations']
  });

  (0, _emberQunit.test)('condition', function (assert) {
    var model = this.subject();
    // let store = this.store();
    assert.ok(!!model, 'Model exists');

    _ember['default'].run(function () {
      model.setProperties({
        estimatedDaysOfStock: 28,
        rank: 'A'
      });
    });
    assert.equal(model.get('condition'), 'good', 'Condition Should be good with given values');

    _ember['default'].run(function () {
      model.set('estimatedDaysOfStock', 15);
    });
    assert.equal(model.get('condition'), 'average', 'Condition Should be average with new quantity');

    _ember['default'].run(function () {
      model.set('rank', 'B');
    });
    assert.equal(model.get('condition'), 'good', 'Condition should be good again with new rank');

    _ember['default'].run(function () {
      model.set('estimatedDaysOfStock', 6);
    });
    assert.equal(model.get('condition'), 'bad', 'Condition should be bad with new quantity');

    _ember['default'].run(function () {
      model.set('rank', 'C');
    });
    assert.equal(model.get('condition'), 'average', 'Condition should be average again');
  });
});
define('hospitalrun/tests/unit/models/inventory-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/inventory-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/inventory-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/invoice-test', ['exports', 'ember-qunit', 'ember'], function (exports, _emberQunit, _ember) {
  'use strict';

  (0, _emberQunit.moduleForModel)('invoice', 'Unit | Model | invoice', {
    needs: ['model:patient', 'model:visit', 'model:price-profile', 'model:payment', 'model:billing-line-item', 'model:line-item-detail', 'ember-validations@validator:local/acceptance', 'ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence']
  });

  var lineItemsData = [{
    category: 'test',
    privateInsurance: 10,
    nationalInsurance: 3,
    discount: 5
  }, {
    privateInsurance: 4,
    nationalInsurance: 5,
    discount: 2
  }];

  (0, _emberQunit.test)('addPayment', function (assert) {
    var _this = this;

    var payments = undefined;
    _ember['default'].run(function () {
      payments = [12.5, 10].map(function (amount) {
        var model = _this.store().createRecord('payment', { amount: amount });
        model.set('currentState.parentState.isNew', false);
        return model;
      });
    });
    var invoice = this.subject();

    _ember['default'].run(function () {
      return invoice.addPayment(payments[0]);
    });
    assert.strictEqual(invoice.get('paidTotal'), 12.5, 'Should add first payment');

    _ember['default'].run(function () {
      return invoice.addPayment(payments[1]);
    });
    assert.strictEqual(invoice.get('paidTotal'), 22.5, 'Should add second payment');
  });

  (0, _emberQunit.test)('billAsDate', function (assert) {
    var invoice = this.subject({
      billDate: new Date(1481745786401)
    });

    assert.strictEqual(invoice.get('billDateAsTime'), 1481745786401);
  });

  (0, _emberQunit.test)('paidFlag', function (assert) {
    var invoice = this.subject({ status: 'Paid' });

    assert.strictEqual(invoice.get('paidFlag'), true);
  });

  (0, _emberQunit.test)('paidFlag false', function (assert) {
    var invoice = this.subject();

    assert.strictEqual(invoice.get('paidFlag'), false);
  });

  (0, _emberQunit.test)('discount', function (assert) {
    var _this2 = this;

    var lineItems = undefined,
        invoice = undefined;
    _ember['default'].run(function () {
      lineItems = lineItemsData.map(function (item) {
        return _this2.store().createRecord('billing-line-item', item);
      });
      invoice = _this2.subject({ lineItems: lineItems });
    });

    assert.strictEqual(invoice.get('discount'), 7);
  });

  (0, _emberQunit.test)('nationalInsurance', function (assert) {
    var _this3 = this;

    var lineItems = undefined,
        invoice = undefined;
    _ember['default'].run(function () {
      lineItems = lineItemsData.map(function (item) {
        return _this3.store().createRecord('billing-line-item', item);
      });
      invoice = _this3.subject({ lineItems: lineItems });
    });

    assert.strictEqual(invoice.get('nationalInsurance'), 8);
  });

  (0, _emberQunit.test)('privateInsurance', function (assert) {
    var _this4 = this;

    var lineItems = undefined,
        invoice = undefined;
    _ember['default'].run(function () {
      lineItems = lineItemsData.map(function (item) {
        return _this4.store().createRecord('billing-line-item', item);
      });
      invoice = _this4.subject({ lineItems: lineItems });
    });

    assert.strictEqual(invoice.get('privateInsurance'), 14);
  });
});
define('hospitalrun/tests/unit/models/invoice-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/invoice-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/invoice-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/line-item-detail-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('line-item-detail', 'Unit | Model | line-item-detail', {
    needs: ['model:pricing']
  });

  (0, _emberQunit.test)('amountOwed', function (assert) {
    var lineItemDetail = this.subject({
      price: 123.45,
      quantity: 3
    });
    assert.strictEqual(lineItemDetail.get('amountOwed'), 370.35);
  });

  (0, _emberQunit.test)('amountOwed valid price string', function (assert) {
    var lineItemDetail = this.subject({
      price: '22.50',
      quantity: 2
    });
    assert.strictEqual(lineItemDetail.get('amountOwed'), 45);
  });

  (0, _emberQunit.test)('amountOwed invalid quantity', function (assert) {
    var lineItemDetail = this.subject({
      price: 123.50,
      quantity: -1
    });
    assert.strictEqual(lineItemDetail.get('amountOwed'), 0);
  });

  (0, _emberQunit.test)('amountOwed invalid price', function (assert) {
    var lineItemDetail = this.subject({
      price: 'invalid',
      quantity: 2
    });
    assert.strictEqual(lineItemDetail.get('amountOwed'), 0);
  });
});
define('hospitalrun/tests/unit/models/line-item-detail-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/line-item-detail-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/line-item-detail-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/medication-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('medication', 'Unit | Model | medication', {
    needs: ['ember-validations@validator:local/acceptance', 'ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence', 'model:inventory', 'model:patient', 'model:visit']
  });

  (0, _emberQunit.test)('isRequested', function (assert) {
    var medication = this.subject({ status: 'Requested' });

    assert.strictEqual(medication.get('isRequested'), true);
  });

  (0, _emberQunit.test)('isRequested false', function (assert) {
    var medication = this.subject({ status: 'Test' });

    assert.strictEqual(medication.get('isRequested'), false);
  });
});
define('hospitalrun/tests/unit/models/medication-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/medication-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/medication-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/patient-note-test', ['exports', 'ember-qunit', 'ember', 'ember-i18n/helper', 'ember-i18n/config/en'], function (exports, _emberQunit, _ember, _emberI18nHelper, _emberI18nConfigEn) {
  'use strict';

  (0, _emberQunit.moduleForModel)('patient-note', 'Unit | Model | patient-note', {
    needs: ['ember-validations@validator:local/presence', 'service:i18n', 'locale:en/translations', 'locale:en/config', 'util:i18n/missing-message', 'util:i18n/compile-template', 'config:environment', 'model:patient', 'model:visit'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      // manually inject the i18n service as initialzer does not run
      // in unit test
      _ember['default'].getOwner(this).inject('model', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    }
  });

  (0, _emberQunit.test)('authoredBy', function (assert) {
    var patientNote = this.subject({
      createdBy: 'Test Person'
    });

    assert.strictEqual(patientNote.get('authoredBy'), 'Test Person');
  });

  (0, _emberQunit.test)('authoredBy', function (assert) {
    var patientNote = this.subject({
      createdBy: 'Test Person',
      attribution: 'Test Organization'
    });

    assert.strictEqual(patientNote.get('authoredBy'), 'Test Person on behalf of Test Organization');
  });
});
define('hospitalrun/tests/unit/models/patient-note-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/patient-note-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/patient-note-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/patient-test', ['exports', 'ember-qunit', 'ember', 'ember-i18n/helper', 'ember-i18n/config/en'], function (exports, _emberQunit, _ember, _emberI18nHelper, _emberI18nConfigEn) {
  'use strict';

  (0, _emberQunit.moduleForModel)('patient', 'Unit | Model | patient', {
    needs: ['config:environment', 'ember-validations@validator:local/format', 'ember-validations@validator:local/presence', 'locale:en/config', 'locale:en/translations', 'model:allergy', 'model:diagnosis', 'model:operation-report', 'model:operative-plan', 'model:payment', 'model:price-profile', 'service:i18n', 'util:i18n/compile-template', 'util:i18n/missing-message'],
    beforeEach: function beforeEach() {
      // set the locale and the config
      this.container.lookup('service:i18n').set('locale', 'en');
      this.registry.register('locale:en/config', _emberI18nConfigEn['default']);

      _ember['default'].getOwner(this).inject('model', 'i18n', 'service:i18n');

      // register t helper
      this.registry.register('helper:t', _emberI18nHelper['default']);
    }
  });

  (0, _emberQunit.test)('displayAddress', function (assert) {
    var patient = this.subject({
      address: '123 Main St.',
      address2: 'Apt #2',
      address4: 'Test'
    });

    assert.strictEqual(patient.get('displayAddress'), '123 Main St., Apt #2, Test');
  });
});
define('hospitalrun/tests/unit/models/patient-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/patient-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/patient-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/payment-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('payment', 'Unit | Model | payment', {
    needs: ['ember-validations@validator:local/numericality', 'ember-validations@validator:local/presence', 'model:invoice']
  });

  (0, _emberQunit.test)('canRemovePayment', function (assert) {
    var payment = this.subject({
      paymentType: 'Deposit'
    });

    assert.strictEqual(payment.get('canRemovePayment'), true);
  });

  (0, _emberQunit.test)('canRemovePayment false', function (assert) {
    var payment = this.subject({
      paymentType: 'Test'
    });

    assert.strictEqual(payment.get('canRemovePayment'), false);
  });
});
define('hospitalrun/tests/unit/models/payment-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/payment-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/payment-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/proc-charge-test', ['exports', 'ember-qunit', 'ember'], function (exports, _emberQunit, _ember) {
  'use strict';

  (0, _emberQunit.moduleForModel)('proc-charge', 'Unit | Model | proc-charge', {
    needs: ['ember-validations@validator:local/presence', 'ember-validations@validator:local/numericality', 'ember-validations@validator:local/acceptance', 'model:inventory', 'model:inv-purchase', 'model:inv-location', 'model:pricing']
  });

  (0, _emberQunit.test)('medicationCharge', function (assert) {
    var _this = this;

    var medication = _ember['default'].run(function () {
      return _this.store().createRecord('inventory');
    });
    var procCharge = this.subject({
      newMedicationCharge: 11,
      medication: medication
    });

    assert.strictEqual(procCharge.get('medicationCharge'), true);
  });

  (0, _emberQunit.test)('medicationCharge both empty', function (assert) {
    var procCharge = this.subject();

    assert.strictEqual(procCharge.get('medicationCharge'), false);
  });

  (0, _emberQunit.test)('medicationChange empty medication', function (assert) {
    var procCharge = this.subject({
      newMedicationCharge: 12
    });

    assert.strictEqual(procCharge.get('medicationCharge'), true);
  });

  (0, _emberQunit.test)('medicationCharge empty newMedicationCharge', function (assert) {
    var _this2 = this;

    var medication = _ember['default'].run(function () {
      return _this2.store().createRecord('inventory');
    });
    var procCharge = this.subject({ medication: medication });

    assert.strictEqual(procCharge.get('medicationCharge'), true);
  });

  (0, _emberQunit.test)('medicationName', function (assert) {
    var _this3 = this;

    var medication = _ember['default'].run(function () {
      return _this3.store().createRecord('inventory', {
        name: 'Test Item',
        price: 12.5
      });
    });
    var procCharge = this.subject({ medication: medication });

    assert.strictEqual(procCharge.get('medicationName'), 'Test Item');
  });

  (0, _emberQunit.test)('medicationPrice', function (assert) {
    var _this4 = this;

    var medication = _ember['default'].run(function () {
      return _this4.store().createRecord('inventory', {
        name: 'Testing',
        price: 133.59
      });
    });
    var procCharge = this.subject({ medication: medication });

    assert.strictEqual(procCharge.get('medicationPrice'), 133.59);
  });
});
define('hospitalrun/tests/unit/models/proc-charge-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/proc-charge-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/proc-charge-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/user-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('user', 'Unit | Model | user', {
    needs: ['ember-validations@validator:local/format']
  });

  (0, _emberQunit.test)('displayRole', function (assert) {
    var user = this.subject({
      roles: ['first', 'second', 'third']
    });

    assert.strictEqual(user.get('displayRole'), 'first');
  });

  (0, _emberQunit.test)('displayRole no roles', function (assert) {
    var user = this.subject({
      roles: []
    });

    assert.strictEqual(user.get('displayRole'), undefined);
  });
});
define('hospitalrun/tests/unit/models/user-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/user-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/user-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/models/visit-test', ['exports', 'ember', 'ember-qunit'], function (exports, _ember, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleForModel)('visit', 'Unit | Model | visit', {
    // Specify the other units that are required for this test.
    needs: ['ember-validations@validator:local/acceptance', 'ember-validations@validator:local/presence', 'model:diagnosis', 'model:procedure', 'model:imaging', 'model:lab', 'model:medication', 'model:patient', 'model:patient-note', 'model:proc-charge', 'model:vital', 'model:visit', 'model:report', 'service:validations']
  });

  (0, _emberQunit.test)('paymentState', function (assert) {
    var model = this.subject();

    _ember['default'].run(function () {
      model.setProperties({
        paymentState: 'bad value'
      });
    });
    assert.equal(model.get('paymentState'), 'bad value');
    assert.ok(model.errors.paymentState.length, 'there should errors');

    _ember['default'].run(function () {
      model.setProperties({
        paymentState: 'clear'
      });
    });
    assert.equal(model.get('paymentState'), 'clear');
    assert.ok(!model.errors.paymentState.length, 'there should be no error');
  });
});
define('hospitalrun/tests/unit/models/visit-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/models/visit-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/models/visit-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/services/config-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('service:config', 'Unit | Service | config', {
    // Specify the other units that are required for this test.
    // needs: ['service:foo']
  });

  // Replace this with your real tests.
  (0, _emberQunit.test)('it exists', function (assert) {
    var service = this.subject();
    assert.ok(service);
  });
});
define('hospitalrun/tests/unit/services/config-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/services/config-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/services/config-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/services/filesystem-test', ['exports', 'ember-qunit'], function (exports, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('service:filesystem', 'Unit | Service | filesystem', {
    // Specify the other units that are required for this test.
    // needs: ['service:foo']
  });

  // Replace this with your real tests.
  (0, _emberQunit.test)('it exists', function (assert) {
    var service = this.subject();
    assert.ok(service);
  });
});
define('hospitalrun/tests/unit/services/filesystem-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/services/filesystem-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/services/filesystem-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/utils/email-validation-test', ['exports', 'hospitalrun/utils/email-validation', 'ember-qunit'], function (exports, _hospitalrunUtilsEmailValidation, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('util:email-validation', 'Unit | Utils | email-validation');

  (0, _emberQunit.test)('emailRegex', function (assert) {
    assert.notStrictEqual('test@example.com'.match(_hospitalrunUtilsEmailValidation['default'].emailRegex), null, 'Should be valid with standard email');
    assert.notStrictEqual('test.person@example.com'.match(_hospitalrunUtilsEmailValidation['default'].emailRegex), null, 'Should be valid with dot');
    assert.notStrictEqual('test+person@example.com'.match(_hospitalrunUtilsEmailValidation['default'].emailRegex), null, 'Should be valid with plus');
    assert.notStrictEqual('test@example.randomnewtld'.match(_hospitalrunUtilsEmailValidation['default'].emailRegex), null, 'Should be valid with tld');

    assert.strictEqual('test@@example.com'.match(_hospitalrunUtilsEmailValidation['default'].emailRegex), null, 'Should be invalid with two @');
    assert.strictEqual('<Test Person> test.person@example.com'.match(_hospitalrunUtilsEmailValidation['default'].emailRegex), null, 'Should be invalid with name');
  });
});
define('hospitalrun/tests/unit/utils/email-validation-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/utils/email-validation-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/utils/email-validation-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/utils/item-condition-test', ['exports', 'hospitalrun/utils/item-condition', 'ember-qunit'], function (exports, _hospitalrunUtilsItemCondition, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('util:item-condition', 'Unit | Utils | item-condition');

  (0, _emberQunit.test)('rankToMultiplier', function (assert) {
    assert.equal((0, _hospitalrunUtilsItemCondition.rankToMultiplier)('A'), 0.5, 'Should be one half for A rank');
    assert.equal((0, _hospitalrunUtilsItemCondition.rankToMultiplier)('B'), 1, 'Should be one for B rank');
    assert.equal((0, _hospitalrunUtilsItemCondition.rankToMultiplier)('C'), 2, 'Should be two for C rank');
  });

  (0, _emberQunit.test)('getCondition', function (assert) {
    assert.equal((0, _hospitalrunUtilsItemCondition.getCondition)(14), 'good', 'Should be good for 14 days');
    assert.equal((0, _hospitalrunUtilsItemCondition.getCondition)(13), 'average', 'Should be average for 13 days');
    assert.equal((0, _hospitalrunUtilsItemCondition.getCondition)(6), 'bad', 'Should be bad for 6 days');
    assert.equal((0, _hospitalrunUtilsItemCondition.getCondition)(14, 0.5), 'average', 'Shold accept custom multiplier');
  });
});
define('hospitalrun/tests/unit/utils/item-condition-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/utils/item-condition-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/utils/item-condition-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/utils/select-values-test', ['exports', 'hospitalrun/utils/select-values', 'ember-qunit'], function (exports, _hospitalrunUtilsSelectValues, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('util:select-values', 'Unit | Utils | select-values');

  (0, _emberQunit.test)('selectValues', function (assert) {
    assert.deepEqual(_hospitalrunUtilsSelectValues['default'].selectValues(['a', 'b']), [{ id: 'a', value: 'a' }, { id: 'b', value: 'b' }], 'Should add id to values');

    assert.deepEqual(_hospitalrunUtilsSelectValues['default'].selectValues(['a', 'b'], true), [{ id: '', value: '' }, { id: 'a', value: 'a' }, { id: 'b', value: 'b' }], 'Should add empty');

    assert.deepEqual(_hospitalrunUtilsSelectValues['default'].selectValues('test'), undefined, 'Should return undefined if non array');
  });
});
define('hospitalrun/tests/unit/utils/select-values-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/utils/select-values-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/utils/select-values-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/unit/utils/text-expansion-test', ['exports', 'hospitalrun/utils/text-expansion', 'ember-qunit'], function (exports, _hospitalrunUtilsTextExpansion, _emberQunit) {
  'use strict';

  (0, _emberQunit.moduleFor)('util:text-expansion', 'Unit | Utils | text-expansion');

  (0, _emberQunit.test)('findExpansionSubjects', function (assert) {
    assert.deepEqual(_hospitalrunUtilsTextExpansion['default'].findExpansionSubjects(''), []);
    assert.deepEqual(_hospitalrunUtilsTextExpansion['default'].findExpansionSubjects('#abc'), ['#abc']);
    assert.deepEqual(_hospitalrunUtilsTextExpansion['default'].findExpansionSubjects('#abc #def'), ['#abc', '#def']);
  });

  (0, _emberQunit.test)('findExpansionSites', function (assert) {
    assert.deepEqual(_hospitalrunUtilsTextExpansion['default'].findExpansionSites('abc', []), []);
    assert.deepEqual(_hospitalrunUtilsTextExpansion['default'].findExpansionSites('#abc', ['#abc']), [{ index: 0, match: '#abc', term: 'abc' }]);
    assert.deepEqual(_hospitalrunUtilsTextExpansion['default'].findExpansionSites('#abc #abc', ['#abc']), [{ index: 0, match: '#abc', term: 'abc' }, { index: 5, match: '#abc', term: 'abc' }]);
  });
});
define('hospitalrun/tests/unit/utils/text-expansion-test.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - unit/utils/text-expansion-test.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'unit/utils/text-expansion-test.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/users/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'ember-i18n'], function (exports, _hospitalrunControllersAbstractDeleteController, _emberI18n) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: (0, _emberI18n.translationMacro)('labels.deleteUser'),

    actions: {
      'delete': function _delete() {
        var _this = this;

        var recordToDelete = this.get('model');
        this.get('model').destroyRecord().then(function () {
          _this.send('closeModal', recordToDelete);
        });
      }
    }
  });
});
define('hospitalrun/tests/users/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - users/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'users/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/users/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/user-roles', 'npm:uuid'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsUserRoles, _npmUuid) {
  'use strict';

  var get = _ember['default'].get;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsUserRoles['default'], {
    config: _ember['default'].inject.service(),
    usersController: _ember['default'].inject.controller('users/index'),
    updateCapability: 'add_user',

    users: null,

    actions: {
      update: function update() {
        var _this = this;

        var updateModel = this.get('model');
        var users = this.get('users');

        if (updateModel.get('isNew')) {
          var newData = updateModel.getProperties('password', 'email', 'roles', 'displayName');
          newData.name = newData.email;
          newData.id = 'org.couchdb.user:' + newData.email;
          if (_ember['default'].isEmpty(newData.password)) {
            newData.password = _npmUuid['default'].v4() + _npmUuid['default'].v4();
          }
          updateModel.deleteRecord();
          updateModel = this.get('store').createRecord('user', newData);
          this.set('model', updateModel);
        }

        if (_ember['default'].isEmpty(updateModel.get('userPrefix'))) {
          var counter = 1;
          var prefix = 'p';
          var userPrefix = prefix + 0;
          var usedPrefix = users.findBy('userPrefix', prefix);

          while (!_ember['default'].isEmpty(usedPrefix)) {
            prefix = userPrefix + counter++;
            usedPrefix = users.findBy('userPrefix', prefix);
          }
          updateModel.set('userPrefix', prefix);
        }
        updateModel.save().then(function () {
          _this.displayAlert(get(_this, 'i18n').t('messages.userSaved'), get(_this, 'i18n').t('messages.userHasBeenSaved'));
          var editTitle = get(_this, 'i18n').t('labels.editUser');
          var sectionDetails = {};
          sectionDetails.currentScreenTitle = editTitle;
          _this.send('setSectionHeader', sectionDetails);
          get(_this, 'config').markUserSetupComplete();
        })['catch'](function (error) {
          _this._handleError(error);
        });
      }
    }
  });
});
define('hospitalrun/tests/users/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - users/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'users/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/users/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'ember', 'ember-i18n'], function (exports, _hospitalrunRoutesAbstractEditRoute, _ember, _emberI18n) {
  'use strict';

  var set = _ember['default'].set;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend({
    editTitle: (0, _emberI18n.translationMacro)('labels.editUser'),
    modelName: 'user',
    newTitle: (0, _emberI18n.translationMacro)('labels.newUser'),

    getNewData: function getNewData() {
      return _ember['default'].RSVP.resolve({
        roles: ['Data Entry', 'user']
      });
    },

    setupController: function setupController(controller, model) {
      var _this = this;

      this._super(controller, model);
      this.store.findAll('user').then(function (users) {
        set(controller, 'users', users);
      })['catch'](function (err) {
        return _this.send('error', err);
      });
    }
  });
});
define('hospitalrun/tests/users/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - users/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'users/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/users/index/controller', ['exports', 'hospitalrun/controllers/abstract-paged-controller', 'hospitalrun/mixins/user-session'], function (exports, _hospitalrunControllersAbstractPagedController, _hospitalrunMixinsUserSession) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractPagedController['default'].extend(_hospitalrunMixinsUserSession['default'], {
    addPermission: 'add_user',
    deletePermission: 'delete_user',
    sortProperties: ['displayName']
  });
});
define('hospitalrun/tests/users/index/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - users/index/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'users/index/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/users/index/route', ['exports', 'hospitalrun/routes/abstract-index-route', 'hospitalrun/mixins/user-session', 'ember-i18n', 'ember'], function (exports, _hospitalrunRoutesAbstractIndexRoute, _hospitalrunMixinsUserSession, _emberI18n, _ember) {
  'use strict';

  var inject = _ember['default'].inject;
  exports['default'] = _hospitalrunRoutesAbstractIndexRoute['default'].extend(_hospitalrunMixinsUserSession['default'], {
    config: inject.service(),
    newButtonAction: (function () {
      if (this.currentUserCan('add_user')) {
        return 'newItem';
      } else {
        return null;
      }
    }).property(),
    newButtonText: (0, _emberI18n.translationMacro)('user.plusNewUser'),
    pageTitle: (0, _emberI18n.translationMacro)('user.usersPageTile'),
    model: function model() {
      return this.store.findAll('user');
    }
  });
});
define('hospitalrun/tests/users/index/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - users/index/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'users/index/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/users/route', ['exports', 'ember-simple-auth/mixins/authenticated-route-mixin', 'ember'], function (exports, _emberSimpleAuthMixinsAuthenticatedRouteMixin, _ember) {
  'use strict';

  exports['default'] = _ember['default'].Route.extend(_emberSimpleAuthMixinsAuthenticatedRouteMixin['default'], {
    actions: {
      allItems: function allItems() {
        this.transitionTo('users.index');
      }
    }
  });
});
define('hospitalrun/tests/users/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - users/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'users/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/date-sort', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = {
    sortByDate: function sortByDate(firstItem, secondItem, compareAttribute) {
      var firstDate = firstItem.get(compareAttribute);
      var secondDate = secondItem.get(compareAttribute);
      return _ember['default'].compare(firstDate.getTime(), secondDate.getTime());
    }
  };
});
define('hospitalrun/tests/utils/date-sort.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/date-sort.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/date-sort.js should pass ESLint.\n');
  });
});
define("hospitalrun/tests/utils/email-validation", ["exports"], function (exports) {
  "use strict";

  exports["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/tests/utils/email-validation.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/email-validation.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/email-validation.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/item-condition', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports.rankToMultiplier = rankToMultiplier;
  exports.getCondition = getCondition;

  var rankMultiplierValues = [{
    rank: 'A',
    value: 0.5
  }, {
    rank: 'B',
    value: 1
  }, {
    rank: 'C',
    value: 2
  }];

  function rankToMultiplier() {
    var rank = arguments.length <= 0 || arguments[0] === undefined ? 'B' : arguments[0];

    var rankModel = _ember['default'].A(rankMultiplierValues).findBy('rank', rank);
    return rankModel.value;
  }

  function getCondition(estimatedDaysOfStock) {
    var multiplier = arguments.length <= 1 || arguments[1] === undefined ? 1 : arguments[1];

    estimatedDaysOfStock *= multiplier;

    if (estimatedDaysOfStock >= 14) {
      return 'good';
    } else if (estimatedDaysOfStock < 7) {
      return 'bad';
    } else {
      return 'average';
    }
  }
});
define('hospitalrun/tests/utils/item-condition.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/item-condition.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/item-condition.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/patient-validation', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  exports['default'] = {
    patientTypeAhead: {
      acceptance: {
        accept: true,
        'if': function _if(object) {
          if (!object.get('selectPatient')) {
            return false;
          }
          if (!object.get('hasDirtyAttributes')) {
            return false;
          }
          var patientName = object.get('patient.displayName');
          var patientTypeAhead = object.get('patientTypeAhead');
          if (_ember['default'].isEmpty(patientName) || _ember['default'].isEmpty(patientTypeAhead)) {
            // force validation to fail
            return true;
          } else {
            var typeAheadName = patientTypeAhead.substr(0, patientName.length).toLowerCase();
            if (patientName.toLowerCase().indexOf(typeAheadName) !== 0) {
              return true;
            }
          }
          // patient is properly selected; don't do any further validation
          return false;
        },
        message: 'Please select a patient'
      }
    }
  };
});
define('hospitalrun/tests/utils/patient-validation.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/patient-validation.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/patient-validation.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/pouch-views', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  /* global req */
  /* global compareStrings */
  /* global getCompareDate */

  function buildIndex(indexName, db) {
    return db.query(indexName, {
      limit: 0
    })['catch'](function (err) {
      console.log('index error: ' + JSON.stringify(err, null, 2));
    });
  }

  function createDesignDoc(item, rev) {
    var ddoc = {
      _id: '_design/' + item.name,
      version: item.version,
      views: {}
    };
    if (rev) {
      ddoc._rev = rev;
    }
    ddoc.views[item.name] = { map: item['function'].toString() };
    if (item.sort) {
      ddoc.lists = {
        sort: item.sort
      };
    }
    return ddoc;
  }

  function checkForUpdate(view, db, runningTest, testDumpFile) {
    return db.get('_design/' + view.name).then(function (doc) {
      if (doc.version !== view.version) {
        return updateDesignDoc(view, db, doc._rev, runningTest, testDumpFile);
      } else {
        if (runningTest) {
          // Indexes need to be built when running tests
          return buildIndex(view.name, db);
        } else {
          return _ember['default'].RSVP.resolve();
        }
      }
    }, function () {
      return updateDesignDoc(view, db, null, runningTest, testDumpFile);
    });
  }

  function generateSortFunction(sortFunction, includeCompareDate, filterFunction) {
    var generatedFunction = 'function(head, req) {' + 'function keysEqual(keyA, keyB) {' + 'for (var i= 0; i < keyA.length; i++) {' + 'if (keyA[i] !== keyB[i]) {' + 'return false;' + '}' + '}' + 'return true;' + '}';
    if (includeCompareDate) {
      generatedFunction += 'function getCompareDate(dateString) {' + 'if (!dateString || dateString === "") {' + 'return 0;' + '}' + 'return new Date(dateString).getTime();' + '}';
    }
    generatedFunction += '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);' + '}';
    if (filterFunction) {
      generatedFunction += 'rows = rows.filter(' + filterFunction + ');';
    }
    generatedFunction += 'rows.sort(' + sortFunction + ');' + 'if (req.query.sortDesc) {' + 'rows = rows.reverse();' + '}' + 'if (req.query.sortStartKey) {' + 'var startKey = JSON.parse(req.query.sortStartKey);' + 'for (var i=0; i<rows.length; i++) {' + 'if (keysEqual(startKey, rows[i].key)) {' + 'startingPosition = i;' + 'break;' + '}' + '}' + '}' + 'if (req.query.sortLimit) {' + 'rows = rows.slice(startingPosition, parseInt(req.query.sortLimit)+startingPosition);' + '} else if (startingPosition > 0) {' + 'rows = rows.slice(startingPosition);' + '}' + 'send(JSON.stringify({"rows" : rows}));' + '}';
    return generatedFunction;
  }

  function generateView(viewDocType, viewBody) {
    return 'function(doc) {\n    var doctype, uidx;\n    if (doc._id && (uidx = doc._id.indexOf(\'_\')) > 0 && !doc.data.archived) {\n      doctype = doc._id.substring(0, uidx);\n      if (doctype === \'' + viewDocType + '\') {\n        ' + viewBody + '\n      }\n    }\n  }';
  }

  function updateDesignDoc(item, db, rev, runningTest, testDumpFile) {
    var designDoc = createDesignDoc(item, rev);
    if (runningTest) {
      console.log('WARNING: The view ' + item.name + ' is out of date. Please update the pouch dump ' + testDumpFile + ' to the latest version of ' + item.name);
    }
    return db.put(designDoc).then(function () {
      // Update index
      return buildIndex(item.name, db);
    }, function (err) {
      console.log('ERR updating design doc:', JSON.stringify(err, null, 2));
      // ignored, design doc already exists
    });
  }

  function generateDateForView(date1) {
    return 'var ' + date1 + ' = doc.data.' + date1 + ';\n    if (' + date1 + ' && ' + date1 + ' !== "") {\n      ' + date1 + ' = new Date(' + date1 + ');\n      if (' + date1 + '.getTime) {\n        ' + date1 + ' = ' + date1 + '.getTime();\n      }\n    }';
  }

  var appointmentSearch = generateSortFunction((function (a, b) {
    function defaultStatus(value) {
      if (!value || value === '') {
        return 'Scheduled';
      } else {
        return value;
      }
    }
    var sortBy = '';
    if (req.query && req.query.sortKey) {
      sortBy = req.query.sortKey;
    }
    switch (sortBy) {
      case 'appointmentType':
      case 'location':
      case 'provider':
        return compareStrings(a.doc.data[sortBy], b.doc.data[sortBy]);
      case 'date':
        {
          var startDiff = getCompareDate(a.doc.data.startDate) - getCompareDate(b.doc.data.startDate);
          if (startDiff === 0) {
            return getCompareDate(a.doc.data.endDate) - getCompareDate(b.doc.data.endDate);
          } else {
            return startDiff;
          }
        }
      case 'status':
        {
          var aStatus = defaultStatus(a.doc.data[sortBy]);
          var bStatus = defaultStatus(b.doc.data[sortBy]);
          return compareStrings(aStatus, bStatus);
        }
      default:
        {
          return 0; // Don't sort
        }
    }
  }).toString(), true, (function (row) {
    var filterBy = null;
    var includeRow = true;
    if (req.query && req.query.filterBy) {
      filterBy = JSON.parse(req.query.filterBy);
    }
    if (!filterBy) {
      return true;
    }
    for (var i = 0; i < filterBy.length; i++) {
      var currentValue = row.doc.data[filterBy[i].name];
      if (filterBy[i].name === 'status' && (!currentValue || currentValue === '')) {
        currentValue = 'Scheduled';
      }
      if (currentValue !== filterBy[i].value) {
        includeRow = false;
        break;
      }
    }
    return includeRow;
  }).toString());

  var patientListingKey = 'if (doc.data.friendlyId) {\n    emit([doc.data.friendlyId, doc._id]);\n  } else if (doc.data.externalPatientId) {\n    emit([doc.data.externalPatientId, doc._id]);\n  } else {\n    emit([doc._id, doc._id]);\n }';

  var patientListingSearch = generateSortFunction((function (a, b) {
    var sortBy = '';
    if (req.query && req.query.sortKey) {
      sortBy = req.query.sortKey;
    }
    switch (sortBy) {
      case 'firstName':
      case 'sex':
      case 'lastName':
      case 'status':
        {
          return compareStrings(a.doc.data[sortBy], b.doc.data[sortBy]);
        }
      case 'dateOfBirth':
        {
          return getCompareDate(a.doc.data.dateOfBirth) - getCompareDate(b.doc.data.dateOfBirth);
        }
      default:
        {
          return 0; // Don't sort
        }
    }
  }).toString(), true);

  var designDocs = [{
    name: 'appointments_by_date',
    'function': generateView('appointment', generateDateForView('endDate') + '\n    ' + generateDateForView('startDate') + '\n    if (doc.data.appointmentType !== \'Surgery\') {\n      emit([startDate, endDate, doc._id]);\n    }'),
    sort: appointmentSearch,
    version: 7
  }, {
    name: 'appointments_by_patient',
    'function': generateView('appointment', generateDateForView('endDate') + '\n    ' + generateDateForView('startDate') + '\n    emit([doc.data.patient, startDate, endDate,doc._id]);'),
    version: 4
  }, {
    name: 'custom_form_by_type',
    'function': generateView('customForm', 'emit(doc.data.formType);'),
    version: 1
  }, {
    name: 'imaging_by_status',
    'function': generateView('imaging', generateDateForView('imagingDate') + '\n    ' + generateDateForView('requestedDate') + '\n    emit([doc.data.status, requestedDate, imagingDate, doc._id]);'),
    version: 4
  }, {
    name: 'inventory_by_friendly_id',
    'function': generateView('inventory', 'emit([doc.data.friendlyId, doc._id]);'),
    version: 1
  }, {
    name: 'inventory_by_name',
    'function': generateView('inventory', 'emit([doc.data.name, doc._id]);'),
    sort: generateSortFunction((function (a, b) {
      var sortBy = '';
      if (req.query && req.query.sortKey) {
        sortBy = req.query.sortKey;
      }
      switch (sortBy) {
        case 'crossReference':
        case 'description':
        case 'friendlyId':
        case 'name':
        case 'price':
        case 'quantity':
        case 'inventoryType':
          {
            return compareStrings(a.doc.data[sortBy], b.doc.data[sortBy]);
          }
        default:
          {
            return 0; // Don't sort
          }
      }
    }).toString()),
    version: 5
  }, {
    name: 'incident_by_friendly_id',
    'function': generateView('incident', 'emit([doc.data.friendlyId, doc._id]);'),
    version: 1
  }, {
    name: 'incident_by_date',
    'function': generateView('incident', generateDateForView('dateOfIncident') + '\n    emit([dateOfIncident, doc._id]);'),
    version: 1
  }, {
    name: 'open_incidents_by_user',
    'function': generateView('incident', 'if (doc.data.status !== "Closed") {\n      emit([doc.data.reportedBy, doc._id]);\n    }'),
    sort: generateSortFunction((function (a, b) {
      var sortBy = '';
      if (req.query && req.query.sortKey) {
        sortBy = req.query.sortKey;
        return compareStrings(a.doc.data[sortBy], b.doc.data[sortBy]);
      }
      return 0; // Don't sort
    }).toString()),
    version: 1
  }, {
    name: 'closed_incidents_by_user',
    'function': generateView('incident', 'if (doc.data.status === "Closed") {\n      emit([doc.data.reportedBy, doc._id]);\n    }'),
    version: 1
  }, {
    name: 'inventory_by_type',
    'function': generateView('inventory', 'emit(doc.data.inventoryType);'),
    version: 5
  }, {
    name: 'inventory_purchase_by_date_received',
    'function': generateView('invPurchase', generateDateForView('dateReceived') + '\n    emit([dateReceived, doc._id]);'),
    version: 5
  }, {
    name: 'inventory_purchase_by_expiration_date',
    'function': generateView('invPurchase', generateDateForView('expirationDate') + '\n    emit([expirationDate, doc._id]);'),
    version: 5
  }, {
    name: 'inventory_request_by_item',
    'function': generateView('invRequest', generateDateForView('dateCompleted') + '\n    emit([doc.data.inventoryItem, doc.data.status, dateCompleted]);'),
    version: 5
  }, {
    name: 'inventory_request_by_status',
    'function': generateView('invRequest', generateDateForView('dateCompleted') + '\n    emit([doc.data.status, dateCompleted, doc._id]);'),
    version: 5
  }, {
    name: 'invoice_by_patient',
    'function': generateView('invoice', 'emit(doc.data.patient);'),
    version: 1
  }, {
    name: 'invoice_by_status',
    'function': generateView('invoice', generateDateForView('billDate') + '\n    emit([doc.data.status, billDate, doc._id]);'),
    version: 4
  }, {
    name: 'lab_by_status',
    'function': generateView('lab', generateDateForView('labDate') + '\n    ' + generateDateForView('requestedDate') + '\n    emit([doc.data.status, requestedDate, labDate, doc._id]);'),
    version: 4
  }, {
    name: 'medication_by_status',
    'function': generateView('medication', generateDateForView('prescriptionDate') + '\n    ' + generateDateForView('requestedDate') + '\n    emit([doc.data.status, requestedDate, prescriptionDate, doc._id]);'),
    version: 4
  }, {
    name: 'patient_by_display_id',
    'function': generateView('patient', patientListingKey),
    sort: patientListingSearch,
    version: 7
  }, {
    name: 'patient_by_status',
    'function': generateView('patient', 'emit(doc.data.status);'),
    version: 3
  }, {
    name: 'patient_by_admission',
    'function': generateView('patient', 'if (doc.data.admitted === true) {\n      ' + patientListingKey + '\n    }'),
    sort: patientListingSearch,
    version: 4
  }, {
    name: 'photo_by_patient',
    'function': generateView('photo', 'emit(doc.data.patient);'),
    version: 4
  }, {
    name: 'procedure_by_date',
    'function': generateView('procedure', generateDateForView('procedureDate') + '\n    emit([procedureDate, doc._id]);'),
    version: 4
  }, {
    name: 'pricing_by_category',
    'function': generateView('pricing', 'emit([doc.data.category, doc.data.name, doc.data.pricingType, doc._id]);'),
    version: 5
  }, {
    name: 'sequence_by_prefix',
    'function': generateView('sequence', 'emit(doc.data.prefix);'),
    version: 4
  }, {
    name: 'surgical_appointments_by_date',
    'function': generateView('appointment', generateDateForView('endDate') + '\n    ' + generateDateForView('startDate') + '\n    if (doc.data.appointmentType === \'Surgery\') {\n      emit([startDate, endDate, doc._id]);\n    }'),
    sort: appointmentSearch,
    version: 1
  }, {
    name: 'visit_by_date',
    'function': generateView('visit', generateDateForView('endDate') + '\n    ' + generateDateForView('startDate') + '\n    emit([startDate, endDate, doc._id]);'),
    version: 4
  }, {
    name: 'visit_by_discharge_date',
    'function': generateView('visit', generateDateForView('endDate') + '\n    emit([endDate, doc._id]);'),
    version: 2
  }, {
    name: 'visit_by_patient',
    'function': generateView('visit', generateDateForView('endDate') + '\n    ' + generateDateForView('startDate') + '\n    emit([doc.data.patient, startDate, endDate, doc.data.visitType, doc._id]);'),
    version: 4
  }, {
    name: 'report_by_visit',
    'function': generateView('report', 'emit(doc.data.visit);'),
    version: 1
  }];

  exports['default'] = function (db, runningTest, testDumpFile) {
    var viewUpdates = [];
    designDocs.forEach(function (item) {
      viewUpdates.push(checkForUpdate(item, db, runningTest, testDumpFile));
    });
    return _ember['default'].RSVP.all(viewUpdates);
  };
});
define('hospitalrun/tests/utils/pouch-views.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/pouch-views.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/pouch-views.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/select-values', ['exports', 'ember'], function (exports, _ember) {
  'use strict';

  function selectValuesMap(value) {
    return {
      id: value,
      value: value
    };
  }

  exports['default'] = {
    /**
     * Map an objects into a format so that selects can use object as value for select
     * @param {object} object the object to map
     * @returns {object} the mapped object
     */
    selectObjectMap: function selectObjectMap(selectValue) {
      return _ember['default'].Object.create({
        selectObject: selectValue
      });
    },

    selectValuesMap: selectValuesMap,

    /** Map an array of strings to objects with id and value set to the string values
     * so that the array can be used for em-select
     * @param {Array} array to map.
     * @param {boolean} includeEmpty if there should be an empty item added to the select list
     */
    selectValues: function selectValues(array, includeEmpty) {
      if (_ember['default'].isArray(array)) {
        var arrayToMap = new Array(array);
        if (includeEmpty) {
          arrayToMap = [''];
          arrayToMap.addObjects(array);
        } else {
          arrayToMap = array;
        }
        return arrayToMap.map(selectValuesMap);
      }
    }
  };
});
define('hospitalrun/tests/utils/select-values.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/select-values.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/select-values.js should pass ESLint.\n');
  });
});
define("hospitalrun/tests/utils/text-expansion", ["exports"], function (exports) {
  "use strict";

  exports["default"] = {
    // Find words with expansion prefix
    // '#abc abc #cd' -> ['#abc', '#cd']
    findExpansionSubjects: function findExpansionSubjects(text) {
      var search = /(^|\s+)(#\S+)/g;
      var match = true;

      var subjects = [];
      while (match != null) {

        match = search.exec(text);
        if (match && match.length > 2) {
          subjects.push(match[2]);
        }
      }

      return subjects.filter(onlyUnique);
    },

    // Find all detected expandable sites by index
    // 'abc #abc cd', ['#abc'] -> [{ index: 4, match: '#abc', term: 'abc'}]
    findExpansionSites: function findExpansionSites(text, subjects) {

      return subjects.map(findAllIndices(text)).reduce(function (a, b) {
        // flatmap
        return a.concat(b);
      }, []);
    }
  };

  function findAllIndices(text) {
    return function (value) {
      var result = [];
      var keepMatching = true;
      var matchPoint = 0;
      while (keepMatching) {
        matchPoint = text.indexOf(value, matchPoint);
        if (matchPoint > -1) {
          result.push({
            index: matchPoint,
            match: value,
            term: value.slice(1)
          });
        } else {
          keepMatching = false;
        }

        matchPoint += 1;
      }

      return result;
    };
  }

  function onlyUnique(value, index, self) {
    return self.indexOf(value) === index;
  }
});
define('hospitalrun/tests/utils/text-expansion.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/text-expansion.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/text-expansion.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/unauthorized-error', ['exports', 'ember-data'], function (exports, _emberData) {
  'use strict';

  var AdapterError = _emberData['default'].AdapterError;

  var UnauthorizedError = function UnauthorizedError(errors) {
    var message = arguments.length <= 1 || arguments[1] === undefined ? 'The adapter operation is unauthorized' : arguments[1];

    AdapterError.call(this, errors, message);
  };

  UnauthorizedError.prototype = Object.create(AdapterError.prototype);

  exports['default'] = UnauthorizedError;
});
define('hospitalrun/tests/utils/unauthorized-error.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/unauthorized-error.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/unauthorized-error.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/utils/visit-statuses', ['exports'], function (exports) {
  'use strict';

  var ADMITTED = 'Admitted';
  exports.ADMITTED = ADMITTED;
  var DISCHARGED = 'Discharged';
  exports.DISCHARGED = DISCHARGED;
  var CHECKED_IN = 'CheckedIn';
  exports.CHECKED_IN = CHECKED_IN;
  var CHECKED_OUT = 'CheckedOut';
  exports.CHECKED_OUT = CHECKED_OUT;
});
define('hospitalrun/tests/utils/visit-statuses.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - utils/visit-statuses.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'utils/visit-statuses.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/charge/controller', ['exports', 'hospitalrun/procedures/charge/controller', 'ember'], function (exports, _hospitalrunProceduresChargeController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunProceduresChargeController['default'].extend({
    cancelAction: 'closeModal',
    newPricingItem: false,
    requestingController: _ember['default'].inject.controller('visits/edit')
  });
});
define('hospitalrun/tests/visits/charge/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/charge/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/charge/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller'], function (exports, _hospitalrunControllersAbstractDeleteController) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    title: 'Delete Visit',

    afterDeleteAction: (function () {
      var deleteFromPatient = this.get('model.deleteFromPatient');
      if (deleteFromPatient) {
        return 'visitDeleted';
      } else {
        return 'closeModal';
      }
    }).property('model.deleteFromPatient')
  });
});
define('hospitalrun/tests/visits/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'hospitalrun/mixins/add-new-patient', 'hospitalrun/mixins/allergy-actions', 'hospitalrun/mixins/charge-actions', 'hospitalrun/mixins/diagnosis-actions', 'ember', 'moment', 'hospitalrun/mixins/patient-notes', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/mixins/user-session', 'hospitalrun/utils/visit-statuses', 'hospitalrun/mixins/visit-types'], function (exports, _hospitalrunControllersAbstractEditController, _hospitalrunMixinsAddNewPatient, _hospitalrunMixinsAllergyActions, _hospitalrunMixinsChargeActions, _hospitalrunMixinsDiagnosisActions, _ember, _moment, _hospitalrunMixinsPatientNotes, _hospitalrunMixinsPatientSubmodule, _hospitalrunMixinsUserSession, _hospitalrunUtilsVisitStatuses, _hospitalrunMixinsVisitTypes) {
  'use strict';

  var computed = _ember['default'].computed;
  var get = _ember['default'].get;
  var isEmpty = _ember['default'].isEmpty;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsAddNewPatient['default'], _hospitalrunMixinsAllergyActions['default'], _hospitalrunMixinsChargeActions['default'], _hospitalrunMixinsDiagnosisActions['default'], _hospitalrunMixinsPatientSubmodule['default'], _hospitalrunMixinsPatientNotes['default'], _hospitalrunMixinsUserSession['default'], _hospitalrunMixinsVisitTypes['default'], {
    visitsController: _ember['default'].inject.controller('visits'),
    additionalButtons: computed('model.status', function () {
      var buttonProps = {
        buttonIcon: 'glyphicon glyphicon-log-out',
        'class': 'btn btn-primary on-white'
      };
      var i18n = this.get('i18n');
      var status = this.get('model.status');
      if (status === _hospitalrunUtilsVisitStatuses['default'].ADMITTED) {
        buttonProps.buttonAction = 'discharge';
        buttonProps.buttonText = i18n.t('visits.buttons.discharge');
        return [buttonProps];
      } else if (status === _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN) {
        buttonProps.buttonAction = 'checkout';
        buttonProps.buttonText = i18n.t('visits.buttons.checkOut');
        return [buttonProps];
      }
    }),

    noReport: false,

    canAddAppointment: computed('model.isNew', function () {
      return !this.get('model.isNew') && this.currentUserCan('add_appointment');
    }),

    canAddBillingDiagnosis: computed('model.isNew', function () {
      return !this.get('model.isNew') && this.currentUserCan('add_billing_diagnosis');
    }),

    canAddImaging: (function () {
      return this.currentUserCan('add_imaging');
    }).property(),

    canAddLab: (function () {
      return this.currentUserCan('add_lab');
    }).property(),

    canAddMedication: (function () {
      return this.currentUserCan('add_medication');
    }).property(),

    canAddProcedure: (function () {
      return this.currentUserCan('add_procedure');
    }).property(),

    canAddVitals: (function () {
      return this.currentUserCan('add_vitals');
    }).property(),

    canAddReport: computed('hasReport', function () {
      return this.currentUserCan('add_report') && !this.get('hasReport');
    }),

    canDeleteImaging: (function () {
      return this.currentUserCan('delete_imaging');
    }).property(),

    canDeleteLab: (function () {
      return this.currentUserCan('delete_lab');
    }).property(),

    canDeleteMedication: (function () {
      return this.currentUserCan('delete_medication');
    }).property(),

    canDeleteProcedure: (function () {
      return this.currentUserCan('delete_procedure');
    }).property(),

    canDeleteVitals: (function () {
      return this.currentUserCan('delete_vitals');
    }).property(),

    canDeleteReport: (function () {
      return this.currentUserCan('delete_report');
    }).property(),

    isAdmissionVisit: (function () {
      var visitType = this.get('model.visitType');
      var isAdmission = visitType === 'Admission';
      return isAdmission;
    }).property('model.visitType'),

    cancelAction: (function () {
      var returnTo = this.get('model.returnTo');
      if (!isEmpty(returnTo)) {
        return 'returnTo';
      } else if (!isEmpty(this.get('model.returnToPatient'))) {
        return 'returnToPatient';
      } else {
        return this._super();
      }
    }).property('model.returnTo', 'model.returnToPatient'),

    allowAddAllergy: computed.not('model.isNew'),
    allowAddDiagnosis: computed.not('model.isNew'),
    allowAddOperativePlan: computed.not('model.isNew'),
    chargePricingCategory: 'Ward',
    chargeRoute: 'visits.charge',
    diagnosisList: _ember['default'].computed.alias('visitsController.diagnosisList'),
    findPatientVisits: false,
    hideChargeHeader: true,
    patientImaging: _ember['default'].computed.alias('model.imaging'),
    patientLabs: _ember['default'].computed.alias('model.labs'),
    patientMedications: _ember['default'].computed.alias('model.medication'),
    pricingList: null, // This gets filled in by the route
    pricingTypes: _ember['default'].computed.alias('visitsController.wardPricingTypes'),
    physicianList: _ember['default'].computed.alias('visitsController.physicianList'),
    locationList: _ember['default'].computed.alias('visitsController.locationList'),
    sexList: computed.alias('visitsController.sexList'),
    visitTypesList: _ember['default'].computed.alias('visitsController.visitTypesList'),
    lookupListsToUpdate: [{
      name: 'physicianList',
      property: 'model.examiner',
      id: 'physician_list'
    }, {
      name: 'locationList',
      property: 'model.location',
      id: 'visit_location_list'
    }],

    updateCapability: 'add_visit',

    showPatientSelection: computed('model.checkIn', 'model.hidePatientSelection', function () {
      return this.get('model.checkIn') && !this.get('model.hidePatientSelection');
    }),

    updateButtonIcon: computed('model.checkIn', function () {
      if (this.get('model.checkIn')) {
        return 'glyphicon glyphicon-log-in';
      }
    }),

    updateButtonText: computed('model.{checkIn,isNew}', function () {
      var i18n = this.get('i18n');
      if (this.get('model.checkIn')) {
        return i18n.t('visits.buttons.checkIn');
      } else {
        return this._super();
      }
    }),

    validVisitTypes: (function () {
      var outPatient = this.get('model.outPatient');
      var visitTypes = this.get('visitTypes');
      if (outPatient === true) {
        visitTypes = visitTypes.filter(function (visitType) {
          return visitType.id !== 'Admission';
        });
      }
      return visitTypes;
    }).property('visitTypes', 'model.outPatient'),

    _addChildObject: function _addChildObject(route, afterTransition) {
      var options = {
        queryParams: {
          forVisitId: this.get('model.id')
        }
      };
      this.transitionToRoute(route, 'new', options).then(function (newRoute) {
        if (afterTransition) {
          afterTransition(newRoute);
        }
      });
    },

    _finishAfterUpdate: function _finishAfterUpdate() {
      var addedNewPatient = this.get('addedNewPatient');
      var checkIn = this.get('model.checkIn');
      var i18n = this.get('i18n');
      var updateMesage = i18n.t('visits.messages.visitSaved');
      var updateTitle = i18n.t('visits.titles.visitSaved');
      if (checkIn === true) {
        var model = this.get('model');
        model.set('checkIn');
        this.send('setSectionHeader', {
          currentScreenTitle: i18n.t('visits.titles.editVisit')
        });
      }

      if (checkIn) {
        updateTitle = i18n.t('visits.titles.checkedIn');
        var patientDetails = {
          patientName: this.get('model.patient.displayName')
        };
        if (addedNewPatient === true) {
          this.set('addedNewPatient');
          updateMesage = i18n.t('visits.messages.patientCreatedAndCheckedIn', patientDetails);
        } else {
          updateMesage = i18n.t('visits.messages.patientCheckedIn', patientDetails);
        }
      }
      this.displayAlert(updateTitle, updateMesage);
    },

    _findAssociatedAppointment: function _findAssociatedAppointment(newVisit) {
      var appointment = newVisit.get('appointment');
      var beginningOfToday = (0, _moment['default'])().startOf('day').valueOf();
      var database = this.get('database');
      var endOfToday = (0, _moment['default'])().endOf('day').valueOf();
      var maxId = database.getMaxPouchId('appointment');
      var minId = database.getMinPouchId('appointment');
      var patientId = newVisit.get('patient.id');
      if (!isEmpty(appointment)) {
        return _ember['default'].RSVP.resolve(appointment);
      } else {
        return this.store.query('appointment', {
          options: {
            startkey: [patientId, beginningOfToday, beginningOfToday, minId],
            endkey: [patientId, endOfToday, endOfToday, maxId]
          },
          mapReduce: 'appointments_by_patient'
        }).then(function (appointments) {
          if (isEmpty(appointments)) {
            return;
          } else {
            return appointments.get('firstObject');
          }
        });
      }
    },

    _saveAssociatedAppointment: function _saveAssociatedAppointment(newVisit) {
      return this._findAssociatedAppointment(newVisit).then(function (appointment) {
        if (isEmpty(appointment)) {
          newVisit.set('hasAppointment', false);
          return _ember['default'].RSVP.resolve();
        } else {
          newVisit.set('hasAppointment', true);
          appointment.set('status', 'Attended');
          return appointment.save();
        }
      });
    },

    haveAdditionalDiagnoses: (function () {
      return !isEmpty(this.get('model.additionalDiagnoses'));
    }).property('model.additionalDiagnoses.[]'),

    afterUpdate: function afterUpdate(visit) {
      this.updatePatientVisitFlags(visit).then(this._finishAfterUpdate.bind(this));
    },

    beforeUpdate: function beforeUpdate() {
      var _this = this;

      var isNew = this.get('model.isNew');
      if (isNew) {
        return new _ember['default'].RSVP.Promise(function (resolve, reject) {
          var newVisit = _this.get('model');
          return newVisit.validate().then(function () {
            if (newVisit.get('isValid')) {
              var patient = newVisit.get('patient');
              if (isEmpty(patient)) {
                _this.addNewPatient();
                return reject({
                  ignore: true,
                  message: 'creating new patient first'
                });
              }
              var outPatient = false;
              var visitType = newVisit.get('visitType');
              var visitStatus = undefined;
              if (visitType === 'Admission') {
                visitStatus = _hospitalrunUtilsVisitStatuses['default'].ADMITTED;
              } else {
                outPatient = true;
                visitStatus = _hospitalrunUtilsVisitStatuses['default'].CHECKED_IN;
              }
              newVisit.setProperties({
                outPatient: outPatient,
                status: visitStatus
              });
              if (_this.get('model.checkIn')) {
                _this._saveAssociatedAppointment(newVisit).then(function () {
                  _this.saveNewDiagnoses().then(resolve, reject);
                });
              } else {
                _this.saveNewDiagnoses().then(resolve, reject);
              }
            }
          });
        });
      } else {
        return this.updateCharges();
      }
    },

    checkoutPatient: function checkoutPatient(status) {
      var visit = this.get('model');
      this.checkoutVisit(visit, status);
    },

    patientSelected: function patientSelected(patient) {
      if (isEmpty(patient)) {
        set(this, 'model.createNewPatient', true);
      } else {
        set(this, 'model.createNewPatient', false);
        this.getPatientDiagnoses(patient, get(this, 'model'));
      }
    },

    /**
     * Adds or removes the specified object from the specified list.
     * @param {String} listName The name of the list to operate on.
     * @param {Object} listObject The object to add or removed from the
     * specified list.
     * @param {boolean} removeObject If true remove the object from the list;
     * otherwise add the specified object to the list.
     */
    updateList: function updateList(listName, listObject, removeObject) {
      var model = this.get('model');
      model.get(listName).then((function (list) {
        if (removeObject) {
          list.removeObject(listObject);
        } else {
          list.addObject(listObject);
        }
        this.send('update', true);
        this.send('closeModal');
      }).bind(this));
    },

    actions: {
      addAllergy: function addAllergy(newAllergy) {
        var patient = get(this, 'model.patient');
        this.savePatientAllergy(patient, newAllergy);
      },

      addDiagnosis: function addDiagnosis(newDiagnosis) {
        this.addDiagnosisToModelAndPatient(newDiagnosis);
      },

      addVitals: function addVitals(newVitals) {
        this.updateList('vitals', newVitals);
      },

      cancel: function cancel() {
        var cancelledItem = this.get('model');
        if (this.get('model.isNew')) {
          cancelledItem.deleteRecord();
        } else {
          cancelledItem.rollbackAttributes();
        }
        this.send(this.get('cancelAction'));
      },

      checkout: function checkout() {
        this.checkoutPatient(_hospitalrunUtilsVisitStatuses['default'].CHECKED_OUT);
      },

      deleteAllergy: function deleteAllergy(allergy) {
        var patient = get(this, 'model.patient');
        this.deletePatientAllergy(patient, allergy);
      },

      deleteProcedure: function deleteProcedure(procedure) {
        this.updateList('procedures', procedure, true);
      },

      deleteVitals: function deleteVitals(vitals) {
        this.updateList('vitals', vitals, true);
      },

      discharge: function discharge() {
        this.checkoutPatient(_hospitalrunUtilsVisitStatuses['default'].DISCHARGED);
      },

      editImaging: function editImaging(imaging) {
        if (imaging.get('canEdit')) {
          imaging.setProperties('returnToVisit', this.get('model.id'));
        }
        this.transitionToRoute('imaging.edit', imaging);
      },

      editLab: function editLab(lab) {
        if (lab.get('canEdit')) {
          lab.setProperties('returnToVisit', this.get('model.id'));
          this.transitionToRoute('labs.edit', lab);
        }
      },

      editMedication: function editMedication(medication) {
        if (medication.get('canEdit')) {
          medication.set('returnToVisit', this.get('model.id'));
          this.transitionToRoute('medication.edit', medication);
        }
      },

      editOperativePlan: function editOperativePlan(operativePlan) {
        var _this2 = this;

        var model = operativePlan;
        if (isEmpty(model)) {
          this._addChildObject('patients.operative-plan', function (route) {
            route.controller.getPatientDiagnoses(_this2.get('model.patient'), route.currentModel);
          });
        } else {
          model.set('returnToVisit', this.get('model.id'));
          this.transitionToRoute('patients.operative-plan', model);
        }
      },

      newPatientChanged: function newPatientChanged(createNewPatient) {
        set(this, 'model.createNewPatient', createNewPatient);
        var model = this.get('model');
        var patient = model.get('patient');
        if (createNewPatient && !isEmpty(patient)) {
          model.set('patientTypeAhead', patient.get('displayName'));
          model.set('patient');
        }
      },

      showAddVitals: function showAddVitals() {
        var newVitals = this.get('store').createRecord('vital', {
          dateRecorded: new Date()
        });
        this.send('openModal', 'visits.vitals.edit', newVitals);
      },

      showAddPatientNote: function showAddPatientNote(model) {
        if (isEmpty(model)) {
          model = this.get('store').createRecord('patient-note', {
            visit: this.get('model'),
            createdBy: this.getUserName(),
            patient: this.get('model').get('patient'),
            noteType: this._computeNoteType(this.get('model'))
          });
        }
        this.send('openModal', 'patients.notes', model);
      },

      newAppointment: function newAppointment() {
        this._addChildObject('appointments.edit');
      },

      newImaging: function newImaging() {
        this._addChildObject('imaging.edit');
      },

      newLab: function newLab() {
        this._addChildObject('labs.edit');
      },

      newMedication: function newMedication() {
        this._addChildObject('medication.edit');
      },

      newReport: function newReport() {
        this._addChildObject('visits.reports.edit');
      },

      showAddProcedure: function showAddProcedure() {
        this._addChildObject('procedures.edit');
      },

      showDeleteImaging: function showDeleteImaging(imaging) {
        this.send('openModal', 'imaging.delete', imaging);
      },

      showDeleteLab: function showDeleteLab(lab) {
        this.send('openModal', 'labs.delete', lab);
      },

      showDeleteMedication: function showDeleteMedication(medication) {
        this.send('openModal', 'medication.delete', medication);
      },

      showDeleteProcedure: function showDeleteProcedure(procedure) {
        this.send('openModal', 'visits.procedures.delete', procedure);
      },

      showDeleteVitals: function showDeleteVitals(vitals) {
        this.send('openModal', 'visits.vitals.delete', vitals);
      },

      showEditProcedure: function showEditProcedure(procedure) {
        if (isEmpty(procedure.get('visit'))) {
          procedure.set('visit', this.get('model'));
        }
        procedure.set('returnToVisit', this.get('model.id'));
        procedure.set('returnToPatient');
        this.transitionToRoute('procedures.edit', procedure);
      },

      showEditVitals: function showEditVitals(vitals) {
        this.send('openModal', 'visits.vitals.edit', vitals);
      },

      showDeletePatientNote: function showDeletePatientNote(note) {
        this.send('openModal', 'dialog', _ember['default'].Object.create({
          confirmAction: 'deletePatientNote',
          title: 'Delete Note',
          message: 'Are you sure you want to delete this note?',
          noteToDelete: note,
          updateButtonAction: 'confirm',
          updateButtonText: this.get('i18n').t('buttons.ok')
        }));
      },

      deletePatientNote: function deletePatientNote(model) {
        var note = model.get('noteToDelete');
        var patientNotes = this.get('model.patientNotes');
        patientNotes.removeObject(note);
        this.send('update', true);
      },

      startDateChanged: function startDateChanged(startDate) {
        var isAdmissionVisit = this.get('isAdmissionVisit');
        var visit = this.get('model');
        if (!isAdmissionVisit) {
          visit.set('endDate', startDate);
        }
      },

      printReport: function printReport(report) {
        set(report, 'returnToVisit', get(this, 'model.id'));
        this.transitionToRoute('visits.reports.edit', report, { queryParams: { print: true } });
      },

      viewReport: function viewReport(report) {
        set(report, 'returnToVisit', get(this, 'model.id'));
        this.transitionToRoute('visits.reports.edit', report, { queryParams: { print: null } });
      }

    }
  });
});
define('hospitalrun/tests/visits/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/edit/route', ['exports', 'ember-i18n', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/charge-route', 'ember', 'hospitalrun/mixins/patient-list-route', 'hospitalrun/mixins/patient-visits', 'ember-data'], function (exports, _emberI18n, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsChargeRoute, _ember, _hospitalrunMixinsPatientListRoute, _hospitalrunMixinsPatientVisits, _emberData) {
  'use strict';

  var get = _ember['default'].get;
  var set = _ember['default'].set;
  var isEmpty = _ember['default'].isEmpty;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsChargeRoute['default'], _hospitalrunMixinsPatientListRoute['default'], _hospitalrunMixinsPatientVisits['default'], {
    customForms: _ember['default'].inject.service(),
    editTitle: (0, _emberI18n.translationMacro)('visits.titles.editVisit'),
    modelName: 'visit',
    newTitle: (0, _emberI18n.translationMacro)('visits.titles.newVisit'),
    pricingCategory: 'Ward',

    model: function model(params) {
      var _this = this;

      var idParam = get(this, 'idParam');
      if (!isEmpty(idParam) && params[idParam] === 'checkin') {
        return this.getNewData().then(function (newData) {
          newData.checkIn = true;
          var newVisit = get(_this, 'store').createRecord('visit', newData);
          return newVisit;
        });
      } else {
        return this._super(params);
      }
    },

    getNewData: function getNewData() {
      var newVisitData = {
        startDate: new Date(),
        visitType: 'Admission',
        customForms: _ember['default'].Object.create()
      };
      var customForms = this.get('customForms');
      return customForms.setDefaultCustomForms(['visit'], newVisitData);
    },

    getScreenTitle: function getScreenTitle(model) {
      if (model.get('checkIn')) {
        return this.get('i18n').t('visits.titles.patientCheckIn');
      } else {
        return this._super(model);
      }
    },

    setupController: function setupController(controller, model) {
      var promise = this.store.query('report', {
        options: {
          key: get(model, 'id')
        },
        mapReduce: 'report_by_visit'
      }).then(function (reports) {
        set(controller, 'noReport', isEmpty(reports));
        return isEmpty(reports) ? '' : get(reports, 'firstObject');
      });
      set(controller, 'report', _emberData['default'].PromiseObject.create({ promise: promise }));
      this._super(controller, model);
    },

    actions: {
      updateNote: function updateNote() {
        this.controller.send('update', true);
      },
      deletePatientNote: function deletePatientNote(model) {
        this.controller.send('deletePatientNote', model);
      }
    }
  });
});
define('hospitalrun/tests/visits/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/procedures/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'ember'], function (exports, _hospitalrunControllersAbstractDeleteController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    afterDeleteAction: 'notifyProcedureDelete',
    editController: _ember['default'].inject.controller('visits/edit'),
    title: 'Delete Procedure',

    actions: {
      notifyProcedureDelete: function notifyProcedureDelete() {
        this.send('closeModal');
        this.get('editController').send('deleteProcedure', this.get('model'));
      }
    }
  });
});
define('hospitalrun/tests/visits/procedures/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/procedures/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/procedures/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/reports/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember', 'hospitalrun/mixins/patient-submodule', 'hospitalrun/mixins/patient-diagnosis', 'hospitalrun/mixins/pouchdb'], function (exports, _hospitalrunControllersAbstractEditController, _ember, _hospitalrunMixinsPatientSubmodule, _hospitalrunMixinsPatientDiagnosis, _hospitalrunMixinsPouchdb) {
  'use strict';

  var get = _ember['default'].get;
  var set = _ember['default'].set;
  var computed = _ember['default'].computed;
  var alias = _ember['default'].computed.alias;
  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend(_hospitalrunMixinsPatientSubmodule['default'], _hospitalrunMixinsPatientDiagnosis['default'], _hospitalrunMixinsPouchdb['default'], {
    queryParams: ['print'],
    print: null,

    visitsController: _ember['default'].inject.controller('visits'),

    physicianList: alias('visitsController.physicianList'),

    logoURL: alias('visitsController.printHeader.value.logoURL'),
    facilityName: alias('visitsController.printHeader.value.facilityName'),
    headerLine1: alias('visitsController.printHeader.value.headerLine1'),
    headerLine2: alias('visitsController.printHeader.value.headerLine2'),
    headerLine3: alias('visitsController.printHeader.value.headerLine3'),

    diagnosisList: alias('visitsController.diagnosisList'),

    additionalButtons: computed('model.isNew', function () {
      var isNew = get(this, 'model.isNew');
      var i18n = get(this, 'i18n');
      if (!isNew) {
        return [{
          'class': 'btn btn-primary on-white',
          buttonAction: 'printReport',
          buttonIcon: 'octicon octicon-check',
          buttonText: i18n.t('labels.print')
        }];
      }
    }),

    updateCapability: 'add_report',

    beforeUpdate: function beforeUpdate() {
      var _this = this;

      return new _ember['default'].RSVP.Promise(function (resolve) {
        var model = get(_this, 'model');
        if (get(model, 'isNew')) {
          if (get(_this, 'model.visit.outPatient')) {
            set(model, 'reportType', 'OPD Report');
          } else {
            set(model, 'reportType', 'Discharge Report');
          }
        }
        resolve();
      });
    },

    afterUpdate: function afterUpdate() {
      var alertTitle = get(this, 'i18n').t('reports.titles.saved');
      var alertMessage = get(this, 'i18n').t('reports.messages.saved');
      this.saveVisitIfNeeded(alertTitle, alertMessage);
      var opdTitle = get(this, 'i18n').t('reports.titles.opdReport');
      var dischargeTitle = get(this, 'i18n').t('reports.titles.dischargeReport');
      var editTitle = get(this, 'model.visit.outPatient') ? opdTitle : dischargeTitle;
      var sectionDetails = {};
      sectionDetails.currentScreenTitle = editTitle;
      this.send('setSectionHeader', sectionDetails);
    },

    actions: {
      printReport: function printReport() {
        window.print();
      }
    }

  });
});
define('hospitalrun/tests/visits/reports/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/reports/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/reports/edit/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/reports/edit/route', ['exports', 'hospitalrun/routes/abstract-edit-route', 'hospitalrun/mixins/add-to-patient-route', 'ember', 'ember-i18n', 'hospitalrun/mixins/patient-visits'], function (exports, _hospitalrunRoutesAbstractEditRoute, _hospitalrunMixinsAddToPatientRoute, _ember, _emberI18n, _hospitalrunMixinsPatientVisits) {
  'use strict';

  var get = _ember['default'].get;
  var set = _ember['default'].set;
  exports['default'] = _hospitalrunRoutesAbstractEditRoute['default'].extend(_hospitalrunMixinsAddToPatientRoute['default'], _hospitalrunMixinsPatientVisits['default'], {
    modelName: 'report',
    customForms: _ember['default'].inject.service(),

    getNewData: function getNewData() {
      var newReportData = {
        reportDate: new Date(),
        customForms: _ember['default'].Object.create()
      };
      var customForms = get(this, 'customForms');
      return customForms.setDefaultCustomForms(['opdReport', 'dischargeReport'], newReportData);
    },

    getScreenTitle: function getScreenTitle(model) {
      var isNew = get(model, 'isNew');
      var title = null;
      if (get(model, 'visit.outPatient')) {
        title = isNew ? 'newOPDReport' : 'opdReport';
      } else {
        title = isNew ? 'newDischargeReport' : 'dischargeReport';
      }
      return (0, _emberI18n.translationMacro)('reports.titles.' + title);
    },

    getDiagnosisContainer: function getDiagnosisContainer(visit) {
      if (get(visit, 'outPatient')) {
        return visit;
      }
      return null;
    },

    getCurrentOperativePlan: function getCurrentOperativePlan(patient) {
      var operativePlans = get(patient, 'operativePlans');
      return operativePlans.findBy('isPlanned', true);
    },

    afterModel: function afterModel(model) {
      if (!get(model, 'isNew')) {
        var patient = get(model, 'visit.patient');
        set(model, 'patient', patient);
      }
      if (!get(model, 'visit')) {
        return this.transitionTo('patients');
      }
    },

    setupController: function setupController(controller, model) {
      this._super(controller, model);
      var visit = get(model, 'visit');
      var patient = get(model, 'patient');
      var isOutPatient = get(visit, 'outPatient');
      set(controller, 'visit', visit);
      set(controller, 'isOutPatient', isOutPatient);
      set(controller, 'diagnosisContainer', this.getDiagnosisContainer(visit));
      set(controller, 'currentOperativePlan', this.getCurrentOperativePlan(patient));
      if (isOutPatient) {
        set(controller, 'nextAppointments', this.getPatientFutureAppointment(visit, true));
      } else {
        set(controller, 'nextAppointment', this.getPatientFutureAppointment(visit));
      }
    }
  });
});
define('hospitalrun/tests/visits/reports/edit/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/reports/edit/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/reports/edit/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/route', ['exports', 'hospitalrun/routes/abstract-module-route'], function (exports, _hospitalrunRoutesAbstractModuleRoute) {
  'use strict';

  exports['default'] = _hospitalrunRoutesAbstractModuleRoute['default'].extend({
    addCapability: 'add_visit',
    additionalModels: [{
      name: 'anesthesiaTypes',
      findArgs: ['lookup', 'anesthesia_types']
    }, {
      name: 'anesthesiologistList',
      findArgs: ['lookup', 'anesthesiologists']
    }, {
      name: 'diagnosisList',
      findArgs: ['lookup', 'diagnosis_list']
    }, {
      name: 'cptCodeList',
      findArgs: ['lookup', 'cpt_code_list']
    }, {
      name: 'physicianList',
      findArgs: ['lookup', 'physician_list']
    }, {
      name: 'locationList',
      findArgs: ['lookup', 'visit_location_list']
    }, {
      name: 'procedureList',
      findArgs: ['lookup', 'procedure_list']
    }, {
      name: 'procedureLocations',
      findArgs: ['lookup', 'procedure_locations']
    }, {
      name: 'procedurePricingTypes',
      findArgs: ['lookup', 'procedure_pricing_types']
    }, {
      name: 'sexList',
      findArgs: ['lookup', 'sex']
    }, {
      name: 'visitTypesList',
      findArgs: ['lookup', 'visit_types']
    }, {
      name: 'wardPricingTypes',
      findArgs: ['lookup', 'ward_pricing_types']
    }, {
      name: 'printHeader',
      findArgs: ['option', 'print_header']
    }],
    moduleName: 'visits',
    newButtonAction: null, // No new button
    sectionTitle: 'Visits',

    actions: {
      allItems: function allItems() {
        this.transitionTo('patients.index');
      }
    }

  });
});
define('hospitalrun/tests/visits/route.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/route.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/route.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/vitals/delete/controller', ['exports', 'hospitalrun/controllers/abstract-delete-controller', 'ember'], function (exports, _hospitalrunControllersAbstractDeleteController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractDeleteController['default'].extend({
    afterDeleteAction: 'notifyVitalsDelete',
    editController: _ember['default'].inject.controller('visits/edit'),
    title: 'Delete Vitals',

    actions: {
      notifyVitalsDelete: function notifyVitalsDelete() {
        this.send('closeModal');
        this.get('editController').send('deleteVitals', this.get('model'));
      }
    }
  });
});
define('hospitalrun/tests/visits/vitals/delete/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/vitals/delete/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/vitals/delete/controller.js should pass ESLint.\n');
  });
});
define('hospitalrun/tests/visits/vitals/edit/controller', ['exports', 'hospitalrun/controllers/abstract-edit-controller', 'ember'], function (exports, _hospitalrunControllersAbstractEditController, _ember) {
  'use strict';

  exports['default'] = _hospitalrunControllersAbstractEditController['default'].extend({
    cancelAction: 'closeModal',

    editController: _ember['default'].inject.controller('visits/edit'),

    newVitals: false,

    temperatureLabel: 'Temperature (\xb0C)',

    title: (function () {
      var isNew = this.get('model.isNew');
      if (isNew) {
        return 'Add Vitals';
      }
      return 'Edit Vitals';
    }).property('model.isNew'),

    updateCapability: 'add_vitals',

    beforeUpdate: function beforeUpdate() {
      if (this.get('model.isNew')) {
        this.set('newVitals', true);
      }
      return _ember['default'].RSVP.Promise.resolve();
    },

    afterUpdate: function afterUpdate(vitals) {
      if (this.get('newVitals')) {
        this.get('editController').send('addVitals', vitals);
      } else {
        this.send('closeModal');
      }
    }
  });
});
define('hospitalrun/tests/visits/vitals/edit/controller.lint-test', ['exports'], function (exports) {
  'use strict';

  QUnit.module('ESLint - visits/vitals/edit/controller.js');
  QUnit.test('should pass ESLint', function (assert) {
    assert.expect(1);
    assert.ok(true, 'visits/vitals/edit/controller.js should pass ESLint.\n');
  });
});
/* jshint ignore:start */

require('hospitalrun/tests/test-helper');
EmberENV.TESTS_FILE_LOADED = true;

/* jshint ignore:end */
//# sourceMappingURL=tests.map
