1.0.0 • Published 2 years ago
@evokegroup/nppes
Library for querying the NPPES NPI Registry. See the NPPES API help page.
NppesClient
constructor()
| Parameter | Type | Default | Description |
|---|
| url | string | https://npiregistry.cms.hhs.gov/api/ | |
| version | string | 2.1 | |
Methods
search()
| Parameter | Type | Default | Description |
|---|
| params | ISearchParams | | The search parameters |
| opts | ISearchOpts | {} | Search options |
returns Promise<ISearchResults>
Example
Get a result for a single NPI number.
import { NppesClient } from '@evokegroup/nppes';
const client = new NppesClient();
client.search({ number: '0123456789' })
.then((searchResults) => {
// do something
})
.catch((ex) => {
// do something
});
Example
Get all individuals in a given city/state with a given last name
import { NppesClient, EnumerationType } from '@evokegroup/nppes';
const client = new NppesClient();
client.search({
enumeration_type: EnumerationType.Individual,
last_name: 'Doe',
city: 'Brooklyn',
state: 'NY'
}, {
retrieveAll: true
})
.then((searchResults) => {
// do something
})
.catch((ex) => {
// do something
});
Example
Get all individuals in a given postal code who have a given specialty
import { NppesClient, EnumerationType } from '@evokegroup/nppes';
const client = new NppesClient();
client.search({
enumeration_type: EnumerationType.Individual,
taxonomy_description: 'gastro*',
postal_code: '12345'
}, {
retrieveAll: true
})
.then((searchResults) => {
// do something
})
.catch((ex) => {
// do something
});
EnumerationType
| Name | Value |
|---|
| Individual | NPI-1 |
| Organization | NPI-2 |
NamePurpose
'AO' | 'Provider'
AddressPurpose
'LOCATION' | 'MAILING' | 'PRIMARY' | 'SECONDARY'
ISearchParams
| Name | Type | Default | Description |
|---|
| number | string | | The NPI number |
| enumeration_type | EnumerationType | | The type of records to return |
| taxonomy_description | string | | |
| name_purpose | NamePurpose | | |
| first_name | string | | |
| use_first_name_alias | boolean | | |
| last_name | string | | |
| organization_name | string | | |
| address_purpose | AddressPurpose | | |
| city | string | | |
| state | string | | |
| postal_code | string | | |
| country_code | string | | |
| limit | number | 10 | |
| skip | number | | |
ISearchOpts
| Name | Type | Default | Description |
|---|
| retrieveAll | boolean | | Retreive all NPI records up to RESULT_MAX |
ISearchResults
| Name | Type |
|---|
| result_count | number |
| results | ISearchResult[] |
ISearchResult
| Name | Type |
|---|
| created_epoch | number |
| enumeration_type | EnumerationType |
| last_updated_epoch | number |
| number | string |
| addresses | IResultAddress[] |
| practiceLocations | IResultAddress[] |
| basic | IResultIndividualName ¦ IResultOrganizationName |
| taxonomies | IResultTaxonomy[] |
| identifiers | IResultIdentifier[] |
| other_names | IResultIndividualOtherName[] ¦ IResultOrganizationOtherName[] |
| endpoints | IResultEndpoint[] |
IResultBasic
| Name | Type |
|---|
| enumeration_date | string |
| last_updated | string |
| status | string |
| replacement_npi | string |
| deactivation_reason_code | string |
| deactivation_date | string |
| reactivation_date | string |
| certification_date | string |
IResultIndividualName
extends IResultBasic
| Name | Type |
|---|
| first_name | string |
| last_name | string |
| middle_name | string |
| credential | string |
| sole_proprietor | string |
| gender | string |
| name_prefix | string |
| name_suffix | string |
IResultOrganizationName
extends IResultBasic
| Name | Type |
|---|
| ein | string |
| organization_name | string |
| organizational_subpart | string |
| authorized_official_first_name | string |
| authorized_official_last_name | string |
| authorized_official_middle_name | string |
| authorized_official_telephone_number | string |
| authorized_official_title_or_position | string |
| authorized_official_name_prefix | string |
| authorized_official_name_suffix | string |
| authorized_official_credential | string |
| parent_organization_legal_business_name | string |
| parent_organization_ein | string |
IResultOtherName
| Name | Type |
|---|
| type | string |
| code | string |
IResultIndividualOtherName
extends IResultOtherName
| Name | Type |
|---|
| first_name | string |
| last_name | string |
| middle_name | string |
| prefix | string |
| suffix | string |
IResultOrganizationOtherName
extends IResultOtherName
| Name | Type |
|---|
| organization_name | string |
IResultAddress
| Name | Type |
|---|
| country_code | string |
| country_name | string |
| address_purpose | string |
| address_type | string |
| address_1 | string |
| address_2 | string |
| city | string |
| state | string |
| postal_code | string |
| telephone_number | string |
| fax_number | string |
IResultTaxonomy
| Name | Type |
|---|
| code | string |
| taxonomy_group | string |
| desc | string |
| state | string |
| license | string |
| primary | boolean |
IResultIdentifier
| Name | Type |
|---|
| code | string |
| desc | string |
| issuer | string |
| identifier | string |
| state | string |
IResultEndpoint
| Name | Type |
|---|
| endpointType | string |
| endpointTypeDescription | string |
| endpoint | string |
| endpointDescription | string |
| affiliation | string |
| affliationName | string |
| use | string |
| useDescription | string |
| contentType | string |
| contentTypeDescription | string |
| contentOtherDescription | string |
| address_type | string |
| address_1 | string |
| address_2 | string |
| city | string |
| state | string |
| postal_code | string |
| country_code | string |
| country_name | string |