Mazecare Logo
Analytics & Reporting

Analytics & Report Templates

Comprehensive standard operating procedure for building dynamic analytics reports, utilizing natural language AI generation, and configuring customized resource builders across patients, encounters, invoices, transactions, appointments, and inventory.

The Analytics & Reporting module in Mazecare OS empowers clinic administrators, practice managers, and healthcare operators to extract deep operational and clinical intelligence across all system entities. By configuring dynamic Report Templates, users can query, filter, format, and visualize structured datasets across core clinic resources, including:

  • Patient: Demographic trends, contact directories, identification records, and registration dates.
  • Encounter: Clinical attendance, doctor consultations, start/end timestamps, and visit volumes.
  • Invoice: Financial billing ledgers, outstanding unpaid balances, payor breakdown, and issue dates.
  • Transaction: Payment allocations, settlement histories, payment methods (Cash, Card, Stripe), and refund logs.
  • Appointment: Booking channels, scheduled slot durations, practitioner allocations, and attendance rates.
  • Item: Pharmaceutical and service catalogs, unit prices, batch inventories, and active statuses.

Detailed Step-by-Step Walkthrough

Step 1: Navigating the Report Templates Dashboard

The reporting hub is managed from Operations → Report Templates:

  1. In the sidebar navigation, navigate to Operations → Report Templates (/operations/report-templates).
  2. The dashboard presents a centralized tabular list of all active and archived report templates, displaying the template name, description, creation date, and last modified timestamp.
  3. Use the search bar to locate specific reports (e.g., Unpaid Invoices Report, Monthly Revenue Report, Patient Demographic Report).
  4. Click the + New Report Template button in the header to open the template creation dialog.


Step 2: Choosing Your Report Generation Method

When you click + New Report Template, the Create Template dialog presents two distinct pathways to generate your report:

  1. AI Generation (Prompt-Driven): Describe what you want in plain English, and Mazecare's AI assistant will automatically construct the data model, query filters, field tree, and column mappings.
  2. Create from Scratch: Manually configure each component of your report using a structured 5-step wizard.


Method 1: AI-Powered Report Generation

The AI generation pathway leverages advanced Large Language Models to interpret complex natural language queries and translate them into production-ready analytical pipelines:

  1. Enter Your Natural Language Prompt:
    • Type your reporting requirements into the prompt box (e.g., "Generate an unpaid invoices report displaying the invoice number identifier, beneficiary name, total amount, and issue date").
    • The interface provides built-in example prompts for common reporting scenarios:
      • Patient Directory: "Create a patient report with columns for first name, last name, date of birth, and all contacts."
      • Financial Billing: "Generate an unpaid invoices report displaying the invoice number identifier, beneficiary name, total amount, and issue date."
      • Transactions & Ledgers: "Create a transaction history report showing the transaction number identifier, settlement date, payment method, amount, and invoice allocations."
      • Clinical Encounters: "Generate an encounters report that includes encounter number, start date, end date, attending patient name, and attending doctor name."
      • Appointments: "Build an appointment report showing the appointment start date time, attending patient name, and attending doctor name."
      • Products & Services: "Generate a products and services report including the item name, type, default price, and active status."

  1. Select AI Model & Enter Draft Mode:
    • Click Create Template to launch the interactive Draft Report Template workspace (/operations/report-templates/draft).
    • In the assistant footer, select your preferred AI engine (e.g., Gemini 1.5 Pro).
    • The AI operates in Draft Mode, analyzing your prompt, mapping schema entities, and rendering a live preview directly onto your canvas without modifying production configurations until you accept.
    • You can converse with the AI assistant in real-time to refine columns, adjust filters, or reformat dates before saving.


Method 2: Building Report Templates from Scratch

For granular control over data extraction, filters, and custom transformation logic, click Create from Scratch in the template modal to launch the 5-step report builder stepper:

[ Step 1: DETAILS ] ➔ [ Step 2: FILTERS ] ➔ [ Step 3: FIELDS ] ➔ [ Step 4: MAPPING ] ➔ [ Step 5: REVIEW ]

Step 1: General Details & Resource Selection

  • Name & Description: Enter a descriptive name for your report (e.g., Unpaid Invoices Report) and a brief explanation of its operational purpose.
  • Resource: Select the foundational entity type from which data will be extracted:
    • Patient (Patient): Demographic records and contacts.
    • Encounter (Encounter): Clinical consultation visits and provider notes.
    • Invoice (Invoice): Billing statements, co-payors, and payment statuses.
    • Transaction (Transaction): Cash/card settlements and allocations.
    • Appointment (Appointment): Scheduled calendar events and virtual visits.
    • Item (Item): Dispensary products, pharmaceuticals, and service offerings.
  • Click Continue →.


Step 2: Filter Rules (Restricting Data)

The Filters step allows you to define boolean criteria to restrict the rows returned by your report query:

  • Build multi-clause condition trees using where and and operators.
  • Choose target fields and conditional operators (e.g., isPaid eq false to isolate unpaid invoices, date range boundaries, or specific practitioner IDs).
  • Click + Add field... or + Add argument... to nest additional logical groupings.
  • Click Continue →.


Step 3: Field Selection (Entity Schema Tree)

The Fields step exposes the underlying GraphQL entity schema as an interactive tree:

  • Browse available object fields and relational properties for the selected resource.
  • For example, when inspecting the Invoice entity, select:
    • id: Unique record identifier.
    • identifiers: External and internal identifier keys (such as invoiceNumber).
    • beneficiary: Nested Entity object representing the patient (name, addresses, contacts).
    • totalAmount: Numerical invoice balance.
    • createdAtUtc: Creation timestamp.
    • items: Line items linked to the invoice.
  • The Result Preview pane on the right confirms the selected schema paths in real time.
  • Click Continue →.


Step 4: Column Mappings & Value Paths

The Column Mappings step defines how extracted fields are named, transformed, formatted, and sorted in the final table output:

  • Column Header Label: Define human-readable column titles (e.g., Invoice Number, Beneficiary, Total Amount, Issue Date).
  • Value Path (JSONPath / Liquid): Specify the exact extraction expression to resolve nested or filtered values:
    • Extract Invoice Number identifier: $.identifiers[?(@.key == 'invoiceNumber')].value
    • Extract Beneficiary Name: $.beneficiary.name
    • Extract Total Amount: $.totalAmount
    • Extract Issue Date: $.createdAtUtc | date: "%Y/%m/%d"
  • Sort Configuration: Select sort priority columns (e.g., sorting by createdAtUtc descending).
  • Click + Add Column to add more fields, then click Continue →.


Step 5: Review & Live Data Preview

The Review step runs an immediate execution of your configured report pipeline against active clinic data:

  • Inspect the generated data grid to verify that column names, JSONPath transformations, and filter conditions are operating accurately.
  • Verify row counts, currency formatting, and date resolutions.
  • Click Create Template to finalize and publish the report template.


Step 3: Viewing, Exporting, and AI-Refining Reports

Once created, report templates can be accessed, executed, exported, or edited at any time:

  1. Viewing Real-Time Data:
    • Open any template from /operations/report-templates to view the live paginated report view (e.g., displaying all unpaid invoices with total records).

  1. Exporting Data (CSV & Excel):
    • Click the Export button in the header toolbar to open the export options dropdown:
      • Export as CSV (.csv): Exports comma-separated plain text data suitable for raw data imports, data pipelines, and custom scripting.
      • Export as Excel (.xlsx): Generates a formatted Microsoft Excel spreadsheet with preserved column structures and tabular headers for financial auditing and management presentations.

  1. Iterative Refinement with AI:
    • Click Edit using AI to reopen the interactive canvas, allowing you to ask the AI assistant to add new columns, modify filters, or adjust grouping logic seamlessly.
Reporting Best Practice
When designing financial and patient demographic reports, always verify that your Value Paths in Column Mappings utilize safe JSONPath queries (such as `$.identifiers[?(@.key == 'invoiceNumber')].value`) to handle optional nested fields gracefully without throwing rendering errors.
Copyright © 2026