Пример #1
0
def getDepartmentUIDs(instance):
    deps = [an.getDepartment().UID() for
            an in obj.getWorksheetServices() if
            an.getDepartment()]
    return deps

@indexer(IWorksheet)
def getDepartmentUIDs(instance):
    deps = [an.getDepartment().UID() for
            an in obj.getWorksheetServices() if
            an.getDepartment()]
    return deps

schema = BikaSchema.copy() + Schema((
    HistoryAwareReferenceField('WorksheetTemplate',
        allowed_types=('WorksheetTemplate',),
        relationship='WorksheetAnalysisTemplate',
    ),
    ComputedField('WorksheetTemplateTitle',
        searchable=True,
        expression="context.getWorksheetTemplate() and context.getWorksheetTemplate().Title() or ''",
        widget=ComputedWidget(
            visible=False,
        ),
    ),
    RecordsField('Layout',
        required=1,
        subfields=('position', 'type', 'container_uid', 'analysis_uid'),
        subfield_types={'position': 'int'},
    ),
    # all layout info lives in Layout; Analyses is used for back references.
    ReferenceField('Analyses',
Пример #2
0
         label = _("ReferenceAnalysis ID"),
         description = _("The ID assigned to the reference analysis"),
         visible = {'edit':'hidden'},
     ),
 ),
 StringField('ReferenceType',
     vocabulary = STD_TYPES,
     widget = SelectionWidget(
         label = _("Reference Type"),
     ),
 ),
 HistoryAwareReferenceField('Service',
     required = 1,
     allowed_types = ('AnalysisService',),
     relationship = 'ReferenceAnalysisAnalysisService',
     referenceClass = HoldingReference,
     widget = ReferenceWidget(
         label = _("Analysis Service"),
     )
 ),
 InterimFieldsField('InterimFields',
     widget = BikaRecordsWidget(
         label = _("Calculation Interim Fields"),
     )
 ),
 StringField('Result',
     widget = StringWidget(
         label = _("Result"),
     )
 ),
 StringField('ResultDM',
Пример #3
0
                 label=_("Model"),
                 description=_("The instrument's model number"),
             )),
 StringField(
     'SerialNo',
     widget=StringWidget(
         label=_("Serial No"),
         description=_(
             "The serial number that uniquely identifies the instrument"),
     )),
 HistoryAwareReferenceField(
     'Method',
     vocabulary='_getAvailableMethods',
     allowed_types=('Method', ),
     relationship='InstrumentMethod',
     required=0,
     widget=SelectionWidget(
         format='select',
         label=_("Method"),
     ),
 ),
 BooleanField(
     'DisposeUntilNextCalibrationTest',
     default=False,
     widget=BooleanWidget(
         label=_("De-activate until next calibration test"),
         description=
         _("If checked, the instrument will be unavailable until the next valid "
           "calibration was performed. This checkbox will automatically be unchecked."
           ),
     ),
Пример #4
0
         _("Define interim fields such as vessel mass, dilution factors, "
           "should your calculation require them. The field title specified "
           "here will be used as column headers and field descriptors where "
           "the interim fields are displayed. If 'Apply wide' is enabled "
           "the field ill be shown in a selection box on the top of the "
           "worksheet, allowing to apply a specific value to all the "
           "corresponding fields on the sheet."),
     )),
 HistoryAwareReferenceField(
     'DependentServices',
     schemata='Calculation',
     required=1,
     multiValued=1,
     vocabulary_display_path_bound=sys.maxsize,
     allowed_types=('AnalysisService', ),
     relationship='CalculationAnalysisService',
     referenceClass=HoldingReference,
     widget=ReferenceWidget(
         checkbox_bound=0,
         visible=False,
         label=_("Dependent Analyses"),
     ),
 ),
 TextField(
     'Formula',
     schemata='Calculation',
     validators=('formulavalidator', ),
     default_content_type='text/plain',
     allowable_content_types=('text/plain', ),
     widget=TextAreaWidget(
         label=_("Calculation Formula"),
Пример #5
0
from bika.lims.content.bikaschema import BikaSchema
from bika.lims.interfaces import IAnalysisSpec
from types import ListType, TupleType
from zope.interface import implements
from zope.i18n import translate
import sys
import time

schema = Schema((
    HistoryAwareReferenceField('SampleType',
        # schemata = 'Description',
        # required = 1,
        vocabulary = "getSampleTypes",
        vocabulary_display_path_bound = sys.maxint,
        allowed_types = ('SampleType',),
        relationship = 'AnalysisSpecSampleType',
        referenceClass = HoldingReference,
        widget = ReferenceWidget(
            checkbox_bound = 0,
            label = _("Sample Type"),
        ),
    ),
    ComputedField('SampleTypeTitle',
        expression = "context.getSampleType().Title() if context.getSampleType() else ''",
        widget = ComputedWidget(
            visible = False,
        ),
    ),
    ComputedField('SampleTypeUID',
        expression = "context.getSampleType().UID() if context.getSampleType() else ''",
        widget = ComputedWidget(
Пример #6
0
# transitioned to a 'verified' state. This value is set automatically
# when the analysis is created, based on the value set for the property
# NumberOfRequiredVerifications from the Analysis Service
NumberOfRequiredVerifications = IntegerField('NumberOfRequiredVerifications',
                                             default=1)

# This field keeps the user_ids of members who verified this analysis.
# After each verification, user_id will be added end of this string
# seperated by comma- ',' .
Verificators = StringField('Verificators', default='')

# Routine Analyses and Reference Analysis have a versioned link to
# the calculation at creation time.
Calculation = HistoryAwareReferenceField('Calculation',
                                         allowed_types=('Calculation', ),
                                         relationship='AnalysisCalculation',
                                         referenceClass=HoldingReference)

# InterimFields are defined in Calculations, Services, and Analyses.
# In Analysis Services, the default values are taken from Calculation.
# In Analyses, the default values are taken from the Analysis Service.
# When instrument results are imported, the values in analysis are overridden
# before the calculation is performed.
InterimFields = InterimFieldsField(
    'InterimFields',
    schemata='Method',
    widget=RecordsWidget(
        label=_("Calculation Interim Fields"),
        description=_(
            "Values can be entered here which will override the defaults "
            "specified in the Calculation Interim Fields."),
Пример #7
0
from bika.lims.content.bikaschema import BikaSchema
from types import ListType, TupleType
from zope.interface import implements
import sys
import time

schema = Schema((
    HistoryAwareReferenceField('SampleType',
        schemata = 'Description',
        required = 1,
        vocabulary = "getRemainingSampleTypes",
        vocabulary_display_path_bound = sys.maxint,
        allowed_types = ('SampleType',),
        relationship = 'AnalysisSpecSampleType',
        referenceClass = HoldingReference,
        widget = ReferenceWidget(
            checkbox_bound = 0,
            label = _("Sample Type"),
            description = _("If the sample type you are looking for is not listed here, "
                            "a specification for it has been created already. To edit existing, "
                            "specifications, navigate 1 level up and select the specification by "
                            "clicking on the sample type in the list"),
        ),
    ),
    ComputedField('SampleTypeTitle',
        expression = "context.getSampleType() and context.getSampleType().Title() or ''",
        widget = ComputedWidget(
            visible = False,
        ),
    ),
    ComputedField('SampleTypeUID',
Пример #8
0
            modes = ('view'),
        ),
    ),

    # Calculations associated to this method. The analyses services
    # with this method assigned will use the calculation selected here.
    HistoryAwareReferenceField('Calculation',
        required = 0,
        vocabulary_display_path_bound = sys.maxint,
        vocabulary = '_getCalculations',
        allowed_types = ('Calculation',),
        relationship = 'MethodCalculation',
        referenceClass = HoldingReference,
        widget = ReferenceWidget(
            checkbox_bound = 0,
            label = _("Calculation"),
            description = _("If required, select a calculation for the "
                            "The analysis services linked to this "
                            "method. Calculations can be configured "
                            "under the calculations item in the LIMS "
                            "set-up"),
            catalog_name='bika_setup_catalog',
            base_query={'inactive_state': 'active'},
        )
    ),
))

schema['description'].schemata = 'default'
schema['description'].widget.visible = True
schema['description'].widget.label = _("Description")
schema['description'].widget.description = _("Describes the method in layman terms. This information is made available to lab clients")
Пример #9
0
     widget = StringWidget(
         label = _("Analysis Keyword"),
         description = _("The unique keyword used to identify the analysis service in "
                         "import files of bulk AR requests and results imports from instruments. "
                         "It is also used to identify dependent analysis services in user "
                         "defined results calculations"),
     ),
 ),
 HistoryAwareReferenceField('Method',
     schemata = "Method",
     required = 0,
     searchable = True,
     vocabulary_display_path_bound = sys.maxint,
     allowed_types = ('Method',),
     vocabulary = 'getMethods',
     relationship = 'AnalysisServiceMethod',
     referenceClass = HoldingReference,
     widget = ReferenceWidget(
         checkbox_bound = 1,
         label = _("Method"),
         description = _("Select analysis method"),
     ),
 ),
 ReferenceField('Instrument',
     schemata = "Method",
     searchable = True,
     required = 0,
     vocabulary_display_path_bound = sys.maxint,
     vocabulary = 'getInstruments',
     allowed_types = ('Instrument',),
     relationship = 'AnalysisServiceInstrument',