public TaggedChemHemRptArray getChemHemReportsByReportDateFromSite(
string pwd, string sitecode, string mpiPid, string fromDate, string toDate)
{
TaggedChemHemRptArray result = new TaggedChemHemRptArray();
if (String.IsNullOrEmpty(sitecode))
{
result.fault = new FaultTO("Missing sitecode");
}
else if (mpiPid == "")
{
result.fault = new FaultTO("Missing mpiPid");
}
else if (fromDate == "")
{
result.fault = new FaultTO("Missing fromDate");
}
if (result.fault != null)
{
return(result);
}
if (toDate == "")
{
toDate = DateTime.Now.ToString("yyyyMMdd");
}
AccountLib acctLib = new AccountLib(mySession);
try
{
// Visit as DoD user...
SiteArray sites = acctLib.patientVisit(pwd, sitecode, mpiPid, false);
if (sites.fault != null)
{
result.fault = sites.fault;
return(result);
}
// Get the labs...
ChemHemReport[] rpts = ChemHemReport.getChemHemReports(mySession.ConnectionSet.getConnection(sitecode), fromDate, toDate);
result = new TaggedChemHemRptArray(sitecode, rpts);
}
catch (Exception e)
{
result.fault = new FaultTO(e.Message);
}
finally
{
mySession.close();
}
return(result);
}