Skip to main content
Glama

MCP Server for Google Cloud Healthcare API

by Kartha-AI
query-parser.js1.46 kB
import { COMMON_CODES, TimeExpressions } from './constants.js'; export async function parseClinicianQuery(query) { query = query.toLowerCase(); const params = { resourceType: 'Observation' // default }; // Extract patient identifier const patientMatch = query.match(/patient\s+(?:id\s+)?([a-z0-9-]+)/i) || query.match(/([a-z0-9-]+)'s/i); if (patientMatch) { params.patientIdentifier = patientMatch[1]; } // Determine resource type and codes if (query.includes('blood pressure') || query.includes('bp')) { params.codes = [COMMON_CODES.SYSTOLIC_BP, COMMON_CODES.DIASTOLIC_BP]; } else if (query.includes('temperature')) { params.codes = [COMMON_CODES.BODY_TEMPERATURE]; } else if (query.includes('heart rate') || query.includes('pulse')) { params.codes = [COMMON_CODES.HEART_RATE]; } else if (query.includes('weight')) { params.codes = [COMMON_CODES.BODY_WEIGHT]; } else if (query.includes('diagnosis') || query.includes('condition')) { params.resourceType = 'Condition'; } // Parse time expressions params.dateRange = parseTimeExpression(query); return params; } function parseTimeExpression(query) { const now = new Date(); for (const [pattern, handler] of Object.entries(TimeExpressions)) { if (query.includes(pattern)) { return handler(now); } } return undefined; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Kartha-AI/google-cloud-healthcare-api-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server