Getting Started with CareKit

Similar documents
Getting the Most Out of HealthKit

Media and Gaming Accessibility

Data Delivery with Drag and Drop

What s New in watchos

Enhancing your apps for the next dimension of touch

Getting the Most out of Playgrounds in Xcode

What s New in Xcode App Signing

What s New in MapKit. App Frameworks #WWDC17. Fredrik Olsson

Using Grouped Notifications

TRACKER DASHBOARD USER GUIDE. Version 1.0

New Ways to Work with Workouts

Touch Bar Fundamentals

What s New in tvos 12

Product and Service Catalog

Rethink Your Workstation Strategy with Amazon AppStream 2.0

Quick Interaction Techniques for watchos

Mastering Drag and Drop

Creating Complications with ClockKit Session 209

Using and Extending the Xcode Source Editor

Building for Voice with Siri Shortcuts

APP USER GUIDE. Sugar.IQ with Watson

Scheduling. Scheduling Tasks At Creation Time CHAPTER

What s New in Core Data?

Introducing Password AutoFill for Apps

Core Data Best Practices

Advanced Notifications

What s New in Testing

Extending Your Apps with SiriKit

Introduction to Siri Shortcuts

User Manual. phr.mtbc.com

What s New in imessage Apps

Designing Great Apple Watch Experiences

Mastering UIKit on tvos

Introducing the Contacts Framework

Thread Sanitizer and Static Analysis

Implementing UI Designs in Interface Builder

An analysis of patterns and causes over

ITMG 100 Data Usage/Networking, Excel/Word Extra Credit (up to 30 points) DUE 5 MAY start of class

APPLIED RESEARCH WORKS, INC.- COZEVA. Specialist Practice Support Guide

What's New in Core Spotlight

User Guide. Need help? Electricity Pay As You Go. Visit our online Help Centre

Blood Glucose Monitoring System. Copyright 2017 Ascensia Diabetes Care Holdings AG. All rights reserved.

What s New in NSCollectionView Session 225

Exporting brochure information for activities and programs. (v6)

What s New in Foundation for Swift Session 207

MPM210: Introduction to Project Management 1. MPM210: Introduction to Project Management. Project Plan for Learning Modules.

Step-by-Step Guide: How to sign up for National Steps Challenge TM Season 4

On initial load of the Provider Dashboard, the user is presented with a sidebar menu along with a main content section. All of the CSS for this

Step-by-Step Guide: How to sign up for National Steps Challenge TM Season 4

ios Configuration and APIs for Kiosk and Assessment Apps

Localizing with Xcode 9

AGENCYCORE MOBILE ios MANUAL

Engagement Portal. Physician Engagement User Guide Press Ganey Associates, Inc.

What s New in Device Configuration, Deployment, and Management

Introducing MusicKit. Media #WWDC17. Tim Parthemore, MusicKit Services Joel Lopes Da Silva, ios Music

GLOOKO FOR PATIENTS QUICK START GUIDE

Introducing the Modern WebKit API

Integrating Apps and Content with AR Quick Look

Building Apps with Dynamic Type

Catering to customers at DEG

Building Watch Apps #WWDC15. Featured. Session 108. Neil Desai watchos Engineer

SAFARI Montage v6.5.28

App Extension Best Practices

itunes Connect Development to distribution #WWDC15 Distribution Session 304

KPMG Clara. User guide September 2018

HOW CAN I PARTICIPATE?

Getting Published in Apple News

Introducing Swift Playgrounds

INFORMATION TECHNOLOGY SPREADSHEETS. Part 1

EC2 Scheduler. AWS Implementation Guide. Lalit Grover. September Last updated: September 2017 (see revisions)

Agile Software Development. Software Development Methodologies. Who am I? Waterfall. John York JOHN YORK EECS 441 FALL 2017 A BRIEF LOOK

HOW CAN I PARTICIPATE?

Agile Software Development. Software Development Methodologies. Who am I? Waterfall. John York JOHN YORK EECS 441 WINTER 2018 A BRIEF LOOK

CRM to Exchange Synchronization

Deploying AirPrint in Enterprise

Monetize and Promote Your App with iad

Visit Mon General Registration

1. Textbook #1: Our Digital World (ODW). 2. Textbook #2: Guidelines for Office 2013 (GFO). 3. SNAP: Assessment Software

Welcome New Client. Welcome to the family! keitaj.com

Writing Energy Efficient Apps

AVContentKeySession Best Practices

Introducing CloudKit. A how-to guide for icloud for your Apps. Frameworks #WWDC14. Session 208 Olivier Bonnet CloudKit Client Software

Behavior Health Consumer Portal User Guide

Connect to CCPL

Introducing PDFKit on ios

Designing for Apple Watch

ID-O Energy Dashboard Engaging Occupants to Save Energy

imessage Apps and Stickers, Part 2

Advanced Scrollviews and Touch Handling Techniques

What is New in MyChart? My Medical Record Health Preferences Settings Appointments and Visits Visits Schedule an Appointment Update Information

This study is brought to you courtesy of.

Blood Glucose Monitoring System. Copyright 2018 Ascensia Diabetes Care Holdings AG

The LDN Health Tracker App. Introducing the world s largest combined study of LDN

Accessibility on OS X

CareAffiliate Tips. Pharmacy. Authorizations Create and manage authorization requests for: *medical drugs

UNIVERSITY EVENTS CALENDAR TIP SHEET

Apple Watch Design Tips and Tricks

What s New in tvos #WWDC16. App Frameworks. Session 206. Hans Kim tvos Engineer

Your Apps and Evolving Network Security Standards

Logging In / Logging Out of Avatar

Transcription:

App Frameworks #WWDC16 Getting Started with CareKit Session 237 Umer Khan Software Engineer 2016 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

CareKit Overview Patient-Provider Experience Creating a CareKit App Customizing with CareKit What s Next?

CareKit Overview

ResearchKit

What s New in ResearchKit Nob Hill Friday 10:00AM Building Apps with ResearchKit WWDC 2015

ResearchKit

ResearchKit

ResearchKit CareKit

CareKit Overview Open source framework Helps providers build apps that empower patients Focused on engaging patient to take active role in their care

Patient-Provider Experience

Creating a CareKit App

CareKit Modules Care Card Symptom Tracker Insights Dashboard Connect

CareKit Modules Care Card Symptom Tracker Insights Dashboard Connect Care Plan Store Document Exporter

Care Plan Store Activity Event Care Plan Store

Care Plan Store Encrypted data storage Defining activities and events Creating an activity and adding it to the store The relationship between activities and events Surfacing activities to the front-end modules Activity Event

647 x 1150 Activity Event

Activity Event

Activity Event

Activity Event

Care Plan Store Activity Event Care Plan Store

Care Plan Store Activity

Care Plan Store identifier groupidentifier title Activity text tintcolor type schedule Activity

Care Plan Store identifier ibuprofenmedication groupidentifier title Activity text tintcolor type schedule Activity

Care Plan Store identifier groupidentifier ibuprofenmedication painmedications title Activity text tintcolor type schedule Activity

Care Plan Store identifier groupidentifier title ibuprofenmedication painmedications Ibuprofen Activity text tintcolor type schedule Activity

Care Plan Store identifier groupidentifier title Activity text ibuprofenmedication painmedications Ibuprofen 200 mg tintcolor type schedule Activity

Care Plan Store identifier groupidentifier title Activity text tintcolor ibuprofenmedication painmedications Ibuprofen 200 mg Blue type schedule Activity

Care Plan Store identifier groupidentifier title text tintcolor ibuprofenmedication painmedications Ibuprofen 200 mg Blue type schedule Activity

Care Plan Store identifier groupidentifier title text tintcolor ibuprofenmedication painmedications Ibuprofen 200 mg Blue type schedule Activity

Type Activity Interventions

Type Activity Interventions Assessments

Care Plan Store identifier groupidentifier title text tintcolor type ibuprofenmedication painmedications Ibuprofen 200 mg Blue Intervention schedule Activity

Care Plan Store identifier groupidentifier title text tintcolor type ibuprofenmedication painmedications Ibuprofen 200 mg Blue Intervention schedule Activity

Schedule Activity

Schedule Activity Specify which days Daily Weekly Custom

Schedule Activity Specify which days Daily Weekly Custom Times per day Frequency

Let s Define a Schedule!

Let s Define a Schedule! Weekly Schedule S M T W T F S

Let s Define a Schedule! Weekly Schedule S M T W T F S

Let s Define a Schedule! Weekly Schedule S M T W T F S Frequency

Let s Define a Schedule! Weekly Schedule S M T W T F S Frequency 4 2 4

Let s Define a Schedule! M W F 4 2 4 Schedule

Care Plan Store identifier groupidentifier title Activity text tintcolor type ibuprofenmedication painmedications Ibuprofen 200 mg Blue Intervention schedule M W F 4 2 4 Activity

Care Plan Store Activity Event Care Plan Store

Care Plan Store M W F 4 2 4 Schedule

Care Plan Store M W F 4 2 4 Event Event Event Event Schedule Events

Care Plan Store Event Event Event Event M W F 6/20/16 6/20/16 6/20/16 6/20/16 4 2 4 Event Event Schedule 6/22/16 6/22/16 Events

Care Plan Store Event Event Event Event M W F 6/20/16 6/20/16 6/20/16 6/20/16 4 2 4 Event Event Schedule 6/22/16 6/22/16 Events

Care Plan Store Event Event Event Event M W F 6/20/16 6/20/16 6/20/16 6/20/16 4 2 4 Event Event Schedule 6/22/16 6/22/16 Events

date state result activity Event

Care Plan Store Activity Event Care Plan Store

// Creating Care Plan Store // Define a persistent directory url var mycareplanstore: OCKCarePlanStore // Determine the file URL for the store. let searchpaths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory,.userDomainMask, true) let applicationsupportpath = searchpaths[0] let mydirectoryurl = URL(fileURLWithPath: applicationsupportpath) mycareplanstore = OCKCarePlanStore(persistenceDirectoryURL: mydirectoryurl)

// Creating Care Plan Store // Define a persistent directory url var mycareplanstore: OCKCarePlanStore // Determine the file URL for the store. let searchpaths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory,.userDomainMask, true) let applicationsupportpath = searchpaths[0] let mydirectoryurl = URL(fileURLWithPath: applicationsupportpath) mycareplanstore = OCKCarePlanStore(persistenceDirectoryURL: mydirectoryurl)

// Creating Care Plan Store // Define a persistent directory url var mycareplanstore: OCKCarePlanStore // Determine the file URL for the store. let searchpaths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory,.userDomainMask, true) let applicationsupportpath = searchpaths[0] let mydirectoryurl = URL(fileURLWithPath: applicationsupportpath) mycareplanstore = OCKCarePlanStore(persistenceDirectoryURL: mydirectoryurl)

// Creating Care Plan Store // Define a persistent directory url var mycareplanstore: OCKCarePlanStore // Determine the file URL for the store. let searchpaths = NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory,.userDomainMask, true) let applicationsupportpath = searchpaths[0] let mydirectoryurl = URL(fileURLWithPath: applicationsupportpath) mycareplanstore = OCKCarePlanStore(persistenceDirectoryURL: mydirectoryurl)

func addibuprofenactivity() { // Create a weekly schedule. let startdate = DateComponents(year: 2016, month: 01, day: 01) let schedule = OCKCareSchedule.weeklySchedule(withStartDate: startdate, occurrencesoneachday: [0, 4, 0, 2, 0, 4, 0]) // Create an intervention activity. Make sure to NSLocalizedString for all strings. let ibuprofenactivity = OCKCarePlanActivity.intervention(withIdentifier: ibuprofenmedication", groupidentifier: "painmedications", title: "Ibuprofen", text: "200mg", tintcolor: UIColor.blue(), instructions:"take with food.", imageurl: NSURL.fileURL(withPath: ibuprofen.png"), schedule: schedule, userinfo: nil) // Add activity to care plan store. mycareplanstore.add(ibuprofenactivity, { success, error in // Perform error checking.... }) }

func addibuprofenactivity() { // Create a weekly schedule. let startdate = DateComponents(year: 2016, month: 01, day: 01) let schedule = OCKCareSchedule.weeklySchedule(withStartDate: startdate, occurrencesoneachday: [0, 4, 0, 2, 0, 4, 0]) // Create an intervention activity. Make sure to NSLocalizedString for all strings. let ibuprofenactivity = OCKCarePlanActivity.intervention(withIdentifier: ibuprofenmedication", groupidentifier: "painmedications", title: "Ibuprofen", text: "200mg", tintcolor: UIColor.blue(), instructions:"take with food.", imageurl: NSURL.fileURL(withPath: ibuprofen.png"), schedule: schedule, userinfo: nil) // Add activity to care plan store. mycareplanstore.add(ibuprofenactivity, { success, error in // Perform error checking.... }) }

func addibuprofenactivity() { // Create a weekly schedule. let startdate = DateComponents(year: 2016, month: 01, day: 01) let schedule = OCKCareSchedule.weeklySchedule(withStartDate: startdate, occurrencesoneachday: [0, 4, 0, 2, 0, 4, 0]) // Create an intervention activity. Make sure to NSLocalizedString for all strings. let ibuprofenactivity = OCKCarePlanActivity.intervention(withIdentifier: ibuprofenmedication", groupidentifier: "painmedications", title: "Ibuprofen", text: "200mg", tintcolor: UIColor.blue(), instructions:"take with food.", imageurl: NSURL.fileURL(withPath: ibuprofen.png"), schedule: schedule, userinfo: nil) // Add activity to care plan store. mycareplanstore.add(ibuprofenactivity, { success, error in // Perform error checking.... }) }

func addibuprofenactivity() { // Create a weekly schedule. let startdate = DateComponents(year: 2016, month: 01, day: 01) let schedule = OCKCareSchedule.weeklySchedule(withStartDate: startdate, occurrencesoneachday: [0, 4, 0, 2, 0, 4, 0]) // Create an intervention activity. Make sure to NSLocalizedString for all strings. let ibuprofenactivity = OCKCarePlanActivity.intervention(withIdentifier: ibuprofenmedication", groupidentifier: "painmedications", title: "Ibuprofen", text: "200mg", tintcolor: UIColor.blue(), instructions:"take with food.", imageurl: NSURL.fileURL(withPath: ibuprofen.png"), schedule: schedule, userinfo: nil) // Add activity to care plan store. mycareplanstore.add(ibuprofenactivity, { success, error in // Perform error checking.... }) }

Care Plan Store Encrypted data storage

Care Card Interactive treatment plan

Care Plan Store identifier groupidentifier title text tintcolor type ibuprofenmedication painmedications Ibuprofen 200 mg Blue Intervention schedule M W F 4 2 4 Activity

Care Plan Store identifier groupidentifier title text tintcolor type ibuprofenmedication painmedications Ibuprofen 200 mg Blue Intervention schedule M W F 4 2 4 Activity

// Creating a Care Card // Link it to a Care Plan Store // Create a Care Card view controller. let viewcontroller = OCKCareCardViewController(carePlanStore: mycareplanstore) // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller) self.present(navcontroller, animated: true, completion: nil)

// Creating a Care Card // Link it to a Care Plan Store // Create a Care Card view controller. let viewcontroller = OCKCareCardViewController(carePlanStore: mycareplanstore) // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller) self.present(navcontroller, animated: true, completion: nil)

// Creating a Care Card // Link it to a Care Plan Store // Create a Care Card view controller. let viewcontroller = OCKCareCardViewController(carePlanStore: mycareplanstore) // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller) self.present(navcontroller, animated: true, completion: nil)

// Creating a Care Card // Link it to a Care Plan Store // Create a Care Card view controller. let viewcontroller = OCKCareCardViewController(carePlanStore: mycareplanstore) // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller) self.present(navcontroller, animated: true, completion: nil)

647 x 1150

Updating Events Care Card

Updating Events Care Card Self-reported

Updating Events Care Card Self-reported Task completion

Updating Events Care Card Self-reported Task completion Device sensors via HealthKit

Care Card Interactive treatment plan

Symptom and Measurement Tracker Subjective and objective data

Care Plan Store identifier groupidentifier title text tintcolor type schedule Activity

Care Plan Store identifier groupidentifier title text tintcolor type painassessment surveys Pain Lower back Blue Assessment schedule M W F 2 1 2 Activity

// Create a Symptom Tracker // Link it to a Care Plan Store // Create a Symptom Tracker view controller. let viewcontroller = OCKSymptomTrackerViewController(carePlanStore: mycareplanstore) viewcontroller.delegate = self // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller)

// Create a Symptom Tracker // Link it to a Care Plan Store // Create a Symptom Tracker view controller. let viewcontroller = OCKSymptomTrackerViewController(carePlanStore: mycareplanstore) viewcontroller.delegate = self // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller)

// Create a Symptom Tracker // Link it to a Care Plan Store // Create a Symptom Tracker view controller. let viewcontroller = OCKSymptomTrackerViewController(carePlanStore: mycareplanstore) viewcontroller.delegate = self // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller)

Assessments

Assessments Survey

Assessments Survey Active task

Assessments Survey Active task Self-reported

Assessments Survey Active task Self-reported HealthKit / Bluetooth device

// Symptom Tracker Delegate // Implement delegate to present assessments func symptomtrackerviewcontroller(_ viewcontroller: OCKSymptomTrackerViewController, didselectrowwithassessmentevent assessmentevent: OCKCarePlanEvent) { // Look up the assessment activity. let activity = assessmentevent.activity presentviewcontroller(for: activity) }

func updateresult(of event: OCKCarePlanEvent) { // Obtain values for event. let painscorevalue = getpainscore() // Create a result object. let result = OCKCarePlanEventResult(valueString: painscorevalue, unitstring: of 10", userinfo: nil) // Update the Care Plan Store. mycareplanstore.update(event, with: result, state:.completed, completion: { success, event, error in // Perform error checking.... }) }

func updateresult(of event: OCKCarePlanEvent) { // Obtain values for event. let painscorevalue = getpainscore() // Create a result object. let result = OCKCarePlanEventResult(valueString: painscorevalue, unitstring: of 10", userinfo: nil) // Update the Care Plan Store. mycareplanstore.update(event, with: result, state:.completed, completion: { success, event, error in // Perform error checking.... }) }

func updateresult(of event: OCKCarePlanEvent) { // Obtain values for event. let painscorevalue = getpainscore() // Create a result object. let result = OCKCarePlanEventResult(valueString: painscorevalue, unitstring: of 10", userinfo: nil) // Update the Care Plan Store. mycareplanstore.update(event, with: result, state:.completed, completion: { success, event, error in // Perform error checking.... }) }

func updateresult(of event: OCKCarePlanEvent) { // Obtain values for event. let painscorevalue = getpainscore() // Create a result object. let result = OCKCarePlanEventResult(valueString: painscorevalue, unitstring: of 10", userinfo: nil) // Update the Care Plan Store. mycareplanstore.update(event, with: result, state:.completed, completion: { success, event, error in // Perform error checking.... }) }

647 x 1150

Symptom and Measurement Tracker Subjective and objective data

Insights Understanding your data

Insights Items

Insights Items Messages Tip Alert

Insights Items Messages Tip Alert Charts Grouped bar chart Custom chart

func querystoreforibuprofenactivity() { // Query the Care Plan Store for Ibuprofen data. let startdate = DateComponents(year: 2016, month: 06, day: 05) let enddate = DateComponents(year: 2016, month: 06, day: 11) careplanstore.enumerateevents(of: ibuprofenactivity, startdate: startdate, enddate: enddate, handler: { event in if event?.state ==.completed { // Calculate adherence... } }, completion: { success, error? in // Perform error checking... }) }

func querystoreforibuprofenactivity() { // Query the Care Plan Store for Ibuprofen data. let startdate = DateComponents(year: 2016, month: 06, day: 05) let enddate = DateComponents(year: 2016, month: 06, day: 11) careplanstore.enumerateevents(of: ibuprofenactivity, startdate: startdate, enddate: enddate, handler: { event in if event?.state ==.completed { // Calculate adherence... } }, completion: { success, error? in // Perform error checking... }) }

func querystoreforibuprofenactivity() { // Query the Care Plan Store for Ibuprofen data. let startdate = DateComponents(year: 2016, month: 06, day: 05) let enddate = DateComponents(year: 2016, month: 06, day: 11) careplanstore.enumerateevents(of: ibuprofenactivity, startdate: startdate, enddate: enddate, handler: { event in if event?.state ==.completed { // Calculate adherence... } }, completion: { success, error? in // Perform error checking... }) }

var ibuprofenmessageitem: OCKInsightItem func createibuprofenmessageitem() { // Generate message using Care Plan Store data. let adherencepercentage = calculateibuprofenadherence() let message = "Your Ibuprofen adherence was \(adherencepercentage) last week. } ibuprofenmessageitem = OCKMessageItem(title: "Medication Adherence, text: message, tintcolor: UIColor.red(), messagetype:.tip)

var ibuprofenmessageitem: OCKInsightItem func createibuprofenmessageitem() { // Generate message using Care Plan Store data. let adherencepercentage = calculateibuprofenadherence() let message = "Your Ibuprofen adherence was \(adherencepercentage) last week. } ibuprofenmessageitem = OCKMessageItem(title: "Medication Adherence, text: message, tintcolor: UIColor.red(), messagetype:.tip)

var ibuprofenmessageitem: OCKInsightItem func createibuprofenmessageitem() { // Generate message using Care Plan Store data. let adherencepercentage = calculateibuprofenadherence() let message = "Your Ibuprofen adherence was \(adherencepercentage) last week. } ibuprofenmessageitem = OCKMessageItem(title: "Medication Adherence, text: message, tintcolor: UIColor.red(), messagetype:.tip)

var ibuprofenmessageitem: OCKInsightItem func createibuprofenmessageitem() { // Generate message using Care Plan Store data. let adherencepercentage = calculateibuprofenadherence() let message = "Your Ibuprofen adherence was \(adherencepercentage) last week. } ibuprofenmessageitem = OCKMessageItem(title: "Medication Adherence, text: message, tintcolor: UIColor.red(), messagetype:.tip)

var barchartitem: OCKInsightItem func createbarchartitem() { let painseries = OCKBarSeries(title: "Pain", values: [10, 5, 7, 9, 6, 3, 8], valuelabels: ["10", "5", "7", "9", "6", "3", "8"], tintcolor: UIColor.blue()) let ibuprofenseries = OCKBarSeries(title: "Ibuprofen", values: [1, 5, 4, 2, 5, 8, 2], valuelabels: ["10%", "50%", "40%", "20%", "50%", "80%", "20%"], tintcolor: UIColor.blue().withAlphaComponent(0.75)) barchartitem = OCKBarChart(title: "Pain", text: "with Ibuprofen", tintcolor: UIColor.blue(), axistitles: ["S", "M", "T", "W", "T", "F", "S"], axissubtitles: ["6/5", "", "", "", "", "", "6/11"], dataseries: [painseries, ibuprofenseries], minimumscalerangevalue: 0, maximumscalerangevalue: 10) }

var barchartitem: OCKInsightItem func createbarchartitem() { let painseries = OCKBarSeries(title: "Pain", values: [10, 5, 7, 9, 6, 3, 8], valuelabels: ["10", "5", "7", "9", "6", "3", "8"], tintcolor: UIColor.blue()) let ibuprofenseries = OCKBarSeries(title: "Ibuprofen", values: [1, 5, 4, 2, 5, 8, 2], valuelabels: ["10%", "50%", "40%", "20%", "50%", "80%", "20%"], tintcolor: UIColor.blue().withAlphaComponent(0.75)) barchartitem = OCKBarChart(title: "Pain", text: "with Ibuprofen", tintcolor: UIColor.blue(), axistitles: ["S", "M", "T", "W", "T", "F", "S"], axissubtitles: ["6/5", "", "", "", "", "", "6/11"], dataseries: [painseries, ibuprofenseries], minimumscalerangevalue: 0, maximumscalerangevalue: 10) }

var barchartitem: OCKInsightItem func createbarchartitem() { let painseries = OCKBarSeries(title: "Pain", values: [10, 5, 7, 9, 6, 3, 8], valuelabels: ["10", "5", "7", "9", "6", "3", "8"], tintcolor: UIColor.blue()) let ibuprofenseries = OCKBarSeries(title: "Ibuprofen", values: [1, 5, 4, 2, 5, 8, 2], valuelabels: ["10%", "50%", "40%", "20%", "50%", "80%", "20%"], tintcolor: UIColor.blue().withAlphaComponent(0.75)) barchartitem = OCKBarChart(title: "Pain", text: "with Ibuprofen", tintcolor: UIColor.blue(), axistitles: ["S", "M", "T", "W", "T", "F", "S"], axissubtitles: ["6/5", "", "", "", "", "", "6/11"], dataseries: [painseries, ibuprofenseries], minimumscalerangevalue: 0, maximumscalerangevalue: 10) }

var barchartitem: OCKInsightItem func createbarchartitem() { let painseries = OCKBarSeries(title: "Pain", values: [10, 5, 7, 9, 6, 3, 8], valuelabels: ["10", "5", "7", "9", "6", "3", "8"], tintcolor: UIColor.blue()) let ibuprofenseries = OCKBarSeries(title: "Ibuprofen", values: [1, 5, 4, 2, 5, 8, 2], valuelabels: ["10%", "50%", "40%", "20%", "50%", "80%", "20%"], tintcolor: UIColor.blue().withAlphaComponent(0.75)) barchartitem = OCKBarChart(title: "Pain", text: "with Ibuprofen", tintcolor: UIColor.blue(), axistitles: ["S", "M", "T", "W", "T", "F", "S"], axissubtitles: ["6/5", "", "", "", "", "", "6/11"], dataseries: [painseries, ibuprofenseries], minimumscalerangevalue: 0, maximumscalerangevalue: 10) }

var barchartitem: OCKInsightItem func createbarchartitem() { let painseries = OCKBarSeries(title: "Pain", values: [10, 5, 7, 9, 6, 3, 8], valuelabels: ["10", "5", "7", "9", "6", "3", "8"], tintcolor: UIColor.blue()) let ibuprofenseries = OCKBarSeries(title: "Ibuprofen", values: [1, 5, 4, 2, 5, 8, 2], valuelabels: ["10%", "50%", "40%", "20%", "50%", "80%", "20%"], tintcolor: UIColor.blue().withAlphaComponent(0.75)) barchartitem = OCKBarChart(title: "Pain", text: "with Ibuprofen", tintcolor: UIColor.blue(), axistitles: ["S", "M", "T", "W", "T", "F", "S"], axissubtitles: ["6/5", "", "", "", "", "", "6/11"], dataseries: [painseries, ibuprofenseries], minimumscalerangevalue: 0, maximumscalerangevalue: 10) }

// Creating an Insights Dashboard // Provide an array of insight items // Create an Insights view controller. let viewcontroller = OCKInsightsViewController(insightItems: [ibuprofenmessageitem, barchartitem], headertitle: "Weekly Insights", headersubtitle: "6/5-6/11")

Insights Understanding your data

Connect Communicate and share

Connect Contacts

Connect Contacts Care Team Physician Nurse

Connect Contacts Care Team Physician Nurse Personal Friend Family

var physiciancontact: OCKContact func createphysiciancontact() { physiciancontact = OCKContact(contactType:.careTeam, name: "Dr. Paul Cashman", relation: "Physician", tintcolor: UIColor.blue(), phonenumber: CNPhoneNumber(stringValue: "361-555-0111"), messagenumber: CNPhoneNumber(stringValue: "361-555-0121"), emailaddress: "paulcash1@icloud.com", monogram: "PC", image: UIImage(named: "doctor")) }

var physiciancontact: OCKContact func createphysiciancontact() { physiciancontact = OCKContact(contactType:.careTeam, name: "Dr. Paul Cashman", relation: "Physician", tintcolor: UIColor.blue(), phonenumber: CNPhoneNumber(stringValue: "361-555-0111"), messagenumber: CNPhoneNumber(stringValue: "361-555-0121"), emailaddress: "paulcash1@icloud.com", monogram: "PC", image: UIImage(named: "doctor")) }

var physiciancontact: OCKContact func createphysiciancontact() { physiciancontact = OCKContact(contactType:.careTeam, name: "Dr. Paul Cashman", relation: "Physician", tintcolor: UIColor.blue(), phonenumber: CNPhoneNumber(stringValue: "361-555-0111"), messagenumber: CNPhoneNumber(stringValue: "361-555-0121"), emailaddress: "paulcash1@icloud.com", monogram: "PC", image: UIImage(named: "doctor")) }

// Creating a Connect View Controller // Provide an array of contacts let viewcontroller = OCKConnectViewController(contacts: [physiciancontact, nursecontact, fathercontact, sistercontact, unclecontact]) viewcontroller.delegate = self // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller)

// Creating a Connect View Controller // Provide an array of contacts let viewcontroller = OCKConnectViewController(contacts: [physiciancontact, nursecontact, fathercontact, sistercontact, unclecontact]) viewcontroller.delegate = self // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller)

// Creating a Connect View Controller // Provide an array of contacts let viewcontroller = OCKConnectViewController(contacts: [physiciancontact, nursecontact, fathercontact, sistercontact, unclecontact]) viewcontroller.delegate = self // Embed the view controller in a navigation controller. let navcontroller = UINavigationController(rootViewController: viewcontroller)

// Connect Delegate // Implement the delegate to enable sharing func connectviewcontroller(_ connectviewcontroller: OCKConnectViewController, didselectsharebuttonfor contact: OCKContact, presentationsourceview sourceview: UIView) { generatepdfreport() sharepdfreport() }

// Connect Delegate // Implement the delegate to enable sharing func connectviewcontroller(_ connectviewcontroller: OCKConnectViewController, didselectsharebuttonfor contact: OCKContact, presentationsourceview sourceview: UIView) { generatepdfreport() sharepdfreport() }

// Connect Delegate // Implement the delegate to enable sharing func connectviewcontroller(_ connectviewcontroller: OCKConnectViewController, didselectsharebuttonfor contact: OCKContact, presentationsourceview sourceview: UIView) { generatepdfreport() sharepdfreport() }

Connect Communicate and share

Document Explorer Share the data

Document Exporter Elements

Document Exporter Elements Headers and footers

Document Exporter Elements Headers and footers Texts and paragraphs

Document Exporter Elements Headers and footers Texts and paragraphs Images

Document Exporter Elements Headers and footers Texts and paragraphs Images Charts

Document Exporter Elements Headers and footers Texts and paragraphs Images Charts Tables

func createpdf() { let paragraph = OCKDocumentElementParagraph(content: In the past week, John Appleseed s overall weekly adherence was 86%. His medication adherence was 40%. There were several incomplete dosages. The chart below shows the comparison of John s medication adherence and pain scores. ) let chart = OCKDocumentElementChart(chart: barchartitem) let table = OCKDocumentElementTable(headers: ["", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], rows: [["Pain", "10", "5", "7", "9", "6", "3", "8"]]) let document = OCKDocument(title: "John Appleseed", elements: [paragraph, chart, table]) let pdfurl = persistencedirectoryurl.appendingpathcomponent("carekit.pdf") document.createpdfdata(completion: { data, error in try! data.write(to: pdfurl, options: NSData.WritingOptions.atomicWrite) }) }

func createpdf() { let paragraph = OCKDocumentElementParagraph(content: In the past week, John Appleseed s overall weekly adherence was 86%. His medication adherence was 40%. There were several incomplete dosages. The chart below shows the comparison of John s medication adherence and pain scores. ) let chart = OCKDocumentElementChart(chart: barchartitem) let table = OCKDocumentElementTable(headers: ["", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], rows: [["Pain", "10", "5", "7", "9", "6", "3", "8"]]) let document = OCKDocument(title: "John Appleseed", elements: [paragraph, chart, table]) let pdfurl = persistencedirectoryurl.appendingpathcomponent("carekit.pdf") document.createpdfdata(completion: { data, error in try! data.write(to: pdfurl, options: NSData.WritingOptions.atomicWrite) }) }

func createpdf() { let paragraph = OCKDocumentElementParagraph(content: In the past week, John Appleseed s overall weekly adherence was 86%. His medication adherence was 40%. There were several incomplete dosages. The chart below shows the comparison of John s medication adherence and pain scores. ) let chart = OCKDocumentElementChart(chart: barchartitem) let table = OCKDocumentElementTable(headers: ["", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], rows: [["Pain", "10", "5", "7", "9", "6", "3", "8"]]) let document = OCKDocument(title: "John Appleseed", elements: [paragraph, chart, table]) let pdfurl = persistencedirectoryurl.appendingpathcomponent("carekit.pdf") document.createpdfdata(completion: { data, error in try! data.write(to: pdfurl, options: NSData.WritingOptions.atomicWrite) }) }

func createpdf() { let paragraph = OCKDocumentElementParagraph(content: In the past week, John Appleseed s overall weekly adherence was 86%. His medication adherence was 40%. There were several incomplete dosages. The chart below shows the comparison of John s medication adherence and pain scores. ) let chart = OCKDocumentElementChart(chart: barchartitem) let table = OCKDocumentElementTable(headers: ["", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], rows: [["Pain", "10", "5", "7", "9", "6", "3", "8"]]) let document = OCKDocument(title: "John Appleseed", elements: [paragraph, chart, table]) let pdfurl = persistencedirectoryurl.appendingpathcomponent("carekit.pdf") document.createpdfdata(completion: { data, error in try! data.write(to: pdfurl, options: NSData.WritingOptions.atomicWrite) }) }

func createpdf() { let paragraph = OCKDocumentElementParagraph(content: In the past week, John Appleseed s overall weekly adherence was 86%. His medication adherence was 40%. There were several incomplete dosages. The chart below shows the comparison of John s medication adherence and pain scores. ) let chart = OCKDocumentElementChart(chart: barchartitem) let table = OCKDocumentElementTable(headers: ["", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], rows: [["Pain", "10", "5", "7", "9", "6", "3", "8"]]) let document = OCKDocument(title: "John Appleseed", elements: [paragraph, chart, table]) let pdfurl = persistencedirectoryurl.appendingpathcomponent("carekit.pdf") document.createpdfdata(completion: { data, error in try! data.write(to: pdfurl, options: NSData.WritingOptions.atomicWrite) }) }

647 x 1150

Document Explorer Share the data

CareKit Modules Document Exporter

CareKit Modules Care Card Symptom Tracker Insights Dashboard Connect Care Plan Store Document Exporter

Customizing with CareKit

647 x 1150

647 x 1150

What s Next?

What s Next?

What s Next? Patient App

What s Next? Provider Cloud Patient App

What s Next? Provider Cloud Patient App Care Team Physician

Open Source

Open Source It will become what YOU make of it!

Please Contribute!!

Please Contribute!! github.com/carekit-apple/carekit

Collaboration Your role

Collaboration Your role Issues on GitHub

Collaboration Your role Issues on GitHub Develop the feature

Collaboration Your role Issues on GitHub Develop the feature Review process

Collaboration Our role

Collaboration Our role Accessibility

Collaboration Our role Accessibility Localization

Collaboration Our role Accessibility Localization QA testing

Collaboration Our role Accessibility Localization QA testing Merge into framework

More Information https://developer.apple.com/wwdc16/237

Related Sessions Getting the Most Out of HealthKit Nob Hill Wednesday 9:00AM What s New in ResearchKit Nob Hill Friday 10:00AM

Labs ResearchKit and CareKit Lab Fort Mason Friday 3:30PM