gov.va.medora.mdws.MhvLib.getHealthSummary C# (CSharp) Method

getHealthSummary() public method

public getHealthSummary ( string pwd, string sitecode, string mpiPid, string displayName ) : TextTO
pwd string
sitecode string
mpiPid string
displayName string
return gov.va.medora.mdws.dto.TextTO
        public TextTO getHealthSummary(string pwd, string sitecode, string mpiPid, string displayName)
        {
            TextTO result = new TextTO();

            if (String.IsNullOrEmpty(sitecode))
            {
                result.fault = new FaultTO("Missing sitecode");
            }
            else if (mpiPid == "")
            {
                result.fault = new FaultTO("Missing mpiPid");
            }
            else if (displayName == "")
            {
                result.fault = new FaultTO("Missing displayName");
            }
            if (result.fault != null)
            {
                return result;
            }

            AccountLib acctLib = new AccountLib(mySession);
            try
            {
                SiteArray sites = acctLib.patientVisit(pwd, sitecode, mpiPid, false);
                if (sites.fault != null)
                {
                    result.fault = sites.fault;
                    return result;
                }

                // Get the labs...
                ClinicalLib clinicalLib = new ClinicalLib(mySession);
                result = clinicalLib.getAdHocHealthSummaryByDisplayName(sitecode, displayName);
            }
            catch (Exception e)
            {
                result.fault = new FaultTO(e.Message);
            }
            finally
            {
                mySession.close();
            }
            return result;
        }