react-native-health-symptoms
Version:
A React Native package to interact with Apple HealthKit, including symptoms
60 lines (53 loc) • 1.7 kB
Markdown
Query for Electrocardiogram (ECG) samples and their associated voltage measurements.
Example input options:
```javascript
let options = {
startDate: new Date(2021, 0, 0).toISOString(), // required
endDate: new Date().toISOString(), // optional; default now
ascending: false, // optional; default false
limit: 1, // optional; default no limit
}
```
Call the method:
```javascript
AppleHealthKit.getElectrocardiogramSamples(
(options: HealthInputOptions),
(err: Object, results: ElectrocardiogramSampleValue[]) => {
if (err) {
return
}
console.log(results)
},
)
```
```javascript
[
{
"id": "5AF5F9E0-F27E-4BD7-8DBD-B7E00B9C68CF",
"sourceName": "ECG",
"sourceId": "com.apple.NanoHeartRhythm",
"startDate": "2021-06-16T19:10:52.498-0400",
"endDate": "2021-06-16T19:11:22.499-0400",
"classification": "SinusRhythm", // see ElectrocardiogramClassification enum
"averageHeartRate": 62,
"samplingFrequency": 512.6171875,
"device": "Watch4,1",
"algorithmVersion": 2,
"voltageMeasurements": [
// [timeSinceSampleStart (s), voltage (V)]
[],
[],
[],
[],
[],
// ...
[],
[],
[],
[],
[]
]
}
]
```