From b01fd78045dfabaffda13bf5f1438a5854e5efc8 Mon Sep 17 00:00:00 2001 From: AndrewVFranco <129307231+AndrewVFranco@users.noreply.github.com> Date: Mon, 20 Apr 2026 02:23:13 -0700 Subject: [PATCH 1/2] Add FHIR server integration --- frontend/src/components/ChatWindow.js | 108 -------------------------- src/agent/graph.py | 14 +++- src/agent/nodes.py | 29 ++++++- src/agent/state.py | 4 + src/api/main.py | 40 +++++++++- 5 files changed, 80 insertions(+), 115 deletions(-) delete mode 100644 frontend/src/components/ChatWindow.js diff --git a/frontend/src/components/ChatWindow.js b/frontend/src/components/ChatWindow.js deleted file mode 100644 index 770b89d..0000000 --- a/frontend/src/components/ChatWindow.js +++ /dev/null @@ -1,108 +0,0 @@ -import React, { useEffect, useRef } from 'react'; -import ReactMarkdown from 'react-markdown'; -import ClaimItem from './ClaimItem'; -import DrugCarousel from './DrugCarousel'; - -function ChatWindow({ messages, query, onQueryChange, onSubmit, loading }) { - const bottomRef = useRef(null); - - useEffect(() => { - bottomRef.current?.scrollIntoView({ behavior: 'smooth' }); - }, [messages, loading]); - - const handleKeyDown = (e) => { - if (e.key === 'Enter' && !e.shiftKey) { - e.preventDefault(); - onSubmit(); - } - }; - - return ( -
-
- {messages.length === 0 && ( -
-

Ask a clinical question

-

- The system will retrieve relevant PubMed abstracts and verify each - claim in the response against medical literature using NLI scoring. -

-
- )} - - {messages.map((msg, i) => { - if (msg.role === 'user') { - return ( -
-
{msg.text}
-
- ); - } - - if (msg.role === 'error') { - return ( -
-
{msg.text}
-
- ); - } - - if (msg.role === 'assistant') { - return ( -
-
- {msg.data.response} -
- - {msg.data.scored_claims && msg.data.scored_claims.length > 0 && ( -
-
Claim Verification
- {msg.data.scored_claims.map((claim, j) => ( - - ))} -
- )} -
- ); - } - - return null; - })} - - {loading && ( -
-
-
-
-
-
-
- )} - -
-
- -
-
-