mirror of
https://github.com/gauvainboiche/ketapk.git
synced 2026-09-02 11:13:11 +02:00
fix: Fixing dose calculus + small display changes
This commit is contained in:
@@ -94,24 +94,24 @@ export function calculate5MinInfusionDose(rate, unit, weight) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calcul d'un bolus unique à l'instant t
|
||||
* Calcul d'un bolus unique à l'instant t avec prise en compte de refDose
|
||||
*/
|
||||
export function calculateBolusCp(model, doseMg, weightKg, timeElapsedMin) {
|
||||
if (timeElapsedMin < 0 || weightKg <= 0) return 0;
|
||||
if (timeElapsedMin < 0 || weightKg <= 0 || !model.refDose) return 0;
|
||||
|
||||
const dosePerKg = doseMg / weightKg;
|
||||
const { A, alpha, B, beta, C, gamma } = model;
|
||||
const { A, alpha, B, beta, C, gamma, refDose } = model;
|
||||
|
||||
const termA = A * Math.exp(-alpha * timeElapsedMin);
|
||||
const termB = B * Math.exp(-beta * timeElapsedMin);
|
||||
const termC = C * (gamma ? Math.exp(-gamma * timeElapsedMin) : 0);
|
||||
|
||||
return dosePerKg * (termA + termB + termC);
|
||||
// Division par refDose pour respecter la formule exacte de l'Excel
|
||||
return (dosePerKg / refDose) * (termA + termB + termC);
|
||||
}
|
||||
|
||||
/**
|
||||
* Propage la perfusion active sur la timeline (pas de 5 min)
|
||||
* Indique si chaque pas de temps possède une consigne explicite (isExplicit) ou héritée.
|
||||
*/
|
||||
export function processTimelineEvents(timelineInputs, weightKg, infusionUnit) {
|
||||
let currentRate = 0;
|
||||
|
||||
Reference in New Issue
Block a user