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.ActionType

CheckAction types Applies to a CheckAction

class rwslib.builders.Address(street_names=None, city=None, state_prov=None, country=None, postal_code=None, other_text=None)

The user’s postal address.

Parameters:
  • street_names (list(Address)) – User street names
  • city (City) – User City
  • state_prov (StateProv) – User State or Provence
  • country (Country) – User City
  • postal_code (PostalCode) – User City
  • other_text (OtherText) – User Other Text
class rwslib.builders.AdminData(study_oid=None)

Administrative information about users, locations, and electronic signatures.

Parameters:study_oid (str) – OID pointing to the StudyDef
class rwslib.builders.Alias(context, name)
An Alias provides an additional name for an element.
The Context attribute specifies the application domain in which this additional name is relevant.
Parameters:
  • context (str) – Context attribute specifies the application domain
  • name (str) – Name
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.Annotations(annotations=[])

Groups Annotation elements referenced by ItemData[TYPE] elements.

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.City(text)

The city name part of a user’s postal address.

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

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.ControlType

CRF Control Type Enumeration Applies to a ItemDef

class rwslib.builders.Country(country_code)

The country name part of a user’s postal address. This must be represented by an ISO 3166 two-letter country code.

class rwslib.builders.DataType

ODM Data Types

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.DisplayName(text)

A short displayable name for the user.

class rwslib.builders.Email(text)

The user’s email address.

class rwslib.builders.FirstName(text)

The user’s initial given name or all given names.

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.FullName(text)

The user’s full formal name.

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.GranularityType

ODM Granularity Type Enumeration Applies to a ODM

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(itemgroupoid=None, 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.LastName(text)

The user’s surname (family name).

class rwslib.builders.LastUpdateMixin

Mixin to add MODM capabilities to Instance types

Note

This is Rave Specific (MODM)

class rwslib.builders.Location(oid, name, location_type=None, metadata_versions=None)

A physical location – typically a clinical research site or a sponsor’s office.

Parameters:
  • oid (str) – OID for the Location, referenced in LocationRef
  • name (str) – Name for the Location
  • location_type (rwslib.builder_constants.LocationType) – Type for this Location
  • metadata_versions (list(MetaDataVersionRef)) – The MetaDataVersionRef for this Location
class rwslib.builders.LocationRef(oid)

Reference to a Location

Parameters:oid (str) – OID for referenced Location
class rwslib.builders.LocationType

Location Type Enumeration Applies to a Location

class rwslib.builders.LogicalRecordPositionType

Logical Record Position (LRP) Type Enumeration Applies to a MdsolDerivationDef, MdsolDerivationStep, MdsolCheckStep

class rwslib.builders.LoginName(text)

The user’s login identification.

class rwslib.builders.MODMAttribute(attribute, value)

A Medidata-ODM specific attribute Mixin for ODM Elements

Note

This is Rave Specific (MODM)

Define a new MODMAttribute

Parameters:
  • attribute (str) – Name of the Attribute
  • value (Union[datetime, bool, str]) – Value for the attribute
class rwslib.builders.MODMExtensionRegistry

A registry of MODM extension Elements

class rwslib.builders.MODMMixin

Mixin to add MODM capabilities to Instance types

Note

This is Rave Specific (MODM)

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.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
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.MetaDataVersionRef(study_oid, metadata_version_oid, effective_date)
A reference to a MetaDataVersion used at the containing Location.
The EffectiveDate expresses the fact that the metadata used at a location can vary over time.
Parameters:
  • study_oid (str) – References the Study that uses this metadata version.
  • metadata_version_oid (str) – References the rwslib.builders.MetaDataVersion (within the above Study).
  • effective_date (datetime.datetime) – Effective Date for this version and Site
class rwslib.builders.MilestoneMixin

Add a Subject Milestone to the element, rendered as Annotation/Flag in the output

Note

This is MODM Rave peculiar

class rwslib.builders.ODM(originator, description='', creationdatetime=None, fileoid=None, filetype=None, granularity=<GranularityType.AllClinicalData: 'AllClinicalData'>, source_system=None, source_system_version=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.Organization(text)

The user’s organization.

class rwslib.builders.OtherText(text)

Any other text needed as part of a user’s postal address.

class rwslib.builders.Phone(text)

The user’s voice phone number.

class rwslib.builders.PostalCode(text)

The postal code part of a user’s postal address.

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.ProtocolDeviationStatus

Protocol Deviation Status Enumeration Applies to a MdsolProtocolDeviation

class rwslib.builders.QueryStatusType

MdsolQuery action type Applies to a MdsolQuery

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.RangeCheckComparatorType

Range Check Enumeration Applies to a RangeCheck

class rwslib.builders.RangeCheckType

Range Check Type Enumeration Applies to a RangeCheck

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.SimpleChildElement(text)

Generic Element, for elements we’re not ready to flesh out in the builders

class rwslib.builders.SiteRef(oid)

Reference to a Location The default value is SiteName, and the value SiteUUID implies that the LocationOID .. note:: The mdsol:LocationOIDType attribute should be used to indicate the type of LocationOID

Parameters:oid (str) – OID for referenced Location
class rwslib.builders.SourceID(source_id)
Information that identifies the source of the data within an originating system.
It is only meaningful within the context of that system.
class rwslib.builders.StateProv(text)

The state or province name part of a user’s postal address.

class rwslib.builders.StepType

Edit/Derivation step types Applies to a MdsolCheckStep, MdsolDerivationStep

class rwslib.builders.StreetName(text)

The street address part of a user’s postal address.

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.User(oid, user_type=None, login_name=None, display_name=None, full_name=None, first_name=None, last_name=None, organisation=None, addresses=[], emails=[], phones=[], locations=[])
Information about a specific user of a clinical data collection system. This may be an investigator, a CRA, or
data management staff. Study subjects are not users in this sense.
Parameters:
class rwslib.builders.UserRef(oid)

Reference to a User

Parameters:oid (str) – OID for referenced User
class rwslib.builders.UserType

User Type Enumeration Applies to a 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