pub struct NppesDatasetBuilder { /* private fields */ }Expand description
Builder for loading a complete NPPES dataset
§Example
let dataset = NppesDatasetBuilder::new()
.main_data("data/npidata_pfile_20240101-20240107.csv")
.taxonomy_reference("data/nucc_taxonomy_240.csv")
.other_names("data/othername_pfile_20240101-20240107.csv")
.practice_locations("data/pl_pfile_20240101-20240107.csv")
.endpoints("data/endpoint_pfile_20240101-20240107.csv")
.build()?;§Example with URL
// NOTE: This URL points to a future data file format (May 2025).
// To download the latest available data, use `NppesDatasetBuilder::download_latest()`.
let dataset = NppesDatasetBuilder::new()
.from_url("https://download.cms.gov/nppes/NPPES_Data_Dissemination_May_2025_V2.zip")
.build_async().await?;Implementations§
Source§impl NppesDatasetBuilder
impl NppesDatasetBuilder
Sourcepub fn main_data<S: Into<DataSource>>(self, source: S) -> Self
pub fn main_data<S: Into<DataSource>>(self, source: S) -> Self
Set the path or URL to the main NPPES data file
Sourcepub fn taxonomy_reference<S: Into<DataSource>>(self, source: S) -> Self
pub fn taxonomy_reference<S: Into<DataSource>>(self, source: S) -> Self
Set the path or URL to the taxonomy reference file
Sourcepub fn other_names<S: Into<DataSource>>(self, source: S) -> Self
pub fn other_names<S: Into<DataSource>>(self, source: S) -> Self
Set the path or URL to the other names file
Sourcepub fn practice_locations<S: Into<DataSource>>(self, source: S) -> Self
pub fn practice_locations<S: Into<DataSource>>(self, source: S) -> Self
Set the path or URL to the practice locations file
Sourcepub fn endpoints<S: Into<DataSource>>(self, source: S) -> Self
pub fn endpoints<S: Into<DataSource>>(self, source: S) -> Self
Set the path or URL to the endpoints file
Sourcepub fn from_url<S: Into<String>>(self, url: S) -> Self
pub fn from_url<S: Into<String>>(self, url: S) -> Self
Load data from a URL (ZIP file containing NPPES data)
Sourcepub fn with_download_config(self, config: DownloadConfig) -> Self
pub fn with_download_config(self, config: DownloadConfig) -> Self
Set download configuration
Sourcepub fn skip_invalid_records(self, skip: bool) -> Self
pub fn skip_invalid_records(self, skip: bool) -> Self
Enable or disable skipping invalid records
Sourcepub fn build_indexes(self, build: bool) -> Self
pub fn build_indexes(self, build: bool) -> Self
Enable or disable automatic index building
Sourcepub fn show_progress(self, show: bool) -> Self
pub fn show_progress(self, show: bool) -> Self
Enable or disable progress bars
Sourcepub fn build(self) -> Result<NppesDataset>
pub fn build(self) -> Result<NppesDataset>
Build the dataset, loading all specified files (synchronous version)
Sourcepub async fn build_async(self) -> Result<NppesDataset>
pub async fn build_async(self) -> Result<NppesDataset>
Build the dataset from internet sources (async version)
Sourcepub fn from_directory<P: AsRef<Path>>(dir: P) -> Result<Self>
pub fn from_directory<P: AsRef<Path>>(dir: P) -> Result<Self>
Load a standard dataset from a directory containing all NPPES files
Looks for files matching standard NPPES naming patterns in the given directory.
Sourcepub async fn download_latest() -> Result<NppesDataset>
pub async fn download_latest() -> Result<NppesDataset>
Download the latest NPPES data and build dataset
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NppesDatasetBuilder
impl RefUnwindSafe for NppesDatasetBuilder
impl Send for NppesDatasetBuilder
impl Sync for NppesDatasetBuilder
impl Unpin for NppesDatasetBuilder
impl UnsafeUnpin for NppesDatasetBuilder
impl UnwindSafe for NppesDatasetBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more