carin_for_blue_button_test_kit 0.12.1 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/c4bb_client_test_suite.rb +227 -0
  3. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/client_claims_data_attestation_test.rb +32 -0
  4. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/coverage_claims_data_request_test.rb +25 -0
  5. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/eob_inpatient_claims_data_request_test.rb +26 -0
  6. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/eob_oral_claims_data_request_test.rb +25 -0
  7. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/eob_outpatient_claims_data_request_test.rb +28 -0
  8. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/eob_pharmacy_claims_data_request_test.rb +25 -0
  9. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/eob_professional_claims_data_request_test.rb +27 -0
  10. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/organization_claims_data_request_test.rb +26 -0
  11. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/patient_claims_data_request_test.rb +24 -0
  12. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/practitioner_claims_data_request_test.rb +25 -0
  13. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/claim_data_request_tests/relatedperson_claims_data_request_test.rb +25 -0
  14. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/client_validation_test.rb +93 -0
  15. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/collection.rb +19 -0
  16. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/endpoints/next_page_endpoint.rb +24 -0
  17. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/endpoints/resource_api_endpoint.rb +74 -0
  18. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/endpoints/resource_id_endpoint.rb +24 -0
  19. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/endpoints/token_endpoint.rb +24 -0
  20. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/initial_wait_test.rb +76 -0
  21. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/metadata/mock_capability_statement.json +535 -0
  22. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/metadata/mock_operation_outcome_resource.json +16 -0
  23. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/mock_server.rb +190 -0
  24. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/required_searches_tests/coverage_required_searches.rb +45 -0
  25. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/required_searches_tests/eob_required_searches.rb +71 -0
  26. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/required_searches_tests/organization_required_searches.rb +47 -0
  27. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/required_searches_tests/patient_required_searches.rb +71 -0
  28. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/required_searches_tests/practitioner_required_searches.rb +47 -0
  29. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/required_searches_tests/relatedperson_required_searches.rb +43 -0
  30. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/tags.rb +7 -0
  31. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/urls.rb +57 -0
  32. data/lib/carin_for_blue_button_test_kit/client/v2.0.0/user_input_response.rb +32 -0
  33. data/lib/carin_for_blue_button_test_kit/version.rb +1 -1
  34. data/lib/carin_for_blue_button_test_kit.rb +1 -0
  35. data/lib/inferno_requirements_tools/tasks/{map_requirements.rb → requirements_coverage.rb} +91 -60
  36. metadata +34 -4
  37. data/lib/inferno_requirements_tools/tasks/collect_requirements.rb +0 -196
@@ -0,0 +1,24 @@
1
+ require_relative '../tags'
2
+ require_relative '../mock_server'
3
+
4
+ module CarinForBlueButtonTestKit
5
+ class NextPageEndpoint < Inferno::DSL::SuiteEndpoint
6
+ include CarinForBlueButtonTestKit::MockServer
7
+
8
+ def test_run_identifier
9
+ extract_bearer_token(request)
10
+ end
11
+
12
+ def make_response
13
+ read_next_page(request)
14
+ end
15
+
16
+ def tags
17
+ [RESOURCE_API_TAG]
18
+ end
19
+
20
+ def update_result
21
+ results_repo.update(result.id, result: 'pass') unless test.config.options[:accepts_multiple_requests]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,74 @@
1
+ require_relative '../tags'
2
+ require_relative '../mock_server'
3
+ require_relative '../client_validation_test'
4
+
5
+ module CarinForBlueButtonTestKit
6
+ class ResourceAPIEndpoint < Inferno::DSL::SuiteEndpoint
7
+ include CarinForBlueButtonTestKit::MockServer
8
+ include CarinForBlueButtonTestKit::ClientValidationTest
9
+
10
+ def test_run_identifier
11
+ extract_bearer_token(request)
12
+ end
13
+
14
+ def make_response
15
+ response
16
+ end
17
+
18
+ def add_resource_tags(tags, response_body_resource)
19
+ if response_body_resource.resourceType == 'Bundle'
20
+ response_body_resource.entry.each do |entry_resource|
21
+ resource = entry_resource.resource
22
+ resource_type_tag = resource.resourceType
23
+ if resource.resourceType == 'ExplanationOfBenefit'
24
+ profile = extract_eob_profile(resource)
25
+ resource_type_tag = "#{resource.resourceType}_#{profile}"
26
+ end
27
+ tags.append(resource_type_tag) unless tags.include?(resource_type_tag)
28
+ end
29
+ else
30
+ resource = response_body_resource
31
+ resource_type_tag = resource.resourceType
32
+ if resource.resourceType == 'ExplanationOfBenefit'
33
+ profile = extract_eob_profile(resource)
34
+ resource_type_tag = "#{resource.resourceType}_#{profile}"
35
+ end
36
+ tags.append(resource_type_tag) unless tags.include?(resource_type_tag)
37
+ end
38
+ end
39
+
40
+ def add_search_param_tags(tags, endpoint_resource, params)
41
+ tags.append("#{endpoint_resource}Search")
42
+ params.keys.each do |key|
43
+ next unless key == '_include'
44
+
45
+ params[key].each do |value|
46
+ params["#{key}=#{value}"] = value
47
+ end
48
+ params.delete(key)
49
+ end
50
+
51
+ params.each_key do |param|
52
+ tags.append(param)
53
+ end
54
+ end
55
+
56
+ def tags
57
+ response_body = FHIR.from_contents(carin_resource_response(request))
58
+ params = get_params(request.query_string)
59
+
60
+ endpoint_resource = resource_endpoint(request.url)
61
+
62
+ tags = [RESOURCE_API_TAG]
63
+
64
+ add_resource_tags(tags, response_body) if response_body.present?
65
+ add_search_param_tags(tags, endpoint_resource, params)
66
+
67
+ tags
68
+ end
69
+
70
+ def update_result
71
+ results_repo.update(result.id, result: 'pass') unless test.config.options[:accepts_multiple_requests]
72
+ end
73
+ end
74
+ end
@@ -0,0 +1,24 @@
1
+ require_relative '../tags'
2
+ require_relative '../mock_server'
3
+
4
+ module CarinForBlueButtonTestKit
5
+ class ResourceIDEndpoint < Inferno::DSL::SuiteEndpoint
6
+ include CarinForBlueButtonTestKit::MockServer
7
+
8
+ def test_run_identifier
9
+ extract_bearer_token(request)
10
+ end
11
+
12
+ def make_response
13
+ carin_resource_id_response(request)
14
+ end
15
+
16
+ def tags
17
+ [RESOURCE_ID_TAG]
18
+ end
19
+
20
+ def update_result
21
+ results_repo.update(result.id, result: 'pass') unless test.config.options[:accepts_multiple_requests]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ require_relative '../tags'
2
+ require_relative '../mock_server'
3
+
4
+ module CarinForBlueButtonTestKit
5
+ class TokenEndpoint < Inferno::DSL::SuiteEndpoint
6
+ include CarinForBlueButtonTestKit::MockServer
7
+
8
+ def test_run_identifier
9
+ extract_client_id(request)
10
+ end
11
+
12
+ def make_response
13
+ token_response(request)
14
+ end
15
+
16
+ def tags
17
+ [AUTH_TAG]
18
+ end
19
+
20
+ def update_result
21
+ results_repo.update(result.id, result: 'pass') unless test.config.options[:accepts_multiple_requests]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,76 @@
1
+ require_relative 'urls'
2
+ module CarinForBlueButtonTestKit
3
+ class C4BBClientInitialWaitTest < Inferno::Test
4
+ include URLs
5
+
6
+ id :initial_wait_test
7
+ title 'Client makes claims data and required search parameter requests'
8
+ description %(
9
+ This test will receive claims data requests and search requests until the user confirms they are done.
10
+ )
11
+ input :access_token
12
+ config options: { accepts_multiple_requests: true }
13
+
14
+ run do
15
+ wait(
16
+ identifier: access_token,
17
+ message: %(
18
+ Access Token: #{access_token} \n
19
+ Submit CARIN requests via the following method:
20
+ * Single Resource API: `#{submit_url}?:search_params`, with `:endpoint` replaced with the endpoint you want
21
+ to reach and `:search_params` replaced with the search parameters for the request.
22
+
23
+ The following CARIN resources can be accessed on the Inferno Reference Server with the following IDs, and
24
+ the following search parameters are required for each resource type:
25
+
26
+ * Patient: `888`
27
+ * _id
28
+ * birthdate
29
+ * family
30
+ * gender
31
+ * given
32
+ * identifier
33
+ * name
34
+ * birthdate+family
35
+ * family+gender
36
+ * birthdate+name
37
+ * gender+name
38
+ * Coverage: `c4bb-Coverage`
39
+ * _id
40
+ * patient
41
+ * Organization: `c4bb-Organization`
42
+ * _id
43
+ * name
44
+ * address
45
+ * Practitioner: `c4bb-Practitioner`
46
+ * _id
47
+ * name
48
+ * identifier
49
+ * RelatedPerson: `c4bb-RelatedPerson`
50
+ * _id
51
+ * ExplanationOfBenefit: `c4bb-EOBInpatient`, `c4bb-EOBOutpatient`, `c4bb-EOBOral`, `c4bb-EOBPharmacy`,
52
+ `c4bb-EOBProfessional`
53
+ * _id
54
+ * patient
55
+ * identifier
56
+ * _lastUpdated
57
+ * service-date
58
+ * service-start-date
59
+ * billable-period-start
60
+ * type
61
+ * _include:
62
+ * ExplanationOfBenefit:patient
63
+ * ExplanationOfBenefit:provider
64
+ * ExplanationOfBenefit:care-team
65
+ * ExplanationOfBenefit:coverage
66
+ * ExplanationOfBenefit:insurer
67
+ * ExplanationOfBenefit:payee
68
+ * ExplanationOfBenefit:*
69
+
70
+ [Click here](#{resume_claims_data_url}?token=#{access_token}) when done.
71
+ ),
72
+ timeout: 900
73
+ )
74
+ end
75
+ end
76
+ end