Back to Dashboard
Loading...
← Dashboard Billing
Smart Supply Management 2026
Medical Supply Tracking
AI-powered inventory prediction, barcode scanning, per-patient supply tracking, automated reorder alerts, and Medicare billing integration "” the most advanced supply management system in home health.
0
Supply Items
0
Low Stock
0
Pending Orders
$0
Monthly Cost

Supply Inventory

Supply Item Category SKU / HCPCS In Stock Reorder Point Unit Cost Supplier Status Actions
Back to Dashboard
'+ '

Purchase Order "” '+po.id+'

Supplier: '+po.supplier+' | Date: '+new Date(po.created).toLocaleDateString()+(po.expected_delivery?' | Expected Delivery: '+po.expected_delivery:'')+'

'+ ''+ po.items.map(function(item){return '';}).join('')+ '
ItemQuantityUnit CostTotal
'+item.supply_name+''+item.qty+'$'+item.unit_cost.toFixed(2)+'$'+(item.qty*item.unit_cost).toFixed(2)+'
Total$'+po.total.toFixed(2)+'
'+ ''); w.document.close(); setTimeout(function(){w.print();},500); } // ============================================================ // BARCODE LOOKUP // ============================================================ function lookupBarcode(){ var code=(eid('manual-barcode').value||'').trim(); if(!code){showMsg('Please enter a barcode or SKU.','err');return;} var found=supplies.find(function(s){return s.sku===code||s.hcpcs===code||s.name.toLowerCase().includes(code.toLowerCase());}); if(found){ var status=getStockStatus(found); var statusColor=status==='out'?'var(--red)':status==='low'?'var(--amber)':'var(--green)'; eid('barcode-result').innerHTML= '
✓ Item found!
'+ '
'+ '
'+found.name+'
'+ '
'+found.category+' · '+found.unit+' · SKU: '+found.sku+'
'+ '
'+ '
'+found.stock+'
In Stock
'+ '
$'+found.cost.toFixed(2)+'
Unit Cost
'+ '
'+(found.billable==='Yes'?'Billable':'Non-billable')+'
Medicare
'+ '
'+ '
'+ ''+ ''+ '
'; } else { eid('barcode-result').innerHTML= '
Item not found for "'+code+'".
'; } } // ============================================================ // AI PREDICTIONS // ============================================================ function runAIPredictions(){ if(!ANTHROPIC_KEY){ // Show rule-based predictions without API showRuleBasedPredictions(); return; } var btn=eid('ai-predict-btn'); btn.disabled=true; btn.innerHTML=' Analyzing...'; eid('ai-predictions-content').innerHTML='
AI is analyzing your inventory and patient data...
'; var lowItems=supplies.filter(function(s){return s.stock<=s.reorder;}); var diagnoses=patients.map(function(p){return p.diagnosis||'';}).join(', '); fetch('https://api.anthropic.com/v1/messages',{ method:'POST', headers:{'Content-Type':'application/json','anthropic-version':'2023-06-01','anthropic-dangerous-direct-browser-access':'true','x-api-key':ANTHROPIC_KEY}, body:JSON.stringify({model:'claude-haiku-4-5-20251001',max_tokens:800,messages:[{role:'user',content: 'You are a medical supply chain AI for a Medicare home health agency. Analyze this data and provide intelligent supply predictions.\n\n'+ 'PATIENT COUNT: '+patients.length+'\n'+ 'PATIENT DIAGNOSES: '+diagnoses+'\n'+ 'LOW STOCK ITEMS: '+lowItems.map(function(s){return s.name+' ('+s.stock+' remaining)';}).join(', ')+'\n'+ 'TOTAL SUPPLIES: '+supplies.length+'\n\n'+ 'Provide:\n'+ '1. TOP 5 SUPPLY PREDICTIONS "” what will run out soonest based on diagnoses\n'+ '2. SEASONAL ALERT "” any seasonal supply needs for April\n'+ '3. COST OPTIMIZATION "” 2 specific ways to reduce supply costs\n'+ '4. MEDICARE BILLING OPPORTUNITY "” which supplies are being used but not billed to Medicare\n'+ '5. REORDER SCHEDULE "” recommended reorder schedule for the next 30 days\n\n'+ 'Be specific and actionable. Format with clear headers.' }]}) }).then(function(r){return r.json();}).then(function(data){ btn.disabled=false; btn.innerHTML='Run AI Analysis'; if(data.content&&data.content[0]){ var text=data.content[0].text; eid('ai-predictions-content').innerHTML= '
'+ '
AI Supply Intelligence Report
'+ 'High Confidence
'+ '
'+text.replace(/\n/g,'
').replace(/\*\*(.*?)\*\*/g,'$1')+'
'+ '
'+ '
'+ ''+ '
'; } }).catch(function(){ btn.disabled=false; btn.innerHTML='Run AI Analysis'; showRuleBasedPredictions(); }); } function showRuleBasedPredictions(){ var out=supplies.filter(function(s){return s.stock===0;}); var low=supplies.filter(function(s){return s.stock>0&&s.stock<=s.reorder;}); var btn=eid('ai-predict-btn'); if(btn){btn.disabled=false;btn.innerHTML='Run AI Analysis';} eid('ai-predictions-content').innerHTML= '
'+ '
Supply Intelligence Report
Rule-Based Analysis
'+ '
'+ (out.length?'OUT OF STOCK (immediate action):
'+out.map(function(s){return '• '+s.name+' "” Order at least '+(s.max-s.stock)+' '+s.unit+'s from '+( s.supplier||'supplier');}).join('
')+'

':'')+ (low.length?'LOW STOCK (reorder within 3 days):
'+low.map(function(s){return '• '+s.name+' "” '+s.stock+' remaining (reorder point: '+s.reorder+')';}).join('
')+'

':'')+ 'MEDICARE BILLABLE SUPPLIES:
'+ supplies.filter(function(s){return s.billable==='Yes'&&s.hcpcs;}).map(function(s){return '• '+s.name+' ('+s.hcpcs+') "” ensure this is being billed to Medicare';}).join('
')+ '
'; } // ============================================================ // REPORTS // ============================================================ function renderReports(){ // Cost analysis var catCosts={}; supplies.forEach(function(s){ if(!catCosts[s.category]) catCosts[s.category]=0; catCosts[s.category]+=s.cost*s.stock; }); eid('cost-analysis').innerHTML=Object.keys(catCosts).map(function(cat){ var val=catCosts[cat]; var total=Object.values(catCosts).reduce(function(a,b){return a+b;},0); var pct=total?Math.round(val/total*100):0; return '
'+ '
'+ ''+cat+'$'+val.toFixed(0)+' ('+pct+'%)
'+ '
'+ '
'+ '
'; }).join(''); // Medicare billable eid('medicare-supplies').innerHTML= supplies.filter(function(s){return s.billable==='Yes';}).map(function(s){ return '
'+ '
'+s.name+'
'+(s.hcpcs||'No HCPCS code')+'
'+ '
$'+s.cost.toFixed(2)+'
per '+s.unit+'
'+ '
'; }).join(''); // Usage table eid('usage-table').innerHTML=supplies.map(function(s){ var used=dispenseLog.filter(function(d){ return d.supply_id===s.id&&new Date(d.date).getMonth()===new Date().getMonth(); }).reduce(function(sum,d){return sum+d.qty;},0); var monthCost=used*s.cost; var patientsUsing=[...new Set(dispenseLog.filter(function(d){return d.supply_id===s.id;}).map(function(d){return d.patient_id;}))].length; return ''+ ''+s.name+''+ ''+s.category+''+ ''+used+''+ '$'+monthCost.toFixed(2)+''+ ''+(s.hcpcs||'"”')+''+ ''+s.billable+''+ ''+patientsUsing+''+ ''; }).join(''); } function populateSupplyDropdowns(){ var sel=eid('d-supply'); if(sel){ sel.innerHTML=''+ supplies.map(function(s){return '';}).join(''); } } function printReport(){ window.print(); } function exportReport(){ var csv='Supply Name,Category,HCPCS,In Stock,Reorder Point,Unit Cost,Supplier,Billable\n'; supplies.forEach(function(s){ csv+='"'+s.name+'","'+s.category+'","'+(s.hcpcs||'')+'",'+s.stock+','+s.reorder+','+s.cost+',"'+(s.supplier||'')+'","'+s.billable+'"\n'; }); var blob=new Blob([csv],{type:'text/csv'}); var url=URL.createObjectURL(blob); var a=document.createElement('a'); a.href=url;a.download='supply-inventory.csv';a.click(); URL.revokeObjectURL(url); showMsg('✓ CSV exported successfully.','ok'); } function printAIReport(){ var content=eid('ai-predictions-content'); if(!content) return; var w=window.open('','_blank'); w.document.write('AI Supply Report
Back to Dashboard

AccessPro Supply Intelligence Report

Generated: '+new Date().toLocaleDateString()+'

'+content.innerHTML+''); w.document.close(); setTimeout(function(){w.print();},500); } loadAll();