Trait NCA
pub trait NCA {
// Required methods
fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>;
fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>;
}Expand description
Extension trait for Non-Compartmental Analysis
Provides .nca() (first occasion) and .nca_all() (all occasions)
on Data, Subject, and Occasion.
The output equation is controlled by NCAOptions::outeq (default 0).
§Example
ⓘ
use pharmsol::prelude::*;
use pharmsol::nca::NCAOptions;
let subject = Subject::builder("patient_001")
.bolus(0.0, 100.0, 0)
.observation(1.0, 10.0, 0)
.observation(2.0, 8.0, 0)
.observation(4.0, 4.0, 0)
.build();
// Single-occasion (the common case)
let result = subject.nca(&NCAOptions::default())?;
println!("Cmax: {:.2}", result.exposure.cmax);
// All occasions
let all = subject.nca_all(&NCAOptions::default());Required Methods§
fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>
fn nca(&self, options: &NCAOptions) -> Result<NCAResult, NCAError>
NCA on the first occasion (the common case). Returns a single result.
fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>
fn nca_all(&self, options: &NCAOptions) -> Vec<Result<NCAResult, NCAError>>
NCA on all occasions. Returns a Vec of results.