-
Notifications
You must be signed in to change notification settings - Fork 186
[biobank] bugfix: Update DB schema, and fix CandidateID references (#10037) #10069
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
base: main
Are you sure you want to change the base?
[biobank] bugfix: Update DB schema, and fix CandidateID references (#10037) #10069
Conversation
…to specimen protocols
|
@HenriRabalais can you fix the static tests then assign to @kongtiaowang ? |
| FROM | ||
| candidate c | ||
| LEFT JOIN session s | ||
| ON s.CandidateID=c.CandID |
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.
I dont think thats correct.
@jeffersoncasimir correct me if I'm wrong but this should be
| ON s.CandidateID=c.CandID | |
| ON s.CandidateID=c.ID |
While row 143 stays as is!
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.
Got it, I changed any join to use c.ID instead of c.CandID.
|
@HenriRabalais Good job! now it is loading. Two tiny bugs need to be fixed. |
|
thanks for testing @kongtiaowang ! I'm looking into the As for the empty field, those values are pulled from the |
|
@HenriRabalais - Please insert default values in the database schema and RB will be fine. This is my first time see "pageCount and totalCount "issue. |


Description
This Pull Request resolves (1) database foreign key mismatches introduced in LORIS v27, (2) includes SQL modifications for a feature for ordering specimen attributes that was accidentally omitted from the original Biobank PR, and (3) corrects a reference to Candidate diagnoses.
Primary changes include:
CandIDto correctly use the new LORIS v27 standard,CandidateID. This includes:modules/biobank/php/optionsendpoint.class.incmodules/biobank/php/specimendao.class.incOrderIndex): Adds theOrderIndexcolumn and aUNIQUEconstraint (UK_SpecimenProtocolId_OrderIndex) to thebiobank_specimen_protocol_attribute_reltable. The patch (2025-10-29_add-order-index-to-specimen-protocols.sql) uses a safe, multi-step migration pattern (NULL-add, populate, enforce NOT NULL/UNIQUE) to prevent data loss or breakage on existing installations.OptionsEndpointto pull fromdiagnosis_evolutioninstead of the deprecateddiagnosistable for biobank-related lookups.Testing Plan
1. Database Changes
SQL/0000-00-06-BiobankTables.sql).biobank_specimen_protocol_attribute_reltable should be created successfully with theOrderIndex INT UNSIGNED NOT NULLcolumn and theUK_SpecimenProtocolId_OrderIndexconstraint.OrderIndex) and existing entries inbiobank_specimen_protocol_attribute_rel.2025-10-29_add-order-index-to-specimen-protocols.sql.OrderIndexvalues (starting at0) for eachSpecimenProtocolIDgroup, finally enforcing the constraints.2. Biobank Module
CandidateIDreference changes inspecimendao.class.incare correct.diagnosistodiagnosis_evolutioninoptionsendpoint.class.incis functional.Closes: #10037