opensafely-core / opensafely-core/opencodelists

Prevent ICD-10 ranges from entering codelists

Open
#2,646 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Why are we doing this?

It is possible for a user to create an ICD-10 codelist that contains a range (e.g. E10-E14), however this causes a failure when you try and use the codelist.

As well as having descriptions for codes, ICD-10 also has descriptions for ranges, so E10-E14 has a description of "diabetes mellitus". Currently if a user does a code search for "E10-E14", or more likely "E*" or "E1*" then we return these "ranges". A user can "include" a range and successfully create a codelist, but it breaks when you try and use it.

How will we know when it's done?

Users can select a range, create a codelist, and use it without error.

What are we doing?

Given these ranges have a description, and that they logically group their descendants together, this seems like a good feature to keep as it makes it easier to create a codelist. So the suggested change is to ensure that if a user selects E10-E14, that it includes each sub code in the codelist (E10, E100, E101, E11, E12 etc), but does not include the code "E10-E14".


Defining delivery tasks guidance

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 locating the code-search and codelist creation paths, then trace how ICD-10 ranges such as E10-E14 are selected and stored. Verify that selecting a range expands it to its descendant codes without storing the range itself, and confirm the resulting codelist can be used without error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.