Class: ONCCertificationG10TestKit::ResourceAccessTest

Inherits:
Inferno::Test
  • Object
show all
Defined in:
lib/onc_certification_g10_test_kit/resource_access_test.rb

Direct Known Subclasses

RestrictedAccessTest

Instance Method Summary collapse

Instance Method Details

#request_should_succeed?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 54

def request_should_succeed?
  true
end

#resource_groupObject

Raises:

  • (StandardError)


17
18
19
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 17

def resource_group
  raise StandardError, '#resource_group must be overridden'
end

#resource_search_testObject



50
51
52
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 50

def resource_search_test
  resource_group.tests.first
end

#resource_typeObject



58
59
60
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 58

def resource_type
  resource_search_test.properties.resource_type
end

#search_param_value(name) ⇒ Object



28
29
30
31
32
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 28

def search_param_value(name)
  return patient_id if ['patient', '_id', 'subject'].include?(name)

  resource_group..search_definitions[name.to_sym][:values].first
end

#search_paramsObject



21
22
23
24
25
26
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 21

def search_params
  @search_params ||=
    resource_group..searches.first[:names].each_with_object({}) do |name, params|
      params[name] = search_param_value(name)
    end
end

#status_search_param_nameObject



40
41
42
43
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 40

def status_search_param_name
  @status_search_param_name ||=
    resource_group..search_definitions.keys.find { |key| key.to_s.include? 'status' }
end

#status_search_param_valueObject



45
46
47
48
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 45

def status_search_param_value
  @status_search_param_value ||=
    resource_group..search_definitions[status_search_param_name][:values].first
end

#status_search_paramsObject



34
35
36
37
38
# File 'lib/onc_certification_g10_test_kit/resource_access_test.rb', line 34

def status_search_params
  {
    "#{status_search_param_name}": search_param_value(status_search_param_name)
  }
end