Code Monkey home page Code Monkey logo

adewin / summit-health-analytics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibm/example-health-analytics

0.0 2.0 0.0 5.96 MB

Summit Health is a conceptual healthcare/insurance type company. It has been around a long time, and has 100s of thousands of patient records in an SQL database connected to a mainframe. This repo houses the UI/Service a data analyst would interact with.

License: Apache License 2.0

Dockerfile 0.34% JavaScript 87.99% Shell 1.72% HTML 4.64% CSS 5.30%

summit-health-analytics's Introduction

Build Status

Summit Health Analytics

This project is a conceptual Node.js analytics web application for a health records system, designed to showcase best in class integration of modern cloud technology, in collaboration with legacy mainframe code.

Summit Health Context

Summit Health is a conceptual healthcare/insurance type company. It has been around a long time, and has 100s of thousands of patient records in a SQL database connected to a zOS mainframe.

Summit's health records look very similar to the health records of most insurance companies.

Here's a view a data analyst might see when they interact with the Summit Health Analytics Application:

Summit has recently started understanding how data science/analytics on some of the patient records, might surface interesting insights. There is lots of talk about this among some of the big data companies.

Summit has also heard a lot about cloud computing. There is a lot of legacy code in the mainframe, and it works well for now, but Summit thinks it may be a complimentary opportunity to explore some data science/analytics in the cloud.

Their CTO sees an architecture for Summit Health like this:

Architecture

Using Kubernetes

Using Cloud Foundry

  1. Data Service API acts as a data pipeline and is triggered for updating data lake with updated health records data by calling API Connect APIs associated with the zOS Mainframe.
  2. API Connect APIs process relevant health records data from zOS Mainframe data warehouse and send the data through the data pipeline.
  3. The Data Service data pipeline processes zOS Mainframe data warehouse data and updates MongoDB data lake.
  4. User interacts with the UI to view and analyze analytics.
  5. The functionality of the App UI that the User interacts with is handled by Node.js. Node.js is where the API calls are initialized.
  6. The API calls are processed in the Node.js data service and are handled accordingly.
  7. The data is gathered from the MongoDB data lake from API calls.
  8. The responses from the API calls are handled accordingly by the App UI.

Steps

Follow these steps to setup and run this code pattern locally and on the Cloud. The steps are described in detail below.

  1. Clone the repo
  2. Prerequisites
  3. Get Mapbox Access Token
  4. Run the application
  5. Deploy to IBM Cloud

1. Clone the repo

Clone the summit-health-analytics repo locally. In a terminal, run:

git clone https://github.com/IBM/summit-health-analytics
cd summit-health-analytics

2. Prerequisites

For running these services locally without Docker containers, the following will be needed:

  • MongoDB
  • NodeJS
  • NPM
  • Relevant Node Components: Use npm install in /data-service and /web

3. Get Mapbox Access Token

  1. In order to make API calls to help in populating the Mapbox map used, a Mapbox access token will be needed.
  2. Assign the access token to mapbox.accessToken in /data-service/properties.ini and mapboxAccessToken in /web/public/javascripts/properties.js.

4. Run the application

zOS Mainframe Data

If your data source for this application is on a zOS Mainframe, follow these steps for populating the datalake and running the application:

  1. Assign the API Connect URL to zsystem.api in /data-service/properties.ini
  2. Start the application by running docker-compose up --build in this repo's root directory.
  3. Once the containers are created and the application is running, use the Open API Doc (Swagger) at http://localhost:3000 and API.md for instructions on how to use the APIs.
  4. Run curl localhost:3000/api/v1/update -X PUT to connect to the zOS Mainframe and populate the data lake. For information on the data lake and data service, read the data service README.md.
  5. Once the data has been populated in the data lake, use http://localhost:4000 to access the Summit Health Analytics UI. For information on the analytics data and UI, read the web README.md.

Generate Data

If you do not have a data source for this application and would like to generate mock data, follow these steps for populating the datalake and running the application:

  1. Start the application by running docker-compose up --build in this repo's root directory.
  2. Once the containers are created and the application is running, use the Open API Doc (Swagger) at http://localhost:3000 and API.md for instructions on how to use the APIs.
  3. Use the provided generate/generate.sh script to generate and populate data. Read README.md for instructions on how to use the script. For information on the data lake and data service, read the data service README.md.
  4. Once the data has been populated in the data lake, use http://localhost:4000 to access the Summit Health Analytics UI. For information on the analytics data and UI, read the web README.md.

5. Deploy to IBM Cloud

Kubernetes

  1. To allow changes to the Data Service or the UI, create a repo on Docker Cloud where the new modified containers will be pushed to.

NOTE: If a new repo is used for the Docker containers, the container image will need to be modified to the name of the new repo used in deploy-dataservice.yml and/or deploy-webapp.yml.

export DOCKERHUB_USERNAME=<your-dockerhub-username>

docker build -t $DOCKERHUB_USERNAME/summithealthanalyticsdata:latest data-service/
docker build -t $DOCKERHUB_USERNAME/summithealthanalyticsweb:latest web/

docker login

docker push $DOCKERHUB_USERNAME/summithealthanalyticsdata:latest
docker push $DOCKERHUB_USERNAME/summithealthanalyticsweb:latest
  1. Provision the IBM Cloud Kubernetes Service and follow the set of instructions for creating a Container and Cluster based on your cluster type, Standard vs Lite.

NOTE use --sso if you have a single sign on account, or delete for username/password login

ibmcloud login --sso
  • Set the Kubernetes environment to work with your cluster:
ibmcloud cs cluster-config $CLUSTER_NAME

The output of this command will contain a KUBECONFIG environment variable that must be exported in order to set the context. Copy and paste the output in the terminal window. An example is:

export KUBECONFIG=/home/rak/.bluemix/plugins/container-service/clusters/Kate/kube-config-prod-dal10-<cluster_name>.yml

Lite Cluster Instructions

  1. Get the workers for your Kubernetes cluster:
ibmcloud cs workers <mycluster>

and locate the Public IP. This IP is used to access the Data Service and UI on the Cloud. Update the env values for HOST_IP in deploy-dataservice.yml to the Public IP and DATA_SERVER in deploy-webapp.yml to http://<Public IP>. Also in deploy-dataservice.yml, update the env value for SCHEME to http.

  1. To deploy the services to the IBM Cloud Kubernetes Service, run:
kubectl apply -f deploy-mongodb.yml
kubectl apply -f deploy-dataservice.yml
kubectl apply -f deploy-webapp.yml

## Confirm the services are running - this may take a minute
kubectl get pods
  1. Use http://PUBLIC_IP:32001 to access the UI and the Open API Doc (Swagger) at http://PUBLIC_IP:32000 for instructions on how to make API calls.

Standard Cluster Instructions

  1. Run ibmcloud cs cluster-get <CLUSTER_NAME> and locate the Ingress Subdomain and Ingress Secret. This is the domain of the URL that is to be used to access the Data Service and UI on the Cloud. Update the env values for HOST_IP in deploy-dataservice.yml to api.<Ingress Subdomain> and DATA_SERVER in deploy-webapp.yml to https://api.<Ingress Subdomain>. Also in deploy-dataservice.yml, update the env value for SCHEME to https. In addition, update the host and secretName in ingress-dataservice.yml and ingress-webapp.yml to Ingress Subdomain and Ingress Secret.

  2. To deploy the services to the IBM Cloud Kubernetes Service, run:

kubectl apply -f deploy-mongodb.yml
kubectl apply -f deploy-dataservice.yml
kubectl apply -f deploy-webapp.yml

## Confirm the services are running - this may take a minute
kubectl get pods

## Update protocol being used to https
kubectl apply -f ingress-dataservice.yml
kubectl apply -f ingress-webapp.yml
  1. Use https://<INGRESS_SUBDOMAIN> to access the UI and the Open API Doc (Swagger) at https://api.<INGRESS_SUBDOMAIN> for instructions on how to make API calls.

Cloud Foundry

  1. Provision two SDK for Node.js applications. One will be for ./data-service and the other will be for ./web.

  2. Provision a Compose for MongoDB database.

  3. Update the following in the manifest.yml file:

  • name for both Cloud Foundry application names provisioned from Step 1.

  • services with the name of the MongoDB service provisioned from Step 2.

  • HOST_IP and DATA_SERVER with the host name and domain of the data-service from Step 1.

  • MONGODB with the HTTPS Connection String of the MongoDB provisioned from Step 2. This can be found under Manage > Overview of the database dashboard.

  1. Connect the Compose for MongoDB database with the data service Node.js app by going to Connections on the dashboard of the data service app provisioned and clicking Create Connection. Locate the Compose for MongoDB database you provisioned and press connect.

  1. To deploy the services to IBM Cloud Foundry, go to one of the dashboards of the apps provisioned from Step 1 and follow the Getting Started instructions for connecting and logging in to IBM Cloud from the console (Step 3 of Getting Started). Once logged in, run ibmcloud app push from the root directory.

  2. Use https://<WEB-HOST-NAME>.<WEB-DOMAIN> to access the UI and the Open API Doc (Swagger) at https://<DATA-SERVICE-HOST-NAME>.<DATA-SERVICE-DOMAIN> for instructions on how to make API calls.

License

This code pattern is licensed under the Apache License, Version 2. Separate third-party code objects invoked within this code pattern are licensed by their respective providers pursuant to their own separate licenses. Contributions are subject to the Developer Certificate of Origin, Version 1.1 and the Apache License, Version 2.

Apache License FAQ

summit-health-analytics's People

Contributors

max-shapiro32 avatar maxshapiro32 avatar antonmc avatar scottdangelo avatar stevemart avatar

Watchers

James Cloos avatar dongjianxiao avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.