Hi Colin
Based on your suggested reading, found out I need to declare the variable outside of the function. So this is what I have-
Unit "Search Patient by Department"
//USEUNIT Patient_Info
// [Name, ptSource, acNum, MRN, DOB, aDate, Dept, Group] - in a array "pStat[]""
//search the patient by department
function searchDept()
{
//gather patient info (unit "Patient_Info")
Patient_Info.getPatientStat();
//back to Unit Search Patient by Department
// log pStat -
Log.message("Name: " + pStat[0]);
Log.message("Patient Source: " + pStat[1]);
Log.message("Account Number: " + pStat[2]);
Log.message("MRN: " + pStat[3]);
Log.message("DOB: " + pStat[4]);
Log.message("Admission Date: " + pStat[5]);
Log.message("Department: " + pStat[6]);
Log.message("Group: " + pStat[7]);
//home
Aliases.browser.swce.aspnetForm.menuHome.Click();
//select search by department and patient name
Aliases.browser.pifHome.aspnetForm.selectSearchBy.ClickItem(1);
//select department dropdown - "Emergency Department"
Aliases.browser.pifHome.aspnetForm.selectDepartment.ClickItem(3);
//set patient name
Aliases.browser.pifHome.aspnetForm.inputPatientName.SetText("Lena")
//search
Aliases.browser.pifHome.aspnetForm.btnSearch.ClickButton();
//select patient
Aliases.browser.pifHome.aspnetForm.firstPatient.Click();
//view information
Aliases.browser.swce.aspnetForm.menuViewInfo.Click();
// MRN = Log.Message(pStat[3]);
//check patient MRN
aqObject.CheckProperty(Aliases.browser.swce.aspnetForm.panelPatientInfo.MRN, "contentText", cmpEqual, pStat[3]);
. . . Unit "Patient_Info"
//patient info
var pStat = [];
function getPatientStat()
{
. . .
//point IE to SWCE3
Browsers.Item("iexplore", "", Browsers.pX86).Run("https://swce3.imedconsent.com/SRC");
//input username
...;
//input password
...
//slelect domain 'none'
Aliases.browser.pifLogin.aspnetForm.setDomain.ClickItem(0);
//click login
Aliases.browser.pifLogin.aspnetForm.btnLogin.ClickButton();
//search patient name
Aliases.browser.pifHome.aspnetForm.inputPatientName.SetText("lena");
//click search
Aliases.browser.pifHome.aspnetForm.btnSearch.ClickButton();
//view information
Aliases.browser.swce.aspnetForm.menuViewInfo.Click();
var pStat =
[Aliases.browser.swce.aspnetForm.panelPatientInfo.Name.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.ptSource.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.acNum.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.MRN.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.DOB.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.aDate.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.Dept.contentText,
Aliases.browser.swce.aspnetForm.panelPatientInfo.Group.contentText];
}
I am running "Search Patient by Department" routine, it immediately runs the Patient_Info routine and returns back to continue.
For some reason, array values are not ported over to Search Patient by Department. Log reports "undefined". Not sure what I did wrong.
Thanks for your help.
Dave