Delink kit from visit event and SRs
Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com

Delink kit from visit event and SRs

Currently, there is no user interface (UI), API, or CSV option available to unlink the kit from the visit.

Use Case:

  1. A kit is created for Event 1.

  2. It is accidentally used for Event 2.

  3. The user moves the visit from Event 2 back to Event 1.

  4. The user is not permitted to edit any specimens from the relocated visit.

  5. An error message is displayed: “Supply item 1000042405 is reserved for specimens of Event 2. (SUPPLY_FORBIDDEN_CPE)” when attempting to update any specimen.

 

The only way to resolve this issue is through the database.

Please execute the following steps on the test server first to ensure everything is functioning correctly, and once confirmed, proceed with the changes on the production server.

  1. Execute the command below, replacing 'barcode' with the visit name or kit barcode:

SELECT * FROM os_supply_items WHERE BARCODE='1104782'

For multiple barcodes, use the command as needed.

SELECT * FROM os_supply_items WHERE BARCODE IN ('1104782', '1104783', '1104784');
Screenshot 2025-05-06 at 8.55.22 AM.png
  1. You will receive the supply_id, which you can also verify through the user interface (UI).

Screenshot 2025-05-06 at 8.49.28 AM.png
  1. Identify all entities associated with this supply.

    SELECT * FROM os_supply_items WHERE supply_id = 2447 AND consumption_date IS NOT NULL;
Screenshot 2025-05-06 at 8.55.38 AM.png
  1. The above specimens and their associated visit are linked to Event 1.

  2. The column CPE_ID refers to the identifier for Event 2, while SR_ID indicates the specimen requirement identifier under Event 2.

  3. To unlink them from the previous event and specimen requirement, execute the commands below:

    UPDATE os_supply_items SET cpe_id = NULL, sr_id = NULL WHERE supply_id = 2447 AND consumption_date IS NOT NULL;
  4. After this, you should be able to update the specimens without any error.

 

 

Got feedback or spotted a mistake?

Leave a comment at the end of this page or email contact@krishagni.com