Skip to content
Flask API for DDC Prescription Score
Python
Branch: master
Clone or download
Latest commit c0b54ca Jul 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
examples
tests
upload
.gitignore
.travis.yml
LICENSE
README.md
ddcapi.py
outliers.py
requirements-zappa.txt fix zappa integration #11 Jul 7, 2019
requirements.txt
wsgi.py
zappa_settings.json

README.md

ddc-api

Build Status

Flask API for DDC Prescription Score

Tutorial

How To use DDC-API

1. Install

First, install the dependencies packages.

git clone https://github.com/nlp-pucrs/ddc-api.git
cd ddc-api
pip3 install -r requirements.txt --user --upgrade

2. Run API

Start DDC API

python3 ./ddcapi.py

3. Test the API

3.1 Request details

POST /ddc-api/score
Content-Type: multipart/form-data;boundary=----XXXX
Host: 127.0.0.1

----XXXX
Content-Disposition: form-data; name="userid"

hospital
----XXXX
Content-Disposition: form-data; name="file"; filename="test.csv.gz"
Content-Type: application/x-gzip

<multipart-file-content>
----XXXX--

3.2 Requesting with curl

curl -X POST -F "userid=hospital" -F 'file=@data/test.csv.gz' http://127.0.0.1:5000/score -o results.csv.gz

3.3 Examples

4. Run Unit Test

python3 -m pytest

5. CSV Format Example

The file must have the same header (columns names) and types:

https://github.com/nlp-pucrs/ddc-api/blob/master/data/test.csv

6. Zappa Deploy

  • Install Zappa
  • Configure zappa_settings.json and run the code below
  • Make sure you have a valid AWS account, your AWS credentials file is properly installed.
virtualenv env
source env/bin/activate
pip install -r requirements-zappa.txt
zappa deploy dev

PUCRS A.I. in HealthCare

This project belongs to GIAS at PUCRS, Brazil

You can’t perform that action at this time.