Changes between Initial Version and Version 1 of Ticket #802, comment 15


Ignore:
Timestamp:
Sep 3, 2015, 2:31:32 PM (9 years ago)
Author:
olle

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #802, comment 15

    initial v1  
    11Functional specification update:
    22
    3  * Case registration should be updated to create new plates for specimens, DNA, or RNA, if needed, instead of relying on the administrator to have created the plate items in advance.
     3 * Case registration should be updated to create new plate for specimens, DNA, or RNA, if needed, instead of relying on the administrator to have created the plate items in advance.
     4
     5Design discussion:
     6
     7Several issues need to be addressed to implement automatic creation of storage box items:
     8
     9 * The function for finding recommended locations for a particular type of item needs to be updated to prepare for new storage boxes, if the number of free wells in existing boxes is not sufficient.[[BR]][[BR]]a. The name should be consistent with a storage box for the particular type of item, and the number should be the next expected one.[[BR]]b. Values for storage location (hardware, section, tray, position) should be set to expected values. Currently these values are not used, but this may be an issue in the future.[[BR]][[BR]]
     10 * Validation of modified storage locations should not report an error, if the specified storage box doesn't exist.
     11 * At registration, any needed new storage box item should be created once only, and then reused, if needed.
     12
     13Design specification:
     14
     15 1. Java servlet class/file `SpecimenTubeServlet.java` in `src/net/sf/basedb/meludi/servlet/` should be updated:[[BR]]a. Protected method `void doGet(HttpServletRequest req, HttpServletResponse resp)` updated for command "`ValidateWell`" to call new private method `BioPlate createStorageBox(DbControl dc, String plateName)` to get a new bio plate item, if no existing storage box with the specified name exists.[[BR]]b. Private method `JSONArray findFreeWells(DbControl dc, Integer nofTubes, String storageBoxSuffix, Boolean fillGaps)` updated to call new private method `BioPlate createStorageBox(DbControl dc, String platePrefix, String plateSuffix, int plateNumber)`get a new bio plate item, if no existing storage box with the specified name exists. New private convenience method `JSONArray updateJsonWells(JSONArray jsonWells, BioPlate box, Integer nofWellsNeeded, Boolean fillGaps)` is called to update the JSONArray of proposed wells, both for existing and new storage boxes.[[BR]]c. New private convenience method `JSONArray updateJsonWells(JSONArray jsonWells, BioPlate box, Integer nofWellsNeeded, Boolean fillGaps)` added. It updates a JSONArray with wells to use for the specified storage box. The core code is taken from the previous version of private method `JSONArray findFreeWells(DbControl dc, Integer nofTubes, String storageBoxSuffix, Boolean fillGaps)`.[[BR]]d. Protected method `void doPost(HttpServletRequest req, HttpServletResponse resp)` updated for command "`CreateSpecimenTubes`" to create a `HashMap<String, BioPlate>` item that is given as argument in calls of updated private methods `BioWell fetchBioWell(DbControl dc, JSONObject jsonSpec, HashMap<String, BioPlate> bioPlateNamePlateHashMap)` and `BioWell fetchBioWell(DbControl dc, JSONObject jsonSpec, HashMap<String, BioPlate> bioPlateNamePlateHashMap, String boxType)`.[[BR]]e. Private method `BioWell fetchBioWell(DbControl dc, JSONObject jsonSpec, HashMap<String, BioPlate> bioPlateNamePlateHashMap)` updated with new argument `HashMap<String, BioPlate> bioPlateNamePlateHashMap`, that is used as argument when calling updated private method `BioWell fetchBioWell(DbControl dc, JSONObject jsonSpec, HashMap<String, BioPlate> bioPlateNamePlateHashMap, String boxType)`.[[BR]]f. Private method `BioWell fetchBioWell(DbControl dc, JSONObject jsonSpec, HashMap<String, BioPlate> bioPlateNamePlateHashMap, String boxType)` updated with new argument `HashMap<String, BioPlate> bioPlateNamePlateHashMap`. If no storage box item with the name specified in argument `jsonSpec` exists, a check is made if a created item with the desired name exists in the hash map, in which case the former is used, otherwise new private method `BioPlate createStorageBox(DbControl dc, String plateName)` is called to provide one. If a new storage box item is created, it is marked to be saved in the database by calling `dc.saveItem()`, with the item as argument, after which it is added as value in the hash map, using the storage box name as key.[[BR]]. g. New private method `BioPlate createStorageBox(DbControl dc, String platePrefix, String plateSuffix, int plateNumber)` added. It creates a storage box name from the input arguments and then calls new private method `BioPlate createStorageBox(DbControl dc, String plateName)` to create a storage box item, that is returned. [[BR]]h. New private method `BioPlate createStorageBox(DbControl dc, String plateName)` added. It preforms database queries to obtain plate geometry and bio plate type items for storage boxes, which is used to create a new `BioPlate` storage box item with the desired name. The created storage box item is then returned. Database queries are performed for the plate geometry and bio plate type items, instead of creating new items, since the `BioPlate` storage box item contains links to the former items.