/** * @fileoverview The pre-render pass shared by the surfaces that return a whole * study — caps on its location, outcome, and reference lists, a download URL on * each uploaded document, and compact counts for the heavy resultsSection. * Applied once, before either output channel sees the record, so * `structuredContent` and `format()` render the same data. * @module mcp-server/tools/utils/study-filters */ import type { RawStudyShape } from '../../../services/clinical-trials/types.js'; /** Caps and geo filter a caller (or a fixed resource default) can request. */ export interface FilterInputs { locationLimit?: number | undefined; nearLocation?: { lat: number; lon: number; radiusMi: number; } | undefined; outcomeLimit?: number | undefined; referenceLimit?: number | undefined; } /** What a filter pass actually did — populated only where it changed the data. */ export interface FilterMeta { locationLimit?: number; locationsWithoutGeo?: number; nearLocation?: { lat: number; lon: number; radiusMi: number; }; outcomeLimit?: number; referenceLimit?: number; totalLocations?: number; totalOtherOutcomes?: number; totalReferences?: number; totalSecondaryOutcomes?: number; } /** * Apply the requested filters to the study so structuredContent and format() * see the same data. A limit (and its corresponding upstream total) is recorded * in `meta` only when it actually reduced the set — reporting a cap that trimmed * nothing would imply a filter was applied when none was. `nearLocation` always * filters (drops non-geo sites, sorts, applies radius), so it is always echoed. * * Document URLs are attached here rather than at either call site: this pass is * the one place both the tool and the resource route a whole record through, so * neither surface can drift from the other on where a document lives. */ export declare function applyFilters(study: RawStudyShape, input: FilterInputs): { study: RawStudyShape; meta: FilterMeta; }; /** Compact counts of a study's posted results. */ export interface ResultsSummary { baselineMeasures?: number; otherAdverseEvents?: number; outcomeMeasures?: number; participantFlowPeriods?: number; seriousAdverseEvents?: number; } /** * Compact counts of a study's posted results, computed before the heavy * resultsSection is dropped from a record-level payload. Returns undefined when * the study has no posted results. */ export declare function summarizeResults(study: RawStudyShape): ResultsSummary | undefined; //# sourceMappingURL=study-filters.d.ts.map