Add doc to script file

This commit is contained in:
2025-11-27 20:09:58 +00:00
parent 312bb911bc
commit 032b966a9d
18 changed files with 189 additions and 2 deletions

View File

@@ -1,3 +1,14 @@
/**
* Pharmacokinetic Calculation Utilities
*
* Combines multiple dose profiles over time to create complete concentration
* curves. Handles steady-state calculations, dose accumulation, and empty
* value filtering for robust simulation.
*
* @author Andreas Weyer
* @license MIT
*/
import { timeToMinutes } from './timeUtils';
import { calculateSingleDoseConcentration } from './pharmacokinetics';
import type { Dose, Deviation, SteadyStateConfig, PkParams, ConcentrationPoint } from '../constants/defaults';

View File

@@ -1,3 +1,14 @@
/**
* Pharmacokinetic Model
*
* Implements single-dose concentration calculations for lisdexamfetamine (LDX)
* and its active metabolite dextroamphetamine (d-amph). Uses first-order
* absorption and elimination kinetics.
*
* @author Andreas Weyer
* @license MIT
*/
import { LDX_TO_DAMPH_CONVERSION_FACTOR, type PkParams } from '../constants/defaults';
interface ConcentrationResult {

View File

@@ -1,3 +1,14 @@
/**
* Dose Correction Suggestion Engine
*
* Generates dose correction suggestions when deviations occur from the planned
* medication schedule. Calculates required dose adjustments and optimal timing
* to maintain therapeutic concentrations.
*
* @author Andreas Weyer
* @license MIT
*/
import { timeToMinutes } from './timeUtils';
import { calculateCombinedProfile } from './calculations';
import type { Dose, Deviation, SteadyStateConfig, PkParams } from '../constants/defaults';

View File

@@ -1,4 +1,13 @@
// Time utility functions
/**
* Time Utility Functions
*
* Provides time format conversion utilities for working with HH:MM time strings
* and minute-based calculations throughout the application.
*
* @author Andreas Weyer
* @license MIT
*/
export const timeToMinutes = (timeStr: string): number => {
if (!timeStr || !timeStr.includes(':')) return 0;
const [hours, minutes] = timeStr.split(':').map(Number);