opensafely-core / opensafely-core/opencodelists
NHS Refset upload tidy up
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 60
- Forks
- 16
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 17
Description
Why are we doing this?
Several areas for possible improvement to the documentation for the nhs refset upload were identified during a session with Katie. This will mean future developers will find updating the refsets easier. We should also tell people about the NHS drug refsets which are now available on OCL.
How will we know when it's done?
The docs are updated, a bug is fixed, and a platform news is created.
What are we doing?
- Add a short section in the
DEVELOPERS.mddoc signposting people to the help text in thecodelists/scripts/update_nhs_refsets.pyfile - Remove the trailing slash from
--host=https://www.opencodelists.org/, throughout the script comments - Point 5 (updating the JSON file) should be removed as it is not correct anymore: https://github.com/opensafely-core/opencodelists/blob/c8dd73bde77affd618814cf52a666927e0e7666a/codelists/scripts/update_nhs_refsets.py#L11-L17
- Put a bit of info early on explaining what the "dry run" is and that it is safe to run that locally, or against opencodelists.org.
- Create a prerequisites section to include:
- You need an account on TRUD
- On TRUD you need to subscribe to: https://isd.digital.nhs.uk/trud/users/authenticated/filters/0/categories/1/items/659/releases
- You then need to get your
TRUD_API_KEYhere - You need to be a member of the "NHSD Primary Care Domain Refsets" org for the PCD refsets and the "NHS Drug Refsets" group for drug refsets (this is already in the help text - but mentioning for completeness)
- You need to have an API_KEY (this is also already in the help text)
- Add guidance that you should pick the most recent version to upload - the most up to date refsets are the most accurate, so if the latest in OCL is v8, and v9 and v10 are available, there's not much point uploading v9 AND v10 - just do v10
- This code assumes the DBs are in a particular location locally, but it should respect the
DATABASE_DIRenv variable that a dev might have set: https://github.com/opensafely-core/opencodelists/blob/c8dd73bde77affd618814cf52a666927e0e7666a/codelists/scripts/bulk_import_codelists.py#L375-L380 - The methodology for the drug refsets is incorrect. The code below shows the text that should be displayed when a codelist uploaded with DM+D has codes not in the dictionary. For some reason the dmd specific branch was not called here, and the generic text was inserted instead of the dmd specific text: https://github.com/opensafely-core/opencodelists/blob/c8dd73bde77affd618814cf52a666927e0e7666a/codelists/actions.py#L411-L423
- Double check the NHS drug refsets to ensure they are accurate
- #2878
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with DEVELOPERS.md and codelists/scripts/update_nhs_refsets.py, then inspect the referenced sections of codelists/scripts/bulk_import_codelists.py and codelists/actions.py. Check the existing help text and related tests or workflows before changing the documentation and upload behavior. Done means the listed guidance and bug fixes are complete, the NHS drug refsets are described, and a platform news item is created.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, documentation
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100