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

Use imaging UID from OMOP-ES extract #469

Merged
merged 32 commits into from
Aug 6, 2024

Conversation

milanmlft
Copy link
Member

@milanmlft milanmlft commented Jul 31, 2024

Description

Related to https://github.com/UCLH-Foundry/the-rolling-skeleton/issues/161
I suspect this has to wait until https://github.com/UCLH-Foundry/the-rolling-skeleton/issues/161 is done and the OMOP-ES extracts actually contain the study UIDs.

  • Get Study UID from OMOP-ES extract
  • Use the Study UID to query the VNA initially, fall back to MRN + accession number if not available
  • Add the UID to the PIXL database Image model and use for querying during anonymisation

Also cleaned up the pixl_dcmd tests and fixtures a bit, as I was getting confused where all the hardcoded values were coming from.

Type of change

Please delete options accordingly to the description.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Suggested Checklist

  • I have performed a self-review of my own code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have passed on my local host device. (see further details at the CONTRIBUTING document)
  • Make sure your branch is up-to-date with main branch. See CONTRIBUTING for a general example to syncronise your branch with the main branch.
  • I have requested PR review to UCLH-Foundtry/arc-dev
  • I have adddressed and marked as resolved all the review comments in my PR.
  • Finally, I have selected squash and merge

@milanmlft milanmlft requested a review from a team July 31, 2024 19:58
Copy link

codecov bot commented Jul 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.02%. Comparing base (6eb8750) to head (cfe755e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #469      +/-   ##
==========================================
- Coverage   84.11%   83.02%   -1.10%     
==========================================
  Files          83       80       -3     
  Lines        3545     3352     -193     
==========================================
- Hits         2982     2783     -199     
- Misses        563      569       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, tests are catching some errors. UIDs are in omop es, so you can ask Baptiste to set off a pinpoint run again if you want to test on real data

pixl_dcmd/src/pixl_dcmd/_database.py Outdated Show resolved Hide resolved
cli/src/pixl_cli/_io.py Show resolved Hide resolved
pixl_core/src/core/db/models.py Outdated Show resolved Hide resolved
@milanmlft milanmlft force-pushed the milanmlft/use-imaging-uid-in-omop-es branch from 7b092d5 to fb5999b Compare August 1, 2024 16:44
@milanmlft milanmlft force-pushed the milanmlft/use-imaging-uid-in-omop-es branch from fb5999b to 41e8066 Compare August 1, 2024 17:15
@milanmlft milanmlft enabled auto-merge (squash) August 2, 2024 16:56
@milanmlft milanmlft disabled auto-merge August 2, 2024 17:30
`sqlalchemy` actually does raise an error when `.one()` doesn't return
anything.
Copy link
Contributor

@stefpiatek stefpiatek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking glorious thanks!

I wonder for pinpoint we could just delete all rows which haven't been exported and then run populate so the UIDs will exist in the ones its still trying to export. From thereon in, we wouldn't expect the UID to change so that should be fine

pixl_dcmd/src/pixl_dcmd/_database.py Outdated Show resolved Hide resolved
pixl_core/src/core/db/models.py Outdated Show resolved Hide resolved
milanmlft and others added 2 commits August 6, 2024 13:52
Co-authored-by: Stef Piatek <s.piatek@ucl.ac.uk>
Co-authored-by: Stef Piatek <s.piatek@ucl.ac.uk>
@milanmlft
Copy link
Member Author

I wonder for pinpoint we could just delete all rows which haven't been exported and then run populate so the UIDs will exist in the ones its still trying to export. From thereon in, we wouldn't expect the UID to change so that should be fine

Sounds reasonable!

@milanmlft milanmlft enabled auto-merge (squash) August 6, 2024 12:56
@milanmlft milanmlft merged commit bd82c65 into main Aug 6, 2024
10 checks passed
@milanmlft milanmlft deleted the milanmlft/use-imaging-uid-in-omop-es branch August 6, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants