Summary Table

Categories Total Count
PII 0
URL 0
DNS 0
EKL 0
IP 0
PORT 0
VsID 0
CF 0
AI 0
VPD 0
PL 0
Other 0

File Content

package automation.Pages;

import java.util.List;

import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;

import automation.ExplorerSuite;
import automation.SharedCodeClass;

public class EDI_PDI_Professional_DetailView extends ExplorerSuite {

// private String pdiNumber = "200617203000606";
// private String pdiNumber = "200617203000825";
private String pdiNumber = "100000000001800";

public void localRunner() throws Exception {
System.out.println("Inside of EDI_PDI_Professional_DetailView.localRunner()!");

goToEdiWebViewerPage();
retrieveProfessionalInformation();
goToDetailView();

verifySectionHeadersPresent();

verifyBillingInformation();
verifyPatientInformation();
verifyVendorInformation();
verifyMiscellaneousBillingInformation();
verifyClaimLevelAmbulanceInformation();
verifyServiceLevelAmbulanceInformation();
verifyServiceLines();
verifyOtherHealthInsuranceClaimAdjustments();
verifyMedicareOutpatientAdjudication();
verifyOhiServiceLineAdjustments();

verifyRenderingNameNpiTaxonomyInformationInServiceLines();

verifyPatientInformationSectionCanBeExpandedAndCollapsed();
verifyVendorInformationSectionCanBeExpandedAndCollapsed();
verifyClaimLevelAmbulanceInformationSectionCanBeExpandedAndCollapsed();
verifyServiceLevelAmbulanceInformationSectionCanBeExpandedAndCollapsed();
verifyBillingMiscellaneousSectionCanBeExpandedAndCollapsed();
verifyBillingInformationSectionCanBeExpandedAndCollapsed();
verifyServiceLinesSectionCanBeExpandedAndCollapsed();
verifyOhiClaimAdjustmentsSectionCanBeExpandedAndCollapsed();
verifyOhiServiceLineAdjustmentsSectionCanBeExpandedAndCollapsed();
}

public void goToEdiWebViewerPage() throws Exception {
SharedCodeClass.clickById("NAV_ewvSearch_appNav_1");
Thread.sleep(4000);

SharedCodeClass.findElementId("HDG_ediWebViewer_ewvSearch_1");
SharedCodeClass.findElementId("IPT_pdiSearchNumber_ewvSearch_1");
SharedCodeClass.findElementId("BTN_pdiSearchRetrieve_ewvSearch_1");
SharedCodeClass.findElementId("BTN_pdiClear_ewvSearch_1");
}

public void retrieveProfessionalInformation() throws Exception {
SharedCodeClass.fillAllElementById("IPT_pdiSearchNumber_ewvSearch_1", pdiNumber);
Thread.sleep(1000);
SharedCodeClass.clickById("BTN_pdiSearchRetrieve_ewvSearch_1");

Thread.sleep(8000);

// SharedCodeClass.findElementId("DIV_ediWebViewer_ewv_1");
// WebElement webElement = driver.findElement(By.id("DIV_ediWebViewer_ewv_1"));
// Assert.assertEquals("EDI Web Viewer / " + pdiNumber, webElement.getText());

SharedCodeClass.findElementId("HDG_ediWebViewer_ewv_1");
WebElement webElement = driver.findElement(By.id("HDG_ediWebViewer_ewv_1"));
Assert.assertEquals("EDI Web Viewer | " + pdiNumber, webElement.getText());
}

public void goToDetailView() throws Exception {
SharedCodeClass.findElementId("LBL_detailTab_ewvMaster_1");
WebElement webElement = driver.findElement(By.id("LBL_detailTab_ewvMaster_1"));
Assert.assertEquals("Detail View", webElement.getText());

SharedCodeClass.findElementId("TAB_detailTab_ewvMaster_1");
SharedCodeClass.clickById("TAB_detailTab_ewvMaster_1");
Thread.sleep(9000);
}

public void verifySectionHeadersPresent() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

// WebElement webElement = detailViewElement.findElement(By.id("LBL_title_patientInfo_1"));
WebElement webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_patientInfo_profDetail_1']"));
Assert.assertEquals("Patient Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_vendorInformation_vendorInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_vendorInfo_profDetail_1']"));
Assert.assertEquals("Vendor Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_claimLvlAmbulanceInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_claimLvlAmbulance_profDetail_1']"));
Assert.assertEquals("Claim-Level Ambulance Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_serviceLvlAmbulanceInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_serviceLvlAmbulance_profDetail_1']"));
Assert.assertEquals("Service-Level Ambulance Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_billingMiscellaneous_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_billingMiscellaneous_profDetail_1']"));
Assert.assertEquals("Billing Miscellaneous", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_billingInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_billingInfo_profDetail_1']"));
Assert.assertEquals("Billing Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_serviceLinesLabel_serviceLines_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_serviceLine_profDetail_1']"));
Assert.assertEquals("Service Lines", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_ohiClaimAdjustments_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_claimAdjustments_profDetail_1']"));
Assert.assertEquals("OHI Claim Adjustments", webElement.getText());

webElement = detailViewElement.findElement(By.id("LBL_title_ohiLineAdjustment_1"));
Assert.assertEquals("OHI Service Line Adjustments", webElement.getText());
}

public void verifyPatientInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
// WebElement detailViewElement = driver.findElement(By.cssSelector("app-patient-info[ng-reflect-accordion-id='ACC_patientInfo_profDetail_1']"));

WebElement webElement = detailViewElement.findElement(By.id("LBL_title_patientInfo_1"));
Assert.assertEquals("Patient Information", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_patientId_patientInfo_1"));
Assert.assertEquals("Patient ID:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_patientId_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_lastName_patientInfo_1"));
Assert.assertEquals("Last Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_lastName_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_firstName_patientInfo_1"));
Assert.assertEquals("First Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_firstName_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_dateOfBirth_patientInfo_1"));
Assert.assertEquals("Date of Birth:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_dateOfBirth_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_gender_patientInfo_1"));
Assert.assertEquals("Gender:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_gender_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_dateOfDeath_patientInfo_1"));
Assert.assertEquals("Date of Death:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_dateOfDeath_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_addressOne_patientInfo_1"));
Assert.assertEquals("Address 1:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_addressOne_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_addressTwo_patientInfo_1"));
Assert.assertEquals("Address 2:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_addressTwo_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() == 0);

webElement = detailViewElement.findElement(By.id("TH_city_patientInfo_1"));
Assert.assertEquals("City:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_city_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_state_patientInfo_1"));
Assert.assertEquals("State:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_state_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_zipCode_patientInfo_1"));
Assert.assertEquals("ZIP Code:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_zipCode_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_country_patientInfo_1"));
Assert.assertEquals("Country:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_country_patientInfo_1"));
Assert.assertTrue(webElement.getText().length() > 0);
}

public void verifyBillingInformation() throws Exception {
// WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement detailViewElement =
driver.findElement(By.cssSelector("app-billing-info[ng-reflect-accordion-id='ACC_billingInfo_profDetail_1']"));
WebElement accordianContentWebElement = detailViewElement.findElement(By.className("accordion-content"));
List <WebElement> xTypeWebElementsList = accordianContentWebElement.findElements(By.className("x-type"));
List <WebElement> xCodesWebElementsList = accordianContentWebElement.findElements(By.className("x-codes"));

// WebElement webElement = detailViewElement.findElement(By.id("LBL_title_billingInfo_1"));
WebElement webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_billingInfo_profDetail_1']"));
Assert.assertEquals("Billing Information", webElement.getText());

WebElement h5_webElement = detailViewElement.findElement(By.cssSelector("h5"));
// webElement = detailViewElement.findElement(By.id("SPN_pos_billingInfo_1"));
webElement = h5_webElement.findElement(By.cssSelector("span"));
Assert.assertEquals("POS: ", webElement.getText().substring(0, 5));
// Assert.assertEquals("POS: 11", webElement.getText());

WebElement h5_divWebElement = h5_webElement.findElement(By.cssSelector("div"));
// webElement = detailViewElement.findElement(By.id("SPN_frequency_billingInfo_1"));
webElement = h5_divWebElement.findElement(By.cssSelector("a"));
Assert.assertEquals("Frequency: ", webElement.getText().substring(0, 11));
// Assert.assertEquals("Frequency: 1", webElement.getText());

// This specific Professional PDI only has DX information. So, we can only test for DX. E and PX cannot be tested.

WebElement diagnosisCodesDivX_TypeWebElement = xTypeWebElementsList.get(0);
Assert.assertEquals("DX:", diagnosisCodesDivX_TypeWebElement.getText());

WebElement diagnosisCodesDivX_CodesWebElement = xCodesWebElementsList.get(0);
List<WebElement> diagnosisCodesDivDataWebElementsList = diagnosisCodesDivX_CodesWebElement.findElements(By.cssSelector("div"));
Assert.assertEquals("1: ", diagnosisCodesDivDataWebElementsList.get(0).getText().substring(0, 3));
// Assert.assertEquals("1: F411", webElement.getText());

// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_2"));
// Assert.assertEquals("2: J449", webElement.getText());
//
// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_3"));
// Assert.assertEquals("3: M5137", webElement.getText());
//
// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_4"));
// Assert.assertEquals("4: M545", webElement.getText());
//
// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_5"));
// Assert.assertEquals("5: E213", webElement.getText());
//
// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_6"));
// Assert.assertEquals("6: E559", webElement.getText());
//
// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_7"));
// Assert.assertEquals("7: F411", webElement.getText());
//
// webElement = dxDivWebElement.findElement(By.id("DIV_dxData_billingInfo_8"));
// Assert.assertEquals("8: F17200", webElement.getText());
}

public void verifyVendorInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement appVendorInfoElement = detailViewElement.findElement(By.cssSelector("app-vendor-info"));

WebElement webElement = appVendorInfoElement.findElement(By.cssSelector("label[for='ACC_vendorInfo_profDetail_1']"));
Assert.assertEquals("Vendor Information", webElement.getText());

// Make sure that Service Location Information is being shown.

List <WebElement> h4ElementsList = appVendorInfoElement.findElements(By.cssSelector("h4"));
webElement = h4ElementsList.get(0);
Assert.assertEquals("Service Location Information", webElement.getText());

WebElement tableElement = appVendorInfoElement.findElement(By.id("TBL_infoColumn_vendorInfo_1"));
List<WebElement> tableElementsRowsList = tableElement.findElements(By.cssSelector("tr"));
Assert.assertEquals("Incorrect number of rows for the Service Location Information table!", 9, tableElementsRowsList.size());

webElement = tableElementsRowsList.get(0).findElement(By.cssSelector("th"));
Assert.assertEquals("Tax ID:", webElement.getText());

webElement = tableElementsRowsList.get(0).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(1).findElement(By.cssSelector("th"));
Assert.assertEquals("Vendor:", webElement.getText());

webElement = tableElementsRowsList.get(1).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(2).findElement(By.cssSelector("th"));
Assert.assertEquals("Address 1:", webElement.getText());

webElement = tableElementsRowsList.get(2).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(3).findElement(By.cssSelector("th"));
Assert.assertEquals("Address 2:", webElement.getText());

webElement = tableElementsRowsList.get(3).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(4).findElement(By.cssSelector("th"));
Assert.assertEquals("City:", webElement.getText());

webElement = tableElementsRowsList.get(4).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(5).findElement(By.cssSelector("th"));
Assert.assertEquals("State:", webElement.getText());

webElement = tableElementsRowsList.get(5).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(6).findElement(By.cssSelector("th"));
Assert.assertEquals("ZIP Code:", webElement.getText());

webElement = tableElementsRowsList.get(6).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(7).findElement(By.cssSelector("th"));
Assert.assertEquals("Country:", webElement.getText());

webElement = tableElementsRowsList.get(7).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(8).findElement(By.cssSelector("th"));
Assert.assertEquals("NPI:", webElement.getText());

webElement = tableElementsRowsList.get(8).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// Make sure that Billing Provider Information is being shown.

webElement = h4ElementsList.get(1);
Assert.assertEquals("Billing Provider Information", webElement.getText());

tableElement = appVendorInfoElement.findElement(By.id("TBL_infoColumn_vendorInfo_2"));
tableElementsRowsList = tableElement.findElements(By.cssSelector("tr"));
Assert.assertEquals("Incorrect number of rows for the Billing Provider Information table!", 10, tableElementsRowsList.size());

webElement = tableElementsRowsList.get(0).findElement(By.cssSelector("th"));
Assert.assertEquals("Tax ID:", webElement.getText());

webElement = tableElementsRowsList.get(0).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(1).findElement(By.cssSelector("th"));
Assert.assertEquals("Vendor:", webElement.getText());

webElement = tableElementsRowsList.get(1).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(2).findElement(By.cssSelector("th"));
Assert.assertEquals("Address 1:", webElement.getText());

webElement = tableElementsRowsList.get(2).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(3).findElement(By.cssSelector("th"));
Assert.assertEquals("Address 2:", webElement.getText());

webElement = tableElementsRowsList.get(3).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(4).findElement(By.cssSelector("th"));
Assert.assertEquals("City:", webElement.getText());

webElement = tableElementsRowsList.get(4).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(5).findElement(By.cssSelector("th"));
Assert.assertEquals("State:", webElement.getText());

webElement = tableElementsRowsList.get(5).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(6).findElement(By.cssSelector("th"));
Assert.assertEquals("ZIP Code:", webElement.getText());

webElement = tableElementsRowsList.get(6).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(7).findElement(By.cssSelector("th"));
Assert.assertEquals("Country:", webElement.getText());

webElement = tableElementsRowsList.get(7).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(8).findElement(By.cssSelector("th"));
Assert.assertEquals("NPI:", webElement.getText());

webElement = tableElementsRowsList.get(8).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableElementsRowsList.get(9).findElement(By.cssSelector("th"));
Assert.assertEquals("Taxonomy Code:", webElement.getText());

webElement = tableElementsRowsList.get(9).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);
}

public void verifyMiscellaneousBillingInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

// WebElement webElement = detailViewElement.findElement(By.id("LBL_title_billingMiscellaneous_1"));
WebElement webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_billingMiscellaneous_profDetail_1']"));
Assert.assertEquals("Billing Miscellaneous", webElement.getText());

WebElement tableElement = detailViewElement.findElement(By.id("TBL_info_billingMiscellaneous_1"));
List<WebElement> tableRowElementsList = tableElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("First Column of Billing Miscellaneous should have rows!", tableRowElementsList.isEmpty());
Assert.assertEquals("First Column of Billing Miscellaneous has incorrect number of rows!", 8, tableRowElementsList.size());

// webElement = detailViewElement.findElement(By.id("TH_patientAccountNumber_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(0).findElement(By.cssSelector("th"));
Assert.assertEquals("Patient Account #:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_patientAccountNumber_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(0).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_placeOfService_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(1).findElement(By.cssSelector("th"));
// Assert.assertEquals("Place of Service:", webElement.getText());
Assert.assertEquals("POS/Frequency:", webElement.getText());
// Assert.assertEquals("TOB/Frequency:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_placeOfService_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(1).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_frequency_billingMiscellaneous_1"));
// Assert.assertEquals("Frequency:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_frequency_billingMiscellaneous_1"));
// Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_statementFromTo_billingMiscellaneous_1"));
// webElement = tableRowElementsList.get(2).findElement(By.cssSelector("th"));
// Assert.assertEquals("Statement From/To:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_statementFromTo_billingMiscellaneous_1"));
// webElement = tableRowElementsList.get(2).findElement(By.cssSelector("td"));
// Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_previousPdiClaimId_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(2).findElement(By.cssSelector("th"));
Assert.assertEquals("Previous PDI/Claim ID:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_previousPdiClaimId_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(2).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_admissionType_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(3).findElement(By.cssSelector("th"));
Assert.assertEquals("Admission Type:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_admissionType_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(3).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_admissionSource_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(4).findElement(By.cssSelector("th"));
Assert.assertEquals("Admission Source:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_admissionSource_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(4).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_admissionDateOrHour_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(5).findElement(By.cssSelector("th"));
Assert.assertEquals("Date/Hour:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_admissionDateOrHour_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(5).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_accidentDate_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(6).findElement(By.cssSelector("th"));
Assert.assertEquals("Accident Date:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_accidentDate_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(6).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_accidentIndicator_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(7).findElement(By.cssSelector("th"));
Assert.assertEquals("Accident Ind:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_accidentIndicator_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(7).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

tableElement = detailViewElement.findElement(By.id("TBL_info_billingMiscellaneous_2"));
tableRowElementsList = tableElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("Second Column of Billing Miscellaneous should have rows!", tableRowElementsList.isEmpty());
Assert.assertEquals("Second Column of Billing Miscellaneous has incorrect number of rows!", 8, tableRowElementsList.size());

// webElement = detailViewElement.findElement(By.id("TH_patientPaidAmount_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(0).findElement(By.cssSelector("th"));
Assert.assertEquals("Patient Paid Amt:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_patientPaidAmount_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(0).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_patientSignature_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(1).findElement(By.cssSelector("th"));
Assert.assertEquals("Patient Signature:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_patientSignature_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(1).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_patientStatus_billingMiscellaneous_1"));
// webElement = tableRowElementsList.get(2).findElement(By.cssSelector("th"));
// Assert.assertEquals("Patient Status:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_patientStatus_billingMiscellaneous_1"));
// webElement = tableRowElementsList.get(2).findElement(By.cssSelector("td"));
// Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_priorAuthorization_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(2).findElement(By.cssSelector("th"));
Assert.assertEquals("Prior Authorization:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_priorAuthorization_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(2).findElement(By.cssSelector("th"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_referralNumber_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(3).findElement(By.cssSelector("th"));
Assert.assertEquals("Referral Number:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_referralNumber_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(3).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_providerAcceptsAssignment_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(4).findElement(By.cssSelector("th"));
Assert.assertEquals("Provider Accept Asmt:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_providerAcceptsAssignment_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(4).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_assignmentOfBenefits_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(5).findElement(By.cssSelector("th"));
Assert.assertEquals("Assignment of Benefits:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_assignmentOfBenefits_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(5).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("TH_dischargeDateHour_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(6).findElement(By.cssSelector("th"));
Assert.assertEquals("Discharge Date/Hour:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_dischargeDateHour_billingMiscellaneous_1"));
webElement = tableRowElementsList.get(6).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableRowElementsList.get(7).findElement(By.cssSelector("th"));
Assert.assertEquals("Medicare Int. Ctrl. Num:", webElement.getText());

webElement = tableRowElementsList.get(7).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

tableElement = detailViewElement.findElement(By.id("TBL_info_billingMiscellaneous_3"));
tableRowElementsList = tableElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("Third Column of Billing Miscellaneous should have rows!", tableRowElementsList.isEmpty());
Assert.assertEquals("Third Column of Billing Miscellaneous has incorrect number of rows!", 6, tableRowElementsList.size());

webElement = tableRowElementsList.get(0).findElement(By.cssSelector("th"));
Assert.assertEquals("Rendering Prov. Name:", webElement.getText());

webElement = tableRowElementsList.get(0).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableRowElementsList.get(1).findElement(By.cssSelector("th"));
Assert.assertEquals("NPI:", webElement.getText());

webElement = tableRowElementsList.get(1).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableRowElementsList.get(2).findElement(By.cssSelector("th"));
Assert.assertEquals("Taxonomy Code:", webElement.getText());

webElement = tableRowElementsList.get(2).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableRowElementsList.get(3).findElement(By.cssSelector("th"));
Assert.assertEquals("DME Procedure:", webElement.getText());

webElement = tableRowElementsList.get(3).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableRowElementsList.get(4).findElement(By.cssSelector("th"));
Assert.assertEquals("DME Modifier:", webElement.getText());

webElement = tableRowElementsList.get(4).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);

webElement = tableRowElementsList.get(5).findElement(By.cssSelector("th"));
Assert.assertEquals("DME Frequency:", webElement.getText());

webElement = tableRowElementsList.get(5).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().length() > 0);
}

public void verifyServiceLines() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

// WebElement webElement = detailViewElement.findElement(By.id("LBL_serviceLinesLabel_serviceLines_1"));
WebElement webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_serviceLine_profDetail_1']"));
Assert.assertEquals("Service Lines", webElement.getText());

WebElement serviceLinesDivWebElement = webElement.findElement(By.xpath(".."));

// webElement = detailViewElement.findElement(By.id("CMP_appTable_serviceLines_1"));
// WebElement serviceLinesTable = webElement.findElement(By.id("TBL_theTable_table_1"));
WebElement serviceLinesTable = detailViewElement.findElement(By.id("TBL_tableInfo_serviceLines_1"));

WebElement serviceLinesTableHeader = serviceLinesTable.findElement(By.tagName("thead"));
List<WebElement> serviceLinesTableColumnsList = serviceLinesTableHeader.findElements(By.tagName("th"));
Assert.assertTrue("No Service Lines Column Headers found!", serviceLinesTableColumnsList.size() > 0);
Assert.assertEquals("Service Lines Table must have 11 columns!", 11, serviceLinesTableColumnsList.size());

// Check for the correct column names.
for (int i = 0; i < serviceLinesTableColumnsList.size(); i++) {
WebElement tableColumnHeader = serviceLinesTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Line #";
} else if (i == 1) {
correctColumnName = "Service From";
} else if (i == 2) {
correctColumnName = "Service To";
} else if (i == 3) {
correctColumnName = "POS";
} else if (i == 4) {
correctColumnName = "DX Pointer";
} else if (i == 5) {
correctColumnName = "PROC/NDC";
} else if (i == 6) {
correctColumnName = "Modifiers";
} else if (i == 7) {
correctColumnName = "Qty. / Type";
} else if (i == 8) {
correctColumnName = "Sales Tax";
} else if (i == 9) {
correctColumnName = "Fac. Tax";
} else if (i == 10) {
correctColumnName = "Amount";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement serviceLinesTableBody = serviceLinesTable.findElement(By.tagName("tbody"));
List<WebElement> serviceLinesTableRowsList = serviceLinesTableBody.findElements(By.tagName("tr"));
Assert.assertTrue("No Service Lines Data Rows found!", serviceLinesTableRowsList.size() > 0);
// Assert.assertEquals("Should only have one Service Line row of data!", 1, serviceLinesTableRowsList.size());

// This specific Professional Claim has one or more rows of Service Lines data.

WebElement firstRowDataElement = serviceLinesTableRowsList.get(0);
List <WebElement> serviceLineRowDataList = firstRowDataElement.findElements(By.tagName("td"));
Assert.assertTrue("No Service Lines Row Column Data found!", serviceLineRowDataList.size() > 0);
Assert.assertEquals("Service Lines Row Column Data must have 11 columns worth of data!", 11, serviceLineRowDataList.size());

// Check for correct data in the first row of the Service Lines.
// for (int i = 0; i < serviceLineRowDataList.size(); i++) {
// WebElement rowColumnDataElement = serviceLineRowDataList.get(i);
// String correctColumnRowData = null;
// if (i == 0) {
// correctColumnRowData = "1";
// } else if (i == 1) {
// correctColumnRowData = "01/23/18";
// } else if (i == 2) {
// correctColumnRowData = "";
// } else if (i == 3) {
// correctColumnRowData = "";
// } else if (i == 4) {
// correctColumnRowData = "1";
// } else if (i == 5) {
// correctColumnRowData = "90837";
// } else if (i == 6) {
// correctColumnRowData = "25";
// } else if (i == 7) {
// correctColumnRowData = "1 UN";
// } else if (i == 8) {
// correctColumnRowData = "";
// } else if (i == 9) {
// correctColumnRowData = "";
// } else if (i == 10) {
// correctColumnRowData = "180.00";
// }
//
// Assert.assertEquals(correctColumnRowData, rowColumnDataElement.getText());
// }

// webElement = detailViewElement.findElement(By.id("DIV_totalClaimCharges_serviceLines_1"));
webElement = serviceLinesDivWebElement.findElement(By.cssSelector("div[class='sum-line']"));
Assert.assertEquals("Total Charges:", webElement.getText().substring(0, 14));
// Assert.assertEquals("Total Charges: $180.00", webElement.getText());
}

public void verifyClaimLevelAmbulanceInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("LBL_title_claimLvlAmbulanceInfo_1"));
Assert.assertEquals("Claim-Level Ambulance Information", webElement.getText());

webElement = detailViewElement.findElement(By.id("HDG_pickupLocation_claimLvlAmbulanceInfo_1"));
Assert.assertEquals("Pick-Up Location", webElement.getText());

WebElement pickupLocationTableElement = detailViewElement.findElement(By.id("TBL_pickupLocation_claimLvlAmbulanceInfo_1"));
List<WebElement> pickupLocationTableColumnsList = pickupLocationTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Pickup Location Column Headers found!", pickupLocationTableColumnsList.size() > 0);
Assert.assertEquals("Pickup Location Table must have 5 columns!", 5, pickupLocationTableColumnsList.size());
for (int i = 0; i < pickupLocationTableColumnsList.size(); i++) {
WebElement tableColumnHeader = pickupLocationTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Address 1:";
} else if (i == 1) {
correctColumnName = "Address 2:";
} else if (i == 2) {
correctColumnName = "City:";
} else if (i == 3) {
correctColumnName = "State:";
} else if (i == 4) {
correctColumnName = "ZIP Code:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

webElement = detailViewElement.findElement(By.id("HDG_dropOffLocation_claimLvlAmbulanceInfo_1"));
Assert.assertEquals("Drop-Off Location", webElement.getText());

WebElement dropOffLocationTableElement = detailViewElement.findElement(By.id("TBL_dropOffLocation_claimLvlAmbulanceInfo_1"));
List<WebElement> dropOffLocationTableColumnsList = dropOffLocationTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Drop-Off Location Column Headers found!", dropOffLocationTableColumnsList.size() > 0);
Assert.assertEquals("Drop-Off Location Table must have 5 columns!", 5, dropOffLocationTableColumnsList.size());
for (int i = 0; i < dropOffLocationTableColumnsList.size(); i++) {
WebElement tableColumnHeader = dropOffLocationTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Address 1:";
} else if (i == 1) {
correctColumnName = "Address 2:";
} else if (i == 2) {
correctColumnName = "City:";
} else if (i == 3) {
correctColumnName = "State:";
} else if (i == 4) {
correctColumnName = "ZIP Code:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement transportTableElement = detailViewElement.findElement(By.id("TBL_transport_claimLvlAmbulanceInfo_1"));
List<WebElement> transportTableColumnsList = transportTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Transport Column Headers found!", transportTableColumnsList.size() > 0);
Assert.assertEquals("Transport Table must have 2 columns!", 2, transportTableColumnsList.size());
for (int i = 0; i < transportTableColumnsList.size(); i++) {
WebElement tableColumnHeader = transportTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Transport Reason Code:";
} else if (i == 1) {
correctColumnName = "Transport Distance Miles:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

transportTableElement = detailViewElement.findElement(By.id("TBL_transport_claimLvlAmbulanceInfo_2"));
transportTableColumnsList = transportTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Transport Column Headers found!", transportTableColumnsList.size() > 0);
Assert.assertEquals("Transport Table must have 2 columns!", 2, transportTableColumnsList.size());
for (int i = 0; i < transportTableColumnsList.size(); i++) {
WebElement tableColumnHeader = transportTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Round Trip Purpose:";
} else if (i == 1) {
correctColumnName = "Stretcher Purpose:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement certificationTableElement = detailViewElement.findElement(By.id("TBL_certification_claimLvlAmbulanceInfo_1"));
List<WebElement> certificationTableColumnsList = certificationTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Certification Column Headers found!", transportTableColumnsList.size() > 0);
for (int i = 0; i < certificationTableColumnsList.size(); i++) {
WebElement tableColumnHeader = certificationTableColumnsList.get(i);
String correctColumnName = "Certification Indicator:";

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement ambulanceConditionCodeTableElement = detailViewElement.findElement(By.id("TBL_ambulanceConditionCode_claimLvlAmbulanceInfo_1"));
List<WebElement> ambulanceConditionCodeTableColumnsList = ambulanceConditionCodeTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Ambulance Condition Code Column Headers found!", ambulanceConditionCodeTableColumnsList.size() > 0);
for (int i = 0; i < ambulanceConditionCodeTableColumnsList.size(); i++) {
WebElement tableColumnHeader = ambulanceConditionCodeTableColumnsList.get(i);
String correctColumnName = "Ambulance Cond. Code:";

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}
}

public void verifyServiceLevelAmbulanceInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("LBL_title_serviceLvlAmbulanceInfo_1"));
Assert.assertEquals("Service-Level Ambulance Information", webElement.getText());

webElement = detailViewElement.findElement(By.id("HDG_lineNumber_serviceLvlAmbulanceInfo_1"));
Assert.assertEquals("Line Number: 1", webElement.getText());

webElement = detailViewElement.findElement(By.id("HDG_pickupLocation_serviceLvlAmbulanceInfo_1"));
Assert.assertEquals("Pick-Up Location", webElement.getText());

WebElement pickupLocationTableElement = detailViewElement.findElement(By.id("TBL_pickupLocation_claimLvlAmbulanceInfo_1"));
List<WebElement> pickupLocationTableColumnsList = pickupLocationTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Pickup Location Column Headers found!", pickupLocationTableColumnsList.size() > 0);
Assert.assertEquals("Pickup Location Table must have 5 columns!", 5, pickupLocationTableColumnsList.size());
for (int i = 0; i < pickupLocationTableColumnsList.size(); i++) {
WebElement tableColumnHeader = pickupLocationTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Address 1:";
} else if (i == 1) {
correctColumnName = "Address 2:";
} else if (i == 2) {
correctColumnName = "City:";
} else if (i == 3) {
correctColumnName = "State:";
} else if (i == 4) {
correctColumnName = "ZIP Code:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

webElement = detailViewElement.findElement(By.id("LBL_dropoffLocation_serviceLvlAmbulanceInfo_1"));
Assert.assertEquals("Drop-Off Location", webElement.getText());

WebElement dropOffLocationTableElement = detailViewElement.findElement(By.id("TBL_dropOffLocation_claimLvlAmbulanceInfo_1"));
List<WebElement> dropOffLocationTableColumnsList = dropOffLocationTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Drop-Off Location Column Headers found!", dropOffLocationTableColumnsList.size() > 0);
Assert.assertEquals("Drop-Off Location Table must have 5 columns!", 5, dropOffLocationTableColumnsList.size());
for (int i = 0; i < dropOffLocationTableColumnsList.size(); i++) {
WebElement tableColumnHeader = dropOffLocationTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Address 1:";
} else if (i == 1) {
correctColumnName = "Address 2:";
} else if (i == 2) {
correctColumnName = "City:";
} else if (i == 3) {
correctColumnName = "State:";
} else if (i == 4) {
correctColumnName = "ZIP Code:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement transportTableElement = detailViewElement.findElement(By.id("TBL_transport_claimLvlAmbulanceInfo_1"));
List<WebElement> transportTableColumnsList = transportTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Transport Column Headers found!", transportTableColumnsList.size() > 0);
Assert.assertEquals("Transport Table must have 2 columns!", 2, transportTableColumnsList.size());
for (int i = 0; i < transportTableColumnsList.size(); i++) {
WebElement tableColumnHeader = transportTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Transport Reason Code:";
} else if (i == 1) {
correctColumnName = "Transport Distance Miles:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

transportTableElement = detailViewElement.findElement(By.id("TBL_transport_claimLvlAmbulanceInfo_2"));
transportTableColumnsList = transportTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Transport Column Headers found!", transportTableColumnsList.size() > 0);
Assert.assertEquals("Transport Table must have 2 columns!", 2, transportTableColumnsList.size());
for (int i = 0; i < transportTableColumnsList.size(); i++) {
WebElement tableColumnHeader = transportTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "Round Trip Purpose:";
} else if (i == 1) {
correctColumnName = "Stretcher Purpose:";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement certificationTableElement = detailViewElement.findElement(By.id("TBL_certification_claimLvlAmbulanceInfo_1"));
List<WebElement> certificationTableColumnsList = certificationTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Certification Column Headers found!", transportTableColumnsList.size() > 0);
for (int i = 0; i < certificationTableColumnsList.size(); i++) {
WebElement tableColumnHeader = certificationTableColumnsList.get(i);
String correctColumnName = "Certification Indicator:";

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement ambulanceConditionCodeTableElement = detailViewElement.findElement(By.id("TBL_ambulanceConditionCode_claimLvlAmbulanceInfo_1"));
List<WebElement> ambulanceConditionCodeTableColumnsList = ambulanceConditionCodeTableElement.findElements(By.tagName("th"));
Assert.assertTrue("No Ambulance Condition Code Column Headers found!", ambulanceConditionCodeTableColumnsList.size() > 0);
for (int i = 0; i < ambulanceConditionCodeTableColumnsList.size(); i++) {
WebElement tableColumnHeader = ambulanceConditionCodeTableColumnsList.get(i);
String correctColumnName = "Ambulance Cond. Code:";

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}
}

public void verifyOtherHealthInsuranceClaimAdjustments() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("LBL_title_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Claim Adjustments", webElement.getText());

// Verify Primary Payer Information

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_ohiPayerId_ohiClaimAdjustments_1"));
Assert.assertEquals("Primary Payer ID:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_ohiPayerId_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("999990171", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_paymentSequenceIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("Payment Seq. Indicator:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_paymentSequenceIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("P", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_fillingIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("Filing Indicator:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_fillingIndicator_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("MC", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_claimAdjustmentDate_ohiClaimAdjustments_1"));
Assert.assertEquals("Claim Adjustment Date:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_claimAdjustmentDate_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("01/01/14", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_ohiPayerName_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Payer Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_ohiPayerName_ohiClaimAdjustments_1"));
// Assert.assertEquals("MEDICAID COLORADO HEALTH", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_ohiGroupName_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Group Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_ohiGroupName_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("MEDICAID COLORADO HEALTH", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_primaryOhiInfo_insuranceType_ohiClaimAdjustments_1"));
Assert.assertEquals("Insurance Type:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_primaryOhiInfo_insuranceType_ohiClaimAdjustments_1"));
Assert.assertEquals("", webElement.getText());

// Verify Primary Payer Table Information

WebElement primaryOhiInfoTableElement = detailViewElement.findElement(By.id("CMP_primaryOhiInfo_table_ohiClaimAdjustments_1"));
WebElement primaryOhiInfoTableHeader = primaryOhiInfoTableElement.findElement(By.tagName("thead"));
List<WebElement> primaryOhiInfoTableColumnsList = primaryOhiInfoTableHeader.findElements(By.tagName("th"));
Assert.assertTrue("No Primary OHI Info Column Headers found!", primaryOhiInfoTableColumnsList.size() > 0);
Assert.assertEquals("Primary OHI Info Table must have 5 columns!", 5, primaryOhiInfoTableColumnsList.size());

for (int i = 0; i < primaryOhiInfoTableColumnsList.size(); i++) {
WebElement tableColumnHeader = primaryOhiInfoTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "OHI Paid Amt.";
} else if (i == 1) {
correctColumnName = "Total Non-Covered";
} else if (i == 2) {
correctColumnName = "Qty.";
} else if (i == 3) {
correctColumnName = "Adj.";
} else if (i == 4) {
correctColumnName = "Adj. Amt.";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement primaryOhiInfoTableBody = primaryOhiInfoTableElement.findElement(By.tagName("tbody"));
List<WebElement> primaryOhiInfoTableRowsList = primaryOhiInfoTableBody.findElements(By.tagName("tr"));
Assert.assertTrue("No Primary OHI Info Data Rows found!", primaryOhiInfoTableRowsList.size() > 0);
// Assert.assertEquals("Should only have one Primary OHI Info Line row of data!", 1, primaryOhiInfoTableRowsList.size());

WebElement primaryOhiInfoFirstRowDataElement = primaryOhiInfoTableRowsList.get(0);
List <WebElement> primaryOhiInfoRowDataList = primaryOhiInfoFirstRowDataElement.findElements(By.tagName("td"));
Assert.assertTrue("No Primary OHI Info Row Column Data found!", primaryOhiInfoRowDataList.size() > 0);
Assert.assertEquals("Primary OHI Info Row Column Data must have 5 columns worth of data!", 5, primaryOhiInfoRowDataList.size());

// Check for correct data in the first and only row of the Primary OHI Info Table.
// for (int i = 0; i < primaryOhiInfoRowDataList.size(); i++) {
// WebElement rowColumnDataElement = primaryOhiInfoRowDataList.get(i);
// String correctColumnRowData = null;
// if (i == 0) {
// correctColumnRowData = "1.00";
// } else if (i == 1) {
// correctColumnRowData = "1.00";
// } else if (i == 2) {
// correctColumnRowData = "01";
// } else if (i == 3) {
// correctColumnRowData = "COA1";
// } else if (i == 4) {
// correctColumnRowData = "100.00";
// }
//
// Assert.assertEquals(correctColumnRowData, rowColumnDataElement.getText());
// }

// Verify Secondary Payer Information

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_ohiPayerId_ohiClaimAdjustments_1"));
Assert.assertEquals("Secondary Payer ID:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_ohiPayerId_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("999990172", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_paymentSequenceIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("Payment Seq. Indicator:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_paymentSequenceIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("S", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_fillingIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("Filing Indicator:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_fillingIndicator_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("MC", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_claimAdjustmentDate_ohiClaimAdjustments_1"));
Assert.assertEquals("Claim Adjustment Date:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_claimAdjustmentDate_ohiClaimAdjustments_1"));
// Assert.assertEquals("", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_ohiPayerName_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Payer Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_ohiPayerName_ohiClaimAdjustments_1"));
// Assert.assertEquals("MEDICAID COLORADO HEALTH", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_ohiGroupName_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Group Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_ohiGroupName_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("MEDICAID COLORADO HEALTH", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_secondaryOhiInfo_insuranceType_ohiClaimAdjustments_1"));
Assert.assertEquals("Insurance Type:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_secondaryOhiInfo_insuranceType_ohiClaimAdjustments_1"));
Assert.assertEquals("", webElement.getText());

// Verify Secondary Payer Table Information

WebElement secondaryOhiInfoTableElement = detailViewElement.findElement(By.id("CMP_secondaryOhiInfo_table_ohiClaimAdjustments_1"));
WebElement secondaryOhiInfoTableHeader = secondaryOhiInfoTableElement.findElement(By.tagName("thead"));
List<WebElement> secondaryOhiInfoTableColumnsList = secondaryOhiInfoTableHeader.findElements(By.tagName("th"));
Assert.assertTrue("No Secondary OHI Info Column Headers found!", secondaryOhiInfoTableColumnsList.size() > 0);
Assert.assertEquals("Secondary OHI Info Table must have 5 columns!", 5, secondaryOhiInfoTableColumnsList.size());

for (int i = 0; i < secondaryOhiInfoTableColumnsList.size(); i++) {
WebElement tableColumnHeader = secondaryOhiInfoTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "OHI Paid Amt.";
} else if (i == 1) {
correctColumnName = "Total Non-Covered";
} else if (i == 2) {
correctColumnName = "Qty.";
} else if (i == 3) {
correctColumnName = "Adj.";
} else if (i == 4) {
correctColumnName = "Adj. Amt.";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement secondaryOhiInfoTableBody = secondaryOhiInfoTableElement.findElement(By.tagName("tbody"));
List<WebElement> secondaryOhiInfoTableRowsList = secondaryOhiInfoTableBody.findElements(By.tagName("tr"));
Assert.assertTrue("No Secondary OHI Info Data Rows found!", secondaryOhiInfoTableRowsList.size() > 0);
// Assert.assertEquals("Should only have one Secondary OHI Info Line row of data!", 1, secondaryOhiInfoTableRowsList.size());

WebElement secondaryOhiInfoFirstRowDataElement = secondaryOhiInfoTableRowsList.get(0);
List <WebElement> secondaryOhiInfoRowDataList = secondaryOhiInfoFirstRowDataElement.findElements(By.tagName("td"));
Assert.assertTrue("No Secondary OHI Info Row Column Data found!", secondaryOhiInfoRowDataList.size() > 0);
Assert.assertEquals("Secondary OHI Info Row Column Data must have 5 columns worth of data!", 5, secondaryOhiInfoRowDataList.size());

// Check for correct data in the first and only row of the Secondary OHI Info Table.
// for (int i = 0; i < secondaryOhiInfoRowDataList.size(); i++) {
// WebElement rowColumnDataElement = secondaryOhiInfoRowDataList.get(i);
// String correctColumnRowData = null;
// if (i == 0) {
// correctColumnRowData = "";
// } else if (i == 1) {
// correctColumnRowData = "";
// } else if (i == 2) {
// correctColumnRowData = "01";
// } else if (i == 3) {
// correctColumnRowData = "COA1";
// } else if (i == 4) {
// correctColumnRowData = "100.00";
// }
//
// Assert.assertEquals(correctColumnRowData, rowColumnDataElement.getText());
// }

// Verify Tertiary Payer Information

WebElement tertiaryOhiInfoFirstTableWebElement = detailViewElement.findElement(
By.cssSelector("table[id='TH_tertiaryOhiInfo_ohiClaimAdjustments_1']"));

List<WebElement> tertiaryOhiInfoTableColumnHeadersList =
tertiaryOhiInfoFirstTableWebElement.findElements(By.cssSelector("th"));
Assert.assertEquals("Tertiary OHI Info First Table should have 4 Column Headers!",
4, tertiaryOhiInfoTableColumnHeadersList.size());

List<WebElement> tertiaryOhiInfoTableColumnsDataList =
tertiaryOhiInfoFirstTableWebElement.findElements(By.cssSelector("td"));
Assert.assertEquals("Tertiary OHI Info First Table should have 4 Data Columns!",
4, tertiaryOhiInfoTableColumnsDataList.size());

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_ohiPayerId_ohiClaimAdjustments_1"));
Assert.assertEquals("Tertiary Payer ID:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_ohiPayerId_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("999990173", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_paymentSequenceIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("Payment Seq. Indicator:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_paymentSequenceIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("T", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_fillingIndicator_ohiClaimAdjustments_1"));
Assert.assertEquals("Filing Indicator:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_fillingIndicator_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("MC", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_claimAdjustmentDate_ohiClaimAdjustments_1"));
Assert.assertEquals("Claim Adjustment Date:", webElement.getText());
webElement = tertiaryOhiInfoTableColumnHeadersList.get(3);
Assert.assertEquals("Claim Adjustment Date:", webElement.getText());

// webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_claimAdjustmentDate_ohiClaimAdjustments_1"));
webElement = tertiaryOhiInfoTableColumnsDataList.get(3);
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("01/01/14", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_ohiPayerName_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Payer Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_ohiPayerName_ohiClaimAdjustments_1"));
// Assert.assertEquals("MEDICAID COLORADO HEALTH", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_ohiGroupName_ohiClaimAdjustments_1"));
Assert.assertEquals("OHI Group Name:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_ohiGroupName_ohiClaimAdjustments_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("MEDICAID COLORADO HEALTH", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_tertiaryOhiInfo_insuranceType_ohiClaimAdjustments_1"));
Assert.assertEquals("Insurance Type:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_tertiaryOhiInfo_insuranceType_ohiClaimAdjustments_1"));
Assert.assertEquals("", webElement.getText());

// Verify Tertiary Payer Table Information

WebElement tertiaryOhiInfoTableElement = detailViewElement.findElement(By.id("CMP_tertiaryOhiInfo_table_ohiClaimAdjustments_1"));
WebElement tertiaryOhiInfoTableHeader = tertiaryOhiInfoTableElement.findElement(By.tagName("thead"));
List<WebElement> tertiaryOhiInfoTableColumnsList = tertiaryOhiInfoTableHeader.findElements(By.tagName("th"));
Assert.assertTrue("No Tertiary OHI Info Column Headers found!", tertiaryOhiInfoTableColumnsList.size() > 0);
Assert.assertEquals("Tertiary OHI Info Table must have 5 columns!", 5, tertiaryOhiInfoTableColumnsList.size());

for (int i = 0; i < tertiaryOhiInfoTableColumnsList.size(); i++) {
WebElement tableColumnHeader = tertiaryOhiInfoTableColumnsList.get(i);
String correctColumnName = null;
if (i == 0) {
correctColumnName = "OHI Paid Amt.";
} else if (i == 1) {
correctColumnName = "Total Non-Covered";
} else if (i == 2) {
correctColumnName = "Qty.";
} else if (i == 3) {
correctColumnName = "Adj.";
} else if (i == 4) {
correctColumnName = "Adj. Amt.";
}

Assert.assertEquals(correctColumnName, tableColumnHeader.getText());
}

WebElement tertiaryOhiInfoTableBody = tertiaryOhiInfoTableElement.findElement(By.tagName("tbody"));
List<WebElement> tertiaryOhiInfoTableRowsList = tertiaryOhiInfoTableBody.findElements(By.tagName("tr"));
Assert.assertTrue("No Tertiary OHI Info Data Rows found!", tertiaryOhiInfoTableRowsList.size() > 0);
// Assert.assertEquals("Should only have one Tertiary OHI Info Line row of data!", 1, tertiaryOhiInfoTableRowsList.size());

WebElement tertiaryOhiInfoFirstRowDataElement = tertiaryOhiInfoTableRowsList.get(0);
List <WebElement> tertiaryOhiInfoRowDataList = tertiaryOhiInfoFirstRowDataElement.findElements(By.tagName("td"));
Assert.assertTrue("No Tertiary OHI Info Row Column Data found!", tertiaryOhiInfoRowDataList.size() > 0);
Assert.assertEquals("Tertiary OHI Info Row Column Data must have 5 columns worth of data!", 5, tertiaryOhiInfoRowDataList.size());

// Check for correct data in the first and only row of the Tertiary OHI Info Table.
// for (int i = 0; i < tertiaryOhiInfoRowDataList.size(); i++) {
// WebElement rowColumnDataElement = tertiaryOhiInfoRowDataList.get(i);
// String correctColumnRowData = null;
// if (i == 0) {
// correctColumnRowData = "1.00";
// } else if (i == 1) {
// correctColumnRowData = "1.00";
// } else if (i == 2) {
// correctColumnRowData = "01";
// } else if (i == 3) {
// correctColumnRowData = "COA1";
// } else if (i == 4) {
// correctColumnRowData = "100.00";
// }
//
// Assert.assertEquals(correctColumnRowData, rowColumnDataElement.getText());
// }
}

public void verifyMedicareOutpatientAdjudication() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement appOhiClaimAdjustmentsWebElement =
detailViewElement.findElement(By.cssSelector("app-ohi-claim-adjustments"));

// Many of the fields do not have any data from the backend, so I will comment out those lines of codes that test
// for data.

// Check for all Remittance Remark Codes
List<WebElement> remittanceRemarkCodesDivElementsList = appOhiClaimAdjustmentsWebElement.findElements(
By.cssSelector("div[class='rarc-code']"));
Assert.assertTrue("Must have at least one Remittance Remark Code Information",
remittanceRemarkCodesDivElementsList.size() > 0);
for (int i = 0; i < remittanceRemarkCodesDivElementsList.size(); i++) {
WebElement remittanceRemarkCodesDivElement = remittanceRemarkCodesDivElementsList.get(i);

WebElement aWebElement = remittanceRemarkCodesDivElement.findElement(By.cssSelector("div[class='label']"));
Assert.assertEquals("Remit. Remark Code:", aWebElement.getText());

aWebElement = remittanceRemarkCodesDivElement.findElement(By.cssSelector("div[class='description']"));
Assert.assertTrue(aWebElement.getText().length() > 0);
}

// Primary Claim Medicare Outpatient Adjudication

WebElement webElement = detailViewElement.findElement(By.id("HDG_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
Assert.assertEquals("Medicare Outpatient Adjudication", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_reimbursementRate_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
Assert.assertEquals("Reimbursement Rate:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_reimbursementRate_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_claimHcpcsPayAmt_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
Assert.assertEquals("Claim HCPCS Pay Amt:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_claimHcpcsPayAmt_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodesLabel_ohiClaimAdjustments_1"));
// Assert.assertEquals("Remit. Remark Code:", webElement.getText());
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_4"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_4"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_5"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_primaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_5"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_esrdPaidAmount_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
Assert.assertEquals("ESRD Paid Amount:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_esrdPaidAmount_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_nonPayableProf_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
Assert.assertEquals("Non-Payable Prof:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_nonPayableProf_medicareOutpatientAdjudication_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);

// Secondary Claim Medicare Outpatient Adjudication

webElement = detailViewElement.findElement(By.id("HDG_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
Assert.assertEquals("Medicare Outpatient Adjudication", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_reimbursementRate_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
Assert.assertEquals("Reimbursement Rate:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_reimbursementRate_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_claimHcpcsPayAmt_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
Assert.assertEquals("Claim HCPCS Pay Amt:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_claimHcpcsPayAmt_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodesLabel_ohiClaimAdjustments_1"));
// Assert.assertEquals("Remit. Remark Code:", webElement.getText());
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_4"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_4"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_5"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_secondaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_5"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_esrdPaidAmount_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
Assert.assertEquals("ESRD Paid Amount:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_esrdPaidAmount_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_nonPayableProf_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
Assert.assertEquals("Non-Payable Prof:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_nonPayableProf_medicareOutpatientAdjudication_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);

// Tertiary Claim Medicare Outpatient Adjudication

webElement = detailViewElement.findElement(By.id("HDG_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
Assert.assertEquals("Medicare Outpatient Adjudication", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_reimbursementRate_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
Assert.assertEquals("Reimbursement Rate:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_reimbursementRate_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_claimHcpcsPayAmt_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
Assert.assertEquals("Claim HCPCS Pay Amt:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_claimHcpcsPayAmt_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);

// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodesLabel_ohiClaimAdjustments_1"));
// Assert.assertEquals("Remit. Remark Code:", webElement.getText());
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_1"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_2"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_4"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_4"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_code_ohiClaimAdjustments_5"));
// Assert.assertTrue(webElement.getText().length() > 0);
//
// webElement = detailViewElement.findElement(By.id("DIV_tertiaryOhiInfo_remitRemarkCodes_description_ohiClaimAdjustments_5"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_esrdPaidAmount_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
Assert.assertEquals("ESRD Paid Amount:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_esrdPaidAmount_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TH_nonPayableProf_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
Assert.assertEquals("Non-Payable Prof:", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_nonPayableProf_medicareOutpatientAdjudication_ohiClaimAdjustments_3"));
// Assert.assertTrue(webElement.getText().length() > 0);
}

public void verifyOhiServiceLineAdjustments() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("LBL_title_ohiLineAdjustment_1"));
Assert.assertEquals("OHI Service Line Adjustments", webElement.getText());

// Check for the Table Header Column Titles.

webElement = detailViewElement.findElement(By.id("TH_lineNumber_ohiLineAdjustment_1"));
Assert.assertEquals("L#", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_adjudicationDate_ohiLineAdjustment_1"));
Assert.assertEquals("Adj. Date", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_ohiId_ohiLineAdjustment_1"));
Assert.assertEquals("OHI ID", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_paymentSequenceIndicator_ohiLineAdjustment_1"));
Assert.assertEquals("PST", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_from_ohiLineAdjustment_1"));
Assert.assertEquals("From", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_bundledUnbundled_ohiLineAdjustment_1"));
Assert.assertEquals("B/U", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_revenueCode_ohiLineAdjustment_1"));
Assert.assertEquals("Rev.", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_procedureCode_ohiLineAdjustment_1"));
Assert.assertEquals("Proc.", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_modifiers_ohiLineAdjustment_1"));
Assert.assertEquals("Modifiers", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_lineCharge_ohiLineAdjustment_1"));
Assert.assertEquals("Line Charge", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_ohiPaid_ohiLineAdjustment_1"));
Assert.assertEquals("OHI Paid", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_quantity_ohiLineAdjustment_1"));
Assert.assertEquals("QTY", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_adjustmentCode_ohiLineAdjustment_1"));
Assert.assertEquals("Adj.", webElement.getText());

webElement = detailViewElement.findElement(By.id("TH_amount_ohiLineAdjustment_1"));
Assert.assertEquals("Amount", webElement.getText());

// Check for the data, In this case, there will be only one row of data. In some cases, there is no data.

webElement = detailViewElement.findElement(By.id("TD_lineNumber_ohiLineAdjustment_1"));
Assert.assertEquals("1", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_adjudicationDate_ohiLineAdjustment_1"));
Assert.assertTrue(webElement.getText().length() > 0);
// Assert.assertEquals("04/14/18", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_ohiId_ohiLineAdjustment_1"));
// Assert.assertEquals("69948657", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_paymentSequenceIndicator_ohiLineAdjustment_1"));
// Assert.assertEquals("---", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_from_ohiLineAdjustment_1"));
// Assert.assertEquals("01/22/18", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_bundledUnbundled_ohiLineAdjustment_1"));
// Assert.assertEquals("1001", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_revenueCode_ohiLineAdjustment_1"));
// Assert.assertEquals("101", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_procedureCode_ohiLineAdjustment_1"));
// Assert.assertEquals("D2332", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_modifiers_ohiLineAdjustment_1"));
// Assert.assertEquals("A, B, C, D", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_lineCharge_ohiLineAdjustment_1"));
// Assert.assertEquals("150.00", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_ohiPaid_ohiLineAdjustment_1"));
// Assert.assertEquals("99.00", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_quantity_ohiLineAdjustment_1"));
Assert.assertEquals("", webElement.getText());

webElement = detailViewElement.findElement(By.id("TD_adjustmentCode_ohiLineAdjustment_1"));
// Assert.assertEquals("COBBB", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);

webElement = detailViewElement.findElement(By.id("TD_amount_ohiLineAdjustment_1"));
// Assert.assertEquals("30.00", webElement.getText());
Assert.assertTrue(webElement.getText().length() > 0);
}

public void verifyPatientInformationSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_patientInfo_profDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Patient Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Patient Information Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Patient Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyVendorInformationSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_vendorInfo_profDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Vendor Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Vendor Information Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Vendor Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyClaimLevelAmbulanceInformationSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_info_claimAmbulance_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Claim Level Ambulance Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Claim Level Ambulance Information Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Claim Level Ambulance Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyServiceLevelAmbulanceInformationSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_info_lineAmbulance_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Claim Level Ambulance Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Claim Level Ambulance Information Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Claim Level Ambulance Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyBillingMiscellaneousSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_info_billingMsc_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Billing Miscellaneous Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Billing Miscellaneous Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Billing Miscellaneous Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyBillingInformationSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_billingInfo_profDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Billing Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Billing Information Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Billing Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyServiceLinesSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_info_serviceLines_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Service Lines Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Service Lines Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Service Lines Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyOhiClaimAdjustmentsSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_info_ohiClaimAdj_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, OHI Claim Adjustments Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("OHI Claim Adjustments Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("OHI Claim Adjustments Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyOhiServiceLineAdjustmentsSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_ohiLine_profDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, OHI Service Line Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("OHI Service Line Adjustments Section should go to collapsed state from expanded state when clicked!",
"false", ngReflectModelValue);
Thread.sleep(3000);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("OHI Service Line Adjustments Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

public void verifyRenderingNameNpiTaxonomyInformationInServiceLines() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement serviceLinesElement = detailViewElement.findElement(By.cssSelector("app-service-line"));

WebElement webElement = serviceLinesElement.findElement(By.cssSelector("label[for='ACC_serviceLine_profDetail_1']"));
Assert.assertEquals("Service Lines", webElement.getText());

WebElement serviceLinesTableElement = serviceLinesElement.findElement(By.id("TBL_tableInfo_serviceLines_1"));
// List<WebElement> taxonomyCodeSpanList = serviceLinesTableElement.findElements(By.xpath("//*[@id='TBL_tableInfo_serviceLines_1']//span[starts-with(text(), 'Taxonomy Code:')]"));
List<WebElement> taxonomyCodeStrongList = serviceLinesTableElement.findElements(By.xpath("//*[@id='TBL_tableInfo_serviceLines_1']//strong[starts-with(text(), 'Taxonomy Code:')]"));
Assert.assertTrue("Missing expected Taxonomy Code Lines!", taxonomyCodeStrongList.size() > 0);

for (int i = 0; i < taxonomyCodeStrongList.size(); i++) {
Assert.assertTrue("Taxonomy Code Span Line is missing expected 'Taxonomy Code:' string!", taxonomyCodeStrongList.get(i).getText().startsWith("Taxonomy Code:"));

WebElement spanElement = taxonomyCodeStrongList.get(i).findElement(By.xpath(".."));
// WebElement taxonomyCodeTdElement = taxonomyCodeSpanList.get(i).findElement(By.xpath(".."));
WebElement taxonomyCodeTdElement = spanElement.findElement(By.xpath(".."));
Assert.assertEquals("Expected Taxonomy Code Span Parent Element to be a 'td' element!", "td", taxonomyCodeTdElement.getTagName());
Assert.assertTrue("Expected Taxonomy Code Span Parent Element Text to have 'Taxonomy Code:' text value at the beginning!",
taxonomyCodeTdElement.getText().startsWith("Taxonomy Code:"));

WebElement taxonomyLineRowElement = taxonomyCodeTdElement.findElement(By.xpath(".."));
Assert.assertEquals("Expected Taxonomy Code 'td' Parent Element to be a 'tr' element!", "tr", taxonomyLineRowElement.getTagName());

List<WebElement> taxonomyLineRowTdElementsList = taxonomyLineRowElement.findElements(By.cssSelector("td"));
Assert.assertEquals("Incorrect number of 'td' elements for a Taxonomy Line Row!", 5, taxonomyLineRowTdElementsList.size());

WebElement tdElement = taxonomyLineRowTdElementsList.get(0);
Assert.assertEquals("Incorrect 'colspan' attribute value for 1st 'td' element in Taxonomy Line Row!", null, tdElement.getAttribute("colspan"));
Assert.assertTrue("1st 'td' element in Taxonomy Line Row should have an empty text value!", tdElement.getText().isEmpty());

tdElement = taxonomyLineRowTdElementsList.get(1);
Assert.assertEquals("Incorrect 'colspan' attribute value for 2nd 'td' element in Taxonomy Line Row!", "3", tdElement.getAttribute("colspan"));
Assert.assertFalse("2nd 'td' element in Taxonomy Line Row should NOT be an empty text value!", tdElement.getText().isEmpty());
Assert.assertTrue("2nd 'td' element in Taxonomy Line Row should have a text value that begins with 'Rendering Physician Name:' string!",
tdElement.getText().startsWith("Rendering Physician Name:"));

tdElement = taxonomyLineRowTdElementsList.get(2);
Assert.assertEquals("Incorrect 'colspan' attribute value for 3rd 'td' element in Taxonomy Line Row!", "2", tdElement.getAttribute("colspan"));
Assert.assertFalse("3rd 'td' element in Taxonomy Line Row should NOT be an empty text value!", tdElement.getText().isEmpty());
Assert.assertTrue("3rd 'td' element in Taxonomy Line Row should have a text value that begins with 'NPI:' string!",
tdElement.getText().startsWith("NPI:"));

tdElement = taxonomyLineRowTdElementsList.get(3);
Assert.assertEquals("Incorrect 'colspan' attribute value for 4th 'td' element in Taxonomy Line Row!", "3", tdElement.getAttribute("colspan"));
Assert.assertFalse("4th 'td' element in Taxonomy Line Row should NOT be an empty text value!", tdElement.getText().isEmpty());
Assert.assertTrue("4th 'td' element in Taxonomy Line Row should have a text value that begins with 'Taxonomy Code:' string!",
tdElement.getText().startsWith("Taxonomy Code:"));

tdElement = taxonomyLineRowTdElementsList.get(4);
Assert.assertEquals("Incorrect 'colspan' attribute value for 5th 'td' element in Drug Line Row!", "2", tdElement.getAttribute("colspan"));
Assert.assertTrue("5th 'td' element in Taxonomy Line Row should have an empty text value!", tdElement.getText().isEmpty());
}
}
}