I'm finding that there are a select few quantity types. How should I go about creating new custom types for use in my App.
Let's look at an example. In your documentation HKQuantityTypeIdentifier has 10 types for Lab & Test Results (while it has 39 types for Nutrition). Let's look at a typical Lipid Blood Panel result from a typical blood test.
I'd like to create data types for:
Cholesterol 208 MG/DL
Triglycerides 112 MG/DL
HDL Cholesterol 52 MG/DL
Calc LDL Cholesterol 134 MG/DL
And also recoded the typical Risk Ratio of Cholesterol (LDL/HDL) in this specific lab result (134/52 = 2.58).
How would I create these HKQuantitySample subclasses?
the docs say:
Extend Quantity Samples
Like many HealthKit classes, you should not subclass the HKQuantitySample class. You may extend this class by adding metadata with custom keys to save related data used by your app.
For more information, see init(type:quantity:start:end:metadata:).
Yet looking at that init doc - I don't see any info on creating new types and therefor new sample types.
Let's look at an example. In your documentation HKQuantityTypeIdentifier has 10 types for Lab & Test Results (while it has 39 types for Nutrition). Let's look at a typical Lipid Blood Panel result from a typical blood test.
I'd like to create data types for:
Cholesterol 208 MG/DL
Triglycerides 112 MG/DL
HDL Cholesterol 52 MG/DL
Calc LDL Cholesterol 134 MG/DL
And also recoded the typical Risk Ratio of Cholesterol (LDL/HDL) in this specific lab result (134/52 = 2.58).
How would I create these HKQuantitySample subclasses?
the docs say:
Extend Quantity Samples
Like many HealthKit classes, you should not subclass the HKQuantitySample class. You may extend this class by adding metadata with custom keys to save related data used by your app.
For more information, see init(type:quantity:start:end:metadata:).
Yet looking at that init doc - I don't see any info on creating new types and therefor new sample types.