public patientVisit ( string pwd, string homeSitecode, string mpiPid, bool multiSite ) : |
||
pwd | string | Client app's BSE security phrase |
homeSitecode | string | Station number |
mpiPid | string | ICN |
multiSite | bool | Set to false for now |
return |
public SiteArray patientVisit(string pwd, string homeSitecode, string mpiPid, bool multiSite)
{
SiteArray result = new SiteArray();
//Make sure we have all the args we need
if (mySession == null || mySession.SiteTable == null)
{
result.fault = new FaultTO("No session has been started");
}
else if (String.IsNullOrEmpty(homeSitecode))
{
result.fault = new FaultTO("No homeSitecode");
}
else if (mySession.SiteTable.getSite(homeSitecode) == null)
{
result.fault = new FaultTO("No site " + homeSitecode + " in the site table");
}
else if (mySession.ConnectionSet != null &&
mySession.ConnectionSet.Count > 0 &&
mySession.ConnectionSet.HasConnection(homeSitecode))
{
result.fault = new FaultTO("Site " + homeSitecode + " already connected");
}
else if (mySession.ConnectionSet != null && mySession.ConnectionSet.Count > 0)
{
result.fault = new FaultTO("This session has pre-existing connections and this method should be the base connection.", "Do a disconnect?");
}
else if (mpiPid == "")
{
result.fault = new FaultTO("No MPI PID");
}
if (result.fault != null)
{
return result;
}
Site homeSite = mySession.SiteTable.getSite(homeSitecode);
mySession.Credentials = getAdministrativeCredentials(homeSite);
mySession.Credentials.SecurityPhrase = pwd;
string context = MdwsConstants.MDWS_CONTEXT;
if (mySession.DefaultVisitMethod == MdwsConstants.NON_BSE_CREDENTIALS)
{
context = MdwsConstants.CPRS_CONTEXT;
}
mySession.PrimaryPermission = new MenuOption(context);
try
{
mySession.User = doTheVisit(homeSitecode, mySession.Credentials, mySession.PrimaryPermission);
PatientApi patientApi = new PatientApi();
string localPid = patientApi.getLocalPid(myCxn, mpiPid);
if (localPid == "")
{
myCxn.disconnect();
result.fault = new FaultTO("No such patient at this site");
return result;
}
mySession.Patient = patientApi.select(myCxn, localPid);
addMyCxn2CxnSet();
}
catch (Exception e)
{
myCxn.disconnect();
result.fault = new FaultTO(e.Message);
return result;
}
return result;
}
AccountLib::patientVisit ( string pwd, string sitecode, string mpiPid ) : |
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); }