Multi-tenant platform (182 pages, 228 API routes, ~30 modules) built on a deterministic verification core: clinical-trial claims checked against ClinicalTrials.gov registered results and raw event counts (ARR/NNT/RR+CI recomputed in code, oracle-tested), code-enforced exact-span grounding, and multi-source cross-verification. Auth/RBAC/multi-tenancy, document processing at scale (unpdf + Docling), agentic workflows, Claude Science connector, compliance/audit, billing, public API, and more. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
59 lines
1.7 KiB
TypeScript
59 lines
1.7 KiB
TypeScript
import {
|
|
formatPct,
|
|
labelFor,
|
|
type RegistryAnalytics,
|
|
} from "../client";
|
|
import { BarChart, ChartCard, KpiCard } from "../components";
|
|
|
|
interface RegistryMetricsProps {
|
|
data: RegistryAnalytics;
|
|
}
|
|
|
|
// KPI row + outcome distribution chart for the evidence & registry sub-page.
|
|
export function RegistryMetrics({ data }: RegistryMetricsProps) {
|
|
const coverage =
|
|
data.trialSourcesMatched > 0
|
|
? data.sourcesWithRegisteredResults / data.trialSourcesMatched
|
|
: 0;
|
|
|
|
return (
|
|
<div className="flex flex-col gap-4">
|
|
<div className="grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4">
|
|
<KpiCard
|
|
label="Trial-matched verifications"
|
|
value={String(data.trialMatchedVerifications)}
|
|
hint="Matched a ClinicalTrials.gov source"
|
|
/>
|
|
<KpiCard
|
|
label="Registry-checkable"
|
|
value={String(data.registryCheckable)}
|
|
hint="Source has posted results"
|
|
/>
|
|
<KpiCard
|
|
label="Trial sources matched"
|
|
value={String(data.trialSourcesMatched)}
|
|
/>
|
|
<KpiCard
|
|
label="Registry coverage"
|
|
value={formatPct(coverage)}
|
|
hint={`${data.sourcesWithRegisteredResults} with results`}
|
|
/>
|
|
</div>
|
|
|
|
<ChartCard
|
|
title="Registry-check outcome distribution"
|
|
description="Outcomes among verifications whose matched trial has posted registered results."
|
|
>
|
|
<BarChart
|
|
data={data.outcomeDistribution.map((o) => ({
|
|
label: labelFor(o.outcome),
|
|
value: o.count,
|
|
suffix: formatPct(o.rate),
|
|
}))}
|
|
emptyMessage="No registry-checkable verifications yet."
|
|
/>
|
|
</ChartCard>
|
|
</div>
|
|
);
|
|
}
|