us_core_test_kit 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/config/presets/client_demo_against_server_800_preset.json.erb +46 -0
  3. data/config/presets/server_demo_against_client_800_preset.json.erb +30 -0
  4. data/lib/us_core_test_kit/client/generated/v3.1.1/bodyheight_client_group.rb +1 -1
  5. data/lib/us_core_test_kit/client/generated/v3.1.1/bodytemp_client_group.rb +1 -1
  6. data/lib/us_core_test_kit/client/generated/v3.1.1/bodyweight_client_group.rb +1 -1
  7. data/lib/us_core_test_kit/client/generated/v3.1.1/bp_client_group.rb +1 -1
  8. data/lib/us_core_test_kit/client/generated/v3.1.1/condition_client_group.rb +1 -1
  9. data/lib/us_core_test_kit/client/generated/v3.1.1/head_circumference_client_group.rb +1 -1
  10. data/lib/us_core_test_kit/client/generated/v3.1.1/heartrate_client_group.rb +1 -1
  11. data/lib/us_core_test_kit/client/generated/v3.1.1/resprate_client_group.rb +1 -1
  12. data/lib/us_core_test_kit/client/generated/v3.1.1/us_core_client_test_suite.rb +1 -1
  13. data/lib/us_core_test_kit/client/generated/v4.0.0/condition_client_group.rb +1 -1
  14. data/lib/us_core_test_kit/client/generated/v4.0.0/head_circumference_client_group.rb +1 -1
  15. data/lib/us_core_test_kit/client/generated/v4.0.0/us_core_client_test_suite.rb +1 -1
  16. data/lib/us_core_test_kit/client/generated/v5.0.1/head_circumference_client_group.rb +1 -1
  17. data/lib/us_core_test_kit/client/generated/v5.0.1/us_core_client_test_suite.rb +1 -1
  18. data/lib/us_core_test_kit/client/generated/v6.1.0/head_circumference_client_group.rb +1 -1
  19. data/lib/us_core_test_kit/client/generated/v6.1.0/observation_clinical_result/observation_clinical_result_client_read_test.rb +2 -2
  20. data/lib/us_core_test_kit/client/generated/v6.1.0/observation_clinical_result_client_group.rb +2 -1
  21. data/lib/us_core_test_kit/client/generated/v6.1.0/us_core_client_test_suite.rb +1 -1
  22. data/lib/us_core_test_kit/client/generated/v7.0.0/head_circumference_client_group.rb +1 -1
  23. data/lib/us_core_test_kit/client/generated/v7.0.0/observation_clinical_result/observation_clinical_result_client_read_test.rb +2 -2
  24. data/lib/us_core_test_kit/client/generated/v7.0.0/observation_clinical_result_client_group.rb +2 -1
  25. data/lib/us_core_test_kit/client/generated/v7.0.0/us_core_client_test_suite.rb +2 -1
  26. data/lib/us_core_test_kit/client/generated/v8.0.0/head_circumference_client_group.rb +1 -1
  27. data/lib/us_core_test_kit/client/generated/v8.0.0/observation_clinical_result/observation_clinical_result_client_read_test.rb +2 -2
  28. data/lib/us_core_test_kit/client/generated/v8.0.0/observation_clinical_result_client_group.rb +2 -1
  29. data/lib/us_core_test_kit/client/generated/v8.0.0/us_core_client_test_suite.rb +10 -1
  30. data/lib/us_core_test_kit/client/generator/group_generator.rb +19 -5
  31. data/lib/us_core_test_kit/client/generator/read_test_generator.rb +9 -1
  32. data/lib/us_core_test_kit/client/generator/templates/read_test.rb.erb +5 -1
  33. data/lib/us_core_test_kit/client/generator/templates/suite.rb.erb +12 -1
  34. data/lib/us_core_test_kit/client/test_helper.rb +5 -3
  35. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_abatement_date_granular_scope_search_test.rb +14 -1
  36. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_asserted_date_granular_scope_search_test.rb +14 -1
  37. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_category_clinical_status_granular_scope_search_test.rb +14 -1
  38. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_category_encounter_granular_scope_search_test.rb +14 -1
  39. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_category_granular_scope_search_test.rb +14 -1
  40. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_clinical_status_granular_scope_search_test.rb +14 -1
  41. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_code_granular_scope_search_test.rb +14 -1
  42. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_granular_scope_search_test.rb +14 -1
  43. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_onset_date_granular_scope_search_test.rb +14 -1
  44. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_patient_recorded_date_granular_scope_search_test.rb +14 -1
  45. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_category_date_granular_scope_search_test.rb +14 -1
  46. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_category_granular_scope_search_test.rb +14 -1
  47. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_category_status_granular_scope_search_test.rb +14 -1
  48. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_code_date_granular_scope_search_test.rb +14 -1
  49. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_code_granular_scope_search_test.rb +14 -1
  50. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_abatement_date_granular_scope_search_test.rb +14 -1
  51. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_asserted_date_granular_scope_search_test.rb +14 -1
  52. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_category_clinical_status_granular_scope_search_test.rb +14 -1
  53. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_category_encounter_granular_scope_search_test.rb +14 -1
  54. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_category_granular_scope_search_test.rb +14 -1
  55. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_clinical_status_granular_scope_search_test.rb +14 -1
  56. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_code_granular_scope_search_test.rb +14 -1
  57. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_granular_scope_search_test.rb +14 -1
  58. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_lastupdated_granular_scope_search_test.rb +14 -1
  59. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_onset_date_granular_scope_search_test.rb +14 -1
  60. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/condition/condition_patient_recorded_date_granular_scope_search_test.rb +14 -1
  61. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/observation/observation_patient_category_date_granular_scope_search_test.rb +14 -1
  62. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/observation/observation_patient_category_granular_scope_search_test.rb +14 -1
  63. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/observation/observation_patient_category_lastupdated_granular_scope_search_test.rb +14 -1
  64. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/observation/observation_patient_category_status_granular_scope_search_test.rb +14 -1
  65. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/observation/observation_patient_code_date_granular_scope_search_test.rb +14 -1
  66. data/lib/us_core_test_kit/generated/v7.0.0/granular_scope_tests/observation/observation_patient_code_granular_scope_search_test.rb +14 -1
  67. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_abatement_date_granular_scope_search_test.rb +14 -1
  68. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_asserted_date_granular_scope_search_test.rb +14 -1
  69. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_category_clinical_status_granular_scope_search_test.rb +14 -1
  70. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_category_encounter_granular_scope_search_test.rb +14 -1
  71. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_category_granular_scope_search_test.rb +14 -1
  72. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_clinical_status_granular_scope_search_test.rb +14 -1
  73. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_code_granular_scope_search_test.rb +14 -1
  74. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_granular_scope_search_test.rb +14 -1
  75. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_lastupdated_granular_scope_search_test.rb +14 -1
  76. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_onset_date_granular_scope_search_test.rb +14 -1
  77. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/condition/condition_patient_recorded_date_granular_scope_search_test.rb +14 -1
  78. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/observation/observation_patient_category_date_granular_scope_search_test.rb +14 -1
  79. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/observation/observation_patient_category_granular_scope_search_test.rb +14 -1
  80. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/observation/observation_patient_category_lastupdated_granular_scope_search_test.rb +14 -1
  81. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/observation/observation_patient_category_status_granular_scope_search_test.rb +14 -1
  82. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/observation/observation_patient_code_date_granular_scope_search_test.rb +14 -1
  83. data/lib/us_core_test_kit/generated/v8.0.0/granular_scope_tests/observation/observation_patient_code_granular_scope_search_test.rb +14 -1
  84. data/lib/us_core_test_kit/generator/granular_scope_test_generator.rb +14 -1
  85. data/lib/us_core_test_kit/granular_scope_search_test.rb +36 -11
  86. data/lib/us_core_test_kit/metadata.rb +1 -1
  87. data/lib/us_core_test_kit/requirements/generated/us_core_client_v800_requirements_coverage.csv +140 -0
  88. data/lib/us_core_test_kit/version.rb +2 -2
  89. data/lib/us_core_test_kit.rb +1 -0
  90. metadata +5 -2
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + code + date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + code and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + abatement-date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + asserted-date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + category + clinical-status and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + category + encounter and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + category and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + clinical-status and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + code and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + _lastUpdated and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + onset-date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Condition searches by
14
14
  patient + recorded-date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + category + date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + category and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + category + _lastUpdated and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + category + status and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + code + date and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -12,7 +12,20 @@ module USCoreTestKit
12
12
  description %(
13
13
  This test repeats all Observation searches by
14
14
  patient + code and verifies that the results have been
15
- filtered based on the granted granular scopes.
15
+ filtered based on the granted granular scopes. The response to each
16
+ repeated request will be compared to the corresponding original response
17
+ independently using the following logic:
18
+ - If the repeated search filters on a category value that
19
+ is explicitly included within the granted scopes, e.g., a search for
20
+ `Observation?category=survey` when the granted scopes includes
21
+ `patient/Observation.rs?category=survey`, then the server is required to
22
+ return the original response filtered to include only entries that match
23
+ one of the granted scopes.
24
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
25
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
26
+ servers may indicate that the request is unauthorized either through an empty
27
+ Bundle or an explicit HTTP error, or they may return the original response
28
+ filtered to include only entries that match one of the granted scopes.
16
29
 
17
30
  )
18
31
 
@@ -155,7 +155,20 @@ module USCoreTestKit
155
155
  <<~DESCRIPTION.gsub(/\n{3,}/, "\n\n")
156
156
  This test repeats all #{resource_type} searches by
157
157
  #{search_param_name_string} and verifies that the results have been
158
- filtered based on the granted granular scopes.
158
+ filtered based on the granted granular scopes. The response to each
159
+ repeated request will be compared to the corresponding original response
160
+ independently using the following logic:
161
+ - If the repeated search filters on a category value that
162
+ is explicitly included within the granted scopes, e.g., a search for
163
+ `Observation?category=survey` when the granted scopes includes
164
+ `patient/Observation.rs?category=survey`, then the server is required to
165
+ return the original response filtered to include only entries that match
166
+ one of the granted scopes.
167
+ - Otherwise, e.g., a search for `Observation?category=cognitive-status`
168
+ when the granted scopes include only `patient/Observation.rs?category=survey`,
169
+ servers may indicate that the request is unauthorized either through an empty
170
+ Bundle or an explicit HTTP error, or they may return the original response
171
+ filtered to include only entries that match one of the granted scopes.
159
172
  DESCRIPTION
160
173
  end
161
174
  end
@@ -33,24 +33,26 @@ module USCoreTestKit
33
33
  end
34
34
 
35
35
  mismatched_ids = mismatched_resource_ids(found_resources)
36
-
37
36
  assert mismatched_ids.empty?,
38
37
  'Resources with the following ids were received even though they do not match the ' \
39
38
  "granted granular scopes: #{mismatched_ids.join(', ')}"
40
39
 
41
- found_ids = found_resources.map(&:id)
42
- previous_ids = expected_resource_ids(all_previous_resources)
43
- missing_ids = previous_ids - found_ids
40
+ # if the query is in scope or resource were returned, we must check missing and unexpected
41
+ if query_in_scope?(resource_type, params) || found_resources.present?
44
42
 
45
- assert missing_ids.empty?,
46
- 'Resources with the following ids were received when using resource-level scopes, ' \
47
- "but not when using granular scopes: #{missing_ids.join(', ')}"
43
+ found_ids = found_resources.map(&:id)
44
+ previous_ids = expected_resource_ids(all_previous_resources)
48
45
 
49
- unexpected_ids = found_ids - previous_ids
46
+ missing_ids = previous_ids - found_ids
47
+ assert missing_ids.empty?,
48
+ 'Resources with the following ids were received when using resource-level scopes, ' \
49
+ "but not when using granular scopes: #{missing_ids.join(', ')}"
50
50
 
51
- assert unexpected_ids.empty?,
52
- 'Resources with the following ids were received when using granular scopes, ' \
53
- "but not when using resource-level scopes: #{unexpected_ids.join(', ')}"
51
+ unexpected_ids = found_ids - previous_ids
52
+ assert unexpected_ids.empty?,
53
+ 'Resources with the following ids were received when using granular scopes, ' \
54
+ "but not when using resource-level scopes: #{unexpected_ids.join(', ')}"
55
+ end
54
56
  end
55
57
  end
56
58
 
@@ -63,6 +65,29 @@ module USCoreTestKit
63
65
  .sort_by { |request| request.index }
64
66
  end
65
67
 
68
+ def query_in_scope?(resource_type, params)
69
+ received_scopes.split(' ').each do |scope|
70
+ parsed_scope = URI.parse(scope)
71
+
72
+ # check for resource type, search scope, and matched params
73
+ next unless parsed_scope.path =~ /\/#{resource_type}\./ &&
74
+ parsed_scope.path.split('.')[1].include?('s') &&
75
+ granular_params_present?(parsed_scope.query, params)
76
+
77
+ return true
78
+ end
79
+
80
+ false
81
+ end
82
+
83
+ def granular_params_present?(granular_params, search_params)
84
+ CGI.parse(granular_params).each do |param_name, value|
85
+ return false unless search_params.key?(param_name) && value.include?(search_params[param_name])
86
+ end
87
+
88
+ true
89
+ end
90
+
66
91
  def previous_resources(params)
67
92
  previous_requests(params)
68
93
  .flat_map do |request|
@@ -70,7 +70,7 @@ module USCoreTestKit
70
70
  of the repository.
71
71
  DESCRIPTION
72
72
  suite_ids [:us_core_v311, :us_core_v400, :us_core_v501, :us_core_v610, :us_core_v700, :us_core_v800, :us_core_client_v311,
73
- :us_core_client_v400, :us_core_client_v501, :us_core_client_v610, :us_core_client_v700]
73
+ :us_core_client_v400, :us_core_client_v501, :us_core_client_v610, :us_core_client_v700, :us_core_client_v800]
74
74
  tags ['SMART App Launch', 'US Core']
75
75
  last_updated LAST_UPDATED
76
76
  version VERSION