예제 #1
0
        public override string Fetch(DataRow dr)
        {
            string message = String.Empty;
            string output  = String.Empty;

            try
            {
                Initialize(dr, true, new SPMConfig()
                {
                    AcceptAllCertificatePolicy = true, Expect100Continue = false
                });
                ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

                if (string.IsNullOrEmpty(provider.FirstName) && string.IsNullOrEmpty(provider.LastName))
                {
                    message = ErrorMsg.InvalidFirstLastName;
                }
                else
                {
                    tableList = GetTableList();

                    // 3a - check for practice (identified by only a lastname provided)
                    if (!string.IsNullOrEmpty(provider.LastName) && string.IsNullOrEmpty(provider.FirstName))
                    {
                        // allow fall-through
                        RunSearch(provider.LastName, ref output, true, false, provider.FirstName, provider.LastName);
                    }

                    // 3b - check for first and last name
                    else if (!string.IsNullOrEmpty(provider.FirstName) && !string.IsNullOrEmpty(provider.LastName))
                    {
                        // allow fall-through
                        RunSearch(String.Format("{0}|{1}", provider.FirstName, provider.LastName), ref output, true, true, provider.FirstName, provider.LastName);
                    }
                }
            }
            catch (Exception exception)
            {
                message = ErrorMsg.CustomException(exception);
            }

            return(ProcessResults(output, message));
        }