Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Electrocardiogram (ECG samples) #235

Open
medericdegoy opened this issue Nov 24, 2021 · 1 comment
Open

Electrocardiogram (ECG samples) #235

medericdegoy opened this issue Nov 24, 2021 · 1 comment
Labels
add new datatype used to indicate that the issue is a request for supporting a new data type enhancement feature request

Comments

@medericdegoy
Copy link

Hi, I tried to add this but this is way over my head. Thanks Dario for your work! I'd love to access ECG samples (HKElectrocardiogramType) in this plugin. I found a React native plugin that did it : https://github.com/agencyenterprise/react-native-health/blob/master/docs/getElectrocardiogramSamples.md but I don't know obj-c. Would you consider including this type in a next version ? thanks :)

@dariosalvi78
Copy link
Owner

dariosalvi78 commented Nov 24, 2021

mm, would be cool to add yes, but my objective-c is really bad too! The iOS code of this plugin is the same as the one in https://github.com/EddyVerbruggen/HealthKit . You may try using the underlying plugin (which is still exposed through this one) to query for the HKElectrocardiogramType and see if you get any data.
Something like:

window.plugins.healthkit.querySampleType(
        {
          'startDate': new Date(new Date().getTime() - 3 * 24 * 60 * 60 * 1000), // three days ago
          'endDate': new Date(),
          'sampleType': 'HKElectrocardiogramType',
          'unit': '???' // not sure what goes here: voltage?
        },
        callback,
        callback
    );

I cannot test it myself as I don't have anything to generate ECG with.

Please let me know if it works and, if it does, I'd be happy to add ECG to this plugin.

For future reference, the full documentation about how to access ECG is here.

@dariosalvi78 dariosalvi78 added enhancement feature request add new datatype used to indicate that the issue is a request for supporting a new data type labels Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add new datatype used to indicate that the issue is a request for supporting a new data type enhancement feature request
Projects
None yet
Development

No branches or pull requests

2 participants