code: function (workout) {
          var q = $q.defer();
          $window.plugins.healthkit.saveWorkout(workout,
            function (success) {
              q.resolve(success);
            },
            function (err) {
              q.resolve(err);
            }
          );
          return q.promise;
        }
docs: Save a workout.
  
  Workout param should be of the format:
  {
  'activityType': 'HKWorkoutActivityTypeCycling', // HKWorkoutActivityType constant (https://developer.apple.com/library/ios/documentation/HealthKit/Reference/HKWorkout_Class/#//apple_ref/c/tdef/HKWorkoutActivityType)
  'quantityType': 'HKQuantityTypeIdentifierDistanceCycling',
  'startDate': new Date(), // mandatory
  'endDate': null, // optional, use either this or duration
  'duration': 3600, // in seconds, optional, use either this or endDate
  'energy': 300, //
  'energyUnit': 'kcal', // J|cal|kcal
  'distance': 11, // optional
  'distanceUnit': 'km' // probably useful with the former param
  'extraData': "", // Not sure how necessary this is
  },