medal-data
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
medal-data [2021/12/17 09:12] – arnaud_poletto | medal-data [2024/01/12 11:35] (current) – [medAL-data User Guide and Troubleshooting] Sylvain | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== medAL-data Documentation ====== | ====== medAL-data Documentation ====== | ||
- | ===== medAL-data | + | medAL-//data// is a National server that stores local data for the clinical follow-up and feeds dashboards with completely anonymized data. |
- | ==== Purpose and Scope ==== | ||
- | This document lists instructions to setup a medAL// | ||
+ | ===== medAL-data Setup and Management ===== | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * {{ :: | ||
+ | * Data model (updated 20230123): | ||
+ | {{ : | ||
- | ==== Initial Requirements ==== | ||
- | - Linux Server. Minimal requirements: | ||
- | - 8GB RAM | ||
- | - 300GB Disk capacity | ||
- | - Operating System: Ubuntu >= 18.04 | ||
- | - Controlling workstation (Linux / MacOS / Windows) with the following installed: | ||
- | - git version control software (see https:// | ||
- | - bash terminal (for windows see : https:// | ||
- | - Domain Name (In the installation we will use the name // | ||
+ | ===== medAL-data User Guide and Troubleshooting ===== | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
+ | * [[medal-data: | ||
- | ===== Manual Installation ===== | ||
- | ==== Environment Setup ==== | ||
- | |||
- | Open up two terminals **[t_local]** and **[t_remote]** on the controlling workstation, | ||
- | < | ||
- | |||
- | |||
- | |||
- | |||
- | === Dokku Installation on Remote Server === | ||
- | |||
- | - **[t_remote]** Install dokku with the following commands: \\ < | ||
- | wget https:// | ||
- | sudo DOKKU_TAG=v0.24.10 bash bootstrap.sh | ||
- | </ | ||
- | |||
- | - **[t_local]** On the local workstation, | ||
- | | ||
- | cat ~/ | ||
- | </ | ||
- | ssh-keygen -t rsa | ||
- | </ | ||
- | | ||
- | |||
- | |||
- | |||
- | |||
- | ==== Application Deployment ==== | ||
- | |||
- | - **[t_remote]** Run the following commands to create and configure the dokku app for the medAL// | ||
- | # Create the App | ||
- | dokku apps:create medal-data | ||
- | # Install the postgres DB plugin | ||
- | sudo dokku plugin: | ||
- | # Create Database | ||
- | dokku postgres: | ||
- | # Link the App to the database | ||
- | dokku postgres: | ||
- | # Set Config variables for Laravel | ||
- | dokku config:set medal-data DB_CONNECTION=postgres | ||
- | # Add the PHP buildpack to the apps config | ||
- | dokku config:set medal-data BUILDPACK_URL=" | ||
- | # Configure the storage folder of the server | ||
- | mkdir -p / | ||
- | mkdir -p / | ||
- | mkdir -p / | ||
- | mkdir -p / | ||
- | mkdir -p / | ||
- | # give rights to herokuish | ||
- | chown -R 32767:32767 / | ||
- | dokku storage: | ||
- | # set the scale of the application | ||
- | dokku ps:scale medal-data web=1 worker=1 | ||
- | </ | ||
- | |||
- | - **[t_local]** On the local workstation, | ||
- | git clone https:// | ||
- | cd liwi-main-data </ | ||
- | - **[t_local]** Do a copy the '' | ||
- | - **[t_remote]** On the remote server, paste the content at the end of the following file: ''/ | ||
- | - **[t_local]** Link and deploy the server with the following git commands (replace **example.com** with your own domain name): \\ < | ||
- | git remote add dokku dokku@example.com: | ||
- | git push dokku master | ||
- | </ | ||
- | 6. **[t_remote]**: | ||
- | | ||
- | dokku config:set medal-data APP_KEY=$(dokku run medal-data php artisan --no-ansi key: | ||
- | ``` | ||
- | 7. **[t_remote]**: | ||
- | | ||
- | dokku run medal-data php artisan passport: | ||
- | | ||
- | 8. **[t_remote]**: | ||
- | | ||
- | dokku run medal-data php artisan migrate: | ||
- | ``` | ||
- | If you wish to only migrate the database then run: | ||
- | | ||
- | dokku run medal-data php artisan migrate --force | ||
- | ``` | ||
- | =====Health Facility Setup & Device Registration===== | ||
- | |||
- | In this section, we show how to use the new interface to create health facilities and assign to them devices such as medAL-*reader* and medAL-*hub* as well as specific algorithm versions that can fetched by authorized devices. | ||
- | |||
- | ====Health Facility Creation==== | ||
- | To start, login with a user which has the `Logistician` role. (if the database is seeded then there is a default role with u: `logistician@dynamic.com`, | ||
- | <img src=" | ||
- | When creating a medal-*hub* device, a redirection URL must be specified in order to enroll the device later on. This redirect URL should correspond to the address of the device (+ endpoint TBD) on the local network when registering it. | ||
- | |||
- | ====Device Assignment==== | ||
- | To assign a Device to a health facility, head to the health facility management panel and click on the `Devices` button on the row corresponding to the health facility. A window will open up allowing to assign free devices to this health facility. | ||
- | <img src=" | ||
- | |||
- | ====Algorithm Version Assignment==== | ||
- | Similarly, medAL-*creator* algorithm versions can be assigned to health facilities by clicking the `Algorithms` button on the row corresponding to the health facility. The window will show two dropdown lists where an algorithm and corresponding version can be assigned. When a version is replaced, the older versions will appear in the table below. Note that choosing a version for which a *json* has not been properly generated on the *creator* server will result in an error. | ||
- | <img src=" | ||
- | |||
- | ===Device API=== | ||
- | When devices and an algorithm version is assigned to a health facility, devices can request access tokens from the medAL-*data* server in order to authenticate to medAL-*data*' | ||
- | |||
- | ===Getting a Token with PKCE in Postman=== | ||
- | In order to get a token and a refresh token, the PKCE OAuth flow must be used. For the example above, this can be tested using the postman collection' | ||
- | |||
- | ===Protected Routes=== | ||
- | The protected routes allow devices to: | ||
- | - Upload medical cases (to be integrated still) | ||
- | - Fetch information from the health facility such that the pin code and hub IP | ||
- | - Upload its own device information such as mac address, os etc.. | ||
- | - Fetch the json of the algorithm version that is assigned to this health facility | ||
- | You can try out these routes using the Postman collection replacing the `token` variable with the one received using the PKCE flow. | ||
- | |||
- | |||
- | ====Passport Installation==== | ||
- | In order to install passport we had to make slight changes of the laravel version currently used by this server. Originally, the `composer.json` file had the following version: | ||
- | ```json | ||
- | " | ||
- | ... | ||
- | " | ||
- | ... | ||
- | }, | ||
- | ``` | ||
- | Which we changed to: | ||
- | ```json | ||
- | " | ||
- | .... | ||
- | " | ||
- | ... | ||
- | }, | ||
- | ``` | ||
- | for the passport installation to work properly. After changing the `composer.json` we run `composer update` followed by `composer require laravel/ | ||
- | |||
- | =====Database model===== | ||
- | {{:: |
medal-data.1639728759.txt.gz · Last modified: 2021/12/17 09:12 by arnaud_poletto