Class Reference

rwslib

class rwslib.RWSConnection(domain, username=None, password=None, auth=None, virtual_dir='RaveWebServices')

A connection to RWS

Create a connection to Rave

If the domain does not start with http then it is assumed to be the name of the medidata url and https:// will be added as a prefix and .mdsol.com will be added as a postfix.

e.g.

innovate = https://innovate.mdsol.com http://mytest = http:/mytest

send_request(request_object, timeout=None, retries=1, **kwargs)

Send request to RWS endpoint. The request object passed provides the URL endpoint and the HTTP method. Takes the text response from RWS and allows the request object to modify it for return. This allows the request object to return text, an XML document object, a CSV file or anything else that can be generated from the text response from RWS. A timeout, in seconds, can be optionally passed into send_request.

rwslib.builders

Note: Any Class with the Prefix Mdsol represents a Medidata Rave specific extension

class rwslib.builders.Annotation(annotation_id=None, seqnum=1, flags=None, comment=None, transaction_type=None)

A general note about clinical data. If an annotation has both a comment and flags, the flags should be related to the comment.

Note

Annotation is not supported by Medidata Rave

Parameters:
  • id (str or None) – ID for this Annotation (required if contained within an Annotations element)
  • seqnum (int) – SeqNum for Annotation
  • flags (Flag or list(Flag)) – one or more Flag for the Annotation
  • comment (Comment) – one or more Comment for the Annotation
  • transaction_typeTransactionType for Annotation (one of Insert, Update, Remove, Upsert, Context)
ALLOWED_TRANSACTION_TYPES = ['Insert', 'Update', 'Remove', 'Upsert', 'Context']
annotation_id

ID for annotation

Note

If an Annotation is contained with an Annotations element, the ID attribute is required.

build(builder)

Build XML by appending to builder

seqnum

SeqNum attribute (a small positive integer) uniquely identifies the annotation within its parent entity.

class rwslib.builders.AuditRecord(edit_point=None, used_imputation_method=None, identifier=None, include_file_oid=None)

An AuditRecord carries information pertaining to the creation, deletion, or modification of clinical data. This information includes who performed that action, and where, when, and why that action was performed.

Note

AuditRecord is supported only by ItemData in Rave

Parameters:
  • identifier (str) – Audit identifier
  • edit_point (str) – EditPoint attribute identifies the phase of data processing in which action occurred (Monitoring, DataManagement, DBAudit)
  • used_imputation_method (bool) – Indicates whether the action involved the use of a Method
  • include_file_oid (bool) – Include the FileOID in the AuditRecord
EDIT_DATA_MANAGEMENT = 'DataManagement'
EDIT_DB_AUDIT = 'DBAudit'
EDIT_MONITORING = 'Monitoring'
EDIT_POINTS = ['Monitoring', 'DataManagement', 'DBAudit']
audit_id

AuditRecord ID

Note

If an AuditRecord is contained within an AuditRecords element, the ID attribute must be provided.

build(builder)

Build XML by appending to builder

date_time_stamp = None

DateTimeStamp for the AuditRecord

edit_point
EditPoint attribute identifies the phase of data processing in which action occurred
(Monitoring, DataManagement, DBAudit)
location_ref = None

LocationRef for the AuditRecord

reason_for_change = None

ReasonForChange for the AuditRecord

user_ref = None

UserRef for the AuditRecord

class rwslib.builders.BasicDefinitions

Container for MeasurementUnit

build(builder)

Build XML by appending to builder

measurement_units = None

Collection of MeasurementUnit

class rwslib.builders.CheckValue(value)

A value in a RangeCheck

Parameters:value (str) – Value for a RangeCheck
build(builder)

Build XML by appending to builder

class rwslib.builders.ClinicalData(projectname, environment, metadata_version_oid='1')

Models the ODM ClinicalData object

Parameters:
  • projectname – Name of Project in Medidata Rave
  • environment – Rave Study Enviroment
  • metadata_version_oid – MetadataVersion OID
build(builder)

Build XML by appending to builder

subject_data = None

SubjectData for the ClinicalData Element

class rwslib.builders.CodeList(oid, name, datatype, sas_format_name=None)

Defines a discrete set of permitted values for an item.

Note

Equates to a Rave Dictionary

Note

Does not support ExternalCodeList

Parameters:
  • oid (str) – CodeList OID
  • name (str) – Name of CodeList
  • datatype (str) – DataType restricts the values that can appear in the CodeList whether internal or external (integer | float | text | string )
  • sas_format_name (str) – SASFormatName must be a legal SAS format for CodeList
VALID_DATATYPES = [<DataType.Integer: 'integer'>, <DataType.Text: 'text'>, <DataType.Float: 'float'>, <DataType.String: 'string'>]
build(builder)

Build XML by appending to builder

codelist_items = None

Collection of CodeListItem

class rwslib.builders.CodeListItem(coded_value, order_number=None, specify=False)

Defines an individual member value of a CodeList including display format. The actual value is given, along with a set of print/display-forms.

Parameters:
  • coded_value (str) – Coded Value for CodeListItem
  • order_number (int) – OrderNumber for the CodeListItem - Note: this is a Medidata Rave Extension, but upstream ODM has been updated to include the OrderNumber attribute
  • specify (bool) – Does this have a Specify? option? - Rave Specific Attribute
build(builder)

Build XML by appending to builder

class rwslib.builders.CodeListRef(oid)

A reference to a CodeList definition.

Parameters:oid – OID for CodeList
build(builder)

Build XML by appending to builder

class rwslib.builders.Comment(text=None, sponsor_or_site=None)

A free-text (uninterpreted) comment about clinical data. The comment may have come from the Sponsor or the clinical Site.

Note

Comment is not supported by Medidata Rave

Parameters:
  • text (str) – Text for Comment
  • sponsor_or_site (str) – Originator flag for Comment (either _Sponsor_ or _Site_)
VALID_SPONSOR_OR_SITE_RESPONSES = ['Sponsor', 'Site']
build(builder)

Build XML by appending to builder

sponsor_or_site

Originator of comment (either Sponsor or Site)

text

Text content of Comment

class rwslib.builders.DateTimeStamp(date_time)

The date/time that the data entry, modification, or signature was performed. This applies to the initial occurrence of the action, not to subsequent transfers between computer systems.

build(builder)

Build XML by appending to builder

date_time = None

specified DateTime for event

class rwslib.builders.Decode

The displayed value relating to the CodedValue

build(builder)

Build XML by appending to builder

translations = None

Collection of Translation for the Decode

class rwslib.builders.Flag(flag_type=None, flag_value=None)

A machine-processable annotation on clinical data.

Note

Flag is not supported by Rave

Parameters:
build(builder)

Build XML by appending to builder

class rwslib.builders.FlagType(flag_type, codelist_oid=None)

The type of flag. This determines the purpose and semantics of the flag. Different applications are expected to be interested in different types of flags. The actual value must be a member of the referenced CodeList.

Note

FlagType is not supported by Rave

Parameters:flag_type – Type for Flag
build(builder)

Build XML by appending to builder

codelist_oid

Reference to the CodeList for the FlagType

class rwslib.builders.FlagValue(flag_value, codelist_oid=None)

The value of the flag. The meaning of this value is typically dependent on the associated FlagType. The actual value must be a member of the referenced CodeList.

Note

FlagValue is not supported by Rave

Parameters:flag_value – Value for Flag
build(builder)

Build XML by appending to builder

codelist_oid

Reference to the CodeList for the FlagType

class rwslib.builders.FormData(formoid, transaction_type=None, form_repeat_key=None)

Models the ODM FormData object

Parameters:
  • formoid (str) – FormDef OID
  • transaction_type (str) – Transaction Type for Data (one of Insert, Update)
  • form_repeat_key (str) – Repeat Key for FormData
ALLOWED_TRANSACTION_TYPES = ['Insert', 'Update']
annotations = None

Collection of Annotation for FormData - Not supported by Rave

build(builder)

Build XML by appending to builder :Example: <FormData FormOID=”MH” TransactionType=”Update”>

signature = None

Signature for FormData

class rwslib.builders.FormDef(oid, name, repeating=False, order_number=None, active=True, template=False, signature_required=False, log_direction='Portrait', double_data_entry='MustNotDDE', confirmation_style='NoLink', link_study_event_oid=None, link_form_oid=None)

A FormDef describes a type of form that can occur in a study.

Parameters:
  • oid (str) – OID for FormDef
  • name (str) – Name for FormDef
  • repeating (bool) – Is this a repeating Form?
  • order_number (int) – OrderNumber for the FormDef
  • active (bool) – Indicates that the form is available to end users when you publish and push the draft to Rave EDC - Rave Specific Attribute
  • template (bool) – Indicates that the form is a template form in Rave EDC - Rave Specific Attribute
  • signature_required (bool) – Select to ensure that the form requires investigator signature for all submitted data points - Rave Specific Attribute
  • log_direction (str) – Set the display mode of a form, (Landscape or Portrait) - Rave Specific Attribute
  • double_data_entry (str) – Indicates if the form is used to collect data in Rave Double Data Entry (DDE), (Always, Never or As Per Site) - Rave Specific Attribute
  • confirmation_style – Style of Confirmation, (None, NotLink, LinkNext or LinkCustom) - Rave Specific Attribute
  • link_study_event_oid – OID for StudyEvent target for Link - Rave Specific Attribute
  • link_form_oid – OID for FormRef target for Link - Rave Specific Attribute
DDE_MAY = 'MayDDE'
DDE_MUST = 'MustDDE'
DDE_MUSTNOT = 'MustNotDDE'
LOG_LANDSCAPE = 'Landscape'
LOG_PORTRAIT = 'Portrait'
build(builder)

Build XML by appending to builder

entry_restrictions = None

Collection of EntryRestriction for Form - Rave Specific Attribute

helptexts = None

Collection of HelpText for Form (Cardinality not clear) - Rave Specific Attribute

itemgroup_refs = None

Collection of ItemGroupRef for Form

view_restrictions = None

Collection of ViewRestriction for Form - Rave Specific Attribute

class rwslib.builders.FormRef(oid, order_number, mandatory)

A reference to a FormDef as it occurs within a specific StudyEventDef . The list of FormRef identifies the types of forms that are allowed to occur within this type of study event. The FormRef within a single StudyEventDef must not have duplicate FormOIDs nor OrderNumbers.

Parameters:
  • oid (str) – Set the FormDef OID for the FormRef
  • order_number (int) – Define the OrderNumber for the FormRef within the containing StudyEventDef
  • mandatory (bool) – Is this Form Mandatory?
build(builder)

Build XML by appending to builder

class rwslib.builders.GlobalVariables(protocol_name, name=None, description='')

GlobalVariables includes general summary information about the Study.

Note

Name and description are not important. protocol_name maps to the Rave project name

Parameters:
  • protocol_name (str) – Protocol Name
  • name (str) – Study Name
  • description (str) – Study Description
build(builder)

Build XML by appending to builder

class rwslib.builders.ItemData(itemoid, value, specify_value=None, transaction_type=None, lock=None, freeze=None, verify=None)

Models the ODM ItemData object

Parameters:
  • itemoid (str) – OID for the matching ItemDef
  • value (str) – Value for the the ItemData
  • specify_value (str) – ‘If other, specify’ value - Rave specific attribute
  • transaction_type (str) – Transaction type for the data
  • lock (bool) – Lock the DataPoint? - Rave specific attribute
  • freeze (bool) – Freeze the DataPoint? - Rave specific attribute
  • verify (bool) – Verify the DataPoint? - Rave specific attribute
ALLOWED_TRANSACTION_TYPES = ['Insert', 'Update', 'Upsert', 'Context', 'Remove']
annotations = None

the list of Annotation on the DataPoint - Not supported by Rave

audit_record = None

the corresponding AuditRecord for the DataPoint

build(builder)

Build XML by appending to builder

deviations = None

the list of MdsolProtocolDeviation references on the DataPoint - Rave Specific Attribute

measurement_unit_ref = None

the corresponding MeasurementUnitRef for the DataPoint

queries = None

the list of MdsolQuery on the DataPoint - Rave Specific Attribute

class rwslib.builders.ItemDef(oid, name, datatype, length=None, significant_digits=None, sas_field_name=None, sds_var_name=None, origin=None, comment=None, active=True, control_type=None, acceptable_file_extensions=None, indent_level=0, source_document_verify=False, default_value=None, sas_format=None, sas_label=None, query_future_date=False, visible=True, translation_required=False, query_non_conformance=False, other_visits=False, can_set_item_group_date=False, can_set_form_date=False, can_set_study_event_date=False, can_set_subject_date=False, visual_verify=False, does_not_break_signature=False, date_time_format=None, field_number=None, variable_oid=None)

An ItemDef describes a type of item that can occur within a study. Item properties include name, datatype, measurement units, range or codelist restrictions, and several other properties.

Parameters:
  • oid (str) – OID for ItemDef
  • name (str) – Name for ItemDef
  • datatype (str) – Datatype for ItemDef
  • length (int) – Max. Length of content expected in Item Value
  • significant_digits (int) – Max. Number of significant digits in Item Value
  • sas_field_name (str) – SAS Name for the ItemDef
  • sds_var_name (str) – SDS Variable Name
  • origin (str) – Origin for the Variable
  • comment (str) – Comment for the Variable
  • active (bool) – Is the Variable Active? - Rave Specific Attribute
  • control_type (ControlType) – Control Type for the Variable - Rave Specific Attribute
  • acceptable_file_extensions (str) – File extensions for File Upload Control (separated by a comma) - Rave Specific Attribute
  • indent_level (int) – Level of indentation of a field from the left-hand page margin. - Rave Specific Attribute
  • source_document_verify (bool) – Does this Variable need to be SDV’ed? - Rave Specific Attribute
  • default_value (str) – Value entered in this field is displayed as the default value in Rave EDC. - Rave Specific Attribute
  • sas_format (str) – SAS variable format of maximum 25 alphanumeric characters.
  • sas_label (str) – SAS label of maximum 256 alphanumeric characters.
  • query_future_date (bool) – Generates a query when the Rave EDC user enters a future date in the field. - Rave Specific Attribute
  • visible (bool) – Indicates that the field displays on the form when the version is pushed to Rave EDC. - Rave Specific Attribute
  • translation_required (bool) – Enables translation functionality for the selected field. - Rave Specific Attribute
  • query_non_conformance (bool) – Generates a query when the Rave EDC user enters data in a format other than what has been defined for the variable. - Rave Specific Attribute
  • other_visits (bool) – Display previous visit data - Rave Specific Attribute
  • can_set_item_group_date (bool) – If a form contains log fields, this parameter assigns the date entered into the field as the date for the record (log line) - Rave Specific Attribute
  • can_set_form_date (bool) – Observation Date of Form assigns the date entered into the field as the date for the form - Rave Specific Attribute
  • can_set_study_event_date (bool) – Observation Date of Folder assigns the date entered into the field as the date for the folder - Rave Specific Attribute
  • can_set_subject_date (bool) – Observation Date of Subject assigns the date entered into the field as the date for the Subject. - Rave Specific Attribute
  • visual_verify (bool) – This parameter sets the field as a Visual Verify field in Rave DDE - Rave Specific Attribute
  • does_not_break_signature (bool) – Indicates that the field (both derived and non-derived) does not participate in signature. - Rave Specific Attribute
  • date_time_format (str) – Displays text boxes for the user to enter the day, month, and year according to the specified variable format. - Rave Specific Attribute
  • field_number (str) – Number that displays to the right of a field label in Rave EDC to create a numbered list on the form. - Rave Specific Attribute
  • variable_oid – OID for Variable - Rave Specific Attribute
VALID_DATATYPES = [<DataType.Text: 'text'>, <DataType.Integer: 'integer'>, <DataType.Float: 'float'>, <DataType.Date: 'date'>, <DataType.DateTime: 'datetime'>, <DataType.Time: 'time'>]
build(builder)

Build XML by appending to builder

codelistref = None

Matching CodeListRef

entry_restrictions = None

Collection of MdsolEntryRestriction

header_text = None

Matching MdsolHeaderText

help_texts = None

Collection of MdsolHelpText

measurement_unit_refs = None

Collection of MeasurementUnitRef

question = None

Matching Question

range_checks = None

Collection of RangeCheck

review_groups = None

Collection of MdsolReviewGroup

view_restrictions = None

Collection of MdsolViewRestriction

class rwslib.builders.ItemGroupData(transaction_type=None, item_group_repeat_key=None, whole_item_group=False, annotations=None)

Models the ODM ItemGroupData object.

Note

No name for the ItemGroupData element is required. This is built automatically by the form.

Parameters:
  • transaction_type (str) – TransactionType for the ItemGroupData
  • item_group_repeat_key (int) – RepeatKey for the ItemGroupData
  • whole_item_group (bool) – Is this the entire ItemGroupData, or just parts? - Rave specific attribute
  • annotations (list(Annotation) or Annotation) – Annotation for the ItemGroup - Not supported by Rave
ALLOWED_TRANSACTION_TYPES = ['Insert', 'Update', 'Upsert', 'Context']
build(builder, formname)

Build XML by appending to builder

signature = None

Signature for ItemGroupData

class rwslib.builders.ItemGroupDef(oid, name, repeating=False, is_reference_data=False, sas_dataset_name=None, domain=None, origin=None, role=None, purpose=None, comment=None)

An ItemGroupDef describes a type of item group that can occur within a Study.

Parameters:
  • oid (str) – OID for ItemGroupDef
  • name (str) – Name for ItemGroupDef
  • repeating (bool) – Is this a repeating ItemDef?
  • is_reference_data (bool) – If IsReferenceData is Yes, this type of item group can occur only within a ReferenceData element. If IsReferenceData is No, this type of item group can occur only within a ClinicalData element. The default for this attribute is No.
  • sas_dataset_name (str) – SAS Dataset Name
  • domain (str) – Domain for Items within this ItemGroup
  • origin – Origin of data (eg CRF, eDT, Derived)
  • role – Role for the ItemGroup (eg Identifier, Topic, Timing, Qualifiers)
  • purpose – Purpose (eg Tabulation)
  • comment – Comment on the ItemGroup Contents
build(builder)

Build XML by appending to builder

item_refs = None

Collection of ItemRef

label_refs = None

Collection of MdsolLabelRef

class rwslib.builders.ItemGroupRef(oid, order_number, mandatory=True)

A reference to an ItemGroupDef as it occurs within a specific FormDef. The list of ItemGroupRefs identifies the types of item groups that are allowed to occur within this type of form. The ItemGroupRefs within a single FormDef must not have duplicate ItemGroupOIDs nor OrderNumbers.

Parameters:
  • oid (str) – OID for the referenced ItemGroupDef
  • order_number (int) – OrderNumber for the ItemGroupRef
  • mandatory (bool) – Is this ItemGroupRef required?
build(builder)
class rwslib.builders.ItemRef(oid, order_number=None, mandatory=False, key_sequence=None, imputation_method_oid=None, role=None, role_codelist_oid=None)

A reference to an ItemDef as it occurs within a specific ItemGroupDef. The list of ItemRefs identifies the types of items that are allowed to occur within this type of item group.

Parameters:
  • oid (str) – OID for ItemDef
  • order_number (int) – OrderNumber for the ItemRef
  • mandatory (bool) – Is this ItemRef required?
  • key_sequence (int) – The KeySequence (if present) indicates that this item is a key for the enclosing item group. It also provides an ordering for the keys.
  • imputation_method_oid (str) – DEPRECATED
  • role (str) – Role name describing the use of this data item.
  • role_codelist_oid (str) – RoleCodeListOID may be used to reference a CodeList that defines the full set roles from which the Role attribute value is to be taken.
attributes = None

Collection of MdsolAttribute

build(builder)

Build XML by appending to builder

class rwslib.builders.LocationRef(oid)

Reference to a Location

Parameters:oid (str) – OID for referenced Location
build(builder)

Build XML by appending to builder

class rwslib.builders.MdsolAttribute(namespace, name, value, transaction_type='Insert')

Rave Web Services element for holding Vendor Attributes

Note

This is Medidata Rave Specific Element

build(builder)

Build XML by appending to builder

name = None

Name for the Attribute

namespace = None

Namespace for the Attribute

transaction_type = None

TransactionType for the Attribute

value = None

Value for the Attribute

class rwslib.builders.MdsolCheckAction(variable_oid=None, field_oid=None, form_oid=None, folder_oid=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, check_action_type=None, check_string=None, check_options=None, check_script=None)

Check Action modeled after check action in Architect Loader spreadsheet.

Note

Do not use directly, use appropriate sub-class.

Note

This is a Medidata Rave Specific Element

Parameters:
  • variable_oid (str) – OID for the Variable that is the target of the CheckAction
  • field_oid (str) – OID for the Field that is the target of the CheckAction
  • form_oid (str) – OID for the Form that is the target of the CheckAction
  • folder_oid (str) – OID for the Folder that is the target of the CheckAction
  • record_position (int) – Record Position for the CheckAction
  • form_repeat_number (int) – Form Repeat Number for the CheckAction
  • folder_repeat_number (int) – Folder Repeat Number for the CheckAction
  • check_string (str) – CheckAction String
  • check_options (str) – CheckAction Options
  • check_script (str) – CheckAction Script
build(builder)
check_action_type

return the CheckAction Type

class rwslib.builders.MdsolCheckStep(variable_oid=None, data_format=None, form_oid=None, folder_oid=None, field_oid=None, static_value=None, function=None, custom_function=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, logical_record_position=None)

A check step modeled after the Architect Loader definition.

Note

Do not use directly, use appropriate subclasses.

Note

this is a Medidata Rave Specific Element

Parameters:
  • variable_oid (str) – OID for Variable targeted by CheckStep
  • data_format (str) – Format for Value
  • form_oid (str) – OID for Form
  • folder_oid (str) – OID for Folder
  • field_oid (str) – OID for Field
  • custom_function (str) – Name of Custom Function for CheckStep
  • record_position (int) – Record Position - If the field is a standard (non-log) field, enter 0
  • form_repeat_number (int) – Repeat Number for Form for CheckStep
  • folder_repeat_number (int) – Repeat Number for Folder for CheckStep
  • logical_record_position (LogicalRecordPositionType) – LRP value for the CheckStep
  • static_value (str) – Static Value for CheckStep
  • function (StepType) – Check Function for CheckStep
LRP_TYPES = [<LogicalRecordPositionType.MaxBySubject: 'MaxBySubject'>, <LogicalRecordPositionType.MaxBySubject: 'MaxBySubject'>, <LogicalRecordPositionType.MaxByInstance: 'MaxByInstance'>, <LogicalRecordPositionType.MaxByDataPage: 'MaxByDataPage'>, <LogicalRecordPositionType.Last: 'Last'>, <LogicalRecordPositionType.Next: 'Next'>, <LogicalRecordPositionType.Previous: 'Previous'>, <LogicalRecordPositionType.First: 'First'>, <LogicalRecordPositionType.MinByDataPage: 'MinByDataPage'>, <LogicalRecordPositionType.MinByInstance: 'MinByInstance'>, <LogicalRecordPositionType.MinBySubject: 'MinBySubject'>]
VALID_STEPS = [<StepType.CustomFunction: 'CustomFunction'>, <StepType.IsEmpty: 'IsEmpty'>, <StepType.IsNotEmpty: 'IsNotEmpty'>, <StepType.Contains: 'Contains'>, <StepType.StartsWith: 'StartsWith'>, <StepType.IsLessThan: 'IsLessThan'>, <StepType.IsLessThanOrEqualTo: 'IsLessThanOrEqualTo'>, <StepType.IsGreaterThan: 'IsGreaterThan'>, <StepType.IsGreaterThanOrEqualTo: 'IsGreaterThanOrEqualTo'>, <StepType.IsEqualTo: 'IsEqualTo'>, <StepType.IsNonConformant: 'IsNonConformant'>, <StepType.IsNotEqualTo: 'IsNotEqualTo'>, <StepType.InLocalLabRange: 'InLocalLabRange'>, <StepType.LengthIsLessThan: 'LengthIsLessThan'>, <StepType.LengthIsLessThanOrEqualTo: 'LengthIsLessThanOrEqualTo'>, <StepType.LengthIsGreaterThan: 'LengthIsGreaterThan'>, <StepType.LengthIsGreaterThanOrEqualTo: 'LengthIsGreaterThanOrEqualTo'>, <StepType.LengthIsEqualTo: 'LengthIsEqualTo'>, <StepType.Or: 'Or'>, <StepType.And: 'And'>, <StepType.Not: 'Not'>, <StepType.Now: 'Now'>, <StepType.IsPresent: 'IsPresent'>, <StepType.IsActive: 'IsActive'>, <StepType.Add: 'Add'>, <StepType.Subtract: 'Subtract'>, <StepType.Multiply: 'Multiply'>, <StepType.Divide: 'Divide'>, <StepType.AddDay: 'AddDay'>, <StepType.AddMonth: 'AddMonth'>, <StepType.AddYear: 'AddYear'>, <StepType.AddSec: 'AddSec'>, <StepType.AddMin: 'AddMin'>, <StepType.AddHour: 'AddHour'>, <StepType.DaySpan: 'DaySpan'>, <StepType.TimeSpan: 'TimeSpan'>, <StepType.Age: 'Age'>, <StepType.StringAdd: 'StringAdd'>]
build(builder)

Build XML by appending to builder

function
logical_record_position

Get the Logical Record Position :return: the Logical Record Position

class rwslib.builders.MdsolConfirmationMessage(message, lang=None)

Form is saved confirmation message

Note

this is a Medidata Rave Specific Element

Parameters:
  • message (str) – Content of confirmation message
  • lang (str) – Language declaration for Message
build(builder)

Build XML by appending to builder

class rwslib.builders.MdsolCustomFunctionDef(oid, code, language='C#')

Extension for Rave Custom functions

Note

This is a Medidata Rave Specific Extension

Note

VB was deprecated in later Rave versions.

Parameters:
  • oid (str) – OID for CustomFunction
  • code (str) – Content for the CustomFunction
  • language (str) – Language for the CustomFunction
C_SHARP = 'C#'
SQL = 'SQ'
VALID_LANGUAGES = ['C#', 'SQ', 'VB']
VB = 'VB'
build(builder)

Build XML by appending to builder

class rwslib.builders.MdsolDerivationDef(oid, active=True, bypass_during_migration=False, needs_retesting=False, variable_oid=None, field_oid=None, form_oid=None, folder_oid=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, logical_record_position=None, all_variables_in_folders=None, all_variables_in_fields=None)

Extension for Rave derivations

Note

This is a Medidata Rave Specific Extension

Parameters:
  • oid (str) – OID for Derivation
  • active (bool) – Is this Derivation Active?
  • bypass_during_migration (bool) – Bypass this Derivation on Study Migration?
  • needs_retesting (bool) – Does this Derivation need retesting?
  • variable_oid (str) – OID for target variable (eg OID for ItemDef)
  • field_oid (str) – OID for target field (eg OID for ItemDef)
  • form_oid (str) – OID for Form for target of Derivation (eg OID for FormDef)
  • folder_oid (str) – OID for Folder for target of Derivation (eg OID for StudyEventDef)
  • record_position (int) – Record Position for the Derivation
  • form_repeat_number (int) – Form Repeat Number for the CheckAction
  • folder_repeat_number (int) – Folder Repeat Number for the CheckAction
  • logical_record_position (LogicalRecordPositionType) –
  • all_variables_in_folders (bool) – Evaluates the derivation according to any field using the specified variable within a specific folder.
  • all_variables_in_fields (bool) – Evaluates the derivation according to any field using the specified variable across the whole subject.
LRP_TYPES = [<LogicalRecordPositionType.MaxBySubject: 'MaxBySubject'>, <LogicalRecordPositionType.MaxBySubject: 'MaxBySubject'>, <LogicalRecordPositionType.MaxByInstance: 'MaxByInstance'>, <LogicalRecordPositionType.MaxByDataPage: 'MaxByDataPage'>, <LogicalRecordPositionType.Last: 'Last'>, <LogicalRecordPositionType.Next: 'Next'>, <LogicalRecordPositionType.Previous: 'Previous'>, <LogicalRecordPositionType.First: 'First'>, <LogicalRecordPositionType.MinByDataPage: 'MinByDataPage'>, <LogicalRecordPositionType.MinByInstance: 'MinByInstance'>, <LogicalRecordPositionType.MinBySubject: 'MinBySubject'>]
build(builder)

Build XML by appending to builder

derivation_steps = None

Set of MdsolDerivationStep for this derivation

logical_record_position

Get the Logical Record Position :return: the Logical Record Position

class rwslib.builders.MdsolDerivationStep(variable_oid=None, data_format=None, form_oid=None, folder_oid=None, field_oid=None, value=None, function=None, custom_function=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, logical_record_position=None)

A derivation step modeled after the Architect Loader definition.

Note

Do not use directly, use appropriate subclasses.

Note

this is a Medidata Rave Specific Element

Parameters:
  • variable_oid (str) – OID for Variable targeted by Derivation
  • data_format (str) – Format for Value
  • form_oid (str) – OID for Form
  • folder_oid (str) – OID for Folder
  • field_oid (str) – OID for Field
  • value (str) – Value for DerivationStep
  • custom_function (str) – Name of Custom Function for DerivationStep
  • record_position (int) – Record Position - If the field is a standard (non-log) field, enter 0
  • form_repeat_number (int) – Repeat Number for Form for DerivationStep
  • folder_repeat_number (int) – Repeat Number for Folder for DerivationStep
  • logical_record_position (LogicalRecordPositionType) – LRP value for the DerivationStep
LRP_TYPES = [<LogicalRecordPositionType.MaxBySubject: 'MaxBySubject'>, <LogicalRecordPositionType.MaxBySubject: 'MaxBySubject'>, <LogicalRecordPositionType.MaxByInstance: 'MaxByInstance'>, <LogicalRecordPositionType.MaxByDataPage: 'MaxByDataPage'>, <LogicalRecordPositionType.Last: 'Last'>, <LogicalRecordPositionType.Next: 'Next'>, <LogicalRecordPositionType.Previous: 'Previous'>, <LogicalRecordPositionType.First: 'First'>, <LogicalRecordPositionType.MinByDataPage: 'MinByDataPage'>, <LogicalRecordPositionType.MinByInstance: 'MinByInstance'>, <LogicalRecordPositionType.MinBySubject: 'MinBySubject'>]
VALID_STEPS = [<StepType.Age: 'Age'>, <StepType.Subtract: 'Subtract'>, <StepType.Multiply: 'Multiply'>, <StepType.Divide: 'Divide'>, <StepType.AddDay: 'AddDay'>, <StepType.AddMonth: 'AddMonth'>, <StepType.AddYear: 'AddYear'>, <StepType.AddSec: 'AddSec'>, <StepType.AddMin: 'AddMin'>, <StepType.AddHour: 'AddHour'>, <StepType.DaySpan: 'DaySpan'>, <StepType.TimeSpan: 'TimeSpan'>, <StepType.Now: 'Now'>, <StepType.StringAdd: 'StringAdd'>, <StepType.CustomFunction: 'CustomFunction'>, <StepType.Space: 'Space'>, <StepType.Add: 'Add'>]
build(builder)

Build XML by appending to builder

function

Return the Derivation Function :return:

logical_record_position

Get the Logical Record Position :return: the Logical Record Position

class rwslib.builders.MdsolEditCheckDef(oid, active=True, bypass_during_migration=False, needs_retesting=False)

Extension for Rave edit checks

Note

This is a Medidata Rave Specific Extension

Parameters:
  • oid (str) – EditCheck OID
  • active (bool) – Is this EditCheck active?
  • bypass_during_migration (bool) – Bypass this EditCheck during a Study Migration
  • needs_retesting (bool) – Does this EditCheck need Retesting?
build(builder)

Build XML by appending to builder

check_actions = None

Set of MdsolCheckAction for this EditCheck

check_steps = None

Set of MdsolCheckStep for this EditCheck

class rwslib.builders.MdsolEntryRestriction(rolename)

EntryRestriction for FormDef and ItemDef

Note

This is Medidata Rave Specific Element

build(builder)
rolename = None

Name for the role for which the EntryRestriction applies

class rwslib.builders.MdsolHeaderText(content, lang=None)

Header text for ItemDef when shown in grid

Note

this is a Medidata Rave Specific Element

Parameters:
  • content (str) – Content for the Header Text
  • lang (str) – Language specification for Header
build(builder)

Build XML by appending to builder

class rwslib.builders.MdsolHelpText(lang, content)

Help element for FormDef and ItemDef

Note

This is Medidata Rave Specific Element

build(builder)
content = None

HelpText content

lang = None

Language specification for HelpText

class rwslib.builders.MdsolLabelDef(oid, name, field_number=None)

Label definition

Note

This is a Medidata Rave Specific Element

Parameters:
  • oid – OID for the MdsolLabelDef
  • name – Name for the MdsolLabelDef
  • field_number (int) – FieldNumber for the MdsolLabelDef
build(builder)

Build XML by appending to builder

help_texts = None

Collection of HelpText

translations = None

Collection of Translation

view_restrictions = None

Collection of ViewRestriction

class rwslib.builders.MdsolLabelRef(oid, order_number)

A reference to a label on a form

Note

This is Medidata Rave Specific Element

build(builder)

Build XML by appending to builder

oid = None

OID for the corresponding MdsoLabel

order_number = None

OrderNumber for the Label

class rwslib.builders.MdsolProtocolDeviation(value, status, repeat_key=1, code=None, klass=None, transaction_type=None)

Extension for Protocol Deviations in Rave

Note

This is a Medidata Rave Specific Extension

Note

This primarily exists as a mechanism for use by the Clinical Audit Record Service, but it is useful to define for the builders

Parameters:
  • value (str) – Value for the Protocol Deviation
  • status (rwslib.builder_constants.ProtocolDeviationStatus) –
  • repeat_key (int) – RepeatKey for the Protocol Deviation
  • code (basestring) – Protocol Deviation Code
  • klass (basestring) – Protocol Deviation Class
  • transaction_type – Transaction Type for the Protocol Deviation
ALLOWED_TRANSACTION_TYPES = ['Insert']
build(builder)

Build XML by appending to builder

repeat_key
status
class rwslib.builders.MdsolQuery(value=None, query_repeat_key=None, recipient=None, status=None, requires_response=None, response=None)

MdsolQuery extension element for Queries at item level only

Note

This is a Medidata Rave specific extension

Parameters:
  • value (str) – Query Value
  • query_repeat_key (int) – Repeat key for Query
  • recipient (str) – Recipient for Query
  • status (QueryStatusType) – Query status
  • requires_response (bool) – Does this Query need a response?
  • response (str or None) – Query response (if any)
build(builder)

Build XML by appending to builder

status

Query Status

class rwslib.builders.MdsolReviewGroup(name)

Maps to Rave review groups for an ItemDef

Note

this is a Medidata Rave Specific Element

Parameters:name (str) – Name for the MdsolReviewGroup
build(builder)

Build XML by appending to builder

class rwslib.builders.MdsolViewRestriction(rolename)

ViewRestriction for FormDef and ItemDef

Note

This is Medidata Rave Specific Element

build(builder)
rolename = None

Name for the role for which the ViewRestriction applies

class rwslib.builders.MeasurementUnit(oid, name, unit_dictionary_name=None, constant_a=1, constant_b=1, constant_c=0, constant_k=0, standard_unit=False)

The physical unit of measure for a data item or value. The meaning of a MeasurementUnit is determined by its Name attribute.

Parameters:
  • oid (str) – MeasurementUnit OID
  • name (str) – Maps to Coded Unit within unit dictionary entries in Rave.
  • unit_dictionary_name (str) – Maps to unit dictionary Name in Rave. - Rave specific attribute
  • constant_a (int) – Maps to the unit dictionary Constant A in Rave. - Rave specific attribute
  • constant_b (int) – Maps to the unit dictionary Constant B in Rave. - Rave specific attribute
  • constant_c (int) – Maps to the unit dictionary Constant C in Rave. - Rave specific attribute
  • constant_k (int) – Maps to the unit dictionary Constant K in Rave. - Rave specific attribute
  • standard_unit (bool) – Yes = Standard checked within the unit dictionary entry in Rave. No = Standard unchecked within the unit dictionary entry in Rave. - Rave specific attribute
build(builder)

Build XML by appending to builder

symbols = None

Collection of Symbol for this MeasurementUnit

class rwslib.builders.MeasurementUnitRef(oid, order_number=None)

A reference to a measurement unit definition (MeasurementUnit).

Parameters:
  • oid (str) – MeasurementUnit OID
  • order_numberOrderNumber for MeasurementUnitRef
build(builder)
class rwslib.builders.MetaDataVersion(oid, name, description=None, primary_formoid=None, default_matrix_oid=None, delete_existing=False, signature_prompt=None)

A metadata version (MDV) defines the types of study events, forms, item groups, and items that form the study data.

Parameters:
  • oid (str) – MDV OID
  • name (str) – Name for MDV
  • description (str) – Description for MDV
  • primary_formoid (str) – OID of Primary Form - Rave Specific Attribute
  • default_matrix_oid (str) – OID of Default Matrix - Rave Specific Attribute
  • delete_existing (bool) – Overwrite the previous version - Rave Specific Attribute
  • signature_prompt (str) – Prompt for Signature - Rave Specific Attribute
build(builder)

Build XML by appending to builder

class rwslib.builders.ODM(originator, description='', creationdatetime='2017-04-05T15:48:58', fileoid=None, filetype=None)

Models the ODM object

Parameters:
  • originator (str) – The organization that generated the ODM file.
  • description (str) – The sender should use the Description attribute to record any information that will help the receiver interpret the document correctly.
  • creationdatetime (str) – Time of creation of the file containing the document.
  • fileoid (str) – A unique identifier for this file.
  • filetype (str) – Snapshot means that the document contains only the current state of the data and metadata it describes, and no transactional history. A Snapshot document may include only one instruction per data point. For clinical data, TransactionType in a Snapshot file must either not be present or be Insert. Transactional means that the document may contain more than one instruction per data point. Use a Transactional document to send both what the current state of the data is, and how it came to be there.
FILETYPE_SNAPSHOT = 'Snapshot'
FILETYPE_TRANSACTIONAL = 'Transactional'
getroot()

Build XML object, return the root

class rwslib.builders.ODMElement

Base class for ODM XML element classes

add(*args)

Like call but adds a set of args

set_list_attribute(other, trigger_klass, property_name)

Used to set guard the setting of a list attribute, ensuring the same element is not added twice.

set_single_attribute(other, trigger_klass, property_name)

Used to set guard the setting of an attribute which is singular and can’t be set twice

class rwslib.builders.Protocol

The Protocol lists the kinds of study events that can occur within a specific version of a Study. All clinical data must occur within one of these study events.

build(builder)

Build XML by appending to builder

study_event_refs = None

Collection of StudyEventRef

class rwslib.builders.Question

A label shown to a human user when prompted to provide data for an item on paper or on a screen.

build(builder)

Build XML by appending to builder

Note

Questions can contain translations

translations = None

Collection of Translation for the Question

class rwslib.builders.RangeCheck(comparator, soft_hard)

Rangecheck in Rave relates to QueryHigh QueryLow and NonConformantHigh and NonComformantLow for other types of RangeCheck, need to use an EditCheck (part of Rave’s extensions to ODM)

Parameters:
  • comparator (str) – Comparator for RangeCheck (LT, LE, GT, GE, EQ, NE, IN, NOTIN)
  • soft_hard (str) – Soft or Hard range check (Soft, Hard)
build(builder)

Build XML by appending to builder

comparator

returns the comparator

soft_hard

returns the Soft or Hard range setting

class rwslib.builders.ReasonForChange(reason)

A user-supplied reason for a data change.

Parameters:reason (str) – Supplied Reason for change
build(builder)

Build XML by appending to builder

class rwslib.builders.Signature(signature_id=None, user_ref=None, location_ref=None, signature_ref=None, date_time_stamp=None)

An electronic signature applies to a collection of clinical data. This indicates that some user accepts legal responsibility for that data. See 21 CFR Part 11. The signature identifies the person signing, the location of signing, the signature meaning (via the referenced SignatureDef), the date and time of signing, and (in the case of a digital signature) an encrypted hash of the included data.

Parameters:
build(builder)

Build XML by appending to builder

signature_id

The ID for the Signature

Note

If a Signature element is contained within a Signatures element, the ID attribute is required.

class rwslib.builders.SignatureRef(oid)

Reference to a Signature

Parameters:oid (str) – OID for referenced Signature
build(builder)

Build XML by appending to builder

class rwslib.builders.Study(oid, project_type=None)

This element collects static structural information about an individual study.

Parameters:
  • oid (str) – Study OID
  • project_type (str) – Type of Project (Project or Global Library) - Rave Specific Attribute
GLOBAL_LIBRARY = 'GlobalLibrary Volume'
PROJECT = 'Project'
PROJECT_TYPES = ['Project', 'GlobalLibrary Volume']
build(builder)

Build XML by appending to builder

studyevent_defs = None

set of StudyEventDef for this Study element

class rwslib.builders.StudyEventData(study_event_oid, transaction_type='Update', study_event_repeat_key=None)

Models the ODM StudyEventData object

Parameters:
  • study_event_oid (str) – StudyEvent OID
  • transaction_type (str) – Transaction Type for Data (one of Insert, Update, Remove, Context)
  • study_event_repeat_key (int) – StudyEventRepeatKey for StudyEventData
ALLOWED_TRANSACTION_TYPES = ['Insert', 'Update', 'Remove', 'Context']
annotations = None

Annotation for Study Event Data - Not Supported by Rave

build(builder)

Build XML by appending to builder :Example: <StudyEventData StudyEventOID=”SCREENING” StudyEventRepeatKey=”1” TransactionType=”Update”>

forms = None

FormData part of Study Event Data

signature = None

Signature for Study Event Data

class rwslib.builders.StudyEventDef(oid, name, repeating, event_type, category=None, access_days=None, start_win_days=None, target_days=None, end_win_days=None, overdue_days=None, close_days=None)

A StudyEventDef packages a set of forms. Scheduled Study Events correspond to sets of forms that are expected to be collected for each subject as part of the planned visit sequence for the study. Unscheduled Study Events are designed to collect data that may or may not occur for any particular subject such as a set of forms that are completed for an early termination due to a serious adverse event.

Parameters:
  • oid (str) – OID for StudyEventDef
  • name (str) – Name for StudyEventDef
  • repeating (bool) – Is this a repeating StudyEvent?
  • event_type (str) – Type of StudyEvent (either Scheduled, Unscheduled, Common)
  • category (str) – Category attribute is typically used to indicate the study phase appropriate to this type of study event. Examples might include Screening, PreTreatment, Treatment, and FollowUp.
  • access_days (int) – The number of days before the Target date that the folder may be opened, viewed and edited from the Task List in Rave EDC. - Rave Specific Attribute
  • start_win_days (int) – The number of days before the Target date that is considered to be the ideal start-date for use of this folder. - Rave Specific Attribute
  • target_days (int) – The ideal number of days between Time Zero and the date of use for the folder. - Rave Specific Attribute
  • end_win_days (int) – The number of days after the Target date that is considered to be the ideal end date for use of this folder. - Rave Specific Attribute
  • overdue_days (int) – The number of days after the Target date at which point empty data points are marked overdue, and are displayed in the Task Summary in Rave EDC. - Rave Specific Attribute
  • close_days (int) – The number of days after the Target date at which point no new data may be entered into the folder. - Rave Specific Attribute
COMMON = 'Common'
SCHEDULED = 'Scheduled'
UNSCHEDULED = 'Unscheduled'
build(builder)

Build XML by appending to builder

class rwslib.builders.StudyEventRef(oid, order_number, mandatory)

A reference to a StudyEventDef as it occurs within a specific version of a Study. The list of StudyEventRef identifies the types of study events that are allowed to occur within the study. The StudyEventRef within a Protocol must not have duplicate StudyEventOIDs nor duplicate OrderNumbers.

Parameters:
  • oid (str) – StudyEventDef OID
  • order_number (int) – OrderNumber for the StudyEventRef within the Study
  • mandatory (bool) – Is this StudyEventDef Mandatory? (True|False)
build(builder)

Build XML by appending to builder

class rwslib.builders.SubjectData(site_location_oid, subject_key, subject_key_type='SubjectName', transaction_type='Update')

Models the ODM SubjectData and ODM SiteRef objects

Parameters:
  • site_location_oid (str) – SiteLocation OID
  • subject_key (str) – Value for SubjectKey
  • subject_key_type (str) – Specifier as to the type of SubjectKey (either SubjectName or SubjectUUID)
  • transaction_type (str) – Transaction Type for Data (one of Insert, Update, Upsert)
ALLOWED_TRANSACTION_TYPES = ['Insert', 'Update', 'Upsert']
annotations = None

collection of Annotation

audit_record = None

AuditRecord for SubjectData - Not Supported By Rave

build(builder)

Build XML by appending to builder

signature = None

Signature for SubjectData

study_events = None

collection of StudyEventData

class rwslib.builders.Symbol

A human-readable name for a MeasurementUnit.

build(builder)

Build XML by appending to builder

translations = None

Collection of TranslatedText

class rwslib.builders.TransactionalElement(transaction_type)

Models an ODM Element that is allowed a transaction type. Different elements have different allowed transaction types

ALLOWED_TRANSACTION_TYPES = []
transaction_type

returns the TransactionType attribute

class rwslib.builders.TranslatedText(text, lang=None)

Represents a language and a translated text for that language

Parameters:
  • text (str) – Content expressed in language designated by lang
  • lang (str) – Language code
build(builder)

Build XML by appending to builder

class rwslib.builders.UserRef(oid)

Reference to a User

Parameters:oid (str) – OID for referenced User
build(builder)

Build XML by appending to builder

rwslib.builders.bool_to_true_false(val)

Convert True/False to TRUE / FALSE

rwslib.builders.bool_to_yes_no(val)

Convert True/False to Yes/No

rwslib.builders.dt_to_iso8601(dt)

Turn a datetime into an ISO8601 formatted string

rwslib.builders.indent(elem, level=0)

Indent a elementree structure

rwslib.builders.make_element(builder, tag, content)

Make an element with this tag and text content

rwslib.builders.now_to_iso8601()

Returns NOW date/time as a UTC date/time formated as iso8601 string

class rwslib.builders.Annotation(annotation_id=None, seqnum=1, flags=None, comment=None, transaction_type=None)

A general note about clinical data. If an annotation has both a comment and flags, the flags should be related to the comment.

Note

Annotation is not supported by Medidata Rave

Parameters:
  • id (str or None) – ID for this Annotation (required if contained within an Annotations element)
  • seqnum (int) – SeqNum for Annotation
  • flags (Flag or list(Flag)) – one or more Flag for the Annotation
  • comment (Comment) – one or more Comment for the Annotation
  • transaction_typeTransactionType for Annotation (one of Insert, Update, Remove, Upsert, Context)
class rwslib.builders.AuditRecord(edit_point=None, used_imputation_method=None, identifier=None, include_file_oid=None)

An AuditRecord carries information pertaining to the creation, deletion, or modification of clinical data. This information includes who performed that action, and where, when, and why that action was performed.

Note

AuditRecord is supported only by ItemData in Rave

Parameters:
  • identifier (str) – Audit identifier
  • edit_point (str) – EditPoint attribute identifies the phase of data processing in which action occurred (Monitoring, DataManagement, DBAudit)
  • used_imputation_method (bool) – Indicates whether the action involved the use of a Method
  • include_file_oid (bool) – Include the FileOID in the AuditRecord
class rwslib.builders.BasicDefinitions

Container for MeasurementUnit

class rwslib.builders.CheckValue(value)

A value in a RangeCheck

Parameters:value (str) – Value for a RangeCheck
class rwslib.builders.ClinicalData(projectname, environment, metadata_version_oid='1')

Models the ODM ClinicalData object

Parameters:
  • projectname – Name of Project in Medidata Rave
  • environment – Rave Study Enviroment
  • metadata_version_oid – MetadataVersion OID
class rwslib.builders.CodeList(oid, name, datatype, sas_format_name=None)

Defines a discrete set of permitted values for an item.

Note

Equates to a Rave Dictionary

Note

Does not support ExternalCodeList

Parameters:
  • oid (str) – CodeList OID
  • name (str) – Name of CodeList
  • datatype (str) – DataType restricts the values that can appear in the CodeList whether internal or external (integer | float | text | string )
  • sas_format_name (str) – SASFormatName must be a legal SAS format for CodeList
class rwslib.builders.CodeListItem(coded_value, order_number=None, specify=False)

Defines an individual member value of a CodeList including display format. The actual value is given, along with a set of print/display-forms.

Parameters:
  • coded_value (str) – Coded Value for CodeListItem
  • order_number (int) – OrderNumber for the CodeListItem - Note: this is a Medidata Rave Extension, but upstream ODM has been updated to include the OrderNumber attribute
  • specify (bool) – Does this have a Specify? option? - Rave Specific Attribute
class rwslib.builders.CodeListRef(oid)

A reference to a CodeList definition.

Parameters:oid – OID for CodeList
class rwslib.builders.Comment(text=None, sponsor_or_site=None)

A free-text (uninterpreted) comment about clinical data. The comment may have come from the Sponsor or the clinical Site.

Note

Comment is not supported by Medidata Rave

Parameters:
  • text (str) – Text for Comment
  • sponsor_or_site (str) – Originator flag for Comment (either _Sponsor_ or _Site_)
class rwslib.builders.DateTimeStamp(date_time)

The date/time that the data entry, modification, or signature was performed. This applies to the initial occurrence of the action, not to subsequent transfers between computer systems.

class rwslib.builders.Decode

The displayed value relating to the CodedValue

class rwslib.builders.Flag(flag_type=None, flag_value=None)

A machine-processable annotation on clinical data.

Note

Flag is not supported by Rave

Parameters:
class rwslib.builders.FlagType(flag_type, codelist_oid=None)

The type of flag. This determines the purpose and semantics of the flag. Different applications are expected to be interested in different types of flags. The actual value must be a member of the referenced CodeList.

Note

FlagType is not supported by Rave

Parameters:flag_type – Type for Flag
class rwslib.builders.FlagValue(flag_value, codelist_oid=None)

The value of the flag. The meaning of this value is typically dependent on the associated FlagType. The actual value must be a member of the referenced CodeList.

Note

FlagValue is not supported by Rave

Parameters:flag_value – Value for Flag
class rwslib.builders.FormData(formoid, transaction_type=None, form_repeat_key=None)

Models the ODM FormData object

Parameters:
  • formoid (str) – FormDef OID
  • transaction_type (str) – Transaction Type for Data (one of Insert, Update)
  • form_repeat_key (str) – Repeat Key for FormData
class rwslib.builders.FormDef(oid, name, repeating=False, order_number=None, active=True, template=False, signature_required=False, log_direction='Portrait', double_data_entry='MustNotDDE', confirmation_style='NoLink', link_study_event_oid=None, link_form_oid=None)

A FormDef describes a type of form that can occur in a study.

Parameters:
  • oid (str) – OID for FormDef
  • name (str) – Name for FormDef
  • repeating (bool) – Is this a repeating Form?
  • order_number (int) – OrderNumber for the FormDef
  • active (bool) – Indicates that the form is available to end users when you publish and push the draft to Rave EDC - Rave Specific Attribute
  • template (bool) – Indicates that the form is a template form in Rave EDC - Rave Specific Attribute
  • signature_required (bool) – Select to ensure that the form requires investigator signature for all submitted data points - Rave Specific Attribute
  • log_direction (str) – Set the display mode of a form, (Landscape or Portrait) - Rave Specific Attribute
  • double_data_entry (str) – Indicates if the form is used to collect data in Rave Double Data Entry (DDE), (Always, Never or As Per Site) - Rave Specific Attribute
  • confirmation_style – Style of Confirmation, (None, NotLink, LinkNext or LinkCustom) - Rave Specific Attribute
  • link_study_event_oid – OID for StudyEvent target for Link - Rave Specific Attribute
  • link_form_oid – OID for FormRef target for Link - Rave Specific Attribute
class rwslib.builders.FormRef(oid, order_number, mandatory)

A reference to a FormDef as it occurs within a specific StudyEventDef . The list of FormRef identifies the types of forms that are allowed to occur within this type of study event. The FormRef within a single StudyEventDef must not have duplicate FormOIDs nor OrderNumbers.

Parameters:
  • oid (str) – Set the FormDef OID for the FormRef
  • order_number (int) – Define the OrderNumber for the FormRef within the containing StudyEventDef
  • mandatory (bool) – Is this Form Mandatory?
class rwslib.builders.GlobalVariables(protocol_name, name=None, description='')

GlobalVariables includes general summary information about the Study.

Note

Name and description are not important. protocol_name maps to the Rave project name

Parameters:
  • protocol_name (str) – Protocol Name
  • name (str) – Study Name
  • description (str) – Study Description
class rwslib.builders.ItemData(itemoid, value, specify_value=None, transaction_type=None, lock=None, freeze=None, verify=None)

Models the ODM ItemData object

Parameters:
  • itemoid (str) – OID for the matching ItemDef
  • value (str) – Value for the the ItemData
  • specify_value (str) – ‘If other, specify’ value - Rave specific attribute
  • transaction_type (str) – Transaction type for the data
  • lock (bool) – Lock the DataPoint? - Rave specific attribute
  • freeze (bool) – Freeze the DataPoint? - Rave specific attribute
  • verify (bool) – Verify the DataPoint? - Rave specific attribute
class rwslib.builders.ItemDef(oid, name, datatype, length=None, significant_digits=None, sas_field_name=None, sds_var_name=None, origin=None, comment=None, active=True, control_type=None, acceptable_file_extensions=None, indent_level=0, source_document_verify=False, default_value=None, sas_format=None, sas_label=None, query_future_date=False, visible=True, translation_required=False, query_non_conformance=False, other_visits=False, can_set_item_group_date=False, can_set_form_date=False, can_set_study_event_date=False, can_set_subject_date=False, visual_verify=False, does_not_break_signature=False, date_time_format=None, field_number=None, variable_oid=None)

An ItemDef describes a type of item that can occur within a study. Item properties include name, datatype, measurement units, range or codelist restrictions, and several other properties.

Parameters:
  • oid (str) – OID for ItemDef
  • name (str) – Name for ItemDef
  • datatype (str) – Datatype for ItemDef
  • length (int) – Max. Length of content expected in Item Value
  • significant_digits (int) – Max. Number of significant digits in Item Value
  • sas_field_name (str) – SAS Name for the ItemDef
  • sds_var_name (str) – SDS Variable Name
  • origin (str) – Origin for the Variable
  • comment (str) – Comment for the Variable
  • active (bool) – Is the Variable Active? - Rave Specific Attribute
  • control_type (ControlType) – Control Type for the Variable - Rave Specific Attribute
  • acceptable_file_extensions (str) – File extensions for File Upload Control (separated by a comma) - Rave Specific Attribute
  • indent_level (int) – Level of indentation of a field from the left-hand page margin. - Rave Specific Attribute
  • source_document_verify (bool) – Does this Variable need to be SDV’ed? - Rave Specific Attribute
  • default_value (str) – Value entered in this field is displayed as the default value in Rave EDC. - Rave Specific Attribute
  • sas_format (str) – SAS variable format of maximum 25 alphanumeric characters.
  • sas_label (str) – SAS label of maximum 256 alphanumeric characters.
  • query_future_date (bool) – Generates a query when the Rave EDC user enters a future date in the field. - Rave Specific Attribute
  • visible (bool) – Indicates that the field displays on the form when the version is pushed to Rave EDC. - Rave Specific Attribute
  • translation_required (bool) – Enables translation functionality for the selected field. - Rave Specific Attribute
  • query_non_conformance (bool) – Generates a query when the Rave EDC user enters data in a format other than what has been defined for the variable. - Rave Specific Attribute
  • other_visits (bool) – Display previous visit data - Rave Specific Attribute
  • can_set_item_group_date (bool) – If a form contains log fields, this parameter assigns the date entered into the field as the date for the record (log line) - Rave Specific Attribute
  • can_set_form_date (bool) – Observation Date of Form assigns the date entered into the field as the date for the form - Rave Specific Attribute
  • can_set_study_event_date (bool) – Observation Date of Folder assigns the date entered into the field as the date for the folder - Rave Specific Attribute
  • can_set_subject_date (bool) – Observation Date of Subject assigns the date entered into the field as the date for the Subject. - Rave Specific Attribute
  • visual_verify (bool) – This parameter sets the field as a Visual Verify field in Rave DDE - Rave Specific Attribute
  • does_not_break_signature (bool) – Indicates that the field (both derived and non-derived) does not participate in signature. - Rave Specific Attribute
  • date_time_format (str) – Displays text boxes for the user to enter the day, month, and year according to the specified variable format. - Rave Specific Attribute
  • field_number (str) – Number that displays to the right of a field label in Rave EDC to create a numbered list on the form. - Rave Specific Attribute
  • variable_oid – OID for Variable - Rave Specific Attribute
class rwslib.builders.ItemGroupData(transaction_type=None, item_group_repeat_key=None, whole_item_group=False, annotations=None)

Models the ODM ItemGroupData object.

Note

No name for the ItemGroupData element is required. This is built automatically by the form.

Parameters:
  • transaction_type (str) – TransactionType for the ItemGroupData
  • item_group_repeat_key (int) – RepeatKey for the ItemGroupData
  • whole_item_group (bool) – Is this the entire ItemGroupData, or just parts? - Rave specific attribute
  • annotations (list(Annotation) or Annotation) – Annotation for the ItemGroup - Not supported by Rave
class rwslib.builders.ItemGroupDef(oid, name, repeating=False, is_reference_data=False, sas_dataset_name=None, domain=None, origin=None, role=None, purpose=None, comment=None)

An ItemGroupDef describes a type of item group that can occur within a Study.

Parameters:
  • oid (str) – OID for ItemGroupDef
  • name (str) – Name for ItemGroupDef
  • repeating (bool) – Is this a repeating ItemDef?
  • is_reference_data (bool) – If IsReferenceData is Yes, this type of item group can occur only within a ReferenceData element. If IsReferenceData is No, this type of item group can occur only within a ClinicalData element. The default for this attribute is No.
  • sas_dataset_name (str) – SAS Dataset Name
  • domain (str) – Domain for Items within this ItemGroup
  • origin – Origin of data (eg CRF, eDT, Derived)
  • role – Role for the ItemGroup (eg Identifier, Topic, Timing, Qualifiers)
  • purpose – Purpose (eg Tabulation)
  • comment – Comment on the ItemGroup Contents
class rwslib.builders.ItemGroupRef(oid, order_number, mandatory=True)

A reference to an ItemGroupDef as it occurs within a specific FormDef. The list of ItemGroupRefs identifies the types of item groups that are allowed to occur within this type of form. The ItemGroupRefs within a single FormDef must not have duplicate ItemGroupOIDs nor OrderNumbers.

Parameters:
  • oid (str) – OID for the referenced ItemGroupDef
  • order_number (int) – OrderNumber for the ItemGroupRef
  • mandatory (bool) – Is this ItemGroupRef required?
class rwslib.builders.ItemRef(oid, order_number=None, mandatory=False, key_sequence=None, imputation_method_oid=None, role=None, role_codelist_oid=None)

A reference to an ItemDef as it occurs within a specific ItemGroupDef. The list of ItemRefs identifies the types of items that are allowed to occur within this type of item group.

Parameters:
  • oid (str) – OID for ItemDef
  • order_number (int) – OrderNumber for the ItemRef
  • mandatory (bool) – Is this ItemRef required?
  • key_sequence (int) – The KeySequence (if present) indicates that this item is a key for the enclosing item group. It also provides an ordering for the keys.
  • imputation_method_oid (str) – DEPRECATED
  • role (str) – Role name describing the use of this data item.
  • role_codelist_oid (str) – RoleCodeListOID may be used to reference a CodeList that defines the full set roles from which the Role attribute value is to be taken.
class rwslib.builders.LocationRef(oid)

Reference to a Location

Parameters:oid (str) – OID for referenced Location
class rwslib.builders.MdsolAttribute(namespace, name, value, transaction_type='Insert')

Rave Web Services element for holding Vendor Attributes

Note

This is Medidata Rave Specific Element

class rwslib.builders.MdsolCheckAction(variable_oid=None, field_oid=None, form_oid=None, folder_oid=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, check_action_type=None, check_string=None, check_options=None, check_script=None)

Check Action modeled after check action in Architect Loader spreadsheet.

Note

Do not use directly, use appropriate sub-class.

Note

This is a Medidata Rave Specific Element

Parameters:
  • variable_oid (str) – OID for the Variable that is the target of the CheckAction
  • field_oid (str) – OID for the Field that is the target of the CheckAction
  • form_oid (str) – OID for the Form that is the target of the CheckAction
  • folder_oid (str) – OID for the Folder that is the target of the CheckAction
  • record_position (int) – Record Position for the CheckAction
  • form_repeat_number (int) – Form Repeat Number for the CheckAction
  • folder_repeat_number (int) – Folder Repeat Number for the CheckAction
  • check_string (str) – CheckAction String
  • check_options (str) – CheckAction Options
  • check_script (str) – CheckAction Script
class rwslib.builders.MdsolCheckStep(variable_oid=None, data_format=None, form_oid=None, folder_oid=None, field_oid=None, static_value=None, function=None, custom_function=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, logical_record_position=None)

A check step modeled after the Architect Loader definition.

Note

Do not use directly, use appropriate subclasses.

Note

this is a Medidata Rave Specific Element

Parameters:
  • variable_oid (str) – OID for Variable targeted by CheckStep
  • data_format (str) – Format for Value
  • form_oid (str) – OID for Form
  • folder_oid (str) – OID for Folder
  • field_oid (str) – OID for Field
  • custom_function (str) – Name of Custom Function for CheckStep
  • record_position (int) – Record Position - If the field is a standard (non-log) field, enter 0
  • form_repeat_number (int) – Repeat Number for Form for CheckStep
  • folder_repeat_number (int) – Repeat Number for Folder for CheckStep
  • logical_record_position (LogicalRecordPositionType) – LRP value for the CheckStep
  • static_value (str) – Static Value for CheckStep
  • function (StepType) – Check Function for CheckStep
class rwslib.builders.MdsolConfirmationMessage(message, lang=None)

Form is saved confirmation message

Note

this is a Medidata Rave Specific Element

Parameters:
  • message (str) – Content of confirmation message
  • lang (str) – Language declaration for Message
class rwslib.builders.MdsolCustomFunctionDef(oid, code, language='C#')

Extension for Rave Custom functions

Note

This is a Medidata Rave Specific Extension

Note

VB was deprecated in later Rave versions.

Parameters:
  • oid (str) – OID for CustomFunction
  • code (str) – Content for the CustomFunction
  • language (str) – Language for the CustomFunction
class rwslib.builders.MdsolDerivationDef(oid, active=True, bypass_during_migration=False, needs_retesting=False, variable_oid=None, field_oid=None, form_oid=None, folder_oid=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, logical_record_position=None, all_variables_in_folders=None, all_variables_in_fields=None)

Extension for Rave derivations

Note

This is a Medidata Rave Specific Extension

Parameters:
  • oid (str) – OID for Derivation
  • active (bool) – Is this Derivation Active?
  • bypass_during_migration (bool) – Bypass this Derivation on Study Migration?
  • needs_retesting (bool) – Does this Derivation need retesting?
  • variable_oid (str) – OID for target variable (eg OID for ItemDef)
  • field_oid (str) – OID for target field (eg OID for ItemDef)
  • form_oid (str) – OID for Form for target of Derivation (eg OID for FormDef)
  • folder_oid (str) – OID for Folder for target of Derivation (eg OID for StudyEventDef)
  • record_position (int) – Record Position for the Derivation
  • form_repeat_number (int) – Form Repeat Number for the CheckAction
  • folder_repeat_number (int) – Folder Repeat Number for the CheckAction
  • logical_record_position (LogicalRecordPositionType) –
  • all_variables_in_folders (bool) – Evaluates the derivation according to any field using the specified variable within a specific folder.
  • all_variables_in_fields (bool) – Evaluates the derivation according to any field using the specified variable across the whole subject.
class rwslib.builders.MdsolDerivationStep(variable_oid=None, data_format=None, form_oid=None, folder_oid=None, field_oid=None, value=None, function=None, custom_function=None, record_position=None, form_repeat_number=None, folder_repeat_number=None, logical_record_position=None)

A derivation step modeled after the Architect Loader definition.

Note

Do not use directly, use appropriate subclasses.

Note

this is a Medidata Rave Specific Element

Parameters:
  • variable_oid (str) – OID for Variable targeted by Derivation
  • data_format (str) – Format for Value
  • form_oid (str) – OID for Form
  • folder_oid (str) – OID for Folder
  • field_oid (str) – OID for Field
  • value (str) – Value for DerivationStep
  • custom_function (str) – Name of Custom Function for DerivationStep
  • record_position (int) – Record Position - If the field is a standard (non-log) field, enter 0
  • form_repeat_number (int) – Repeat Number for Form for DerivationStep
  • folder_repeat_number (int) – Repeat Number for Folder for DerivationStep
  • logical_record_position (LogicalRecordPositionType) – LRP value for the DerivationStep
class rwslib.builders.MdsolEditCheckDef(oid, active=True, bypass_during_migration=False, needs_retesting=False)

Extension for Rave edit checks

Note

This is a Medidata Rave Specific Extension

Parameters:
  • oid (str) – EditCheck OID
  • active (bool) – Is this EditCheck active?
  • bypass_during_migration (bool) – Bypass this EditCheck during a Study Migration
  • needs_retesting (bool) – Does this EditCheck need Retesting?
class rwslib.builders.MdsolEntryRestriction(rolename)

EntryRestriction for FormDef and ItemDef

Note

This is Medidata Rave Specific Element

class rwslib.builders.MdsolHeaderText(content, lang=None)

Header text for ItemDef when shown in grid

Note

this is a Medidata Rave Specific Element

Parameters:
  • content (str) – Content for the Header Text
  • lang (str) – Language specification for Header
class rwslib.builders.MdsolHelpText(lang, content)

Help element for FormDef and ItemDef

Note

This is Medidata Rave Specific Element

class rwslib.builders.MdsolLabelDef(oid, name, field_number=None)

Label definition

Note

This is a Medidata Rave Specific Element

Parameters:
  • oid – OID for the MdsolLabelDef
  • name – Name for the MdsolLabelDef
  • field_number (int) – FieldNumber for the MdsolLabelDef
class rwslib.builders.MdsolLabelRef(oid, order_number)

A reference to a label on a form

Note

This is Medidata Rave Specific Element

class rwslib.builders.MdsolQuery(value=None, query_repeat_key=None, recipient=None, status=None, requires_response=None, response=None)

MdsolQuery extension element for Queries at item level only

Note

This is a Medidata Rave specific extension

Parameters:
  • value (str) – Query Value
  • query_repeat_key (int) – Repeat key for Query
  • recipient (str) – Recipient for Query
  • status (QueryStatusType) – Query status
  • requires_response (bool) – Does this Query need a response?
  • response (str or None) – Query response (if any)
class rwslib.builders.MdsolReviewGroup(name)

Maps to Rave review groups for an ItemDef

Note

this is a Medidata Rave Specific Element

Parameters:name (str) – Name for the MdsolReviewGroup
class rwslib.builders.MdsolViewRestriction(rolename)

ViewRestriction for FormDef and ItemDef

Note

This is Medidata Rave Specific Element

class rwslib.builders.MeasurementUnit(oid, name, unit_dictionary_name=None, constant_a=1, constant_b=1, constant_c=0, constant_k=0, standard_unit=False)

The physical unit of measure for a data item or value. The meaning of a MeasurementUnit is determined by its Name attribute.

Parameters:
  • oid (str) – MeasurementUnit OID
  • name (str) – Maps to Coded Unit within unit dictionary entries in Rave.
  • unit_dictionary_name (str) – Maps to unit dictionary Name in Rave. - Rave specific attribute
  • constant_a (int) – Maps to the unit dictionary Constant A in Rave. - Rave specific attribute
  • constant_b (int) – Maps to the unit dictionary Constant B in Rave. - Rave specific attribute
  • constant_c (int) – Maps to the unit dictionary Constant C in Rave. - Rave specific attribute
  • constant_k (int) – Maps to the unit dictionary Constant K in Rave. - Rave specific attribute
  • standard_unit (bool) – Yes = Standard checked within the unit dictionary entry in Rave. No = Standard unchecked within the unit dictionary entry in Rave. - Rave specific attribute
class rwslib.builders.MeasurementUnitRef(oid, order_number=None)

A reference to a measurement unit definition (MeasurementUnit).

Parameters:
  • oid (str) – MeasurementUnit OID
  • order_numberOrderNumber for MeasurementUnitRef
class rwslib.builders.MetaDataVersion(oid, name, description=None, primary_formoid=None, default_matrix_oid=None, delete_existing=False, signature_prompt=None)

A metadata version (MDV) defines the types of study events, forms, item groups, and items that form the study data.

Parameters:
  • oid (str) – MDV OID
  • name (str) – Name for MDV
  • description (str) – Description for MDV
  • primary_formoid (str) – OID of Primary Form - Rave Specific Attribute
  • default_matrix_oid (str) – OID of Default Matrix - Rave Specific Attribute
  • delete_existing (bool) – Overwrite the previous version - Rave Specific Attribute
  • signature_prompt (str) – Prompt for Signature - Rave Specific Attribute
class rwslib.builders.ODM(originator, description='', creationdatetime='2017-04-05T15:48:58', fileoid=None, filetype=None)

Models the ODM object

Parameters:
  • originator (str) – The organization that generated the ODM file.
  • description (str) – The sender should use the Description attribute to record any information that will help the receiver interpret the document correctly.
  • creationdatetime (str) – Time of creation of the file containing the document.
  • fileoid (str) – A unique identifier for this file.
  • filetype (str) – Snapshot means that the document contains only the current state of the data and metadata it describes, and no transactional history. A Snapshot document may include only one instruction per data point. For clinical data, TransactionType in a Snapshot file must either not be present or be Insert. Transactional means that the document may contain more than one instruction per data point. Use a Transactional document to send both what the current state of the data is, and how it came to be there.
class rwslib.builders.ODMElement

Base class for ODM XML element classes

class rwslib.builders.Protocol

The Protocol lists the kinds of study events that can occur within a specific version of a Study. All clinical data must occur within one of these study events.

class rwslib.builders.Question

A label shown to a human user when prompted to provide data for an item on paper or on a screen.

class rwslib.builders.RangeCheck(comparator, soft_hard)

Rangecheck in Rave relates to QueryHigh QueryLow and NonConformantHigh and NonComformantLow for other types of RangeCheck, need to use an EditCheck (part of Rave’s extensions to ODM)

Parameters:
  • comparator (str) – Comparator for RangeCheck (LT, LE, GT, GE, EQ, NE, IN, NOTIN)
  • soft_hard (str) – Soft or Hard range check (Soft, Hard)
class rwslib.builders.ReasonForChange(reason)

A user-supplied reason for a data change.

Parameters:reason (str) – Supplied Reason for change
class rwslib.builders.Signature(signature_id=None, user_ref=None, location_ref=None, signature_ref=None, date_time_stamp=None)

An electronic signature applies to a collection of clinical data. This indicates that some user accepts legal responsibility for that data. See 21 CFR Part 11. The signature identifies the person signing, the location of signing, the signature meaning (via the referenced SignatureDef), the date and time of signing, and (in the case of a digital signature) an encrypted hash of the included data.

Parameters:
class rwslib.builders.SignatureRef(oid)

Reference to a Signature

Parameters:oid (str) – OID for referenced Signature
class rwslib.builders.Study(oid, project_type=None)

This element collects static structural information about an individual study.

Parameters:
  • oid (str) – Study OID
  • project_type (str) – Type of Project (Project or Global Library) - Rave Specific Attribute
class rwslib.builders.StudyEventData(study_event_oid, transaction_type='Update', study_event_repeat_key=None)

Models the ODM StudyEventData object

Parameters:
  • study_event_oid (str) – StudyEvent OID
  • transaction_type (str) – Transaction Type for Data (one of Insert, Update, Remove, Context)
  • study_event_repeat_key (int) – StudyEventRepeatKey for StudyEventData
class rwslib.builders.StudyEventDef(oid, name, repeating, event_type, category=None, access_days=None, start_win_days=None, target_days=None, end_win_days=None, overdue_days=None, close_days=None)

A StudyEventDef packages a set of forms. Scheduled Study Events correspond to sets of forms that are expected to be collected for each subject as part of the planned visit sequence for the study. Unscheduled Study Events are designed to collect data that may or may not occur for any particular subject such as a set of forms that are completed for an early termination due to a serious adverse event.

Parameters:
  • oid (str) – OID for StudyEventDef
  • name (str) – Name for StudyEventDef
  • repeating (bool) – Is this a repeating StudyEvent?
  • event_type (str) – Type of StudyEvent (either Scheduled, Unscheduled, Common)
  • category (str) – Category attribute is typically used to indicate the study phase appropriate to this type of study event. Examples might include Screening, PreTreatment, Treatment, and FollowUp.
  • access_days (int) – The number of days before the Target date that the folder may be opened, viewed and edited from the Task List in Rave EDC. - Rave Specific Attribute
  • start_win_days (int) – The number of days before the Target date that is considered to be the ideal start-date for use of this folder. - Rave Specific Attribute
  • target_days (int) – The ideal number of days between Time Zero and the date of use for the folder. - Rave Specific Attribute
  • end_win_days (int) – The number of days after the Target date that is considered to be the ideal end date for use of this folder. - Rave Specific Attribute
  • overdue_days (int) – The number of days after the Target date at which point empty data points are marked overdue, and are displayed in the Task Summary in Rave EDC. - Rave Specific Attribute
  • close_days (int) – The number of days after the Target date at which point no new data may be entered into the folder. - Rave Specific Attribute
class rwslib.builders.StudyEventRef(oid, order_number, mandatory)

A reference to a StudyEventDef as it occurs within a specific version of a Study. The list of StudyEventRef identifies the types of study events that are allowed to occur within the study. The StudyEventRef within a Protocol must not have duplicate StudyEventOIDs nor duplicate OrderNumbers.

Parameters:
  • oid (str) – StudyEventDef OID
  • order_number (int) – OrderNumber for the StudyEventRef within the Study
  • mandatory (bool) – Is this StudyEventDef Mandatory? (True|False)
class rwslib.builders.SubjectData(site_location_oid, subject_key, subject_key_type='SubjectName', transaction_type='Update')

Models the ODM SubjectData and ODM SiteRef objects

Parameters:
  • site_location_oid (str) – SiteLocation OID
  • subject_key (str) – Value for SubjectKey
  • subject_key_type (str) – Specifier as to the type of SubjectKey (either SubjectName or SubjectUUID)
  • transaction_type (str) – Transaction Type for Data (one of Insert, Update, Upsert)
class rwslib.builders.Symbol

A human-readable name for a MeasurementUnit.

class rwslib.builders.TransactionalElement(transaction_type)

Models an ODM Element that is allowed a transaction type. Different elements have different allowed transaction types

class rwslib.builders.TranslatedText(text, lang=None)

Represents a language and a translated text for that language

Parameters:
  • text (str) – Content expressed in language designated by lang
  • lang (str) – Language code
class rwslib.builders.UserRef(oid)

Reference to a User

Parameters:oid (str) – OID for referenced User

rwslib.rws_requests

class rwslib.rws_requests.StudyDatasetRequest(project_name, environment_name, dataset_type='regular', start=None, rawsuffix=None, formoid=None, versionitem=None, codelistsuffix=None, decodesuffix=None, stdsuffix=None)

Return the text of the full datasets listing as an ODM string.

class rwslib.rws_requests.SubjectDatasetRequest(project_name, environment_name, subjectkey, dataset_type='regular', start=None, rawsuffix=None, formoid=None, versionitem=None, codelistsuffix=None, decodesuffix=None, stdsuffix=None)

Return the text of the full datasets for a version as an ODM string. By supplying formoid, will be filtered to just that formoid data

class rwslib.rws_requests.VersionDatasetRequest(project_name, environment_name, version_oid, dataset_type='regular', start=None, rawsuffix=None, formoid=None, versionitem=None, codelistsuffix=None, decodesuffix=None, stdsuffix=None)

Return the text of the full datasets for a version as an ODM string. By supplying formoid, will be filtered to just that formoid data

class rwslib.rws_requests.ConfigurableDatasetRequest(dataset_name, dataset_format='', params={})

Create a new Configurable Dataset Request :param dataset_name: Name for the dataset :type dataset_name: str :param dataset_format: Format for the dataset :type dataset_format: str :param params: set of parameters to pass to URL :type params: dict

rwslib.rwsobjects

class rwslib.rwsobjects.ODMDoc(xml)

A base ODM document

class rwslib.rwsobjects.RWSResponse(xml)

Parses messages of the form:

<Response ReferenceNumber="82e942b0-48e8-4cf4-b299-51e2b6a89a1b"
    InboundODMFileOID=""
    IsTransactionSuccessful="1"
    SuccessStatistics="Rave objects touched: Subjects=0; Folders=0; Forms=0; Fields=0; LogLines=0" NewRecords="">
</Response>
class rwslib.rwsobjects.RWSException(msg, rws_error)

RWS Exception. Usual to attach the error response object

class rwslib.rwsobjects.RWSError(xml)

Extends ODMDoc, inheriting attributes like filetype, creationdatetime etc.

Parses XML of the form:

<?xml version="1.0" encoding="utf-8"?>
<ODM xmlns:mdsol="http://www.mdsol.com/ns/odm/metadata"
     FileType="Snapshot"
     CreationDateTime="2013-04-08T10:28:49.578-00:00"
     FileOID="4d13722a-ceb6-4419-a917-b6ad5d0bc30e"
     ODMVersion="1.3"
     mdsol:ErrorDescription="Incorrect login and password combination. [RWS00008]"
     xmlns="http://www.cdisc.org/ns/odm/v1.3" />
class rwslib.rwsobjects.RWSErrorResponse(xml)

Parses messages of the form:

<Response
    ReferenceNumber="0b47fe86-542f-4070-9e7d-16396a5ef08a"
    InboundODMFileOID="Not Supplied"
    IsTransactionSuccessful="0"
    ReasonCode="RWS00092"
    ErrorClientResponseMessage="CRF version not found">
</Response>
class rwslib.rwsobjects.RWSPostResponse(xml)

Parses responses from PostODMClinicalData messages with the format:

<Response ReferenceNumber="82e942b0-48e8-4cf4-b299-51e2b6a89a1b"
          InboundODMFileOID=""
          IsTransactionSuccessful="1"
          SuccessStatistics="Rave objects touched: Subjects=0; Folders=0; Forms=0; Fields=0; LogLines=0" NewRecords=""
          SubjectNumberInStudy="1103" SubjectNumberInStudySite="55">
</Response>
class rwslib.rwsobjects.RWSStudies(xml)

Represents a list of studies. Extends the list class and adds a couple of extra properties:

<ODM FileType="Snapshot" FileOID="767a1f8b-7b72-4d12-adbe-37d4d62ba75e"
     CreationDateTime="2013-04-08T10:02:17.781-00:00"
     ODMVersion="1.3"
     xmlns:mdsol="http://www.mdsol.com/ns/odm/metadata"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     xmlns="http://www.cdisc.org/ns/odm/v1.3">
     <Study OID="Fixitol(Dev)">
        <GlobalVariables>
              <StudyName>Fixitol (Dev)</StudyName>
              <StudyDescription/>
              <ProtocolName>Fixitol</ProtocolName>
        </GlobalVariables>
     </Study>
     <Study OID="IANTEST(Prod)">
        <GlobalVariables>
              <StudyName>IANTEST</StudyName>
              <StudyDescription/>
              <ProtocolName>IANTEST</ProtocolName>
        </GlobalVariables>
     </Study>
</ODM>
class rwslib.rwsobjects.RWSSubjects(xml)

Represents a list of subjects:

<ODM FileType="Snapshot"
     FileOID="770f1758-db33-4ab2-af72-38db863734aa"
     CreationDateTime="2013-04-08T14:08:06.875-00:00"
     ODMVersion="1.3">

     <ClinicalData StudyOID="Fixitol(Dev)" MetaDataVersionOID="1111">
        <SubjectData SubjectKey="000001">
           <SiteRef LocationOID="BP001"/>
           <mdsol:Link xlink:type="simple" xlink:href="http://innovate.mdsol.com/MedidataRAVE/HandleLink.aspx?page=SubjectPage.aspx?ID=849" />
        </SubjectData>
     </ClinicalData>

     <ClinicalData StudyOID="Fixitol(Dev)" MetaDataVersionOID="1111">
         <SubjectData SubjectKey="1111">
            <SiteRef LocationOID="335566"/>
            <mdsol:Link xlink:type="simple" xlink:href="http://innovate.mdsol.com/MedidataRAVE/HandleLink.aspx?page=SubjectPage.aspx?ID=849" />
         </SubjectData>
     </ClinicalData>
</ODM>
class rwslib.rwsobjects.RWSSubjectListItem

Parses response of Subject List request:

<ClinicalData StudyOID="Fixitol(Dev)" MetaDataVersionOID="1111">
 <SubjectData SubjectKey="1111">
    <SiteRef LocationOID="335566"/>
 </SubjectData>
</ClinicalData>

Optionally ClinicalData may include status:

<SubjectData SubjectKey="1111" mdsol:Overdue="No"
          mdsol:Touched="Yes"
          mdsol:Empty="No"
          mdsol:Incomplete="No"
          mdsol:NonConformant="No"
          mdsol:RequiresSecondPass="No"
          mdsol:RequiresReconciliation="No"
          mdsol:RequiresVerification="No"
          mdsol:Verified="No"
          mdsol:Frozen="No"
          mdsol:Locked="No"
          mdsol:RequiresReview="No"
          mdsol:PendingReview="No"
          mdsol:Reviewed="No"
          mdsol:RequiresAnswerQuery="No"
          mdsol:RequiresPendingCloseQuery="No"
          mdsol:RequiresCloseQuery="No"
          mdsol:StickyPlaced="No"
          mdsol:Signed="No"
          mdsol:SignatureCurrent="No"
          mdsol:RequiresTranslation="No"
          mdsol:RequiresCoding="No"
          mdsol:RequiresPendingAnswerQuery="No"
          mdsol:RequiresSignature="No"
          mdsol:ReadyForFreeze="No"
          mdsol:ReadyForLock="Yes">

The SubjectKey can be either a Subject ID or a UUID depending on the value of SubjectKeyType:

<ClinicalData StudyOID="Fixitol(Dev)" MetaDataVersionOID="1111">
 <SubjectData SubjectKey="EC82F1AB-D463-4930-841D-36FC865E63B2" mdsol:SubjectName="1" mdsol:SubjectKeyType="SubjectUUID">
    <SiteRef LocationOID="335566"/>
 </SubjectData>
</ClinicalData>

May include links:

<ClinicalData StudyOID="Fixitol(Dev)" MetaDataVersionOID="1111">
 <SubjectData SubjectKey="1111">
    <SiteRef LocationOID="335566"/>
    <mdsol:Link xlink:type="simple" xlink:href="http://innovate.mdsol.com/MedidataRAVE/HandleLink.aspx?page=SubjectPage.aspx?ID=849" />
 </SubjectData>
</ClinicalData>

The ODM message has a ClinicalData element with a single SubjectData and SiteRef elements nested within. I collapse into a single object

class rwslib.rwsobjects.RWSStudyMetadataVersions(xml)

Parses responses from MetaDataVersions request:

<ODM ODMVersion="1.3" Granularity="Metadata" FileType="Snapshot" FileOID="d26b4d33-376d-4037-9747-684411190179" CreationDateTime=" 2013-04-08T01:29:13 " xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:mdsol="http://www.mdsol.com/ns/odm/metadata">
    <Study OID="IANTEST">
        <GlobalVariables>
            <StudyName>IANTEST</StudyName>
            <StudyDescription></StudyDescription>
            <ProtocolName>IANTEST</ProtocolName>
        </GlobalVariables>
        <MetaDataVersion OID="1203" Name="Webservice Outbound" />
        <MetaDataVersion OID="1195" Name="JC_Demo_Draft1" />
        <MetaDataVersion OID="1165" Name="Initial" />
    </Study>
</ODM>
class rwslib.rwsobjects.MetaDataVersion

<MetaDataVersion OID=”1203” Name=”Webservice Outbound”/>

rwslib.rws_requests.biostats_gateway

class rwslib.rws_requests.biostats_gateway.CVMetaDataRequest(project_name, environment_name, versionitem=None, rawsuffix=None, codelistsuffix=None, decodesuffix=None)

Return Clinical View Metadata as ODM string

class rwslib.rws_requests.biostats_gateway.FormDataRequest(project_name, environment_name, dataset_type, form_oid, start=None, dataset_format='csv')

Return CV Form Data as CSV or XML

class rwslib.rws_requests.biostats_gateway.ProjectMetaDataRequest(project_name, dataset_format='csv')

Return Metadata for Clinical Views in CSV or XML fornat for a Project

class rwslib.rws_requests.biostats_gateway.ViewMetaDataRequest(view_name, dataset_format='csv')

Return Metadata for Clinical Views in CSV fornat for a single View

class rwslib.rws_requests.biostats_gateway.CommentDataRequest(project_name, environment_name, dataset_format='csv')

Return Comments from Rave as CSV or XML

class rwslib.rws_requests.biostats_gateway.ProtocolDeviationsRequest(project_name, environment_name, dataset_format='csv')

Retrieve Protocol Deviation Information from Rave

class rwslib.rws_requests.biostats_gateway.DataDictionariesRequest(project_name, environment_name, dataset_format='csv')

Retrieve Data Dictionaries from Rave

rwslib.rws_requests.odm_adapter

class rwslib.rws_requests.odm_adapter.AuditRecordsRequest(project_name, environment_name, startid=1, per_page=100)

Clinical Audit Records Dataset

class rwslib.rws_requests.odm_adapter.VersionFoldersRequest(project_name, environment_name)

Identify all folders in use in study

class rwslib.rws_requests.odm_adapter.SitesMetadataRequest(project_name=None, environment_name=None)

List all sites in a study along with their StudyVersions

class rwslib.rws_requests.odm_adapter.UsersRequest(project_name, environment_name, location_oid=None)

Return list of users for study (can be filtered by location)

class rwslib.rws_requests.odm_adapter.SignatureDefinitionsRequest(project_name)

Return signature definitions for all versions of the study