#72 closed enhancement (fixed)

Refactor AICIS listing note mechanism for batch operation

Reported by: Mike Dewhirst Owned by: Mike Dewhirst
Priority: medium Version: 1.x
Keywords: AICIS listing notes batch management command Cc:

Description

Ticket #71 "Bulk import and Listing report" was motivated by a need to monitor AICIS inventory changes as they applied to chemicals in Chemintro.

Prior to commencing on #71 we need to ensure the AICIS listing note system is refactored so it can be executed in batch as well as individually when - as currently - a chemical is saved with a blank AICIS listing field.

This ticket calls for a batch note generation system with no change to the current default or manual system.

Change History (3)

comment:1 by Mike Dewhirst, 13 months ago

Management batch command scan_cas_for_aiic_change is now working as follows:

  1. The chemical itself will re-examine the inventory to compare with its AICIS listing note (or otherwise create it) whenever the chemical is saved with a blank selection in the AICIS listing field OR if save() is called from the new management batch command. The latter is the real outcome of this ticket.
  1. Re-examination means the central part of the note, which is based on the wording in the inventory, is re-computed and note content is checked to see if it contains that exact wording. If no change is detected the note is left untouched. This means the note can be edited so long as the computed content is not changed. Otherwise the system will think the inventory has changed and it will leap into action!

Leaping into Action

If AICIS make changes to an inventory chemical which result in a change of note title (see below), Chemintro will adjust the title of the previous note by adding the words " - now irrelevant" and create a new note for the new inventory situation.

If AICIS change the wording slightly, perhaps adjusting a percentage value or merely punctuation, that will be detected and the note content re-computed. The system will then insert the re-computed content above the old with a tag "Previous note from <date of previous note>". That will also happen if you edit the computed content of the note so it no longer exactly matches the inventory content!

Consequences

Part of note construction for all notes (except the first two in the list below) is an acknowledgment mechanism. On trying to save your chemical, it will be an error preventing progress if a note requiring acknowledgment has been ignored.

The new management command resets that acknowledgment trigger if it leaps into action for any note.

Below

These are the automatic selections in the AICIS listing field made by Chemintro. That field label plus the actual selection together form the note title.

  • Searched for but not found
  • Listed with standard reporting obligations and restrictions
  • Listed with a defined scope of assessment
  • Listed with a defined scope of assessment and conditions of introduction or use
  • Listed with a defined scope of assessment, conditions of introduction or use and specific information requirements
  • Listed with a defined scope of assessment and specific information requirements
  • Listed with conditions of introduction or use
  • Listed with conditions of introduction or use and specific information requirements
  • Listed with specific information requirements
  • Listed but NOT within any defined scope or conditions of introduction

PS
The new management command is currently executed manually as required following changes to the inventory. However, the system is designed so that anyone in the Authority group has the capacity to not only run the EVA update process (See Ticket #64) but also manually adjust our inventory records. Therefore, it is intended to automate running of this scan_cas_for_aiic_change management command on a regular basis. It does nothing if there are no changes so it might usefully be executed nightly. See ticket #73.

Last edited 13 months ago by Mike Dewhirst (previous) (diff)

comment:2 by Mike Dewhirst, 13 months ago

Keywords: batch management command added
Owner: set to Mike Dewhirst
Summary: Refactor AICIS listing note mechanismRefactor AICIS listing note mechanism for batch operation

comment:3 by Mike Dewhirst, 13 months ago

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.