Feature #12020

Updated by Dan Gillean about 2 years ago

AtoM supports the ability to create de-accession records and associate them with an accession record. However, while an accession record CSV import option currently exists, there is no way to import deaccession records.

This feature will add a new command-line task to AtoM, giving system administrators the ability to import deaccessions data into AtoM. Multiple rows of data (aka multiple deaccession records) can target the same accession record. This current feature ticket does *not* include time to add support for this task to the user interface.

The expected CSV will have 7 columns, corresponding to various fields available in the Deaccession record template. These include:

* *accessionNumber*: expects the accession number of an existing accession record in AtoM as input. If no match is found for an existing accession, the console will provide a warning, the row will be skipped, and the task will continue.
* *deaccessionNumber*: an identifier for the deaccession. Free text, will support symbols and typographical marks such as dashes and slashes
*date*: expects a date value in ISO-8601 format (YYYY-MM-DD)
* *scope*: expects one of the controlled terms from the "Scope" field in the AtoM deaccession record template. English options include "Whole" and "Part"
* *description*: Free-text. Identify what materials are being deaccessioned.
* *extent*: Free-text. Identify the number of units and the unit of measurement for the amount of records being deaccessioned.
* *reason*: Free-text. Provide a reason why the records are being deaccessioned
* culture*: Expects a 2-letter ISO 639-1 language code as input (e.g.: en, fr, es, pt, etc)

More than 1 row of data can be associated with the same accession record. To prevent accidental exact duplicates, by default AtoM will skip any rows where all data is identical to a row preceding it, and will report the skipped record in the console log. If you are intentionally importing duplicate deaccession records, you can use the --ignore-duplicates option.

If you wish a summary of warnings reported in the console log, you can use the --error-log option - it takes a path to a new text file as input, and will copy all console warnings to this log file. Acceptable file extensions for the log file are .txt or .log.

Basic syntax of the command:

php symfony csv:deaccession-import lib/task/import/example/example_deaccessions.csv

Full help text for the new CLI task:

php symfony help csv:deaccession-import

symfony csv:deaccession-import [--application[="..."]] [--env="..."] [--connection="..."] [--rows-until-update[="..."]] [--skip-rows[="..."]] [--error-log[="..."]] [--ignore-duplicates] filename
filename The input file (csv format).
--application The application name (default: qubit)
--env The environment (default: cli)
--connection The connection name (default: propel)
--rows-until-update Output total rows imported every n rows.
--skip-rows Skip n rows before importing.
--error-log File to log errors to.
--ignore-duplicates Load all records from csv, including duplicates.
Import CSV deaccession data

An example of the CSV template has been attached to this issue for reference - you can also find a copy in AtoM, at: