1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! Non-Compartmental Analysis (NCA) for pharmacokinetic data
//!
//! This module provides an API for calculating standard NCA parameters
//! from the basic Pharmsol's data structures
//! ([`crate::Subject`], [`crate::Occasion`] and [`crate::Data`]).
//!
//! # Usage
//!
//! NCA is performed by calling `.nca()` on a `Subject`. Dose and route
//! information are automatically detected from the dose events in the data.
//!
//! ```rust,ignore
//! use pharmsol::prelude::*;
//! use pharmsol::nca::NCAOptions;
//!
//! // Build subject with dose and observation events
//! let subject = Subject::builder("patient_001")
//! .bolus(0.0, 100.0, 0) // 100 mg oral dose
//! .observation(1.0, 10.0, 0)
//! .observation(2.0, 8.0, 0)
//! .observation(4.0, 4.0, 0)
//! .build();
//!
//! // Perform NCA with default options
//! let result = subject.nca(&NCAOptions::default()).expect("NCA failed");
//!
//! println!("Cmax: {:.2}", result.exposure.cmax);
//! println!("AUClast: {:.2}", result.exposure.auc_last);
//! ```
//!
//! # Steady-State Analysis
//!
//! ```rust,ignore
//! use pharmsol::nca::NCAOptions;
//!
//! // Configure for steady-state with 12h dosing interval
//! let options = NCAOptions::default().with_tau(12.0);
//! let result = subject.nca(&options).unwrap();
//!
//! if let Some(ref ss) = result.steady_state {
//! println!("Cavg: {:.2}", ss.cavg);
//! println!("Fluctuation: {:.1}%", ss.fluctuation);
//! }
//! ```
//!
//! # Population Analysis
//!
//! ```rust,ignore
//! use pharmsol::nca::{NCAOptions, NCA, NCAPopulation};
//!
//! // All occasions flat
//! let all_results = data.nca_all(&options);
//!
//! // Grouped by subject (includes error isolation)
//! let grouped = data.nca_grouped(&options);
//! for subj in &grouped {
//! println!("{}: {} ok, {} errors",
//! subj.subject_id,
//! subj.successes().len(),
//! subj.errors().len());
//! }
//! ```
// Internal modules
pub
// Feature modules
// Crate-internal re-exports
// (traits.rs accesses analyze::analyze and calc::tlag_from_raw directly)
// Public API
pub use ;
pub use NCAError;
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export shared types (backwards compatible)
pub use crate;