Engineer an inpatient malnutrition augmented reality visualization that overlays risk…
- User
Engineer an inpatient malnutrition augmented reality visualization that overlays risk scores at bedside rounds.
Assistant
The user wants an AR visualization for inpatient malnutrition risk scores at bedside rounds. This is a healthcare/medical application that would help clinicians quickly identify patients at risk for malnutrition during their rounds.
Let me think about what this should include:
-
Core Features:
- Malnutrition risk score visualization (like NRS-2002, MUST score, or similar)
- Patient information overlay
- Risk indicators with color coding
- Interactive elements
-
Visual Elements:
- 3D holographic-style patient card
- Risk gauges/meters
- Trend charts showing nutritional status over time
- Warning indicators for high-risk patients
- Interactive data panels
-
Design Considerations:
- Clean, medical-grade aesthetic (not flashy game-like)
- High contrast for readability
- Professional color scheme (avoiding the purple gradient the instructions mention)
- Clear data visualization
- Responsive interactions
-
Technical Implementation:
- Three.js for 3D elements
- Simulated AR frame/hUD
- Particle effects for alerts (subtle, professional)
- Animated transitions
- Mouse/touch interactions
Let me create a sophisticated AR-style interface that shows:
- Patient bed view with AR overlay frame
- Floating risk score cards
- Animated gauges for different malnutrition indicators
- Trend visualization
- Interactive elements to explore patient data
- Professional medical aesthetic with greens, teals, and warning colors
I'll avoid:
- Purple gradients
- Emoji in buttons/titles
- Excessive particle effects
- Low contrast
Color scheme ideas for medical AR:
- Dark background (like AR glasses view)
- Cyan/teal for primary UI elements
- Green for low risk
- Orange/amber for moderate risk
- Red for high risk
- White for text and highlights
Inpatient Malnutrition AR Visualization
This is a sophisticated AR-style interface for displaying malnutrition risk scores during bedside rounds. Here's my approach:
Design Concept:
- AR Viewport Frame - Simulates looking through AR glasses with corner brackets
- Floating Risk Dashboard - Holographic-style cards with patient data
- Animated Risk Gauges - Real-time visual indicators for BMI, weight loss, intake, and disease severity
- Trend Charts - 7-day nutritional status history
- Interactive Elements - Clickable metrics that expand with details
- Alert System - Pulsing warnings for high-risk patients
Color Scheme:
- Dark AR background with cyan/teal holographic elements
- Traffic light system: Green (low risk) → Amber (moderate) → Red (high risk)
- High contrast white text for readability
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Malnutrition AR Visualization</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } body { background: #0a0f14; font-family: 'Segoe UI', system-ui, sans-serif; overflow: hidden; color: #e0e8f0; } #canvas-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; } .ar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; } .ar-corner { position: absolute; width: 60px; height: 60px; border-color: rgba(0, 220, 200, 0.6); border-style: solid; border-width: 0; } .ar-corner.tl { top: 20px; left: 20px; border-top-width: 3px; border-left-width: 3px; } .ar-corner.tr { top: 20px; right: 20px; border-top-width: 3px; border-right-width: 3px; } .ar-corner.bl { bottom: 20px; left: 20px; border-bottom-width: 3px; border-left-width: 3px; } .ar-corner.br { bottom: 20px; right: 20px; border-bottom-width: 3px; border-right-width: 3px; } .patient-card { position: absolute; top: 100px; left: 40px; width: 380px; background: linear-gradient(135deg, rgba(0, 40, 50, 0.9), rgba(0, 25, 35, 0.95)); border: 1px solid rgba(0, 200, 180, 0.4); border-radius: 12px; padding: 20px; pointer-events: auto; box-shadow: 0 0 30px rgba(0, 180, 160, 0.2), inset 0 0 20px rgba(0, 100, 90, 0.1); animation: floatIn 0.8s ease-out; } @keyframes floatIn { from { opacity: 0; transform: translateX(-50px) scale(0.9); } to { opacity: 1; transform: translateX(0) scale(1); } } .patient-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; padding-bottom: 15px; border-bottom: 1px solid rgba(0, 200, 180, 0.3); } .patient-name { font-size: 22px; font-weight: 600; color: #ffffff; } .patient-meta { font-size: 13px; color: #80a0b0; margin-top: 4px; } .room-badge { background: rgba(0, 180, 160, 0.3); color: #00e8d0; padding: 6px 12px; border-radius: 20px; font-size: 14px; font-weight: 600; } .risk-score-container { display: flex; align-items: center; gap: 20px; margin: 20px 0; } .risk-gauge { width: 100px; height: 100px; position: relative; } .risk-gauge svg { transform: rotate(-90deg); } .risk-gauge-bg { fill: none; stroke: rgba(255,255,255,0.1); stroke-width: 8; } .risk-gauge-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 1s ease-out, stroke 0.5s; } .risk-gauge-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; } .risk-value { font-size: 28px; font-weight: 700; } .risk-label { font-size: 10px; color: #80a0b0; text-transform: uppercase; } .risk-details { flex: 1; } .risk-level { font-size: 18px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; } .risk-indicator { width: 12px; height: 12px; border-radius: 50%; animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; } 50% { opacity: 0.7; box-shadow: 0 0 10px 4px currentColor; } } .risk-low { color: #00dd88; } .risk-moderate { color: #ffaa00; } .risk-high { color: #ff4466; } .risk-description { font-size: 13px; color: #80a0b0; line-height: 1.5; } .metrics-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 15px; } .metric-item { background: rgba(0, 60, 70, 0.4); border-radius: 8px; padding: 12px; cursor: pointer; transition: all 0.3s ease; border: 1px solid transparent; } .metric-item:hover { background: rgba(0, 80, 90, 0.5); border-color: rgba(0, 200, 180, 0.4); transform: translateY(-2px); } .metric-label { font-size: 11px; color: #60a0b0; text-transform: uppercase; letter-spacing: 0.5px; } .metric-value { font-size: 20px; font-weight: 600; margin-top: 4px; } .metric-trend { font-size: 11px; margin-top: 2px; } .trend-up { color: #ff6666; } .trend-down { color: #00dd88; } .trend-stable { color: #80a0b0; } .trend-chart { position: absolute; top: 100px; right: 40px; width: 320px; background: linear-gradient(135deg, rgba(0, 40, 50, 0.9), rgba(0, 25, 35, 0.95)); border: 1px solid rgba(0, 200, 180, 0.4); border-radius: 12px; padding: 20px; pointer-events: auto; box-shadow: 0 0 30px rgba(0, 180, 160, 0.2); animation: floatIn 0.8s ease-out 0.2s both; } .chart-title { font-size: 14px; font-weight: 600; margin-bottom: 15px; color: #00e8d0; } .chart-container { height: 150px; position: relative; } .chart-canvas { width: 100%; height: 100%; } .intervention-panel { position: absolute; bottom: 100px; left: 40px; width: 380px; background: linear-gradient(135deg, rgba(50, 30, 0, 0.9), rgba(35, 20, 0, 0.95)); border: 1px solid rgba(255, 170, 0, 0.4); border-radius: 12px; padding: 20px; pointer-events: auto; animation: slideUp 0.6s ease-out 0.4s both; } @keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } } .intervention-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; } .alert-icon { width: 24px; height: 24px; background: #ffaa00; border-radius: 50%; display: flex; align-items: center; justify-content: center; animation: pulse 2s infinite; color: #1a0f00; font-weight: bold; font-size: 14px; } .intervention-title { font-size: 16px; font-weight: 600; color: #ffcc66; } .intervention-list { list-style: none; } .intervention-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255, 170, 0, 0.2); font-size: 14px; } .intervention-item:last-child { border-bottom: none; } .check-icon { width: 18px; height: 18px; border: 2px solid rgba(255, 170, 0, 0.6); border-radius: 4px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.3s; } .check-icon.checked { background: #ffaa00; border-color: #ffaa00; } .check-icon.checked::after { content: ''; width: 6px; height: 10px; border: solid #1a0f00; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px; } .status-bar { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); display: flex; gap: 30px; background: rgba(0, 30, 40, 0.8); padding: 12px 25px; border-radius: 30px; border: 1px solid rgba(0, 200, 180, 0.3); pointer-events: auto; } .status-item { display: flex; align-items: center; gap: 8px; font-size: 13px; } .status-dot { width: 8px; height: 8px; border-radius: 50%; } .status-dot.active { background: #00dd88; } .status-dot.warning { background: #ffaa00; } .status-dot.alert { background: #ff4466; } .patient-nav { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; } .nav-btn { background: rgba(0, 60, 70, 0.6); border: 1px solid rgba(0, 200, 180, 0.4); color: #00e8d0; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-size: 14px; transition: all 0.3s; } .nav-btn:hover { background: rgba(0, 100, 110, 0.7); transform: translateY(-2px); } .nav-btn.active { background: rgba(0, 180, 160, 0.4); border-color: #00e8d0; } .scan-line { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: linear-gradient(90deg, transparent, rgba(0, 220, 200, 0.5), transparent); animation: scan 4s linear infinite; pointer-events: none; } @keyframes scan { 0% { top: 0; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } } .tooltip { position: absolute; background: rgba(0, 50, 60, 0.95); border: 1px solid rgba(0, 200, 180, 0.5); border-radius: 8px; padding: 12px 16px; font-size: 13px; max-width: 250px; z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s; } .tooltip.visible { opacity: 1; } .tooltip-title { font-weight: 600; color: #00e8d0; margin-bottom: 6px; } </style> </head> <body> <div id="canvas-container"></div> <div class="ar-overlay"> <div class="scan-line"></div> <div class="ar-corner tl"></div> <div class="ar-corner tr"></div> <div class="ar-corner bl"></div> <div class="ar-corner br"></div> <div class="patient-nav"> <button class="nav-btn" data-patient="0">Room 301</button> <button class="nav-btn active" data-patient="1">Room 302</button> <button class="nav-btn" data-patient="2">Room 303</button> <button class="nav-btn" data-patient="3">Room 304</button> </div> <div class="patient-card" id="patientCard"> <div class="patient-header"> <div> <div class="patient-name" id="patientName">Margaret Chen</div> <div class="patient-meta" id="patientMeta">72 y/o Female | MRN: 847291</div> </div> <div class="room-badge" id="roomBadge">Room 302</div> </div> <div class="risk-score-container"> <div class="risk-gauge"> <svg width="100" height="100" viewBox="0 0 100 100"> <circle class="risk-gauge-bg" cx="50" cy="50" r="42"/> <circle class="risk-gauge-fill" id="riskGaugeFill" cx="50" cy="50" r="42" stroke="#ffaa00" stroke-dasharray="198 264"/> </svg> <div class="risk-gauge-text"> <div class="risk-value" id="riskValue">5</div> <div class="risk-label">NRS Score</div> </div> </div> <div class="risk-details"> <div class="risk-level" id="riskLevel"> <span class="risk-indicator risk-moderate"></span> Moderate Risk </div> <div class="risk-description" id="riskDesc"> Nutrition Risk Screening 2002 indicates moderate malnutrition risk. Dietary consultation recommended. </div> </div> </div> <div class="metrics-grid"> <div class="metric-item" data-metric="bmi"> <div class="metric-label">BMI</div> <div class="metric-value" id="bmiValue">18.9</div> <div class="metric-trend trend-down" id="bmiTrend">-0.4 this week</div> </div> <div class="metric-item" data-metric="weight"> <div class="metric-label">Weight Loss</div> <div class="metric-value" id="weightValue">7.2%</div> <div class="metric-trend trend-up" id="weightTrend">30-day change</div> </div> <div class="metric-item" data-metric="intake"> <div class="metric-label">Dietary Intake</div> <div class="metric-value" id="intakeValue">45%</div> <div class="metric-trend trend-stable" id="intakeTrend">of requirements</div> </div> <div class="metric-item" data-metric="albumin"> <div class="metric-label">Albumin</div> <div class="metric-value" id="albuminValue">2.8</div> <div class="metric-trend trend-down" id="albuminTrend">g/dL (Low)</div> </div> </div> </div> <div class="trend-chart"> <div class="chart-title">7-Day Nutritional Trend</div> <div class="chart-container"> <canvas id="trendCanvas" class="chart-canvas"></canvas> </div> </div> <div class="intervention-panel" id="interventionPanel"> <div class="intervention-header"> <div class="alert-icon">!</div> <div class="intervention-title">Recommended Interventions</div> </div> <ul class="intervention-list"> <li class="intervention-item"> <div class="check-icon" data-check="0"></div> <span>Dietitian consultation within 24h</span> </li> <li class="intervention-item"> <div class="check-icon checked" data-check="1"></div> <span>Oral nutritional supplements initiated</span> </li> <li class="intervention-item"> <div class="check-icon" data-check="2"></div> <span>Calorie count monitoring</span> </li> <li class="intervention-item"> <div class="check-icon" data-check="3"></div> <span>Weekly weight reassessment</span> </li> </ul> </div> <div class="status-bar"> <div class="status-item"> <div class="status-dot active"></div> <span>AR Active</span> </div> <div class="status-item"> <div class="status-dot warning"></div> <span>2 Alerts</span> </div> <div class="status-item"> <div class="status-dot active"></div> <span>Synced: EHR Live</span> </div> <div class="status-item"> <span id="currentTime">09:42 AM</span> </div> </div> <div class="tooltip" id="tooltip"> <div class="tooltip-title"></div> <div class="tooltip-content"></div> </div> </div> <script type="importmap"> { "imports": { "three": "https://unpkg.com/three@0.160.0/build/three.module.js", "three/addons/": "https://unpkg.com/three@0.160.0/examples/jsm/" } } </script> <script type="module"> import * as THREE from 'three'; // Patient data const patients = [ { name: 'Robert James', meta: '68 y/o Male | MRN: 847185', room: 'Room 301', riskScore: 2, riskLevel: 'Low Risk', riskClass: 'risk-low', riskDesc: 'Nutrition Risk Screening 2002 indicates low malnutrition risk. Continue monitoring.', bmi: 24.2, bmiTrend: '-0.1 this week', bmiTrendClass: 'trend-stable', weight: '2.1%', weightTrend: '30-day change', intake: '85%', intakeTrend: 'of requirements', albumin: '3.8', albuminTrend: 'g/dL (Normal)', albuminTrendClass: 'trend-stable', trendData: [75, 78, 80, 82, 79, 81, 83] }, { name: 'Margaret Chen', meta: '72 y/o Female | MRN: 847291', room: 'Room 302', riskScore: 5, riskLevel: 'Moderate Risk', riskClass: 'risk-moderate', riskDesc: 'Nutrition Risk Screening 2002 indicates moderate malnutrition risk. Dietary consultation recommended.', bmi: 18.9, bmiTrend: '-0.4 this week', bmiTrendClass: 'trend-down', weight: '7.2%', weightTrend: '30-day change', intake: '45%', intakeTrend: 'of requirements', albumin: '2.8', albuminTrend: 'g/dL (Low)', albuminTrendClass: 'trend-down', trendData: [60, 55, 52, 48, 50, 45, 47] }, { name: 'Thomas Rivera', meta: '55 y/o Male | MRN: 847389', room: 'Room 303', riskScore: 7, riskLevel: 'High Risk', riskClass: 'risk-high', riskDesc: 'Critical malnutrition risk detected. Immediate nutritional intervention required.', bmi: 16.2, bmiTrend: '-0.8 this week', bmiTrendClass: 'trend-down', weight: '12.5%', weightTrend: '30-day change', intake: '25%', intakeTrend: 'of requirements', albumin: '2.1', albuminTrend: 'g/dL (Critical)', albuminTrendClass: 'trend-down', trendData: [45, 40, 38, 35, 32, 30, 28] }, { name: 'Susan Miller', meta: '80 y/o Female | MRN: 847445', room: 'Room 304', riskScore: 3, riskLevel: 'Low Risk', riskClass: 'risk-low', riskDesc: 'Mild nutritional concern. Continue current diet plan with monitoring.', bmi: 22.8, bmiTrend: '-0.2 this week', bmiTrendClass: 'trend-stable', weight: '3.8%', weightTrend: '30-day change', intake: '75%', intakeTrend: 'of requirements', albumin: '3.5', albuminTrend: 'g/dL (Normal)', albuminTrendClass: 'trend-stable', trendData: [70, 72, 71, 74, 73, 75, 76] } ]; let currentPatient = 1; // Three.js setup const container = document.getElementById('canvas-container'); const scene = new THREE.Scene(); const camera = new THREE.PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000); camera.position.z = 5; const renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true }); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)); container.appendChild(renderer.domElement); // Particles const particleCount = 500; const particleGeometry = new THREE.BufferGeometry(); const positions = new Float32Array(particleCount * 3); const colors = new Float32Array(particleCount * 3); const sizes = new Float32Array(particleCount); for (let i = 0; i < particleCount; i++) { positions[i * 3] = (Math.random() - 0.5) * 15; positions[i * 3 + 1] = (Math.random() - 0.5) * 10; positions[i * 3 + 2] = (Math.random() - 0.5) * 8 - 2; const intensity = Math.random() * 0.5 + 0.5; colors[i * 3] = 0 * intensity; colors[i * 3 + 1] = 0.8 * intensity; colors[i * 3 + 2] = 0.7 * intensity; sizes[i] = Math.random() * 3 + 1; } particleGeometry.setAttribute('position', new THREE.BufferAttribute(positions, 3)); particleGeometry.setAttribute('aColor', new THREE.BufferAttribute(colors, 3)); particleGeometry.setAttribute('aSize', new THREE.BufferAttribute(sizes, 1)); const particleMaterial = new THREE.ShaderMaterial({ uniforms: { uTime: { value: 0 }, uPixelRatio: { value: renderer.getPixelRatio() } }, vertexShader: ` attribute vec3 aColor; attribute float aSize; varying vec3 vColor; uniform float uTime; uniform float uPixelRatio; void main() { vColor = aColor; vec3 pos = position; pos.y += sin(uTime * 0.5 + position.x) * 0.1; pos.x += cos(uTime * 0.3 + position.z) * 0.05; vec4 mvPosition = modelViewMatrix * vec4(pos, 1.0); gl_Position = projectionMatrix * mvPosition; gl_PointSize = aSize * uPixelRatio * (1.0 / -mvPosition.z); } `, fragmentShader: ` varying vec3 vColor; void main() { float dist = length(gl_PointCoord - vec2(0.5)); if (dist > 0.5) discard; float alpha = 1.0 - smoothstep(0.2, 0.5, dist); gl_FragColor = vec4(vColor, alpha * 0.4); } `, transparent: true, blending: THREE.AdditiveBlending, depthWrite: false }); const particles = new THREE.Points(particleGeometry, particleMaterial); scene.add(particles); // Grid lines const gridGroup = new THREE.Group(); const gridMaterial = new THREE.LineBasicMaterial({ color: 0x00b4a0, transparent: true, opacity: 0.1 }); for (let i = -10; i <= 10; i++) { const geometry = new THREE.BufferGeometry().setFromPoints([ new THREE.Vector3(i, -5, -3), new THREE.Vector3(i, 5, -3) ]); const line = new THREE.Line(geometry, gridMaterial); gridGroup.add(line); } for (let i = -5; i <= 5; i++) { const geometry = new THREE.BufferGeometry().setFromPoints([ new THREE.Vector3(-10, i, -3), new THREE.Vector3(10, i, -3) ]); const line = new THREE.Line(geometry, gridMaterial); gridGroup.add(line); } scene.add(gridGroup); // Data flow lines const flowLines = []; for (let i = 0; i < 8; i++) { const points = []; const startX = (Math.random() - 0.5) * 12; const startY = (Math.random() - 0.5) * 6; for (let j = 0; j < 50; j++) { points.push(new THREE.Vector3( startX + j * 0.02, startY + Math.sin(j * 0.2) * 0.3, -2 + Math.random() * 0.5 )); } const geometry = new THREE.BufferGeometry().setFromPoints(points); const material = new THREE.LineBasicMaterial({ color: 0x00d4c0, transparent: true, opacity: 0.3 }); const line = new THREE.Line(geometry, material); line.userData.offset = Math.random() * Math.PI * 2; scene.add(line); flowLines.push(line); } // Update patient display function updatePatientDisplay(index) { const p = patients[index]; document.getElementById('patientName').textContent = p.name; document.getElementById('patientMeta').textContent = p.meta; document.getElementById('roomBadge').textContent = p.room; document.getElementById('riskValue').textContent = p.riskScore; document.getElementById('riskLevel').innerHTML = `<span class="risk-indicator ${p.riskClass}"></span>${p.riskLevel}`; document.getElementById('riskDesc').textContent = p.riskDesc; // Update gauge const gauge = document.getElementById('riskGaugeFill'); const circumference = 2 * Math.PI * 42; const progress = (p.riskScore / 7) * circumference; gauge.style.strokeDasharray = `${progress} ${circumference}`; let color; if (p.riskScore <= 2) color = '#00dd88'; else if (p.riskScore <= 5) color = '#ffaa00'; else color = '#ff4466'; gauge.style.stroke = color; // Update metrics document.getElementById('bmiValue').textContent = p.bmi; document.getElementById('bmiTrend').textContent = p.bmiTrend; document.getElementById('bmiTrend').className = `metric-trend ${p.bmiTrendClass}`; document.getElementById('weightValue').textContent = p.weight; document.getElementById('weightTrend').textContent = p.weightTrend; document.getElementById('intakeValue').textContent = p.intake; document.getElementById('intakeTrend').textContent = p.intakeTrend; document.getElementById('albuminValue').textContent = p.albumin; document.getElementById('albuminTrend').textContent = p.albuminTrend; document.getElementById('albuminTrend').className = `metric-trend ${p.albuminTrendClass}`; // Update intervention panel style const panel = document.getElementById('interventionPanel'); if (p.riskScore >= 6) { panel.style.background = 'linear-gradient(135deg, rgba(60, 20, 20, 0.9), rgba(40, 15, 15, 0.95))'; panel.style.borderColor = 'rgba(255, 68, 102, 0.4)'; } else if (p.riskScore >= 4) { panel.style.background = 'linear-gradient(135deg, rgba(50, 30, 0, 0.9), rgba(35, 20, 0, 0.95))'; panel.style.borderColor = 'rgba(255, 170, 0, 0.4)'; } else { panel.style.background = 'linear-gradient(135deg, rgba(0, 40, 50, 0.9), rgba(0, 25, 35, 0.95))'; panel.style.borderColor = 'rgba(0, 200, 180, 0.4)'; } // Update trend chart drawTrendChart(p.trendData); } // Trend chart const trendCanvas = document.getElementById('trendCanvas'); const ctx = trendCanvas.getContext('2d'); function drawTrendChart(data) { const rect = trendCanvas.getBoundingClientRect(); trendCanvas.width = rect.width * window.devicePixelRatio; trendCanvas.height = rect.height * window.devicePixelRatio; ctx.scale(window.devicePixelRatio, window.devicePixelRatio); const width = rect.width; const height = rect.height; const padding = 20; ctx.clearRect(0, 0, width, height); // Grid lines ctx.strokeStyle = 'rgba(0, 180, 160, 0.15)'; ctx.lineWidth = 1; for (let i = 0; i <= 4; i++) { const y = padding + (height - padding * 2) * (i / 4); ctx.beginPath(); ctx.moveTo(padding, y); ctx.lineTo(width - padding, y); ctx.stroke(); } // Data line const maxVal = 100; const minVal = 0; const range = maxVal - minVal; ctx.strokeStyle = '#00d4c0'; ctx.lineWidth = 2; ctx.beginPath(); const points = []; data.forEach((val, i) => { const x = padding + (width - padding * 2) * (i / (data.length - 1)); const y = padding + (height - padding * 2) * (1 - (val - minVal) / range); points.push({ x, y }); if (i === 0) ctx.moveTo(x, y); else ctx.lineTo(x, y); }); ctx.stroke(); // Gradient fill const gradient = ctx.createLinearGradient(0, padding, 0, height - padding); gradient.addColorStop(0, 'rgba(0, 212, 192, 0.3)'); gradient.addColorStop(1, 'rgba(0, 212, 192, 0)'); ctx.fillStyle = gradient; ctx.beginPath(); ctx.moveTo(points[0].x, height - padding); points.forEach(p => ctx.lineTo(p.x, p.y)); ctx.lineTo(points[points.length - 1].x, height - padding); ctx.closePath(); ctx.fill(); // Data points points.forEach((p, i) => { ctx.fillStyle = '#00d4c0'; ctx.beginPath(); ctx.arc(p.x, p.y, 4, 0, Math.PI * 2); ctx.fill(); ctx.fillStyle = '#0a0f14'; ctx.beginPath(); ctx.arc(p.x, p.y, 2, 0, Math.PI * 2); ctx.fill(); }); // X-axis labels ctx.fillStyle = '#607080'; ctx.font = '10px Segoe UI'; ctx.textAlign = 'center'; const days = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']; days.forEach((day, i) => { const x = padding + (width - padding * 2) * (i / (days.length - 1)); ctx.fillText(day, x, height - 5); }); } // Tooltips const tooltipData = { bmi: { title: 'Body Mass Index', content: 'BMI below 18.5 indicates underweight. Current trend shows declining nutritional status.' }, weight: { title: 'Weight Loss', content: 'Unintentional weight loss >5% in 1 month or >10% in 6 months indicates malnutrition risk.' }, intake: { title: 'Dietary Intake', content: 'Current caloric intake as percentage of calculated requirements. <50% indicates significant risk.' }, albumin: { title: 'Serum Albumin', content: 'Normal range: 3.5-5.0 g/dL. Low albumin indicates protein deficiency and inflammation.' } }; const tooltip = document.getElementById('tooltip'); const metricItems = document.querySelectorAll('.metric-item'); metricItems.forEach(item => { item.addEventListener('mouseenter', (e) => { const metric = item.dataset.metric; const data = tooltipData[metric]; if (data) { tooltip.querySelector('.tooltip-title').textContent = data.title; tooltip.querySelector('.tooltip-content').textContent = data.content; const rect = item.getBoundingClientRect(); tooltip.style.left = rect.right + 15 + 'px'; tooltip.style.top = rect.top + 'px'; tooltip.classList.add('visible'); } }); item.addEventListener('mouseleave', () => { tooltip.classList.remove('visible'); }); }); // Checkbox interactions document.querySelectorAll('.check-icon').forEach(icon => { icon.addEventListener('click', () => { icon.classList.toggle('checked'); }); }); // Navigation document.querySelectorAll('.nav-btn').forEach(btn => { btn.addEventListener('click', () => { document.querySelectorAll('.nav-btn').forEach(b => b.classList.remove('active')); btn.classList.add('active'); currentPatient = parseInt(btn.dataset.patient); updatePatientDisplay(currentPatient); }); }); // Update time function updateTime() { const now = new Date(); const timeStr = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit' }); document.getElementById('currentTime').textContent = timeStr; } setInterval(updateTime, 1000); updateTime(); // Animation let time = 0; function animate() { requestAnimationFrame(animate); time += 0.016; particleMaterial.uniforms.uTime.value = time; particles.rotation.y = Math.sin(time * 0.1) * 0.05; particles.rotation.x = Math.cos(time * 0.15) * 0.02; gridGroup.rotation.y = Math.sin(time * 0.05) * 0.02; flowLines.forEach((line, i) => { line.material.opacity = 0.2 + Math.sin(time + line.userData.offset) * 0.15; }); renderer.render(scene, camera); } // Resize handler window.addEventListener('resize', () => { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize(window.innerWidth, window.innerHeight); particleMaterial.uniforms.uPixelRatio.value = renderer.getPixelRatio(); drawTrendChart(patients[currentPatient].trendData); }); // Initialize updatePatientDisplay(currentPatient); animate(); </script> </body> </html>Key Features:
-
AR Viewport Simulation - Corner brackets and scan line effect simulate AR glasses view
-
Dynamic Risk Gauges - Animated circular progress showing NRS-2002 scores (0-7 scale)
-
Color-Coded Risk System:
- Green (Score 0-2): Low Risk
- Amber (Score 3-5): Moderate Risk
- Red (Score 6-7): High Risk
-
Interactive Metrics - Hover over BMI, Weight Loss, Intake, or Albumin for detailed clinical information
-
7-Day Trend Chart - Canvas-based visualization of nutritional status over time
-
Intervention Checklist - Clickable checkboxes for care team to track recommendations
-
Patient Navigation - Switch between 4 different patient scenarios
-
Background Effects - Subtle particle system and grid lines create depth without distraction
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.