LIMS-1391 Configurable object identifiers #1885
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provides an interface 'IHaveIdentifiers' which allows objects providing it to be referred to by multiple configurable IDs. This can be used to allow objects to have CAS numbers assigned to them, or to allow a Patient record to be looked up via a national ID, driver's license, or hospital record number.
To use this:
Provide the bika.lims.interfaces.IHaveIdentifiers interface on your object. These objects will now have a new field added to their schema called 'Identifiers'. The field contains a list of dictionaries: {'IdentifierType', 'Identifier', 'Title'}.
Enter Bika Setup, and select "Identifier Types". Here you can configure the name and description of all types of identifiers to be used on the system. You can also specify a list of portal_types which each identifier type can be used to identify.
A new KeywordIndex index 'Identifiers' is added to portal_catalog, bika_catalog and bika_setup_catalog.
The field is flagged 'searchable=True' so 'Identifier' values are available in the SearchText ZCFullText index.
This commit adds an IdentifierType called 'CAS Nr' representing Chemical Abstract Service registry numbers, and applies the IHaveIdentifiers interface to AnalysisServices