us_core_test_kit 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (21) hide show
  1. checksums.yaml +4 -4
  2. data/lib/us_core_test_kit/custom_groups/capability_statement/instantiate_test.rb +6 -2
  3. data/lib/us_core_test_kit/custom_groups/capability_statement/profile_support_test.rb +10 -7
  4. data/lib/us_core_test_kit/custom_groups/smart_scopes_constants.rb +6 -4
  5. data/lib/us_core_test_kit/custom_groups/v6.1.0/smart_granular_scopes_group.rb +46 -93
  6. data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope1_group.rb +0 -1
  7. data/lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope2_group.rb +44 -0
  8. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/condition/metadata.yml +2 -2
  9. data/lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/metadata.yml +2 -2
  10. data/lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb +0 -4
  11. data/lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb +51 -0
  12. data/lib/us_core_test_kit/generated/v6.1.0/metadata.yml +6 -0
  13. data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope1_group.rb +0 -3
  14. data/lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope2_group.rb +36 -0
  15. data/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +1 -1
  16. data/lib/us_core_test_kit/generated/v7.0.0-ballot/us_core_test_suite.rb +1 -1
  17. data/lib/us_core_test_kit/generator/granular_scope_group_generator.rb +0 -7
  18. data/lib/us_core_test_kit/generator/granular_scope_resource_type_group_generator.rb +1 -1
  19. data/lib/us_core_test_kit/generator/granular_scope_test_generator.rb +2 -2
  20. data/lib/us_core_test_kit/version.rb +1 -1
  21. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b693ad77df0cc7296b9ae07942cf5ea4f3496fb47ca199d63f3066f906f142f
4
- data.tar.gz: 34d31851aabbf208e7f0db087a2f72f355e42c1c8e61da20b3c5a62885db1b72
3
+ metadata.gz: cc3ca68e2a7b8f7609f1eaf4f983afd2813252e706a65f096733412d3aa4e118
4
+ data.tar.gz: 3458eaaeb4d904b728b16f92524da58598d1d84d12b82458614d014d8959efcc
5
5
  SHA512:
6
- metadata.gz: 325e5643f37e0da1e02e5e4fe3d4808ed3dc4e62a24e7f290ebe146e275b86cc13db3d51f79a331f5207bca117c1d7b8fcd2707170158aa29d21f50ed38605de
7
- data.tar.gz: 2b11e159d4e26f24571fd040155a6ac924c2b5ccda1e5474380b24caac4486d0d8ea83e7ed4b6005f57aee2df0f25cd1e1073e36057409226b17840469bb3a99
6
+ metadata.gz: 0b8df109a82023aa02b8eeadfd4a024cd41e1b00570c6d7e3aa55e68d910ac17031874e62bed5f8a09392f5b6b70cc594a6a60ec47b1c1c34620f71c526f2d2f
7
+ data.tar.gz: 87e2ed36f19a5a5815d13c64f74afa0b8c3824fa751fb52b5b013bf9f0449b3d2d47bf36e8d9bd26341e6cd25a8731a27d7f8a1b5fe38ce21c250a02187ab37b
@@ -12,8 +12,12 @@ module USCoreTestKit
12
12
  assert_resource_type(:capability_statement)
13
13
  capability_statement = resource
14
14
 
15
- assert capability_statement.instantiates.include?('http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server'),
16
- "Server CapabilityStatement.instantiates does not include 'http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server'"
15
+ include_us_core = capability_statement.instantiates&.any? do |url|
16
+ url.split('|').first == 'http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server'
17
+ end
18
+
19
+ assert include_us_core,
20
+ "Server CapabilityStatement.instantiates does not include 'http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server'"
17
21
  end
18
22
  end
19
23
  end
@@ -20,13 +20,15 @@ module USCoreTestKit
20
20
  assert_resource_type(:capability_statement)
21
21
  capability_statement = resource
22
22
 
23
- supported_profiles =
24
- capability_statement.rest
25
- &.each_with_object([]) do |rest, profiles|
26
- rest.resource.each { |resource| profiles.concat(resource.supportedProfile) }
27
- end.uniq
23
+ supported_profiles = capability_statement.rest&.flat_map do |rest|
24
+ rest.resource.flat_map do |resource|
25
+ # Remove trailing version from canonical url
26
+ resource.supportedProfile&.map { |profile| profile.split('|').first }
27
+ end.compact
28
+ end&.uniq || []
28
29
 
29
- assert supported_profiles.include?('http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient'), 'US Core Patient profile not supported'
30
+ assert supported_profiles.include?('http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient'),
31
+ 'US Core Patient profile not supported'
30
32
 
31
33
  us_core_profiles = config.options[:us_core_profiles]
32
34
 
@@ -45,7 +47,8 @@ module USCoreTestKit
45
47
  .join(', ')
46
48
 
47
49
  assert missing_profiles.empty?,
48
- "The CapabilityStatement did not list support for the following resources: #{missing_profiles_list}"
50
+ 'The CapabilityStatement does not list support for the following' \
51
+ "US Core profiles: #{missing_profiles_list}"
49
52
  end
50
53
  end
51
54
  end
@@ -6,12 +6,8 @@ module USCoreTestKit
6
6
  'v610' => [
7
7
  'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis',
8
8
  'patient/Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern',
9
- 'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
10
9
  'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory',
11
10
  'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history',
12
- 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs',
13
- 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey',
14
- 'patient/Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh'
15
11
  ].map(&:freeze).freeze,
16
12
  'v700_ballot' => [
17
13
  'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis',
@@ -28,6 +24,12 @@ module USCoreTestKit
28
24
  }.freeze
29
25
 
30
26
  SMART_GRANULAR_SCOPES_GROUP2 = {
27
+ 'v610' => [
28
+ 'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
29
+ 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs',
30
+ 'patient/Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey',
31
+ 'patient/Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh'
32
+ ].map(&:freeze).freeze,
31
33
  'v700_ballot' => [
32
34
  'patient/Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item',
33
35
  'patient/DiagnosticReport.rs?category=http://loinc.org|LP7839-6',
@@ -1,33 +1,12 @@
1
1
  require_relative '../base_smart_granular_scopes_group'
2
- require_relative '../smart_scopes_constants'
3
- require_relative '../granted_granular_scopes_test'
4
2
  require_relative '../../generated/v6.1.0/granular_scopes1_group'
3
+ require_relative '../../generated/v6.1.0/granular_scopes2_group'
5
4
 
6
5
  module USCoreTestKit
7
6
  module USCoreV610
8
- class SmartGranularScopesGroup < Inferno::TestGroup
9
- include SmartScopesConstants
10
- title 'US Core SMART Granular Scopes'
7
+ class SmartGranularScopesGroup < BaseSmartGranularScopesGroup
11
8
  id :us_core_v610_smart_granular_scopes
12
-
13
- description <<~DESCRIPTION
14
- These tests verify that servers honor [SMART App Launch granular
15
- scopes](http://hl7.org/fhir/smart-app-launch/STU2/scopes-and-launch-context.html#finer-grained-resource-constraints-using-search-parameters).
16
- Support for these scopes is [required in US Core
17
- 7](http://hl7.org/fhir/us/core/2024Jan/scopes.html#us-core-scopes).
18
-
19
- Prior to running these tests, first run the US Core FHIR API tests using
20
- resource-level scopes. This group includes a SMART App Launch followed by
21
- FHIR API tests. The app launches require that a granular scopes be
22
- granted. The FHIR API tests then repeat all of the queries from the
23
- original FHIR API tests that were run using resource-level scopes, and
24
- verify that only resources matching the granted granular scopes are
25
- returned.
26
- DESCRIPTION
27
-
28
- def self.default_group_scopes(version)
29
- [DEFAULT_SCOPES, *SMART_GRANULAR_SCOPES_GROUP1[version]].join(' ')
30
- end
9
+ title 'US Core SMART Granular Scopes'
31
10
 
32
11
  def self.scopes_string(scopes)
33
12
  scopes
@@ -36,91 +15,65 @@ module USCoreTestKit
36
15
  .join("\n")
37
16
  end
38
17
 
39
- config(
40
- inputs: {
41
- url: {
42
- locked: true
18
+ groups
19
+ .first
20
+ .description %(
21
+ These tests perform a SMART app launch to receive the following granular scopes:
22
+
23
+ #{scopes_string(SMART_GRANULAR_SCOPES_GROUP1['v610'])}
24
+
25
+ Then all of the searches which have been performed in the US Core FHIR API tests
26
+ are repeated to verify that the results have been filtered according to the
27
+ above scopes.
28
+ )
29
+
30
+ groups
31
+ .first
32
+ .config(
33
+ inputs: {
34
+ requested_scopes: {
35
+ name: :requested_scopes_group1,
36
+ default: groups.first.default_group_scopes('v610')
37
+ }
43
38
  },
44
- requested_scopes: {
45
- name: :requested_scopes_group1,
46
- default: default_group_scopes('v610')
39
+ options: {
40
+ required_scopes: SMART_GRANULAR_SCOPES_GROUP1['v610']
47
41
  }
48
- }
49
- )
50
-
51
- group do
52
- title 'SMART App Launch w/Granular Scopes'
42
+ )
53
43
 
54
- def self.scopes_string(scopes)
55
- scopes
56
- .map { |scope| scope.delete_prefix 'patient/' }
57
- .map { |scope| "* `#{scope}`" }
58
- .join("\n")
59
- end
44
+ groups
45
+ .first
46
+ .group from: :us_core_v610_smart_granular_scopes_1
60
47
 
61
- description %(
48
+ groups
49
+ .last
50
+ .description %(
62
51
  These tests perform a SMART app launch to receive the following granular scopes:
63
52
 
64
- #{scopes_string(SMART_GRANULAR_SCOPES_GROUP1['v610'])}
53
+ #{scopes_string(SMART_GRANULAR_SCOPES_GROUP2['v610'])}
65
54
 
66
55
  Then all of the searches which have been performed in the US Core FHIR API tests
67
56
  are repeated to verify that the results have been filtered according to the
68
57
  above scopes.
69
58
  )
70
59
 
71
- config(
72
- outputs: {
73
- smart_credentials: {
74
- name: :granular_scopes_1_credentials
60
+ groups
61
+ .last
62
+ .config(
63
+ inputs: {
64
+ requested_scopes: {
65
+ name: :requested_scopes_group2,
66
+ default: groups.last.default_group_scopes('v610')
75
67
  }
68
+ },
69
+ options: {
70
+ required_scopes: SMART_GRANULAR_SCOPES_GROUP2['v610']
76
71
  }
77
72
  )
78
- group from: :us_core_smart_standalone_launch_stu2,
79
- optional: true,
80
- config: {
81
- inputs: {
82
- smart_credentials: {
83
- name: :granular_scopes_1_credentials
84
- }
85
- }
86
- } do
87
- groups[1].test from: :us_core_granted_granular_scopes,
88
- config: {
89
- inputs: {
90
- received_scopes: {
91
- name: :standalone_received_scopes
92
- }
93
- },
94
- options: {
95
- required_scopes: SMART_GRANULAR_SCOPES_GROUP1['v610']
96
- }
97
- }
98
- end
99
- group from: :us_core_smart_ehr_launch_stu2,
100
- optional: true,
101
- config: {
102
- inputs: {
103
- smart_credentials: {
104
- name: :granular_scopes_1_credentials
105
- }
106
- }
107
- } do
108
- groups[1].test from: :us_core_granted_granular_scopes,
109
- config: {
110
- inputs: {
111
- received_scopes: {
112
- name: :ehr_received_scopes
113
- }
114
- },
115
- options: {
116
- required_scopes: SMART_GRANULAR_SCOPES_GROUP1['v610']
117
- }
118
- }
119
- end
120
- end
121
73
 
122
- group from: :us_core_v610_smart_granular_scopes_1,
123
- title: 'US Core FHIR API w/Granular Scopes'
74
+ groups
75
+ .last
76
+ .group from: :us_core_v610_smart_granular_scopes_2
124
77
  end
125
78
  end
126
79
  end
@@ -22,7 +22,6 @@ based on the following granular scopes:
22
22
 
23
23
  * `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis`
24
24
  * `Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern`
25
- * `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item`
26
25
 
27
26
  )
28
27
 
@@ -0,0 +1,44 @@
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'
12
+
13
+ module USCoreTestKit
14
+ module USCoreV610
15
+ class ConditionGranularScope2Group < Inferno::TestGroup
16
+ title 'Condition Granular Scope Tests Tests'
17
+ short_description 'Verify support for the server capabilities required by the US Core Condition Encounter Diagnosis Profile.'
18
+ description %(
19
+ The tests in this group repeat all of the searches from the US Core
20
+ FHIR API tests, and verify that the resources returned are filtered
21
+ based on the following granular scopes:
22
+
23
+ * `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item`
24
+
25
+ )
26
+
27
+ id :us_core_v610_condition_granular_scope_2_group
28
+ run_as_group
29
+
30
+
31
+ test from: :us_core_v610_Condition_patient_category_granular_scope_search_test
32
+ test from: :us_core_v610_Condition_patient_granular_scope_search_test
33
+ test from: :us_core_v610_Condition_patient_recorded_date_granular_scope_search_test
34
+ test from: :us_core_v610_Condition_patient_asserted_date_granular_scope_search_test
35
+ test from: :us_core_v610_Condition_patient_category_clinical_status_granular_scope_search_test
36
+ test from: :us_core_v610_Condition_patient_onset_date_granular_scope_search_test
37
+ test from: :us_core_v610_Condition_patient_abatement_date_granular_scope_search_test
38
+ test from: :us_core_v610_Condition_patient_clinical_status_granular_scope_search_test
39
+ test from: :us_core_v610_Condition_patient_category_encounter_granular_scope_search_test
40
+ test from: :us_core_v610_Condition_patient_code_granular_scope_search_test
41
+ test from: :us_core_v610_Condition_granular_scope_read_test
42
+ end
43
+ end
44
+ end
@@ -372,6 +372,6 @@
372
372
  :file_name: condition_patient_code_granular_scope_search_test.rb
373
373
  - :id: us_core_v610_Condition_granular_scope_read_test
374
374
  :file_name: condition_granular_scope_read_test.rb
375
- :id: us_core_v610_condition_granular_scope_1_group
376
- :file_name: condition_granular_scope1_group.rb
375
+ :id: us_core_v610_condition_granular_scope_2_group
376
+ :file_name: condition_granular_scope2_group.rb
377
377
  :delayed_references: []
@@ -275,8 +275,8 @@
275
275
  :file_name: observation_patient_code_granular_scope_search_test.rb
276
276
  - :id: us_core_v610_Observation_granular_scope_read_test
277
277
  :file_name: observation_granular_scope_read_test.rb
278
- :id: us_core_v610_observation_granular_scope_1_group
279
- :file_name: observation_granular_scope1_group.rb
278
+ :id: us_core_v610_observation_granular_scope_2_group
279
+ :file_name: observation_granular_scope2_group.rb
280
280
  :delayed_references:
281
281
  - :path: specimen
282
282
  :resources:
@@ -14,12 +14,8 @@ based on the following granular scopes:
14
14
 
15
15
  * `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis`
16
16
  * `Condition.rs?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern`
17
- * `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item`
18
17
  * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory`
19
18
  * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history`
20
- * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs`
21
- * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey`
22
- * `Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh`
23
19
 
24
20
  )
25
21
 
@@ -0,0 +1,51 @@
1
+ require_relative './condition_granular_scope2_group'
2
+ require_relative './observation_granular_scope2_group'
3
+
4
+ module USCoreTestKit
5
+ module USCoreV610
6
+ class SmartGranularScopes2Group < Inferno::TestGroup
7
+ id :us_core_v610_smart_granular_scopes_2
8
+ title 'US Core FHIR API w/Granular Scopes 2'
9
+
10
+ description %(
11
+ The tests in this group repeat all of the searches from the US Core
12
+ FHIR API tests, and verify that the resources returned are filtered
13
+ based on the following granular scopes:
14
+
15
+ * `Condition.rs?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item`
16
+ * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs`
17
+ * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey`
18
+ * `Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh`
19
+
20
+ )
21
+
22
+ input :granular_scopes_2_credentials,
23
+ title: 'SMART Credentials for Granular Scopes 2',
24
+ type: :oauth_credentials,
25
+ locked: true
26
+
27
+ config(
28
+ inputs: {
29
+ patient_ids: {
30
+ locked: true
31
+ },
32
+ received_scopes: {
33
+ title: 'Received Scopes',
34
+ locked: true
35
+ },
36
+ url: {
37
+ locked: true
38
+ }
39
+ }
40
+ )
41
+
42
+ fhir_client do
43
+ oauth_credentials :granular_scopes_2_credentials
44
+ url :url
45
+ end
46
+
47
+ group from: :us_core_v610_condition_granular_scope_2_group
48
+ group from: :us_core_v610_observation_granular_scope_2_group
49
+ end
50
+ end
51
+ end
@@ -12128,9 +12128,15 @@
12128
12128
  Condition:
12129
12129
  - :id: us_core_v610_condition_granular_scope_1_group
12130
12130
  :file_name: condition_granular_scope1_group.rb
12131
+ - :id: us_core_v610_condition_granular_scope_2_group
12132
+ :file_name: condition_granular_scope2_group.rb
12131
12133
  Observation:
12132
12134
  - :id: us_core_v610_observation_granular_scope_1_group
12133
12135
  :file_name: observation_granular_scope1_group.rb
12136
+ - :id: us_core_v610_observation_granular_scope_2_group
12137
+ :file_name: observation_granular_scope2_group.rb
12134
12138
  :granular_scope_groups:
12135
12139
  - :id: us_core_v610_smart_granular_scopes_1
12136
12140
  :file_name: granular_scopes1_group.rb
12141
+ - :id: us_core_v610_smart_granular_scopes_2
12142
+ :file_name: granular_scopes2_group.rb
@@ -17,9 +17,6 @@ based on the following granular scopes:
17
17
 
18
18
  * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory`
19
19
  * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history`
20
- * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs`
21
- * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey`
22
- * `Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh`
23
20
 
24
21
  )
25
22
 
@@ -0,0 +1,36 @@
1
+ require_relative './granular_scope_tests/observation/observation_patient_category_granular_scope_search_test'
2
+ require_relative './granular_scope_tests/observation/observation_patient_code_date_granular_scope_search_test'
3
+ require_relative './granular_scope_tests/observation/observation_patient_category_status_granular_scope_search_test'
4
+ require_relative './granular_scope_tests/observation/observation_patient_category_date_granular_scope_search_test'
5
+ require_relative './granular_scope_tests/observation/observation_patient_code_granular_scope_search_test'
6
+ require_relative './granular_scope_tests/observation/observation_granular_scope_read_test'
7
+
8
+ module USCoreTestKit
9
+ module USCoreV610
10
+ class ObservationGranularScope2Group < Inferno::TestGroup
11
+ title 'Observation Granular Scope Tests Tests'
12
+ short_description 'Verify support for the server capabilities required by the US Core Laboratory Result Observation Profile.'
13
+ description %(
14
+ The tests in this group repeat all of the searches from the US Core
15
+ FHIR API tests, and verify that the resources returned are filtered
16
+ based on the following granular scopes:
17
+
18
+ * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs`
19
+ * `Observation.rs?category=http://terminology.hl7.org/CodeSystem/observation-category|survey`
20
+ * `Observation.rs?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh`
21
+
22
+ )
23
+
24
+ id :us_core_v610_observation_granular_scope_2_group
25
+ run_as_group
26
+
27
+
28
+ test from: :us_core_v610_Observation_patient_category_granular_scope_search_test
29
+ test from: :us_core_v610_Observation_patient_code_date_granular_scope_search_test
30
+ test from: :us_core_v610_Observation_patient_category_status_granular_scope_search_test
31
+ test from: :us_core_v610_Observation_patient_category_date_granular_scope_search_test
32
+ test from: :us_core_v610_Observation_patient_code_granular_scope_search_test
33
+ test from: :us_core_v610_Observation_granular_scope_read_test
34
+ end
35
+ end
36
+ end
@@ -204,7 +204,7 @@ module USCoreTestKit
204
204
  group from: :us_core_311_data_absent_reason
205
205
  end
206
206
 
207
- group from: :'us_core_v610_smart_granular_scopes',
207
+ group from: :us_core_v610_smart_granular_scopes,
208
208
  required_suite_options: USCoreOptions::SMART_2_REQUIREMENT
209
209
 
210
210
  end
@@ -212,7 +212,7 @@ module USCoreTestKit
212
212
  group from: :us_core_311_data_absent_reason
213
213
  end
214
214
 
215
- group from: :'us_core_v700_ballot_smart_granular_scopes',
215
+ group from: :us_core_v700_ballot_smart_granular_scopes,
216
216
  required_suite_options: USCoreOptions::SMART_2_REQUIREMENT
217
217
 
218
218
  end
@@ -4,18 +4,11 @@ require_relative '../custom_groups/smart_scopes_constants'
4
4
  module USCoreTestKit
5
5
  class Generator
6
6
  class GranularScopeGroupGenerator
7
- include SmartScopesConstants
8
-
9
7
  class << self
10
8
  def generate(ig_metadata, base_output_dir)
11
9
  return unless ['6', '7'].include? ig_metadata.ig_version[1]
12
10
 
13
11
  [1, 2].each do |group_number|
14
- scopes =
15
- SmartScopesConstants
16
- .const_get("SMART_GRANULAR_SCOPES_GROUP#{group_number}")[ig_metadata.reformatted_version]
17
- next if scopes.blank?
18
-
19
12
  new(ig_metadata, base_output_dir, group_number).generate
20
13
  end
21
14
  end
@@ -16,7 +16,7 @@ module USCoreTestKit
16
16
  .const_get("SMART_GRANULAR_SCOPES_GROUP#{group_number}")[ig_metadata.reformatted_version]
17
17
 
18
18
  groups.each do |group_metadata|
19
- next if scopes.blank? || scopes.none? { |scope| scope.start_with? "patient/#{group_metadata.resource}" }
19
+ next if scopes.none? { |scope| scope.start_with? "patient/#{group_metadata.resource}" }
20
20
 
21
21
  new(GroupMetadata.new(group_metadata.to_hash), ig_metadata, base_output_dir, group_number).generate
22
22
  end
@@ -11,12 +11,12 @@ module USCoreTestKit
11
11
 
12
12
  scopes =
13
13
  SmartScopesConstants::SMART_GRANULAR_SCOPES_GROUP1[ig_metadata.reformatted_version] +
14
- (SmartScopesConstants::SMART_GRANULAR_SCOPES_GROUP2[ig_metadata.reformatted_version] || [])
14
+ SmartScopesConstants::SMART_GRANULAR_SCOPES_GROUP2[ig_metadata.reformatted_version]
15
15
 
16
16
  SmartScopesConstants::SMART_GRANULAR_SCOPE_RESOURCES.each do |resource_type|
17
17
  group = ig_metadata.groups.find { |group| group.resource == resource_type }
18
18
 
19
- next if scopes.blank? || scopes.none? { |scope| scope.start_with? "patient/#{group.resource}" }
19
+ next if scopes.none? { |scope| scope.start_with? "patient/#{group.resource}" }
20
20
 
21
21
  group.searches
22
22
  .each { |search| new(group, search, base_output_dir).generate }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module USCoreTestKit
4
- VERSION = '0.7.1'
4
+ VERSION = '0.7.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: us_core_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-06 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core
@@ -1411,6 +1411,7 @@ files:
1411
1411
  - lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/metadata.yml
1412
1412
  - lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis_group.rb
1413
1413
  - lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope1_group.rb
1414
+ - lib/us_core_test_kit/generated/v6.1.0/condition_granular_scope2_group.rb
1414
1415
  - lib/us_core_test_kit/generated/v6.1.0/condition_problems_health_concerns/condition_problems_health_concerns_must_support_test.rb
1415
1416
  - lib/us_core_test_kit/generated/v6.1.0/condition_problems_health_concerns/condition_problems_health_concerns_patient_abatement_date_search_test.rb
1416
1417
  - lib/us_core_test_kit/generated/v6.1.0/condition_problems_health_concerns/condition_problems_health_concerns_patient_asserted_date_search_test.rb
@@ -1533,6 +1534,7 @@ files:
1533
1534
  - lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_code_date_granular_scope_search_test.rb
1534
1535
  - lib/us_core_test_kit/generated/v6.1.0/granular_scope_tests/observation/observation_patient_code_granular_scope_search_test.rb
1535
1536
  - lib/us_core_test_kit/generated/v6.1.0/granular_scopes1_group.rb
1537
+ - lib/us_core_test_kit/generated/v6.1.0/granular_scopes2_group.rb
1536
1538
  - lib/us_core_test_kit/generated/v6.1.0/head_circumference/head_circumference_must_support_test.rb
1537
1539
  - lib/us_core_test_kit/generated/v6.1.0/head_circumference/head_circumference_patient_category_date_search_test.rb
1538
1540
  - lib/us_core_test_kit/generated/v6.1.0/head_circumference/head_circumference_patient_category_search_test.rb
@@ -1615,6 +1617,7 @@ files:
1615
1617
  - lib/us_core_test_kit/generated/v6.1.0/observation_clinical_result/observation_clinical_result_validation_test.rb
1616
1618
  - lib/us_core_test_kit/generated/v6.1.0/observation_clinical_result_group.rb
1617
1619
  - lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope1_group.rb
1620
+ - lib/us_core_test_kit/generated/v6.1.0/observation_granular_scope2_group.rb
1618
1621
  - lib/us_core_test_kit/generated/v6.1.0/observation_lab/metadata.yml
1619
1622
  - lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_lab_must_support_test.rb
1620
1623
  - lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_lab_patient_category_date_search_test.rb