Skip to content

Commit 5062246

Browse files
GeneAIclaude
authored andcommitted
feat: Add Healthcare Wizards external link and SBAR wizard demo
- Update Navigation to link Healthcare Wizards to healthcare.smartaimemory.com - Add SBAR wizard with 5-step guided workflow - Auto-generate report on Step 5 completion - Include quick-fill templates for common scenarios - Add demo API routes for wizard functionality 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 754be09 commit 5062246

File tree

7 files changed

+1807
-713
lines changed

7 files changed

+1807
-713
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { NextRequest, NextResponse } from 'next/server';
2+
3+
// Demo endpoint for AI text enhancement
4+
// Full implementation lives in empathy-healthcare-plugin (separate PyPI package)
5+
export async function POST(request: NextRequest) {
6+
try {
7+
const { text, section } = await request.json();
8+
9+
if (!text) {
10+
return NextResponse.json({ error: 'Text is required' }, { status: 400 });
11+
}
12+
13+
// Demo: Return slightly enhanced version (real implementation uses Claude AI)
14+
const enhanced = text
15+
.replace(/pt\b/gi, 'patient')
16+
.replace(/hx\b/gi, 'history')
17+
.replace(/dx\b/gi, 'diagnosis')
18+
.replace(/tx\b/gi, 'treatment')
19+
.replace(/rx\b/gi, 'prescription')
20+
.replace(/sx\b/gi, 'symptoms')
21+
.replace(/sob\b/gi, 'shortness of breath')
22+
.replace(/bp\b/gi, 'blood pressure')
23+
.replace(/hr\b/gi, 'heart rate')
24+
.replace(/rr\b/gi, 'respiratory rate');
25+
26+
return NextResponse.json({
27+
success: true,
28+
original: text,
29+
enhanced: enhanced,
30+
section: section,
31+
demo_note: 'This is a demo. Full AI enhancement available in empathy-healthcare-plugin.',
32+
});
33+
} catch (error) {
34+
return NextResponse.json(
35+
{ error: 'Enhancement failed', details: String(error) },
36+
{ status: 500 }
37+
);
38+
}
39+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { NextRequest, NextResponse } from 'next/server';
2+
3+
// Demo endpoint for medication interaction checking
4+
// Full implementation lives in empathy-healthcare-plugin (separate PyPI package)
5+
export async function POST(request: NextRequest) {
6+
try {
7+
const { medications } = await request.json();
8+
9+
if (!medications) {
10+
return NextResponse.json({ error: 'Medications text required' }, { status: 400 });
11+
}
12+
13+
const text = medications.toLowerCase();
14+
15+
// Demo: Extract common medication names
16+
const commonMeds = [
17+
'metformin', 'lisinopril', 'amlodipine', 'metoprolol', 'atorvastatin',
18+
'omeprazole', 'aspirin', 'warfarin', 'heparin', 'insulin', 'prednisone',
19+
'furosemide', 'hydrochlorothiazide', 'levothyroxine', 'gabapentin',
20+
];
21+
22+
const found = commonMeds.filter(med => text.includes(med));
23+
24+
// Demo interactions (educational only)
25+
const demoInteractions = [];
26+
27+
if (text.includes('warfarin') && text.includes('aspirin')) {
28+
demoInteractions.push({
29+
drug1: 'Warfarin',
30+
drug2: 'Aspirin',
31+
severity: 'major' as const,
32+
description: 'Increased bleeding risk when combined',
33+
});
34+
}
35+
36+
if (text.includes('metformin') && text.includes('contrast')) {
37+
demoInteractions.push({
38+
drug1: 'Metformin',
39+
drug2: 'IV Contrast',
40+
severity: 'major' as const,
41+
description: 'Risk of lactic acidosis; hold metformin before/after contrast',
42+
});
43+
}
44+
45+
if (text.includes('lisinopril') && text.includes('potassium')) {
46+
demoInteractions.push({
47+
drug1: 'Lisinopril',
48+
drug2: 'Potassium',
49+
severity: 'moderate' as const,
50+
description: 'Risk of hyperkalemia; monitor potassium levels',
51+
});
52+
}
53+
54+
return NextResponse.json({
55+
success: true,
56+
has_interactions: demoInteractions.length > 0,
57+
has_major_interactions: demoInteractions.some(i => i.severity === 'major'),
58+
total_interactions: demoInteractions.length,
59+
interactions: demoInteractions,
60+
medications_found: found,
61+
demo_note: 'This is a demo. Full drug interaction database available in empathy-healthcare-plugin.',
62+
});
63+
} catch (error) {
64+
return NextResponse.json(
65+
{ error: 'Medication check failed', details: String(error) },
66+
{ status: 500 }
67+
);
68+
}
69+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { NextRequest, NextResponse } from 'next/server';
2+
3+
// Demo endpoint for priority suggestion
4+
// Full implementation lives in empathy-healthcare-plugin (separate PyPI package)
5+
export async function POST(request: NextRequest) {
6+
try {
7+
const { vital_signs, clinical_concerns } = await request.json();
8+
9+
const text = `${vital_signs || ''} ${clinical_concerns || ''}`.toLowerCase();
10+
11+
// Demo priority logic based on keywords
12+
let suggested_priority: 'stat' | 'urgent' | 'routine' = 'routine';
13+
let reasoning = 'Based on clinical assessment, routine monitoring appropriate.';
14+
15+
// STAT indicators
16+
const statKeywords = ['unresponsive', 'cardiac arrest', 'not breathing', 'code', 'emergency', 'critical'];
17+
if (statKeywords.some(kw => text.includes(kw))) {
18+
suggested_priority = 'stat';
19+
reasoning = 'Critical indicators detected. Immediate intervention required.';
20+
}
21+
// Urgent indicators
22+
else if (text.includes('chest pain') || text.includes('difficulty breathing') ||
23+
text.includes('severe') || text.includes('acute') || text.includes('deteriorat') ||
24+
text.includes('distress') || text.includes('altered mental')) {
25+
suggested_priority = 'urgent';
26+
reasoning = 'Significant clinical concerns identified. Prompt evaluation recommended.';
27+
}
28+
29+
return NextResponse.json({
30+
success: true,
31+
suggested_priority,
32+
reasoning,
33+
demo_note: 'This is a demo. Full AI priority assessment available in empathy-healthcare-plugin.',
34+
});
35+
} catch (error) {
36+
return NextResponse.json(
37+
{ error: 'Priority check failed', details: String(error) },
38+
{ status: 500 }
39+
);
40+
}
41+
}

0 commit comments

Comments
 (0)