Exemple #1
0
class SampleTypeSchemaExtender(object):
    adapts(ISampleType)
    implements(IOrderableSchemaExtender)

    fields = [
        ExtReferenceField(
            'Service',
            schemata='Analyses',
            multiValued=1,
            allowed_types=('AnalysisService', ),
            relationship='SampleTypeAnalysisService',
            widget=ProjectAnalysesWidget(
                label=_("Sample Analyses"),
                description=
                _("The analyses included in this sample type, grouped per category"
                  ),
            )),
    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        return self.fields

    def getOrder(self, schematas):
        return schematas
Exemple #2
0
class SampleTypeSchemaExtender(object):
    adapts(ISampleType)
    implements(IOrderableSchemaExtender)

    fields = [
        ExtReferenceField(
            'Service',
            schemata='Analyses',
            multiValued=1,
            allowed_types=('AnalysisService', ),
            relationship='SampleTypeAnalysisService',
            widget=ProjectAnalysesWidget(
                label=_("Sample Analyses"),
                description=
                _("The analyses included in this sample type, grouped per category"
                  ),
            )),
        ExtReferenceField(
            'SampleMatrix',
            required=0,
            allowed_types=('SampleMatrix', ),
            vocabulary='SampleMatricesVocabulary',
            relationship='SampleTypeSampleMatrix',
            referenceClass=HoldingReference,
            widget=ReferenceWidget(checkbox_bound=0,
                                   label=_("Sample Matrix"),
                                   visible=False),
        ),
        ReferenceField(
            'ContainerType',
            required=0,
            allowed_types=('ContainerType', ),
            vocabulary='ContainerTypesVocabulary',
            relationship='SampleTypeContainerType',
            widget=ReferenceWidget(
                checkbox_bound=0,
                label=_("Default Container Type"),
                visible=False,
                description=_(
                    "The default container type. New sample partitions "
                    "are automatically assigned a container of this "
                    "type, unless it has been specified in more details "
                    "per analysis service"),
            ),
        ),
        ExtReferenceField(
            'SamplePoints',
            required=0,
            multiValued=1,
            allowed_types=('SamplePoint', ),
            vocabulary='SamplePointsVocabulary',
            relationship='SampleTypeSamplePoint',
            widget=bika_ReferenceWidget(
                label=_("Sample Points"),
                visible=False,
                description=_(
                    "The list of sample points from which this sample "
                    "type can be collected.  If no sample points are "
                    "selected, then all sample points are available."),
            ),
        ),
        ExtBooleanField('HasBabyNumber',
                        default=False,
                        widget=BooleanWidget(
                            label=_("Has Baby Number"),
                            description=_('Sample Type that has Baby No.'),
                        )),
        ExtStringField(
            'ChangeUserName',
            widget=StringWidget(
                label=_('ChangeUserName'),
                description=_(
                    'The user who created or last made a change to this sample.'
                ),
                visible={
                    'view': 'invisible',
                    'edit': 'invisible'
                })),
        ExtDateTimeField(
            'ChangeDateTime',
            widget=StringWidget(
                label=_('ChangeDateTime'),
                description=
                _('The date and time when the sample was created or last updated.'
                  ),
                visible={
                    'view': 'invisible',
                    'edit': 'invisible'
                })),
    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        return self.fields

    def getOrder(self, schematas):
        return schematas
Exemple #3
0
         label=_("Biospecimen Type"),
         description=_(
             "Multi-select widget. Use to select more than one biospecimen type. Selecting a biospecimen type import "
             "the corresponding analysis services."),
         visible={
             'edit': 'visible',
             'view': 'visible'
         },
     )),
 ReferenceField('Service',
                required=0,
                multiValued=1,
                allowed_types=('AnalysisService', ),
                relationship='BiospecimenAnalysisService',
                widget=ProjectAnalysesWidget(
                    label=_("Analyses"),
                    description="",
                )),
 DateTimeField('DateCreated',
               mode="rw",
               read_permission=permissions.View,
               write_permission=permissions.ModifyPortalContent,
               widget=DateTimeWidget(
                   label=_("Date Created"),
                   visible={
                       'edit': 'invisible',
                       'view': 'invisible'
                   },
               )),
 StringField(
     'ChangeUserName',
     widget=StringWidget(
Exemple #4
0
from bika.lims.content.bikaschema import BikaSchema
from baobab.lims.interfaces import IBiospecType
from Products.Archetypes.public import *
from zope.interface import implements
from baobab.lims.browser.widgets import ProjectAnalysesWidget
from baobab.lims import bikaMessageFactory as _

schema = BikaSchema.copy() + Schema((
    ReferenceField('Service',
                   required=1,
                   multiValued=1,
                   allowed_types=('AnalysisService',),
                   relationship='BiospecimenAnalysisService',
                   widget=ProjectAnalysesWidget(
                       label=_("Analyse Services"),
                       description=_("Multi-checkboxes table. Use the suitable services for the current "
                                     "biospecimen-type"),
                   )),
))
schema['description'].widget.visible = True
schema['description'].schemata = 'default'


class BiospecType(BaseContent):
    implements(IBiospecType)
    security = ClassSecurityInfo()
    displayContentsTab = False
    schema = schema

    _at_rename_after_creation = True
Exemple #5
0
class SampleTypeSchemaExtender(object):
    adapts(ISampleType)
    implements(IOrderableSchemaExtender)

    fields = [
        ExtReferenceField(
            'Service',
            schemata='Analyses',
            multiValued=1,
            allowed_types=('AnalysisService', ),
            relationship='SampleTypeAnalysisService',
            widget=ProjectAnalysesWidget(
                label=_("Sample Analyses"),
                description=
                _("The analyses included in this sample type, grouped per category."
                  ),
            )),
        ExtReferenceField(
            'SampleMatrix',
            required=0,
            allowed_types=('SampleMatrix', ),
            vocabulary='SampleMatricesVocabulary',
            relationship='SampleTypeSampleMatrix',
            referenceClass=HoldingReference,
            widget=ReferenceWidget(checkbox_bound=0,
                                   label=_("Sample Matrix"),
                                   visible=False),
        ),
        ReferenceField(
            'ContainerType',
            required=0,
            allowed_types=('ContainerType', ),
            vocabulary='ContainerTypesVocabulary',
            relationship='SampleTypeContainerType',
            widget=ReferenceWidget(
                checkbox_bound=0,
                label=_("Default Container Type"),
                visible=False,
                description=_(
                    "The default container type. New sample partitions "
                    "are automatically assigned a container of this "
                    "type, unless it has been specified in more details "
                    "per analysis service"),
            ),
        ),
        ExtReferenceField(
            'SamplePoints',
            required=0,
            multiValued=1,
            allowed_types=('SamplePoint', ),
            vocabulary='SamplePointsVocabulary',
            relationship='SampleTypeSamplePoint',
            widget=bika_ReferenceWidget(
                label=_("Sample Points"),
                visible=False,
                description=_(
                    "The list of sample points from which this sample "
                    "type can be collected.  If no sample points are "
                    "selected, then all sample points are available."),
            ),
        ),
    ]

    def __init__(self, context):
        self.context = context

    def getFields(self):
        return self.fields

    def getOrder(self, schematas):
        return schematas