Class: Radiology::RadiologyController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/radiology/radiology_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
# File 'app/controllers/radiology/radiology_controller.rb', line 5

def create
  patient_details, physician_details, radiology_orders = params.require %i[patient_details physician_details radiology_orders]
  radiology_orders = service.generate_msi(patient_details,physician_details, radiology_orders)
  render json: radiology_orders, status: :created
end

#indexObject



14
15
16
# File 'app/controllers/radiology/radiology_controller.rb', line 14

def index
  render json: service.get_previous_orders(params[:patient_id])
end


18
19
20
21
22
23
24
# File 'app/controllers/radiology/radiology_controller.rb', line 18

def print_order_label
  label = service.print_radiology_barcode(params[:accession_number],params[:patient_national_id], params[:patient_name], params[:radio_order], params[:date_created])
  send_data(label, type: 'application/label; charset=utf-8',
                         stream: false,
                         filename: "#{SecureRandom.hex(24)}.lbl",
                         disposition: 'inline')
end

#serviceObject



25
26
27
# File 'app/controllers/radiology/radiology_controller.rb', line 25

def service
  Radiology::RadiologyService
end

#showObject



10
11
12
# File 'app/controllers/radiology/radiology_controller.rb', line 10

def show
  render json: service.get_radiology_orders(params[:id])
end