the Indivo X iOS Framework

1,260 views

Published on

A walkthrough of building new apps on top of the Indivo iOS framework, as well as integrating it with existing apps to cloud-enable them.

By Pascal Pfiffner, MD Ph.D., Children's Hospital Informatics Program

Published in: Technology, Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,260
On SlideShare
0
From Embeds
0
Number of Embeds
379
Actions
Shares
0
Downloads
21
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

the Indivo X iOS Framework

  1. 1. Indivo iOSframework
  2. 2. Goals• Drop-in to existing Cocoa projects• Provide a low entry barrier into PHR• Make Indivo a viable choice for App developers who want to move their users’ data into the cloud
  3. 3. The framework• Handles authentication (OAuth)• Provides Indivo objects (automatic XML handling)• Knows where an object comes from (REST paths)• Provides messaging functionality
  4. 4. Handling OAuth• Class INServerCall to encapsulate requests• Uses MPOAuth, an OSS OAuth framework for iOS, transparently‣ OAuth is handled for you
  5. 5. From Schema to Cocoa• The developer should not have to deal with XML serialization/deserialization‣ Provide classes for all Indivo document types• We have to write Objective-C classes for all types‣ A generator creates Cocoa classes from Indivo’s XSD and SDMJ schemas
  6. 6. Self-aware objects• Document objects know their record• Records know their server• Framework knows the server actions‣ REST methods can be inferred for all tasks
  7. 7. iOS framework Abstract logic into Cocoa objects selectRecord:Server Record addDocumentOfClass: fetchReportsOfClass: push: Docs replace: archive: ...
  8. 8. App Flow Setup server = [IndivoServer serverWithDelegate:self];#define kIndivoFrameworkServerURL @“http://10.17.20.127:8000”#define kIndivoFrameworkUIServerURL @“http://10.17.20.127:8001”#define kIndivoFrameworkAppId @“medsample@apps.indivo.org”#define kIndivoFrameworkConsumerKey @“nkd8cg02mgo34sntkao9”#define kIndivoFrameworkConsumerSecret @“1acgk9804wkmraoceu02”
  9. 9. App Flow Logging in[server selectRecord:^{ }];server.activeRecord
  10. 10. App Flow Adding a medicationMedication *med = [record addDocument:Medication];med.drugName = [INCodedValue new];med.drugName.title = @“Tylenol”;med.drugName.system ... [med push:^{ }];
  11. 11. App Flow Sending a message[med.activeRecord sendMessage:@“New medication added” withBody:@“See medlist app”
 ofType:INMessageTypePlaintext severity:INMessageSeverityMedium attachments:nil callback:^{ }];
  12. 12. Integrating Indivo Into Existing Apps
  13. 13. Growth Charts App
  14. 14. Growth Charts App Data ModelsCHPatientSource selectPatient:^{ } CHPatient ageAtDate: measurementSetsContainingDataTypes: CHMeasurementSet date CHMeasurement value CHMeasurement value CHMeasurement value
  15. 15. Growth Charts App Local Data Source• Override selectPatient: • Instantiate a CHPatient • Read CSV data as measurement sets
  16. 16. Growth Charts App Indivo Data Source• Call Indivo’s selectRecord: method• Within the callback block: • Fetch patient demographics • Create CHPatient with record demographics • Fetch patient’s vitals • Convert Indivo vitals into measurement sets
  17. 17. Growth Charts App Indivo-Enabled (read-only)• 2 lines + app setup file to setup Indivo server instance• 9 lines to convert IndivoRecord to CHPatient• 21 lines to convert Indivo vitals into CHMeasurementSet
  18. 18. Documentation• Take a look at README.md• Checkout the sample medication app• Technical documentation available online: http://docs.indivohealth.org/projects/indivo-x-ios- framework/en/latest/
  19. 19. Playing with Medications
  20. 20. Version 2.0 α Available with the other Indivo sources from: https://github.com/chb/IndivoFramework-iosCheckout branch dev_two (tag hackathon_2012)

×