Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update oref0 to include reversion of actualDate #68

Merged
merged 1 commit into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion FreeAPS/Resources/javascript/bundle/autosens.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FreeAPS/Resources/javascript/bundle/autotune-prep.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FreeAPS/Resources/javascript/bundle/iob.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion FreeAPS/Resources/javascript/bundle/meal.js

Large diffs are not rendered by default.

17 changes: 6 additions & 11 deletions open-iaps-oref/lib/meal/history.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@ function findMealInputs (inputs) {

for (var i=0; i < carbHistory.length; i++) {
var current = carbHistory[i];
if (current.carbs && current.actualDate) {
var temp = {};
temp.timestamp = current.actualDate;
temp.carbs = current.carbs;
temp.nsCarbs = current.carbs;
} else if (current.carbs && current.created_at) {
if (current.carbs && current.created_at) {
var temp = {};
temp.timestamp = current.created_at;
temp.carbs = current.carbs;
temp.nsCarbs = current.carbs;
if (!arrayHasElementWithSameTimestampAndProperty(mealInputs,current.created_at,"carbs") ||
!arrayHasElementWithSameTimestampAndProperty(mealInputs, current.actualDate,"carbs")) {
if (!arrayHasElementWithSameTimestampAndProperty(mealInputs,current.created_at,"carbs")) {
mealInputs.push(temp);
} else {
duplicates += 1;
Expand All @@ -61,7 +55,8 @@ function findMealInputs (inputs) {
// More specifically, we need to make sure we process the corresponding bolus entry first.
bolusWizardInputs.push(current);

} else if ((current._type === "Meal Bolus" || current._type === "Correction Bolus" || current._type === "Snack Bolus" || current._type === "Bolus Wizard" || current._type === "Carb Correction") && current.created_at || current.actualDate) { //imports carbs entered through Nightscout Care Portal
} else if ((current._type === "Meal Bolus" || current._type === "Correction Bolus" || current._type === "Snack Bolus" || current._type === "Bolus Wizard" || current._type === "Carb Correction") && current.created_at) {
//imports carbs entered through Nightscout Care Portal
//"Bolus Wizard" refers to the Nightscout Bolus Wizard, not the Medtronic Bolus Wizard
temp = {};
temp.timestamp = current.created_at;
Expand Down Expand Up @@ -89,7 +84,7 @@ function findMealInputs (inputs) {
temp = {};
temp.carbs = current.carbs;
temp.nsCarbs = current.carbs;
temp.timestamp = current.actualDate || current.created_at;
temp.timestamp = current.created_at;
temp.bolus = current.insulin;
if (!arrayHasElementWithSameTimestampAndProperty(mealInputs,current.timestamp,"carbs")) {
mealInputs.push(temp);
Expand All @@ -98,7 +93,7 @@ function findMealInputs (inputs) {
}
} else if (current._type === "JournalEntryMealMarker" && current.carb_input > 0 && current.timestamp) {
temp = {};
temp.timestamp = current.actualDate || current.created_at;
temp.timestamp = current.timestamp;
temp.carbs = current.carb_input;
temp.journalCarbs = current.carb_input;
if (!arrayHasElementWithSameTimestampAndProperty(mealInputs,current.timestamp,"carbs")) {
Expand Down
12 changes: 6 additions & 6 deletions oref0_source_version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
oref0 branch: dev - git version: 1990e37
oref0 branch: dev - git version: 4438013

Last commits:
4438013 Merge pull request #11 from nightscout/issue-template
d76ed48 Update config.yml
8d4f4ff Merge pull request #14 from nightscout/revert_actualDate
a42e58f Revert "actualDate" changes to lib/meal/history.js
f10ef66 Edit issue templates
1990e37 Merge pull request #9 from nightscout/smb_ratio_log
4b7676c determine-basal.js smb_ratio log: if (smb_ratio != 0.5)
f932754 Merge pull request #4 from nightscout/duplicate_SMBratio
Expand All @@ -26,8 +31,3 @@ f295a47 fix from Deniz
8d739f5 Merge pull request #7 from JeremyStorring/time-issues
1f2b45f fix for time calcs
b8f5997 Merge pull request #6 from JeremyStorring/min_bg_threshold
256662c Adjusted min threshold, as min_bg for target of 80 is 60 (80 - (0.5*(80-40))
838038a Merge pull request #4 from JeremyStorring/minify_fixes
fc0e748 Address review comments from Robert
30549a0 Merge pull request #3 from bjornoleh/webpack
1276c59 Merge pull request #2 from bjornoleh/revert_1370