gov.va.medora.mdws.PatientLib.getPcpForPatient C# (CSharp) Method

getPcpForPatient() public method

public getPcpForPatient ( string pid ) : TaggedText
pid string
return gov.va.medora.mdws.dto.TaggedText
        public TaggedText getPcpForPatient(string pid)
        {
            TaggedText result = new TaggedText();

            string msg = MdwsUtils.isAuthorizedConnection(mySession);
            if (msg != "OK")
            {
                result.fault = new FaultTO(msg);
            }
            else if (String.IsNullOrEmpty(pid))
            {
                result.fault = new FaultTO("Empty PID");
            }
            if (result.fault != null)
            {
                return result;
            }
            try
            {
                KeyValuePair<string, string> kvp = Patient.getPcpForPatient(mySession.ConnectionSet.BaseConnection, pid);
                result = new TaggedText(kvp);
            }
            catch (Exception exc)
            {
                result.fault = new FaultTO(exc);
            }
            return result;
        }