Skip to content
Centers for Medicare and Medicaid Services (CMS) National Provider Identifier (NPI) REST service built atop Ratpack, RxMongo hosted at Heroku.
Groovy
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
.gitignore
Procfile
README.md
app.json
build.gradle
circle.yml
gradlew
gradlew.bat
settings.gradle
system.properties

README.md

cms-npi-rest

Centers for Medicare and Medicaid Services (CMS) National Provider Identifier (NPI) REST service built atop Ratpack, RxMongo hosted at Heroku.

Data load procedures:

  1. Read the Data Dissemination page for the National Provider Identifier Standard (NPI). Specifically, it's good to read the Readme know and unerstand the code values.
  2. Follow the link the NPI Downloadable File.
  3. Download the single zip file under the "Full Replacement Monthly NPI File" heading (should be half a gigabyte or so).
  4. Unpack the file
  5. With the latest Java 8 JDK and Groovy installed (recommend via sdkman), execute the CSV conversion script found in the data-cleaning-scripts branch.
  6. Place the script in the same directory as the csv file. Modify the script on line 24 and execute. I intentionally didn't want the ENTIRE dataset for this project, so I calculate the weights for each state within the US and use those values to randomly pick individuals and organizations for output. The script is straight forward -- modification to output everything is simple enough. The script will produce two JSON files, individuals.json and organizations.json.
  7. Import script output into Mongo
  • mongoimport -v --host=127.0.0.1 --port=27017 --db cms-npi-rest --collection individuals individuals.json
  • mongoimport -v --host=127.0.0.1 --port=27017 --db cms-npi-rest --collection organizations organizations.json
  1. Establish indexes on organizations collection
db.organizations.createIndex(
  {
    npiCode: 1,
    "practiceAddress.postalCode": 1,
  },
  {
    name: "Organizations Code and PostalCode Index"
  }
)

db.organizations.createIndex(
  {
    name: "text",
    otherName: "text"
  },
  {
    name: "Organizations Text Index"
  }
)
  1. Establish indexes on individuals
db.individuals.createIndex(
  {
    npiCode: 1,
    "practiceAddress.postalCode": 1,
  },
  {
    name: "Individuals Code and PostalCode Index"
  }
)

db.individuals.createIndex(
  {
    firstName: "text",
    middleName: "text",
    lastName: "text"
  },
  {
    name: "Individuals Text Index"
  }
)

Deploy

You can’t perform that action at this time.