Data Searches

Once you have populated a Project in the QMENTA Platform with several sessions, you can perform different types of searches to extract the information you are looking for.

In this section, you will learn how to search for subject data and metadata within a project. Various methods to retrieve such information are explained.

To begin, log in and activate a Project by following the steps in Logging In and Activating a QMENTA Project.

Search for a Specific Subject

You can retrieve the information for a specific subject by:

# Define the Subject ID.
subject_name = "0001"

# Retrieve Subject Information
subjects = [subject for subject in project.subjects_metadata if subject["patient_secret_name"] == subject_name]

where subject_name corresponds to the Subject ID and subjects is a list of the sessions available for that Subject ID containing certain information (Patient ID, Container ID, Session Tags, Session Metadata…). This is equivalent to the information available via the Data tab in the QMENTA Platform.

Note

This type of search only provides the sessions available in the Project at the time it was activated.

Search of Input Containers

This type of search queries the database with the primary goal to retrieve the Container IDs of all sessions uploaded to the active Project that satisfy a defined search criteria.

The search criteria is a dictionary that can have the following keys:

  • s_n: Applies the search to the Subject ID.

  • ssid: Applies the search to the Session ID (SSID).

  • from_d: Starting search date in which the data was acquired.

  • to_d: Ending search date in which the data was acquired.

An example search would be as follows:

search_criteria = {"s_n": "01", "ssid":"1"}
sessions = project.list_input_containers(search_criteria)

In this case, the search criteria retrieves a list of sessions (sessions) where the strings 01 and 1 are included as Subject ID and Session ID, respectively. Each session is represented by a dictionary containing the following information:

  • Subject ID in key: patient_secret_name

  • Session ID (SSID) in key: ssid

  • Container ID in key: container_id

  • Container Name in key: container_name

Next Steps

Explore the following sections in detail: