From 7c3480b6d05c3edeff0582a942391ff02da5c99c Mon Sep 17 00:00:00 2001 From: t_j_s Date: Sat, 12 Feb 2022 19:10:58 +0000 Subject: [PATCH] Allows use of basal if TDD7 is not available from Database. --- app/src/main/assets/OpenAPSSMB/determine-basal.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/assets/OpenAPSSMB/determine-basal.js b/app/src/main/assets/OpenAPSSMB/determine-basal.js index a18120af22..d33dc5988d 100644 --- a/app/src/main/assets/OpenAPSSMB/determine-basal.js +++ b/app/src/main/assets/OpenAPSSMB/determine-basal.js @@ -284,7 +284,12 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ else { console.error("Time now is "+now+"; "); } + if (meal_data.TDDAIMI7){ var tdd7 = meal_data.TDDAIMI7; + } + else{ + var tdd7 = ((basal * 12)*100)/21; + } var tdd_pump_now = meal_data.TDDPUMP; var tdd_pump = ( tdd_pump_now / (now / 24)); var TDD = (tdd7 * 0.4) + (tdd_pump * 0.6); @@ -307,6 +312,7 @@ var determine_basal = function determine_basal(glucose_status, currenttemp, iob_ rT.reason += "TDD: " +TDD+ " based on standard pump 60/tdd7 40 split; "; } + var variable_sens = (277700 / (TDD * bg)); variable_sens = round(variable_sens,1); console.log("Current sensitivity for predictions is " +variable_sens+" based on current bg");