Skip to main content

Section 5-1 : Case Study openEMR

AI Case Study

This tutorial is based on case study, where AI data solution is used as in a real-world example of a customer using it.

Please review important aspects and key considerations on How To Use AI Data Solutions in previous chapter.

Healthcare App openEMR Case Study

Of: openEMR App for healthcare

Brief Synopsis

Leverage opportunities for AI data solutions such as AI-driven insights & trends and AI workflow automation for healthcare App openEMR as demo installation.

Steps

Following steps were taken towards implementing solutions using EasyManage AI.

Import Tables And Download Schema

  • Import Tables
    • App Tables from MySQL/mariaDB cloud database imported into EasyManage.
  • Download Table Schema from EasyManage.

Get Data modeling suggestions from AI

  • Open Cursor and start new project workspace at e.g. C:\openEMR
  • Copy TableSchemaDnld_openEMR.sql to project root.
  • Using above table schema SQL file as context, Ask AI model
Give suggestions for data modeling i.e. table joins up to 4 nested levels, specify one-to-many or one-to-one
  • Define and configure data modeling, table joins in Builder Studio for
    • Medication and Prescription Data Model
      • Level 1: Patient Medications
      • patient_data | 1:M | prescriptions | 1:M | drugs
      • Refer to tutorial on Data Modeling

MCP Server Module Bundling for V1

It is recommended to keep 5-10 tables in one MCP Server module. Along with data modeling of those tables.

  • Select 16 tables for AI solution module building.
  • Bookmark below tables for generating code
patient_data    
patient_history
prescriptions
drugs
drug_inventory
drug_sales
drug_templates
pharmacies
claims
billing
insurance_companies
insurance_data
insurance_numbers
insurance_type_codes
payments
prices
  • Build/Generate MCP Server REST with APIs REST.
    • This will be version V1.
  • Run APIs.
  • Configure MCP Server in Cursor.

Use MCP Server V1

Exceeding Total Tools Limit

  • Warning is displayed as total tools 102 are exceeding 40.

Try chat input:

easymanage get and study all table schema and suggest what insights and trends can be derived from tables
  • AI model sees no relevant tool call available and tries to suggest insights from static SQL file available in workspace:

  • Please see response doc:

  • Now delete TableSchemaDnld_openEMR.sql from project root

    • We want AI model to call tool get_all_table_schema once available later.

Customize MCP Server as V2

  • Customize MCP Server REST V1, disable some table level tools globally.

    • Please see section: How to Enable/Disable Tools in README-mcprest.md
  • Verify and Disable Tools as indicated below and try out.

    • Table Level - Disable
      • TOOL-ViewAll
      • TOOL-ViewAllPaged
    • Table Level - Keep
      • TOOL-SelectWhere
      • TOOL-Query
    • AI Transactions - Disable All
      • AI-TRAN-ADD
      • AI-TRAN-EDIT
      • AI-TRAN-DEL
    • Table Joins Data Modeling Level - Disable
      • TOOL-DM-ViewAll
      • TOOL-DM-ViewAllPaged
    • Table Joins Data Modeling Level - Keep
      • TOOL-DM-SelectWhere
      • TOOL-DM-Query
  • Build/Generate MCP Server REST.

    • This will be version V2.
  • Configure MCP Server in Cursor.

    • Shows: Found 40 Tools

AI Model Analysis

Results from AI analysis is given in response docs below.

Presented below and listed are few analysis and solutions being recommended by AI models.

easymanage get and study all table schema and suggest what insights and trends can be derived from tables

Please refer to response doc

Ask AI What AI Workflows Can Implement

easymanage get and study all table schema and suggest what AI workflows can be implemented based on tables

Please refer to response doc

Next Steps

After AI Transaction Tools enabled, can ask AI.

Ask AI What AI Transactions Can Implement

easymanage get and study all table schema and suggest what AI transactions can be implemented