opensafely-core / opensafely-core/opencodelists

Some old CTV3 codelist versions contain invalid CTV3 codes

Open
#1,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

A handful of old CTV3 codelist versions contain invalid CTV3 codes. Visiting the page for these versions causes a 500 error (because we're trying to look up a term for a code that doesn't exist), although the version can still be downloaded (by appending /download.csv) to the URL.

In most cases, there are some four-digit codes, and in all the cases I have checked, these four-digit codes (eg 5135) correspond to CTV3 codes with a trailing dot (eg 5135.) It is most likely that this was caused by Excel.

For each of these, I have created new versions that include the correct codes:

The diffs view shows the codes that were missing from the original codelists:

The Chemotherapy or Radiotherapy codelist has the most invalid codes (47), with all others have 5 or fewer.

Attached is a CSV file with the missing codes.

missing-ctv3-codes.csv

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the 500 error on the six original codelist URLs and compare them with their linked corrected versions and diff views. Use the attached missing-ctv3-codes.csv to trace the invalid four-digit codes and determine how those historical versions are handled. Done means the affected version pages render successfully while preserving the downloadable codelists and correct CTV3 codes.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.