Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deactivated NPIs #22

Closed
jgarrigan opened this issue Feb 28, 2021 · 2 comments
Closed

Deactivated NPIs #22

jgarrigan opened this issue Feb 28, 2021 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@jgarrigan
Copy link

@frankfarach Thank you very much for creating this package. I only discovered it after I miserably failed to create a function of my own.

I am passing about 3000 call to the API and some of these NPIs appear to be deactivated

Is there an approach that can be used to handle deactivated NPIs?

The deactivated NPIs appear to be valid when I pass them to npi_is_valid()

An example of a deactivated NPI is 1710983663

This is an example of what I am trying to run

examples <- data.frame(names = c(1003060377,
                                # 1710983663, this is a deactivated NPI
                                 1003213240,
                                 1003116930,
                                 1003020306,
                                 1003292350,
                                 1003094988,
                                 1003164716,
                                 1003156324,
                                 1003219981))

result <- vector('list', nrow(examples))

for(i in seq(nrow(examples))) {
  #Sleep for 1 minute after every 2 values
  if(i %% 2 == 0) Sys.sleep(5)
  result[[i]] <- npi::npi_search(examples$names[i])
}

x <- bind_rows(result) %>%
  select(npi,addresses) %>% 
  unnest(addresses) %>% 
  filter(address_purpose == "LOCATION") %>% 
  select(npi,
         address_1,
         address_2,
         city,
         state,
         postal_code)
@frankfarach
Copy link
Collaborator

frankfarach commented Mar 1, 2021

@jgarrigan thanks for the question. The function npi_is_valid() only determines whether the NPI meets the check digit requirement described below:

https://www.cms.gov/Regulations-and-Guidance/Administrative-Simplification/NationalProvIdentStand/Downloads/NPIcheckdigit.pdf

While this can be useful for catching invalid NPIs due to data integrity problems, it does not tell you anything about the administrative status of the NPI.

Looking at the NPPES field map, I would expect that deactivation information, if present at all for a record, would probably appear in the following fields:

basic_deactivation_reason_code
basic_deactivation_date

Deactivation reason codes are given in data dissemination file code values:

https://www.cms.gov/Regulations-and-Guidance/Administrative-Simplification/NationalProvIdentStand/Downloads/Data_Dissemination_File-Code_Values.pdf

Previously deactivated NPIs that were reactivated might have the date of reactivation:

basic_reactivation_date

You might wish to filter for these fields and apply suitable logic to meet the goals of your project. If you have more detailed questions about the meaning of the data elements themselves, I suggest contacting the NPPES NPI Registry. Good luck!

@frankfarach frankfarach self-assigned this Mar 1, 2021
@frankfarach frankfarach added the question Further information is requested label Mar 1, 2021
@kadamson615
Copy link

@jgarrigan I just stumbled across this same issue. Were you ever able to determine a resolution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants