Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""Override << operator"""
# ExternalQuestion?,,
# Role*, Alias*,
# mdsol:HelpText?, mdsol:ViewRestriction* or mdsolEntryRestrictions*), (or mdsol:ReviewGroups*), mdsol:Label?)
if not isinstance(other, (MdsolHelpText, MdsolEntryRestriction, MdsolViewRestriction, Question,
MeasurementUnitRef, CodeListRef, MdsolHeaderText, MdsolReviewGroup, RangeCheck,
Alias,)):
raise ValueError('ItemDef cannot accept a {0} as a child element'.format(other.__class__.__name__))
self.set_single_attribute(other, Question, 'question')
self.set_single_attribute(other, CodeListRef, 'codelistref')
self.set_single_attribute(other, MdsolHeaderText, 'header_text')
self.set_list_attribute(other, RangeCheck, 'range_checks')
self.set_list_attribute(other, MeasurementUnitRef, 'measurement_unit_refs')
self.set_list_attribute(other, MdsolHelpText, 'help_texts')
self.set_list_attribute(other, MdsolViewRestriction, 'view_restrictions')
self.set_list_attribute(other, MdsolEntryRestriction, 'entry_restrictions')
self.set_list_attribute(other, MdsolReviewGroup, 'review_groups')
self.set_list_attribute(other, Alias, 'aliases')
return other
def __lshift__(self, other):
if not isinstance(other, (MeasurementUnitRef, AuditRecord, MdsolQuery, Annotation,
MdsolProtocolDeviation)):
raise ValueError("ItemData object can only receive MeasurementUnitRef, AuditRecord, Annotation,"
"MdsolProtocolDeviation or MdsolQuery objects")
self.set_single_attribute(other, MeasurementUnitRef, 'measurement_unit_ref')
self.set_single_attribute(other, AuditRecord, 'audit_record')
self.set_list_attribute(other, MdsolQuery, 'queries')
self.set_list_attribute(other, MdsolProtocolDeviation, 'deviations')
self.set_list_attribute(other, Annotation, 'annotations')
return other
def __lshift__(self, other):
"""Override << operator"""
# ExternalQuestion?,,
# Role*, Alias*,
# mdsol:HelpText?, mdsol:ViewRestriction* or mdsolEntryRestrictions*), (or mdsol:ReviewGroups*), mdsol:Label?)
if not isinstance(other, (MdsolHelpText, MdsolEntryRestriction, MdsolViewRestriction, Question,
MeasurementUnitRef, CodeListRef, MdsolHeaderText, MdsolReviewGroup, RangeCheck,
Alias,)):
raise ValueError('ItemDef cannot accept a {0} as a child element'.format(other.__class__.__name__))
self.set_single_attribute(other, Question, 'question')
self.set_single_attribute(other, CodeListRef, 'codelistref')
self.set_single_attribute(other, MdsolHeaderText, 'header_text')
self.set_list_attribute(other, RangeCheck, 'range_checks')
self.set_list_attribute(other, MeasurementUnitRef, 'measurement_unit_refs')
self.set_list_attribute(other, MdsolHelpText, 'help_texts')
self.set_list_attribute(other, MdsolViewRestriction, 'view_restrictions')
self.set_list_attribute(other, MdsolEntryRestriction, 'entry_restrictions')
self.set_list_attribute(other, MdsolReviewGroup, 'review_groups')
self.set_list_attribute(other, Alias, 'aliases')
return other
def __lshift__(self, other):
"""Override << operator"""
if not isinstance(other, (CheckValue, MeasurementUnitRef,)):
raise ValueError('RangeCheck cannot accept a {0} as a child element'.format(other.__class__.__name__))
self.set_single_attribute(other, CheckValue, 'check_value')
self.set_single_attribute(other, MeasurementUnitRef, 'measurement_unit_ref')
def __lshift__(self, other):
if not isinstance(other, (MeasurementUnitRef, AuditRecord, MdsolQuery, Annotation,
MdsolProtocolDeviation)):
raise ValueError("ItemData object can only receive MeasurementUnitRef, AuditRecord, Annotation,"
"MdsolProtocolDeviation or MdsolQuery objects")
self.set_single_attribute(other, MeasurementUnitRef, 'measurement_unit_ref')
self.set_single_attribute(other, AuditRecord, 'audit_record')
self.set_list_attribute(other, MdsolQuery, 'queries')
self.set_list_attribute(other, MdsolProtocolDeviation, 'deviations')
self.set_list_attribute(other, Annotation, 'annotations')
return other