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\Users;
  6: 
  7: class EncounterLedgerTest extends ApplicationTestCase
  8: {
  9:     public function supportsCustomer($cus_id)
 10:     {
 11:         // Azalea EHR, Azalea PM customers only
 12:         return (Customers::isEhrCustomer($cus_id) || Customers::isPmCustomer($cus_id));
 13:     }
 14: 
 15:     /**
 16:      * Summary:
 17:      * Adding a procedure code to an encounter for a Self Pay billing
 18:      * patient adds the appropriate charge to the ledger.
 19:      */
 20:     public function testProcedurePaymentForSelfPayPatient()
 21:     {
 22:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
 23: 
 24:         // Open Patient Record for Selenium Self Pay (QAA81) > Encounters section.
 25:         $encounterView = $app->patients->get(Patients::SELENIUM_SELF_PAY)
 26:             ->encounters
 27:             ->navigate()
 28:             ->addEncounter();
 29: 
 30:         // Make sure that the Date of Service, Place of Service, and Location
 31:         // fields are not empty.
 32:         $encounterView->setDateOfService(date("m/d/Y", time()))
 33:             ->select("enc_spl_id", "9") // OFFICE (11)
 34:             ->select("enc_loc_id", "401") // Gerhard Hospital
 35:             ->select("enc_cfs_id", "173") // FEE SCHEDULE
 36:             ->tab();
 37: 
 38:         $this->waitForAjax();
 39: 
 40:         // In the procedures Quick Submit boxes enter 99212
 41:         // Click Submit.
 42:         $encounterView->procedures->fillQuickSubmit("99212", 1)
 43:             ->submitQuickSubmit();
 44:         $encounterView->procedures->grid->waitForRowCount(1);
 45: 
 46:         /**
 47:          * Expected outcome:
 48:          * a. A charge for 99212 for Date "Today" is added to the ledger.
 49:          * b. The charge is for the self pay price of $151.83.
 50:          * c. The "Next Payer" is marked as "PATIENT"
 51:          * d. Total Encounter Charges is $151.83.
 52:          * e. Total Encounter Balance is $151.83
 53:          */
 54:         $this->spinWait(function () use ($encounterView) {
 55:             $encounterView->ledger->table->assertCanSee("Today");
 56:             $encounterView->ledger->table->assertCanSee("99212");
 57:             $encounterView->ledger->table->assertCanSee("$151.83");
 58:             $encounterView->ledger->table->assertCanSee("Next Payer: PATIENT");
 59:             $encounterView->ledger->table->filter(
 60:                 $encounterView->ledger->table->selectors->totalEncounterCharges
 61:             )->assertCanSee("$151.83");
 62:             $encounterView->ledger->table->filter(
 63:                 $encounterView->ledger->table->selectors->totalEncounterBalance
 64:             )->assertCanSee("$151.83");
 65:             return true;
 66:         });
 67: 
 68:         // remove all cpts
 69:         $encounterView->procedures->removeAll();
 70: 
 71:         /**
 72:          * Expected outcome:
 73:          * a. The charge for 99212 is removed from the ledger.
 74:          */
 75:         $this->spinWait(function () use ($encounterView) {
 76:             $encounterView->ledger->table->assertCanNotSee("Today");
 77:             $encounterView->ledger->table->assertCanNotSee("99212");
 78:             $encounterView->ledger->table->assertCanNotSee("$151.83");
 79:             $encounterView->ledger->table->assertCanNotSee("Next Payer: PATIENT");
 80:             return true;
 81:         });
 82: 
 83:         // cancel the encounter to clean up
 84:         $encounterView->cancel();
 85: 
 86:         $this->assertNoErrorPopups();
 87:     }
 88: 
 89:     /**
 90:      * Summary:
 91:      * Adding a procedure code to an encounter for a patient that has
 92:      * a primary insurance and adds the appropriate charge to the ledger.
 93:      */
 94:     public function testProcedurePaymentForInsurancePatient()
 95:     {
 96:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
 97: 
 98:         // Open Patient Record for Selenium Primary Insurance (QAA11) > Encounters section.
 99:         $encounterView = $app->patients->get(Patients::SELENIUM_PRIMARY_INSURANCE)
100:             ->encounters
101:             ->navigate()
102:             ->addEncounter();
103: 
104:         // Make sure that the Date of Service, Place of Service, and Location
105:         // fields are not empty.
106:         $encounterView->setDateOfService(date("m/d/Y", time()))
107:             ->select("enc_spl_id", "9") // OFFICE (11)
108:             ->select("enc_loc_id", "401") // Gerhard Hospital
109:             ->select("enc_cfs_id", "173") // FEE SCHEDULE
110:             ->tab();
111: 
112:         $this->waitForAjax();
113: 
114:         // In the procedures Quick Submit boxes enter 99212
115:         // Click Submit.
116:         $encounterView->procedures->fillQuickSubmit("99212", 1)
117:             ->submitQuickSubmit();
118:         $encounterView->procedures->grid->waitForRowCount(1);
119: 
120:         /**
121:          * Expected outcome:
122:          * a. A charge for 99212 for Date "Today" is added to the ledger.
123:          * b. The charge is for the price of $148.56.
124:          * c. The "Next Payer" is marked as "PRIMARY INS.:1ST MEDICAL NETWORK"
125:          * d. Total Encounter Charges is $148.56.
126:          * e. Total Encounter Balance is $148.56
127:          */
128:         $this->spinWait(function () use ($encounterView) {
129:             $encounterView->ledger->table->assertCanSee("Today");
130:             $encounterView->ledger->table->assertCanSee("99212");
131:             $encounterView->ledger->table->assertCanSee("$148.56");
132:             $encounterView->ledger->table->assertCanSee("Next Payer: PRIMARY INS.:1ST MEDICAL NETWORK");
133:             $encounterView->ledger->table->filter(
134:                 $encounterView->ledger->table->selectors->totalEncounterCharges
135:             )->assertCanSee("$148.56");
136:             $encounterView->ledger->table->filter(
137:                 $encounterView->ledger->table->selectors->totalEncounterBalance
138:             )->assertCanSee("$148.56");
139:             return true;
140:         });
141: 
142:         // remove all cpts
143:         $encounterView->procedures->removeAll();
144: 
145:         /**
146:          * Expected outcome:
147:          * a. The charge for 99212 is removed from the ledger.
148:          */
149:         $this->spinWait(function () use ($encounterView) {
150:             $encounterView->ledger->table->assertCanNotSee("Today");
151:             $encounterView->ledger->table->assertCanNotSee("99212");
152:             $encounterView->ledger->table->assertCanNotSee("$148.56");
153:             $encounterView->ledger->table->assertCanNotSee("Next Payer: PRIMARY INS.:1ST MEDICAL NETWORK");
154:             return true;
155:         });
156: 
157:         // cancel the encounter to clean up
158:         $encounterView->cancel();
159: 
160:         $this->assertNoErrorPopups();
161:     }
162: 
163:     /**
164:      * Summary:
165:      * When a payment is applied to a charge in an encounter that exceeds the
166:      * charged amount the ledger reflects a credit balance. Self pay patient.
167:      */
168:     public function testCashOverPaymentForSelfPayPatient()
169:     {
170:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
171: 
172:         // Open Patient Record for Selenium Self Pay (QAA81) > Encounters section.
173:         $encounterView = $app->patients->get(Patients::SELENIUM_SELF_PAY)
174:             ->encounters
175:             ->navigate()
176:             ->addEncounter();
177: 
178:         // Make sure that the Date of Service, Place of Service, and Location
179:         // fields are not empty.
180:         $encounterView->setDateOfService(date("m/d/Y", time()))
181:             ->select("enc_spl_id", "9") // OFFICE (11)
182:             ->select("enc_loc_id", "401") // Gerhard Hospital
183:             ->select("enc_cfs_id", "173") // FEE SCHEDULE
184:             ->tab();
185: 
186:         $this->waitForAjax();
187: 
188:         // In the procedures Quick Submit boxes enter 99212
189:         // Click Submit.
190:         $encounterView->procedures->fillQuickSubmit("99212", 1)
191:             ->submitQuickSubmit();
192:         $encounterView->procedures->grid->waitForRowCount(1);
193: 
194:         $ledger = $encounterView->ledger;
195: 
196:         // Click the + Payment / Adjustment button
197:         $ledger->addPaymentAdjustment();
198: 
199:         // Set Payment Date to Today
200:         $encounterView->popups->addPayment->press("Today");
201: 
202:         // Set Billing Code to CASH PAYMENT (1)
203:         $encounterView->popups->addPayment->select("epay_bil_id", "1");
204: 
205:         // Set Apply To CPT Code / Charge to 99212
206:         $options = $encounterView->popups->addPayment->querySelectorAll('[name="led_apply_to_ecp_id"] > option');
207:         $value = $options[1]->attribute("value");
208:         $encounterView->popups->addPayment->select("led_apply_to_ecp_id", $value);
209: 
210:         // Enter $300 for amount
211:         $encounterView->popups->addPayment->setInput("epay_amount", "300.00");
212: 
213:         // Click Submit
214:         $app->popup->last()->press("Submit");
215: 
216:         $this->waitForAjax();
217: 
218:         /**
219:          * Expected outcome:
220:          * a. A patient payment for $(300.00) is applied to 99212
221:          * b. The CPT Code / Charge subtotal is $(148.17)
222:          * c. The CPT Code / Charge Next Payer is PATIENT
223:          * d. Total Encounter Charges is $151.83
224:          * e. Total Encounter Balance is $(148.17)
225:          */
226:         $this->spinWait(function () use ($ledger) {
227:             $payment = $ledger->table->filter(".payment");
228:             $payment->assertCanSee("CASH PAYMENT -");
229:             $payment->assertCanSee("PATIENT");
230:             $payment->assertCanSee("$(300.00)");
231:             $payment->assertCanSee("99212");
232: 
233:             $subtotal = $ledger->table->filter(".subtotal");
234:             $subtotal->assertCanSee("$(148.17)");
235:             $subtotal->assertCanSee("Next Payer: CREDIT");
236: 
237:             $ledger->table->filter(
238:                 $ledger->table->selectors->totalEncounterCharges
239:             )->assertCanSee("$151.83");
240:             $ledger->table->filter(
241:                 $ledger->table->selectors->totalEncounterBalance
242:             )->assertCanSee("$(148.17)");
243:             return true;
244:         });
245: 
246:         $this->assertNoErrorPopups();
247:     }
248: 
249:     /**
250:      * Summary:
251:      * When a payment is applied to a charge in an encounter that is below the
252:      * charged amount the ledger reflects a debit balance. Self pay patient.
253:      */
254:     public function testCashUnderPaymentForSelfPayPatient()
255:     {
256:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
257: 
258:         // Open Patient Record for Selenium Self Pay (QAA81) > Encounters section.
259:         $encounterView = $app->patients->get(Patients::SELENIUM_SELF_PAY)
260:             ->encounters
261:             ->navigate()
262:             ->addEncounter();
263: 
264:         // Make sure that the Date of Service, Place of Service, and Location
265:         // fields are not empty.
266:         $encounterView->setDateOfService(date("m/d/Y", time()))
267:             ->select("enc_spl_id", "9") // OFFICE (11)
268:             ->select("enc_loc_id", "401") // Gerhard Hospital
269:             ->select("enc_cfs_id", "173") // FEE SCHEDULE
270:             ->tab();
271: 
272:         $this->waitForAjax();
273: 
274:         // In the procedures Quick Submit boxes enter 99212
275:         // Click Submit.
276:         $encounterView->procedures->fillQuickSubmit("99212", 1)
277:             ->submitQuickSubmit();
278:         $encounterView->procedures->grid->waitForRowCount(1);
279: 
280:         $ledger = $encounterView->ledger;
281: 
282:         // Click the + Payment / Adjustment button
283:         $ledger->addPaymentAdjustment();
284: 
285:         // Set Payment Date to Today
286:         $encounterView->popups->addPayment->press("Today");
287: 
288:         // Set Billing Code to CASH PAYMENT (1)
289:         $encounterView->popups->addPayment->select("epay_bil_id", "1");
290: 
291:         // Set Apply To CPT Code / Charge to 99212
292:         $options = $encounterView->popups->addPayment->querySelectorAll('[name="led_apply_to_ecp_id"] > option');
293:         $value = $options[1]->attribute("value");
294:         $encounterView->popups->addPayment->select("led_apply_to_ecp_id", $value);
295: 
296:         // Enter $50.00 for amount
297:         $encounterView->popups->addPayment->setInput("epay_amount", "50.00");
298: 
299:         // Click Submit
300:         $app->popup->last()->press("Submit");
301: 
302:         $this->waitForAjax();
303: 
304:         /**
305:          * Expected outcome:
306:          * a. A patient payment for $(50.00) is applied to 99212
307:          * b. The CPT Code / Charge subtotal is $101.83
308:          * c. The CPT Code / Charge Next Payer is PATIENT
309:          * d. Total Encounter Charges is $151.83
310:          * e. Total Encounter Balance is $101.83
311:          */
312:         $this->spinWait(function () use ($ledger) {
313:             $payment = $ledger->table->filter(".payment");
314:             $payment->assertCanSee("CASH PAYMENT -");
315:             $payment->assertCanSee("PATIENT");
316:             $payment->assertCanSee("$(50.00)");
317:             $payment->assertCanSee("99212");
318: 
319:             $subtotal = $ledger->table->filter(".subtotal");
320:             $subtotal->assertCanSee("$101.83");
321:             $subtotal->assertCanSee("Next Payer: PATIENT");
322: 
323:             $ledger->table->filter(
324:                 $ledger->table->selectors->totalEncounterCharges
325:             )->assertCanSee("$151.83");
326:             $ledger->table->filter(
327:                 $ledger->table->selectors->totalEncounterBalance
328:             )->assertCanSee("$101.83");
329:          return true;
330:         });
331: 
332:         $this->assertNoErrorPopups();
333:     }
334: 
335:     /**
336:      * Summary:
337:      * When a payment is applied to a charge in an encounter that is equal to the
338:      * charged amount the ledger reflects a zero balance. Self pay patient.
339:      */
340:     public function testCashExactPaymentForSelfPayPatient()
341:     {
342:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
343: 
344:         // Open Patient Record for Selenium Self Pay (QAA81) > Encounters section.
345:         $encounterView = $app->patients->get(Patients::SELENIUM_SELF_PAY)
346:             ->encounters
347:             ->navigate()
348:             ->addEncounter();
349: 
350:         // Make sure that the Date of Service, Place of Service, and Location
351:         // fields are not empty.
352:         $encounterView->setDateOfService(date("m/d/Y", time()))
353:             ->select("enc_spl_id", "9") // OFFICE (11)
354:             ->select("enc_loc_id", "401") // Gerhard Hospital
355:             ->select("enc_cfs_id", "173") // FEE SCHEDULE
356:             ->tab();
357: 
358:         $this->waitForAjax();
359: 
360:         // In the procedures Quick Submit boxes enter 99212
361:         // Click Submit.
362:         $encounterView->procedures->fillQuickSubmit("99212", 1)
363:             ->submitQuickSubmit();
364:         $encounterView->procedures->grid->waitForRowCount(1);
365: 
366:         $ledger = $encounterView->ledger;
367: 
368:         // Click the + Payment / Adjustment button
369:         $ledger->addPaymentAdjustment();
370: 
371:         // Set Payment Date to Today
372:         $encounterView->popups->addPayment->press("Today");
373: 
374:         // Set Billing Code to CASH PAYMENT (1)
375:         $encounterView->popups->addPayment->select("epay_bil_id", "1");
376: 
377:         // Set Apply To CPT Code / Charge to 99212
378:         $options = $encounterView->popups->addPayment->querySelectorAll('[name="led_apply_to_ecp_id"] > option');
379:         $value = $options[1]->attribute("value");
380:         $encounterView->popups->addPayment->select("led_apply_to_ecp_id", $value);
381: 
382:         // Enter $151.83 for amount
383:         $encounterView->popups->addPayment->setInput("epay_amount", "151.83");
384: 
385:         // Click Submit
386:         $app->popup->last()->press("Submit");
387: 
388:         $this->waitForAjax();
389: 
390:         /**
391:          * Expected outcome:
392:          * a. A patient payment for $(151.83) is applied to 99212
393:          * b. The CPT Code / Charge subtotal is $101.83
394:          * c. The CPT Code / Charge Next Payer is PATIENT
395:          * d. Total Encounter Charges is $151.83
396:          * e. Total Encounter Balance is $101.83
397:          */
398:         $this->spinWait(function () use ($ledger) {
399:             $payment = $ledger->table->filter(".payment");
400:             $payment->assertCanSee("CASH PAYMENT -");
401:             $payment->assertCanSee("PATIENT");
402:             $payment->assertCanSee("$(151.83)");
403:             $payment->assertCanSee("99212");
404: 
405:             $subtotal = $ledger->table->filter(".subtotal");
406:             $subtotal->assertCanSee("$0.00");
407:             $subtotal->assertCanSee("Next Payer: -");
408: 
409:             $ledger->table->filter(
410:                 $ledger->table->selectors->totalEncounterCharges
411:             )->assertCanSee("$151.83");
412:             $ledger->table->filter(
413:                 $ledger->table->selectors->totalEncounterBalance
414:             )->assertCanSee("$0.00");
415:          return true;
416:         });
417: 
418:         $this->assertNoErrorPopups();
419:     }
420: 
421:     /**
422:      * Summary:
423:      * When a payment is applied to a charge in an encounter it can be
424:      * removed (voided).
425:      */
426:     public function testCanRemovePatientPayment()
427:     {
428:         $app = $this->login(Users::FELIX_MILLER, Users::PASSWORD);
429: 
430:         // Open Patient Record for Selenium Self Pay (QAA81) > Encounters section.
431:         $encounterView = $app->patients->get(Patients::SELENIUM_SELF_PAY)
432:             ->encounters
433:             ->navigate()
434:             ->addEncounter();
435: 
436:         // Make sure that the Date of Service, Place of Service, and Location
437:         // fields are not empty.
438:         $encounterView->setDateOfService(date("m/d/Y", time()))
439:             ->select("enc_spl_id", "9") // OFFICE (11)
440:             ->select("enc_loc_id", "401") // Gerhard Hospital
441:             ->select("enc_cfs_id", "173") // FEE SCHEDULE
442:             ->tab();
443: 
444:         $this->waitForAjax();
445: 
446:         // In the procedures Quick Submit boxes enter 99212
447:         // Click Submit.
448:         $encounterView->procedures->fillQuickSubmit("99212", 1)
449:             ->submitQuickSubmit();
450:         $encounterView->procedures->grid->waitForRowCount(1);
451: 
452:         $ledger = $encounterView->ledger;
453: 
454:         // Click the + Payment / Adjustment button
455:         $ledger->addPaymentAdjustment();
456: 
457:         // Set Payment Date to Today
458:         $encounterView->popups->addPayment->press("Today");
459: 
460:         // Set Billing Code to CASH PAYMENT (1)
461:         $encounterView->popups->addPayment->select("epay_bil_id", "1");
462: 
463:         // Set Apply To CPT Code / Charge to 99212
464:         $options = $encounterView->popups->addPayment->querySelectorAll('[name="led_apply_to_ecp_id"] > option');
465:         $value = $options[1]->attribute("value");
466:         $encounterView->popups->addPayment->select("led_apply_to_ecp_id", $value);
467: 
468:         // Enter $151.83 for amount
469:         $encounterView->popups->addPayment->setInput("epay_amount", "151.83");
470: 
471:         // Click Submit
472:         $app->popup->last()->press("Submit");
473: 
474:         $this->waitForAjax();
475: 
476:         // For the Cash Payment, click the "Remove" link
477:         $ledger->table->filter(".payment")->click("Remove");
478: 
479:         // Fill in a reason
480:         $app->popup->last()->setInput("void_reason", "Cancel payment.");
481: 
482:         // Click Submit
483:         $app->popup->last()->press("Submit");
484: 
485:         /**
486:          * Expected outcome:
487:          * a. The patient payment for $(151.83) is removed.
488:          * b. The CPT Code / Charge subtotal is $151.83
489:          * c. The CPT Code / Charge Next Payer is PATIENT
490:          * d. Total Encounter Charges is $151.83
491:          * e. Total Encounter Balance is $151.83
492:          */
493:         $this->spinWait(function () use ($ledger) {
494:             $ledger->table->assertCanNotSee("CASH PAYMENT -");
495:             $ledger->table->assertCanNotSee("$(151.83)");
496: 
497:             $subtotal = $ledger->table->filter(".subtotal");
498:             $subtotal->assertCanSee("$151.83");
499:             $subtotal->assertCanSee("Next Payer: PATIENT");
500: 
501:             $ledger->table->filter(
502:                 $ledger->table->selectors->totalEncounterCharges
503:             )->assertCanSee("$151.83");
504:             $ledger->table->filter(
505:                 $ledger->table->selectors->totalEncounterBalance
506:             )->assertCanSee("$151.83");
507:         return true;
508:         });
509: 
510:         $this->assertNoErrorPopups();
511:     }
512: }
513: 
514: ?>
API documentation generated by ApiGen