Bear query

From FDU-INS/Insurance-Skills · View interactive version

Bear query is an AI agent skill from the GitHub repository FDU-INS/Insurance-Skills. Query the Bear EHR database using the semantic layer. Use when asked about clients, billing, appointments, insurance, clinical data, procedures, scheduling, programs, staff, vitals, diagnoses, revenue, claims, or any data question about the Bear application.

How to use this skill

Skill file

Bear EHR Database Query Skill

You have access to the Bear EHR MariaDB database via MCP tools (mcp__bear-db__execute_query, mcp__bear-db__get_table_info, mcp__bear-db__get_schema).

Before Writing Any Query

  1. Read the semantic layer docs in /home/andres/code/claude/semantic/ to understand the schema
  2. Start with 00_query_guide.md for query patterns, naming conventions, and caveats
  3. Read the relevant domain file (01-15) for the specific tables involved

Domain Files Quick Reference

| # | File | Use When Asking About |

|---|------|-----------------------|

| 00 | 00_query_guide.md | NL-to-SQL patterns, status derivation, caveats |

| 01 | 01_people_demographics.md | Clients, demographics, addresses, phones |

| 02 | 02_programs_enrollment.md | Programs, enrollment, locations |

| 03 | 03_insurance_coverage.md | Insurance policies, payors, plans, authorizations |

| 04 | 04_appointments_scheduling.md | Scheduling, calendar, appointment types |

| 05 | 05_encounters_forms.md | Clinical documentation, encounter forms |

| 06 | 06_billing_revenue.md | Charges, claims, payments, revenue cycle |

| 07 | 07_clinical_data.md | Diagnoses, medications, vitals, labs |

| 08 | 08_users_staff.md | Staff, providers, credentials, roles |

| 09 | 09_tfc.md | Treatment Foster Care |

| 10 | 10_otp.md | Opioid Treatment Program |

| 11 | 11_transportation.md | Client transportation |

| 12 | 12_crew_groups.md | Group therapy sessions |

| 13 | 13_bed_management.md | Residential bed tracking |

| 14 | 14_prescriptions_erx.md | Electronic prescribing |

| 15 | 15_labs.md | Laboratory orders and results |

Critical Rules

MariaDB Syntax (NOT PostgreSQL)

Soft Deletes

Names Are in a Separate Table

STI Tables

Money Columns

Appointment Status (Timestamp-Based)

Insurance

Vitals

Suicide Risk (C-SSRS)

Query Workflow

  1. Read the relevant semantic layer file(s)
  2. If unsure about a column, use mcp__bear-db__get_table_info to verify
  3. Write the query using MariaDB syntax
  4. Present results in a clear table format
  5. Highlight key insights and anomalies
  6. When results are large, get summary counts first, then drill down

Responding

$ARGUMENTS

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.