Download - Indivo iOS Framework
Indivo iOS FrameworkPascal B PfiffnerKenneth D MandlIntelligent Health LaboratoryChildren's Hospital Informatics ProgramBoston Children's HospitalHarvard Medical School
Writing medical apps
Medical Data
Connecting medical apps
• To some sources you just can’t connect – EHRs
• To other sources you can – but it’s a ton of work
• What we need is low hacktivation energy
➔ Frameworks
IndivoPersonally Controlled Health Record
Indivo PCHR
• Full-featured backend for personally controlled health record (PCHR) data
• App platform with an extensive API
• Comes with a substitutable front end
• Open Source (github.com/chb)
➔ Patient portal for research projects
Why a patient portal?
• Key technology for engaging patients
• Valuable source of data for phenotype and outcomes
• A channel for providing value back to the patient, to facilitate recruitment and retention
• Efficient method for obtaining low-cost, timely data
• A means for patients to manage their own consents for research
Indivo deployments
• Boston Children’s Hospital – genomics research
• CARRAnet – rheumatologic childhood diseases
• Harvard IBD network – intestinal bowel disease
• TuAnalyze – diabetes network
• Wake Forest School of Medicine – DICOM sharing
Why Mobile?
bdconf Dallas, Sep 2012
Mobile
• 35% of Americans have no internet access at home
• hispanic: 49%, blacks: 51%, w/ disabilities: 59%
• 20% have no desktop internet access at all
• hispanic: 32%, blacks: 29%, w/ disabilities: 46%, w/o diploma: 57%
• Mobile internet use: 31% (2009) ➔ 55% (2012)
• 31% of all Americans only or mostly use the internet on their phones
If your services are not available on mobile devices, they
do not existfor those people
“
”Karen McGrane
Writing Indivo Apps
All you need to do is…
• Perform an OAuth handshake
• Determine correct REST paths
• Deserialize incoming XML or JSON
• Correctly serialize outgoing XML or JSON
All you need to do is…
• Perform an OAuth handshake
• Determine correct REST paths
• Deserialize incoming XML or JSON
• Correctly serialize outgoing XML or JSON
lather, rinse, repeat
Goals
1. High quality mobile experience for Indivo users
2. Framework for easier development of patient-facing apps
• Python client: web apps
• iOS framework: iOS (mobile)
iOS framework
• Handles authentication (OAuth)
• Knows where an object comes from (REST paths)
• Knows Indivo objects’ anatomy (XML handling)
AuthenticationOAuth
App Developer
selectRecord:
callback is called and "activeRecord" property is ready
User
Taps a connect button
Selects a record
Logs in
Approves app
Framework
request app starting page
receives callback with record id
requests request token
receives access token
displays HTML in embedded web view
receives verifier
receives request token
asks to authorize the token
requests access token
displays HTML in embedded web view
Indivo X
returns HTML for either login screen or a record list
returns record id upon record selection
returns request token
authorizes app and approves request token
returns access token
app previously authorized?
YESNO
Handling OAuth
• Server call class to encapsulate all requests
• All OAuth signing is done transparently
• Knows when user interaction (login and App approval) is needed and provides a UI
➔ Authentication is handled for you
App flow
[indivo selectRecord:^{ }];
indivo.activeRecord
Object HandlingREST paths & serialization
From schema to Cocoa
• The developer should not have to deal with XML serialization/deserialization
➔ Provide Cocoa classes for all Indivo data models
• We have to write Objective-C classes for all types
• Indivo’s data models can be extended, what about those?
➔ Include a generator that creates Cocoa classes from Indivo’s data models
Self-aware objects
• Document objects know their record
• Records know their server
• Framework knows the object actions
➔ REST methods can be inferred for all tasks
Abstract logic into Cocoa objects
Server Record addDocumentOfClass:
fetchReportsOfClass:
selectRecord:
Docspush:
replace:
archive:
...
Integrating Indivo into Existing AppsPediatric Growth Charts
Example: growth data
Example: growth data
Growth charts app
• Standalone iOS growth charts app
• Built modular with extendability in mind, but started with only a local “data source”
➔ Indivo-enable the app
Integrating Indivo
• Select child ➔ call Indivo’s selectRecord: method
• Create child instance with Indivo demographics
• Convert Indivo vitals into app format data sets
Indivo-enabled (read-only)
Growth charts app
• Add Indivo framework
• 2 lines (+credentials) to setup Indivo server instance
• 9 lines to convert Indivo record to app’s child object
• 21 lines to convert Indivo vitals into app’s measurement set objects
SMARTOutlook
iOS framework
• Released with SMART 0.6
• Write apps that run against EHR data
• Same convenience™ as the Indivo framework
• Sister Android framework in the works