Update pharmacokinetic parameters/calculations, add advanced settings, add disclaimer/citations, many improvements
This commit is contained in:
@@ -28,7 +28,12 @@ export const calculateCombinedProfile = (
|
||||
const timeStepHours = 0.25;
|
||||
const totalDays = days.length;
|
||||
const totalHours = totalDays * 24;
|
||||
const daysToSimulate = Math.min(parseInt(steadyStateConfig.daysOnMedication, 10) || 0, 5);
|
||||
|
||||
// Use steadyStateDays from advanced settings (allows 0 for "first day" simulation)
|
||||
const daysToSimulate = Math.min(
|
||||
parseInt(pkParams.advanced.steadyStateDays, 10) || 0,
|
||||
7 // cap at 7 days for performance
|
||||
);
|
||||
|
||||
// Convert days to processed doses with absolute time
|
||||
const allDoses: ProcessedDose[] = [];
|
||||
@@ -36,7 +41,7 @@ export const calculateCombinedProfile = (
|
||||
// Add steady-state doses (days before simulation period)
|
||||
// Use template day (first day) for steady state
|
||||
const templateDay = days[0];
|
||||
if (templateDay) {
|
||||
if (templateDay && daysToSimulate > 0) {
|
||||
for (let steadyDay = -daysToSimulate; steadyDay < 0; steadyDay++) {
|
||||
const dayOffsetMinutes = steadyDay * 24 * 60;
|
||||
templateDay.doses.forEach(dose => {
|
||||
|
||||
Reference in New Issue
Block a user