description=_( "Select an Import/Export interface for this instrument."), visible=False, ), ), #TODO: To be removed? RecordsField( 'DataInterfaceOptions', type='interfaceoptions', subfields=('Key', 'Value'), required_subfields=('Key', 'Value'), subfield_labels={ 'OptionValue': _('Key'), 'OptionText': _('Value'), }, widget=RecordsWidget( label=_("Data Interface Options"), description= _("Use this field to pass arbitrary parameters to the export/import modules." ), visible=False, ), ), # References to all analyses performed with this instrument. # Includes regular analyses, QC analyes and Calibration tests. ReferenceField( 'Analyses', required=0, multiValued=1,
from baobab.lims.interfaces import IKitTemplate schema = BikaSchema.copy() + Schema(( RecordsField( 'ProductList', schemata='Product List', type='productList', subfields=('product', 'quantity', 'product_uid'), subfield_hidden = {'product_uid': True}, required_subfields=('product', 'quantity', 'product_uid'), subfield_sizes={'product': 50, 'quantity': 5,}, subfield_labels={'product': _('Product'), 'quantity': _('Quantity'), }, widget=RecordsWidget( label = _("Product List"), description=_("Select complete list of the components required to create this kit"), combogrid_options={ 'product': { 'colModel': [{'columnName':'product', 'width':'30', 'label':_('Title')}, {'columnName':'Description', 'width':'70', 'label':_('Description')}, {'columnName': 'product_uid', 'hidden': True}], 'url': 'getproducts', 'showOn': True, 'width': '550px' }, }, ), ), FixedPointField( 'Cost', schemata='Accounting',
"InstrumentUID", expression= "context.getInstrument() and context.getInstrument().UID() or None", widget=ComputedWidget(visible=False, ), ), StringField( "Type", vocabulary="getTaskTypes", widget=ReferenceWidget( checkbox_bound=0, label=_("Task type", "Type"), ), ), RecordsField( "ScheduleCriteria", required=1, type="schedulecriteria", widget=ScheduleInputWidget(label=_("Criteria"), ), ), TextField( "Considerations", default_content_type="text/plain", allowed_content_types=("text/plain", ), default_output_type="text/plain", widget=TextAreaWidget( label=_("Considerations"), description=_("Remarks to take into account before performing the " "task"), ), ), ))
], ), ), RecordField( "Metadata", multiValued=True, ), BlobField( "Pdf", ), RecordsField( "Recipients", type="recipients", subfields=( "UID", "Username", "Fullname", "EmailAddress", "PublicationModes" ), ), DateTimeField( "DatePrinted", mode="rw", widget=DateTimeWidget( label=_("Date Printed"), visible={ "edit": "visible", "view": "visible", } ),
from bika.lims.browser.widgets import RecordsWidget from bika.lims.content.bikaschema import BikaSchema from bika.health.config import PROJECTNAME from Products.Archetypes.public import * from Products.ATExtensions.ateapi import RecordsField from zope.interface import implements schema = BikaSchema.copy() + Schema((RecordsField( 'AetiologicAgentSubtypes', type='aetiologicagentsubtypes', subfields=('Subtype', 'SubtypeRemarks'), subfield_labels={ 'Subtype': _('Subtype'), 'SubtypeRemarks': _('Remarks') }, subfield_sizes={ 'Subtype': 10, 'SubtypeRemarks': 25 }, widget=RecordsWidget( label='Subtypes', description=_("A list of aetiologic agent subtypes."), visible=True, ), ), )) schema['description'].widget.visible = True schema['description'].schemata = 'default' class AetiologicAgent(BaseContent): security = ClassSecurityInfo() displayContentsTab = False
), ), StringField( 'IDServerURL', schemata="ID Server", widget=StringWidget( label=_("ID Server URL"), description=_("The full URL: http://URL/path:port") ), ), RecordsField( 'RejectionReasons', schemata="Analyses", widget=RejectionSetupWidget( label=_("Enable the rejection workflow"), description=_("Select this to activate the rejection workflow " "for Samples and Analysis Requests. A 'Reject' " "option will be displayed in the actions menu for " "these objects.") ), ), BooleanField( 'NotifyOnRejection', schemata="Analyses", default=False, widget=BooleanWidget( label=_("Email notification on rejection"), description=_("Select this to activate automatic notifications " "via email to the Client when a Sample or Analysis " "Request is rejected.") ),
from bika.lims.content.bikaschema import BikaSchema schema = BikaSchema.copy() + Schema(( ReferenceField( 'AnalysisRequest', allowed_types=('AnalysisRequest', ), relationship='ReportAnalysisRequest', referenceClass=HoldingReference, required=1, ), BlobField('Pdf', ), StringField('Html', ), StringField('SMS', ), RecordsField( 'Recipients', type='recipients', subfields=('UID', 'Username', 'Fullname', 'EmailAddress', 'PublicationModes'), ), )) schema['id'].required = False schema['title'].required = False class ARReport(BaseFolder): security = ClassSecurityInfo() displayContentsTab = False schema = schema _at_rename_after_creation = True
widget=ReferenceWidget(visible={ 'edit': 'invisible', 'view': 'invisible', }, ), ), )) TrailingSchema = Schema(( RecordsField( 'identifiers', searchable=0, required=0, languageIndependent=1, is_duplicates_criterion=False, subfields=('label', 'value'), subfield_labels={'label': 'Identifier'}, subfield_vocabularies={ 'label': 'publicationIdentifiers', }, widget=RecordsWidget( i18n_domain="cmfbibliographyat", label=u"Identifiers", ), ), LinesField( 'keywords', searchable=1, required=0, languageIndependent=1, is_duplicates_criterion=False, multiValued=1, widget=KeywordWidget(
'BirthDate', required=1, validators=('isDateFormat', ), widget=DateTimeWidget_bl( label=_('Birth date'), datepicker_nofuture=1, ), ), BooleanField( 'BirthDateEstimated', default=False, widget=BooleanWidget(label=_('Birth date is estimated'), ), ), RecordsField( 'AgeSplitted', required=1, widget=SplittedDateWidget(label=_('Age'), ), ), ComputedField( 'AgeSplittedStr', expression="context.getAgeSplittedStr()", widget=ComputedWidget(visible=False), ), AddressField( 'CountryState', widget=AddressWidget( searchable=True, label=_("Country and state"), showLegend=True, showDistrict=True, showCopyFrom=False,
type="metadata", subfields=( "paperformat", "timestamp", "orientation", "template", "contained_requests", ), ), RecordsField( "SendLog", type="sendlog", subfields=( "actor", "actor_fullname", "email_send_date", "email_recipients", "email_responsibles", "email_subject", "email_body", "email_attachments", ), ), TextField( "Html" ), BlobField( "Pdf", default_content_type="application/pdf", ), RecordsField( "Recipients",
# This field is not editable and is generated automatically based on the rows, # columns and occupied positions. It returns a list of dicts. Each dict # represents an object stored within this container at the given 'column' and # 'row' keys. The UID of the object is stored as a value for the key 'uid'. # "capacity" refers to the number of samples the contained object can store # directly or indirectly (through other child containers). "utilization" field # refers to the number of sample the contained object actually stores directly # or indirectly. # The total capacity and utilization of this container is the sum of values of # the capacity and utilization of the objects this container stores. PositionsLayout = RecordsField(name="PositionsLayout", subfields=("row", "column", "uid", "samples_capacity", "samples_utilization"), subfield_types={ "row": "int", "column": "int", "samples_capacity": "int", "samples_utilization": "int" }, widget=RecordsWidget(visible=False)) AvailablePositions = LinesField(name="AvailablePositions", required=0, subfields=("row", "column"), widget=LinesWidget(visible=False)) schema = BikaFolderSchema.copy() + Schema(( Rows, Columns, PositionsLayout,
RecordsField( 'AdmittedStickerTemplates', subfields=( 'admitted', SMALL_DEFAULT_STICKER, LARGE_DEFAULT_STICKER, ), subfield_labels={ 'admitted': _( 'Admitted stickers for the sample type'), SMALL_DEFAULT_STICKER: _( 'Default small sticker'), LARGE_DEFAULT_STICKER: _( 'Default large sticker')}, subfield_sizes={ 'admitted': 6, SMALL_DEFAULT_STICKER: 1, LARGE_DEFAULT_STICKER: 1}, subfield_types={ 'admitted': 'selection', SMALL_DEFAULT_STICKER: 'selection', LARGE_DEFAULT_STICKER: 'selection' }, subfield_vocabularies={ 'admitted': sticker_templates(), SMALL_DEFAULT_STICKER: '_sticker_templates_vocabularies', LARGE_DEFAULT_STICKER: '_sticker_templates_vocabularies', }, required_subfields={ 'admitted': 1, SMALL_DEFAULT_STICKER: 1, LARGE_DEFAULT_STICKER: 1}, default=[{}], fixedSize=1, widget=SampleTypeStickersWidget( label=_("Admitted sticker templates"), description=_( "Defines the stickers to use for this sample type."), allowDelete=False, ), ),
searchable = True, widget = ComputedWidget( visible = False, ), ), RecordsField('Uncertainties', schemata = "Uncertainties", type = 'uncertainties', subfields = ('intercept_min', 'intercept_max', 'errorvalue'), required_subfields = ('intercept_min', 'intercept_max', 'errorvalue'), subfield_sizes = {'intercept_min': 10, 'intercept_max': 10, 'errorvalue': 10, }, subfield_labels = {'intercept_min': _('Range min'), 'intercept_max': _('Range max'), 'errorvalue': _('Uncertainty value'), }, widget = RecordsWidget( label = _("Uncertainty"), description = _("Specify the uncertainty value for a given range, e.g. for results " "in a range with minimum of 0 and maximum of 10, the uncertainty " "value is 0.5 - a result of 6.67 will be reported as 6.67 +- 0.5. " "Please ensure successive ranges are continuous, e.g. 0.00 - 10.00 " "is followed by 10.01 - 20.00, 20.01 - 30 .00 etc."), ), ), RecordsField('ResultOptions', schemata = "Result Options", type = 'resultsoptions', subfields = ('ResultValue','ResultText'), required_subfields = ('ResultValue','ResultText'),
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', required=1, multiValued=1, allowed_types=('Analysis', 'DuplicateAnalysis', 'ReferenceAnalysis', 'RejectAnalysis'), relationship = 'WorksheetAnalysis', ), StringField('Analyst', searchable = True, ), # TODO Remove. Instruments must be assigned directly to each analysis. ReferenceField('Instrument', required = 0,
default='', visible=True, ), ), RecordsField( 'ResultFilesFolder', subfields=('InterfaceName', 'Folder'), subfield_labels={ 'InterfaceName': _('Interface Code'), 'Folder': _('Folder that results will be saved') }, subfield_readonly={ 'InterfaceName': True, 'Folder': False }, widget=RecordsWidget( label=_("Result files folders"), description=_("For each interface of this instrument, \ you can define a folder where \ the system should look for the results files while \ automatically importing results. Having a folder \ for each Instrument and inside that folder creating \ different folders for each of its Interfaces \ can be a good approach. You can use Interface codes \ to be sure that folder names are unique."), visible=True, ), ), RecordsField( 'DataInterfaceOptions', type='interfaceoptions', subfields=('Key', 'Value'),
Uncertainties = RecordsField( 'Uncertainties', schemata="Uncertainties", type='uncertainties', subfields=('intercept_min', 'intercept_max', 'errorvalue'), required_subfields=('intercept_min', 'intercept_max', 'errorvalue'), subfield_sizes={ 'intercept_min': 10, 'intercept_max': 10, 'errorvalue': 10, }, subfield_labels={ 'intercept_min': _('Range min'), 'intercept_max': _('Range max'), 'errorvalue': _('Uncertainty value'), }, subfield_validators={ 'intercept_min': 'uncertainties_validator', 'intercept_max': 'uncertainties_validator', 'errorvalue': 'uncertainties_validator', }, widget=RecordsWidget( label=_("Uncertainty"), description=_( "Specify the uncertainty value for a given range, e.g. for " "results in a range with minimum of 0 and maximum of 10, " "where the uncertainty value is 0.5 - a result of 6.67 will be " "reported as 6.67 +- 0.5. You can also specify the uncertainty " "value as a percentage of the result value, by adding a '%' to " "the value entered in the 'Uncertainty Value' column, e.g. for " "results in a range with minimum of 10.01 and a maximum of 100, " "where the uncertainty value is 2% - a result of 100 will be " "reported as 100 +- 2. Please ensure successive ranges are " "continuous, e.g. 0.00 - 10.00 is followed by 10.01 - 20.00, " "20.01 - 30 .00 etc."), ))
), ), StringField('Type', vocabulary = "getTaskTypes", widget = ReferenceWidget( checkbox_bound = 1, label = _("Task type", "Type"), ), ), RecordsField('ScheduleCriteria', required=1, type='schedulecriteria', widget=ScheduleInputWidget( label=_('Criteria'), ), ), TextField('Considerations', default_content_type = 'text/x-web-intelligent', allowable_content_types = ('text/x-web-intelligent',), default_output_type="text/html", widget = TextAreaWidget( label = _("Considerations"), description = _("Remarks to take into account before performing the task"), ), ), ))