/PCM_app_final

Primary LanguageObjective-C

pcm-asco

Project Setup

CocoaPods

In order for this project to work, you will need to install CocoaPods. Once installed, navigate to wherever you have this project checked out and execute "pod install" from terminal.

Project file

Next, open up the created ".xcworkspace" file in XCode.

Patient XML Generation

Once the project is open, go back to cli and execute the R script here: pcm-xml-generator.R.

R script

Required Packages (script will install these if you do not already have them):

  • XML
  • rjson
  • hash
  • RCurl

Execution: Rscript pcm-xml-generator.R breast.hashed.RData

The first (and only) accepted argument is a path to an RData file. This file should contain objects in a format identical to the provided example.

Workflow:

  1. Determine if file exists
  2. Determine if packages are installed
    • If not, install them
    • I would suggest modifying line 19 of the script with the appropriate mirror for your location
  3. Load RData file into "inputData" environment
  4. Loop through objects and construct output XML
    • This script makes GET requests against 'http://rest.genenames.org/fetch/symbol/{$symbol}' to fetch HGNC ID's
    • The first execution will take ~5 minutes (on my work iMac, at least) while these queries are made
    • Once execution is completed, an internal map of Gene Symbols -> Gene IDs is cached as a ".rds" file. This file is referenced on subsequent executions to speed things up.
    • The birthdate value is randomly generated on execution time

Copy XML Files into Project

Once you have generated the XML files (they should be under the "patient-xml" directory in the r-scripts dir), go into XCode and execute:

  1. File -> Add Files to {project name}
  2. Navigate to r-scripts dir with XML
  3. Select ALL "patient-#.xml" files

Once the files are part of the workspace, you should be able to run the app in the simulator. The app is targeted at iPads with iOS 8.

Importing patients

You will notice 3 tabs in this app:

  1. Search
  2. About
  3. Admin

The "Admin" panel is only used to clear and re-populate the internal sqlite schema. Orignally, this app was designed to consume these XML files over HTTP from a little api I built. I cannot give out access to that endpoint, however, so I have modified the app to be able to consume data from the local XML files generated by the parser I provided.

I did, however, leave the Remote populate code in place, just in case you were interested in using it. If that is the case, I can provide the app (it is written using the PHP framework Symfony 2) with some basic instructions on how to set it up.

Please contact me at daniel.p.carbone@vanderbilt.edu if you run into any issues