Repository navigation
Check codelists for inactive SNOMED CT codes with usage - #174
Open
milanwiedemann wants to merge 12 commits into
Open
milanwiedemann wants to merge 12 commits into
milanwiedemann wants to merge 12 commits into
Conversation
milanwiedemann
marked this pull request as ready for review
November 2, 2026 16:32
This branch has not been deployed
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.
SNOMED CT codes can become inactive and be replaced by new codes, but GP EHR (software) may still use both. In our PROMs study we missed codes this way. This PR adds an experimental check that finds old and new codes with GP usage that may be missing from a codelist. A flagged code is something to review, might not always be a mistake.
What this adds
check_codelists(),check_codelists_dir()andcheck_codelists_url()run the check in Ropencodecounts codelists checkCLI runs it in the terminal. This needs the newest version of theopencodecountspackage andRapp::install_pkg_cli_apps("opencodecounts"))read_codelists()reads the CSV files fromopensafely codelists updateHow it works
Old and new code pairs come from a table on NHS TRUD: SNOMED CT UK Query Table and History Substitution Table
. We publish it as a GitHub release and through a (currently) hidden function
opencodecounts::get_snomed_history(), usage comes fromget_gp_snomed().Known limitations