COQUITO supports domain experts (clinical researchers, social media analysts) in iteratively constructing cohorts from large temporal event databases by visually specifying temporal constraints. The workflow enables researchers to define populations exhibiting particular temporal patterns of events without requiring SQL expertise, receiving continuous feedback about intermediate result sizes and event distributions to guide query refinement.
The input consists of a large database of individuals (e.g., 200,000+ patients or 17,000+ social media users) each with a timeline of typed point events organized in a hierarchical event dictionary (e.g., 14,000 unique diagnoses, 5,000 medications, 11,000 procedures; or 289 venue categories in 9 top-level groups). The system provides an initial overview of the full population: demographics bar charts (gender, ethnicity, age distribution) and event-type treemaps showing the frequency hierarchy of all events. This overview establishes the starting context — the source junction representing the entire population.
The researcher iteratively builds a temporal query by adding event constraints to junctions connected by routes. They search for events (keyword search with hierarchical browsing), inspect treemaps to identify frequent events after the current junction (acting as hints for what to add next), and drag event types into the query view. Each addition creates or modifies a junction — immediately computing intermediate result counts displayed as junction size. The researcher specifies temporal windows on routes (e.g., "within 7 days") and can create branching paths for disjunctive temporal patterns (OR logic). They assess intermediate results at each step: if a junction yields too few patients, constraints may be too restrictive; if too many, further constraints are needed. They adjust by removing, reordering, or modifying constraints, creating branches, or changing time windows. This cycle repeats — adding constraints, observing feedback, assessing cohort size and composition via demographics, and refining — until the case cohort satisfies the analytical requirements.
For comparative studies (e.g., predictive modeling), the researcher constructs a control cohort by creating a second query that references and negates the case cohort results, ensuring no patient overlap. Additional constraints are applied to the control query to define a comparable but distinct population. Cohort sizes are balanced using matching (random sampling or more sophisticated techniques) by dragging one result onto another.
The researcher compares case and control cohort demographics side-by-side (overlaid coloured bar charts) to verify that cohorts are appropriately composed and balanced. They may check overlap between query branches by dragging junctions atop each other to see intersection counts. Once satisfied, they export the defined cohorts to external analytics — either as CSV files or directly to a predictive modeling pipeline (e.g., PARAMO). Results of downstream analysis (e.g., AUC predictive scores) are returned and displayed within COQUITO, enabling the researcher to assess whether the cohort definition yields meaningful analytical power. If not, they return to query refinement.
The researcher synthesises findings from the iterative cohort construction process: confirmed that the database contains sufficient patients matching their clinical hypothesis, identified the temporal event patterns that define meaningful subpopulations, and determined that predictive models built on these cohorts have adequate discriminative power for their research goals.