The purpose of this API is to ingest HEDIS data from pyspark, save it, and then use it to populate the Sarawati Dashboard.
- Make sure you have Mongo set up on your machine; if not follow this guide to install and get up and runnning.
Or, run docker pull mongo
and then docker run -d --name=mongo --network cp-all-in-one-community_default -p 27017:27017 mongo
to setup a fast instance.
- Run
cp .env.example .env
- Run
yarn
and thenyarn start
- Run
node test-data-generator.js -d 30
Or, using postman, hit POST localhost:4000/api/v1/measures/bulk
with the data in test/seed-data
folder to seed the db
- Using the browser or postman, you can view all of that data with
GET localhost:4000/api/v1/measures/
- Using postman, you can also add individual measures with
POST localhost:4000/api/v1/measures/
but that isn't a use case we have currently. - You can search for individual results using any combination of the parameters for
GET localhost:4000/api/v1/measures/search?measurementType=<type>&memberId=<id>
- To add the measure results, copy the JSON from
test/result-data/measure-results.json
place in the body forPOST http://localhost:4000/api/v1/measures/storeResults
- After measure results are created predicition data can be created through
saraswati-time-series
withGET http://localhost:5050/get_predictions/<measure>
- Metadata will be automatically pushed to the mongo collection on start-up. To refresh your data stop HeRA, drop the
hedis_info
collection, and then restart HeRA. To do that manually go toinitialize/hedis-info.json
for the body andPOST http://localhost:4000/api/v1/measures/info
Due to recent changes, you need to run this event streaming.
docker run -d --pull=always --name=redpanda1 --network cp-all-in-one-community_default -p 9092:9092 -p 9644:9644 docker.vectorized.io/vectorized/redpanda:latest redpanda start --overprovisioned --smp 1 --memory 1G --reserve-memory 0M --node-id 0 --check=false
If you have issues, try using the advertised endpoints (normally these would go into a config file but dev purposes, it's fine):
docker run -d --pull=always --name=redpanda1 --network cp-all-in-one-community_default -p 9092:9092 -p 9644:9644 docker.vectorized.io/vectorized/redpanda:latest redpanda start --overprovisioned --smp 1 --memory 1G --reserve-memory 0M --node-id 0 --check=false --kafka-addr "PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092" --advertise-kafka-addr "PLAINTEXT://redpanda1:29092,OUTSIDE://redpanda1:9092"