pub fn find_last_dose_time_before(subject: &Subject, obs_time: f64) -> f64Expand description
Find the time of the last dose (bolus or infusion) before a given observation time
Returns the time of the most recent dose event that occurred before obs_time.
If no dose exists before the observation time, returns 0.0.
§Arguments
subject- Subject containing dose eventsobs_time- Observation time to find the preceding dose for
§Returns
Time of the last dose before obs_time, or 0.0 if none exists
§Example
ⓘ
let subject = Subject::builder("patient")
.bolus(0.0, 100.0, 0)
.bolus(12.0, 50.0, 0)
.observation(18.0, 5.0, 0)
.build();
let last_dose_time = find_last_dose_time_before(&subject, 18.0);
assert_eq!(last_dose_time, 12.0);