Skip to content

NHS Refset upload tidy up #2874

@rw251

Description

@rw251

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.md doc signposting people to the help text in the codelists/scripts/update_nhs_refsets.py file
  • Point 5 here should be removed as it is not correct anymore:
    This script:
    1. Fetches available releases from TRUD API
    2. Identifies releases the same or newer than the current one
    3. Downloads and extracts a particular release
    4. Optionally filters to specific Cluster_IDs (refset IDs) if provided
    5. Updates the configuration JSON with the new release date (if --live-run is set)
    6. Runs the bulk import process with the new files
  • 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:
  • 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_DIR env variable that a dev might have set:
    db_path = (
    Path(__file__).resolve().parent.parent.parent
    / "coding_systems"
    / coding_system_id
    / f"{release_db_alias}.sqlite3"
    )
  • 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:
    suggested_reason = (
    "This may be because this codelist contains both clinical terms and "
    "medications. In which case you may need to create another codelist "
    "for the missing clinical/medication codes."
    )
    if codelist.coding_system_cls.name == "dm+d":
    suggested_reason = (
    "This may be because this codelist contains non-prescribable "
    "SNOMED codes, such as 108535009 - Product containing felodipine. "
    "As these are not prescribable, they are not in the dm+d dictionary "
    "but do sometimes appear in things like the NHS drug refsets."
    )
  • Double check the NHS drug refsets to ensure they are accurate
  • Create a platform news to publicise these new refsets. #2878

Metadata

Metadata

Assignees

No one assigned

    Labels

    deck-scrubbingTech debt or other between-initiative tidy-up work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions