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

Add an API endpoint to check codelists from study repos #1703

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

rebkwok
Copy link
Contributor

@rebkwok rebkwok commented Oct 24, 2023

Fixes #1702
See also https://github.com/orgs/opensafely-core/projects/13/views/1?pane=issue&itemId=42536167

This endpoint may be called from opensafely-cli or from job-server. It takes as POST parameters the content of a study repo's codelists.txt file (specifying the codelists that are to be used in the study), and a manifest (codelists.json) file, which is generated when opensafely codelists update is run. It checks that the hashed codelist data in the manifest file matches the content of the current codelist versions, if they were to be downloaded again.

This is specifically intended to deal with dm+d codelists, which may change after they're downloaded into a study repo due to mapped VMPs.

Note opensafely-cli already has a codelists check command, which checks that the manifest file is consistent with the codelists in the study repo. However, dm+d codelists can change due to new VMP mappings, which get mapped into CSV downloads. Therefore a dm+d codelist that was downloaded into a study repo may need to be updated again, even if no changes have been made to the codelists.csv.

This endpoint may be called from opensafely-cli or from job-server.
It takes as POST parameters the content of a study repo's
codelists.txt file (specifying the codelists that are to be used in
the study), and a manifest (codelists.json) file, which is generated
when `opensafely codelists update` is run. It checks that the hashed
codelist data in the manifest file matches the content of the current
codelist versions, if they were to be downloaded again.

Note opensafely-cli already has a codelists check command, which checks
that the manifest file is consistent with the codelists in the study
repo. However, dm+d codelists can change due to new VMP mappings, which
get mapped into CSV downloads. Therefore a dm+d codelist that was
downloaded into a study repo may need to be updated again, even if no changes
have been made to the codelists.csv.
@rebkwok rebkwok merged commit 25d12a4 into main Oct 25, 2023
6 checks passed
@rebkwok rebkwok deleted the api-check-endpoint branch October 25, 2023 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add an API endpoint to check study codelists are up to date
2 participants