Skip to content

Commit ed36912

Browse files
committed
- Added getInsulinDeliverySamples documentation
1 parent aacf222 commit ed36912

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

docs/getInsulinDeliverySamples.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# getInsulinDeliverySamples
2+
3+
Query for insulin delivery samples. The options object is used to setup a query to retrieve relevant samples.
4+
5+
Example input options:
6+
7+
```javascript
8+
let options = {
9+
startDate: new Date(2021, 0, 0).toISOString(), // required
10+
endDate: new Date().toISOString(), // optional; default now
11+
ascending: false, // optional; default false
12+
limit: 10, // optional; default no limit
13+
}
14+
```
15+
16+
Insulin delivery samples are always in International Units.
17+
18+
```javascript
19+
AppleHealthKit.getInsulinDeliverySamples(
20+
options,
21+
(callbackError: string, results: HealthValue[]) => {
22+
console.log(results)
23+
},
24+
);
25+
```
26+
27+
Example output:
28+
29+
```json
30+
[
31+
{
32+
"id": "8DE6A905-02B7-41D2-BB6E-67D1DD82DD6F", // The universally unique identifier (UUID) for this HealthKit object.
33+
"endDate": "2021-03-22T16:19:00.000-0300",
34+
"sourceId": "com.apple.Health",
35+
"sourceName": "Health",
36+
"startDate": "2021-03-22T16:19:00.000-0300",
37+
"value": 5,
38+
"metadata": {
39+
"HKWasUserEntered": true,
40+
"HKInsulinDeliveryReason": 2, // Basal = 1, Bolus = 2
41+
}
42+
}
43+
]
44+
```

0 commit comments

Comments
 (0)