Class: Lab::ResultsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/lab/results_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/lab/results_controller.rb', line 5

def create
  result_params = params.require(:result)
                        .permit([:encounter_id,
                                 :encounter,
                                 :date,
                                 { measures: [:value,
                                              :value_type,
                                              :value_modifier,
                                              { indicator: %i[concept_id concept] }] }])

  result = Lab::ResultsService.create_results(params[:test_id], result_params, 'user entered')

  render json: result, status: :created
end