|
@@ -14,7 +14,6 @@ struct Statistics: JSON, Equatable {
|
|
|
var CGM: String
|
|
var CGM: String
|
|
|
var insulinType: String
|
|
var insulinType: String
|
|
|
var peakActivityTime: Decimal
|
|
var peakActivityTime: Decimal
|
|
|
- var TDD: Decimal
|
|
|
|
|
var Carbs_24h: Decimal
|
|
var Carbs_24h: Decimal
|
|
|
var GlucoseStorage_Days: Decimal
|
|
var GlucoseStorage_Days: Decimal
|
|
|
var Statistics: Stats
|
|
var Statistics: Stats
|
|
@@ -33,7 +32,6 @@ struct Statistics: JSON, Equatable {
|
|
|
CGM: String,
|
|
CGM: String,
|
|
|
insulinType: String,
|
|
insulinType: String,
|
|
|
peakActivityTime: Decimal,
|
|
peakActivityTime: Decimal,
|
|
|
- TDD: Decimal,
|
|
|
|
|
Carbs_24h: Decimal,
|
|
Carbs_24h: Decimal,
|
|
|
GlucoseStorage_Days: Decimal,
|
|
GlucoseStorage_Days: Decimal,
|
|
|
Statistics: Stats
|
|
Statistics: Stats
|
|
@@ -51,7 +49,6 @@ struct Statistics: JSON, Equatable {
|
|
|
self.CGM = CGM
|
|
self.CGM = CGM
|
|
|
self.insulinType = insulinType
|
|
self.insulinType = insulinType
|
|
|
self.peakActivityTime = peakActivityTime
|
|
self.peakActivityTime = peakActivityTime
|
|
|
- self.TDD = TDD
|
|
|
|
|
self.Carbs_24h = Carbs_24h
|
|
self.Carbs_24h = Carbs_24h
|
|
|
self.GlucoseStorage_Days = GlucoseStorage_Days
|
|
self.GlucoseStorage_Days = GlucoseStorage_Days
|
|
|
self.Statistics = Statistics
|
|
self.Statistics = Statistics
|
|
@@ -81,7 +78,6 @@ extension Statistics {
|
|
|
case CGM
|
|
case CGM
|
|
|
case insulinType
|
|
case insulinType
|
|
|
case peakActivityTime
|
|
case peakActivityTime
|
|
|
- case TDD
|
|
|
|
|
case Carbs_24h
|
|
case Carbs_24h
|
|
|
case GlucoseStorage_Days
|
|
case GlucoseStorage_Days
|
|
|
case Statistics
|
|
case Statistics
|
|
@@ -161,11 +157,19 @@ struct Hypers: JSON, Equatable {
|
|
|
var total: Decimal
|
|
var total: Decimal
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+struct Ins: JSON, Equatable {
|
|
|
|
|
+ let TDD: Decimal?
|
|
|
|
|
+ let bolus: Decimal?
|
|
|
|
|
+ let temp_basal: Decimal?
|
|
|
|
|
+ let scheduled_basal: Decimal?
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
struct Stats: JSON, Equatable {
|
|
struct Stats: JSON, Equatable {
|
|
|
var Distribution: [TIRs]
|
|
var Distribution: [TIRs]
|
|
|
var Glucose: [Averages]
|
|
var Glucose: [Averages]
|
|
|
var HbA1c: [Hbs]
|
|
var HbA1c: [Hbs]
|
|
|
var LoopCycles: [LoopCycles]
|
|
var LoopCycles: [LoopCycles]
|
|
|
|
|
+ var Insulin: [Ins]
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
extension LoopCycles {
|
|
extension LoopCycles {
|
|
@@ -249,11 +253,21 @@ extension Hypers {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+extension Ins {
|
|
|
|
|
+ private enum CodingKeys: String, CodingKey {
|
|
|
|
|
+ case TDD
|
|
|
|
|
+ case bolus
|
|
|
|
|
+ case temp_basal
|
|
|
|
|
+ case scheduled_basal
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
extension Stats {
|
|
extension Stats {
|
|
|
private enum CodingKeys: String, CodingKey {
|
|
private enum CodingKeys: String, CodingKey {
|
|
|
case Distribution
|
|
case Distribution
|
|
|
case Glucose
|
|
case Glucose
|
|
|
case HbA1c
|
|
case HbA1c
|
|
|
case LoopCycles
|
|
case LoopCycles
|
|
|
|
|
+ case Insulin
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|