Skip to content

jidiazhernandez/opencodelists

 
 

Repository files navigation

OpenCodelists

OpenCodelists is a rapidly-changing work in progress. It will be a platform for the development and dissemination of codelists for use in medical research.

It is part of the OpenSAFELY project, and is currently served from codelists.opensafely.org.

It hosts codelists used in our paper on factors associated with COVID-19-related hospital death in the linked electronic health records of 17 million adult NHS patients.

Repo structure

There are the usual config files in the root of the repo.

opencodelists/

The "project root", containing settings.py etc. Also an app, with models for users, organisations, and projects.

codelists/

The app with models and views for viewing, downloading, creating, and updating codelists.

coding_systems/

A directory containing one app per coding system. Each of these apps will have a common structure, which has not yet been codified.

mappings/

A directory containing one app per mapping between coding systems. Each of these apps will have a common structure, which has not yet been codified.

templates/

Templates.

deploy/

Resources for deployment. Deployment is via Fabric.

scripts/

A place to put scripts to be run via runscript.

Development

To install dependencies:

  • Run pip install -r requirements.txt
  • Run npm install

To update dependencies:

  • Edit requirements.in and run pip-compile
  • Run npm --save[-dev] ...

To build JS:

  • Run npm run watch

To run tests:

  • pytest (or ./manage.py test)
  • npm run test

To check formatting:

  • make format lint sort

To fix formatting:

  • make fix

To set up tooling via a pre-commit hook:

  • pre-commit install

To use Django Debug Toolbar in development, set DDT_ENABLED. It is not enabled by default because it adds tens of seconds to the load time of some pages.

Deployment

OpenCodelists is currently deployed to smallweb1. Deployment is with fabric:

fab deploy

You will need to configure SSH agent forwarding in your ~/.ssh/config, e.g.

Host smallweb1.ebmdatalab.net
ForwardAgent yes
User <your user on smallweb1>

macOS users will need to configure their SSH Agent to add their key by default as per GitHub's Docs.

On the server, use with_environment.sh to run a management command in the virtual environment with the correct settings:

./with_environment.sh ./manage.py shell

About

OpenCodelists is an open platform for creating and sharing codelists of clinical terms and drugs.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 80.3%
  • HTML 11.6%
  • JavaScript 5.6%
  • ANTLR 2.1%
  • Other 0.4%