opensafely-core / opensafely-core/opencodelists
Some old CTV3 codelist versions contain invalid CTV3 codes
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.
- https://opencodelists.org/codelist/opensafely/chemotherapy-or-radiotherapy/2020-04-15/
- https://opencodelists.org/codelist/opensafely/diabetes/2020-04-15/
- https://opencodelists.org/codelist/opensafely/pneumococcal-vaccination-clinical-codes-that-it-is-unclear-of-intention/2020-05-19/
- https://opencodelists.org/codelist/opensafely/other-organ-transplant/2020-07-15/
- https://opencodelists.org/codelist/opensafely/dialysis/2020-07-16/
- https://opencodelists.org/codelist/opensafely/other-chronic-respiratory-disease/2020-07-20/
For each of these, I have created new versions that include the correct codes:
- https://opencodelists.org/codelist/opensafely/chemotherapy-or-radiotherapy/60bb7bb9/
- https://opencodelists.org/codelist/opensafely/diabetes/47ac0884/
- https://opencodelists.org/codelist/opensafely/pneumococcal-vaccination-clinical-codes-that-it-is-unclear-of-intention/2e9c954f/
- https://opencodelists.org/codelist/opensafely/other-organ-transplant/79caeeee/
- https://opencodelists.org/codelist/opensafely/dialysis/3ce108ac/
- https://opencodelists.org/codelist/opensafely/other-chronic-respiratory-disease/158d221a/
The diffs view shows the codes that were missing from the original codelists:
- https://opencodelists.org/codelist/opensafely/chemotherapy-or-radiotherapy/2020-04-15/diff/60bb7bb9/
- https://opencodelists.org/codelist/opensafely/diabetes/2020-04-15/diff/47ac0884/
- https://opencodelists.org/codelist/opensafely/pneumococcal-vaccination-clinical-codes-that-it-is-unclear-of-intention/2020-05-19/diff/2e9c954f/
- https://opencodelists.org/codelist/opensafely/other-organ-transplant/2020-07-15/diff/79caeeee/
- https://opencodelists.org/codelist/opensafely/dialysis/2020-07-16/diff/3ce108ac/
- https://opencodelists.org/codelist/opensafely/other-chronic-respiratory-disease/2020-07-20/diff/158d221a/
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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