Code

If you’d like to write a study using OpenSAFELY, then the documentation is the best place to start; the getting started guide covers setting up your computer and writing a “toy” study. After that, the study definition section describes how to define the patient population, as well as the associated variables, in detail. You can copy the research template to write your study even faster, using other OpenSAFELY studies for help. You can find other OpenSAFELY studies within our OpenSAFELY GitHub organisation.

Most studies are based on a codelist, or a list of codes for clinical events or demographic characteristics. You can create and share codelists using OpenCodelists. We have created and shared over 370 codelists, which we have used in over 20 published papers.

OpenSAFELY has many components; the most important are the command-line interface; the cohort-extractor; and the job runner/job server.

You can find these, and more, within our OpenSAFELY Core GitHub organisation.

OpenSAFELY is under constant development; we suggest you regularly check our Platform News page to learn about significant improvements.