Barcode Prefixes in Consortial Environment RFC

== Barcode Prefixes in Consortia ==
=== Synopsis: ===
This rfc describes changes made to core Koha to enable multiple libraries with potentially overlapping item and patron barcodes to merge their collections and patrons into a single Koha database.
=== Details: ===
Libraries with overlapping barcodes (items and patrons) currently must rebarcode their collections in order to coexist in a single Koha installation.
This RFC outlines proposed modifications to Koha's functionality to allow libraries to merge collections into a single Koha instance, decreasing overall maintenance overhead and giving them access to Koha's resource sharing features.
This work encompasses:
* auto-insertion of institution-code prefixes to inputs on circulation functions and cataloging;
* addition of system-wide barcode length definitions;
* extension of autobarcode calculation to use ranges defined by those prefixes and string lengths;
* addition of jacket-sleeve barcode image printing, allowing materials to circulate between libraries.
Two collections with overlapping barcode sets may be merged into a single Koha database by defining a system-wide barcode length and a branch-level prefix. It is assumed that the incoming data will be prefixed and padded prior to import so that the imported items & patrons fit this schema. When a patron or item barcode is scanned that is shorter than the defined system lengths (system preferences), Koha will add the prefix and pad as necessary based on the transaction branch location. If a scanned barcode is equal to or greater than the system-wide length, Koha will make no modifications. This allows sites to engage in long-term rebarcoding projects, eventually allowing them to turn off this feature.
Since Koha must know the transaction location in order to determine which item is scanned, transfers between libraries cannot be allowed without affixing a temporary full-length barcode to an item. The existing hold-transfer slip is extended to allow printing of the full system barcode on a jacket sleeve, thus allowing materials to circulate between different libraries. The sleeve is only required for items with 'short' barcodes.
=== Database changes: ===
two columns are added to branches: 
itembarcodeprefix & patronbarcodeprefix. 
=== API Changes: ===
Items.pm is modified to parse and alter a cataloged barcode if the relevant system preferences are ON.
Existing Circulation.pm barcode filter is extended.
=== System Preferences: ===
* itembarcodelength : Specifies the system-wide barcode length for items.
* patronbarcodelength: Specifies the system-wide barcode length for patron cardnumbers. 
* enforce_barcode_prefix: Turns on autoparsing in cataloging and patron 
* existing itembarcodefilter is also extended to add prefix option.
=== Added Dependencies: ===
GD::Barcode is used to generate the barcode on the jacket sleeve, allowing a library to send its items to another library. This dependency only occurs in one newly added script, thus the dependency is only required for those using this feature. No other dependencies are added.
=== Interaction with other Koha features: ===
This feature plays nicely with independent branches.
=== Limitations: ===
* This feature is primarily intended to allow many smaller libraries to adopt a single system. Since parsing of barcodes happens with every transaction, some optimization of the barcode modifications may be required for a high-transaction rate library system.
* The system will not validate barcode schemas on every import or modification of records -- doing so would be too costly. It is possible to import via bulkmarcimport or stage & commit (or patron import) interface barcodes that do not fit the schema.
Category:Abandoned_RFC