From a166b8a56a63aae420251c7cc151a66c9d9a22a2 Mon Sep 17 00:00:00 2001 From: Rob Kresha Date: Sun, 22 Dec 2019 21:54:45 -0600 Subject: [PATCH 1/2] Medtronic clarify error notification Adding additional information around the error message so the user can resolve. US version of the 723 Revel has no Basal 'profile' setting, just a 'patterns' setting which when enabled resolves the error. --- app/src/main/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e03b30b2b9..f34ec9c784 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1542,7 +1542,7 @@ RileyLink Address invalid. Pump type detected is not the same as configured type. - Basal profiles are not enabled on pump. + Basal profiles/patterns setting is not enabled on pump. Enable it on the pump. Basal profile set on pump is incorrect (must be STD). Wrong TBR type set on pump (must be Absolute). Wrong Max Bolus set on Pump (must be %1$.2f). From 86adc19010d7ca9c4efa618e82c00cc385a9e01b Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Tue, 24 Dec 2019 17:52:28 +0100 Subject: [PATCH 2/2] - added code to remove Treatment entries, without any insulin (for syncing PH Bolus entries with Treatments) --- .../medtronic/data/MedtronicHistoryData.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java index 2e23d2a955..11d1bad3d9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.java @@ -32,6 +32,7 @@ import info.nightscout.androidaps.db.TemporaryBasal; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.general.nsclient.NSUpload; import info.nightscout.androidaps.plugins.pump.common.bolusInfo.DetailedBolusInfoStorage; +import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil; import info.nightscout.androidaps.plugins.pump.common.utils.StringUtil; import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.MedtronicPumpHistoryDecoder; @@ -613,6 +614,8 @@ public class MedtronicHistoryData { return; } + filterOutNonInsulinEntries(entriesFromHistory); + if (doubleBolusDebug) LOG.debug("DoubleBolusDebug: List (after filter): {}, FromDb={}", gson.toJson(entryList), gsonCore.toJson(entriesFromHistory)); @@ -640,6 +643,23 @@ public class MedtronicHistoryData { } + private void filterOutNonInsulinEntries(List entriesFromHistory) { + // when we try to pair PumpHistory with AAPS treatments, we need to ignore all non-insulin entries + List removeList = new ArrayList<>(); + + for (DbObjectBase dbObjectBase : entriesFromHistory) { + + Treatment treatment = (Treatment)dbObjectBase; + + if (RileyLinkUtil.isSame(treatment.insulin, 0d)) { + removeList.add(dbObjectBase); + } + } + + entriesFromHistory.removeAll(removeList); + } + + private void processTBREntries(List entryList) { Collections.reverse(entryList);