Skip to main content

CoPilot

CoPilot serves as an intelligent, interactive assistant designed to streamline clinical data exploration across the PJI ecosystem. It enables users—including clinicians, researchers, analysts, and operational teams—to conduct data-driven investigations without writing code.

Through a conversational interface, CoPilot interprets natural-language prompts, generates structured SQL queries, executes them on selected databases, and returns both tabular results and the underlying logic. It supports exploratory analysis, cohort discovery, workflow acceleration, and institutional consistency.

Patient Co-Pilot Assistant

This video demonstrates the interface visually without audio narration.


Module Architecture

CoPilot consists of three primary interface panels:

  • Chat List (Left Panel): Pinned conversations, recent queries, and validated "Ground Truth" responses
  • Chat Workspace (Center Panel): Natural-language prompts, AI-generated responses, and interaction history
  • Results Panel (Right Panel): SQL query results, technical transparency, export tools, and cohort creation options

Users may initiate queries such as:

  • "List patients with a diagnosis of hyperlipidemia."
  • "Show breakdown by gender and age group."
  • "Find patients over 60 years old prescribed beta blockers."
  • "Retrieve pain medication prescriptions from the past 3 months."

CoPilot identifies medical concepts, composes the appropriate SQL, and presents results with interpretable outputs.


Database Selection

At the top of the workspace, users select the target database for the session.

  • Default: OMOP Database (the primary PJI clinical data repository)
  • Custom Databases: Added via the Database Explorer module

Switching databases:

  • Clears the active conversation
  • Ensures query context aligns with the selected data source
  • Prevents cross-schema errors or misinterpretations

This feature guarantees analytic integrity during session-based interactions.


Initiating a New Conversation

Users can launch new analytical threads via multiple entry points:

1. New Conversation (+ Button)

Opens a scope selector for contextual queries:

  • By Cohort
  • By Individual Patient

2. Prompt Input Field

Accepts direct natural-language input. Example:

"Find diabetic patients admitted in the last 12 months."

3. Quick Prompts

Reusable query templates for common analytics:

  • "Identify patients diagnosed with rheumatoid arthritis."
  • "List heart failure patients by last documented visit."

These options accelerate exploratory and operational workflows.


Left Panel: Chat List

Organizes saved and recent conversational sessions for ease of navigation:

Pinned Conversations

Manually bookmarked dialogues for frequent reference.

Recent Queries

Chronologically grouped history (e.g., Today, Yesterday) for continuity and retrievability.

Ground Truths

Administrator-validated responses, used to:

  • Reinforce model consistency
  • Promote standardized institutional logic
  • Ensure repeatability across users

Message-Level Tools and Actions

Each message or response supports an inline action menu (⋯), offering:

  • Promote to Ground Truth
    Marks the AI response as institutionally validated.

  • Create New Conversation from This
    Forks the current dialogue as a new analytical thread.

  • Re-run Query
    Executes the original SQL again, accounting for new data or schema updates.

These tools enhance governance, reproducibility, and analytical quality assurance.


Right Panel: Results Display

Upon query execution, results appear in two linked views:


1. Result Table View

A dynamic, interactive data table displaying query output. Typical fields may include:

  • Person ID
  • Patient Name
  • Primary Condition
  • Visit Count
  • Last Visit Date
  • Diagnosis Codes
  • Demographic Attributes
  • Data Provenance
Features:
  • Column sorting and filtering
  • Pagination for large datasets
  • In-table keyword search
  • CSV export functionality
  • Create Cohort option from selected rows

Opens Cohort Builder pre-populated with selected patients.


2. SQL Query View

Displays the fully rendered SQL statement generated by CoPilot.

Purpose:
  • Enhances transparency
  • Enables auditing of AI behavior
  • Supports learning and reproducibility

Example:

SELECT DISTINCT
p.person_id
FROM tpj.person p
JOIN tpj.condition_occurrence co
ON p.person_id = co.person_id
WHERE co.condition_concept_id IN (
SELECT descendant_concept_id
FROM vocab.concept_ancestor
WHERE ancestor_concept_id IN (4029305) -- Hypercholesterolemia
);

Key Benefits of CoPilot

The CoPilot module brings several transformative advantages to PJI users:

  • Natural-language querying over OMOP and other databases
  • No-code analytics for clinicians and non-technical users
  • Full SQL transparency and query audit trails
  • Contextual exploration (by patient, cohort, or population)
  • Governance support via Ground Truths and response validation
  • Tight integration with Cohort Builder for downstream workflows

It democratizes access to clinical insights and significantly reduces the friction of translating questions into analytic outputs.


The CoPilot module enables fast, interpretable, and reliable exploration of clinical data through a natural-language interface that combines ease of use with full technical transparency.

It supports:

  • Conversational data exploration
  • Cohort discovery and refinement
  • Insight generation without SQL expertise
  • Traceable and reproducible analytics
  • Accelerated workflows across research, quality, and care operations

By merging conversational AI with structured data querying, CoPilot transforms the way users interact with clinical information across the Patient Journey Intelligence platform.