Skip to content

[Biobank] Add QueryEngine implementation for specimen data queries#10431

Open
HenriRabalais wants to merge 4 commits intoaces:mainfrom
HenriRabalais:2026-03-31_biobank-queryengine
Open

[Biobank] Add QueryEngine implementation for specimen data queries#10431
HenriRabalais wants to merge 4 commits intoaces:mainfrom
HenriRabalais:2026-03-31_biobank-queryengine

Conversation

@HenriRabalais
Copy link
Copy Markdown
Collaborator

@HenriRabalais HenriRabalais commented Mar 31, 2026

Description

Implements QueryEngine for the biobank module, enabling biospecimen data to be queried through the Data Query Tool (DQT).

This implementation exposes biospecimen collection and availability data as queryable fields, allowing researchers to filter and export specimen information alongside other candidate data.

Changes

New Files:

  • modules/biobank/php/QueryEngine.php - Main QueryEngine implementation with 13 queryable fields

Modified Files:

  • modules/biobank/php/Module.class.inc - Added getQueryEngines() method to register QueryEngine with DQT

Fields Added to Data Dictionary:

Session-level summary fields (Cardinality::SINGLE):

  • SpecimenCollectionDone - Whether any specimens were collected at session
  • SpecimenAvailable - Whether any specimens are currently available

Specimen-level fields (Cardinality::MANY):

  • SpecimenType - Type of specimen (Blood, Serum, etc.)
  • SpecimenBarcode - Container barcode
  • SpecimenQuantity - Current quantity
  • SpecimenUnit - Unit of measurement
  • SpecimenAvailabilityStatus - Available vs Used/Discarded
  • SpecimenFreezeThawCycle - Number of freeze-thaw cycles
  • SpecimenCollectionDate - Collection date
  • SpecimenCollectionTime - Collection time
  • SpecimenCollectionProtocol - Protocol used
  • SpecimenCollectionCenter - Center where collected
  • SpecimenContainerType - Type of container
  • SpecimenTemperature - Storage temperature

Implementation Notes

  • Barcode serves as unique key for Cardinality::MANY field alignment
  • Visit list restricted to visits with actual specimens (not all user-accessible visits)
  • JOIN clauses stored as class constants to ensure exact string matching for SQL deduplication

Testing Instructions

  1. Ensure biobank module is active and has specimen data
  2. Navigate to Data Query Tool
  3. Verify "Specimen" category appears in field selector
  4. Test queries:
    • Filter by SpecimenType = "Blood"
    • Filter by SpecimenAvailabilityStatus = "Available"
    • Run Query

Related Issues

Resolves aces/CBIGR#659

@github-actions github-actions bot added the Language: PHP PR or issue that update PHP code label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Language: PHP PR or issue that update PHP code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants