Skip to main content

AI Generated Cells in Reports

How to generate good AI prompts for Mesh AI Analytics

Written by Ethan
Updated over a month ago

In Mesh AI, AI-Generated Cells function as a high-level analytical tool, converting natural language prompts into graphs, tables, and structured data.

To achieve the highest fidelity in your reports, view the AI as a junior analyst newly integrated into your clinical team. It possesses the technical capability to process data but lacks the intrinsic clinical context of your department; therefore, precise "orders" are essential for accurate results.


Strategies for High-Fidelity Data Extraction

Use the following guidelines to ensure your clinical and administrative analyses are precise:

  • Define the Output Format: Explicitly state the required visualization, such as a pie chart, bar graph, or summary table (e.g., "Generate a pie chart of..." or "Tabulate a list of...").

  • Specify Granular Requirements: Avoid broad requests like "Show shift data". Use specific parameters, such as "Provide a bar graph illustrating total shift counts per associate".

  • Isolate Clinical Variables: Define exactly which positions, call types, or request categories to include (e.g., "Filter for Night shifts only" or "Include only weekend coverage").

  • Communicate Departmental Workflows: While the AI understands core concepts like Shifts and Associates, it requires guidance on your specific logic. For instance, specify if a "Conference" request should or should not impact an individual’s total shift quota.

  • Outline Procedural Logic: If your analysis involves multiple steps, describe your thought process to the AI (e.g., "First, identify all approved vacation requests, then calculate the remaining shift capacity per member").

  • Incorporate Operational Rules: The system is unaware of internal departmental constraints unless explicitly mentioned. Clearly state any relevant rules, such as identifying instances where a provider is scheduled for more than four consecutive night shifts.

  • Perform Iterative Refinement: If the initial output requires adjustment, refine your existing prompt rather than restarting. For example, modify "A pie chart of shifts" to "A pie chart of shifts, restricted to associates with the 'ER' position".

Examples

❌ Unclear Prompt

✔️ Clear & Effective Prompt

Show shifts numbers.

Create a graph of the number of shifts each associate has.

Who works too much?

Show a list of the people who have more than 9 shifts.

Show max shifts per week.

For each week, calculate the number of shifts each associate has that week; then show a table of the maximum number of shifts that associate has in any one week.

Find weeks where people are overbooked.

Give me a list of times that people have more than 2 shifts in any week, along with the shifts that contribute in order by start date.

Break down shifts by job.

Show a stacked bar graph of the number of shifts each associate has, separated by job.

Find out if scheduling rules are broken.

List all shifts where someone is scheduled for more than 5 consecutive days, along with the shift details.

Tell me the percentage of Prefer On - Day requests that were honored

Show the percentage of Prefer On - Day requests being honored. Having a Prefer On - Day request means the associate wants a shift that starts between 8am and 4pm during that request.

Shifts for each person vs. GME limit.

List the amount of shifts each person has worked compared to the GME limits. The GME limits for our team are: no more than 1 in 4 'In Hospital Call' days and no more than 1 in 3 'Home Call' days, and no more than two weekends in a 28 day period.

Advanced Configuration: Information for Developers

For complex data requirements or highly specific reporting needs, you can directly create or modify the code within an AI cell. This level of access allows you to manipulate raw data structures to produce customized clinical insights.

Core Data Arrays

The programming environment has access to the following primary data arrays. Note: Do not modify these terms, as they are essential for the system's analysis.

  • shifts: Individual scheduled blocks of time.

  • requests: Member submissions for time off or availability.

  • tours: Patterns of recurring shifts or rotations.

  • associates: The physicians, residents, or staff members in your team.

  • jobs: The specific duties or tasks assigned within the team.

  • positions: The professional roles or designations of your members.

  • requestTypes: The categories of submissions (e.g., Vacation, CME, On-Call).

  • holidays: Standard recognized public or religious holidays.

  • specialDates: Custom-defined dates relevant to your specific department.

Implementation Note: Ensure your code references these exact schemas to maintain data integrity across your analytical reports.

Associate:

Field

Type

Description

id

integer

Links associate to shifts or requests

name

string

Name of the person

email

string

Account owner’s email

organization_email

string

Organization-specific email

contact_info

object

Object with primary_contact, secondary_contact, tertiary_contact; blank = 'N/A'

role

string

Role in organization; blank = 'N/A'

Shift:

Field

Type

Description

id

integer

Unique identifier

job

string

Job name this shift is linked to

start

string

Start datetime (with offset)

end

string

End datetime (with offset)

allDay

boolean

True if all-day shift

weight_modifier

integer

has_issues

boolean

True if breaking rules

cluster

string

Common strings define clusters

view_priority

integer

metadata

object

Object of key-value pairs

associate_id

integer

Linked associate (null = unassigned)

cached_position_ids

array

IDs of positions held

is_special

boolean

True if holiday/special

specialness_cache

string

Name of holiday/special date

associate_name

string

Cached associate name

changed_since_publish

boolean

team_metadata

array

Request:

Field

Type

Description

id

integer

Unique identifier

request_type

string

Type of request

start

string

Start datetime (with offset)

end

string

End datetime (with offset)

allDay

boolean

True if all-day request

show_to_team_associates

boolean

True if visible to non-admins

metadata

object

Object of key-value pairs

associate_id

integer

Linked associate

all_teams

boolean

Applies to all teams

cached_position_ids

array

IDs of positions during the request

team_ids

array

request_targets

array

approval_state

enum

0=pending, 1=approved, 2=denied, 3=acknowledged

Job:

Field

Type

Description

id

integer

Unique identifier

name

string

Job name

team_id

integer

Linked team

weight_modifier

integer

color

string

can_take

integer

view_priority

integer

can_be_empty

boolean

postcall_period

integer

positions

array

Positions qualifying for this job

Position:

Field

Type

Description

id

integer

Unique identifier

name

string

Position name

team_id

integer

Linked team

jobs

array

Jobs qualified for this position

Tour:

Field

Type

Description

id

integer

Unique identifier

associate_id

integer

Linked associate

start_date

string

YYYY-MM-DD (nullable)

finish_date

string

YYYY-MM-DD (nullable, inclusive)

job_ids

array

Qualified jobs

position_ids

array

Held positions

metadata

object

Extra key-value data

weight_modifier

integer

Workload/FTE (0–1)

tour_block_name

string

Block name

Holiday:

Field

Type

Description

id

integer

Unique identifier

name

string

Holiday name (e.g., “Christmas”)

date

string

YYYY-MM-DD

SpecialDate:

Field

Type

Description

id

integer

Unique identifier

description

string

Label name

date

string

YYYY-MM-DD

is_holiday

boolean

True if holiday

Did this answer your question?