The purpose of the project is to provide a GraphQL API to multiple data sources related to healthcare costs and services.
The CMS-Utilization-DB is a containerized PostgreSQL instance loaded with millions of records related to healthcare costs and services. Specifically, the database holds 2016 CMS Utilization & Payment Data , which is a data set published by the U.S. Centers for Medicare & Medicaid Services.
CMS-Utilization-Search is a containerized ElasticSearch instance, seeded with records from the CMS-Utilization-DB. This Elastic service powers the autocomplete, suggest and geo search features provided by this API.
The NPI Registry, is a goverment API that provides access to physicians' National Provider Identifier (NPI) registration records.
Elasticsearch requires the ability to create many memory-mapped areas. (Details Here). Before you run Elastic and attempt to seed it with 2M+ records, run the following to set the max_map_count to the min amount required by Elastic.
# increase max_map_count
sysctl -w vm.max_map_count=262144Once that's done, you can start and seed the Elastic instance:
#------------------
# STARTS
#------------------
# - local postgres
# - elastic service
# - containerized GraphQL API
#------------------
make start
# seed the elastic instance with precompiled records
make seedThis seeding process will take 45 mins (sample time report provided below) to complete on the first run. Subsequent starts rely on persistent data.
:: real 42m58.263s
:: user 0m0.884s
:: sys 0m1.160s
The database & index setup processes are well detailed in their respective repos. If you have any issues, reference their respective readmes.
The resources in this API are well documented. You can use a variety of methods to interact with this service, but we recomment the following:
-
GraphQL Playground The GraphQL Playground provides a native API client and interactive schema inspectors -- so for anyone new to the service and the available resources -- this feature could be of some value.
-
Insomnia API Client is an API client that offers great support for building out (and making) GraphQL service calls. The client is very similar to Postman, but with better native support for GraphQL calls.
-
Insomnia API Workplace Import I've defined a comprehensive workplace that you can import into insomnia to get you started. The workplace includes simple GraphQL calls and more complex calls -- like combinations (page count & paginated records). Be sure to update the environment variables if you opt to run the service on a custom port or a non localhost machine.
# starts (and seeds) local postgres & elastic service
make run
# seed the elastic instance with precompiled records
make seed
# install nodemon (globally -- because it's awesome)
npm i -g nodemon
# install and run nodejs app via nodemon
npm i
npm run watch
This project uses SemVer for versioning. For the versions available, see the tags on this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details.