UI changes for ICD-10 multi-edition releases - #3164
Draft
rw251 wants to merge 28 commits into
Draft
Conversation
Jongmassey
force-pushed
the
icd-10-multi-edition-ui-changes
branch
from
July 30, 2026 11:48
4526178 to
fae9f1c
Compare
Codes that move were found from this report (https://github.com/bennettoxford/icd-browser-scraper/blob/main/claml/2016-vs-2019.md).
There are some rubrics that differ between the 2016 WHO claml and the 2016 NHS. When merging we want to use the NHS one. This adds a lookup containing the original WHO rubrics, and the changes that need to be applied. Also added a `_check_rubrics()` method to confirm that the rubrics found for WHO 2016 match what we have in the lookup to give assurance that the rubrics we're replacing are the ones we think they are.
Pass icd10_term_differences and icd10_moved codes to the front end for use in the warning banners. We do this in the builder (views.py->draft.html) and in the codelist viewer django templates (version.py->version.html).
ICD10TermDifferences and ICD10MovedCodes describe the data being injected into the django templates (for the viewer and the builder). Various other types and helpers added to icd10-warning-indicators.ts. These are required for the CodelistWarning React component that we will build (in the next commit!)
Contains both possible ICD-10 warnings in a single React component.
We load the relevant data from the page, pass it to the CodelistBuilder, and render the CodelistWarning above the tabs in the builder component
We pass the relevant data down the React tree: CodelistBuilder > CodelistTab > Container > Section > Tree > Row. Displays an inline warning in any code rows in the tree view that are triggering the main warning banners. We'll style in a later commit. This came from user feedback that in a large tree you may not realise a warning banner has appeared at the top.
We load the same react component in the codelist viewer template (version.py/version.html). This avoids creating a duplicate component in this non-react part of the app.
- Make clear that it's the WHO 2016 rubrics that are the base - change "resolved_use" to resolved_rubrics
E.g. "Causalgia" now returns G906 as the term only appears in its inclusion rubric and not in the main term "Complex regional pain syndrome type II"
We need to pick a single definition to display to users. It largely doesn't matter which because they're mostly the same, and when they differ importantly, a big warning banner will be displayed. Given there is more data in hospital admissions, and this is likely what most codelists will be used against (rather than ONS deaths data), we default to the NHS 2016 edition of ICD-10, falling back to the most recent other edition if the code doesn't have a 2016 definition. We use the database window function row_number to prioritise terms from 2016 edition. This works because "2016" is the earliest version that will exist, so ordering by edition id will result in "2016" being first, unless it doesn't exist for that concept_id.
- Wrap all ICD-10 rubric info in a box with a caveat that this info is targeted for coders - Rubrics `definition`, `note` and `test` appear in italics first - Then anything else is in a "Concept" box e.g. inclusion/exclusion and coding hints - If there are modifier rubrics, ,then these are in a different coloured "Modifier" box
If a code has different term in 2016 vs 2019 then we return both definitions and whether they are clinically equivalent or not.
If the descriptions are clinically equivalent we put them in a green box for info. If they are different they are in a red box. The warning banners (in another branch) will be the first thing people see for clinically different definitions, so the more info is just for extra info.
Use a custom QuerySet and Manager for ConceptRubric to encapsulate the logic of prioritising the 2016 (NHS) ICD-10 edition for rubrics. This uses a row_number window function in the db and relies on the fact that 2016 sorts higher than 2019. todo: apply similar prioritisation to rubrics defined at parent concepts
Where there exist rubrics in the 2016 edition, take all rubrics from that edition. Sets of rubrics in a given edition should be considered a consistent set of instructions and we should not mix instructions from editions. This change does this by using dense ranking rather than row numbering, such that all rubrics of the same edition get the same ranking.
This will only ever be an icd10 thing, so no point making it part of the coding_system interface. Instead we just call that method if it exists for a coding system.
Originally we had `lookup_synonyms` and `lookup_references, and have recently added `lookup_additional_rubrics` - all of which are only ever called by the more info modal - and are often specific to a single coding system. This refactors all calls into a single `lookup_more_info` method on the base class that each coding system can implement how they like as long as the return is a dict.
Jongmassey
force-pushed
the
icd-10-multi-edition-ui-changes
branch
from
July 30, 2026 11:49
fae9f1c to
0ad12ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The feature branch for all the UI changes required for the move to the ICD-10 multi edition