// OrthoGlobe Research Portal — study catalog.
//
// The portal is Phase 7 on the OrthoGlobe roadmap. The types below are the
// contract the study directory, study detail page, and EDC preview will speak
// when real protocols are entered. Until then `researchStudies` is empty and
// the directory page renders a "Coming soon" panel rather than fabricated
// trials, fake principal investigators, or invented enrolment numbers.

export type StudyPhase = "Planned" | "Recruiting" | "Active" | "Completed";

export type ResearchStudy = {
  slug: string;
  title: string;
  phase: StudyPhase;
  nctId?: string;
  sponsor: string;
  principalInvestigator: string;
  conditionKeyword: string;
  targetEnrolment: number;
  currentEnrolment: number;
  countries: string[];
  background: string;
  design: string;
  intervention: string;
  control: string;
  inclusion: string[];
  exclusion: string[];
  primaryOutcomes: string[];
  secondaryOutcomes: string[];
  sites: { city: string; country: string; pi: string; enrolment: number }[];
  investigators: { name: string; institution: string; role: string }[];
  documents: { name: string; type: string }[];
};

export const researchStudies: ResearchStudy[] = [];

export function getResearchStudy(slug: string): ResearchStudy | undefined {
  return researchStudies.find((s) => s.slug === slug);
}
