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

feat(patients): add individual phenopackets endpoint w/ attachment option #433

Merged
merged 4 commits into from
Sep 12, 2023

Conversation

davidlougheed
Copy link
Member

@davidlougheed davidlougheed commented Sep 12, 2023

adds an endpoint that looks like /api/individuals/ind:HG00096/phenopackets to get all phenopackets for an individual, with an optional attachment=1 query param to get it with a Content-Disposition: attachment; ... header for future downloading use

@codecov
Copy link

codecov bot commented Sep 12, 2023

Codecov Report

Merging #433 (0c2e60e) into develop (1b0dfed) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #433      +/-   ##
===========================================
+ Coverage    86.39%   86.42%   +0.02%     
===========================================
  Files          129      129              
  Lines         5146     5156      +10     
  Branches       680      680              
===========================================
+ Hits          4446     4456      +10     
  Misses         521      521              
  Partials       179      179              
Files Changed Coverage Δ
chord_metadata_service/patients/api_views.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@gsfk gsfk left a comment

Choose a reason for hiding this comment

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

Is this any different from katsu /api/phenopackets/{id}? It's hard to tell exactly since our current crop of test data doesn't cover the case of multiple phenopackets per individual.

This does highlight some weirdness from the current response from /api/individuals/{id}, which includes a phenopackets array that you might guess would give the same response as the endpoint in this pr, but you'd be wrong, since it does two odd things:

  • it removes all subject fields (sex, age, etc) and moves them to the top level of the response
  • it copies (!) the biosamples field to the top level of the response so that all biosample and experiment data is given twice.

@noctillion
Copy link
Contributor

It works as expected locally. lgtm

@davidlougheed davidlougheed merged commit 0c9fc57 into develop Sep 12, 2023
7 checks passed
@davidlougheed davidlougheed deleted the feat/individual-phenopackets branch September 12, 2023 16:49
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.

3 participants