CastorAPIWrapper-class: Class used to wrap Castor REST API.

CastorAPIWrapper-classR Documentation

Class used to wrap Castor REST API.

Description

Class used to wrap Castor REST API.

Class used to wrap Castor REST API.

Format

An R6 class object.

Methods

  • getRequest(req_path, query_data): Sends a request to the API given a url path and any query parameters (such as page number or include arguments).

  • collectPages(request_url, page, include:

  • getStudy(study_id): Retrieves information about given study.

  • getStudiesPages(): Retries all Castor studies in account.

  • getForm(study_id, form_id): Retrieves information about given study.

  • getFormsPages(): Retries all Castor studies in account.

  • getField(study_id, field_id, include): Gets a specified field.

  • getFieldsPages(study_id, include, page): Gets all fields pages for a given study.

  • getParticipant(study_id, participant_id): Gets a specified participant.

  • getParticipantPages(study_id: Gets all participants for a given study.

  • getStudyDataPoint(study_id, participant_id, field_id: Gets an individual data point for a given study, participant and field.

  • getStudyDataPointsPages(study_id, participant_id, filter_types: Gets all data points for a given study and participant Filter types may be supplied for fields types as a character vector of field types.

Methods

Public methods


Method new()

Usage
CastorAPIWrapper$new(
  username,
  password,
  key,
  secret,
  access_token = NULL,
  type_to_func = self$type_to_func,
  base_url = "https://dev.do.castoredc.com/",
  verbose = self$verbose
)

Method castorOAuth()

Usage
CastorAPIWrapper$castorOAuth(key, secret, baseurl)

Method getRequest()

Usage
CastorAPIWrapper$getRequest(req_path, query_data = list(), raw = FALSE)

Method collectPages()

Usage
CastorAPIWrapper$collectPages(
  request_url,
  page = NULL,
  include = NULL,
  page_size = NULL,
  ...
)

Method getStudy()

Usage
CastorAPIWrapper$getStudy(study_id)

Method getStudiesPages()

Usage
CastorAPIWrapper$getStudiesPages(page = NULL)

Method getUsersPages()

Usage
CastorAPIWrapper$getUsersPages(page = NULL)

Method getForm()

Usage
CastorAPIWrapper$getForm(study_id, form_id)

Method getFormsPages()

Usage
CastorAPIWrapper$getFormsPages(study_id, page = NULL)

Method getVisit()

Usage
CastorAPIWrapper$getVisit(study_id, visit_id)

Method getVisitsPages()

Usage
CastorAPIWrapper$getVisitsPages(study_id, page = NULL)

Method getSurvey()

Usage
CastorAPIWrapper$getSurvey(study_id, survey_id)

Method getSurveysPages()

Usage
CastorAPIWrapper$getSurveysPages(study_id, include = "forms", page = NULL)

Method getSurveyPackage()

Usage
CastorAPIWrapper$getSurveyPackage(study_id, surveypackage_id)

Method getSurveyPackagesPages()

Usage
CastorAPIWrapper$getSurveyPackagesPages(study_id, page = NULL)

Method getSurveyPackageInstance()

Usage
CastorAPIWrapper$getSurveyPackageInstance(study_id, surveypackageinstance_id)

Method getSurveyPackageInstancesPages()

Usage
CastorAPIWrapper$getSurveyPackageInstancesPages(study_id, page = NULL)

Method getRepeatingData()

Usage
CastorAPIWrapper$getRepeatingData(study_id, repeating_data_id, include = NULL)

Method getRepeatingDatasPages()

Usage
CastorAPIWrapper$getRepeatingDatasPages(
  study_id,
  include = "optiongroup",
  page = NULL
)

Method getRepeatingDataForm()

Usage
CastorAPIWrapper$getRepeatingDataForm(
  study_id,
  repeating_data_id,
  repeating_data_form_id
)

Method getRepeatingDataFormsPages()

Usage
CastorAPIWrapper$getRepeatingDataFormsPages(
  study_id,
  repeating_data_id,
  page = NULL
)

Method getField()

Usage
CastorAPIWrapper$getField(study_id, field_id, include = NULL)

Method getFieldsPages()

Usage
CastorAPIWrapper$getFieldsPages(study_id, include = "optiongroup", page = NULL)

Method getParticipant()

Usage
CastorAPIWrapper$getParticipant(study_id, participant_id)

Method getParticipantsPages()

Usage
CastorAPIWrapper$getParticipantsPages(study_id, page = NULL)

Method getStudyDataPoint()

Usage
CastorAPIWrapper$getStudyDataPoint(study_id, participant_id, field_id)

Method getStudyDataPointsPages()

Usage
CastorAPIWrapper$getStudyDataPointsPages(study_id, participant_id, page = NULL)

Method getRepeatingDataInstanceMetadataPages()

Usage
CastorAPIWrapper$getRepeatingDataInstanceMetadataPages(study_id, page = NULL)

Method clone()

The objects of this class are cloneable with this method.

Usage
CastorAPIWrapper$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


castoredc/castoRedc documentation built on Aug. 4, 2024, 5:24 a.m.