Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if self.transaction_type is not None:
params["TransactionType"] = self.transaction_type
if self.value in [None, '']:
params['IsNull'] = 'Yes'
else:
params['Value'] = str(self.value)
if self.specify_value is not None:
params['mdsol:SpecifyValue'] = self.specify_value
if self.lock is not None:
params['mdsol:Lock'] = bool_to_yes_no(self.lock)
if self.freeze is not None:
params['mdsol:Freeze'] = bool_to_yes_no(self.freeze)
if self.verify is not None:
params['mdsol:Verify'] = bool_to_yes_no(self.verify)
# mixins
self.mixin()
self.mixin_params(params)
builder.start("ItemData", params)
if self.audit_record is not None:
self.audit_record.build(builder)
# Measurement unit ref must be after audit record or RWS complains
if self.measurement_unit_ref is not None:
self.measurement_unit_ref.build(builder)
params['mdsol:SourceDocument'] = bool_to_yes_no(self.source_document_verify)
params['mdsol:IndentLevel'] = str(self.indent_level)
if self.sas_format is not None:
params['mdsol:SASFormat'] = self.sas_format
if self.sas_label is not None:
params['mdsol:SASLabel'] = self.sas_label
params['mdsol:QueryFutureDate'] = bool_to_yes_no(self.query_future_date)
params['mdsol:Visible'] = bool_to_yes_no(self.visible)
params['mdsol:TranslationRequired'] = bool_to_yes_no(self.translation_required)
params['mdsol:QueryNonConformance'] = bool_to_yes_no(self.query_non_conformance)
params['mdsol:OtherVisits'] = bool_to_yes_no(self.other_visits)
params['mdsol:CanSetItemGroupDate'] = bool_to_yes_no(self.can_set_item_group_date)
params['mdsol:CanSetFormDate'] = bool_to_yes_no(self.can_set_form_date)
params['mdsol:CanSetStudyEventDate'] = bool_to_yes_no(self.can_set_study_event_date)
params['mdsol:CanSetSubjectDate'] = bool_to_yes_no(self.can_set_subject_date)
params['mdsol:VisualVerify'] = bool_to_yes_no(self.visual_verify)
params['mdsol:DoesNotBreakSignature'] = bool_to_yes_no(self.does_not_break_signature)
if self.field_number is not None:
params['mdsol:FieldNumber'] = self.field_number
if self.variable_oid is not None:
params['mdsol:VariableOID'] = self.variable_oid
builder.start("ItemDef", params)
if self.question is not None:
self.question.build(builder)
if self.sas_format is not None:
params['mdsol:SASFormat'] = self.sas_format
if self.sas_label is not None:
params['mdsol:SASLabel'] = self.sas_label
params['mdsol:QueryFutureDate'] = bool_to_yes_no(self.query_future_date)
params['mdsol:Visible'] = bool_to_yes_no(self.visible)
params['mdsol:TranslationRequired'] = bool_to_yes_no(self.translation_required)
params['mdsol:QueryNonConformance'] = bool_to_yes_no(self.query_non_conformance)
params['mdsol:OtherVisits'] = bool_to_yes_no(self.other_visits)
params['mdsol:CanSetItemGroupDate'] = bool_to_yes_no(self.can_set_item_group_date)
params['mdsol:CanSetFormDate'] = bool_to_yes_no(self.can_set_form_date)
params['mdsol:CanSetStudyEventDate'] = bool_to_yes_no(self.can_set_study_event_date)
params['mdsol:CanSetSubjectDate'] = bool_to_yes_no(self.can_set_subject_date)
params['mdsol:VisualVerify'] = bool_to_yes_no(self.visual_verify)
params['mdsol:DoesNotBreakSignature'] = bool_to_yes_no(self.does_not_break_signature)
if self.field_number is not None:
params['mdsol:FieldNumber'] = self.field_number
if self.variable_oid is not None:
params['mdsol:VariableOID'] = self.variable_oid
builder.start("ItemDef", params)
if self.question is not None:
self.question.build(builder)
if self.codelistref is not None:
self.codelistref.build(builder)
params['mdsol:IndentLevel'] = str(self.indent_level)
if self.sas_format is not None:
params['mdsol:SASFormat'] = self.sas_format
if self.sas_label is not None:
params['mdsol:SASLabel'] = self.sas_label
params['mdsol:QueryFutureDate'] = bool_to_yes_no(self.query_future_date)
params['mdsol:Visible'] = bool_to_yes_no(self.visible)
params['mdsol:TranslationRequired'] = bool_to_yes_no(self.translation_required)
params['mdsol:QueryNonConformance'] = bool_to_yes_no(self.query_non_conformance)
params['mdsol:OtherVisits'] = bool_to_yes_no(self.other_visits)
params['mdsol:CanSetItemGroupDate'] = bool_to_yes_no(self.can_set_item_group_date)
params['mdsol:CanSetFormDate'] = bool_to_yes_no(self.can_set_form_date)
params['mdsol:CanSetStudyEventDate'] = bool_to_yes_no(self.can_set_study_event_date)
params['mdsol:CanSetSubjectDate'] = bool_to_yes_no(self.can_set_subject_date)
params['mdsol:VisualVerify'] = bool_to_yes_no(self.visual_verify)
params['mdsol:DoesNotBreakSignature'] = bool_to_yes_no(self.does_not_break_signature)
if self.field_number is not None:
params['mdsol:FieldNumber'] = self.field_number
if self.variable_oid is not None:
params['mdsol:VariableOID'] = self.variable_oid
builder.start("ItemDef", params)
if self.question is not None:
self.question.build(builder)
if self.codelistref is not None:
params['mdsol:SASFormat'] = self.sas_format
if self.sas_label is not None:
params['mdsol:SASLabel'] = self.sas_label
params['mdsol:QueryFutureDate'] = bool_to_yes_no(self.query_future_date)
params['mdsol:Visible'] = bool_to_yes_no(self.visible)
params['mdsol:TranslationRequired'] = bool_to_yes_no(self.translation_required)
params['mdsol:QueryNonConformance'] = bool_to_yes_no(self.query_non_conformance)
params['mdsol:OtherVisits'] = bool_to_yes_no(self.other_visits)
params['mdsol:CanSetItemGroupDate'] = bool_to_yes_no(self.can_set_item_group_date)
params['mdsol:CanSetFormDate'] = bool_to_yes_no(self.can_set_form_date)
params['mdsol:CanSetStudyEventDate'] = bool_to_yes_no(self.can_set_study_event_date)
params['mdsol:CanSetSubjectDate'] = bool_to_yes_no(self.can_set_subject_date)
params['mdsol:VisualVerify'] = bool_to_yes_no(self.visual_verify)
params['mdsol:DoesNotBreakSignature'] = bool_to_yes_no(self.does_not_break_signature)
if self.field_number is not None:
params['mdsol:FieldNumber'] = self.field_number
if self.variable_oid is not None:
params['mdsol:VariableOID'] = self.variable_oid
builder.start("ItemDef", params)
if self.question is not None:
self.question.build(builder)
if self.codelistref is not None:
self.codelistref.build(builder)
for mur in self.measurement_unit_refs:
def build(self, builder):
"""Build XML by appending to builder"""
params = dict(OID=self.oid,
Name=self.name,
Repeating=bool_to_yes_no(self.repeating)
)
if self.order_number is not None:
params['mdsol:OrderNumber'] = str(self.order_number)
if self.active is not None:
params['mdsol:Active'] = bool_to_yes_no(self.active)
params['mdsol:Template'] = bool_to_yes_no(self.template)
params['mdsol:SignatureRequired'] = bool_to_yes_no(self.signature_required)
params['mdsol:LogDirection'] = self.log_direction
params['mdsol:DoubleDataEntry'] = self.double_data_entry
params['mdsol:ConfirmationStyle'] = self.confirmation_style
if self.link_study_event_oid:
params['mdsol:LinkStudyEventOID'] = self.link_study_event_oid
if self.link_form_oid:
params['mdsol:LinkFormOID'] = self.link_form_oid
builder.start("FormDef", params)
for itemgroup_ref in self.itemgroup_refs:
itemgroup_ref.build(builder)
for helptext in self.helptexts:
def build(self, builder):
"""Build XML by appending to builder"""
params = {}
if self.edit_point is not None:
params["EditPoint"] = self.edit_point
if self.used_imputation_method is not None:
params['UsedImputationMethod'] = bool_to_yes_no(self.used_imputation_method)
if self.audit_id is not None:
params['ID'] = str(self.audit_id)
if self.include_file_oid is not None:
params['mdsol:IncludeFileOID'] = bool_to_yes_no(self.include_file_oid)
builder.start("AuditRecord", params)
if self.user_ref is None:
raise ValueError("User Reference not set.")
self.user_ref.build(builder)
if self.location_ref is None:
raise ValueError("Location Reference not set.")
self.location_ref.build(builder)
if self.date_time_stamp is None:
raise ValueError("DateTime not set.")
self.date_time_stamp.build(builder)
# Optional
params['mdsol:DefaultValue'] = str(self.default_value)
params['mdsol:SourceDocument'] = bool_to_yes_no(self.source_document_verify)
params['mdsol:IndentLevel'] = str(self.indent_level)
if self.sas_format is not None:
params['mdsol:SASFormat'] = self.sas_format
if self.sas_label is not None:
params['mdsol:SASLabel'] = self.sas_label
params['mdsol:QueryFutureDate'] = bool_to_yes_no(self.query_future_date)
params['mdsol:Visible'] = bool_to_yes_no(self.visible)
params['mdsol:TranslationRequired'] = bool_to_yes_no(self.translation_required)
params['mdsol:QueryNonConformance'] = bool_to_yes_no(self.query_non_conformance)
params['mdsol:OtherVisits'] = bool_to_yes_no(self.other_visits)
params['mdsol:CanSetItemGroupDate'] = bool_to_yes_no(self.can_set_item_group_date)
params['mdsol:CanSetFormDate'] = bool_to_yes_no(self.can_set_form_date)
params['mdsol:CanSetStudyEventDate'] = bool_to_yes_no(self.can_set_study_event_date)
params['mdsol:CanSetSubjectDate'] = bool_to_yes_no(self.can_set_subject_date)
params['mdsol:VisualVerify'] = bool_to_yes_no(self.visual_verify)
params['mdsol:DoesNotBreakSignature'] = bool_to_yes_no(self.does_not_break_signature)
if self.field_number is not None:
params['mdsol:FieldNumber'] = self.field_number
if self.variable_oid is not None:
params['mdsol:VariableOID'] = self.variable_oid
builder.start("ItemDef", params)
if self.question is not None:
"""
params = dict(ItemOID=self.itemoid)
if self.transaction_type is not None:
params["TransactionType"] = self.transaction_type
if self.value in [None, '']:
params['IsNull'] = 'Yes'
else:
params['Value'] = str(self.value)
if self.specify_value is not None:
params['mdsol:SpecifyValue'] = self.specify_value
if self.lock is not None:
params['mdsol:Lock'] = bool_to_yes_no(self.lock)
if self.freeze is not None:
params['mdsol:Freeze'] = bool_to_yes_no(self.freeze)
if self.verify is not None:
params['mdsol:Verify'] = bool_to_yes_no(self.verify)
# mixins
self.mixin()
self.mixin_params(params)
builder.start("ItemData", params)
if self.audit_record is not None:
self.audit_record.build(builder)
def build(self, builder):
"""Build XML by appending to builder"""
params = dict(StudyEventOID=self.oid,
OrderNumber=str(self.order_number),
Mandatory=bool_to_yes_no(self.mandatory))
builder.start("StudyEventRef", params)
builder.end("StudyEventRef")