mirror of
https://github.com/gauvainboiche/ketapk.git
synced 2026-09-02 11:13:11 +02:00
feat: Comments translation to EN
This commit is contained in:
+15
-15
@@ -1,12 +1,12 @@
|
||||
/**
|
||||
* ============================================================================
|
||||
* KétaPK - Moteur Pharmacocinétique (PK/PD)
|
||||
* Modèles : Domino (1982), Clements (1981), Kamp (2020)
|
||||
* KétaPK - Pharmacokinetic Engine (PK/PD)
|
||||
* Models: Domino (1982), Clements (1981), Kamp (2020)
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
/**
|
||||
* Version unique de l'application (Centralisée)
|
||||
* Single application version (centralized)
|
||||
*/
|
||||
export const APP_VERSION = '0.19.0';
|
||||
|
||||
@@ -15,7 +15,7 @@ export const MODES = {
|
||||
RACEMIQUE: 'RACEMIQUE'
|
||||
};
|
||||
|
||||
// Modèles Multi-exponentiels
|
||||
// Multi-exponential models
|
||||
export const PK_MODELS = {
|
||||
DOMINO: {
|
||||
name: "Domino (1982)",
|
||||
@@ -43,7 +43,7 @@ export const PK_MODELS = {
|
||||
}
|
||||
};
|
||||
|
||||
// Zones d'effets cliniques et seuils (ng/mL)
|
||||
// Clinical effect zones and thresholds (ng/mL)
|
||||
export const CLINICAL_THRESHOLDS = {
|
||||
[MODES.ESKETAMINE]: {
|
||||
maxScale: 500,
|
||||
@@ -73,7 +73,7 @@ export const CLINICAL_THRESHOLDS = {
|
||||
}
|
||||
};
|
||||
|
||||
// Unités de perfusion supportées
|
||||
// Supported infusion units
|
||||
export const INFUSION_UNITS = {
|
||||
MG_KG_H: 'mg_kg_h', // mg/kg/h
|
||||
MCG_KG_MIN: 'mcg_kg_min',// µg/kg/min
|
||||
@@ -81,7 +81,7 @@ export const INFUSION_UNITS = {
|
||||
};
|
||||
|
||||
/**
|
||||
* Calcule la dose en mg administrée sur un intervalle de 5 minutes
|
||||
* Calculates the dose in mg administered over a 5-minute interval
|
||||
*/
|
||||
export function calculate5MinInfusionDose(rate, unit, weight) {
|
||||
if (!rate || rate <= 0) return 0;
|
||||
@@ -99,7 +99,7 @@ export function calculate5MinInfusionDose(rate, unit, weight) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul d'un bolus unique à l'instant t avec prise en compte de refDose
|
||||
* Calculation of a single bolus at time t, accounting for refDose
|
||||
*/
|
||||
export function calculateBolusCp(model, doseMg, weightKg, timeElapsedMin) {
|
||||
if (timeElapsedMin < 0 || weightKg <= 0 || !model.refDose) return 0;
|
||||
@@ -111,12 +111,12 @@ export function calculateBolusCp(model, doseMg, weightKg, timeElapsedMin) {
|
||||
const termB = B * Math.exp(-beta * timeElapsedMin);
|
||||
const termC = C * (gamma ? Math.exp(-gamma * timeElapsedMin) : 0);
|
||||
|
||||
// Division par refDose pour respecter la formule exacte de l'Excel
|
||||
// Division by refDose to match the exact Excel formula
|
||||
return (dosePerKg / refDose) * (termA + termB + termC);
|
||||
}
|
||||
|
||||
/**
|
||||
* Propage la perfusion active sur la timeline (pas de 5 min)
|
||||
* Propagates the active infusion across the timeline (5-min steps)
|
||||
*/
|
||||
export function processTimelineEvents(timelineInputs, weightKg, infusionUnit) {
|
||||
let currentRate = 0;
|
||||
@@ -142,7 +142,7 @@ export function processTimelineEvents(timelineInputs, weightKg, infusionUnit) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Convertit le débit de perfusion courant en mg/kg/min, quelle que soit l'unité saisie
|
||||
* Converts the current infusion rate to mg/kg/min, regardless of the input unit
|
||||
*/
|
||||
function infusionRateToMgKgPerMin(rate, unit, weightKg) {
|
||||
if (!rate || rate <= 0) return 0;
|
||||
@@ -160,8 +160,8 @@ function infusionRateToMgKgPerMin(rate, unit, weightKg) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Résolution exacte (méthode récursive discrétisée, cf. formule KétaPK) des bolus et
|
||||
* perfusions (à débit variable) sur la timeline, ng/mL arrondis à l'entier.
|
||||
* Exact resolution (discretized recursive method, cf. KétaPK formula) of boluses and
|
||||
* infusions (with variable rate) across the timeline, ng/mL rounded to the nearest integer.
|
||||
*/
|
||||
export function generateSimulationData({ model, weightKg, timelineInputs, infusionUnit = INFUSION_UNITS.MG_KG_H }) {
|
||||
const processedTimeline = processTimelineEvents(timelineInputs, weightKg, infusionUnit);
|
||||
@@ -191,7 +191,7 @@ export function generateSimulationData({ model, weightKg, timelineInputs, infusi
|
||||
if (!nextEvent) return;
|
||||
|
||||
const deltaT = nextEvent.time - event.time;
|
||||
// Excel applique le débit déclaré à la fin de l'intervalle (colonne d'arrivée), pas celui du départ
|
||||
// Excel applies the declared rate at the end of the interval (arrival column), not the starting one
|
||||
const Rn = infusionRateToMgKgPerMin(nextEvent.infusionRate, infusionUnit, weightKg) / refDose;
|
||||
|
||||
const Falpha = Math.exp(-alpha * deltaT);
|
||||
@@ -209,7 +209,7 @@ export function generateSimulationData({ model, weightKg, timelineInputs, infusi
|
||||
return cpResults;
|
||||
}
|
||||
|
||||
// Moteur de conversion de doses
|
||||
// Dose conversion engine
|
||||
export const CalculatorEngine = {
|
||||
mgToMgKg: (mg, weight) => (weight > 0 ? mg / weight : 0),
|
||||
mgKgToMg: (mgKg, weight) => mgKg * weight,
|
||||
|
||||
Reference in New Issue
Block a user