Class Reference for Builders¶
Builders provide a way to construct an ODM XML document from Python object.
Note
Any Class with the Prefix Mdsol represents a Medidata Rave specific extension
Metadata Builders¶
Metadata Builders provide an API for creating ODM metadata elements
- class rwslib.builders.metadata.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.metadata.BasicDefinitions¶
Container for
MeasurementUnit- measurement_units¶
Collection of
MeasurementUnit
- class rwslib.builders.metadata.CheckValue(value)¶
A value in a
RangeCheck- Parameters:
value (str) – Value for a
RangeCheck
- class rwslib.builders.metadata.CodeList(oid, name, datatype, sas_format_name=None)¶
Defines a discrete set of permitted values for an item.
Note
Equates to a Rave Dictionary
Does not support ExternalCodeList
- Parameters:
oid (str) – CodeList OID
name (str) – Name of CodeList
datatype (DataType) – 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
- codelist_items¶
Collection of
CodeListItem
- class rwslib.builders.metadata.CodeListItem(coded_value, order_number=None, specify=False)¶
Defines an individual member value of a
CodeListincluding 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) –
OrderNumberfor the CodeListItem - Note: this is a Medidata Rave Extension, but upstream ODM has been updated to include the OrderNumber attributespecify (bool) – Does this have a Specify? option? - Rave Specific Attribute
- class rwslib.builders.metadata.CodeListRef(oid)¶
A reference to a
CodeListdefinition.- Parameters:
oid – OID for
CodeList
- class rwslib.builders.metadata.Decode¶
The displayed value relating to the CodedValue
- translations¶
Collection of
Translationfor the Decode
- class rwslib.builders.metadata.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
StudyEventtarget for Link - Rave Specific Attributelink_form_oid – OID for
FormReftarget for Link - Rave Specific Attribute
- entry_restrictions¶
Collection of
EntryRestrictionfor Form - Rave Specific Attribute
- helptexts¶
Collection of
HelpTextfor Form (Cardinality not clear) - Rave Specific Attribute
- itemgroup_refs¶
Collection of
ItemGroupReffor Form
- view_restrictions¶
Collection of
ViewRestrictionfor Form - Rave Specific Attribute
- class rwslib.builders.metadata.FormRef(oid, order_number, mandatory)¶
A reference to a
FormDefas it occurs within a specificStudyEventDef. The list ofFormRefidentifies the types of forms that are allowed to occur within this type of study event. TheFormRefwithin a singleStudyEventDefmust not have duplicate FormOIDs nor OrderNumbers.- Parameters:
order_number (int) – Define the OrderNumber for the
FormRefwithin the containingStudyEventDefmandatory (bool) – Is this Form Mandatory?
- class rwslib.builders.metadata.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.metadata.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 (DataType) – 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
- codelistref¶
Matching
CodeListRef
- entry_restrictions¶
Collection of
MdsolEntryRestriction
- header_text¶
Matching
MdsolHeaderText
- help_texts¶
Collection of
MdsolHelpText
- measurement_unit_refs¶
Collection of
MeasurementUnitRef
- range_checks¶
Collection of
RangeCheck
- review_groups¶
Collection of
MdsolReviewGroup
- view_restrictions¶
Collection of
MdsolViewRestriction
- class rwslib.builders.metadata.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
ReferenceDataelement. If IsReferenceData is No, this type of item group can occur only within aClinicalDataelement. 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
- label_refs¶
Collection of
MdsolLabelRef
- class rwslib.builders.metadata.ItemGroupRef(oid, order_number=None, 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
ItemGroupDeforder_number (int) – OrderNumber for the ItemGroupRef
mandatory (bool) – Is this ItemGroupRef required?
- class rwslib.builders.metadata.ItemRef(oid, order_number=None, mandatory=False, key_sequence=None, imputation_method_oid=None, role=None, role_codelist_oid=None)¶
A reference to an
ItemDefas it occurs within a specificItemGroupDef. 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
ItemDeforder_number (int) –
OrderNumberfor the ItemRefmandatory (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
CodeListthat defines the full set roles from which theRoleattribute value is to be taken.
- attributes¶
Collection of
MdsolAttribute
- class rwslib.builders.metadata.MdsolAttribute(namespace, name, value, transaction_type='Insert')¶
Rave Web Services element for holding Vendor Attributes
Note
This is Medidata Rave Specific Element
- name¶
Name for the Attribute
- namespace¶
Namespace for the Attribute
- transaction_type¶
TransactionType for the Attribute
- value¶
Value for the Attribute
- class rwslib.builders.metadata.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.
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
- property check_action_type¶
return the CheckAction Type
- class rwslib.builders.metadata.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
- property logical_record_position¶
Get the Logical Record Position :return: the Logical Record Position
- class rwslib.builders.metadata.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.metadata.MdsolCustomFunctionDef(oid, code, language='C#')¶
Extension for Rave Custom functions
Note
This is a Medidata Rave Specific Extension
VB has been 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.metadata.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.
- derivation_steps¶
Set of
MdsolDerivationStepfor this derivation
- property logical_record_position¶
Get the Logical Record Position :return: the Logical Record Position
- class rwslib.builders.metadata.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
- property function¶
Return the Derivation Function :return:
- property logical_record_position¶
Get the Logical Record Position :return: the Logical Record Position
- class rwslib.builders.metadata.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?
- check_actions¶
Set of
MdsolCheckActionfor this EditCheck
- check_steps¶
Set of
MdsolCheckStepfor this EditCheck
- class rwslib.builders.metadata.MdsolEntryRestriction(rolename)¶
EntryRestriction for
FormDefandItemDefNote
This is Medidata Rave Specific Element
- rolename¶
Name for the role for which the EntryRestriction applies
- class rwslib.builders.metadata.MdsolHeaderText(content, lang=None)¶
Header text for
ItemDefwhen shown in gridNote
this is a Medidata Rave Specific Element
- Parameters:
content (str) – Content for the Header Text
lang (str) – Language specification for Header
- class rwslib.builders.metadata.MdsolHelpText(lang, content)¶
Help element for
FormDefandItemDefNote
This is Medidata Rave Specific Element
- content¶
HelpText content
- lang¶
Language specification for HelpText
- class rwslib.builders.metadata.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) –
FieldNumberfor the MdsolLabelDef
- help_texts¶
Collection of
HelpText
- translations¶
Collection of
Translation
- view_restrictions¶
Collection of
ViewRestriction
- class rwslib.builders.metadata.MdsolLabelRef(oid, order_number)¶
A reference to a label on a form
Note
This is Medidata Rave Specific Element
- oid¶
OID for the corresponding
MdsoLabel
- order_number¶
OrderNumberfor the Label
- class rwslib.builders.metadata.MdsolReviewGroup(name)¶
Maps to Rave review groups for an
ItemDefNote
this is a Medidata Rave Specific Element
- Parameters:
name (str) – Name for the MdsolReviewGroup
- class rwslib.builders.metadata.MdsolViewRestriction(rolename)¶
ViewRestriction for
FormDefandItemDefNote
This is Medidata Rave Specific Element
- rolename¶
Name for the role for which the ViewRestriction applies
- class rwslib.builders.metadata.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.metadata.MeasurementUnitRef(oid)¶
A reference to a measurement unit definition (
MeasurementUnit).- Parameters:
oid (str) –
MeasurementUnitOID
- class rwslib.builders.metadata.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.metadata.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.- study_event_refs¶
Collection of
StudyEventRef
- class rwslib.builders.metadata.Question¶
A label shown to a human user when prompted to provide data for an item on paper or on a screen.
- translations¶
Collection of
Translationfor the Question
- class rwslib.builders.metadata.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)
- property comparator¶
returns the comparator
- property soft_hard¶
returns the Soft or Hard range setting
- class rwslib.builders.metadata.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
- studyevent_defs¶
set of
StudyEventDeffor this Study element
- class rwslib.builders.metadata.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.metadata.StudyEventRef(oid, order_number=None, mandatory=False)¶
A reference to a StudyEventDef as it occurs within a specific version of a
Study. The list ofStudyEventRefidentifies the types of study events that are allowed to occur within the study. TheStudyEventRefwithin aProtocolmust not have duplicate StudyEventOIDs nor duplicate OrderNumbers.Note
In Rave the OrderNumber attribute is not reported for the SUBJECT Form, for this reason the order_number attribute is not mandatory and will default to None
- Parameters:
oid (str) –
StudyEventDefOIDorder_number (Union(int, None)) – OrderNumber for the
StudyEventRefwithin theStudymandatory (bool) – Is this StudyEventDef Mandatory? (True|False)
- class rwslib.builders.metadata.Symbol¶
A human-readable name for a
MeasurementUnit.- translations¶
Collection of
TranslatedText
- class rwslib.builders.metadata.TranslatedText(text, lang=None)¶
Represents a language and a translated text for that language
- Parameters:
text (str) – Content expressed in language designated by
langlang (str) – Language code
Clinical Data Builders¶
Clinical Data Builders provide an API for creating ODM data elements
- class rwslib.builders.clinicaldata.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:
- property annotation_id¶
ID for annotation
Note
If an Annotation is contained with an Annotations element, the ID attribute is required.
- property seqnum¶
SeqNum attribute (a small positive integer) uniquely identifies the annotation within its parent entity.
- class rwslib.builders.clinicaldata.Annotations(annotations=[])¶
Groups Annotation elements referenced by ItemData[TYPE] elements.
- class rwslib.builders.clinicaldata.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
ItemDatain 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
- property audit_id¶
AuditRecord ID
Note
If an AuditRecord is contained within an AuditRecords element, the ID attribute must be provided.
- date_time_stamp¶
DateTimeStampfor the AuditRecord
- property edit_point¶
- EditPoint attribute identifies the phase of data processing in which action occurred
(Monitoring, DataManagement, DBAudit)
- location_ref¶
LocationReffor the AuditRecord
- reason_for_change¶
ReasonForChangefor the AuditRecord
- class rwslib.builders.clinicaldata.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
- subject_data¶
collection of
SubjectDatafor the ClinicalData Element
- class rwslib.builders.clinicaldata.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_)
- property sponsor_or_site¶
Originator of comment (either Sponsor or Site)
- property text¶
Text content of Comment
- class rwslib.builders.clinicaldata.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.
- date_time¶
specified DateTime for event
- class rwslib.builders.clinicaldata.Flag(flag_type=None, flag_value=None)¶
A machine-processable annotation on clinical data.
Note
Flag is not supported by Rave
- class rwslib.builders.clinicaldata.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
- property codelist_oid¶
Reference to the
CodeListfor the FlagType
- class rwslib.builders.clinicaldata.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
- property codelist_oid¶
Reference to the
CodeListfor the FlagType
- class rwslib.builders.clinicaldata.FormData(formoid, transaction_type=None, form_repeat_key=None, lab_reference=None, lab_type=None)¶
Models the ODM FormData object
- Parameters:
formoid (str) –
FormDefOIDtransaction_type (str) – Transaction Type for Data (one of Insert, Update, Upsert, Context, Remove)
form_repeat_key (str) – Repeat Key for FormData
lab_reference (str) – Name for the Lab with the ranges
lab_type (LabType) – Type of the Lab (Central, Local)
- annotations: list(Annotation)¶
Collection of
Annotationfor FormData - Not supported by Rave
- class rwslib.builders.clinicaldata.ItemData(itemoid, value=<class 'rwslib.builders.common.Unset'>, specify_value=None, transaction_type=None, lock=None, freeze=None, verify=None)¶
Models the ODM ItemData object
- Parameters:
itemoid (str) – OID for the matching
ItemDefvalue (str) – Value for the ItemData
specify_value (str) – ‘If other, specify’ value - Rave specific attribute
transaction_type (str) – Transaction Type for Data (one of Insert, Update, Upsert, Context, Remove)
lock (bool) – Lock the DataPoint? - Rave specific attribute
freeze (bool) – Freeze the DataPoint? - Rave specific attribute
verify (bool) – Verify the DataPoint? - Rave specific attribute
- annotations¶
the list of
Annotationon the DataPoint - Not supported by Rave
- audit_record¶
the corresponding
AuditRecordfor the DataPoint
- deviations¶
the list of
MdsolProtocolDeviationreferences on the DataPoint - Rave Specific Attribute
- measurement_unit_ref¶
the corresponding
MeasurementUnitReffor the DataPoint
- queries¶
the list of
MdsolQueryon the DataPoint - Rave Specific Attribute
- class rwslib.builders.clinicaldata.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) – Transaction Type for Data (one of Insert, Update, Upsert, Context, Remove)
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.clinicaldata.LocationRef(oid)¶
Reference to a
Location- Parameters:
oid (str) – OID for referenced
Location
- class rwslib.builders.clinicaldata.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
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.clinicaldata.MdsolQuery(value=None, query_repeat_key=None, recipient=None, status=None, requires_response=None, response=None, preceding_query_repeat_key=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 (Marking Group)
status (QueryStatusType) – Query status
requires_response (bool) – Does this Query need a response?
response (str or None) – Query response (if any)
preceding_query_repeat_key (int) – Query Key returned by OpenQuery call
- property status¶
Query Status
- class rwslib.builders.clinicaldata.ReasonForChange(reason)¶
A user-supplied reason for a data change.
- Parameters:
reason (str) – Supplied Reason for change
- class rwslib.builders.clinicaldata.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:
location_ref (LocationRef) –
LocationRefforLocationof signingsignature_ref (SignatureRef) –
SignatureRefforSignatureDefproviding signature meaningdate_time_stamp –
DateTimeStampfor the time of Signature
- property 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.clinicaldata.SignatureRef(oid)¶
Reference to a Signature
- Parameters:
oid (str) – OID for referenced
Signature
- class rwslib.builders.clinicaldata.SiteRef(oid, location_oid_type: LocationOIDType | None = None, site_number: str | None = None, study_site_name: str | None = None, site_uuid: str | None = None, location_name: str | None = None, study_env_site_number: str | None = None, previous_location_oid: str | None = None, shared_location_oid: str | None = None, previous_shared_location_oid: str | None = None, subject_created_at_site: str | None = None)¶
Reference to a
LocationThe 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
Locationlocation_oid_type (LocationOIDType) – Type for the oid
site_number – Site number
study_site_name – Study site name
site_uuid – Site UUID
location_name – Location name
study_env_site_number – Study environment site number
previous_location_oid – Previous location OID
shared_location_oid – Shared location OID
previous_shared_location_oid – Previous shared location OID
subject_created_at_site – Subject created at site
- class rwslib.builders.clinicaldata.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.
- source_id¶
specified DateTime for event
- class rwslib.builders.clinicaldata.StudyEventData(study_event_oid, transaction_type='Update', study_event_repeat_key=None)¶
Models the ODM StudyEventData object
- Parameters:
study_event_oid (str) –
StudyEventOIDtransaction_type (str) – Transaction Type for Data (one of Insert, Update, Upsert, Context, Remove)
study_event_repeat_key (int) –
StudyEventRepeatKeyfor StudyEventData
- annotations¶
Annotationfor Study Event Data - Not Supported by Rave
- class rwslib.builders.clinicaldata.SubjectData(site_location_oid, subject_key, subject_key_type='SubjectName', transaction_type='Update', location_oid_type: LocationOIDType | None = None)¶
Models the ODM SubjectData and ODM SiteRef objects
- Parameters:
site_location_oid (str) –
SiteLocationOIDsubject_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, Context, Remove)
- annotations¶
collection of
Annotation
- audit_record¶
AuditRecordfor SubjectData - Not Supported By Rave
- location_oid_type¶
LocationOIDType
- study_events¶
collection of
StudyEventData
- class rwslib.builders.clinicaldata.UserRef(oid)¶
Reference to a
User- Parameters:
oid (str) – OID for referenced
User
Administrative Data Builders¶
Admin Data Builders provide an API for creating ODM AdminData elements
- class rwslib.builders.admindata.Address(street_names=None, city=None, state_prov=None, country=None, postal_code=None, other_text=None)¶
The user’s postal address.
- class rwslib.builders.admindata.AdminData(study_oid=None)¶
Administrative information about users, locations, and electronic signatures.
- Parameters:
study_oid (str) – OID pointing to the StudyDef
- class rwslib.builders.admindata.City(text)¶
The city name part of a user’s postal address.
- class rwslib.builders.admindata.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.admindata.DisplayName(text)¶
A short displayable name for the user.
- class rwslib.builders.admindata.Email(text)¶
The user’s email address.
- class rwslib.builders.admindata.FirstName(text)¶
The user’s initial given name or all given names.
- class rwslib.builders.admindata.FullName(text)¶
The user’s full formal name.
- class rwslib.builders.admindata.LastName(text)¶
The user’s surname (family name).
- class rwslib.builders.admindata.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
LocationRefname (str) – Name for the Location
location_type (rwslib.builder_constants.LocationType) – Type for this Location
metadata_versions (list(MetaDataVersionRef)) – The
MetaDataVersionReffor this Location
- class rwslib.builders.admindata.LoginName(text)¶
The user’s login identification.
- class rwslib.builders.admindata.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
Studythat 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.admindata.Organization(text)¶
The user’s organization.
- class rwslib.builders.admindata.OtherText(text)¶
Any other text needed as part of a user’s postal address.
- class rwslib.builders.admindata.Phone(text)¶
The user’s voice phone number.
- class rwslib.builders.admindata.PostalCode(text)¶
The postal code part of a user’s postal address.
- class rwslib.builders.admindata.SimpleChildElement(text)¶
Generic Element, for elements we’re not ready to flesh out in the builders
- class rwslib.builders.admindata.StateProv(text)¶
The state or province name part of a user’s postal address.
- class rwslib.builders.admindata.StreetName(text)¶
The street address part of a user’s postal address.
- class rwslib.builders.admindata.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:
oid (str)
user_type (rwslib.builder_constants.UserType) – User Type
display_name (DisplayName) – User Display Name - see
DisplayNameorganisation (Organisation) – User Organisation - see
Organisationlocations (list(LocationRef)) – Locations for User - see
LocationRef
- property user_type¶
User Type :return: