ResearchKit / AppCore

Core code shared by the initial ResearchKit apps.
Other
262 stars 82 forks source link

Add Category to provide filename or translated filename #98

Closed ghost closed 9 years ago

ghost commented 9 years ago

Re: https://github.com/ResearchKit/ResearchKit/pull/324 Re: https://github.com/ResearchKit/ResearchKit/issues/323

Add a method in a category on ORKFileResult to provide a filename derived from the concatenation of the ORKResult identifier and ORKStep identifier. Provide for translation of the derived filename via FilenameTranslation.json.

This would serve our purposes for recovering the original filenames in Parkinson and Cardio without adding the step identifier back into the logName in ORKRecorder.

YuanZhu-apple commented 9 years ago

I assume FilenameTranslation.json and the method caller will be in the apps?

ghost commented 9 years ago

@YuanZhu-apple Yes, as needed. Sage has a filename schema which we need to follow, else they will have fragmented data in their database. This will also help insulate the app from further changes to the url which we are currently using to identify the file and form a filename.

ghost commented 9 years ago

@YuanZhu-apple To clarify further on your question about the caller. Currently we have an APCDataArchiver class which includes a friendlyFilenameForFile() method for filename translation via regex. I am currently refactoring / deprecating this class by moving the Parkinson specific code into subclasses of APCBaseTaskViewController and using my encapsulated upload classes to upload. The filename translation will be initially be called from APCDataArchiver, and after refactoring from APCBaseTaskViewController.

YuanZhu-apple commented 9 years ago

r=me.