Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX for adding codelists to a project is poor #295

Open
Jongmassey opened this issue Nov 29, 2024 · 2 comments · May be fixed by #294
Open

UX for adding codelists to a project is poor #295

Jongmassey opened this issue Nov 29, 2024 · 2 comments · May be fixed by #294

Comments

@Jongmassey
Copy link
Contributor

To add a codelist from OpenCodelists to a study a user currently has to:

  1. Identify the codelist required on OpenCodelists
  2. Copy the part of the URL after https://www.opencodelists.org/codelist/ being sure not to include the trailing /
  3. Paste into codelists/codelists.txt
  4. Run opensafely codelists update
  5. Note the path of the codelist csv that has been downloaded by this command
  6. Inspect the csv/the codelist on OpenCodelist to note the key field name(s)
  7. Use the codelist_from_csv() function in their ehrQL with the field name(s) and csv file path

That's rather a lot of steps, and opportunities for things to go wrong.

Improvement of 5-7 could require changes to ehrQL or perhaps generation of code snippets, but I feel 2-4 are ripe for some simplification by changing the behaviour of the CLI.

@Jongmassey
Copy link
Contributor Author

For a while I've thought we could provide an easier means of adding codelists, perhaps via an add command, and @lucyb appears to have reached a similar thought so I propose this as a potential implementation of this.

In my proposed implementation the user:

  • doesn't need to modify the opencodelists URL
  • doesn't need to modify the codelists.txt file
  • only needs to call one CLI command

The last of those may require some further thought as there are sometimes-unexpected implications/side-effects of calling opensafely codelists update e.g. updating previously-downloaded codelists, and removing and local codelists which may have (erroneously) been placed in the codelists/ folder. However, I cannot imagine a circumstance in which a user would add a codelist to codelists.txt and not then run opensafely codelists update.

@Jongmassey Jongmassey linked a pull request Nov 29, 2024 that will close this issue
@Jongmassey
Copy link
Contributor Author

Any such changes to the the CLI would require updates to the documentation and to (e.g.) copiloting guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants