opensafely-core / opensafely-core/opencodelists

Enable viewing of draft codelists in the opencodecounts tool

Open
#2,536 1 comment 0 reactions 1 assignee View on GitHub

@Jongmassey is already working on this.

Since May 14, 2025.

initiative:codelist-builder
Dominant language
Python
Stars
60
Forks
16
Avg merge
4d 12h
Merged PRs (30d)
17

Description

Why are we doing this?

We are considering linking to the OpenCodeCounts web app in order to help codelist authors understand usage of codes in building their codelists.

This tool's opencodelists module calls the OpenCodelists API endpoint which lists a user/organisation's codelists and checks the user-provided codelist+version slug against the returned data to ensure the codelist ID's correctness, then uses the codelist version's download url to get the csv data.

Currently this doesn't work with draft codelists as their download URL redirects to the builder.

In order to make OpenCodeCounts a more useful tool for codelist development we should consider how draft codelists might be made available for this tool.

This may involve working with the research team to make changes to OpenCodeCounts.

We also need to consider what the behaviour should be regarding code statuses not permitted in In Review or Published codelists. Do our users want to see usage for all potential codes in a codelist or just the ones they've included.

As this will probably end up including some extra logic for draft codelists we should consider creating a dedicated API endpoint for the OpenCodeCounts tool as not to modify the established existing behaviour of the csv download endpoint.

How will we know when it's done?

Draft codelists will be usable in the OpenCodeCounts code usage tool.

What are we doing?

...


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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.