+ {messages.length === 0 && (
+
+
Ask a clinical question
+
+ The system retrieves PubMed abstracts and verifies each claim
+ against medical literature using NLI scoring. Optionally attach
+ a FHIR resource for structured clinical context.
+
+
+ )}
+
+ {messages.map((msg, i) => {
+ if (msg.role === 'user') {
+ return (
+
+ );
+ }
+
+ if (msg.role === 'error') {
+ return (
+
+ );
+ }
+
+ 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 && (
+
+ )}
+
+
+
+
+
+ {showFhir && (
+
+
+
+ FHIR Resource
+
+
+ · HAPI R4 Server
+
+
+
+ setFhirType(e.target.value)}
+ style={{
+ background: 'var(--bg)',
+ border: '1px solid var(--border)',
+ borderRadius: 6,
+ color: 'var(--text)',
+ fontFamily: 'DM Mono, monospace',
+ fontSize: 12,
+ padding: '6px 10px',
+ outline: 'none',
+ cursor: 'pointer',
+ flexShrink: 0,
+ }}
+ >
+ {FHIR_RESOURCE_TYPES.map(t => (
+ {t}
+ ))}
+
+ setFhirId(e.target.value)}
+ style={{
+ flex: 1,
+ background: 'var(--bg)',
+ border: '1px solid var(--border)',
+ borderRadius: 6,
+ color: 'var(--text)',
+ fontFamily: 'DM Mono, monospace',
+ fontSize: 12,
+ padding: '6px 10px',
+ outline: 'none',
+ }}
+ />
+
+
+ )}
+
+
+ setShowFhir(!showFhir)}
+ title="Attach FHIR resource"
+ style={{
+ background: showFhir ? 'var(--text)' : 'transparent',
+ color: showFhir ? 'var(--bg)' : 'var(--text-3)',
+ border: '1px solid var(--border)',
+ borderRadius: 6,
+ width: 32,
+ height: 32,
+ display: 'flex',
+ alignItems: 'center',
+ justifyContent: 'center',
+ cursor: 'pointer',
+ flexShrink: 0,
+ fontSize: 13,
+ transition: 'all 0.15s',
+ }}
+ >
+ ⬡
+
+
+
Enter to send · Shift+Enter for new line
+
+