% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/corrected_calcium.R
\name{corrected_calcium}
\alias{corrected_calcium}
\title{Albumin-Corrected Calcium}
\usage{
corrected_calcium(
  data,
  col_map = NULL,
  units = c("auto", "conventional", "si"),
  na_action = c("keep", "omit", "error", "ignore", "warn"),
  verbose = TRUE
)
}
\arguments{
\item{data}{A data.frame or tibble containing serum calcium and albumin.}

\item{col_map}{Named list with \code{calcium} and \code{albumin} indicating column names.}

\item{units}{One of c("auto","conventional","si"). "auto" attempts unit detection.}

\item{na_action}{One of c("keep","omit","error","ignore","warn").}

\item{verbose}{Logical; if TRUE (default), emits progress via hm_inform().}
}
\value{
A tibble with one column: corrected_calcium (numeric, in mg/dL for
conventional input or mmol/L for SI / auto-SI input).
}
\description{
Calculates the albumin-adjusted (corrected) serum calcium level, accounting for hypoalbuminemia,
using the Payne formula.
}
\details{
Payne formula (conventional units): Corrected Ca (mg/dL) = measured Ca (mg/dL) + 0.8 * (4.0 - albumin (g/dL)).
If inputs appear to be in SI units (calcium mmol/L, albumin g/L), they are converted to mg/dL and g/dL
(using 1 mmol/L ~= 4 mg/dL; 1 g/L = 0.1 g/dL) for the correction and converted back to mmol/L for output.
}
\examples{
df <- data.frame(Ca = c(2.3, 2.5, 2.1), Alb = c(38, 42, 30))
corrected_calcium(df)
}
\references{
\insertRef{payne1973}{HealthMarkers}
}
