|
@@ -67,6 +67,7 @@ enum DataTable {
|
|
|
let fpuID: String?
|
|
let fpuID: String?
|
|
|
let note: String?
|
|
let note: String?
|
|
|
let isSMB: Bool?
|
|
let isSMB: Bool?
|
|
|
|
|
+ let isNonPump: Bool?
|
|
|
|
|
|
|
|
private var numberFormatter: NumberFormatter {
|
|
private var numberFormatter: NumberFormatter {
|
|
|
let formatter = NumberFormatter()
|
|
let formatter = NumberFormatter()
|
|
@@ -94,7 +95,8 @@ enum DataTable {
|
|
|
isFPU: Bool? = nil,
|
|
isFPU: Bool? = nil,
|
|
|
fpuID: String? = nil,
|
|
fpuID: String? = nil,
|
|
|
note: String? = nil,
|
|
note: String? = nil,
|
|
|
- isSMB: Bool? = nil
|
|
|
|
|
|
|
+ isSMB: Bool? = nil,
|
|
|
|
|
+ isNonPump: Bool? = nil
|
|
|
) {
|
|
) {
|
|
|
self.units = units
|
|
self.units = units
|
|
|
self.type = type
|
|
self.type = type
|
|
@@ -108,6 +110,7 @@ enum DataTable {
|
|
|
self.fpuID = fpuID
|
|
self.fpuID = fpuID
|
|
|
self.note = note
|
|
self.note = note
|
|
|
self.isSMB = isSMB
|
|
self.isSMB = isSMB
|
|
|
|
|
+ self.isNonPump = isNonPump
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static func == (lhs: Treatment, rhs: Treatment) -> Bool {
|
|
static func == (lhs: Treatment, rhs: Treatment) -> Bool {
|
|
@@ -135,12 +138,18 @@ enum DataTable {
|
|
|
return numberFormatter
|
|
return numberFormatter
|
|
|
.string(from: amount as NSNumber)! + NSLocalizedString(" g", comment: "gram of carb equilvalents")
|
|
.string(from: amount as NSNumber)! + NSLocalizedString(" g", comment: "gram of carb equilvalents")
|
|
|
case .bolus:
|
|
case .bolus:
|
|
|
|
|
+ var bolusText = " "
|
|
|
|
|
+
|
|
|
|
|
+ if isSMB ?? false {
|
|
|
|
|
+ bolusText += NSLocalizedString("Automatic", comment: "Automatic delivered treatments")
|
|
|
|
|
+ } else if isNonPump ?? false {
|
|
|
|
|
+ bolusText += NSLocalizedString("Non-Pump", comment: "Non-pump Insulin")
|
|
|
|
|
+ } else {
|
|
|
|
|
+ bolusText += NSLocalizedString("Manual", comment: "Manual Bolus")
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return numberFormatter
|
|
return numberFormatter
|
|
|
- .string(from: amount as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit") +
|
|
|
|
|
- (
|
|
|
|
|
- (isSMB ?? false) ? " " + NSLocalizedString("Automatic", comment: "Automatic delivered treatments") : " " +
|
|
|
|
|
- NSLocalizedString("Manual", comment: "Manual Bolus")
|
|
|
|
|
- )
|
|
|
|
|
|
|
+ .string(from: amount as NSNumber)! + NSLocalizedString(" U", comment: "Insulin unit") + bolusText
|
|
|
case .tempBasal:
|
|
case .tempBasal:
|
|
|
return numberFormatter
|
|
return numberFormatter
|
|
|
.string(from: amount as NSNumber)! + NSLocalizedString(" U/hr", comment: "Unit insulin per hour")
|
|
.string(from: amount as NSNumber)! + NSLocalizedString(" U/hr", comment: "Unit insulin per hour")
|
|
@@ -172,9 +181,9 @@ enum DataTable {
|
|
|
case .fpus:
|
|
case .fpus:
|
|
|
return .orange.opacity(0.5)
|
|
return .orange.opacity(0.5)
|
|
|
case .bolus:
|
|
case .bolus:
|
|
|
- return .insulin
|
|
|
|
|
|
|
+ return Color.insulin
|
|
|
case .tempBasal:
|
|
case .tempBasal:
|
|
|
- return Color.insulin.opacity(0.5)
|
|
|
|
|
|
|
+ return Color.insulin.opacity(0.4)
|
|
|
case .resume,
|
|
case .resume,
|
|
|
.suspend,
|
|
.suspend,
|
|
|
.tempTarget:
|
|
.tempTarget:
|