/ohdsi

:whale2: OHDSI stack Docker configuration

Primary LanguageShellMIT LicenseMIT

King's College London Health Informatics (kclhi) OHDSI stack

Docker configuration 🐋

Prerequisites

Before starting, download and install docker (machine).

Setup

  1. Checkout OMOP CDM v5.2.2:

git clone -b v5.2.2 git@github.com:OHDSI/CommonDataModel.git db/cdm

        or v6.0.0:

git clone -b v6.0.0 git@github.com:OHDSI/CommonDataModel.git db/cdm

  1. Vocabulary
  • CDM v5.2.2: Download vocabulary from Athena into a folder called db/vocabulary. Minimum codesets: SNOMED, ICD9CM, ICD9Proc, CPT4, HCPCS, RxNorm, NDC, Gender, Race, CMS Place of Service, Ethnicity, Currency and RxNorm. Ensure all instructions in the downloaded Athena folder are followed.

  • CDM v6.0.0: Repeat as above, but downloading vocabulary to etl/vocabulary.

  1. Initially run the broadsea-webtools service, and obtain a DDL to define the tables of a db/results schema.
docker-compose up -d broadsea-webtools
curl "http://localhost:8080/WebAPI/ddl/results?dialect=postgresql&vocabSchema=cdm" >> db/results.sql
docker-compose down
  1. Data
  • CDM v5.2.2: Download the SynPUF 1000 person dataset from ltscomputingllc into a folder called db/data.

  • CDM v6.0.0: Clone the Synthea patient dataset generator into etl/data and follow the instructions within the repository to generate a suitable dataset.

  1. Build the services (target v6 compose file with -f docker-compose.v6.yml for CDM v6.0.0, for this and subsequent docker commands).
docker-compose build
  1. Run the services, to initialise the database, tracking progress. NB. this is an intensive task, which may require a reset (either indirectly via a restart, or directly by (carefully) removing resources using docker system prune -a) before proceeding:
docker-compose up -d db
docker logs -f ohdsi_db_1
  1. Start the (remaining) broadsea containers, prompting the webtools container to run its migrations against the (now initialised) database:
docker-compose up -d
  1. Enter the db container, and execute the post-migration OHDSI script:
docker exec -it ohdsi_db_1 /bin/bash
psql omop --user user -f ohdsi.sql
  1. Restart the broadsea containers, so they can leverage the information provided by the post-migration script.
docker restart ohdsi_broadsea-webtools_1
docker restart ohdsi_broadsea-methods-library_1
  1. Open RStudio at http://localhost:8787 and login with the username 'rstudio' and the password 'mypass'. Execute the following commands to create the remainder of the tables required by ATLAS and the API:
library(Achilles)

connectionDetails <- createConnectionDetails(dbms = "postgresql",
                                             server = "<DB container IP>/omop",
                                             user = "user",
                                             password = "password")

achilles(connectionDetails = connectionDetails,
         cdmDatabaseSchema = "cdm",
         resultsDatabaseSchema = "results",
         vocabDatabaseSchema = "cdm",
         sourceName = "OHDSI-CDMV5",
         cdmVersion = "5.2.2",
         numThreads = 1,
         runHeel = FALSE)
  1. Confirm cohorts can be successfully generated at http://localhost:8080/atlas/#/cohortdefinitions.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

kclhi

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments