Overview

Namespaces

  • Azalea
    • Selenium
      • App
        • Charts
        • Components
        • Encounters
        • Home
        • Login
        • Main
        • Messages
        • Patients
        • Scheduler
      • Core
      • EHR
        • UI
          • Charts
          • Documents
          • Encounters
          • Home
          • Messaging
            • Folders
          • Patients
          • Payments
          • Precerts
          • Reports
          • Scheduler
          • Settings
            • General
              • Locations
              • Roles
              • Users
        • User
      • Login
        • UI
      • PHR
        • UI
        • User
      • Toolkit
        • Exception
        • Validation
    • Util
  • None
  • tests
    • integration
      • barebones
        • controllers
          • charts
          • patients
          • system
        • models
          • billing
          • encounters
          • examples
          • messaging
          • rcm
          • system
    • unit
      • barebones
        • lib
        • utilities
          • calculations

Classes

  • AddPatientTest
  • Azalea\Selenium\App\ApplicationTestCase
  • Azalea\Selenium\App\Charts\Chart
  • Azalea\Selenium\App\Charts\ChartAssessment
  • Azalea\Selenium\App\Charts\ChartDiagnosisCodes
  • Azalea\Selenium\App\Charts\ChartListControls
  • Azalea\Selenium\App\Charts\ChartObjective
  • Azalea\Selenium\App\Charts\ChartProcedureCodes
  • Azalea\Selenium\App\Charts\Charts
  • Azalea\Selenium\App\Charts\ChartSubjective
  • Azalea\Selenium\App\Components\CodeLookup
  • Azalea\Selenium\App\Components\CollectionGrid
  • Azalea\Selenium\App\Components\Popup
  • Azalea\Selenium\App\Customers
  • Azalea\Selenium\App\Encounters\Encounter
  • Azalea\Selenium\App\Encounters\EncounterDiagnosisCodes
  • Azalea\Selenium\App\Encounters\EncounterLedger
  • Azalea\Selenium\App\Encounters\EncounterProcedureCodes
  • Azalea\Selenium\App\Encounters\Encounters
  • Azalea\Selenium\App\Home\Home
  • Azalea\Selenium\App\Login\LoginPage
  • Azalea\Selenium\App\Main\MainSearch
  • Azalea\Selenium\App\Messages\Messages
  • Azalea\Selenium\App\Patients
  • Azalea\Selenium\App\Patients\Patient
  • Azalea\Selenium\App\Patients\PatientCharts
  • Azalea\Selenium\App\Patients\PatientEditDemographicsForm
  • Azalea\Selenium\App\Patients\PatientEncounters
  • Azalea\Selenium\App\Patients\PatientFaker
  • Azalea\Selenium\App\Patients\PatientList
  • Azalea\Selenium\App\Patients\PatientListFilters
  • Azalea\Selenium\App\Patients\Patients
  • Azalea\Selenium\App\Providers
  • Azalea\Selenium\App\Scheduler\AppointmentPopup
  • Azalea\Selenium\App\Scheduler\Scheduler
  • Azalea\Selenium\App\Users
  • Azalea\Selenium\Core\BaseTestCase
  • Azalea\Selenium\Core\Browser
  • Azalea\Selenium\Core\Page
  • Azalea\Selenium\Core\User
  • Azalea\Selenium\Core\View
  • Azalea\Selenium\Core\WebDriver
  • Azalea\Selenium\EHR\Application
  • Azalea\Selenium\EHR\EHR
  • Azalea\Selenium\EHR\EHRTestCase
  • Azalea\Selenium\EHR\EMR
  • Azalea\Selenium\EHR\PM
  • Azalea\Selenium\EHR\UI\Charts\ChartsList
  • Azalea\Selenium\EHR\UI\Charts\ChartsListRow
  • Azalea\Selenium\EHR\UI\Charts\ChartsListTab
  • Azalea\Selenium\EHR\UI\CheckboxGrid
  • Azalea\Selenium\EHR\UI\Documents\Documents
  • Azalea\Selenium\EHR\UI\Documents\DocumentsTab
  • Azalea\Selenium\EHR\UI\Encounters\Encounters
  • Azalea\Selenium\EHR\UI\Encounters\EncountersTab
  • Azalea\Selenium\EHR\UI\Grid
  • Azalea\Selenium\EHR\UI\GridRow
  • Azalea\Selenium\EHR\UI\Heading
  • Azalea\Selenium\EHR\UI\Home\Home
  • Azalea\Selenium\EHR\UI\Home\OfficeOverview
  • Azalea\Selenium\EHR\UI\LockScreen
  • Azalea\Selenium\EHR\UI\MainMenu
  • Azalea\Selenium\EHR\UI\MainSearch
  • Azalea\Selenium\EHR\UI\Messaging\Folders\MessagingAllMail
  • Azalea\Selenium\EHR\UI\Messaging\Folders\MessagingInbox
  • Azalea\Selenium\EHR\UI\Messaging\Folders\MessagingSentMail
  • Azalea\Selenium\EHR\UI\Messaging\Folders\MessagingStarred
  • Azalea\Selenium\EHR\UI\Messaging\Folders\MessagingTrashed
  • Azalea\Selenium\EHR\UI\Messaging\Messaging
  • Azalea\Selenium\EHR\UI\Messaging\MessagingCompose
  • Azalea\Selenium\EHR\UI\Messaging\MessagingFolder
  • Azalea\Selenium\EHR\UI\Messaging\MessagingMenu
  • Azalea\Selenium\EHR\UI\Messaging\MessagingReply
  • Azalea\Selenium\EHR\UI\Messaging\MessagingTab
  • Azalea\Selenium\EHR\UI\Messaging\MessagingViewMessage
  • Azalea\Selenium\EHR\UI\Module
  • Azalea\Selenium\EHR\UI\Notifications
  • Azalea\Selenium\EHR\UI\Patients\ChartsListRow
  • Azalea\Selenium\EHR\UI\Patients\ChartsTab
  • Azalea\Selenium\EHR\UI\Patients\PatientAllergies
  • Azalea\Selenium\EHR\UI\Patients\PatientAllergyEditPopup
  • Azalea\Selenium\EHR\UI\Patients\PatientAllergySearchPopup
  • Azalea\Selenium\EHR\UI\Patients\PatientAppointments
  • Azalea\Selenium\EHR\UI\Patients\PatientAssembly
  • Azalea\Selenium\EHR\UI\Patients\PatientCharts
  • Azalea\Selenium\EHR\UI\Patients\PatientChartsList
  • Azalea\Selenium\EHR\UI\Patients\PatientComments
  • Azalea\Selenium\EHR\UI\Patients\PatientDashboard
  • Azalea\Selenium\EHR\UI\Patients\PatientDemographics
  • Azalea\Selenium\EHR\UI\Patients\PatientDemographicsPopup
  • Azalea\Selenium\EHR\UI\Patients\PatientDocuments
  • Azalea\Selenium\EHR\UI\Patients\PatientDocumentsList
  • Azalea\Selenium\EHR\UI\Patients\PatientEncounters
  • Azalea\Selenium\EHR\UI\Patients\PatientEncountersAddPopup
  • Azalea\Selenium\EHR\UI\Patients\PatientHandouts
  • Azalea\Selenium\EHR\UI\Patients\PatientInsurance
  • Azalea\Selenium\EHR\UI\Patients\PatientLabOrders
  • Azalea\Selenium\EHR\UI\Patients\PatientLabOrdersAddView
  • Azalea\Selenium\EHR\UI\Patients\PatientMedications
  • Azalea\Selenium\EHR\UI\Patients\PatientPortal
  • Azalea\Selenium\EHR\UI\Patients\PatientRecalls
  • Azalea\Selenium\EHR\UI\Patients\Patients
  • Azalea\Selenium\EHR\UI\Patients\PatientSearchPopup
  • Azalea\Selenium\EHR\UI\Patients\PatientSection
  • Azalea\Selenium\EHR\UI\Patients\PatientSidebar
  • Azalea\Selenium\EHR\UI\Patients\PatientsList
  • Azalea\Selenium\EHR\UI\Patients\PatientsListRow
  • Azalea\Selenium\EHR\UI\Patients\PatientsListTab
  • Azalea\Selenium\EHR\UI\Patients\PatientsTab
  • Azalea\Selenium\EHR\UI\Patients\PatientTab
  • Azalea\Selenium\EHR\UI\Patients\PatientTasks
  • Azalea\Selenium\EHR\UI\Patients\PatientVitals
  • Azalea\Selenium\EHR\UI\Patients\PatientVitalsAddPopup
  • Azalea\Selenium\EHR\UI\Payments\EDIRemitsTab
  • Azalea\Selenium\EHR\UI\Payments\Payments
  • Azalea\Selenium\EHR\UI\Payments\PaymentsTab
  • Azalea\Selenium\EHR\UI\Payments\UnappliedPaymentsTab
  • Azalea\Selenium\EHR\UI\Popup
  • Azalea\Selenium\EHR\UI\PopupConfirm
  • Azalea\Selenium\EHR\UI\PopupError
  • Azalea\Selenium\EHR\UI\Precerts\Precerts
  • Azalea\Selenium\EHR\UI\Precerts\PrecertsTab
  • Azalea\Selenium\EHR\UI\Reports\AuditLogTab
  • Azalea\Selenium\EHR\UI\Reports\ClinicalQualityMeasuresTab
  • Azalea\Selenium\EHR\UI\Reports\ClinicalQualityMeasuresValueSetsTab
  • Azalea\Selenium\EHR\UI\Reports\MeaningfulUseTab
  • Azalea\Selenium\EHR\UI\Reports\PatientStatementsTab
  • Azalea\Selenium\EHR\UI\Reports\RecordsTab
  • Azalea\Selenium\EHR\UI\Reports\Reports
  • Azalea\Selenium\EHR\UI\Reports\ReportsQueueTab
  • Azalea\Selenium\EHR\UI\Reports\ReportsTab
  • Azalea\Selenium\EHR\UI\Reports\SystemStatisticsTab
  • Azalea\Selenium\EHR\UI\Scheduler\AppointmentsRequestsTab
  • Azalea\Selenium\EHR\UI\Scheduler\AppointmentsTab
  • Azalea\Selenium\EHR\UI\Scheduler\RecallsTab
  • Azalea\Selenium\EHR\UI\Scheduler\Scheduler
  • Azalea\Selenium\EHR\UI\Scheduler\SchedulerTab
  • Azalea\Selenium\EHR\UI\SelectDropdown
  • Azalea\Selenium\EHR\UI\Settings\BillingTab
  • Azalea\Selenium\EHR\UI\Settings\General\GroupsSection
  • Azalea\Selenium\EHR\UI\Settings\General\HandoutsSection
  • Azalea\Selenium\EHR\UI\Settings\General\InsurancesSection
  • Azalea\Selenium\EHR\UI\Settings\General\Locations\LocationRow
  • Azalea\Selenium\EHR\UI\Settings\General\Locations\LocationsList
  • Azalea\Selenium\EHR\UI\Settings\General\LocationsSection
  • Azalea\Selenium\EHR\UI\Settings\General\ProvidersSection
  • Azalea\Selenium\EHR\UI\Settings\General\Roles\RoleCreatePopup
  • Azalea\Selenium\EHR\UI\Settings\General\Roles\RoleRow
  • Azalea\Selenium\EHR\UI\Settings\General\Roles\RolesList
  • Azalea\Selenium\EHR\UI\Settings\General\RolesSection
  • Azalea\Selenium\EHR\UI\Settings\General\Users\UserDetails
  • Azalea\Selenium\EHR\UI\Settings\General\Users\UserRow
  • Azalea\Selenium\EHR\UI\Settings\General\Users\UsersList
  • Azalea\Selenium\EHR\UI\Settings\General\UsersSection
  • Azalea\Selenium\EHR\UI\Settings\GeneralTab
  • Azalea\Selenium\EHR\UI\Settings\InventoryTab
  • Azalea\Selenium\EHR\UI\Settings\MedicalTab
  • Azalea\Selenium\EHR\UI\Settings\PatientTab
  • Azalea\Selenium\EHR\UI\Settings\SchedulerTab
  • Azalea\Selenium\EHR\UI\Settings\Settings
  • Azalea\Selenium\EHR\UI\TabContainer
  • Azalea\Selenium\EHR\UI\TabPanel
  • Azalea\Selenium\EHR\UI\UserAccountMenu
  • Azalea\Selenium\EHR\User\EHRAdminTestingUser
  • Azalea\Selenium\EHR\User\EMRAdminTestingUser
  • Azalea\Selenium\EHR\User\PMAdminTestingUser
  • Azalea\Selenium\Login\LoginPage
  • Azalea\Selenium\Login\LoginTestCase
  • Azalea\Selenium\Login\ResetPasswordPage
  • Azalea\Selenium\Login\UI\LoginForm
  • Azalea\Selenium\Login\UI\ResetPasswordForm
  • Azalea\Selenium\PHR\Application
  • Azalea\Selenium\PHR\PHR
  • Azalea\Selenium\PHR\PHRTestCase
  • Azalea\Selenium\PHR\UI\PopupError
  • Azalea\Selenium\PHR\User\PHRTestingUser
  • Azalea\Selenium\Toolkit\Dom
  • Azalea\Selenium\Toolkit\NestedHashMap
  • Azalea\Selenium\Toolkit\ResourceLoader
  • Azalea\Selenium\Toolkit\SauceLabsTestCase
  • Azalea\Selenium\Toolkit\SeleniumTestCase
  • Azalea\Selenium\Toolkit\TestCase
  • Azalea\Selenium\Toolkit\Validation\ElementExists
  • Azalea\Selenium\Toolkit\Validation\ElementHasText
  • Azalea\Selenium\Toolkit\Validation\ElementVisible
  • Azalea\Selenium\Toolkit\Validation\PageTitle
  • Azalea\Selenium\Toolkit\Validation\ValidationRule
  • Azalea\Selenium\Toolkit\Validation\ViewExists
  • Azalea\Selenium\Toolkit\Validation\WebDriverValidator
  • Azalea\Selenium\Toolkit\View
  • Azalea\Util\Config
  • Azalea\Util\Debug
  • Azalea_Sniffs_WhiteSpace_ScopeClosingBraceSniff
  • BaseModelTestCase
  • ChartAssessmentTest
  • ChartCustomFieldBehaviorsTest
  • ChartDiagnosisTest
  • ChartEncounterDiagnosisTest
  • ChartEncounterProceduresTest
  • ChartInventoryTest
  • ChartObjectiveTest
  • ChartProblemHistoryTest
  • ChartProceduresTest
  • ChartProviderAccessTest
  • ChartSigningTest
  • ChartsListProviderAccessTest
  • ChartSmokingStatusTest
  • ChartSubjectiveTest
  • ConfigTest
  • EncounterClaimsTest
  • EncounterDemographicsTest
  • EncounterDiagnosisTest
  • EncounterGuarantorTest
  • EncounterLedgerTest
  • EncounterProceduresTest
  • ExampleTestCase
  • MessagesLabelsTest
  • PageTest
  • PatentsListTest
  • PathManagerTest
  • PatientAccountSummaryTest
  • PatientBillingActionsTest
  • PatientCommentsTest
  • PatientDashboardAlertsTest
  • PatientDashboardLinkedPatientsTest
  • PatientDemographicsEditTest
  • PatientDocumentsTest
  • PatientPopupCommentsTest
  • PatientProviderAccessTest
  • PatientsListProviderAccessTest
  • PermissionsTest
  • PopupTest
  • SchedulerBlocksTest
  • SchedulerInsuranceBlocksTest
  • SimpePage
  • SimpleView
  • SimpleViewWithArgs
  • SimpleViewWithNoHash
  • TestCase
  • tests\integration\barebones\BarebonesConstants
  • tests\integration\barebones\BarebonesTestCase
  • tests\integration\barebones\controllers\charts\ChartsControllerTest
  • tests\integration\barebones\controllers\patients\PatientsPopupAlertsControllerTest
  • tests\integration\barebones\controllers\system\ClientsControllerTest
  • tests\integration\barebones\models\billing\ClientsFeeSchedulesMapModelTest
  • tests\integration\barebones\models\encounters\AppointmentModelTest
  • tests\integration\barebones\models\encounters\CollectionTest
  • tests\integration\barebones\models\encounters\ConcurrentCollectionTest
  • tests\integration\barebones\models\encounters\EncounterModelTest
  • tests\integration\barebones\models\encounters\EncountersIncompleteReasonModelTest
  • tests\integration\barebones\models\encounters\ModelQueryBuilderTest
  • tests\integration\barebones\models\examples\ExampleModelBasicsTest
  • tests\integration\barebones\models\examples\ExamplesGenericControllerTest
  • tests\integration\barebones\models\messaging\MessageModelTest
  • tests\integration\barebones\models\rcm\RCMStatsGeneralControllerTests
  • tests\integration\barebones\models\system\ClientModelTest
  • tests\unit\barebones\lib\BarebonesTestCase
  • tests\unit\barebones\utilities\ArraysTest
  • tests\unit\barebones\utilities\calculations\PovertyLineTest
  • tests\unit\barebones\utilities\MathTest
  • UrlManagerTest
  • VariantRulesTest
  • VariantsManagerTest
  • ViewTest
  • WebDriverMock

Exceptions

  • Azalea\Selenium\Toolkit\Exception\ElementNotFoundException
  • Azalea\Selenium\Toolkit\Exception\InvalidPageException
  • Azalea\Selenium\Toolkit\Exception\TimeoutException
  • Overview
  • Namespace
  • Class
  1: <?php
  2: use Azalea\Selenium\App\ApplicationTestCase;
  3: use Azalea\Selenium\App\Customers;
  4: use Azalea\Selenium\App\Patients;
  5: use Azalea\Selenium\App\Providers;
  6: use Azalea\Selenium\App\Users;
  7: 
  8: class ChartInventoryTest extends ApplicationTestCase
  9: {
 10:     public function supportsCustomer($cus_id)
 11:     {
 12:         // Azalea EHR, Azalea EMR customers only
 13:         return (Customers::isEhrCustomer($cus_id) || Customers::isEmrCustomer($cus_id));
 14:     }
 15: 
 16:     /**
 17:      * Summary:
 18:      * Add and remove a simple immunization inventory item.
 19:      * Adding an immuniation inventory inserts into the immunization history
 20:      * section.
 21:      */
 22:     public function testAddRemoveSimpleImmunizationInventory()
 23:     {
 24:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
 25: 
 26:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
 27:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
 28: 
 29:         // Click + Inventory
 30:         $chartView->procedure->press("Inventory");
 31:         $this->waitForAjax();
 32: 
 33:         // Wait for the Select Inventory popup
 34:         $chartView->popups->inventory->verifyAndWait();
 35:         $chartView->popups->inventory->grid->waitForRowAt(0);
 36: 
 37:         // Search for "Selenium Test Immunization Simple"
 38:         $chartView->popups->inventory->type("autoselect_search", "Selenium Test Immunization Simple");
 39:         $this->spinWait(function () use ($chartView) {
 40:             return $chartView->popups->inventory->grid->first()->see("Selenium Test Immunization Simple");
 41:         });
 42: 
 43:         // Click on the "Selenium Test Immunization Simple" row
 44:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
 45:         $app->popup->last()->press("Add");
 46: 
 47:         // Wait for the Patient Inventory popup
 48:         $this->waitForAjax();
 49:         $chartView->popups->patientInventory->verifyAndWait();
 50: 
 51:         // Set the Provider to "Grover Ledner, M.D."
 52:         $chartView->popups->patientInventory->select("pinv_administered_phy_id", Providers::GROVER_LEDNER_ID);
 53: 
 54:         // Set the Location to "Left Thigh"
 55:         $chartView->popups->patientInventory->select("pinv_administered_location_id", 1);
 56: 
 57:         // Set the Route to "Intradermal"
 58:         $chartView->popups->patientInventory->select("pinv_administered_route_id", 1);
 59: 
 60:         // Set the Immunization Source to "New immunization"
 61:         $chartView->popups->patientInventory->select("pim_imzs_id", 1);
 62: 
 63:         // Set the notes field to "This is some notes"
 64:         $chartView->popups->patientInventory->setInput("pinv_administered_notes", "This is a note.");
 65: 
 66:         // Submit the patient inventory
 67:         $app->popup->last()->press("Submit");
 68: 
 69:         /**
 70:          * Expected outcome:
 71:          * a. Selenium Test Immunization Simple is added to the Inventory section
 72:          *    of the chart.
 73:          */
 74:         $this->spinWait(function () use ($chartView) {
 75:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Immunization Simple");
 76:             $chartView->procedure->inventory->grid->assertCanSee("Grover Ledner, M.D.");
 77:             $chartView->procedure->inventory->grid->assertCanSee("Left Thigh");
 78:             $chartView->procedure->inventory->grid->assertCanSee("Intradermal");
 79:             $chartView->procedure->inventory->grid->assertCanSee("This is a note.");
 80:             $chartView->procedure->inventory->grid->assertCanSee("FELIX MILLER");
 81:             $chartView->procedure->inventory->grid->assertCanSee("ADMINISTRATOR");
 82:             $chartView->procedure->inventory->grid->assertCanSee("1mL x 1");        // Amount
 83:             $chartView->procedure->inventory->grid->assertCanSee("01010");      // NDC #
 84:             $chartView->procedure->inventory->grid->assertCanSee("12345");      // Lot #
 85:             $chartView->procedure->inventory->grid->assertCanSee("54321");      // Product #
 86:             return true;
 87:         });
 88: 
 89:         /**
 90:          * Expected outcome:
 91:          * a. Selenium Test Immunization Simple is added to the Immunization History
 92:          *    section of the chart.
 93:          */
 94:         $this->spinWait(function () use ($chartView) {
 95:             $chartView->subjective->immunizations->grid->assertCanSee("Selenium Test Immunization Simple");
 96:             $chartView->subjective->immunizations->grid->assertCanSee("FELIX MILLER");
 97:             $chartView->subjective->immunizations->grid->assertCanSee("ADMINISTRATOR");
 98:             $chartView->subjective->immunizations->grid->assertCanSee("1mL x 1");       // Amount
 99:             $chartView->subjective->immunizations->grid->assertCanSee("12345");         // Lot #
100:             return true;
101:         });
102: 
103:         // Click the "X" button to remove the inventory from the inventory section.
104:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
105: 
106:         /**
107:          * Expected outcome:
108:          * a. Selenium Test Immunization Simple is removed from the Inventory section
109:          *    of the chart.
110:          */
111:         $this->spinWait(function () use ($chartView) {
112:             $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Test Immunization Simple");
113:             return true;
114:         });
115: 
116:         // Click the "X" button to remove the immunization from the immunization history section.
117:         $chartView->subjective->immunizations->grid->first()->querySelector('[data-button-class="delete"]')->click();
118: 
119:         /**
120:          * Expected outcome:
121:          * a. Selenium Test Immunization Simple is removed from the Immunization history section
122:          *    of the chart.
123:          */
124:         $this->spinWait(function () use ($chartView) {
125:             $chartView->subjective->immunizations->grid->assertCanNotSee("Selenium Test Immunization Simple");
126:             return true;
127:         });
128: 
129:         // cancel the chart to clean up
130:         $chartView->cancel();
131: 
132:         $this->assertNoErrorPopups();
133:     }
134: 
135:     /**
136:      * Summary:
137:      * Add and remove a simple non-administered inventory item.
138:      */
139:     public function testAddRemoveSimpleNonAdministeredInventory()
140:     {
141:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
142: 
143:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
144:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
145: 
146:         // Click + Inventory
147:         $chartView->procedure->press("Inventory");
148:         $this->waitForAjax();
149: 
150:         // Wait for the Select Inventory popup
151:         $chartView->popups->inventory->verifyAndWait();
152:         $chartView->popups->inventory->grid->waitForRowAt(0);
153: 
154:         // Search for "Selenium Test Non-Administered"
155:         $chartView->popups->inventory->type("autoselect_search", "Selenium Test Non-Administered");
156:         $this->spinWait(function () use ($chartView) {
157:             return $chartView->popups->inventory->grid->first()->see("Selenium Test Non-Administered");
158:         });
159: 
160:         // Click on the "Selenium Test Non-Administered" row
161:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
162:         $app->popup->last()->press("Add");
163: 
164:         // Wait for the Patient Inventory popup
165:         $chartView->popups->patientInventory->verifyAndWait();
166: 
167:         // Submit the patient inventory
168:         $app->popup->last()->press("Submit");
169: 
170:         /**
171:          * Expected outcome:
172:          * a. Selenium Test Non-Administered is added to the Inventory section
173:          *    of the chart.
174:          */
175:         $this->spinWait(function () use ($chartView) {
176:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Non-Administered");
177:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Non-Administered Type");
178:             $chartView->procedure->inventory->grid->assertCanSee("N/A");
179:             $chartView->procedure->inventory->grid->assertCanSee("1 x 1");      // Amount
180:             $chartView->procedure->inventory->grid->assertCanSee("88888");      // Lot #
181:             $chartView->procedure->inventory->grid->assertCanSee("99999");      // Product #
182:             return true;
183:         });
184: 
185:         // Click the "X" button to remove the inventory from the inventory section.
186:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
187: 
188:         /**
189:          * Expected outcome:
190:          * a. Selenium Test Non-Administered is removed from the Inventory section
191:          *    of the chart.
192:          */
193:         $this->spinWait(function () use ($chartView) {
194:             $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Test Non-Administered");
195:             return true;
196:         });
197: 
198:         // cancel the chart to clean up
199:         $chartView->cancel();
200: 
201:         $this->assertNoErrorPopups();
202:     }
203: 
204:     /**
205:      * Summary:
206:      * Add and remove a simple custom administered inventory item.
207:      */
208:     public function testAddRemoveSimpleAdministeredInventory()
209:     {
210:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
211: 
212:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
213:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
214: 
215:         // Click + Inventory
216:         $chartView->procedure->press("Inventory");
217:         $this->waitForAjax();
218: 
219:         // Wait for the Select Inventory popup
220:         $chartView->popups->inventory->verifyAndWait();
221:         $chartView->popups->inventory->grid->waitForRowAt(0);
222: 
223:         // Search for "Selenium Test Administered"
224:         $chartView->popups->inventory->type("autoselect_search", "Selenium Test Administered");
225:         $this->spinWait(function () use ($chartView) {
226:             return $chartView->popups->inventory->grid->first()->see("Selenium Test Administered");
227:         });
228: 
229:         // Click on the "Selenium Test Administered" row
230:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
231:         $app->popup->last()->press("Add");
232: 
233:         // Wait for the Patient Inventory popup
234:         $chartView->popups->patientInventory->verifyAndWait();
235: 
236:         // Push "Now" for Administered Time
237:         $chartView->popups->patientInventory->press("Now");
238: 
239:         // Set the Provider to "Grover Ledner, M.D."
240:         $chartView->popups->patientInventory->select("pinv_administered_phy_id", Providers::GROVER_LEDNER_ID);
241: 
242:         // Set the Location to "Left Thigh"
243:         $chartView->popups->patientInventory->select("pinv_administered_location_id", 1);
244: 
245:         // Set the Route to "Intradermal"
246:         $chartView->popups->patientInventory->select("pinv_administered_route_id", 1);
247: 
248:         // Set the notes field to "This is some notes"
249:         $chartView->popups->patientInventory->setInput("pinv_administered_notes", "This is a note.");
250: 
251:         // Submit the patient inventory
252:         $app->popup->last()->press("Submit");
253: 
254:         /**
255:          * Expected outcome:
256:          * a. Selenium Test Administered is added to the Inventory section
257:          *    of the chart.
258:          */
259:         $this->spinWait(function () use ($chartView) {
260:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Administered");
261:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Administered Type");
262:             $chartView->procedure->inventory->grid->assertCanSee("Grover Ledner, M.D.");
263:             $chartView->procedure->inventory->grid->assertCanSee("Left Thigh");
264:             $chartView->procedure->inventory->grid->assertCanSee("Intradermal");
265:             $chartView->procedure->inventory->grid->assertCanSee("This is a note.");
266:             $chartView->procedure->inventory->grid->assertCanSee("FELIX MILLER");
267:             $chartView->procedure->inventory->grid->assertCanSee("ADMINISTRATOR");
268:             $chartView->procedure->inventory->grid->assertCanSee("1mL x 1");    // Amount
269:             $chartView->procedure->inventory->grid->assertCanSee("808080");     // NDC #
270:             $chartView->procedure->inventory->grid->assertCanSee("424242");     // Lot #
271:             $chartView->procedure->inventory->grid->assertCanSee("242424");     // Product #
272:             return true;
273:         });
274: 
275:         // Click the "X" button to remove the inventory from the inventory section.
276:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
277: 
278:         /**
279:          * Expected outcome:
280:          * a. Selenium Test Administered is removed from the Inventory section
281:          *    of the chart.
282:          */
283:         $this->spinWait(function () use ($chartView) {
284:             $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Test Administered");
285:             return true;
286:         });
287: 
288:         // cancel the chart to clean up
289:         $chartView->cancel();
290: 
291:         $this->assertNoErrorPopups();
292:     }
293: 
294:     /**
295:      * Summary:
296:      * Tests the decrement of inventory item when added and increment when
297:      * removed from a chart.
298:      */
299:     public function testIncrementDecrementInventory()
300:     {
301:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
302: 
303:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
304:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
305: 
306:         // Click + Inventory
307:         $chartView->procedure->press("Inventory");
308:         $this->waitForAjax();
309: 
310:         // Wait for the Select Inventory popup
311:         $chartView->popups->inventory->verifyAndWait();
312:         $chartView->popups->inventory->grid->waitForRowAt(0);
313: 
314:         // Search for "Selenium Increment Decrement Test"
315:         $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Test");
316:         $this->spinWait(function () use ($chartView) {
317:             return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Test");
318:         });
319: 
320:         // Get the # Available amount
321:         $displayInitialAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
322:         $displayInitialAvailable = str_replace(",", "", trim(current(explode("/", $displayInitialAvailable))));
323:         $displayInitialAvailable = intval($displayInitialAvailable);
324: 
325:         // Click on the "Selenium Increment Decrement Test" row
326:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
327:         $app->popup->last()->press("Add");
328: 
329:         // Wait for the Patient Inventory popup
330:         $chartView->popups->patientInventory->verifyAndWait();
331: 
332:         // Submit the patient inventory
333:         $app->popup->last()->press("Submit");
334: 
335:         /**
336:          * Expected outcome:
337:          * a. Selenium Increment Decrement Test is added to the Inventory section
338:          *    of the chart.
339:          */
340:         $this->spinWait(function () use ($chartView) {
341:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Increment Decrement Test");
342:             return true;
343:         });
344: 
345: 
346:         // Click + Inventory
347:         $chartView->procedure->press("Inventory");
348:         $this->waitForAjax();
349: 
350:         // Wait for the Select Inventory popup
351:         $chartView->popups->inventory->verifyAndWait();
352:         $chartView->popups->inventory->grid->waitForRowAt(0);
353: 
354:         // Search for "Selenium Increment Decrement Test"
355:         $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Test");
356:         $this->spinWait(function () use ($chartView) {
357:             return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Test");
358:         });
359: 
360:         // Get the # Available amount
361:         $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
362:         $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
363:         $displayAvailable = intval($displayAvailable);
364: 
365:         $app->popup->last()->press("Cancel");
366: 
367:         // displayAvailable < displayInitialAvailable
368:         $this->assertTrue($displayAvailable < $displayInitialAvailable);
369: 
370: 
371:         // Click the "X" button to remove the inventory from the inventory section.
372:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
373: 
374:         /**
375:          * Expected outcome:
376:          * a. Selenium Increment Decrement Test is removed from the Inventory section
377:          *    of the chart.
378:          */
379:         $this->spinWait(function () use ($chartView) {
380:             $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Increment Decrement Test");
381:             return true;
382:         });
383: 
384: 
385:         // Click + Inventory
386:         $chartView->procedure->press("Inventory");
387:         $this->waitForAjax();
388: 
389:         // Wait for the Select Inventory popup
390:         $chartView->popups->inventory->verifyAndWait();
391:         $chartView->popups->inventory->grid->waitForRowAt(0);
392: 
393:         // Search for "Selenium Increment Decrement Test"
394:         $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Test");
395:         $this->spinWait(function () use ($chartView) {
396:             return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Test");
397:         });
398: 
399:         // Get the # Available amount
400:         $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
401:         $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
402:         $displayAvailable = intval($displayAvailable);
403: 
404:         $app->popup->last()->press("Cancel");
405: 
406:         // displayAvailable >= displayInitialAvailable
407:         $this->assertTrue($displayAvailable >= $displayInitialAvailable);
408: 
409: 
410:         // cancel the chart to clean up
411:         $chartView->cancel();
412: 
413:         $this->assertNoErrorPopups();
414:     }
415: 
416:     /**
417:      * Summary:
418:      * Tests the decrement of inventory item when added and increment when
419:      * removed from a chart when multiple units are specified.
420:      */
421:     public function testIncrementDecrementInventoryWithMultipleUnits()
422:     {
423:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
424: 
425:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
426:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
427: 
428:         // Click + Inventory
429:         $chartView->procedure->press("Inventory");
430:         $this->waitForAjax();
431: 
432:         // Wait for the Select Inventory popup
433:         $chartView->popups->inventory->verifyAndWait();
434:         $chartView->popups->inventory->grid->waitForRowAt(0);
435: 
436:         // Search for "Selenium Increment Decrement Administered Test"
437:         $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Administered Test");
438:         $this->spinWait(function () use ($chartView) {
439:             return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Administered Test");
440:         });
441: 
442:         // Get the # Available amount
443:         $this->wait(1);
444:         $chartView->popups->inventory->grid->clearCache();
445:         $displayInitialAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
446:         $displayInitialAvailable = str_replace(",", "", trim(current(explode("/", $displayInitialAvailable))));
447:         $displayInitialAvailable = intval($displayInitialAvailable);
448: 
449:         // Click on the "Selenium Increment Decrement Administered Test" row
450:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
451:         $app->popup->last()->press("Add");
452: 
453:         // Wait for the Patient Inventory popup
454:         $chartView->popups->patientInventory->verifyAndWait();
455: 
456:         // Set Administered Units to 2
457:         $chartView->popups->patientInventory->setInput("pinv_administered_multiplier", 2);
458: 
459:         // Submit the patient inventory
460:         $app->popup->last()->press("Submit");
461: 
462:         /**
463:          * Expected outcome:
464:          * a. Selenium Increment Decrement Administered Test is added to the Inventory section
465:          *    of the chart.
466:          */
467:         $this->spinWait(function () use ($chartView) {
468:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Increment Decrement Administered Test");
469:             return true;
470:         });
471: 
472: 
473:         // Click + Inventory
474:         $chartView->procedure->press("Inventory");
475:         $this->waitForAjax();
476: 
477:         // Wait for the Select Inventory popup
478:         $chartView->popups->inventory->verifyAndWait();
479:         $chartView->popups->inventory->grid->waitForRowAt(0);
480: 
481:         // Search for "Selenium Increment Decrement Administered Test"
482:         $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Administered Test");
483:         $this->spinWait(function () use ($chartView) {
484:             return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Administered Test");
485:         });
486: 
487:         // Get the # Available amount
488:         $this->wait(1);
489:         $chartView->popups->inventory->grid->clearCache();
490:         $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
491:         $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
492:         $displayAvailable = intval($displayAvailable);
493: 
494:         $app->popup->last()->press("Cancel");
495: 
496:         // displayAvailable == displayInitialAvailable - 2
497:         $this->assertTrue($displayAvailable == ($displayInitialAvailable - 2));
498: 
499: 
500:         // Click the "X" button to remove the inventory from the inventory section.
501:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
502: 
503:         /**
504:          * Expected outcome:
505:          * a. Selenium Increment Decrement Administered Test is removed from the Inventory section
506:          *    of the chart.
507:          */
508:         $this->spinWait(function () use ($chartView) {
509:             $chartView->procedure->inventory->grid->assertCanNotSee("Selenium Increment Decrement Administered Test");
510:             return true;
511:         });
512: 
513: 
514:         // Click + Inventory
515:         $chartView->procedure->press("Inventory");
516:         $this->waitForAjax();
517: 
518:         // Wait for the Select Inventory popup
519:         $chartView->popups->inventory->verifyAndWait();
520:         $chartView->popups->inventory->grid->waitForRowAt(0);
521: 
522:         // Search for "Selenium Increment Decrement Administered Test"
523:         $chartView->popups->inventory->type("autoselect_search", "Selenium Increment Decrement Administered Test");
524:         $this->spinWait(function () use ($chartView) {
525:             return $chartView->popups->inventory->grid->first()->see("Selenium Increment Decrement Administered Test");
526:         });
527: 
528:         // Get the # Available amount
529:         $this->wait(1);
530:         $chartView->popups->inventory->grid->clearCache();
531:         $displayAvailable = $chartView->popups->inventory->grid->first()->querySelector(".displayAvailable")->text();
532:         $displayAvailable = str_replace(",", "", trim(current(explode("/", $displayAvailable))));
533:         $displayAvailable = intval($displayAvailable);
534: 
535:         $app->popup->last()->press("Cancel");
536: 
537:         // displayAvailable == displayInitialAvailable
538:         $this->assertTrue($displayAvailable == $displayInitialAvailable);
539: 
540: 
541:         // cancel the chart to clean up
542:         $chartView->cancel();
543: 
544:         $this->assertNoErrorPopups();
545:     }
546: 
547:     /**
548:      * Summary:
549:      * Add an inventory item with 1 CPT and 1 Dx code attached.
550:      */
551:     public function testAddSingleAttachedCodesInventory()
552:     {
553:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
554: 
555:         // Open Patient Record for Mable D. Carroll > Charts section.
556:         $chartView = $app->patients->get(Patients::MABLE_D_CARROLL)->charts->navigate()->addChart();
557: 
558:         // Make sure that the Date of Service and Place of Service fields are not empty.
559:         $chartView->setDateOfService(date("Ymd", time()))
560:             ->select("enc_spl_id", "9") // OFFICE (11)
561:             ->tab();
562: 
563:         // Click + Inventory
564:         $chartView->procedure->press("Inventory");
565:         $this->waitForAjax();
566: 
567:         // Wait for the Select Inventory popup
568:         $chartView->popups->inventory->verifyAndWait();
569:         $chartView->popups->inventory->grid->waitForRowAt(0);
570: 
571:         // Search for "Selenium Test Single Attached Codes"
572:         $chartView->popups->inventory->type("autoselect_search", "Selenium Test Single Attached Codes");
573:         $this->spinWait(function () use ($chartView) {
574:             return $chartView->popups->inventory->grid->first()->see("Selenium Test Single Attached Codes");
575:         });
576: 
577:         // Click on the "Selenium Test Single Attached Codes" row
578:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
579:         $app->popup->last()->press("Add");
580: 
581:         // Wait for the Patient Inventory popup
582:         $chartView->popups->patientInventory->verifyAndWait();
583: 
584:         // Submit the patient inventory
585:         $app->popup->last()->press("Submit");
586: 
587:         /**
588:          * Expected outcome:
589:          * a. Selenium Test Single Attached Codes is added to the Inventory section
590:          *    of the chart.
591:          */
592:         $this->spinWait(function () use ($chartView) {
593:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Single Attached Codes");
594:             return true;
595:         });
596: 
597:         /**
598:          * Expected outcome:
599:          * a. Procedure code J6040 is added to the Chart.
600:          */
601:         $this->spinWait(function () use ($chartView) {
602:             $chartView->procedures->grid->assertCanSee("J6040");
603:             return true;
604:         });
605: 
606:         /**
607:          * Expected outcome:
608:          * a. Dx code I10 is added to the Chart.
609:          */
610:         $this->spinWait(function () use ($chartView) {
611:             $chartView->icds->grid->assertCanSee("I10");
612:             return true;
613:         });
614: 
615:         // Click the "X" button to remove the inventory from the inventory section.
616:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
617: 
618:         // Click the "X" button in the row corresponding to I10.
619:         $chartView->icds->grid->first()->querySelector('[data-button-class="Delete"]')->click();
620: 
621:         // remove all cpts to clean up
622:         $chartView->procedures->removeAll();
623: 
624:         // cancel the chart to clean up
625:         $chartView->cancel();
626: 
627:         $this->assertNoErrorPopups();
628:     }
629: 
630:     /**
631:      * Summary:
632:      * Add an inventory item with 1 CPT with no default unit count from the
633:      * fee schedule. Unit count should default to 1.
634:      */
635:     public function testAddSingleAttachedCodesInventoryWithDefaultUnitCount()
636:     {
637:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
638: 
639:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
640:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
641: 
642:         // Make sure that the Date of Service and Place of Service fields are not empty.
643:         $chartView->setDateOfService(date("Ymd", time()))
644:             ->select("enc_spl_id", "9") // OFFICE (11)
645:             ->tab();
646: 
647:         // Click + Inventory
648:         $chartView->procedure->press("Inventory");
649:         $this->waitForAjax();
650: 
651:         // Wait for the Select Inventory popup
652:         $chartView->popups->inventory->verifyAndWait();
653:         $chartView->popups->inventory->grid->waitForRowAt(0);
654: 
655:         // Search for "Dexamethasone Sodium Phosphate"
656:         $chartView->popups->inventory->type("autoselect_search", "Dexamethasone Sodium Phosphate");
657:         $this->spinWait(function () use ($chartView) {
658:             return $chartView->popups->inventory->grid->first()->see("Dexamethasone Sodium Phosphate");
659:         });
660: 
661:         // Click on the "Dexamethasone Sodium Phosphate" row
662:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
663:         $app->popup->last()->press("Add");
664: 
665:         // Wait for the Patient Inventory popup
666:         $chartView->popups->patientInventory->verifyAndWait();
667: 
668:         /**
669:          * Expected outcome:
670:          *  a. J1100 units is set to "1" (from Fee Schedule)
671:          */
672:         $chartView->popups->patientInventory->assertInputValueEquals("J1100", "1");
673: 
674:         // Submit the patient inventory
675:         $app->popup->last()->press("Submit");
676: 
677:         /**
678:          * Expected outcome:
679:          * a. Dexamethasone Sodium Phosphate is added to the Inventory section
680:          *    of the chart.
681:          */
682:         $this->spinWait(function () use ($chartView) {
683:             $chartView->procedure->inventory->grid->assertCanSee("Dexamethasone Sodium Phosphate");
684:             return true;
685:         });
686: 
687:         /**
688:          * Expected outcome:
689:          * a. Procedure code J1100 is added to the Chart.
690:          * b. Procedure code J1100 shows 1 in Units column.
691:          * b. The amount column for the inventory reads "1mg x 1".
692:          */
693:         $this->spinWait(function () use ($chartView) {
694:             $chartView->procedures->grid->assertCanSee("J1100");
695:             $chartView->procedures->grid->first()->filter(".ecp_num_units")->assertCanSee("1");
696:             $chartView->procedure->inventory->assertCanSee("1mg x 1");
697:             return true;
698:         });
699: 
700:         // Click the "X" button to remove the inventory from the inventory section.
701:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
702: 
703:         // remove all cpts to clean up
704:         $chartView->procedures->removeAll();
705: 
706:         // cancel the chart to clean up
707:         $chartView->cancel();
708: 
709:         $this->assertNoErrorPopups();
710:     }
711: 
712:     /**
713:      * Summary:
714:      * Add an inventory item with 1 CPT with a unit count. Assign multiple units
715:      * to the inventory item.
716:      */
717:     public function testAddSingleAttachedCodesInventoryWithMultipleUnits()
718:     {
719:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
720: 
721:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
722:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
723: 
724:         // Make sure that the Date of Service and Place of Service fields are not empty.
725:         $chartView->setDateOfService(date("Ymd", time()))
726:             ->select("enc_spl_id", "9") // OFFICE (11)
727:             ->tab();
728: 
729:         // Click + Inventory
730:         $chartView->procedure->press("Inventory");
731:         $this->waitForAjax();
732: 
733:         // Wait for the Select Inventory popup
734:         $chartView->popups->inventory->verifyAndWait();
735:         $chartView->popups->inventory->grid->waitForRowAt(0);
736: 
737:         // Search for "Selenium Test Single Attached Codes"
738:         $chartView->popups->inventory->type("autoselect_search", "Selenium Test Single Attached Codes Multiple Units");
739:         $this->spinWait(function () use ($chartView) {
740:             return $chartView->popups->inventory->grid->first()->see("Selenium Test Single Attached Codes Multiple Units");
741:         });
742: 
743:         // Click on the "Selenium Test Single Attached Codes Multiple Units" row
744:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
745:         $app->popup->last()->press("Add");
746: 
747:         // Wait for the Patient Inventory popup
748:         $chartView->popups->patientInventory->verifyAndWait();
749: 
750:         // Set Administered Units to 2
751:         $chartView->popups->patientInventory->setInput("pinv_administered_multiplier", 2);
752: 
753:         /**
754:          * Expected outcome:
755:          *  a. J0980 units is set to "60" (from Fee Schedule)
756:          */
757:         $chartView->popups->patientInventory->assertInputValueEquals("J0980", "60");
758: 
759:         // Submit the patient inventory
760:         $app->popup->last()->press("Submit");
761: 
762:         /**
763:          * Expected outcome:
764:          * a. Selenium Test Single Attached Codes Multiple Units is added to the Inventory section
765:          *    of the chart.
766:          */
767:         $this->spinWait(function () use ($chartView) {
768:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Single Attached Codes Multiple Units");
769:             return true;
770:         });
771: 
772:         /**
773:          * Expected outcome:
774:          * a. Procedure code J0980 is added to the Chart.
775:          * b. Procedure code J0980 shows 60 in Units column.
776:          * b. The amount column for the inventory reads "60mg x 2".
777:          */
778:         $this->spinWait(function () use ($chartView) {
779:             $chartView->procedures->grid->assertCanSee("J0980");
780:             $chartView->procedures->grid->first()->filter(".ecp_num_units")->assertCanSee("60");
781:             $chartView->procedure->inventory->assertCanSee("60mg x 2");
782:             return true;
783:         });
784: 
785:         // Click the "X" button to remove the inventory from the inventory section.
786:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
787: 
788:         // remove all cpts to clean up
789:         $chartView->procedures->removeAll();
790: 
791:         // cancel the chart to clean up
792:         $chartView->cancel();
793: 
794:         $this->assertNoErrorPopups();
795:     }
796: 
797:     /**
798:      * Summary:
799:      * Add an inventory item with 1 CPT with a unit count. Override the unit
800:      * count for the CPT code.
801:      */
802:     public function testCanOverrideAttachedCptUnitCount()
803:     {
804:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
805: 
806:         // Open Patient Record for Camila Fisher (QAA74) > Charts section.
807:         $chartView = $app->patients->get(Patients::CAMILA_FISHER_ID)->charts->navigate()->addChart();
808: 
809:         // Make sure that the Date of Service and Place of Service fields are not empty.
810:         $chartView->setDateOfService(date("Ymd", time()))
811:             ->select("enc_spl_id", "9") // OFFICE (11)
812:             ->tab();
813: 
814:         // Click + Inventory
815:         $chartView->procedure->press("Inventory");
816:         $this->waitForAjax();
817: 
818:         // Wait for the Select Inventory popup
819:         $chartView->popups->inventory->verifyAndWait();
820:         $chartView->popups->inventory->grid->waitForRowAt(0);
821: 
822:         // Search for "Selenium Test Single Attached Codes"
823:         $chartView->popups->inventory->type("autoselect_search", "Selenium Test Single Attached Codes Multiple Units");
824:         $this->spinWait(function () use ($chartView) {
825:             return $chartView->popups->inventory->grid->first()->see("Selenium Test Single Attached Codes Multiple Units");
826:         });
827: 
828:         // Click on the "Selenium Test Single Attached Codes Multiple Units" row
829:         $chartView->popups->inventory->grid->waitForRowAt(0)->click();
830:         $app->popup->last()->press("Add");
831: 
832:         // Wait for the Patient Inventory popup
833:         $chartView->popups->patientInventory->verifyAndWait();
834: 
835:         /**
836:          * Expected outcome:
837:          *  a. J0980 units is set to "60" (from Fee Schedule)
838:          */
839:         $chartView->popups->patientInventory->assertInputValueEquals("J0980", "60");
840: 
841:         // Set J0980 Units to 30
842:         $chartView->popups->patientInventory->setInput("J0980", 30);
843: 
844:         // Submit the patient inventory
845:         $app->popup->last()->press("Submit");
846: 
847:         /**
848:          * Expected outcome:
849:          * a. Selenium Test Single Attached Codes Multiple Units is added to the Inventory section
850:          *    of the chart.
851:          */
852:         $this->spinWait(function () use ($chartView) {
853:             $chartView->procedure->inventory->grid->assertCanSee("Selenium Test Single Attached Codes Multiple Units");
854:             return true;
855:         });
856: 
857:         /**
858:          * Expected outcome:
859:          * a. Procedure code J0980 is added to the Chart.
860:          * b. Procedure code J0980 shows 30 in Units column.
861:          * b. The amount column for the inventory reads "60mg x 1".
862:          */
863:         $this->spinWait(function () use ($chartView) {
864:             $chartView->procedures->grid->assertCanSee("J0980");
865:             $chartView->procedures->grid->first()->filter(".ecp_num_units")->assertCanSee("30");
866:             $chartView->procedure->inventory->assertCanSee("60mg x 1");
867:             return true;
868:         });
869: 
870:         // Click the "X" button to remove the inventory from the inventory section.
871:         $chartView->procedure->inventory->grid->first()->querySelector('[data-button-class="delete"]')->click();
872: 
873:         // remove all cpts to clean up
874:         $chartView->procedures->removeAll();
875: 
876:         // cancel the chart to clean up
877:         $chartView->cancel();
878: 
879:         $this->assertNoErrorPopups();
880:     }
881: }
882: 
883: ?>
API documentation generated by ApiGen