|
@@ -10,6 +10,31 @@ struct PumpHistoryEvent: JSON, Equatable {
|
|
|
let rate: Decimal?
|
|
let rate: Decimal?
|
|
|
let temp: TempType?
|
|
let temp: TempType?
|
|
|
let carbInput: Int?
|
|
let carbInput: Int?
|
|
|
|
|
+ let note: String?
|
|
|
|
|
+
|
|
|
|
|
+ init(
|
|
|
|
|
+ id: String,
|
|
|
|
|
+ type: EventType,
|
|
|
|
|
+ timestamp: Date,
|
|
|
|
|
+ amount: Decimal? = nil,
|
|
|
|
|
+ duration: Int? = nil,
|
|
|
|
|
+ durationMin: Int? = nil,
|
|
|
|
|
+ rate: Decimal? = nil,
|
|
|
|
|
+ temp: TempType? = nil,
|
|
|
|
|
+ carbInput: Int? = nil,
|
|
|
|
|
+ note: String? = nil
|
|
|
|
|
+ ) {
|
|
|
|
|
+ self.id = id
|
|
|
|
|
+ self.type = type
|
|
|
|
|
+ self.timestamp = timestamp
|
|
|
|
|
+ self.amount = amount
|
|
|
|
|
+ self.duration = duration
|
|
|
|
|
+ self.durationMin = durationMin
|
|
|
|
|
+ self.rate = rate
|
|
|
|
|
+ self.temp = temp
|
|
|
|
|
+ self.carbInput = carbInput
|
|
|
|
|
+ self.note = note
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
enum EventType: String, JSON {
|
|
enum EventType: String, JSON {
|
|
@@ -22,6 +47,8 @@ enum EventType: String, JSON {
|
|
|
case tempBasalDuration = "TempBasalDuration"
|
|
case tempBasalDuration = "TempBasalDuration"
|
|
|
case pumpSuspend = "PumpSuspend"
|
|
case pumpSuspend = "PumpSuspend"
|
|
|
case pumpResume = "PumpResume"
|
|
case pumpResume = "PumpResume"
|
|
|
|
|
+ case pumpAlarm = "PumpAlarm"
|
|
|
|
|
+ case pumpBattery = "PumpBattery"
|
|
|
case rewind = "Rewind"
|
|
case rewind = "Rewind"
|
|
|
case prime = "Prime"
|
|
case prime = "Prime"
|
|
|
case journalCarbs = "JournalEntryMealMarker"
|
|
case journalCarbs = "JournalEntryMealMarker"
|
|
@@ -29,6 +56,11 @@ enum EventType: String, JSON {
|
|
|
case nsTempBasal = "Temp Basal"
|
|
case nsTempBasal = "Temp Basal"
|
|
|
case nsCarbCorrection = "Carb Correction"
|
|
case nsCarbCorrection = "Carb Correction"
|
|
|
case nsTempTarget = "Temporary Target"
|
|
case nsTempTarget = "Temporary Target"
|
|
|
|
|
+ case nsInsulinChange = "Insulin Change"
|
|
|
|
|
+ case nsSiteChange = "Site Change"
|
|
|
|
|
+ case nsBatteryChange = "Pump Battery Change"
|
|
|
|
|
+ case nsAnnouncement = "Announcement"
|
|
|
|
|
+ case nsSensorChange = "Sensor Start"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
enum TempType: String, JSON {
|
|
enum TempType: String, JSON {
|
|
@@ -47,5 +79,6 @@ extension PumpHistoryEvent {
|
|
|
case rate
|
|
case rate
|
|
|
case temp
|
|
case temp
|
|
|
case carbInput = "carb_input"
|
|
case carbInput = "carb_input"
|
|
|
|
|
+ case note
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|