Code Monkey home page Code Monkey logo

nih-ipad-app-end-point's Introduction

nih-ipad-app-end-point

An end-point for centrally storing data from the NIH iPad app

The problem of the last mile for a large multi-site study can be solved by introducing efficient and automatic methods for the centralized collection of data. This web-based server software receives and stores data from a large number of devices in a secure way.

Data collection instrument

The NIH Toolbox application (http://www.nihtoolbox.org) provides a large number of assessment instruments that can be captured on an iPAD. This project provides a simple backend that allows users to capture results from multiple iPADs at a central location.

Setup on the server

The server based code consists of a single php script. You'll need docker and docker-compose set up.

Initial Setup

# build image
docker-compose build

# create `data` folder into which
# the apache process can write to (user 33)
mkdir data && sudo chown -R 33:33 ./data

# blank out the `passwords` file, so test account gets removed
cp /dev/null ./passwords

Starting the server:

docker-compose up -d

It should now be available in http://localhost:8080/ .

โš ๏ธ Make sure to place this behind https reverse proxy to encrypt traffic, otherwise it will not be HIPAA-compliant.

Creating a New Project/Site

Multiple projects/sites are supported by creating a user/password combo specific to that site. To create a new site ("site_a"), just run this command, and type the password twice.

docker exec -it nih_toolbox htpasswd -B /var/www/passwords site_a

Data for this new project will be available in ./data/site_a.

Setup on the client

The iPAD app has a field to enter the URL for your central data collection site together with the user name, which is the site name, and the password of that site. If the test connection works (test) you can upload the data to the server. All uploaded datasets appear inside the site directories "./data/site_a" and are labeled with the date and time of the upload. The content of each file is the collected data as a comma-separated table of values.

Technical Notes

In order to test the server one can emulate the actions that the NIH Toolbox iPad application performs.

Login

curl -F "action=test" https://<your server>

Results in: Error HTML "Unauthorized"

curl --user "site_a" -F "action=test" https://<your server>

Will asks for password for the given site, responds with { "message": "ok" }

Store files

curl --user "site_a" -F "action=store" https://<your server>

Result: Error json message: {"message":"Error: no files attached to upload"}

echo "1,2,3,4" > test.csv
curl --user "site_a" -F "action=store" -F "[email protected]" https://<your server>

Result: A single file is stored, json object with error=0 returned

echo "1,2,3,4,5" > test2.csv
curl --user "site_a" -F "action=store" -F "upload[][email protected]" -F "upload[][email protected]" https://<your server>

Result: Two files are stored on the server, json object with error=0 returned

Funding Message

This software was created with support by the National Institute On Drug Abuse of the National Institutes of Health under Award Number U24DA041123. The content is solely the responsibility of the authors and does not necessarily represent the official views of the National Institutes of Health.

nih-ipad-app-end-point's People

Contributors

mobalt avatar alexdecastro avatar haukebartsch avatar

Forkers

nrgxnat

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.