private void SetParameterValues(StagingAddress address)
 {
     Parameters.AddWithValue("@AddressID", address.AddressID);
     Parameters.AddWithValue("@AddressTypeID", address.AddressTypeID);
     Parameters.AddWithValue("@CarrierRoute", address.CarrierRoute);
     Parameters.AddWithValue("@City", address.City);
     Parameters.AddWithValue("@County", address.County);
     Parameters.AddWithValue("@DPV", address.DPV);
     Parameters.AddWithValue("@EncounterImportID", address.EncounterImportID);
     Parameters.AddWithValue("@FileID", address.FileID);
     Parameters.AddWithValue("@JobID", address.JobID);
     Parameters.AddWithValue("@Latitude", address.Latitude);
     Parameters.AddWithValue("@Longitude", address.Longitude);
     Parameters.AddWithValue("@PatientNumber", address.PatientNumber);
     Parameters.AddWithValue("@RawAddress", address.RawAddress);
     Parameters.AddWithValue("@StandardizationResult", address.StandardizationResult);
     Parameters.AddWithValue("@StandardizationWarnings", address.StandardizationWarnings);
     Parameters.AddWithValue("@Standardized", address.Standardized);
     Parameters.AddWithValue("@StandardizedAddress", address.StandardizedAddress);
     Parameters.AddWithValue("@StandardizedCityStZip", address.StandardizedCityStZip);
     Parameters.AddWithValue("@State", address.State);
     Parameters.AddWithValue("@Vacant", address.Vacant);
     Parameters.AddWithValue("@ZipCode", address.ZipCode);
     Parameters.AddWithValue("@ZipFour", address.ZipFour);
 }
 public void Execute(ref StagingAddress address, SqlConnection connection, SqlTransaction transaction = null)
 {
     SetParameterValues(address);
     DataTable t = ExecuteReader(connection, transaction);
     if (t.Rows.Count > 0)
     {
         address.StagingAddressID = t.Rows[0].Field<int>("StagingAddressID");
     }
 }
 public void Execute(ref StagingAddress address)
 {
     SetParameterValues(address);
     DataTable t = ExecuteReader();
     if (t.Rows.Count > 0)
     {
         address.StagingAddressID = t.Rows[0].Field<int>("StagingAddressID");
     }
 }
Example #4
0
        public void GeoCodeAddress(ref StagingAddress address)
        {
            GeoCodeResult result = LookupZipCode(address.ZipCode + address.ZipFour);
            if (result.Found)
            {
                log.DebugFormat("Latitude: String {0}, Decimal {1}", result.Latitude, address.Latitude);
                log.DebugFormat("Longitude: String {0}, Decimal {1}", result.Longitude, address.Longitude);

                address.Latitude = Convert.ToDecimal(result.Latitude);
                address.Longitude = Convert.ToDecimal(result.Longitude);
            }
        }
 public void Execute(ref StagingAddress address)
 {
     Parameters.AddWithValue("@StagingAddressID", address.StagingAddressID);
     Parameters.AddWithValue("@AddressTypeID", address.AddressTypeID);
     Parameters.AddWithValue("@CarrierRoute", address.CarrierRoute);
     Parameters.AddWithValue("@City", address.City);
     Parameters.AddWithValue("@County", address.County);
     Parameters.AddWithValue("@Deliverable", address.Deliverable);
     Parameters.AddWithValue("@DPV", address.DPV);
     Parameters.AddWithValue("@Latitude", address.Latitude);
     Parameters.AddWithValue("@Longitude", address.Longitude);
     Parameters.AddWithValue("@StandardizationResult", address.StandardizationResult);
     Parameters.AddWithValue("@StandardizationWarnings", address.StandardizationWarnings);
     Parameters.AddWithValue("@Standardized", address.Standardized);
     Parameters.AddWithValue("@StandardizedAddress", address.StandardizedAddress);
     Parameters.AddWithValue("@StandardizedCityStZip", address.StandardizedCityStZip);
     Parameters.AddWithValue("@State", address.State);
     Parameters.AddWithValue("@Vacant", address.Vacant);
     Parameters.AddWithValue("@ZipCode", address.ZipCode);
     Parameters.AddWithValue("@ZipFour", address.ZipFour);
     ExecuteNonQuery();
 }
Example #6
0
        public int LookupAddress(ref StagingAddress address)
        {
            int result = -1;
            Clear();
            inputPrimaryAddress = address.RawAddress;
            if (!string.IsNullOrEmpty(address.RawAddress2))
            {
                inputSecondaryAddress = address.RawAddress2;
            }
            inputCityName = address.City;
            inputStateName = address.State;
            inputZipCode = address.ZipCode;
            log.DebugFormat("{0} {1},{2} {3}", inputPrimaryAddress, inputCityName, inputStateName, inputZipCode);

            CASSLookup();
            address.CarrierRoute = resultCarrierRouteCode;
            address.County = resultCountyName;
            address.DPV = resultDPV;
            address.StandardizedAddress = resultPrimaryAdddress;
            address.StandardizedCityStZip = resultLastLine;
            if (Int32.TryParse(resultReturnCode, out result))
            {
                address.StandardizationResult = result;
            }
            address.Vacant = resultVacancyFlag == "Y";
            address.ZipCode = resultZipCode;
            address.ZipFour = resultPlus4;

            //address.StandardizationWarnings = resultErrorAndWarning;
            address.StandardizationWarnings = GetStandardizationWarnings(result);
            address.Standardized = true;
            address.Deliverable = result == 31;

            log.DebugFormat("resultReturnCode: {0}", result);
            return result;
        }
Example #7
0
        private void btnAccuZipWebService_Click(object sender, EventArgs e)
        {
            StagingAddress a = new StagingAddress();
            a.RawAddress = txtAddress.Text;
            a.City = txtCity.Text;
            a.State = txtState.Text;
            a.ZipCode = txtZip5.Text;


            int returncode = SystemDataProvider.ClientDataProvider.StagingAddressStandardize(ref a);
            StringBuilder sbResults = new StringBuilder();

            sbResults.AppendLine(String.Format("StandardizedAddress = {0}", a.StandardizedAddress));
            sbResults.AppendLine(String.Format("Last Line           = {0}", a.StandardizedCityStZip));
            sbResults.AppendLine(String.Format("City                = {0}", a.City));
            sbResults.AppendLine(String.Format("State               = {0}", a.State));
            sbResults.AppendLine(String.Format("Zip                 = {0}", a.ZipCode));
            sbResults.AppendLine(String.Format("Zip4                = {0}", a.ZipFour));
            sbResults.AppendLine(String.Format("Carrier Route       = {0}", a.CarrierRoute));
            sbResults.AppendLine(String.Format("County              = {0}", a.County));
            sbResults.AppendLine(String.Format("Latitude            = {0}", a.Latitude));
            sbResults.AppendLine(String.Format("Longitude           = {0}", a.Longitude));

            sbResults.AppendLine(String.Format("Return Code       = {0}", returncode));
            txtAccuZipOutput.Text = sbResults.ToString();

        }
 public void UpdateStagingAddressStandardized(StagingAddress a)
 {
     spStagingAddressUpdateStandardized proc = new spStagingAddressUpdateStandardized(this.ConnectionString);
     proc.Execute(ref a);
 }
 public void StagingAddressUpdateStandardized(ref StagingAddress stagingAddress)
 {
     spStagingAddressUpdateStandardized proc = new spStagingAddressUpdateStandardized(this.ConnectionString);
     proc.Execute(ref stagingAddress);
 }
 public void StagingAddressSave(ref StagingAddress stagingAddress)
 {
     spAddStagingAddress proc = new spAddStagingAddress(this.ConnectionString);
     proc.Execute(ref stagingAddress);
 }
 public int StagingAddressStandardize(ref StagingAddress stagingAddress)
 {
     AddressServiceClient client = new AddressServiceClient();
     client.StandardizeStagingAddress(ref stagingAddress);
     return stagingAddress.StandardizationResult.Value;
 }
        public StagingAddress Clone()
        {
            StagingAddress result = new StagingAddress();
            result.AddressHash = this.AddressHash;
            result.AddressID = this.AddressID;
            result.AddressTypeID = this.AddressTypeID;
            result.CarrierRoute = this.CarrierRoute;
            result.City = this.City;
            result.Company = this.County;
            result.Deliverable = this.Deliverable;
            result.DPV = this.DPV;
            result.EncounterImportID = this.EncounterImportID;
            result.FileID = this.FileID;
            result.JobID = this.JobID;
            result.Latitude = this.Latitude;
            result.Longitude = this.Longitude;
            result.PatientNumber = this.PatientNumber;
            result.RawAddress = this.RawAddress;
            result.RawAddress2 = this.RawAddress2;
            result.StagingAddressID = this.StagingAddressID;
            result.StandardizationResult = this.StandardizationResult;
            result.StandardizationWarnings = this.StandardizationWarnings;
            result.Standardized = this.Standardized;
            result.StandardizedAddress = this.StandardizedAddress;
            result.StandardizedCityStZip = this.StandardizedCityStZip;
            result.State = this.State;
            result.Vacant = this.Vacant;
            result.ZipCode = this.ZipCode;
            result.ZipFour = this.ZipFour;

            return result;
        }
 public StagingAddress GetAddressValues(Job job)
 {
     StagingAddress result = new StagingAddress()
     {
         City = this.City,
         State = this.State,
         PatientNumber = this.PatientNumber,
         RawAddress = this.Address,
         RawAddress2 = this.Address2,
         ZipCode = GetZip5(),
         ZipFour = GetZip4(),
         FileID = job.FileID,
         JobID = job.JobID,
         EncounterImportID = this.EncounterImportID
     };
     return result;
 }
        void IAddressService.StandardizeStagingAddress(ref StagingAddress stagingAddress)
        {
            int returnCode = Cass.LookupAddress(ref stagingAddress);
            stagingAddress.AddressTypeID = (int)MapAddressType(Cass.resultAddressRecordType);
            stagingAddress.Deliverable = returnCode == 31;
            log.DebugFormat("StandardizationResult: {0}", returnCode);
            Geo.GeoCodeAddress(ref stagingAddress);


        }