From e4a95ad72e210853cc13affd2a232fe116c83db8 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 6 May 2026 23:39:40 +0200 Subject: [PATCH] refactor: move assistant examples to module --- public/index.html | 2 +- public/js/assistant/data.js | 22 ++++++++++++++++++++++ public/js/clinicalAssistant.js | 24 ++---------------------- 3 files changed, 25 insertions(+), 23 deletions(-) create mode 100644 public/js/assistant/data.js diff --git a/public/index.html b/public/index.html index 1afcf4e..f9a99a4 100644 --- a/public/index.html +++ b/public/index.html @@ -494,7 +494,7 @@ - + diff --git a/public/js/assistant/data.js b/public/js/assistant/data.js new file mode 100644 index 0000000..43dbea1 --- /dev/null +++ b/public/js/assistant/data.js @@ -0,0 +1,22 @@ +export var EMPTY_PROMPT_SETS = [ + [ + { label: 'Status asthma escalation', prompt: 'In a 4-year-old with acute wheeze, when should magnesium sulfate be considered and what dose is recommended?' }, + { label: 'Bilious vomiting', prompt: 'What are the red flags for bilious vomiting in neonates, and what immediate workup is recommended?' }, + { label: 'Bronchiolitis vs asthma', prompt: 'Compare bronchiolitis and asthma management in infants, citing pediatric references.' } + ], + [ + { label: 'Febrile neonate', prompt: 'What initial workup and empiric antibiotics are recommended for a well-appearing febrile neonate?' }, + { label: 'DKA fluids', prompt: 'Summarize pediatric DKA fluid strategy and cerebral edema warning signs.' }, + { label: 'Croup escalation', prompt: 'When should a child with croup receive nebulized epinephrine and observation?' } + ], + [ + { label: 'Sepsis bolus', prompt: 'In pediatric septic shock, when should fluid boluses be limited and vasoactives started?' }, + { label: 'Head injury CT', prompt: 'Which pediatric head injury features should prompt CT or observation?' }, + { label: 'UTI fever', prompt: 'How should febrile UTI be evaluated and treated in young children?' } + ], + [ + { label: 'Sickle pain fever', prompt: 'How should fever and pain crisis be managed in a child with sickle cell disease?' }, + { label: 'Neonatal jaundice', prompt: 'What bilirubin risk factors change phototherapy decisions in a newborn?' }, + { label: 'Status seizure', prompt: 'Outline first- and second-line treatment for pediatric status epilepticus.' } + ] +]; diff --git a/public/js/clinicalAssistant.js b/public/js/clinicalAssistant.js index e537f3b..aa5113c 100644 --- a/public/js/clinicalAssistant.js +++ b/public/js/clinicalAssistant.js @@ -3,6 +3,8 @@ // Backend contract intentionally uses /api/clinical-assistant/* so the // server can call native MCP directly without routing through mcpo. // ============================================================ +import { EMPTY_PROMPT_SETS } from './assistant/data.js'; + (function () { 'use strict'; @@ -14,28 +16,6 @@ var dynamicExamples = []; var generatedImages = {}; var generatedImageSeq = 0; - var EMPTY_PROMPT_SETS = [ - [ - { label: 'Status asthma escalation', prompt: 'In a 4-year-old with acute wheeze, when should magnesium sulfate be considered and what dose is recommended?' }, - { label: 'Bilious vomiting', prompt: 'What are the red flags for bilious vomiting in neonates, and what immediate workup is recommended?' }, - { label: 'Bronchiolitis vs asthma', prompt: 'Compare bronchiolitis and asthma management in infants, citing pediatric references.' } - ], - [ - { label: 'Febrile neonate', prompt: 'What initial workup and empiric antibiotics are recommended for a well-appearing febrile neonate?' }, - { label: 'DKA fluids', prompt: 'Summarize pediatric DKA fluid strategy and cerebral edema warning signs.' }, - { label: 'Croup escalation', prompt: 'When should a child with croup receive nebulized epinephrine and observation?' } - ], - [ - { label: 'Sepsis bolus', prompt: 'In pediatric septic shock, when should fluid boluses be limited and vasoactives started?' }, - { label: 'Head injury CT', prompt: 'Which pediatric head injury features should prompt CT or observation?' }, - { label: 'UTI fever', prompt: 'How should febrile UTI be evaluated and treated in young children?' } - ], - [ - { label: 'Sickle pain fever', prompt: 'How should fever and pain crisis be managed in a child with sickle cell disease?' }, - { label: 'Neonatal jaundice', prompt: 'What bilirubin risk factors change phototherapy decisions in a newborn?' }, - { label: 'Status seizure', prompt: 'Outline first- and second-line treatment for pediatric status epilepticus.' } - ] - ]; document.addEventListener('tabChanged', function (e) { if (e.detail && e.detail.tab === 'assistant') initIfNeeded();