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.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.junit.Assert;
import org.openqa.selenium.By;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.interactions.internal.Coordinates;

import automation.ExplorerSuite;
import automation.SharedCodeClass;
import po.CommonPO;
import po.EDI_Instit_Detail_PO;

public class EDI_PDI_Institutional_DetailView extends ExplorerSuite {

EDI_Instit_Detail_PO instDetail = new EDI_Instit_Detail_PO(driver);
CommonPO common = new CommonPO(driver);

// private String pdiNumber = "200617203000832"; // Does not work
private String pdiNumber = "999917203555817";
private String pdiNumberHasDrugLines = "100000000001399";

// Also has Health Care Procedure Codes
private String pdiNumberHasOperatorPhysicianNameAndNpi = "999917203555817";

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

goToEdiWebViewerPage();
retrieveInstitutionalInformation();
goToDetailView();

verifyVendorInformation();
verifyMiscellaneousBillingInformation();
verifyHiHealthCareOccurrenceSpanInformation();
verifyHiHealthCareOccurrenceInformation();
verifyHiHealthCareValueInformation();
verifyHiHealthCareConditionInformation();

verifyPatientInformationSectionCanBeExpandedAndCollapsed();
verifyVendorInformationSectionCanBeExpandedAndCollapsed();
verifyBillingMiscellaneousSectionCanBeExpandedAndCollapsed();
verifyBillingInformationSectionCanBeExpandedAndCollapsed();
verifyHealthCareProcedureCodesSectionCanBeExpandedAndCollapsed();
verifyServiceLinesSectionCanBeExpandedAndCollapsed();
verifyOhiClaimAdjustmentsSectionCanBeExpandedAndCollapsed();
verifyOhiServiceLineAdjustmentsSectionCanBeExpandedAndCollapsed();
verifyHiHealthCareValueInformationSectionCanBeExpandedAndCollapsed();
verifyHiHealthCareConditionInformationSectionCanBeExpandedAndCollapsed();
verifyHiHealthCareOccurrenceSpanInformationSectionCanBeExpandedAndCollapsed();
verifyHiHealthCareOccurenceInformationSectionCanBeExpandedAndCollapsed();

verifySectionHeadersPresent();

verifyRenderingNameNpiTaxonomyInformationInServiceLines();

goToEdiWebViewerPage_v2();
pdiNumber = pdiNumberHasDrugLines;
retrieveInstitutionalInformation();
goToDetailView();

verifyDrugRxInformationInServiceLines();

goToEdiWebViewerPage_v2();
pdiNumber = pdiNumberHasOperatorPhysicianNameAndNpi;
retrieveInstitutionalInformation();
goToDetailView();

verifyOperatorPhysicianNameAndNpiInformationInServiceLines();
verifyHealthCareProcedureCodesInformation();

SharedCodeClass.loadEWVPage("999917203555817");
verifyDMEonBillMisc("Verify DME in Billing Misc table");
}

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 goToEdiWebViewerPage_v2() throws Exception {
driver.get(baseUrl + "/ewvSearch");
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 retrieveInstitutionalInformation() throws Exception {
SharedCodeClass.fillAllElementById("IPT_pdiSearchNumber_ewvSearch_1", pdiNumber);
Thread.sleep(1000);
SharedCodeClass.clickById("BTN_pdiSearchRetrieve_ewvSearch_1");

Thread.sleep(30000);

// No longer present..
// 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(7000);
}

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

WebElement webElement = detailViewElement.findElement(By.id("ACC_patientInfo_instDetail_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(2000);
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_instDetail_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(2000);
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 verifyBillingMiscellaneousSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

// WebElement webElement = detailViewElement.findElement(By.id("ACC_info_billingMsc_1"));
WebElement webElement = detailViewElement.findElement(By.id("ACC_billingMiscellaneous_instDetail_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_instDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Billing Information Section should be in expanded state.", "true", ngReflectModelValue);

((JavascriptExecutor) driver).executeScript("scroll(0, 500);", webElement);
Thread.sleep(1000);

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 verifyHealthCareProcedureCodesSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

WebElement webElement = detailViewElement.findElement(By.id("ACC_hiProcCodes_instDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Health Care Procedure Codes Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Health Care Procedure Codes 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("Health Care Procedure Codes 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_serviceLine_instDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, Service Lines Section should be in expanded state.", "true", ngReflectModelValue);

((JavascriptExecutor) driver).executeScript("scroll(0, 800);", webElement);
Thread.sleep(1000);

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_ohiClaimAdjustments_instDetail_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(2000);
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_instDetail_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 verifyHiHealthCareValueInformationSectionCanBeExpandedAndCollapsed() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));

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

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("HI Health Care Value 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("HI Health Care Value Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

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

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

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("HI Health Care Condition 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("HI Health Care Condition Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

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

WebElement webElement = detailViewElement.findElement(By.id("ACC_hiOccurrSpanInfo_instDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, HI Health Care Occurence Span Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("HI Health Care Occurence Span 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("HI Health Care Occurence Span Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

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

WebElement webElement = detailViewElement.findElement(By.id("ACC_hiOccurrInfo_instDetail_1"));
String ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("Initially, HI Health Care Occurence Span Information Section should be in expanded state.", "true", ngReflectModelValue);

webElement.click();
Thread.sleep(1000);
ngReflectModelValue = webElement.getAttribute("ng-reflect-model");
Assert.assertEquals("HI Health Care Occurence Span 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("HI Health Care Occurence Span Information Section should go to expanded state from collaped state when clicked!",
"true", ngReflectModelValue);
}

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"));
Assert.assertEquals("Patient Information", webElement.getText());

webElement = detailViewElement.findElement(By.id("LBL_vendorInformation_vendorInfo_1"));
Assert.assertEquals("Vendor Information", webElement.getText());

webElement = detailViewElement.findElement(By.id("LBL_title_billingMiscellaneous_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_instDetail_1']"));;
Assert.assertEquals("Billing Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_healthCareProcedureCodes_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_hiProcCodes_instDetail_1']"));
Assert.assertEquals("Health Care Procedure Codes", webElement.getText());

webElement = detailViewElement.findElement(By.id("LBL_serviceLinesLabel_serviceLines_1"));
Assert.assertEquals("Service Lines", webElement.getText());

webElement = detailViewElement.findElement(By.id("LBL_title_ohiClaimAdjustments_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());

// webElement = detailViewElement.findElement(By.id("LBL_title_hiHealthCareValueInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_hiValueInfo_instDetail_1']"));
Assert.assertEquals("HI Health Care Value Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_hiHealthCareConditionInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_hiConditionInf_instDetail_1']"));
Assert.assertEquals("HI Health Care Condition Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_hiHealthCareOccurrenceSpanInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_hiOccurrSpanInfo_instDetail_1']"));
Assert.assertEquals("HI Health Care Occurrence Span Information", webElement.getText());

// webElement = detailViewElement.findElement(By.id("LBL_title_hiHealthCareOccurrenceInfo_1"));
webElement = detailViewElement.findElement(By.cssSelector("label[for='ACC_hiOccurrInfo_instDetail_1']"));
Assert.assertEquals("HI Health Care Occurrence Information", webElement.getText());
}

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_instDetail_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!", 10, 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(3).findElement(By.cssSelector("th"));
Assert.assertEquals("Previous PDI/Claim ID:", webElement.getText());

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

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

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

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

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

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

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

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

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

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

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

webElement = tableRowElementsList.get(9).findElement(By.cssSelector("th"));
Assert.assertTrue(webElement.getText().isEmpty());

webElement = tableRowElementsList.get(9).findElement(By.cssSelector("td"));
Assert.assertTrue(webElement.getText().isEmpty());

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!", 10, 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(3).findElement(By.cssSelector("th"));
Assert.assertEquals("Prior Authorization:", webElement.getText());

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

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

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

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

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

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

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

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

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

webElement = tableRowElementsList.get(8).findElement(By.cssSelector("th"));
Assert.assertEquals("Diagnosis Related Group:", webElement.getText());

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

webElement = tableRowElementsList.get(9).findElement(By.cssSelector("th"));
Assert.assertEquals("Medicare Internal Control Number:", webElement.getText());

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

public void verifyHiHealthCareOccurrenceSpanInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement hiHealthCareOccurrenceSpanInfoElement = detailViewElement.findElement(By.cssSelector("app-hi-health-care-occurrence-span-info"));

WebElement webElement = hiHealthCareOccurrenceSpanInfoElement.findElement(By.cssSelector("label[for='ACC_hiOccurrSpanInfo_instDetail_1']"));
Assert.assertEquals("Health Care Occurrence Span Information", webElement.getText());

WebElement hiHealthCareOccurenceSpanTableElement = hiHealthCareOccurrenceSpanInfoElement.findElement(By.id("TBL_hi_healthCare_occurenceSpan_info_1"));
List<WebElement> tableHeaderElementsList = hiHealthCareOccurenceSpanTableElement.findElements(By.cssSelector("th"));
Assert.assertEquals("Incorrect number of Column Headers for the Health Care Occurrence Span Information table!", 4, tableHeaderElementsList.size());

// Verify that the correct Table Headers are present.

WebElement tableHeaderElement = tableHeaderElementsList.get(0);
Assert.assertEquals("Qualifier", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(1);
Assert.assertEquals("Code", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(2);
Assert.assertEquals("Code Description", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(3);
Assert.assertEquals("Date", tableHeaderElement.getText());

WebElement tableBodyElement = hiHealthCareOccurenceSpanTableElement.findElement(By.cssSelector("tbody"));
List<WebElement> tableDataRowsElementsList = tableBodyElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("At least one row of Health Care Occurrence Span Information should exist!", tableDataRowsElementsList.isEmpty());

// Verify that the correct Table data is present.
for (int i = 0; i < tableDataRowsElementsList.size(); i++) {
List<WebElement> tdElementsList = tableDataRowsElementsList.get(i).findElements(By.cssSelector("td"));
Assert.assertEquals("Incorrect number of <td> elements for a row of data in the Health Care Occurrence Span Information table!",
4, tdElementsList.size());

for (int j = 0; j < tdElementsList.size(); j++) {
Assert.assertFalse("Must have a non-empty string value for a <td> element in the Health Care Occurrence Span Information table!",
tdElementsList.get(j).getText().isEmpty());
}
}
}

public void verifyHiHealthCareOccurrenceInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement hiHealthCareOccurrenceInfoElement = detailViewElement.findElement(By.cssSelector("app-hi-health-care-occurrence-info"));

WebElement webElement = hiHealthCareOccurrenceInfoElement.findElement(By.cssSelector("label[for='ACC_hiOccurrInfo_instDetail_1']"));
Assert.assertEquals("Health Care Occurrence Information", webElement.getText());

WebElement hiHealthCareOccurenceTableElement = hiHealthCareOccurrenceInfoElement.findElement(By.id("TBL_hi_healthCare_occurenceInfo_1"));
List<WebElement> tableHeaderElementsList = hiHealthCareOccurenceTableElement.findElements(By.cssSelector("th"));
Assert.assertEquals("Incorrect number of Column Headers for the Health Care Occurrence Information table!", 4, tableHeaderElementsList.size());

// Verify that the correct Table Headers are present.

WebElement tableHeaderElement = tableHeaderElementsList.get(0);
Assert.assertEquals("Qualifier", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(1);
Assert.assertEquals("Code", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(2);
Assert.assertEquals("Code Description", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(3);
Assert.assertEquals("Date", tableHeaderElement.getText());

WebElement tableBodyElement = hiHealthCareOccurenceTableElement.findElement(By.cssSelector("tbody"));
List<WebElement> tableDataRowsElementsList = tableBodyElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("At least one row of Health Care Occurrence Information should exist!", tableDataRowsElementsList.isEmpty());

// Verify that the correct Table data is present.
for (int i = 0; i < tableDataRowsElementsList.size(); i++) {
List<WebElement> tdElementsList = tableDataRowsElementsList.get(i).findElements(By.cssSelector("td"));
Assert.assertEquals("Incorrect number of <td> elements for a row of data in the Health Care Occurrence Information table!",
4, tdElementsList.size());

for (int j = 0; j < tdElementsList.size(); j++) {
Assert.assertFalse("Must have a non-empty string value for a <td> element in the Health Care Occurrence Information table!",
tdElementsList.get(j).getText().isEmpty());
}
}
}

public void verifyHiHealthCareValueInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement hiHealthCareValueInfoElement = detailViewElement.findElement(By.cssSelector("app-hi-health-care-value-info"));

WebElement webElement = hiHealthCareValueInfoElement.findElement(By.cssSelector("label[for='ACC_hiValueInfo_instDetail_1']"));
Assert.assertEquals("Health Care Value Information", webElement.getText());

WebElement hiHealthCareValueTableElement = hiHealthCareValueInfoElement.findElement(By.id("TBL_healthCare_valueInfo_1"));
List<WebElement> tableHeaderElementsList = hiHealthCareValueTableElement.findElements(By.cssSelector("th"));
Assert.assertEquals("Incorrect number of Column Headers for the Health Care Value Information table!", 4, tableHeaderElementsList.size());

// Verify that the correct Table Headers are present.

WebElement tableHeaderElement = tableHeaderElementsList.get(0);
Assert.assertEquals("Qualifier", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(1);
Assert.assertEquals("Code", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(2);
Assert.assertEquals("Code Description", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(3);
Assert.assertEquals("Amount", tableHeaderElement.getText());

WebElement tableBodyElement = hiHealthCareValueTableElement.findElement(By.cssSelector("tbody"));
List<WebElement> tableDataRowsElementsList = tableBodyElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("At least one row of Health Care Value Information should exist!", tableDataRowsElementsList.isEmpty());

// Verify that the correct Table data is present.
for (int i = 0; i < tableDataRowsElementsList.size(); i++) {
List<WebElement> tdElementsList = tableDataRowsElementsList.get(i).findElements(By.cssSelector("td"));
Assert.assertEquals("Incorrect number of <td> elements for a row of data in the Health Care Value Information table!",
4, tdElementsList.size());

for (int j = 0; j < tdElementsList.size(); j++) {
Assert.assertFalse("Must have a non-empty string value for a <td> element in the Health Care Value Information table!",
tdElementsList.get(j).getText().isEmpty());
}
}
}

public void verifyHiHealthCareConditionInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement hiHealthCareConditionInfoElement = detailViewElement.findElement(By.cssSelector("app-hi-health-care-condition-info"));

WebElement webElement = hiHealthCareConditionInfoElement.findElement(By.cssSelector("label[for='ACC_hiConditionInf_instDetail_1']"));
Assert.assertEquals("Health Care Condition Information", webElement.getText());

WebElement hiHealthCareConditionTableElement = hiHealthCareConditionInfoElement.findElement(By.id("TBL_hi_healthCare_conditionInfo_1"));
List<WebElement> tableHeaderElementsList = hiHealthCareConditionInfoElement.findElements(By.cssSelector("th"));
Assert.assertEquals("Incorrect number of Column Headers for the Health Care Condition Information table!", 4, tableHeaderElementsList.size());

// Verify that the correct Table Headers are present.

WebElement tableHeaderElement = tableHeaderElementsList.get(0);
Assert.assertEquals("Qualifier", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(1);
Assert.assertEquals("Code", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(2);
Assert.assertEquals("Code Description", tableHeaderElement.getText());

tableHeaderElement = tableHeaderElementsList.get(3);
Assert.assertEquals("", tableHeaderElement.getText());

WebElement tableBodyElement = hiHealthCareConditionTableElement.findElement(By.cssSelector("tbody"));
List<WebElement> tableDataRowsElementsList = tableBodyElement.findElements(By.cssSelector("tr"));
Assert.assertFalse("At least one row of Health Care Condition Information should exist!", tableDataRowsElementsList.isEmpty());

// Verify that the correct Table data is present.
for (int i = 0; i < tableDataRowsElementsList.size(); i++) {
List<WebElement> tdElementsList = tableDataRowsElementsList.get(i).findElements(By.cssSelector("td"));
Assert.assertEquals("Incorrect number of <td> elements for a row of data in the Health Care Condition Information table!",
4, tdElementsList.size());

for (int j = 0; j < (tdElementsList.size() - 1); j++) {
Assert.assertFalse("Must have a non-empty string value for a <td> element that is not the last one in the Health Care Condition Information table!",
tdElementsList.get(j).getText().isEmpty());
}

Assert.assertTrue("Must have an empty string value for a <td> element that is the last one in the Health Care Condition Information table!",
tdElementsList.get(tdElementsList.size() - 1).getText().isEmpty());
}
}

public void verifyDrugRxInformationInServiceLines() 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_instDetail_1']"));
Assert.assertEquals("Service Lines", webElement.getText());

WebElement serviceLinesTableElement = serviceLinesElement.findElement(By.id("TBL_tableInfo_serviceLines_1"));
List<WebElement> drugRxSpanList = serviceLinesTableElement.findElements(By.cssSelector("span[title^='DRUG RX:']"));
Assert.assertTrue("Missing expected Drug Lines!", drugRxSpanList.size() > 0);

for (int i = 0; i < drugRxSpanList.size(); i++) {
Assert.assertTrue("Drug Line is missing expected 'DRUG RX:' string!", drugRxSpanList.get(i).getText().startsWith("DRUG RX:"));

WebElement drugRxTdElement = drugRxSpanList.get(i).findElement(By.xpath(".."));
Assert.assertEquals("Expected Drug RX Span Parent Element to be a 'td' element!", "td", drugRxTdElement.getTagName());
Assert.assertTrue("Expected Drug RX Span Parent Element Text to have 'DRUG RX:' text value at the beginning!",
drugRxTdElement.getText().startsWith("DRUG RX:"));

WebElement drugLineRowElement = drugRxTdElement.findElement(By.xpath(".."));
Assert.assertEquals("Expected Drug RX 'td' Parent Element to be a 'tr' element!", "tr", drugLineRowElement.getTagName());

List<WebElement> drugLineRowTdElementsList = drugLineRowElement.findElements(By.cssSelector("td"));
Assert.assertEquals("Incorrect number of 'td' elements for a Drug Line Row!", 7, drugLineRowTdElementsList.size());

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

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

tdElement = drugLineRowTdElementsList.get(2);
Assert.assertEquals("Incorrect 'colspan' attribute value for 3rd 'td' element in Drug Line Row!", "2", tdElement.getAttribute("colspan"));

tdElement = drugLineRowTdElementsList.get(3);
Assert.assertEquals("Incorrect 'colspan' attribute value for 4th 'td' element in Drug Line Row!", "1", tdElement.getAttribute("colspan"));

tdElement = drugLineRowTdElementsList.get(4);
Assert.assertEquals("Incorrect 'colspan' attribute value for 5th 'td' element in Drug Line Row!", "1", tdElement.getAttribute("colspan"));

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

tdElement = drugLineRowTdElementsList.get(6);
Assert.assertEquals("Incorrect 'colspan' attribute value for 7th 'td' element in Drug Line Row!", "1", tdElement.getAttribute("colspan"));
}
}

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_instDetail_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());
}
}

public void verifyOperatorPhysicianNameAndNpiInformationInServiceLines() 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_instDetail_1']"));
Assert.assertEquals("Service Lines", webElement.getText());

WebElement serviceLinesTableElement = serviceLinesElement.findElement(By.id("TBL_tableInfo_serviceLines_1"));
List<WebElement> operatingPhysicianNameNpiStrongList = serviceLinesTableElement.findElements(By.xpath("//*[@id='TBL_tableInfo_serviceLines_1']//strong[starts-with(text(), 'Operating Physician Name:')]"));
Assert.assertTrue("Missing expected Operating Physician Name/NPI Lines!", operatingPhysicianNameNpiStrongList.size() > 0);

for (int i = 0; i < operatingPhysicianNameNpiStrongList.size(); i++) {
WebElement operatingPhysicianNameSpanElement = operatingPhysicianNameNpiStrongList.get(i).findElement(By.xpath(".."));
Assert.assertTrue("Operating Physician Name Span Element is missing expected 'Operating Physician Name:' string!",
operatingPhysicianNameSpanElement.getText().startsWith("Operating Physician Name:"));

WebElement operatingPhysicianTdElement = operatingPhysicianNameSpanElement.findElement(By.xpath(".."));
WebElement operatingPhysicianTrElement = operatingPhysicianTdElement.findElement(By.xpath(".."));

List<WebElement> operatingPhysicianSpanElementList = operatingPhysicianTrElement.findElements(By.cssSelector("span"));
Assert.assertEquals("Must have Two Span Elements per Operating Physician Name/NPI Pair!", 2, operatingPhysicianSpanElementList.size());

operatingPhysicianNameSpanElement = operatingPhysicianSpanElementList.get(0);
Assert.assertTrue("Operating Physician Name Span Element is missing expected 'Operating Physician Name:' string!",
operatingPhysicianNameSpanElement.getText().startsWith("Operating Physician Name:"));

WebElement operatingPhysicianNpiSpanElement = operatingPhysicianSpanElementList.get(1);
Assert.assertTrue("Operating Physician NPI Span Element is missing expected 'NPI:' string!",
operatingPhysicianNpiSpanElement.getText().startsWith("NPI:"));
}
}

public void verifyHealthCareProcedureCodesInformation() throws Exception {
WebElement detailViewElement = driver.findElement(By.id("DIV_detailView_ewv_1"));
WebElement healthCareProcedureCodesElement = detailViewElement.findElement(By.cssSelector("app-health-care-procedure-codes"));

WebElement webElement = healthCareProcedureCodesElement.findElement(By.cssSelector("label[for='ACC_hiProcCodes_instDetail_1']"));
Assert.assertEquals("Health Care Procedure Codes", webElement.getText());

WebElement tableElement = healthCareProcedureCodesElement.findElement(By.id("TBL_principleProcedure_healthCareProcedureCodes_1"));
WebElement thElement = tableElement.findElement(By.cssSelector("th"));
Assert.assertEquals("Missing 'Principle Procedure:' string!", "Principle Procedure:", thElement.getText());

WebElement tdElement = tableElement.findElement(By.cssSelector("td"));
Assert.assertFalse("Principle Procedure has not value!", tdElement.getText().isEmpty());

tableElement = healthCareProcedureCodesElement.findElement(By.id("TBL_dateOfPrincipalProcedure_healthCareProcedureCodes_1"));
thElement = tableElement.findElement(By.cssSelector("th"));
Assert.assertEquals("Missing 'Date:' string!", "Date:", thElement.getText());

tdElement = tableElement.findElement(By.cssSelector("td"));
Assert.assertFalse("Principle Procedure Date has not value!", tdElement.getText().isEmpty());

WebElement divElement = healthCareProcedureCodesElement.findElement(By.xpath("//div[starts-with(text(), 'Other Proc Codes:')]"));
Assert.assertEquals("Other Proc Codes:", divElement.getText());

WebElement otherProcedureCodesDivElement = divElement.findElement(By.xpath(".."));
WebElement otherProcedureCodesDivElement_xCodesWide = otherProcedureCodesDivElement.findElement(By.cssSelector("div[class='x-codes wide']"));
List<WebElement> otherProceduresCodesDivElementsList = otherProcedureCodesDivElement_xCodesWide.findElements(By.cssSelector("div"));
Assert.assertFalse("No Other Procedure Codes Exist!", otherProceduresCodesDivElementsList.isEmpty());
// System.out.println("Number of Other Procedure Codes = " + otherProceduresCodesDivElementsList.size());

for (int i = 0; i < otherProceduresCodesDivElementsList.size(); i++) {
List<WebElement> spanElementsList = otherProceduresCodesDivElementsList.get(i).findElements(By.cssSelector("span"));
Assert.assertFalse("No Span Elements found for an Other Procedure Code!", spanElementsList.isEmpty());
Assert.assertEquals("Must have Four Span Elements per Other Procedure Code!", 4, spanElementsList.size());

Assert.assertFalse("No Sequence Number for an Other Procedure Code!", spanElementsList.get(0).getText().isEmpty());
Assert.assertFalse("No Code value for Other Procedure Code!", spanElementsList.get(1).getText().isEmpty());
Assert.assertEquals("No 'Date:' string for Other Procedure Code!", "Date:", spanElementsList.get(2).getText());
Assert.assertFalse("No Date for Other Procedure Code!", spanElementsList.get(3).getText().isEmpty());
}
}

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_instDetail_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);
}

/***Added 07/20/2018 by EKutsenko*************************************************
* Story 01.11.26: The system will provide the ability to view modifier and text for Durable Medical Equipment (DME) frequency.
* @throws IOException
***/

public void verifyDMEonBillMisc(String description) throws IOException{
List<String> expectedHeaders = Arrays.asList("DME Procedure:", "DME Modifier:", "DME Frequency:");
List<String> expectedData = Arrays.asList("DME Proc", "DME Mod", "DME Freq displays");
try {
ArrayList<String> actualHeaders = instDetail.getBillingMiscColumn3Headers();
ArrayList<String> actualData = instDetail.getBillingMiscColumn3Data();

Assert.assertEquals(description, expectedHeaders, actualHeaders);
Assert.assertEquals(description, expectedData, actualData);

SharedCodeClass.assertPassed(description);
} catch (AssertionError | Exception e) {
SharedCodeClass.assertFailed(description, e );
}


}
}
;