% PRISMA 2020 flow diagram (TikZ). All numbers come from prisma_numbers.tex,
% which is generated from data_processed/prisma_flow.json - never hand-edit a count.
\input{figures/prisma_numbers}

\begin{center}
\begin{tikzpicture}[
  font=\footnotesize,
  stage/.style={draw, rounded corners=2pt, align=left, inner sep=5pt, text width=6.4cm},
  side/.style={draw, dashed, rounded corners=2pt, align=left, inner sep=4pt, text width=6.0cm, fill=gray!6},
  lbl/.style={font=\scriptsize\bfseries, fill=white, inner sep=1.5pt},
  arrow/.style={-{Latex[length=2mm]}, thick},
  node distance=5mm
]

% ---- Identification ----
\node[stage] (ident) {\textbf{Identification (via databases)}\\
  Records identified from: OpenAlex (\pIdentOA); Scopus (\pIdentSC)\\
  \textbf{Total records identified: \pIdentTotal}};

\node[side, below=of ident] (dup) {Duplicate records removed before screening: \textbf{\pDuplicates}\\
  Records remaining after deduplication: \textbf{\pAfterDedup}};

\node[stage, below=of dup] (screen) {\textbf{Screening}\\
  Records screened (title/abstract): \textbf{\pScreened}\\
  \quad Records excluded at screening: \textbf{\pScreeningExcluded}};

\node[stage, below=of screen] (elig) {\textbf{Eligibility (full text)}\\
  Reports sought for retrieval: \textbf{\pSought}\\
  \quad Reports not retrieved: \textbf{\pNotRetrieved}\\
  Reports assessed for eligibility: \textbf{\pAssessed}};

\node[side, below=of elig] (eligex) {Reports excluded at eligibility, with reasons: \textbf{\pEligExcluded}};

\node[stage, below=of eligex, fill=green!5] (incl) {\textbf{Included}\\
  Studies included in the qualitative synthesis: \textbf{\pIncluded}};

\draw[arrow] (ident) -- (dup);
\draw[arrow] (dup) -- (screen);
\draw[arrow] (screen) -- (elig);
\draw[arrow] (elig) -- (eligex);
\draw[arrow] (eligex) -- (incl);

% annotation: automated pre-screening
\node[anchor=west, font=\scriptsize, align=left] at ($(screen.east)+(0.6,0)$)
  {Automated pre-screen\\removed \pAutoExcluded\\before human review.};

\end{tikzpicture}
\end{center}
