Package 'npi'

Title: Access the U.S. National Provider Identifier Registry API
Description: Access the United States National Provider Identifier Registry API <https://npiregistry.cms.hhs.gov/api/>. Obtain and transform administrative data linked to a specific individual or organizational healthcare provider, or perform advanced searches based on provider name, location, type of service, credentials, and other attributes exposed by the API.
Authors: Frank Farach [cre, aut, cph] , Sam Parmar [ctb], Matthias GreniƩ [rev] , Emily C. Zabor [rev]
Maintainer: Frank Farach <[email protected]>
License: MIT + file LICENSE
Version: 0.2.0.9000
Built: 2024-09-28 06:28:55 UTC
Source: https://github.com/ropensci/npi

Help Index


S3 method to flatten an npi_results object

Description

S3 method to flatten an npi_results object

Usage

npi_flatten(df, cols, key)

Arguments

df

A data frame containing the results of a call to npi_search.

cols

If non-NULL, only the named columns specified here will be be flattened and returned along with npi.

key

A quoted column name from df to use as a matching key. The default value is "npi".

Value

A data frame (tibble) with flattened list columns.

Examples

# Flatten all list columns
data(npis)
npi_flatten(npis)

# Only flatten specified columns
npi_flatten(npis, cols = c("basic", "identifiers"))

Flatten NPI search results

Description

This function takes an npi_results S3 object returned by npi_search and flattens its list columns. It unnests the lists columns and left joins them by npi. You can optionally specify which columns from df to include.

Usage

## S3 method for class 'npi_results'
npi_flatten(df, cols = NULL, key = "npi")

Arguments

df

A data frame containing the results of a call to npi_search.

cols

If non-NULL, only the named columns specified here will be be flattened and returned along with npi.

key

A quoted column name from df to use as a matching key. The default value is "npi".

Details

The names of unnested columns are prefixed by the name of their originating list column to avoid name clashes and show their lineage. List columns containing all NULL data will be absent from the result because there are no columns to unnest.

Value

A data frame (tibble) with flattened list columns.

Examples

# Flatten all list columns
data(npis)
npi_flatten(npis)

# Only flatten specified columns
npi_flatten(npis, cols = c("basic", "identifiers"))

Check if candidate NPI number is valid

Description

Check whether a number is a valid NPI number per the specifications detailed in the Final Rule for the Standard Unique Health Identifier for Health Care Providers (69 FR 3434).

Usage

npi_is_valid(x)

Arguments

x

10-digit candidate NPI number

Value

Boolean indicating whether npi is valid

Examples

npi_is_valid(1234567893) # TRUE
npi_is_valid(1234567898) # FALSE

S3 method to summarize an npi_results object

Description

S3 method to summarize an npi_results object

Usage

npi_summarize(object, ...)

Arguments

object

An npi_results S3 object

...

Additional optional arguments

Value

Tibble containing the following columns:

npi

National Provider Identifier (NPI) number

name

Provider's first and last name for individual providers, organization name for organizational providers.

enumeration_type

Type of provider associated with the NPI, either "Individual" or "Organizational"

primary_practice_address

Full address of the provider's primary practice location

phone

Provider's telephone number

primary_taxonomy

Primary taxonomy description

Examples

data(npis)
npi_summarize(npis)

Summary method for npi_results S3 object

Description

Print a human-readable overview of each record return in the results from a call to npi_search. The format of the summary is modeled after the one offered on the NPI registry website.

Usage

## S3 method for class 'npi_results'
npi_summarize(object, ...)

Arguments

object

An npi_results S3 object

...

Additional optional arguments

Value

Tibble containing the following columns:

npi

National Provider Identifier (NPI) number

name

Provider's first and last name for individual providers, organization name for organizational providers.

enumeration_type

Type of provider associated with the NPI, either "Individual" or "Organizational"

primary_practice_address

Full address of the provider's primary practice location

phone

Provider's telephone number

primary_taxonomy

Primary taxonomy description

Examples

data(npis)
npi_summarize(npis)

Sample results from the NPI Registry

Description

A dataset containing 10 records returned from an NPI Registry search for providers with a primary address in New York City.

Usage

npis

Format

A tibble with 10 rows and 11 columns, organized as follows:

npi

[integer] 10-digit National Provider Identifier number

enumeration_type

[character] Type of provider NPI, either "Individual" or "Organizational".

basic

[list of 1 tibble] Basic information about the provider.

other_names

[list of tibbles] Other names the provider goes by.

identifiers

[list of tibbles] Other identifiers linked to the NPI.

taxonomies

[list of tibbles] Healthcare Provider Taxonomy classification.

addresses

[list of tibbles] Addresses for the provider's primary practice location and primary mailing address.

practice_locations

[list of tibbles] Addresses for the provider's other practice locations.

endpoints

[list of tibbles] Details about provider's endpoints for health information exchange.

created_date

[datetime] Date NPI record was first created (UTC).

last_updated_date

[datetime] UTC timestamp of the last time the NPI record was updated.

Details

search_npi(city = "New York City", limit = 10)

Source

https://npiregistry.cms.hhs.gov/registry/help-api