Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def studyoid(self):
"""Create studyoid from project name and environment"""
return "%s(%s)" % (self.project_name, self.environment_name)
def _querystring(self):
"""Additional keyword arguments if filtered to project_name and environment_name"""
if self.project_name is not None:
return {"studyoid": self.studyoid}
return {}
def url_path(self):
"""Return url path list"""
return self.make_url("datasets", "Sites.odm", **self._querystring())
class UsersRequest(RWSAuthorizedGetRequest):
"""Return list of users for study (can be filtered by location)"""
def __init__(self, project_name, environment_name, location_oid=None):
"""
:param str project_name: Project Name
:param str environment_name: Environment Name
:param str location_oid: Study Site Name to filter with
"""
self.project_name = project_name
self.environment_name = environment_name
self.location_oid = location_oid
@property
def studyoid(self):
"""Create studyoid from project name and environment"""
return "%s(%s)" % (self.project_name, self.environment_name)
check_dataset_format(dataset_format)
self.dataset_format = dataset_format.lower()
self.view_name = view_name
def _dataset_name(self):
return "ClinicalViewMetadata%s" % dataset_format_to_extension(
self.dataset_format
)
def url_path(self):
return self.make_url(
"datasets", self._dataset_name(), **{"ViewName": self.view_name}
)
class CommentDataRequest(RWSAuthorizedGetRequest):
"""Return Comments from Rave as CSV or XML"""
def __init__(self, project_name, environment_name, dataset_format="csv"):
"""
:param str project_name: Project Name
:param str dataset_format: Specify format of the Datasets (either `csv` or `xml`)
:param str environment_name: Environment Name
"""
check_dataset_format(dataset_format)
self.dataset_format = dataset_format.lower()
self.project_name = project_name
self.environment_name = environment_name
def studyname_environment(self):
return "%s(%s)" % (self.project_name, self.environment_name)
self.form_oid,
dataset_format_to_extension(self.dataset_format),
)
def url_path(self):
return self.make_url(
"studies",
self.studyname_environment(),
"datasets",
self.dataset_type,
self._dataset_name(),
**self._querystring()
)
class MetaDataRequest(RWSAuthorizedGetRequest):
"""Return Metadata for Clinical Views in CSV or XML fornat"""
def __init__(self, dataset_format="csv"):
"""
:param str dataset_format: Specify format of the Datasets (either `csv` or `xml`)
"""
check_dataset_format(dataset_format)
self.dataset_format = dataset_format
def _dataset_name(self):
return "ClinicalViewMetadata%s" % dataset_format_to_extension(
self.dataset_format
)
def url_path(self):
return self.make_url("datasets", self._dataset_name())
return "%s(%s)" % (self.project_name, self.environment_name)
def _querystring(self):
"""Additional keyword arguments"""
kw = {"studyoid": self.studyoid}
if self.location_oid is not None:
kw["locationoid"] = self.location_oid
return kw
def url_path(self):
"""Return url path list"""
return self.make_url("datasets", "Users.odm", **self._querystring())
class SignatureDefinitionsRequest(RWSAuthorizedGetRequest):
"""Return signature definitions for all versions of the study"""
def __init__(self, project_name):
"""
:param str project_name: Project Name
"""
self.project_name = project_name
def _querystring(self):
"""Additional keyword arguments"""
kw = {"studyid": self.project_name}
return kw
def url_path(self):
"""Return url path list"""
check_dataset_format(dataset_format)
self.dataset_format = dataset_format.lower()
self.project_name = project_name
def _dataset_name(self):
return "ClinicalViewMetadata%s" % dataset_format_to_extension(
self.dataset_format
)
def url_path(self):
return self.make_url(
"datasets", self._dataset_name(), **{"ProjectName": self.project_name}
)
class ViewMetaDataRequest(RWSAuthorizedGetRequest):
"""Return Metadata for Clinical Views in CSV fornat for a single View"""
def __init__(self, view_name, dataset_format="csv"):
"""
:param str view_name: Clinical View of interest
:param str dataset_format: Specify format of the Datasets (either `csv` or `xml`)
"""
check_dataset_format(dataset_format)
self.dataset_format = dataset_format.lower()
self.view_name = view_name
def _dataset_name(self):
return "ClinicalViewMetadata%s" % dataset_format_to_extension(
self.dataset_format
)
self.environment_name = environment_name
@property
def studyoid(self):
"""Create studyoid from project name and environment"""
return "%s(%s)" % (self.project_name, self.environment_name)
def _dataset_name(self):
return "VersionFolders.odm"
def url_path(self):
"""Return url path list"""
return self.make_url("datasets", self._dataset_name(), **self._querystring())
class SitesMetadataRequest(RWSAuthorizedGetRequest):
"""List all sites in a study along with their StudyVersions"""
def __init__(self, project_name=None, environment_name=None):
"""
:param str project_name: Project Name
:param str environment_name: Environment Name
"""
self.project_name = project_name
self.environment_name = environment_name
if project_name is not None:
if environment_name in [None, ""]:
raise AttributeError(
"environment_name cannot be empty if project_name is set"
)
"""
:param str dataset_format: Specify format of the Datasets (either `csv` or `xml`)
"""
check_dataset_format(dataset_format)
self.dataset_format = dataset_format
def _dataset_name(self):
return "ClinicalViewMetadata%s" % dataset_format_to_extension(
self.dataset_format
)
def url_path(self):
return self.make_url("datasets", self._dataset_name())
class ProjectMetaDataRequest(RWSAuthorizedGetRequest):
"""Return Metadata for Clinical Views in CSV or XML format for a Project"""
def __init__(self, project_name, dataset_format="csv"):
"""
:param str project_name: Project Name
:param str dataset_format: Specify format of the Datasets (either `csv` or `xml`)
"""
check_dataset_format(dataset_format)
self.dataset_format = dataset_format.lower()
self.project_name = project_name
def _dataset_name(self):
return "ClinicalViewMetadata%s" % dataset_format_to_extension(
self.dataset_format
)