[MRG] adding support for apple health - #44
Conversation
| ) | ||
| new_analysis.save() | ||
| except: | ||
| pass |
There was a problem hiding this comment.
in which case would an exception be thrown here? maybe add a comment
There was a problem hiding this comment.
Good point, it's a rather general catch-all as the merging of Fitbit & Fitbit Intraday is really fickle and easily crashes (e.g. I stopped using my Fitbit some time ago but still have my data in my account. Fitbit still updates the data even and reports 0 for each day, this leads the whole pipeline to crash 🙈 ).
There was a problem hiding this comment.
not ideal but better than a server error ruining other processing/response? wouldn't hold this up based on improving this further
| if i["source"] == "direct-sharing-453" and i["basename"].startswith( | ||
| "heartrate_samples" | ||
| ): | ||
| missing_sources.pop("apple_health", None) |
There was a problem hiding this comment.
Alright so this PR handles the case of the data having been imported by OH already, and doesn't offer an option to import them through QF. Is this planned for future?
There was a problem hiding this comment.
Nope, the Apple Health data is a bit special, as you can't export it through an API or anything, but just through having the corresponding iPhone app installed that exports data. Which makes integrating it much harder.
To integrate this in QF we'd need to generate a whole new API to which to export the data (not to mention the fact that it took 2 months to get the app into the appstore :D).
So using the app we got now seems the way to go (plus it doesn't make much difference, as people need to use an external tool in any case).
There was a problem hiding this comment.
this bit of code reminds me that supporting the google fit data from the separate activity is missing :) I created #46
madprime
left a comment
There was a problem hiding this comment.
LGTM! I only looked at the code, didn't try running it. I made a minor PR that's just formatting the template code for readability (at least, that's what I intended), and added an issue that occurred to me while looking over the code. :)
| if i["source"] == "direct-sharing-453" and i["basename"].startswith( | ||
| "heartrate_samples" | ||
| ): | ||
| missing_sources.pop("apple_health", None) |
There was a problem hiding this comment.
this bit of code reminds me that supporting the google fit data from the separate activity is missing :) I created #46
| </p> | ||
| {% endif %} | ||
| </div> | ||
| {% endif %} |
There was a problem hiding this comment.
I opened up the code wondering if this was an extra endif (it's not) & have a minor code formatting PR to share. just readability, as I was trying to check this over :)
| ) | ||
| new_analysis.save() | ||
| except: | ||
| pass |
There was a problem hiding this comment.
not ideal but better than a server error ruining other processing/response? wouldn't hold this up based on improving this further
(minor) improve template code formatting
This PR:
RetrospectiveEventandSymptomReportobjects as is done for all other wearables.I've tested it with my data and it worked for all cases. I think it should be ready to be deployed!