A database of frequencies of clinical concepts observed at Columbia University Medical Center. Over 17,000 clinical concepts and 8.7M pairs of clinical concepts, including conditions, drugs, and procedures are included. The COHD RESTful API allows users to query the database.
Note: For NCATS ITRB, please also see the Translator Application Intake Form
- Clone the COHD_API github repository
git clone https://github.com/WengLab-InformaticsResearch/cohd_api.git/
cd cohd_api
- Edit the MySQL database configuration file with MySQL credentials
cohd_api/database.cnf
Note: Please request MySQL database dump file from @CaseyTa - Change
DEV_KEY
incohd_api/cohd/cohd_flask.conf
. This key allows certain privileged developer API calls. - [Optional] If necessary, edit the nginx configuration file
cohd_api/nginx.conf
- Build the COHD docker image
docker build -t cohd_image .
- Run the COHD docker container (the second port mapping to 443 is only necessary if enabling HTTPS)
docker run -d -p <HOST:PORT>:80 -p <HOST:PORT>:443 --name=cohd cohd_image
- [Optional] If necessary, use tools like certbot to enable HTTPS. In the COHD container:
- Start a shell to the COHD container
docker container exec -it cohd bash
- Use certbot to generate trusted SSL certificates
certbot certonly --webroot -w /root/certbot -d <url>
- Update the nginx configuration file:
vi /etc/nginx/nginx.conf
- Uncomment the ssl server block to listen on port 443
- Update the ssl_certificate lines with the correct location of the pubic and private keys
- Save and exit
- Test and reload the nginx configuration:
nginx -t
service nginx reload
- Start a shell to the COHD container
- [Recommended] Trigger COHD to build the OMOP-Biolink mappings
curl --request GET 'https://<LOCATION>/api/dev/build_mappings?q=<DEV_KEY_FROM_STEP_3>'
The instructions below provide guidance for deploying COHD manually to a linux server.
Python 3
Python packages
pip install flask flask_cors flask-caching pymysql requests reasoner_validator numpy scipy semantic_version apscheduler
The COHD API is served using FLASK:
FLASK_APP=cohd.py flask run
COHD is served on an AWS EC2 instance using Nginx and uWSGI. For consistency, use the approach in the following blog post: http://vladikk.com/2013/09/12/serving-flask-with-nginx-on-ubuntu/
Caveats:
- If using virtualenv, you either have to have the virtualenv directory in the same location as the cohd.py application, or specify the location of the virtualenv using the
uWSGI -H
parameter.