{"id":13703921,"url":"https://github.com/Senzing/mapper-npi","last_synced_at":"2025-05-05T09:32:20.025Z","repository":{"id":38338122,"uuid":"314595546","full_name":"Senzing/mapper-npi","owner":"Senzing","description":"Map NPPES NPI Registry to Senzing format.","archived":false,"fork":false,"pushed_at":"2024-08-22T15:47:29.000Z","size":194,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-08-22T17:43:44.582Z","etag":null,"topics":["mapper","senzing-g2-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Senzing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-20T15:36:42.000Z","updated_at":"2024-08-22T15:47:31.000Z","dependencies_parsed_at":"2024-07-08T18:56:36.963Z","dependency_job_id":null,"html_url":"https://github.com/Senzing/mapper-npi","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senzing%2Fmapper-npi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senzing%2Fmapper-npi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senzing%2Fmapper-npi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Senzing%2Fmapper-npi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Senzing","download_url":"https://codeload.github.com/Senzing/mapper-npi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224439586,"owners_count":17311478,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mapper","senzing-g2-python"],"created_at":"2024-08-02T21:01:01.782Z","updated_at":"2024-11-13T11:30:25.085Z","avatar_url":"https://github.com/Senzing.png","language":"Python","funding_links":[],"categories":["Mapper"],"sub_categories":[],"readme":"# mapper-npi\n\n## Overview\n\nThe [npi_mapper.py](npi_mapper.py) python script converts the NPPES NPI Registry located\n[here](https://npiregistry.cms.hhs.gov).  It is a free directory of all active National Provider\nIdentifier (NPI) records provided by US government.\n\nLoading this data into Senzing requires additional features and configurations. These are contained in the\n[npi_config_updates.g2c](npi_config_updates.g2c) file.\n\nUsage:\n\n```console\npython npi_mapper.py --help\nusage: npi_mapper.py [-h] -i SOURCEDIR -f FILEPERIOD -o OUTPUTFILEPATH [-l LOGFILENAME]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -i SOURCEDIR, --sourceDir SOURCEDIR\n                        directory in which the source files are located\n  -f FILEPERIOD, --filePeriod FILEPERIOD\n                        the period portion of the NPPES file naming convention such as \"20050523-20201108\"\n  -o OUTPUTFILEPATH, --outFileDir OUTPUTFILEPATH\n                        the file or directory to write the JSON files to\n  -l LOGFILENAME, --logFileName LOGFILENAME\n                        optional statistics output file name\n```\n\n## Contents\n\n1. [Prerequisites](#prerequisites)\n2. [Installation](#installation)\n3. [Configuring Senzing](#configuring-senzing)\n4. [Running the mapper](#running-the-mapper)\n5. [Loading into Senzing](#loading-into-senzing)\n6. [Mapping other data sources](#mapping-other-data-sources)\n\n### Prerequisites\n\n- python 3.6 or higher\n- Senzing API version 2.1 or higher\n- pandas (pip3 install pandas)\n\n### Installation\n\nPlace the following files on a directory of your choice ...\n\n- [npi_mapper.py](npi_mapper.py)\n- [npi_config_updates.g2c](npi_config_updates.g2c)\n\n### Configuring Senzing\n\n*Note:* This only needs to be performed one time! In fact you may want to add these configuration updates to a master configuration file for all your data sources.\n\nFrom your Senzing project directory:\n\n```console\npython3 G2ConfigTool.py \u003cpath-to-file\u003e/npi_config_updates.g2c\n```\n\nThis will step you through the process of adding the data sources, features, attributes and any other settings needed to load this watch list data into \nSenzing. After each command you will see a status message saying \"success\" or \"already exists\".  For instance, if you run the script twice, the second time through they will all \nsay \"already exists\" which is OK.\n\n### Running the mapper\n\nDownload the raw files from: [https://download.cms.gov/nppes/NPI_Files.html](https://download.cms.gov/nppes/NPI_Files.html)\n\nThe full monthly download contains many files.   These are the ones actually used by this mapper ...\n\n- npidata_pfile_20050523-20201108.csv       main provider file\n- othername_pfile_20050523-20201108.csv     additional names providers are known by\n- endpoint_pfile_20050523-20201108.csv      emails and websites for providers as well as their affiliated entities\n- pl_pfile_20050523-20201108.csv            additional locations for each provider\n\n*Note the period date range \"20050523-20201108\" will be based on the date you download the zip file.*\n\nThen run the mapper.  Example usage:\n\n```console\npython3 npi_mapper.py -i ./NPPES_Data_Dissemination_November_2020/ -f 20050523-20201108 -o ./output \n```\n\nBecause, the -o parameter only specifies a directory, the following 4 output files will be created:\n- NPI_LOCATIONS_20050523-20201108.json\n- NPI_OFFICIALS_20050523-20201108.json\n- NPI_PROVIDERS_20050523-20201108.json\n- NPI_AFFILIATIONS_20050523-20201108.json\n\nor to create one file with all the records, specify the path and file name in the -o paramter like so ...\n\n```console\npython3 npi_mapper.py -i ./NPPES_Data_Dissemination_November_2020/ -f 20050523-20201108 -o ./output/npi-yyyy-mm-dd.json\n```\n\nFinally, specifying the -l logFileName writes out the stats and examples of what gets mapped into Senzing.   It can be quite useful \nduring development and debugging of mapping issues.\n\n\n### Loading into Senzing\n\nIf you use the G2Loader program to load your data, from your project directory:\n\n```console\npython3 G2Loader.py -f ./output/NPI_LOCATIONS_20050523-20201108.json\npython3 G2Loader.py -f ./output/NPI_OFFICIALS_20050523-20201108.json\npython3 G2Loader.py -f ./output/NPI_PROVIDERS_20050523-20201108.json\npython3 G2Loader.py -f ./output/NPI_AFFILIATIONS_20050523-20201108.json\n```\n\nor if those are the only files in the output directory you can use a wild card like so ...\n\n```\npython3 G2Loader.py -f ./output/NPI*.json\n```\n\nThis data set currently contains about 7 million providers and yields a total of 8.5 million records with the additional entities created for officials, locations and affiliations.\nIt may take a few hours to load depending on your harware.\n\nIf you use the API directly, then you just need to perform an addRecord() for each line of each file.\n\n### Mapping other data sources\n\nWhile not required, look for the following identifiers in your other data sets:\n- NPI number\n- Other provider licenses issued by states\n- Medicare provider IDs\n- Any other provider IDs \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSenzing%2Fmapper-npi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSenzing%2Fmapper-npi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSenzing%2Fmapper-npi/lists"}