private NPIRequest(ZipcodeMetadata address, int skip) { this.Address = address; this.Skip = skip; this.URI = baseURL + "?number=&enumeration_type=" + "&taxonomy_description=&first_name=&last_name=&organization_name" + "=&address_purpose=&city=" + address.City.Trim() + "&state=" + address.State.Trim() + "&postal_code=" + address._id.Trim() + "&country_code=US&limit=" + MAX_RESULTS + "&skip=" + (Skip * MAX_RESULTS) + "&version=2.0"; }
int IData.Processed(ZipcodeMetadata address) { try { var filter = Builders <ZipcodeMetadata> .Filter.Eq(x => x._id, address._id); var entry = zipEntries.Find(filter); if (entry == null || entry.First() == null) { return(-1); //Unknown pincode from our list } var first = entry.First(); if (string.IsNullOrEmpty(first.Processed)) { return(0); } if (first.Processed == TRUE) { return(-1); } if (first.Processed == FALSE) { return(first.BatchCount + 1); } throw new InvalidProgramException("This is an invalid state for the processed attribute for zipCode " + address._id); } catch (Exception ex) { Console.WriteLine(ex.ToString()); return(-1); } }
public static NPIRequest Create(ZipcodeMetadata address, int skip = 0) { return(new NPIRequest(address, skip)); }
public static int Processed(ZipcodeMetadata address) => data.Processed(address);