Apple’s CareKit framework makes writing healthcare apps easy

I’d been planning to write a healthcare app this summer, but then a few weeks ago Apple announced their new CareKit framework. For those are who are unaware, Apple has a number of different frameworks in their health initiative:

  • HealthKit – Used to read data from devices such as FitBits
  • ResearchKit – To help academic and research institutions collect data from study participants
  • CareKit – Helps build apps to track treatment and symptoms of a condition and share the information with their healthcare provider

CareKit is open source and can be downloaded from Github so I decided to give it a try. Basically it is split into 4 main sections:

  1. Care card – where you list out your intervention activities such as taking some kind of medication or performing some exercise
  2. Symptom tracker – where the patient indicates the severity of their symptoms
  3. Insights – which allows you to draw a chart that compares an intervention against a symptom
  4. Connect – which lets you list out your healthcare providers and allows you to send reports to them about your progress

Each of them is its own viewController in a TabBarController. All you have to do is specify the activities (both intervention and tracking) that go into the care card and symptom tracker.

struct TakeVitaminD: Activity {
       let activityType: ActivityType = .TakeVitaminD

    func carePlanActivity() -> OCKCarePlanActivity {

        // Create a weekly schedule.
        let startDate = NSDateComponents(year: 2016, month: 01, day: 01)
        let schedule = OCKCareSchedule.weeklyScheduleWithStartDate(startDate, occurrencesOnEachDay: [2, 2, 2, 2, 2, 2, 2])

        // Get the localized strings to use for the activity.
        let title = NSLocalizedString("Vitamin D", comment: "")
        let summary = NSLocalizedString("100mg", comment: "")
        let instructions = NSLocalizedString("Take with food.", comment: "")

        let activity = OCKCarePlanActivity.interventionWithIdentifier(
            groupIdentifier: nil,
            title: title,
            text: summary,
            tintColor: Colors.Green.color,
            instructions: instructions,
            imageURL: nil,
            schedule: schedule,
            userInfo: nil
        return activity

Basically this creates an intervention activity that is occurs twice every day of the week (you can specify uneven intervals too, like 2 pills on Sunday and 1 pill the rest of the week). This appears in the care card view of the app as follows:

Simulator Screen Shot May 11, 2016, 3.42.15 PM

The app should be used everyday to record symptoms

Simulator Screen Shot May 11, 2016, 3.49.36 PM

Once you have entered enough data for both treatments and symptoms you will be able to view your progress on the insights tab and view correlations between say taking your medication and your symptoms.

Simulator Screen Shot May 11, 2016, 3.53.02 PM

All of the data is persisted into a care store that resides on your local device. Periodically you can go to the Connect tab and send reports to your physician to keep them updated on your situation.

Overall CareKit was easy to get going but I did find several drawbacks. I can’t seem to find a way to capture numeric or empirical data in the care card intervention activities. I would also like to be able to view charts with multiple data series, but I haven’t figured out how to display those yet. Moreover in an actual app you would probably have a user login to your site and then download their care instructions to the app rather having it hardcoded like I have here.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s