us_core_test_kit 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/lib/us_core_test_kit/custom_groups/base_smart_granular_scopes_group.rb +2 -1
  3. data/lib/us_core_test_kit/custom_groups/screening_assessment_category_test.rb +75 -0
  4. data/lib/us_core_test_kit/custom_groups/v6.1.0/screening_assessment_group.rb +45 -0
  5. data/lib/us_core_test_kit/custom_groups/v7.0.0-ballot/screening_assessment_group.rb +48 -0
  6. data/lib/us_core_test_kit/fhir_resource_navigation.rb +11 -6
  7. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/metadata.yml +22 -20
  8. data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope1_group.rb +22 -20
  9. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/condition_granular_scope_read_test.rb +32 -0
  10. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_abatement_date_granular_scope_test.rb → condition_patient_abatement_date_granular_scope_search_test.rb} +5 -5
  11. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_asserted_date_granular_scope_test.rb → condition_patient_asserted_date_granular_scope_search_test.rb} +5 -5
  12. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_category_clinical_status_granular_scope_test.rb → condition_patient_category_clinical_status_granular_scope_search_test.rb} +5 -5
  13. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_category_encounter_granular_scope_test.rb → condition_patient_category_encounter_granular_scope_search_test.rb} +5 -5
  14. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_category_granular_scope_test.rb → condition_patient_category_granular_scope_search_test.rb} +5 -5
  15. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_clinical_status_granular_scope_test.rb → condition_patient_clinical_status_granular_scope_search_test.rb} +5 -5
  16. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_code_granular_scope_test.rb → condition_patient_code_granular_scope_search_test.rb} +5 -5
  17. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_granular_scope_test.rb → condition_patient_granular_scope_search_test.rb} +5 -5
  18. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_onset_date_granular_scope_test.rb → condition_patient_onset_date_granular_scope_search_test.rb} +5 -5
  19. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/{condition_patient_recorded_date_granular_scope_test.rb → condition_patient_recorded_date_granular_scope_search_test.rb} +5 -5
  20. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/metadata.yml +22 -20
  21. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/metadata.yml +12 -10
  22. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_granular_scope_read_test.rb +32 -0
  23. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/{observation_patient_category_date_granular_scope_test.rb → observation_patient_category_date_granular_scope_search_test.rb} +5 -5
  24. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/{observation_patient_category_granular_scope_test.rb → observation_patient_category_granular_scope_search_test.rb} +5 -5
  25. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/{observation_patient_category_status_granular_scope_test.rb → observation_patient_category_status_granular_scope_search_test.rb} +5 -5
  26. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/{observation_patient_code_date_granular_scope_test.rb → observation_patient_code_date_granular_scope_search_test.rb} +5 -5
  27. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/{observation_patient_code_granular_scope_test.rb → observation_patient_code_granular_scope_search_test.rb} +5 -5
  28. data/lib/us_core_test_kit/generated/v6.1.0/metadata.yml +34 -30
  29. data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope1_group.rb +12 -10
  30. data/lib/us_core_test_kit/generated/v6.1.0/observation_lab/metadata.yml +12 -10
  31. data/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +2 -0
  32. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/metadata.yml +22 -20
  33. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_granular_scope1_group.rb +22 -20
  34. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_granular_scope2_group.rb +22 -20
  35. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_granular_scope1_group.rb +14 -12
  36. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_granular_scope2_group.rb +14 -12
  37. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/metadata.yml +14 -12
  38. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/metadata.yml +16 -14
  39. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference_granular_scope1_group.rb +16 -14
  40. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/condition_granular_scope_read_test.rb +32 -0
  41. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_abatement_date_granular_scope_test.rb → condition_patient_abatement_date_granular_scope_search_test.rb} +5 -5
  42. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_asserted_date_granular_scope_test.rb → condition_patient_asserted_date_granular_scope_search_test.rb} +5 -5
  43. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_category_clinical_status_granular_scope_test.rb → condition_patient_category_clinical_status_granular_scope_search_test.rb} +5 -5
  44. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_category_encounter_granular_scope_test.rb → condition_patient_category_encounter_granular_scope_search_test.rb} +5 -5
  45. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_category_granular_scope_test.rb → condition_patient_category_granular_scope_search_test.rb} +5 -5
  46. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_clinical_status_granular_scope_test.rb → condition_patient_clinical_status_granular_scope_search_test.rb} +5 -5
  47. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_code_granular_scope_test.rb → condition_patient_code_granular_scope_search_test.rb} +5 -5
  48. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_granular_scope_test.rb → condition_patient_granular_scope_search_test.rb} +5 -5
  49. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_onset_date_granular_scope_test.rb → condition_patient_onset_date_granular_scope_search_test.rb} +5 -5
  50. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/{condition_patient_recorded_date_granular_scope_test.rb → condition_patient_recorded_date_granular_scope_search_test.rb} +5 -5
  51. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/condition/metadata.yml +22 -20
  52. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/diagnostic_report_granular_scope_read_test.rb +32 -0
  53. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/{diagnostic_report_patient_category_date_granular_scope_test.rb → diagnostic_report_patient_category_date_granular_scope_search_test.rb} +5 -5
  54. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/{diagnostic_report_patient_category_granular_scope_test.rb → diagnostic_report_patient_category_granular_scope_search_test.rb} +5 -5
  55. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/{diagnostic_report_patient_code_date_granular_scope_test.rb → diagnostic_report_patient_code_date_granular_scope_search_test.rb} +5 -5
  56. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/{diagnostic_report_patient_code_granular_scope_test.rb → diagnostic_report_patient_code_granular_scope_search_test.rb} +5 -5
  57. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/{diagnostic_report_patient_granular_scope_test.rb → diagnostic_report_patient_granular_scope_search_test.rb} +5 -5
  58. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/{diagnostic_report_patient_status_granular_scope_test.rb → diagnostic_report_patient_status_granular_scope_search_test.rb} +5 -5
  59. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/diagnostic_report/metadata.yml +14 -12
  60. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/document_reference_granular_scope_read_test.rb +32 -0
  61. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_id_granular_scope_test.rb → document_reference_id_granular_scope_search_test.rb} +5 -5
  62. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_patient_category_date_granular_scope_test.rb → document_reference_patient_category_date_granular_scope_search_test.rb} +5 -5
  63. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_patient_category_granular_scope_test.rb → document_reference_patient_category_granular_scope_search_test.rb} +5 -5
  64. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_patient_granular_scope_test.rb → document_reference_patient_granular_scope_search_test.rb} +5 -5
  65. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_patient_status_granular_scope_test.rb → document_reference_patient_status_granular_scope_search_test.rb} +5 -5
  66. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_patient_type_granular_scope_test.rb → document_reference_patient_type_granular_scope_search_test.rb} +5 -5
  67. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/{document_reference_patient_type_period_granular_scope_test.rb → document_reference_patient_type_period_granular_scope_search_test.rb} +5 -5
  68. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/document_reference/metadata.yml +16 -14
  69. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/metadata.yml +12 -10
  70. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/observation_granular_scope_read_test.rb +32 -0
  71. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/{observation_patient_category_date_granular_scope_test.rb → observation_patient_category_date_granular_scope_search_test.rb} +5 -5
  72. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/{observation_patient_category_granular_scope_test.rb → observation_patient_category_granular_scope_search_test.rb} +5 -5
  73. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/{observation_patient_category_status_granular_scope_test.rb → observation_patient_category_status_granular_scope_search_test.rb} +5 -5
  74. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/{observation_patient_code_date_granular_scope_test.rb → observation_patient_code_date_granular_scope_search_test.rb} +5 -5
  75. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/observation/{observation_patient_code_granular_scope_test.rb → observation_patient_code_granular_scope_search_test.rb} +5 -5
  76. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/metadata.yml +16 -14
  77. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/service_request_granular_scope_read_test.rb +32 -0
  78. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_id_granular_scope_test.rb → service_request_id_granular_scope_search_test.rb} +5 -5
  79. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_patient_category_authored_granular_scope_test.rb → service_request_patient_category_authored_granular_scope_search_test.rb} +5 -5
  80. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_patient_category_granular_scope_test.rb → service_request_patient_category_granular_scope_search_test.rb} +5 -5
  81. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_patient_code_authored_granular_scope_test.rb → service_request_patient_code_authored_granular_scope_search_test.rb} +5 -5
  82. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_patient_code_granular_scope_test.rb → service_request_patient_code_granular_scope_search_test.rb} +5 -5
  83. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_patient_granular_scope_test.rb → service_request_patient_granular_scope_search_test.rb} +5 -5
  84. data/lib/us_core_test_kit/generated/v7.0.0-ballot/granular_scope_tests/service_request/{service_request_patient_status_granular_scope_test.rb → service_request_patient_status_granular_scope_search_test.rb} +5 -5
  85. data/lib/us_core_test_kit/generated/v7.0.0-ballot/metadata.yml +80 -70
  86. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_granular_scope1_group.rb +12 -10
  87. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_granular_scope2_group.rb +12 -10
  88. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_lab/metadata.yml +12 -10
  89. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/metadata.yml +16 -14
  90. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request_granular_scope1_group.rb +16 -14
  91. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request_granular_scope2_group.rb +16 -14
  92. data/lib/us_core_test_kit/generated/v7.0.0-ballot/us_core_test_suite.rb +2 -0
  93. data/lib/us_core_test_kit/generator/granular_scope_read_test_generator.rb +102 -0
  94. data/lib/us_core_test_kit/generator/granular_scope_test_generator.rb +2 -2
  95. data/lib/us_core_test_kit/generator/suite_generator.rb +9 -1
  96. data/lib/us_core_test_kit/generator.rb +2 -0
  97. data/lib/us_core_test_kit/granular_scope.rb +63 -0
  98. data/lib/us_core_test_kit/granular_scope_read_test.rb +71 -0
  99. data/lib/us_core_test_kit/{granular_scope_checker.rb → granular_scope_search_test.rb} +8 -47
  100. data/lib/us_core_test_kit/must_support_test.rb +3 -2
  101. data/lib/us_core_test_kit/primitive_type.rb +5 -0
  102. data/lib/us_core_test_kit/provenance_validator.rb +3 -4
  103. data/lib/us_core_test_kit/resource_search_param_checker.rb +139 -0
  104. data/lib/us_core_test_kit/search_test.rb +6 -2
  105. data/lib/us_core_test_kit/version.rb +1 -1
  106. metadata +70 -55
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff99afacbf38abd7c8c459ab425b3e58c763a9ff721f9447562d62ff6e5dba66
4
- data.tar.gz: b69ed849fd8588b2f8fe029cee922d78b46ba639de36ccd174efe94fe3da60eb
3
+ metadata.gz: 2b693ad77df0cc7296b9ae07942cf5ea4f3496fb47ca199d63f3066f906f142f
4
+ data.tar.gz: 34d31851aabbf208e7f0db087a2f72f355e42c1c8e61da20b3c5a62885db1b72
5
5
  SHA512:
6
- metadata.gz: c64bede1519c6c76aa1e6fdb82f87036ccce90f88d238bb0af3fa35d7080246206a0cfedb0cbc57e0ad8aaf1769b1fa1297b5db50a1a5c0a35b6dc861664828a
7
- data.tar.gz: 41a2be6bc4932c82fe6ef1ebe48027c556fec81ff8e3e7c72bcd77bb02de6ccb6161ea16772de78f7df2679facf6f7b798c1fbc9656a4fa2f20d96db6ee6d9fb
6
+ metadata.gz: 325e5643f37e0da1e02e5e4fe3d4808ed3dc4e62a24e7f290ebe146e275b86cc13db3d51f79a331f5207bca117c1d7b8fcd2707170158aa29d21f50ed38605de
7
+ data.tar.gz: 2b11e159d4e26f24571fd040155a6ac924c2b5ccda1e5474380b24caac4486d0d8ea83e7ed4b6005f57aee2df0f25cd1e1073e36057409226b17840469bb3a99
@@ -3,7 +3,8 @@ require 'smart_app_launch_test_kit'
3
3
  require_relative './smart_ehr_launch_stu2'
4
4
  require_relative './smart_scopes_constants'
5
5
  require_relative './smart_standalone_launch_stu2_group'
6
- require_relative '../granular_scope_checker'
6
+ require_relative '../granular_scope_search_test'
7
+ require_relative '../granular_scope_read_test'
7
8
  require_relative '../us_core_options'
8
9
  require_relative './granted_granular_scopes_test'
9
10
 
@@ -0,0 +1,75 @@
1
+ require_relative '../search_test'
2
+
3
+ module USCoreTestKit
4
+ class ScreeningAssessmentCategoryTest < Inferno::Test
5
+ include SearchTest
6
+
7
+ id :us_core_screening_assessment_category
8
+ title 'Server demonstrates support for the required Condition and Observation categories.'
9
+
10
+ input :patient_ids,
11
+ title: 'Patient IDs',
12
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
13
+
14
+ # Disable tagging requests since this test doesn't have properties defined.
15
+ # TODO: investigate whether we need to tag these for granular scope
16
+ # checking.
17
+ def tags(_params)
18
+ nil
19
+ end
20
+
21
+ # rubocop:disable Metrics/CyclomaticComplexity
22
+ def category_found(resource_type:, patient_id:, category_search_values:, missing_categories:)
23
+ search_params = { patient: patient_id }
24
+
25
+ category_search_values.each do |category_search_value|
26
+ search_params[:category] = category_search_value
27
+ search_and_check_response(search_params, resource_type)
28
+
29
+ resources = fetch_all_bundled_resources(resource_type:)
30
+ .select { |resource| resource.resourceType == resource_type }
31
+
32
+ resources.each do |resource|
33
+ resource.category&.each do |category|
34
+ category.coding&.each do |coding|
35
+ missing_categories.delete(coding.code)
36
+ end
37
+ end
38
+
39
+ break if missing_categories.empty?
40
+ end
41
+
42
+ break if missing_categories.empty?
43
+ end
44
+ end
45
+ # rubocop:enable Metrics/CyclomaticComplexity
46
+
47
+ run do
48
+ missing_obs_categories = config.options[:observation_screening_assessment_categories].dup
49
+ missing_cond_categories = config.options[:condition_screening_assessment_categories].dup
50
+
51
+ patient_id_list.each do |patient_id|
52
+ unless missing_cond_categories.empty?
53
+ category_found(resource_type: 'Condition',
54
+ patient_id:,
55
+ category_search_values: ['health-concern', 'problem-list-item'],
56
+ missing_categories: missing_cond_categories)
57
+ end
58
+
59
+ next if missing_obs_categories.empty?
60
+
61
+ category_found(resource_type: 'Observation',
62
+ patient_id:,
63
+ category_search_values: ['survey'],
64
+ missing_categories: missing_obs_categories)
65
+ end
66
+
67
+ pass if missing_cond_categories.empty? && missing_obs_categories.empty?
68
+
69
+ messages = []
70
+ messages << "Observation categories: #{missing_obs_categories.join(', ')}" unless missing_obs_categories.empty?
71
+ messages << "Condition categories: #{missing_cond_categories.join(', ')}" unless missing_cond_categories.empty?
72
+ skip "Could not find these #{messages.join(' and ')}."
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,45 @@
1
+ require_relative '../screening_assessment_category_test'
2
+
3
+ module USCoreTestKit
4
+ module USCoreV610
5
+ class ScreeningAssessmentGroup < Inferno::TestGroup
6
+ id :us_core_v610_screening_assessment
7
+ title 'Screening Assessments Guidance'
8
+ short_description 'Verify Condition and Observation resources support the ' \
9
+ 'US Core Screening And Assessments Guidance.'
10
+ description %(
11
+ The #{title} Sequence tests Condition and Observation
12
+ resources associated with the provided patient. The resources returned
13
+ will be checked for consistency against the [US Core Screening And Assessments
14
+ Guidance](https://hl7.org/fhir/us/core/STU6.1/screening-and-assessments.html)
15
+ and FHIR JIRA ticket [FHIR-45319](https://jira.hl7.org/browse/FHIR-45319)
16
+
17
+ In this set of tests, Inferno serves as a FHIR client that attempts to
18
+ access the different types of Screening and Assessments specified in the guidance.
19
+ The provided patient needs to have the following four common Screening and Assessements
20
+ as Observation categories:
21
+
22
+ * SDOH Assessment (sdoh)
23
+ * Functional Status (functional-status)
24
+ * Disability Status (disability-status)
25
+ * Mental/Cognitive Status (cognitive-status)
26
+
27
+ The provided patient also needs to have the following common Screening and Assessment
28
+ as Condition category:
29
+
30
+ * SDOH Assessment (sdoh)
31
+ )
32
+ run_as_group
33
+
34
+ test from: :us_core_screening_assessment_category do
35
+ config(
36
+ options: {
37
+ condition_screening_assessment_categories: ['sdoh'].freeze,
38
+ observation_screening_assessment_categories: ['sdoh', 'functional-status', 'disability-status',
39
+ 'cognitive-status'].freeze
40
+ }
41
+ )
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,48 @@
1
+ require_relative '../screening_assessment_category_test'
2
+
3
+ module USCoreTestKit
4
+ module USCoreV700_BALLOT
5
+ class ScreeningAssessmentGroup < Inferno::TestGroup
6
+ id :us_core_v700_ballot_screening_assessment
7
+ title 'Screening Assessments Guidance'
8
+ short_description 'Verify Condition and Observation resources support the ' \
9
+ 'US Core Screening And Assessments Guidance.'
10
+ description %(
11
+ The #{title} Sequence tests Condition and Observation
12
+ resources associated with the provided patient. The resources returned
13
+ will be checked for consistency against the [US Core Screening And Assessments
14
+ Guidance](https://hl7.org/fhir/us/core/STU7/screening-and-assessments.html)
15
+ and FHIR JIRA ticket [FHIR-46052](https://jira.hl7.org/browse/FHIR-46052)
16
+
17
+ In this set of tests, Inferno serves as a FHIR client that attempts to
18
+ access the different types of Screening and Assessments specified in the guidance.
19
+ The provided patient needs to have the following four common Screening and Assessements
20
+ as Observation categories:
21
+
22
+ * SDOH Assessment (sdoh)
23
+ * Functional Status (functional-status)
24
+ * Disability Status (disability-status)
25
+ * Mental/Cognitive Status (cognitive-status)
26
+ * Physical Activity (activity)
27
+ * Alcohol Use (social-history)
28
+ * Substance Use (social-history)
29
+
30
+ The provided patient also needs to have the following common Screening and Assessment
31
+ as Condition category:
32
+
33
+ * SDOH Assessment (sdoh)
34
+ )
35
+ run_as_group
36
+
37
+ test from: :us_core_screening_assessment_category do
38
+ config(
39
+ options: {
40
+ condition_screening_assessment_categories: ['sdoh'].freeze,
41
+ observation_screening_assessment_categories: ['sdoh', 'functional-status', 'disability-status',
42
+ 'cognitive-status', 'activity', 'social-history'].freeze
43
+ }
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
@@ -1,3 +1,5 @@
1
+ require_relative './primitive_type'
2
+
1
3
  module USCoreTestKit
2
4
  module FHIRResourceNavigation
3
5
  DAR_EXTENSION_URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason'.freeze
@@ -65,19 +67,22 @@ module USCoreTestKit
65
67
  slice = find_slice_via_discriminator(element, property)
66
68
  slice
67
69
  else
68
- result = element.send(property)
69
- result = find_primitive_extension(element, property) if result.nil?
70
- result
70
+ value = element.send(property)
71
+ primitive_value = get_primitive_type_value(element, property, value)
72
+ primitive_value.present? ? primitive_value : value
71
73
  end
72
74
  rescue NoMethodError
73
75
  nil
74
76
  end
75
77
 
76
- def find_primitive_extension(element, property)
77
- type = element.class::METADATA[property.to_s]['type']
78
+ def get_primitive_type_value(element, property, value)
78
79
  source_value = element.source_hash["_#{property}"]
79
80
 
80
- PRIMITIVE_DATA_TYPES.include?(type) && source_value.present? ? FHIR::Element.new(source_value) : nil
81
+ return nil unless source_value.present?
82
+
83
+ primitive_value = USCoreTestKit::PrimitiveType.new(source_value)
84
+ primitive_value.value = value
85
+ primitive_value
81
86
  end
82
87
 
83
88
  def find_slice_via_discriminator(element, property)
@@ -350,26 +350,28 @@
350
350
  - :id: us_core_v610_condition_encounter_diagnosis_reference_resolution_test
351
351
  :file_name: condition_encounter_diagnosis_reference_resolution_test.rb
352
352
  :granular_scope_tests:
353
- - :id: us_core_v610_Condition_patient_category_granular_scope_test
354
- :file_name: condition_patient_category_granular_scope_test.rb
355
- - :id: us_core_v610_Condition_patient_granular_scope_test
356
- :file_name: condition_patient_granular_scope_test.rb
357
- - :id: us_core_v610_Condition_patient_recorded_date_granular_scope_test
358
- :file_name: condition_patient_recorded_date_granular_scope_test.rb
359
- - :id: us_core_v610_Condition_patient_asserted_date_granular_scope_test
360
- :file_name: condition_patient_asserted_date_granular_scope_test.rb
361
- - :id: us_core_v610_Condition_patient_category_clinical_status_granular_scope_test
362
- :file_name: condition_patient_category_clinical_status_granular_scope_test.rb
363
- - :id: us_core_v610_Condition_patient_onset_date_granular_scope_test
364
- :file_name: condition_patient_onset_date_granular_scope_test.rb
365
- - :id: us_core_v610_Condition_patient_abatement_date_granular_scope_test
366
- :file_name: condition_patient_abatement_date_granular_scope_test.rb
367
- - :id: us_core_v610_Condition_patient_clinical_status_granular_scope_test
368
- :file_name: condition_patient_clinical_status_granular_scope_test.rb
369
- - :id: us_core_v610_Condition_patient_category_encounter_granular_scope_test
370
- :file_name: condition_patient_category_encounter_granular_scope_test.rb
371
- - :id: us_core_v610_Condition_patient_code_granular_scope_test
372
- :file_name: condition_patient_code_granular_scope_test.rb
353
+ - :id: us_core_v610_Condition_patient_category_granular_scope_search_test
354
+ :file_name: condition_patient_category_granular_scope_search_test.rb
355
+ - :id: us_core_v610_Condition_patient_granular_scope_search_test
356
+ :file_name: condition_patient_granular_scope_search_test.rb
357
+ - :id: us_core_v610_Condition_patient_recorded_date_granular_scope_search_test
358
+ :file_name: condition_patient_recorded_date_granular_scope_search_test.rb
359
+ - :id: us_core_v610_Condition_patient_asserted_date_granular_scope_search_test
360
+ :file_name: condition_patient_asserted_date_granular_scope_search_test.rb
361
+ - :id: us_core_v610_Condition_patient_category_clinical_status_granular_scope_search_test
362
+ :file_name: condition_patient_category_clinical_status_granular_scope_search_test.rb
363
+ - :id: us_core_v610_Condition_patient_onset_date_granular_scope_search_test
364
+ :file_name: condition_patient_onset_date_granular_scope_search_test.rb
365
+ - :id: us_core_v610_Condition_patient_abatement_date_granular_scope_search_test
366
+ :file_name: condition_patient_abatement_date_granular_scope_search_test.rb
367
+ - :id: us_core_v610_Condition_patient_clinical_status_granular_scope_search_test
368
+ :file_name: condition_patient_clinical_status_granular_scope_search_test.rb
369
+ - :id: us_core_v610_Condition_patient_category_encounter_granular_scope_search_test
370
+ :file_name: condition_patient_category_encounter_granular_scope_search_test.rb
371
+ - :id: us_core_v610_Condition_patient_code_granular_scope_search_test
372
+ :file_name: condition_patient_code_granular_scope_search_test.rb
373
+ - :id: us_core_v610_Condition_granular_scope_read_test
374
+ :file_name: condition_granular_scope_read_test.rb
373
375
  :id: us_core_v610_condition_encounter_diagnosis
374
376
  :file_name: condition_encounter_diagnosis_group.rb
375
377
  :delayed_references: []
@@ -1,13 +1,14 @@
1
- require_relative './granular_scope_tests/condition/condition_patient_category_granular_scope_test'
2
- require_relative './granular_scope_tests/condition/condition_patient_granular_scope_test'
3
- require_relative './granular_scope_tests/condition/condition_patient_recorded_date_granular_scope_test'
4
- require_relative './granular_scope_tests/condition/condition_patient_asserted_date_granular_scope_test'
5
- require_relative './granular_scope_tests/condition/condition_patient_category_clinical_status_granular_scope_test'
6
- require_relative './granular_scope_tests/condition/condition_patient_onset_date_granular_scope_test'
7
- require_relative './granular_scope_tests/condition/condition_patient_abatement_date_granular_scope_test'
8
- require_relative './granular_scope_tests/condition/condition_patient_clinical_status_granular_scope_test'
9
- require_relative './granular_scope_tests/condition/condition_patient_category_encounter_granular_scope_test'
10
- require_relative './granular_scope_tests/condition/condition_patient_code_granular_scope_test'
1
+ require_relative './granular_scope_tests/condition/condition_patient_category_granular_scope_search_test'
2
+ require_relative './granular_scope_tests/condition/condition_patient_granular_scope_search_test'
3
+ require_relative './granular_scope_tests/condition/condition_patient_recorded_date_granular_scope_search_test'
4
+ require_relative './granular_scope_tests/condition/condition_patient_asserted_date_granular_scope_search_test'
5
+ require_relative './granular_scope_tests/condition/condition_patient_category_clinical_status_granular_scope_search_test'
6
+ require_relative './granular_scope_tests/condition/condition_patient_onset_date_granular_scope_search_test'
7
+ require_relative './granular_scope_tests/condition/condition_patient_abatement_date_granular_scope_search_test'
8
+ require_relative './granular_scope_tests/condition/condition_patient_clinical_status_granular_scope_search_test'
9
+ require_relative './granular_scope_tests/condition/condition_patient_category_encounter_granular_scope_search_test'
10
+ require_relative './granular_scope_tests/condition/condition_patient_code_granular_scope_search_test'
11
+ require_relative './granular_scope_tests/condition/condition_granular_scope_read_test'
11
12
 
12
13
  module USCoreTestKit
13
14
  module USCoreV610
@@ -29,16 +30,17 @@ based on the following granular scopes:
29
30
  run_as_group
30
31
 
31
32
 
32
- test from: :us_core_v610_Condition_patient_category_granular_scope_test
33
- test from: :us_core_v610_Condition_patient_granular_scope_test
34
- test from: :us_core_v610_Condition_patient_recorded_date_granular_scope_test
35
- test from: :us_core_v610_Condition_patient_asserted_date_granular_scope_test
36
- test from: :us_core_v610_Condition_patient_category_clinical_status_granular_scope_test
37
- test from: :us_core_v610_Condition_patient_onset_date_granular_scope_test
38
- test from: :us_core_v610_Condition_patient_abatement_date_granular_scope_test
39
- test from: :us_core_v610_Condition_patient_clinical_status_granular_scope_test
40
- test from: :us_core_v610_Condition_patient_category_encounter_granular_scope_test
41
- test from: :us_core_v610_Condition_patient_code_granular_scope_test
33
+ test from: :us_core_v610_Condition_patient_category_granular_scope_search_test
34
+ test from: :us_core_v610_Condition_patient_granular_scope_search_test
35
+ test from: :us_core_v610_Condition_patient_recorded_date_granular_scope_search_test
36
+ test from: :us_core_v610_Condition_patient_asserted_date_granular_scope_search_test
37
+ test from: :us_core_v610_Condition_patient_category_clinical_status_granular_scope_search_test
38
+ test from: :us_core_v610_Condition_patient_onset_date_granular_scope_search_test
39
+ test from: :us_core_v610_Condition_patient_abatement_date_granular_scope_search_test
40
+ test from: :us_core_v610_Condition_patient_clinical_status_granular_scope_search_test
41
+ test from: :us_core_v610_Condition_patient_category_encounter_granular_scope_search_test
42
+ test from: :us_core_v610_Condition_patient_code_granular_scope_search_test
43
+ test from: :us_core_v610_Condition_granular_scope_read_test
42
44
  end
43
45
  end
44
46
  end
@@ -0,0 +1,32 @@
1
+ require_relative '../../../../generator/group_metadata'
2
+ require_relative '../../../../granular_scope_read_test'
3
+
4
+ module USCoreTestKit
5
+ module USCoreV610
6
+ class ConditionGranularScopeReadTest < Inferno::Test
7
+ include USCoreTestKit::GranularScopeReadTest
8
+
9
+ title 'Server filters results for Condition reads based on granular scopes'
10
+ description %(
11
+ This test attempts Condition reads
12
+ and verifies that the results have been
13
+ filtered based on the granted granular scopes.
14
+
15
+ )
16
+
17
+ id :us_core_v610_Condition_granular_scope_read_test
18
+
19
+ def resource_type
20
+ 'Condition'
21
+ end
22
+
23
+ def self.metadata
24
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
25
+ end
26
+
27
+ run do
28
+ run_scope_read_test
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientAbatementDateGranularScopeTest < Inferno::Test
7
+ class ConditionPatientAbatementDateGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + abatement-date based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_abatement_date_granular_scope_test
19
+ id :us_core_v610_Condition_patient_abatement_date_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientAssertedDateGranularScopeTest < Inferno::Test
7
+ class ConditionPatientAssertedDateGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + asserted-date based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_asserted_date_granular_scope_test
19
+ id :us_core_v610_Condition_patient_asserted_date_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientCategoryClinicalStatusGranularScopeTest < Inferno::Test
7
+ class ConditionPatientCategoryClinicalStatusGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + category + clinical-status based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_category_clinical_status_granular_scope_test
19
+ id :us_core_v610_Condition_patient_category_clinical_status_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientCategoryEncounterGranularScopeTest < Inferno::Test
7
+ class ConditionPatientCategoryEncounterGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + category + encounter based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_category_encounter_granular_scope_test
19
+ id :us_core_v610_Condition_patient_category_encounter_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientCategoryGranularScopeTest < Inferno::Test
7
+ class ConditionPatientCategoryGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + category based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_category_granular_scope_test
19
+ id :us_core_v610_Condition_patient_category_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientClinicalStatusGranularScopeTest < Inferno::Test
7
+ class ConditionPatientClinicalStatusGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + clinical-status based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_clinical_status_granular_scope_test
19
+ id :us_core_v610_Condition_patient_clinical_status_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientCodeGranularScopeTest < Inferno::Test
7
+ class ConditionPatientCodeGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient + code based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_code_granular_scope_test
19
+ id :us_core_v610_Condition_patient_code_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end
@@ -1,12 +1,12 @@
1
1
  require_relative '../../../../search_test'
2
2
  require_relative '../../../../generator/group_metadata'
3
- require_relative '../../../../granular_scope_checker'
3
+ require_relative '../../../../granular_scope_search_test'
4
4
 
5
5
  module USCoreTestKit
6
6
  module USCoreV610
7
- class ConditionPatientGranularScopeTest < Inferno::Test
7
+ class ConditionPatientGranularScopeSearchTest < Inferno::Test
8
8
  include USCoreTestKit::SearchTest
9
- include USCoreTestKit::GranularScopeChecker
9
+ include USCoreTestKit::GranularScopeSearchTest
10
10
 
11
11
  title 'Server filters results for Condition search by patient based on granular scopes'
12
12
  description %(
@@ -16,7 +16,7 @@ filtered based on the granted granular scopes.
16
16
 
17
17
  )
18
18
 
19
- id :us_core_v610_Condition_patient_granular_scope_test
19
+ id :us_core_v610_Condition_patient_granular_scope_search_test
20
20
 
21
21
  input :patient_ids,
22
22
  title: 'Patient IDs',
@@ -34,7 +34,7 @@ filtered based on the granted granular scopes.
34
34
  end
35
35
 
36
36
  run do
37
- run_scope_check_test
37
+ run_scope_search_test
38
38
  end
39
39
  end
40
40
  end