neurobagel/api

update query template to work with new session-level phenotypic data model

Closed this issue · 1 comments

  • create local db with https://github.com/neurobagel/neurobagel_examples/blob/main/data-upload/pheno-bids-output/example_synthetic_pheno-bids.jsonld for testing new functionality
  • update query model: split query parameter for min # sessions into
    • min # pheno sessions
    • min # imaging sessions
  • note: we won't have an "any" param cause it gets too complicated (it would need to be exclusive from min_num_pheno_sessions and min_num_imaging_sessions)
  • note 2: default for either parameter cannot be 1, or this gets undesirably constrained when user doesn't fill out either field
  • update query template
  • What do we return for a subject when they match the criteria?
    • Since the session ID of their phenotypic + imaging sessions can be different, we should return both separately + info for both (b/c otherwise, if user only sets an imaging data criteria, the matching sessions have no phenotypic attributes attached which is not useful)
    • Separate entries for each session
    • Per session entry, a new "session_type" key
  • in subject-level response, split num_sessions into phenotypic + imaging ses count
  • create new data model for session entry in subject_data response field
  • update docstrings of functions, remove TODOs
  • update tests

Reference query examples:

  1. 2+ imaging sessions; imaging modality = T1
  2. 2+ pheno sessions; age > 60; assessment = MoCA
  3. 2+ imaging sessions; age > 60; assessment = MoCA
  4. 2+ imaging sessions; 2+ pheno sessions; age > 60; assessment = MoCA

🚀 Issue was released in v0.2.0 🚀