Class: BulkDataTestKit::BulkDataV200Client::Endpoints::Output

Inherits:
Inferno::DSL::SuiteEndpoint
  • Object
show all
Includes:
ServerProxy
Defined in:
lib/bulk_data_test_kit/v2.0.0_client/endpoints/output.rb

Instance Method Summary collapse

Methods included from ServerProxy

#proxy_client, #request_headers, #rewrite_url_base

Methods included from URLs

#base_url, #fhir_url, #output_url, #resume_pass_url, #status_url, #suite_id

Instance Method Details

#binary_idObject



37
38
39
# File 'lib/bulk_data_test_kit/v2.0.0_client/endpoints/output.rb', line 37

def binary_id
  request.params[:binary_id]
end

#make_responseObject

Proxy the request to the reference server for a completed output file, using the same id provided with the completed status request.



20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/bulk_data_test_kit/v2.0.0_client/endpoints/output.rb', line 20

def make_response
  server_response = proxy_client.get("Binary/#{binary_id}")

  case server_response.status
  when 200
    response.status = 200
    response.headers['Content-Type'] = 'application/fhir+ndjson'
  else
    response.status = server_response.status
  end
  response.body = server_response.body
end

#tagsObject



33
34
35
# File 'lib/bulk_data_test_kit/v2.0.0_client/endpoints/output.rb', line 33

def tags
  [OUTPUT_TAG]
end

#test_run_identifierObject



10
11
12
13
14
15
16
# File 'lib/bulk_data_test_kit/v2.0.0_client/endpoints/output.rb', line 10

def test_run_identifier
  return request.params[:session_path] if request.params[:session_path].present?

  SMARTAppLaunch::MockSMARTServer.issued_token_to_client_id(
    request.headers['authorization']&.delete_prefix('Bearer ')
  )
end