-
Notifications
You must be signed in to change notification settings - Fork 3
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
✨ New sample-relationships API #665
Conversation
7de38c2
to
156384e
Compare
156384e
to
46811f5
Compare
46811f5
to
91dfae2
Compare
2044070
to
2ab07cc
Compare
cabe3df
to
5c0b60a
Compare
9fa7fdd
to
957e135
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some things I'm curious about:
- can a sample have multiple parents? (or are we explicitly allowing/ disallowing that?)
- if the answer to the multiple parent question above is "No" then why is this not just a column in the sample table itself?
:param external_parent_id: Name given to parent sample by contributor | ||
:param external_child_id: Name given to child sample by contributor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being populated in the relationship table? shouldn't this just be coming from sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit redundant but I think its a tradeoff with ease of implementation + complexity of the query when fetching/searching for relationships with the external sample IDs.
If we didn't have these additional columns on the relationship table, then in order to get all relationships or search for specific relationships using the external parent or child sample IDs, we'd have to join the relationships table with the sample table on both the parent_id and child_id FK columns.
We'd also have to break the pattern we follow in the schema layer of the API in order to return the parent Sample.external_id and the child Sample.external_id along with each sample relationship. We could do this but I didn't think it was worth figuring this out with the old documentation and time constraints
Just to clarify, the If
Then we are validating that a new record cannot be SA2 is parent and SA1 is child, correct? |
Correct, we're validating that a child sample cannot also be the parent of its own parent sample, and a parent sample cannot also be the child of its own child sample. Basically, we're avoiding cycles |
|
1702b56
to
935f9cd
Compare
## Release 1.28.0 ### Summary - Emojis: ✨ x2, ? x1 - Categories: Additions x2, Other Changes x1 ### New features and changes - [#665](#665) - ✨ New sample-relationships API - [51995c3](51995c3) by [znatty22](https://github.com/znatty22) - [#661](#661) - 🗃️ Migration for Biospecimen.specimen_status - [83e2ed4](83e2ed4) by [znatty22](https://github.com/znatty22) - [#660](#660) - ✨ Add Biospecimen.specimen_status - [0d3f1aa](0d3f1aa) by [znatty22](https://github.com/znatty22)
## Release 1.28.0 ### Summary - Emojis: ♻️ x1, ✨ x2, ? x1 - Categories: Additions x3, Other Changes x1 ### New features and changes - [#667](#667) - ♻️ Don't delete samples with 0 biospecimens - [6eddc7c](6eddc7c) by [znatty22](https://github.com/znatty22) - [#665](#665) - ✨ New sample-relationships API - [51995c3](51995c3) by [znatty22](https://github.com/znatty22) - [#661](#661) - 🗃️ Migration for Biospecimen.specimen_status - [83e2ed4](83e2ed4) by [znatty22](https://github.com/znatty22) - [#660](#660) - ✨ Add Biospecimen.specimen_status - [0d3f1aa](0d3f1aa) by [znatty22](https://github.com/znatty22)
Motivation
CBTN has complex sample data where a group of samples actually have a hierarchical or tree like structure (Blood -> White Blood Cells -> DNA, RNA). There is currently no way to capture this information in Dataservice and therefore no way to get the information into the FHIR service and the Portal.
Approach
Add a SampleRelationship table to capture the sample tree. The table has the following columns:
Add validation rules in the API:
API
The endpoint and search parameters follow the same pattern as all other endpoints. Here are the examples