schema = BikaSchema.copy() + Schema(( StringField( 'Category', default='lab', vocabulary=PRESERVATION_CATEGORIES, widget=SelectionWidget( format='flex', label=_("Preservation Category"), ), ), DurationField( 'RetentionPeriod', widget=DurationWidget( label=_("Retention Period"), description=_( 'Once preserved, the sample must be disposed of within this ' 'time period. If not specified, the sample type retention ' 'period will be used.')), ), )) schema['description'].widget.visible = True schema['description'].schemata = 'default' class Preservation(BaseContent): implements(IDeactivable) security = ClassSecurityInfo() displayContentsTab = False schema = schema _at_rename_after_creation = True
), StringField( 'Elevation', schemata='Location', widget=StringWidget( label=_("Elevation"), description=_( "The height or depth at which the sample has to be taken"), ), ), DurationField( 'SamplingFrequency', vocabulary_display_path_bound=sys.maxint, widget=DurationWidget( label=_("Sampling Frequency"), description= _("If a sample is taken periodically at this sample point, enter frequency here, e.g. weekly" ), ), ), ReferenceField( 'SampleTypes', required=0, multiValued=1, allowed_types=('SampleType', ), vocabulary='SampleTypesVocabulary', relationship='SamplePointSampleType', widget=brw( label=_("Sample Types"), description=_("The list of sample types that can be collected " "at this sample point. If no sample types are " "selected, then all sample types are available."),
"own configuration"), format='select', )), DurationField( 'DefaultSampleLifetime', schemata="Analyses", required=1, default={ "days": 30, "hours": 0, "minutes": 0 }, widget=DurationWidget( label=_("Default sample retention period"), description= _("The number of days before a sample expires and cannot be analysed " "any more. This setting can be overwritten per individual sample type " "in the sample types setup"), )), StringField('ResultsDecimalMark', schemata="Analyses", vocabulary=DECIMAL_MARKS, default=".", widget=SelectionWidget( label=_("Default decimal mark"), description=_("Preferred decimal mark for results"), format='select', )), StringField( 'ScientificNotationResults', schemata="Analyses",
"This setting can be set per individual analysis on its " "own configuration"), )), DurationField( 'DefaultSampleLifetime', schemata="Analyses", required=1, default={ "days": 30, "hours": 0, "minutes": 0 }, widget=DurationWidget( label=_("Default sample retention period"), description=_( "The number of days before a sample expires and cannot be " "analysed any more. This setting can be overwritten per " "individual sample type in the sample types setup"), )), DurationField( 'DefaultTurnaroundTime', schemata="Analyses", required=1, default={ "days": 5, "hours": 0, "minutes": 0 }, widget=DurationWidget( label=_("Default turnaround time for analyses."), description=_(
"""Returns the field that stores the SampleType object, if any """ field = self.getField("SampleType", None) if not field: field = self.getField("SampleTypes", None) return field schema = BikaSchema.copy() + Schema(( DurationField('RetentionPeriod', required = 1, default_method = 'getDefaultLifetime', widget = DurationWidget( label=_("Retention Period"), description =_( "The period for which un-preserved samples of this type can be kept before " "they expire and cannot be analysed any further"), ) ), BooleanField('Hazardous', default = False, widget = BooleanWidget( label=_("Hazardous"), description=_("Samples of this type should be treated as hazardous"), ), ), ReferenceField('SampleMatrix', required = 0, allowed_types = ('SampleMatrix',), vocabulary = 'SampleMatricesVocabulary', relationship = 'SampleTypeSampleMatrix',
label=_("Calculation Interim Fields"), )), StringField('Result', ), DateTimeField( 'ResultCaptureDate', widget=ComputedWidget(visible=False, ), ), StringField('ResultDM', ), BooleanField( 'Retested', default=False, ), DurationField( 'MaxTimeAllowed', widget=DurationWidget( label=_("Maximum turn-around time"), description=_( "Maximum time allowed for completion of the analysis. " "A late analysis alert is raised when this period elapses"), ), ), DateTimeField( 'DateAnalysisPublished', widget=DateTimeWidget(label=_("Date Published"), ), ), DateTimeField( 'DueDate', widget=DateTimeWidget(label=_("Due Date"), ), ), IntegerField('Duration', widget=IntegerWidget(label=_("Duration"), )), IntegerField('Earliness', widget=IntegerWidget(label=_("Earliness"), )), BooleanField( 'ReportDryMatter',