Class: Lab::VoidOrderJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/lab/void_order_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(order_id) ⇒ Object



7
8
9
10
11
12
13
14
15
# File 'app/jobs/lab/void_order_job.rb', line 7

def perform(order_id)
  Rails.logger.info("Voiding order ##{order_id} in LIMS")

  User.current = Lab::Lims::Utils.lab_user
  Location.current = Location.find_by_name('ART clinic')

  worker = Lab::Lims::PushWorker.new(Lab::Lims::ApiFactory.create_api)
  worker.push_order(Lab::LabOrder.unscoped.find(order_id))
end