Building a codelist
There are two ways to build a codelist using OpenCodelists:
The current coding systems available in the OpenCodelists builder are listed below.
Coding system |
---|
Pseudo BNF |
CTV3 (Read v3) |
CTV3 (Read v3) with TPP extensions |
Dictionary of Medicines and Devices (dm+d) |
International Classification of Diseases 10 (ICD-10) |
SNOMED CT |
Each codelist must use exactly one of these systems.
OPCS-4 and dm+d codes are not currently supported by the OpenCodelists builder. However, it is possible to manually upload an existing OPCS-4 or dm+d codelist.
Workflow🔗
The general workflow for creating codelists from scratch with the builder is as follows:
- Search OpenCodelists for codelists that meet or nearly meet your requirements and make sure that one doesn't already exist.
- If you need to build a new codelist sign up for an account on OpenCodelists.
- Create a new issue on the codelist-development repo.
- Decide your key terms to search for codes. Good source of key words might be a previous codelist, clinicians or experts in the field and previous research papers.
- When logged into OpenCodelists click "my codelists" and then "create new codelist". There is a short video at the bottom of this page on how to use the builder to develop a medication codelist.
- Add/remove terms to your codelists to end up with a list.
- Save the list as a draft.
- Clicking "Save changes" makes the codelist available on https://www.opencodelists.org as a draft. Share this link to the GitHub issue.
- Discuss as a group in the issue your decisions, and the reason for including or excluding different codes. Finalise a list as a group (i.e. at least 2). Detailed reasons are helpful in this issue for referencing in the future.
- Once agreed, click "Save for review" and obtain sign-off.
- Summarise your discussion and methodology briefly, and add any references (including the GitHub issue) and sign offs by editing the codelist metadata. When ready, click "Publish version" to publish it.
- Close the issue on the codelist-development repo.
- Import the codelist for use in your study definition.
Create a new issue on the codelist-development repo🔗
The issue title should start with either:
- *PATIENT* -- non-clinical patient information (demographic, social, etc)
- *CONDITION* -- specific clinical conditions / disorders / findings / symptoms
- *DISEASE* -- specific diseases
- *MEDICINE* -- medicines, treatments, prescriptions, interventions
- another codelist classification if relevant.
The rest of the title should be short and informative.
Discuss and document and review🔗
Discuss and document each decision clearly and comprehensively in the issue. Explain why codes have been included and why codes have been excluded. Link to relevant webpages and documents. Upload files. Involve domain experts. Iterate.
Sign-off🔗
Once a draft codelist has been agreed, we recommend it should be signed-off by at least two different people. (These can include the person who led on creating the codelist). This should usually include a "data expert" (epidemiological sign-off) and "disease expert" (clinical sign-off).
Creating a codelist from a CSV file🔗
- If your codelist is in an Excel spreadsheet, first export your Spreadsheet to a CSV.
- For codelists in PseudoBNF, CTv3, ICD-10 or SNOMED-CT coding systems, the CSV must have no headers, and the first column must contain the codes. Follow the instructions in the OpenCodelists documentation to create a codelist by uploading the CSV file.
- For OPCS-4 or dm+d codelists, use the alternative CSV upload process described in the
OpenCodelists documentation. In this case,
the CSV file must include a column with the heading
code
(ordmd_id
for dm+d uploads). References and sign-offs can be entered during the upload process, or afterwards, by editing the codelist metadata.
Exporting a CSV from a Spreadsheet🔗
- In Excel go to File
- Click Export in the left-hand ribbon menu
- Select Change File Type
- Click CSV (Comma delimited) (*.csv)
Close the issue in the repo🔗
Go to the codelist issue in the codelist repo and close it. This issue serves as documentation of the choices made that determined the final codelist. The issue can be re-opened if revisions are required.
Import the codelist for use in your study definition🔗
Once the codelist is in OpenCodelists, you can retrieve it for use in your research repo. Follow the adding codelists to project instructions if you're not sure how to do this.
Codelist contributorship🔗
How contributions to codelists are acknowledged -- to be agreed.
Editing existing codelists🔗
- Go to an existing Codelist page.
- Click Edit metadata.
- Edit the relevant fields
- Add, remove, or edit the Description, Methodology, References and SignOffs as needed.
- Click Submit
Publishing a Codelist Version🔗
- Go to an existing Codelist page.
- This will show you the latest version for a Codelist.
- If it's a Under Review version there will be a Publish Version button on the left below Create new version.
- If not, it's already published, and the Publish Version button will be disabled.
Adding a Codelist Version🔗
- Go to an existing Codelist page.
- Click Create new version.
Build a simple medication codelist🔗
This is a short video showing how to build a pseudoBNF medication codelist. For OpenSAFELY studies you can convert this to NHS Dictionary of Medicines and Devices codelist which we briefly mention at the end of the video.
Very briefly, we recommend that you build and agree medication codelists using the pseudoBNF coding system and convert this to dm+d for use in study definitions. You can read more about the uses and differences between pseudoBNF, dm+d and SNOMED CT on our blog.