-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- category - quantity - vision prescription
- Loading branch information
Showing
15 changed files
with
538 additions
and
596 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
Sources/Decorator/Extensions+HKCategoryValueAppleWalkingSteadinessEvent.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// | ||
// Extensions+HKCategoryValueAppleWalkingSteadinessEvent.swift | ||
// HealthKitReporter | ||
// | ||
// Created by Victor Kachalov on 04.10.22. | ||
// | ||
|
||
import HealthKit | ||
|
||
@available(iOS 15.0, *) | ||
extension HKCategoryValueAppleWalkingSteadinessEvent: CustomStringConvertible { | ||
public var description: String { | ||
"HKCategoryValueAppleWalkingSteadinessEvent" | ||
} | ||
public var detail: String { | ||
switch self { | ||
case .initialLow: | ||
return "Initial low" | ||
case .initialVeryLow: | ||
return "Initial very low" | ||
case .repeatLow: | ||
return "Repeat low" | ||
case .repeatVeryLow: | ||
return "Repeat very low" | ||
@unknown default: | ||
return "Unknown" | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Sources/Decorator/Extensions+HKCategoryValuePregnancyTestResult.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Extensions+HKCategoryValuePregnancyTestResult.swift | ||
// HealthKitReporter | ||
// | ||
// Created by Victor Kachalov on 04.10.22. | ||
// | ||
|
||
import HealthKit | ||
|
||
@available(iOS 15.0, *) | ||
extension HKCategoryValuePregnancyTestResult: CustomStringConvertible { | ||
public var description: String { | ||
"HKCategoryValuePregnancyTestResult" | ||
} | ||
public var detail: String { | ||
switch self { | ||
case .negative: | ||
return "Negative" | ||
case .positive: | ||
return "Positive" | ||
case .indeterminate: | ||
return "Indeterminate" | ||
@unknown default: | ||
return "Unknown" | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
Sources/Decorator/Extensions+HKCategoryValueProgesteroneTestResult.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Extensions+HKCategoryValueProgesteroneTestResult.swift | ||
// HealthKitReporter | ||
// | ||
// Created by Victor Kachalov on 04.10.22. | ||
// | ||
|
||
import HealthKit | ||
|
||
@available(iOS 15.0, *) | ||
extension HKCategoryValueProgesteroneTestResult: CustomStringConvertible { | ||
public var description: String { | ||
"HKCategoryValueProgesteroneTestResult" | ||
} | ||
public var detail: String { | ||
switch self { | ||
case .negative: | ||
return "Negative" | ||
case .positive: | ||
return "Positive" | ||
case .indeterminate: | ||
return "Indeterminate" | ||
@unknown default: | ||
return "Unknown" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// Extensions+HKVisionPrescription.swift | ||
// HealthKitReporter | ||
// | ||
// Created by Victor Kachalov on 04.10.22. | ||
// | ||
|
||
import HealthKit | ||
|
||
@available(iOS 16.0, *) | ||
extension HKVisionPrescription: Harmonizable { | ||
typealias Harmonized = VisionPrescription.Harmonized | ||
|
||
func harmonize() throws -> Harmonized { | ||
return Harmonized( | ||
dateIssuedTimestamp: dateIssued.millisecondsSince1970, | ||
expirationDateTimestamp: expirationDate?.millisecondsSince1970, | ||
prescriptionType: VisionPrescription.PrescriptionType(prescriptionType: prescriptionType), | ||
metadata: metadata?.compactMapValues { String(describing: $0 )} | ||
) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Sources/Decorator/Extensions+HKVisionPrescriptionType.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// | ||
// Extensions+HKVisionPrescriptionType.swift | ||
// HealthKitReporter | ||
// | ||
// Created by Victor Kachalov on 04.10.22. | ||
// | ||
|
||
import HealthKit | ||
|
||
@available(iOS 16.0, *) | ||
extension HKVisionPrescriptionType: CustomStringConvertible { | ||
public var description: String { | ||
"HKVisionPrescriptionType" | ||
} | ||
public var detail: String { | ||
switch self { | ||
case .glasses: | ||
return "Glasses" | ||
case .contacts: | ||
return "Contacts" | ||
@unknown default: | ||
return "Unknown" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.