Removing Orders from RxXplore

There are cases where orders may be synced from RxUniverse sometime in the past, but get removed due to one reason or another. These orders will remain in RxXplore and you may want to remove them from the database for reporting reasons.

 Instructions

  1. Create a CSV file containing order numbers as the first column.

    1. This can be done as an export in rx-reports, or manually created.

    2. It can also be a new-line delimited list of order numbers

  2. Run bundle exec rails runner -e production lib/del_orders.rb <path_to_file> within the rx-xplore directory

  3. This wil remove all orders listed in the file.

The input file can contain duplicate order numbers, it won’t effect the run.

 Related articles