Connected Health- It’s good for you. But, how can you do it? Our experts can guide you to the right solutions.
This webinar intends to give necessary insights on how iOS based Health apps could help in managing information on a user’s health and fitness.
We will also have a demo that will showcase how caregivers/ doctors can monitor their patient’s health and fitness. Using such apps, a doctor can also instruct exercise plans to the users and check the progress of the same.
1. Introduction to Apple’s HealthKit
2. Fetching Health related data from iPhone
3. App Demo
What is a health app?
If you have an iPhone running on iOS 8 or iOS 9, you might have seen an app named ‘Health’. It shows health rate, active energy, cholesterol and all kinds of health related data, and acts as a centralized hub for all your health and fitness information. It shares your health data with various other apps.
Dashboard of Health app
The dashboard of the Heath app shows information like: the average steps a user has taken, his walking or running distances over a period of time, flights he has climbed etc. It is possible to specify data for a particular period, like a day, a week or a month and view the history on various data points covered during this period.
Health data, the second tab, comprises of quantitative analysis of the health data that our health app provides like body fat percentage, body mass index, height and weight. In the fitness section, we have information like active energy burnt, flights climbed, Nike Fuel integration, steps user has taken, and so on. It also consists a profile section where the user can provide their date of birth and various biological details. Various features like sleep, vitals, and nutrition-related data can be viewed from the health app.
If the user needs to add some data points to his dashboard, he can just go to the Steps tab, and choose the option ‘show on data board’.
Medical ID is a very critical feature that gives the user details of the various medical conditions, allergies if any and doctor’s details or a relative’s number to contact in case of emergency. If the user is suffering from critical medical situation and if his phone is locked, on the bottom left you can click on an option called emergency. On tapping the bottom left, we have a medical ID option. On clicking the Medical ID option, you can see the basic details of the user such as the name, date of birth and various medical conditions and details provided in case of any emergency. So this is a critical feature provided by the health app and quite useful for health kit users.
Healthkit and its Advantages
Health kit is a framework provided by Apple, its benefits and user experience cannot be matched with any other frameworks available as of now. It separates data collection, data processing, and socialization.
Healthkit is designed to manage data from wide range of sources. The health app works with Healthkit, which provides an elegant way to store and retrieve user’s health data. It is an API introduced in iOS 8, and works directly with health and fitness devices like iwatch.
Sometimes health data can be sensitive, and users would like to keep it secure. The Healthkit store can only be accessed by an authorized app data, kept locally on the users device which means the data is kept on that device solely and not accessible from any other devices.
One of the advantages for developers is that they no longer need to download API’s or write custom codes to share with each other as it enables automatic data sharing between apps. Also, users don’t need to manually set up the connections between their apps or import and export their data. Most importantly, users can control which app can read and write data to Healthkit store. However, if the user grants permission, apps can freely access each other’s data.
Healthkit grants users control over their data by providing fine-grained control over the information that apps can share. The user must explicitly grant permission to read and write data to the health kit store. Users can grant or deny permission separately for each type of data. For security, the Healthkit store is encrypted when the device is launched.
Healthkit allows you to focus on implementing only the aspects you are most interested in, leaving the other tasks to more specialized apps. For example, if a group of friends decide to join a daily step count challenge, each person could use his or her preferred hardware device to track her steps, but they could all use the same social app for the challenge.
Healthkit provides a richer set of data and a greater sense of context. Which means that, by accessing a wider range of data, each app gets a complete view of the user’s health and fitness needs. In most cases, apps can modify its matrix advice from the additional information available at the Healthkit store. As an example, a training app could suggest a post-workout snack based not just on calories burnt but also on the amount and type of food the user has eaten so far that day.
Healthkit is being used by 90 percent of the health and fitness app on the store which makes it an integral part of developing any health-related apps, ensuring we become a part of ever-growing ecosystem.
Healthcare objects can be divided into 2 main groups, characteristics and samples. Characteristics typically includes information like date of birth, blood type, sex and skin type.
Samples are where most of the health data is stored. These represents data at a particular point in time like a number of steps user walked each day or fluctuation in blood sugar levels over a period of time. Some properties of sample class are type, start date and end date.
There are 4 types of samples:
Category samples are data which can be categorized into finite set of categories.
Quantity samples can be stored as numerical values which includes the user’s height, weight and data such as the number of steps taken, user’s temperature and pulse rate.
Correlations are composite data containing one or more samples. You should always use a correlation when creating food or blood pressure data.
Workouts represent a physical activity like running, swimming or even playing. Workouts often have a tight duration, distance and burn properties. You can also associate a workout with a number of fine grain samples. Like correlations, these samples are not contained within the workout, they can be queried using the workout.
How to integrate health kit into an app
Here’s an example to show how to enable Healthkit from our code. This is basic xcode view. Moving to the capabilities, we can see the Healthkit. On choosing this option, our app will integrate with the default Healthkit that is being provided within the app. On adding this Healthkit, the entitlement will be added to our project as well as various other Healthkit frameworks.
The app we are focusing consist of 2 views, patient view and doctor view.
The patient view comprises details that a specific user can see on various data that he has been storing inside the Healthkit. He can see the changes he has been focusing over a period of time and he will get a realistic view on how every day the value has been changing and so he can view his health-related data. When we click on patient view, we are taken to health access screen. This allows the user to provide all data a user can access from his health kit as we can see, height, steps taken, active energy, date of birth, dietary calories, heart rate etc.
Doctors view is the view that can be used by doctors to groom a group of patients based on common health data and provide solutions for users like training plans, health precautions needs etc. and all these data that we provide are dynamically created based on each user’s health data points.
These are all the data points that an app needs to capture from the users Healthkit. So on clicking all categories “on” and clicking “allow” what we do is fetch the required data from our health kit and display. So our app displays the age, gender, and heartrate, step count per day, user’s recent weight, height and a prescribed plan that has been suggested by the doctor. The plan shown here comprises of sub-plan such as on food diet he can choose of the various training suggested by the doctor. Also, the various data matrix that he can use. The doctor view comprises a set of patients that the doctor has grouped based on their specific characteristics, and it also provides data time, whether data has been recently used. Now moving to first user. The user details have been provided to doctor and his recent Heart rate and the steps he has covered per day, weight and height. This is only a small amount of data requested to the app. We can also access other data like user’s blood pressure, blood sugar level and basis on type of requirement we can access data that we need. In our app, its basically amount of steps user has been walking and based on that we will provide the required action plans user should follow in the coming days and doctor can check if users data metric point has been used correctly and can evaluate if he has been following the plan correctly and after completing a successful plan he can suggest new plans with relevant data.
Moving to API section
We can look at the various types of data that we can infer from Health kit. Body measurements like body mass index, body weight, height, etc. can be inferred from the health kit and scalar data types like calories burnt, distance walked and integrating Nike fuel. This is the type of data that different types of app can infer on basis of their requirements. Also, we can see information like heart rate, body temperature, blood pressure levels, oxygen saturation, and nutrition levels. Also, the different users may be inputting data in different units. So while accessing the data, we can choose the unit we prefer. For e.g. for user height, we can provide the Meter unit, such as metric prefix centi, it will provide height of user in cm form. We can choose which data type needs to be displayed such as height, whether it should be represented in cm format or inch format or feet representation. So these are different data points which we can use using Healthkit.
Does the health app work with hands like Fitbit and mi band?
As of now there is no direct integration with Fitbit but what we can do is we can create an app, there are open source API’s available for Fitbit we can pull out data from fit bit and write it on to Healthkit as with mi band.
Is there a way to keep data in server so when I switch on my device, I can access them?
We have to pull the data from Healthkit, fetch the data from health app and put it on our server and access it anytime we want.
How health kit integrates with other research kits and care kits as well as homekit? How Health kit provides health with a holistic view?
iOS provides the homekit, using which, various activities can be monitored and can be integrated with the Healthkit.
Research kit is an open source API where users can provide data for various research related activities. Earlier, if one wanted to volunteer for research activity, we had to book a place and conduct several exercises, find data and then store. Now, we can use our Healthkit data and voluntarily provide the data for research purposes. Several organizations are collaborating for handling the larger input of data. Care kit provides data such as if user is suffering from Asthma or other critical conditions, the data point reads if the user is critical, and sends a message to nearby doctor or relatives that this data point of the user has reached a very critical level and suggests the necessary steps to be taken. After a user’s surgery, if we need to evaluate his health data, we can use this Carekit and it is an open source that evaluates post-operational condition of the user as well.
For any further queries regarding our webinar, you can drop us an e-mail at firstname.lastname@example.org
Sulabh is currently working as an iOS developer at Suyati Technologies. He brings in rich experience that includes working on large and complex mobile projects. He is also specialized in CoreData and Service Integration. From estimation and designing to coding and deployment, Sulabh has worked across verticals like Real Estate, e-commerce and HealthCare.
Rijo is a Senior iOS developer at Suyati Technologies. He has a vast experience working on large and complex mobile projects and is also specialized in Mobile User Experience and Application Design. Starting from estimation and designing, to coding and deployment, Rijo has enormous development expertise in mobile.