% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/psych_scores.R
\name{psych_med_flags}
\alias{psych_med_flags}
\title{Psychiatric medication flags aggregator}
\usage{
psych_med_flags(
  data,
  col_map = list(),
  prefix = "med",
  na_action = c("keep", "omit", "error")
)
}
\arguments{
\item{data}{Data frame containing questionnaire item columns.}

\item{col_map}{Named list \code{med} mapping medication classes (e.g., ssri, snri) to columns of boolean/numeric flags.}

\item{prefix}{Prefix for output flag columns.}

\item{na_action}{How to handle rows with missing items: \code{keep}, \code{omit}, or \code{error}.}
}
\value{
A tibble of flag columns only: \code{med_any_psych}, \code{med_count}. Input columns are not included.
}
\description{
Psychiatric medication flags aggregator
}
\examples{
df <- data.frame(med_ssri = c(1, 0), med_antipsychotic = c(0, 1))
cm <- list(med = list(
  ssri = "med_ssri",
  antipsychotic = "med_antipsychotic"
))
psych_med_flags(df, col_map = cm)
}
