OP

openevidence-data-handling

Outlines data classification and retention policies to ensure HIPAA compliance for clinical AI queries.

Install

mkdir -p .claude/skills/openevidence-data-handling && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/5474" && unzip -o skill.zip -d .claude/skills/openevidence-data-handling && rm skill.zip

Installs to .claude/skills/openevidence-data-handling

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Data Handling for OpenEvidence.
31 charsno explicit “when” trigger
Intermediate

Key capabilities

  • De-identify clinical query text using regex patterns
  • Validate clinical queries for PHI and length constraints
  • Enforce data retention schedules for clinical evidence
  • Apply AES-256 encryption to PHI and patient-contextualized data
  • Export evidence summaries with post-processing de-identification

How it works

The skill provides functions to sanitize clinical queries by replacing identifiers like MRNs and SSNs with redacted placeholders before transmission. It also enforces data lifecycle policies, including specific retention periods and encryption standards for different clinical data types.

Inputs & outputs

You give it
ClinicalQuery object containing queryText and patientContext
You get back
evidenceId string or array of de-identified evidence summaries

When to use openevidence-data-handling

  • Configuring data retention policies
  • Implementing PHI de-identification
  • Ensuring HIPAA compliance
  • Securing clinical evidence data flows

About this skill

OpenEvidence Data Handling

Overview

OpenEvidence provides AI-powered clinical evidence synthesis for healthcare professionals. Data types include clinical queries (potentially containing PHI), evidence citations from medical literature, patient-contextualized responses, research paper references, and usage analytics. All data handling must comply with HIPAA (PHI safeguards, minimum necessary standard, BAA requirements), GDPR for EU clinicians, and FDA guidance on clinical decision support. Query data may contain patient identifiers, diagnoses, or treatment details that require de-identification before storage or analytics.

Data Classification

Data TypeSensitivityRetentionEncryption
Clinical queries (may contain PHI)CriticalDe-identify within 24h, purge raw in 7 daysAES-256 + TLS, field-level for PHI
Evidence citationsLowIndefinite (public literature)TLS in transit
Patient-contextualized responsesHigh (derived PHI)30 days max, then de-identifyAES-256 at rest
Research paper metadataLowIndefiniteTLS in transit
Clinician usage analyticsMedium1 year (de-identified)AES-256 at rest

Data Import

interface ClinicalQuery {
  queryId: string; clinicianId: string; queryText: string;
  patientContext?: { age?: number; sex?: string; conditions?: string[] };
  timestamp: string;
}

async function submitClinicalQuery(query: ClinicalQuery): Promise<string> {
  const sanitized = { ...query, queryText: deidentifyPHI(query.queryText) };
  const res = await fetch('https://api.openevidence.com/v1/query', {
    method: 'POST',
    headers: { Authorization: `Bearer ${process.env.OPENEVIDENCE_API_KEY}`, 'Content-Type': 'application/json' },
    body: JSON.stringify(sanitized),
  });
  return (await res.json()).evidenceId;
}

function deidentifyPHI(text: string): string {
  return text
    .replace(/\b(MRN|mrn)[:\s]?\d{6,}\b/g, '[MRN_REDACTED]')
    .replace(/\b\d{3}-\d{2}-\d{4}\b/g, '[SSN_REDACTED]')
    .replace(/\b(DOB|dob)[:\s]?\d{1,2}\/\d{1,2}\/\d{2,4}\b/g, '[DOB_REDACTED]')
    .replace(/\b[A-Z][a-z]+ [A-Z][a-z]+, (MD|DO|NP|PA)\b/g, '[PROVIDER_REDACTED]');
}

Data Export

async function exportEvidenceSummary(queryIds: string[]) {
  const summaries = [];
  for (const id of queryIds) {
    const res = await fetch(`https://api.openevidence.com/v1/evidence/${id}`, {
      headers: { Authorization: `Bearer ${process.env.OPENEVIDENCE_API_KEY}` },
    });
    const data = await res.json();
    summaries.push({ queryId: id, citations: data.citations,
      summary: deidentifyPHI(data.summary), confidence: data.confidenceScore });
  }
  return summaries;
}

Data Validation

function validateClinicalQuery(q: ClinicalQuery): string[] {
  const errors: string[] = [];
  if (!q.queryId) errors.push('Missing query ID');
  if (!q.clinicianId) errors.push('Missing clinician identifier');
  if (!q.queryText || q.queryText.length < 10) errors.push('Query too short for meaningful evidence retrieval');
  if (q.queryText.length > 5000) errors.push('Query exceeds 5000 char limit');
  if (/\b\d{3}-\d{2}-\d{4}\b/.test(q.queryText)) errors.push('CRITICAL: SSN detected in query text');
  if (/\b(MRN|mrn)[:\s]?\d{6,}\b/.test(q.queryText)) errors.push('CRITICAL: MRN detected in query text');
  if (q.timestamp && isNaN(Date.parse(q.timestamp))) errors.push('Invalid timestamp');
  return errors;
}

Compliance

  • HIPAA: BAA executed with OpenEvidence before any PHI transmission
  • HIPAA: PHI de-identified using Safe Harbor method before storage/analytics
  • HIPAA: Minimum necessary standard enforced — only transmit required clinical context
  • HIPAA: Audit trail for all PHI access with clinician ID, timestamp, and query purpose
  • HIPAA: Breach notification procedure documented (72-hour window)
  • GDPR: EU clinician data subject rights (access, erasure, portability)
  • FDA: Clinical decision support disclaimer included in all evidence responses
  • Data retention: raw queries purged at 7 days, de-identified analytics retained 1 year

Error Handling

IssueCauseFix
PHI detected in stored queryDe-identification regex missed a patternAdd pattern to deidentifyPHI, re-scan stored queries
API 403 on query submissionBAA not on file or expired API credentialsVerify BAA status, rotate API key
Evidence response contains patient nameUpstream model hallucinated PHIPost-process all responses through de-identification before display
Audit log gapLogging service outage during query windowReplay from API request logs, flag gap in compliance report
Export exceeds size limitToo many citations in bulk exportPaginate export, limit to 50 evidence summaries per request

Resources

Next Steps

See openevidence-security-basics.

When not to use it

  • Transmitting PHI without an executed BAA
  • Storing raw clinical queries beyond the 7-day limit
  • Processing queries exceeding the 5000 character limit

Prerequisites

OpenEvidence API keyExecuted BAA with OpenEvidence

Limitations

  • De-identification relies on regex and may miss patterns
  • Bulk exports are limited to 50 evidence summaries per request
  • Raw clinical queries must be purged within 7 days

How it compares

Unlike standard API integrations, this workflow mandates specific de-identification regex patterns and strict retention schedules to maintain HIPAA and GDPR compliance.

Compared to similar skills

openevidence-data-handling side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
openevidence-data-handling (this skill)127dReviewIntermediate
security-header-generator59moCautionIntermediate
backend-security-coder244moNo flagsIntermediate
api-security-best-practices156moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by jeremylongshore

View all by jeremylongshore

analyzing-logs

jeremylongshore

Analyze application logs to detect performance issues, identify error patterns, and improve stability by extracting key insights.

14123

ollama-setup

jeremylongshore

Configure auto-configure Ollama when user needs local LLM deployment, free AI alternatives, or wants to eliminate hosted API costs. Trigger phrases: "install ollama", "local AI", "free LLM", "self-hosted AI", "replace OpenAI", "no API costs". Use when appropriate context detected. Trigger with relevant phrases based on skill purpose.

1167

backtesting-trading-strategies

jeremylongshore

Backtest crypto and traditional trading strategies against historical data. Calculates performance metrics (Sharpe, Sortino, max drawdown), generates equity curves, and optimizes strategy parameters. Use when user wants to test a trading strategy, validate signals, or compare approaches. Trigger with phrases like "backtest strategy", "test trading strategy", "historical performance", "simulate trades", "optimize parameters", or "validate signals".

1071

generating-database-seed-data

jeremylongshore

Process this skill enables AI assistant to generate realistic test data and database seed scripts for development and testing environments. it uses faker libraries to create realistic data, maintains relational integrity, and allows configurable data volumes. u... Use when working with databases or data models. Trigger with phrases like 'database', 'query', or 'schema'.

1033

cursor-codebase-indexing

jeremylongshore

Execute set up and optimize Cursor codebase indexing. Triggers on "cursor index setup", "codebase indexing", "index codebase", "cursor semantic search". Use when working with cursor codebase indexing functionality. Trigger with phrases like "cursor codebase indexing", "cursor indexing", "cursor".

885

testing-mobile-apps

jeremylongshore

Execute mobile app testing on iOS and Android devices/simulators. Use when performing specialized testing. Trigger with phrases like "test mobile app", "run iOS tests", or "validate Android functionality".

810

Search skills

Search the agent skills registry