opensafely-core / opensafely-core/opencodelists

Separate the "create new codelist" from the "upload existing codelist"

Open
#2,515 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Why are we doing this?

Currently there are 3 ways to create a codelist:

  1. Click "Create a codelist", complete the form but don't select a CSV file. This creates a blank codelist that you can then add searches to.
  2. Click "Create a codelist", complete the form and select a CSV file. This first validates that the codes you're uploading exist in the selected dictionary. If they do then if automatically publishes the codelist (though once #2513 is merged it will first allow users to check and add searches before publishing)
  3. Navigate to /codelist/user/{user}/add/ and upload a CSV file. This allows you to upload against dictionaries that we don't fully support e.g. DM+D and OPCS4.

There are a few confusing things about this:

  1. Having 1 and 2 above on the same form means it's hard to have button text that makes sense in both scenarios
  2. Having two different pages to upload CSV files, with one of them only found via the docs (i.e. not linked to on the site)
  3. It might not be clear on the "My codelists" page that uploading a CSV is an option when the only button is "Create a codelist"

How will we know when it's done?

The user journeys for creating a codelist and uploading a codelist are clearer.

What are we doing?

  • Change "My codelists" to have two buttons - worded something like "Create new codelist" and "Upload existing codelist (CSV)"
  • The page for "create new codelist" is as present, but without the CSV upload
  • The page for "upload existing codelist" is as present, except that
    • the CSV upload is no longer optional
    • the list of coding systems is the same as the /codelist/user/{user}/add/ page i.e. includes unsupported ones like OPSC4 and DM+D
    • the submit button text is updated to better reflect what will happen - e.g. a draft will be created that can be edited and checked
  • The backend should update so that if the selected coding system is supported we check the codes, but don't check if it's not. I think this is how the backend to /codelist/user/{user}/add/ currently works
  • The docs are updated to reflect the new ways of creating codelists
  • We remove the /codelist/user/{user}/add/ route, or create a ticket for its removal

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 with the My codelists page, the existing create-codelist page, and the /codelist/user/{user}/add/ route described in the issue. Trace the form and backend handling for supported and unsupported coding systems, then review the codelist documentation. Done means the two journeys have separate entry points, the upload flow creates an editable draft, and the documentation reflects the new routes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.