From acb0aeffa847c476225e34573b62773b175f73ea Mon Sep 17 00:00:00 2001 From: RunasSudo Date: Tue, 27 Aug 2024 17:13:23 +1000 Subject: [PATCH] Limit minimum gestation to 23 weeks as per NICE thresholds --- src/bilirubin_app.js | 4 ++-- src/bilirubin_lib.js | 4 ++-- src/index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bilirubin_app.js b/src/bilirubin_app.js index 5e83c3b..c1924eb 100644 --- a/src/bilirubin_app.js +++ b/src/bilirubin_app.js @@ -22,7 +22,7 @@ function plotGraphData() { let gestation = document.getElementById('gestation').valueAsNumber; - if (isNaN(gestation) || gestation < 22) { + if (isNaN(gestation) || gestation < 23) { chart.data.datasets[0].data = []; chart.data.datasets[1].data = []; } else { @@ -145,7 +145,7 @@ function updateBilirubin() { resultDiv.className = 'hidden'; return; } - if (isNaN(gestation) || gestation < 22) { + if (isNaN(gestation) || gestation < 23) { resultDiv.className = 'hidden'; return; } diff --git a/src/bilirubin_lib.js b/src/bilirubin_lib.js index 4132177..b407adb 100644 --- a/src/bilirubin_lib.js +++ b/src/bilirubin_lib.js @@ -46,7 +46,7 @@ function phototherapy_thresh(d, gestation) { if (gestation >= 38) { return phototherapy_38wks(d); } - if (gestation < 22) { + if (gestation < 23) { throw new Error('Invalid gestation'); } if (d <= 0) { @@ -63,7 +63,7 @@ function exchange_thresh(d, gestation) { if (gestation >= 38) { return exchange_38wks(d); } - if (gestation < 22) { + if (gestation < 23) { throw new Error('Invalid gestation'); } if (d <= 0) { diff --git a/src/index.html b/src/index.html index 45a25d6..f95f3b9 100644 --- a/src/index.html +++ b/src/index.html @@ -35,7 +35,7 @@
- +
completed weeks