v13: Increase JSON limit to 10MB, client-side size check for chart review
- Raise express.json limit from 1MB to 10MB — handles large chart reviews with many notes (50 full clinic notes ≈ 600KB, well within new limit) - Client-side: warn user if payload >8MB, friendly toast if >30 notes - Bump to v13.0.0
This commit is contained in:
parent
22d9a8ec29
commit
6b6bf728d5
4 changed files with 18 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
pediatric-scribe:
|
||||
image: danielonyejesi/pediatric-ai-scribe-v3:v12
|
||||
image: danielonyejesi/pediatric-ai-scribe-v3:v13
|
||||
ports:
|
||||
- "3552:3000"
|
||||
env_file:
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pediatric-ai-scribe",
|
||||
"version": "12.0.0",
|
||||
"version": "13.0.0",
|
||||
"description": "AI-powered pediatric clinical documentation platform",
|
||||
"main": "server.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -123,6 +123,17 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Warn if payload is very large (>8MB = approaching 10MB server limit)
|
||||
var payloadEstimate = JSON.stringify({ visits: visits, subspecialty: subspecialty, edVisits: edVisits, labs: labs }).length;
|
||||
if (payloadEstimate > 8 * 1024 * 1024) {
|
||||
showToast('Notes are very large (' + Math.round(payloadEstimate / 1024 / 1024) + 'MB). Consider trimming some notes.', 'warning');
|
||||
return;
|
||||
}
|
||||
var totalNotes = visits.length + subspecialty.length + edVisits.length;
|
||||
if (totalNotes > 30) {
|
||||
showToast('Processing ' + totalNotes + ' notes — this may take a moment...', 'info');
|
||||
}
|
||||
|
||||
showLoading('Generating chart review...');
|
||||
|
||||
fetch('/api/generate-chart-review', {
|
||||
|
|
|
|||
|
|
@ -53,9 +53,10 @@ app.use(cors({
|
|||
app.use(cookieParser());
|
||||
|
||||
// ============================================================
|
||||
// BODY LIMITS — 1mb for JSON, transcribe uses multipart (no limit here)
|
||||
// BODY LIMITS — 10mb for JSON (chart review with many notes can be large),
|
||||
// transcribe uses multipart (25mb limit set in multer)
|
||||
// ============================================================
|
||||
app.use(express.json({ limit: '1mb' }));
|
||||
app.use(express.json({ limit: '10mb' }));
|
||||
|
||||
// ============================================================
|
||||
// RATE LIMITING
|
||||
|
|
@ -142,7 +143,7 @@ app.get('/api/models', async (req, res) => {
|
|||
const { activeProvider } = require('./src/utils/ai');
|
||||
app.get('/api/health', (req, res) => {
|
||||
res.json({
|
||||
status: 'running', version: '12.0.0', provider: activeProvider,
|
||||
status: 'running', version: '13.0.0', provider: activeProvider,
|
||||
timestamp: new Date().toISOString(),
|
||||
openrouter: process.env.OPENROUTER_API_KEY ? 'configured' : 'missing',
|
||||
bedrock: process.env.AWS_BEDROCK_REGION ? 'configured' : 'not configured',
|
||||
|
|
@ -209,7 +210,7 @@ const PORT = process.env.PORT || 3000;
|
|||
server.listen(PORT, () => {
|
||||
console.log('');
|
||||
console.log('==========================================');
|
||||
console.log('🏥 PEDIATRIC AI SCRIBE v12.0');
|
||||
console.log('🏥 PEDIATRIC AI SCRIBE v13.0');
|
||||
console.log('==========================================');
|
||||
console.log('🌐 http://localhost:' + PORT);
|
||||
console.log('🤖 Provider: ' + activeProvider);
|
||||
|
|
|
|||
Loading…
Reference in a new issue