davinci_us_drug_formulary_test_kit 0.10.4 → 0.11.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6abd8fe1d3bdfce993a7460f65b63e69584d1ef1f6a415cccd6a64d150cd1a7f
4
- data.tar.gz: 550ca3c64266d29a125c9eb714603e1e2cca9f951bf082a7f5d87f5f4ddb6aeb
3
+ metadata.gz: 5da16d423c118156da150fd9a6ad67fdedda6c3bd154377fb7794b074419edbc
4
+ data.tar.gz: e6ac77c4fdde8b3c1c457339e7c5c077c3c0ae1c4562152ac0853d7a62577bd2
5
5
  SHA512:
6
- metadata.gz: ed4d70d9d928c43f50de47544cbf064493abf2fcb28040e36a3710c633614dd382661d8f199e77d4f0fc49207c827548e579ed16cf352e41079e961c44eed09e
7
- data.tar.gz: 69103a6ff42f900a02a36c2bbd4a0ab12bd948ee3dacb9741033c444a546cf5da175c68c10564836f93fa1cdbeeea1c7e8643c9e3108681f4637cfe3d1e573ce
6
+ metadata.gz: 67974be7b9cccf56fbcd507c348b46df10cf90ed96b0777b977e10b1b6e0771d4d768a6ec24ae8e730ea6d17f65bbbf6d0e5e77ffefcd1ffb22ea0504a0939b9
7
+ data.tar.gz: 0f54db7b6131970356a2086f18eda574d379f2c4f1f673ac876b26d128d3254dea38ec032f156a82c19c227c0e939a06367e1063943099f547bde62de58264ea
@@ -0,0 +1,28 @@
1
+ {
2
+ "title": "Drug Formulary Reference Implementation",
3
+ "id": "drug-formulary-ri",
4
+ "test_suite_id": "davinci_us_drug_formulary_v201",
5
+ "inputs": [
6
+ {
7
+ "name": "url",
8
+ "value": "https://drug-formulary-ri.davinci.hl7.org/fhir",
9
+ "_title": "FHIR Endpoint",
10
+ "_description": "URL of the FHIR endpoint",
11
+ "_type": "text"
12
+ },
13
+ {
14
+ "name": "smart_credentials",
15
+ "value": null,
16
+ "_title": "OAuth Credentials",
17
+ "_type": "oauth_credentials",
18
+ "_optional": true
19
+ },
20
+ {
21
+ "name": "input_ids",
22
+ "value": "StateOfCTLocation,UnitedStatesLocation",
23
+ "_title": "Location IDs",
24
+ "_description": "Comma separated list of Location IDs that in sum contain all MUST SUPPORT elements",
25
+ "_type": "text"
26
+ }
27
+ ]
28
+ }
@@ -45,7 +45,6 @@ module DaVinciUSDrugFormularyTestKit
45
45
  - Multiple And
46
46
  - Comparators
47
47
  )
48
- version VERSION
49
48
 
50
49
  id :davinci_us_drug_formulary_v201
51
50
 
@@ -85,9 +84,13 @@ module DaVinciUSDrugFormularyTestKit
85
84
  url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit/issues'
86
85
  },
87
86
  {
88
- label: 'Source Code',
87
+ label: 'Open Source',
89
88
  url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit'
90
89
  },
90
+ {
91
+ label: 'Download',
92
+ url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit/releases'
93
+ },
91
94
  {
92
95
  label: 'Implementation Guide',
93
96
  url: 'https://hl7.org/fhir/us/davinci-drug-formulary/STU2.0.1/'
@@ -0,0 +1,24 @@
1
+ <% test_file_list.each do |file_name| %>require_relative '<%= file_name %>'
2
+ <% end %>
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::TestGroup
6
+ title '<%= title %> Tests'
7
+ short_description '<%= short_description %>'
8
+ description %(
9
+ <%= description %>
10
+ )
11
+
12
+ id :<%= group_id %>
13
+ run_as_group<% if optional? %>
14
+ optional
15
+ <% end %>
16
+
17
+ def self.metadata
18
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, '<%= profile_identifier %>', 'metadata.yml'), aliases: true))
19
+ end
20
+ <% test_id_list.each do |id| %>
21
+ test from: :<%= id %><% end %>
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,38 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module DaVinciUSDrugFormularyTestKit
5
+ module <%= module_name %>
6
+ class <%= class_name %> < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns <%= include_param_resource %> resources from <%= resource_type %> search by <%= include_param_string %>'
10
+ description %(
11
+ A server SHALL be capable of supporting _includes for <%= include_param %>.
12
+
13
+ This test will perform a search using <%= include_param_string %> and
14
+ will pass if the referenced <%= include_param_resource %> is included in the response.
15
+ )
16
+
17
+ id :<%= test_id %>
18
+
19
+ def self.properties
20
+ @properties ||= SearchTestProperties.new(
21
+ <%= search_test_properties_string %>
22
+ )
23
+ end
24
+
25
+ def self.metadata
26
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml')))
27
+ end
28
+
29
+ def self.include_metadata
30
+ @include_metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, '..', '<%= include_param_resource %>', 'metadata.yml'), aliases: true))
31
+ end
32
+
33
+ run do
34
+ run_include_search_test
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,41 @@
1
+ require_relative '../../../must_support_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::MustSupportTest
7
+
8
+ title 'All must support elements are provided in the <%= resource_type %> resources returned'
9
+ description %(
10
+ US Drug Formulary Responders SHALL be capable of populating all data elements as
11
+ part of the query results as specified by the US Drug Formulary Capability
12
+ Statement. This test will look through the <%= resource_type %> resources
13
+ found previously for the following must support elements:
14
+
15
+ <%= must_support_list_string %><% if uscdi_list_string.present? %>
16
+
17
+ For ONC USCDI requirements, each <%= resource_type %> must support the following additional elements:
18
+
19
+ <%= uscdi_list_string %><% end %>
20
+ )
21
+
22
+ id :<%= test_id %>
23
+
24
+ def resource_type
25
+ '<%= resource_type %>'
26
+ end
27
+
28
+ def self.metadata
29
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
30
+ end
31
+
32
+ def scratch_resources
33
+ scratch[:<%= profile_identifier %>_resources] ||= {}
34
+ end
35
+
36
+ run do
37
+ perform_must_support_test(<%= resource_collection_string %>)
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,50 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module DaVinciUSDrugFormularyTestKit
5
+ module <%= module_name %>
6
+ class <%= class_name %> < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns Provenance resources from <%= resource_type %> search by <%= search_param_name_string %>'
10
+ description %(
11
+ A server SHALL be capable of supporting _revIncludes:Provenance:target.
12
+
13
+ This test will perform a search by <%= search_param_name_string %> and
14
+ will pass if a Provenance resource is found in the response.
15
+ %)
16
+
17
+ id :<%= test_id %>
18
+ <% if needs_patient_id? %>
19
+ input :patient_ids,
20
+ title: 'Patient IDs',
21
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
22
+ <% end %>
23
+ def properties
24
+ @properties ||= SearchTestProperties.new(
25
+ <%= search_test_properties_string %>
26
+ )
27
+ end
28
+
29
+ def self.metadata
30
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml')))
31
+ end
32
+
33
+ def self.provenance_metadata
34
+ @provenance_metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, '..', 'provenance', 'metadata.yml'), aliases: true))
35
+ end
36
+
37
+ def scratch_resources
38
+ scratch[:<%= profile_identifier %>_resources] ||= {}
39
+ end
40
+
41
+ def scratch_provenance_resources
42
+ scratch[:provenance_resources] ||= {}
43
+ end
44
+
45
+ run do
46
+ run_provenance_revinclude_search_test
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../../../read_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::ReadTest
7
+
8
+ title 'Server returns correct <%= resource_type %> resource from <%= resource_type %> read interaction'
9
+ description 'A server <%= conformance_expectation %> support the <%= resource_type %> read interaction.'
10
+
11
+ id :<%= test_id %>
12
+
13
+ def resource_type
14
+ '<%= resource_type %>'
15
+ end
16
+
17
+ def scratch_resources
18
+ scratch[:<%= profile_identifier %>_resources] ||= {}
19
+ end
20
+
21
+ run do
22
+ perform_read_test(<%= resource_collection_string %>)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,40 @@
1
+ require_relative '../../../reference_resolution_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::ReferenceResolutionTest
7
+
8
+ title 'MustSupport references within <%= resource_type %> resources are valid'
9
+ description %(
10
+ This test will attempt to read external references provided within elements
11
+ marked as 'MustSupport', if any are available.
12
+
13
+ It verifies that at least one external reference for each MustSupport Reference element
14
+ can be accessed by the test client, and conforms to corresponding US Core profile.
15
+
16
+ Elements which may provide external references include:
17
+
18
+ <%= must_support_reference_list_string %>
19
+ )
20
+
21
+ id :<%= test_id %>
22
+
23
+ def resource_type
24
+ '<%= resource_type %>'
25
+ end
26
+
27
+ def self.metadata
28
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
29
+ end
30
+
31
+ def scratch_resources
32
+ scratch[:<%= profile_identifier %>_resources] ||= {}
33
+ end
34
+
35
+ run do
36
+ perform_reference_resolution_test(<%= resource_collection_string %>)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,41 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module DaVinciUSDrugFormularyTestKit
5
+ module <%= module_name %>
6
+ class <%= class_name %> < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for <%= resource_type %> search by <%= search_param_name_string %>'
10
+ description %(
11
+ <%= description %>
12
+ )
13
+
14
+ id :<%= test_id %><% if optional? %>
15
+ optional
16
+ <% end %>
17
+ <% if needs_id? %>
18
+ input :input_ids,
19
+ title: '<%= resource_type %> IDs',
20
+ description: 'Comma separated list of <%= resource_type %> IDs that in sum contain all MUST SUPPORT elements'
21
+ <% end %>
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ <%= search_test_properties_string %>
25
+ )
26
+ end
27
+
28
+ def self.metadata
29
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
30
+ end
31
+
32
+ def scratch_resources
33
+ scratch[:<%= profile_identifier %>_resources] ||= {}
34
+ end
35
+
36
+ run do
37
+ run_search_test
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,115 @@
1
+ require 'inferno/dsl/oauth_credentials'
2
+ require_relative '../../version'
3
+ require_relative '<%= capability_statement_file_name %>'
4
+ <% group_file_list.each do |file_name| %>require_relative '<%= file_name %>'
5
+ <% end %>
6
+ module DaVinciUSDrugFormularyTestKit
7
+ module <%= module_name %>
8
+ class <%= class_name %> < Inferno::TestSuite
9
+ title '<%= title %>'
10
+ short_title '<%= short_title %>'
11
+ description %(
12
+ The DaVinci US Drug Formulary Test Kit tests systems for their
13
+ conformance to the [US Drug Formulary Implementation Guide](<%=ig_link
14
+ %>).
15
+
16
+ ## Instructions
17
+ In order to run the tests, provide the base URL of the FHIR server to
18
+ test, along with the IDs of Insurance Plan Location resources.
19
+ Credentials may optionally be provided if testing against a system which
20
+ requires authorization.
21
+
22
+ ## Scope
23
+ These tests check the following behaviors as defined in the IG:
24
+ - FHIR Interactions
25
+ - Conformance
26
+ - Read
27
+ - Search
28
+ - Individual search parameters
29
+ - _include searches
30
+ - FHIR Data
31
+ - Validation against IG profiles
32
+ - Presence of all Must Support fields
33
+ - Resolution of Must Support references
34
+
35
+ **Known Issues**
36
+ - Must Support checks are not performed for all elements of Formulary
37
+ Drug resources due to the use of an intensional value set for slicing
38
+ `MedicationKnowledge.code.coding` elements.
39
+ - The following search features are not tested:
40
+ - Combination searches
41
+ - Multiple Or
42
+ - Multiple And
43
+ - Comparators
44
+ )
45
+
46
+ id :<%= suite_id %>
47
+
48
+ VALIDATION_MESSAGE_FILTERS = [
49
+ %r{Sub-extension url 'introspect' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
50
+ %r{Sub-extension url 'revoke' is not defined by the Extension http://fhir-registry\.smarthealthit\.org/StructureDefinition/oauth-uris},
51
+ /Observation\.effective\.ofType\(Period\): .*vs-1:/, # Invalid invariant in FHIR v4.0.1
52
+ /\A\S+: \S+: URL value '.*' does not resolve/,
53
+ ].freeze
54
+
55
+ VERSION_SPECIFIC_MESSAGE_FILTERS = <%=version_specific_message_filters%>.freeze
56
+
57
+ def self.metadata
58
+ @metadata ||= YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true)[:groups].map do |raw_metadata|
59
+ Generator::GroupMetadata.new(raw_metadata)
60
+ end
61
+ end
62
+
63
+ fhir_resource_validator do
64
+ igs '<%= ig_identifier %>'
65
+
66
+ message_filters = VALIDATION_MESSAGE_FILTERS + VERSION_SPECIFIC_MESSAGE_FILTERS
67
+
68
+ exclude_message do |message|
69
+
70
+ message_filters.any? { |filter| filter.match? message.message }
71
+ end
72
+
73
+ perform_additional_validation do |resource, profile_url|
74
+ ProvenanceValidator.validate(resource) if resource.instance_of?(FHIR::Provenance)
75
+ end
76
+ end
77
+
78
+ links [
79
+ {
80
+ label: 'Report Issue',
81
+ url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit/issues'
82
+ },
83
+ {
84
+ label: 'Open Source',
85
+ url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit'
86
+ },
87
+ {
88
+ label: 'Download',
89
+ url: 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit/releases'
90
+ },
91
+ {
92
+ label: 'Implementation Guide',
93
+ url: '<%=ig_link%>'
94
+ }
95
+ ]
96
+
97
+ input :url,
98
+ title: 'FHIR Endpoint',
99
+ description: 'URL of the FHIR endpoint'
100
+ input :smart_credentials,
101
+ title: 'OAuth Credentials',
102
+ type: :oauth_credentials,
103
+ optional: true
104
+
105
+ fhir_client do
106
+ url :url
107
+ oauth_credentials :smart_credentials
108
+ end
109
+
110
+ group from: :<%= capability_statement_group_id %>
111
+ <% group_id_list.each do |id| %>
112
+ group from: :<%= id %><% end %>
113
+ end
114
+ end
115
+ end
@@ -0,0 +1,30 @@
1
+ require_relative '../../../validation_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module <%= module_name %>
5
+ class <%= class_name %> < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::ValidationTest
7
+
8
+ id :<%= test_id %>
9
+ title '<%= resource_type %> resources returned during previous tests conform to the <%= profile_name %> profile'
10
+ description %(
11
+ <%= description %>
12
+ )
13
+ output :dar_code_found, :dar_extension_found
14
+
15
+ def resource_type
16
+ '<%= resource_type %>'
17
+ end
18
+
19
+ def scratch_resources
20
+ scratch[:<%= profile_identifier %>_resources] ||= {}
21
+ end
22
+
23
+ run do
24
+ perform_validation_test(scratch_resources[:all] || [],
25
+ '<%= profile_url %>',
26
+ '<%= profile_version %>')
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,25 @@
1
+ # Note on this IGs folder
2
+
3
+ There are three reasons why it would be necessary to put an IG package.tgz in this folder. If none of these apply, you do not need to put any files here, or can consider removing any existing files to make it clear they are unused.
4
+
5
+ ## 1. Generated Test Suites
6
+ Some test kits use a "generator" to automatically generate the contents of a test suite for an IG. The IG files are required every time the test suites need to be regenerated. Examples of test kits that use this approach are the US Core Test Kit and CARIN IG for Blue Button® Test Kit.
7
+
8
+
9
+ ## 2. Non-published IG
10
+ If your IG, or the specific version of the IG you want to test against, is not published, then the validator service needs to load the IG from file in order to be able to validate resources with it. The IG must be referenced in the `fhir_resource_validator` block in the test suite definition by filename, ie:
11
+
12
+ ```ruby
13
+ fhir_resource_validator do
14
+ igs 'igs/filename.tgz'
15
+
16
+ ...
17
+ end
18
+ ```
19
+
20
+ ## 3. Inferno Validator UI
21
+ The Inferno Validator UI is configured to auto-load any IGs present in the igs folder and include them in all validations. The Inferno Validator UI is currently disabled by default, so this is only relevant if you choose to re-enable it. In general, the Inferno team is currently leaving IGs in this folder even if not otherwise necessary to make it easy to re-enable the validator UI.
22
+
23
+ ## 4. Overwriting or supplementing IG data
24
+ In some instances, an IG may include errors or be missing resources. In these cases, you can correct individual resource files and put them in either the <ig package name>_supersede or <ig package name>_supplement directories.
25
+ A README.md file in each directory explains why each file exists.
@@ -0,0 +1,44 @@
1
+ # IG Supersede Files
2
+
3
+ The files in this directory will supersede files in the <ig package>.tgz IG.
4
+ Add files to this directory if you need to correct errors in the IG.
5
+
6
+ ## CapabilityStatement-usdf-server.json
7
+ The original capability statement includes the following:
8
+
9
+ ``` json
10
+ "searchInclude": [
11
+ "formulary-coverage"
12
+ ],
13
+ ...
14
+
15
+ "searchInclude": [
16
+ "subject",
17
+ "formulary"
18
+ ],
19
+ ```
20
+
21
+ The [FHIR documentation](https://hl7.org/fhir/r4/search.html#table) states that the allowable content for `_include` is `SourceType:searchParam(:targetType)`.
22
+
23
+
24
+
25
+ This capability statement supersedes the original with the following:
26
+
27
+ ``` json
28
+ "searchInclude": [
29
+ "InsurancePlan:formulary-coverage"
30
+ ],
31
+ ...
32
+
33
+ "searchInclude": [
34
+ "Basic:subject",
35
+ "Basic:formulary"
36
+ ],
37
+ ```
38
+
39
+ With this modification, the test generator can properly create tests for `_include`.
40
+
41
+ ### Notes:
42
+
43
+ #### 06/19/2024
44
+ This issue should be raised with the Da Vinci IG developers. Once this issue is resolved in the IG, this file should be removed.
@@ -0,0 +1,9 @@
1
+ # IG Supplement Files
2
+
3
+ The files in this directory will supplement files in the <ig package>.tgz IG.
4
+ Add files to this directory if you need to add information that may be missing from the IG (e.g., adding in base definitions that are not defined in the IG).
5
+ These files will not supersede the files in the IG.
6
+
7
+ ## r4_search-parameters.json
8
+
9
+ The US Drug Formulary IG (v2.0.1) only includes definitions for parameters it changes from the base definitions. However, the code generator assumes all definitions are present in the IG. By adding in the `r4_search-parameters.json` file, we provide any missing definitions. However, we want to make sure we don't supersede any definitions in the IG, because those take precedence.
@@ -0,0 +1,60 @@
1
+ require_relative 'version'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ class Metadata < Inferno::TestKit
5
+ id :davinci_us_drug_formulary_test_kit
6
+ title 'Da Vinci US Drug Formulary Test Kit'
7
+ suite_ids ['davinci_us_drug_formulary_v201']
8
+ tags ['Da Vinci']
9
+ last_updated ::DaVinciUSDrugFormularyTestKit::LAST_UPDATED
10
+ version ::DaVinciUSDrugFormularyTestKit::VERSION
11
+ maturity 'Low'
12
+ authors ['Stephen MacVicar', 'Tom Strassner', 'Robert Passas']
13
+ repo 'https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit'
14
+ description <<~DESCRIPTION
15
+ The DaVinci US Drug Formulary Test Kit validates the conformance of a server
16
+ implementation to the
17
+ [DaVinci Payer Data Exchange (PDex) US Drug Formulary Implementation Guide v2.0.1](http://hl7.org/fhir/us/davinci-drug-formulary/STU2.0.1).
18
+
19
+ <!-- break -->
20
+
21
+ These tests check the following behaviors as defined in the IG:
22
+
23
+ - FHIR Interactions
24
+ + Capabilities
25
+ + Read
26
+ + Search
27
+ * Individual search parameters
28
+ * _include searches
29
+ - FHIR Data
30
+ + Validation against IG profiles
31
+ + Presence of all Must Support fields
32
+ * Resolution of Must Support references
33
+
34
+ The DaVinci US Drug Formulary Test Kit is built using the
35
+ [Inferno Framework](https://inferno-framework.github.io/).
36
+ The Inferno Framework is designed for reuse and aims to make it easier to
37
+ build test kits for any FHIR-based data exchange.
38
+
39
+ ### Known Limitations
40
+
41
+ The following areas of the IG are not fully tested in this draft version
42
+ of the test kit:
43
+
44
+ - Must Support checks are not performed for all elements of Formulary Drug
45
+ resources due to the use of an intensional value set for slicing
46
+ `MedicationKnowledge.code.coding` elements.
47
+ - The following search features are not tested:
48
+ + Combination searches
49
+ + Multiple Or
50
+ + Multiple And
51
+ + Comparators
52
+
53
+ ## Reporting Issues
54
+
55
+ Please report any issues with this set of tests in the
56
+ [GitHub Issues](https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit/issues)
57
+ section of this repository.
58
+ DESCRIPTION
59
+ end
60
+ end
@@ -131,7 +131,7 @@ module DaVinciUSDrugFormularyTestKit
131
131
  check_search_response
132
132
 
133
133
  resources_returned =
134
- fetch_all_bundled_resources.select { |resource| resource.resourceType == resource_type }
134
+ select_all_bundled_resources
135
135
 
136
136
  return [] if resources_returned.blank?
137
137
 
@@ -166,7 +166,7 @@ module DaVinciUSDrugFormularyTestKit
166
166
 
167
167
  check_search_response
168
168
 
169
- post_search_resources = fetch_all_bundled_resources.select { |resource| resource.resourceType == resource_type }
169
+ post_search_resources = select_all_bundled_resources
170
170
 
171
171
  filter_insurance_plan(post_search_resources) if resource_type == 'InsurancePlan'
172
172
 
@@ -272,7 +272,7 @@ module DaVinciUSDrugFormularyTestKit
272
272
 
273
273
  search_and_check_response(params_with_comparator)
274
274
 
275
- fetch_all_bundled_resources.each do |resource|
275
+ fetch_all_bundled_resources(resource_type: resource_type, bundle: resource).each do |resource|
276
276
  check_resource_against_params(resource, params_with_comparator) if resource.resourceType == resource_type
277
277
  end
278
278
  end
@@ -304,9 +304,7 @@ module DaVinciUSDrugFormularyTestKit
304
304
 
305
305
  search_and_check_response(new_search_params)
306
306
 
307
- reference_with_type_resources = fetch_all_bundled_resources.select do |resource|
308
- resource.resourceType == resource_type
309
- end
307
+ reference_with_type_resources = select_all_bundled_resources
310
308
 
311
309
  filter_insurance_plan(reference_with_type_resources) if resource_type == 'InsurancePlan'
312
310
 
@@ -329,9 +327,7 @@ module DaVinciUSDrugFormularyTestKit
329
327
  search_params = params.merge(new_search_params)
330
328
  search_and_check_response(search_params)
331
329
 
332
- resources_returned =
333
- fetch_all_bundled_resources
334
- .select { |resource| resource.resourceType == resource_type }
330
+ resources_returned = select_all_bundled_resources
335
331
 
336
332
  assert resources_returned.present?, 'No resources were returned when searching by `system|code`'
337
333
 
@@ -378,9 +374,7 @@ module DaVinciUSDrugFormularyTestKit
378
374
 
379
375
  search_and_check_response(search_params)
380
376
 
381
- resources_returned =
382
- fetch_all_bundled_resources
383
- .select { |resource| resource.resourceType == resource_type }
377
+ resources_returned = select_all_bundled_resources
384
378
 
385
379
  multiple_or_search_params.each do |param_name|
386
380
  missing_values[param_name.to_sym] =
@@ -508,51 +502,14 @@ module DaVinciUSDrugFormularyTestKit
508
502
  "#{msg}. Please use resources with more information"
509
503
  end
510
504
 
511
- def fetch_all_bundled_resources(
512
- reply_handler: nil,
513
- max_pages: 20,
514
- additional_resource_types: [],
515
- resource_type: self.resource_type
516
- )
517
- page_count = 1
518
- resources = []
519
- bundle = resource
520
-
521
- until bundle.nil? || page_count == max_pages
522
- resources += bundle&.entry&.map { |entry| entry&.resource }
523
- next_bundle_link = bundle&.link&.find { |link| link.relation == 'next' }&.url
524
- reply_handler&.call(response)
525
-
526
- break if next_bundle_link.blank?
527
-
528
- reply = fhir_client.raw_read_url(next_bundle_link)
529
-
530
- store_request('outgoing') { reply }
531
- error_message = cant_resolve_next_bundle_message(next_bundle_link)
532
-
533
- assert_response_status(200)
534
- assert_valid_json(reply.body, error_message)
535
-
536
- bundle = fhir_client.parse_reply(FHIR::Bundle, fhir_client.default_format, reply)
537
-
538
- page_count += 1
539
- end
540
-
541
- valid_resource_types = [resource_type, 'OperationOutcome'].concat(additional_resource_types)
542
- valid_resource_types << 'Medication' if resource_type == 'MedicationRequest'
543
-
544
- invalid_resource_types =
545
- resources.reject { |entry| valid_resource_types.include? entry.resourceType }
546
- .map(&:resourceType)
547
- .uniq
548
-
549
- if invalid_resource_types.any?
550
- info "Received resource type(s) #{invalid_resource_types.join(', ')} in search bundle, " \
551
- "but only expected resource types #{valid_resource_types.join(', ')}. " \
552
- 'This is unusual but allowed if the server believes additional resource types are relevant.'
505
+ def select_all_bundled_resources
506
+ if resource_type == 'MedicationRequest'
507
+ fetch_all_bundled_resources(resource_type: resource_type, bundle: resource, additional_resource_types: ['Medication'])
508
+ .select{ |resource| resource.resourceType == resource_type }
509
+ else
510
+ fetch_all_bundled_resources(resource_type: resource_type, bundle: resource)
511
+ .select{ |resource| resource.resourceType == resource_type }
553
512
  end
554
-
555
- resources
556
513
  end
557
514
 
558
515
  def cant_resolve_next_bundle_message(link)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DaVinciUSDrugFormularyTestKit
4
- VERSION = '0.10.4'
4
+ VERSION = '0.11.0'
5
+ LAST_UPDATED = '2025-02-25'
5
6
  end
@@ -1 +1,2 @@
1
+ require_relative 'davinci_us_drug_formulary_test_kit/metadata.rb'
1
2
  require_relative 'davinci_us_drug_formulary_test_kit/generated/v2.0.1/usdf_test_suite'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: davinci_us_drug_formulary_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.4
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen MacVicar
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-11-07 00:00:00.000000000 Z
13
+ date: 2025-02-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: inferno_core
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: 0.5.0
21
+ version: 0.6.2
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: 0.5.0
28
+ version: 0.6.2
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: tls_test_kit
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 0.2.0
35
+ version: 0.3.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 0.2.0
42
+ version: 0.3.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: database_cleaner-sequel
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -104,6 +104,7 @@ extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
106
  - LICENSE
107
+ - config/presets/formulary_ri.json
107
108
  - lib/davinci_us_drug_formulary_test_kit.rb
108
109
  - lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/conformance_support_test.rb
109
110
  - lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/fhir_version_test.rb
@@ -204,12 +205,25 @@ files:
204
205
  - lib/davinci_us_drug_formulary_test_kit/generator/search_metadata_extractor.rb
205
206
  - lib/davinci_us_drug_formulary_test_kit/generator/search_test_generator.rb
206
207
  - lib/davinci_us_drug_formulary_test_kit/generator/suite_generator.rb
208
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/group.rb.erb
209
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/include_search.rb.erb
210
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/must_support.rb.erb
211
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/provenance_revinclude_search.rb.erb
212
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/read.rb.erb
213
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/reference_resolution.rb.erb
214
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/search.rb.erb
215
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/suite.rb.erb
216
+ - lib/davinci_us_drug_formulary_test_kit/generator/templates/validation.rb.erb
207
217
  - lib/davinci_us_drug_formulary_test_kit/generator/terminology_binding_metadata_extractor.rb
208
218
  - lib/davinci_us_drug_formulary_test_kit/generator/validation_test_generator.rb
209
219
  - lib/davinci_us_drug_formulary_test_kit/generator/value_extractor.rb
220
+ - lib/davinci_us_drug_formulary_test_kit/igs/README.md
210
221
  - lib/davinci_us_drug_formulary_test_kit/igs/package.tgz
211
222
  - lib/davinci_us_drug_formulary_test_kit/igs/package_supersede/CapabilityStatement-usdf-server.json
223
+ - lib/davinci_us_drug_formulary_test_kit/igs/package_supersede/README.md
224
+ - lib/davinci_us_drug_formulary_test_kit/igs/package_supplement/README.md
212
225
  - lib/davinci_us_drug_formulary_test_kit/igs/package_supplement/r4_search-parameters.json
226
+ - lib/davinci_us_drug_formulary_test_kit/metadata.rb
213
227
  - lib/davinci_us_drug_formulary_test_kit/must_support_test.rb
214
228
  - lib/davinci_us_drug_formulary_test_kit/read_test.rb
215
229
  - lib/davinci_us_drug_formulary_test_kit/reference_resolution_test.rb
@@ -224,6 +238,7 @@ licenses:
224
238
  metadata:
225
239
  homepage_uri: https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit
226
240
  source_code_uri: https://github.com/inferno-framework/davinci-us-drug-formulary-test-kit
241
+ inferno_test_kit: 'true'
227
242
  post_install_message:
228
243
  rdoc_options: []
229
244
  require_paths:
@@ -232,14 +247,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
232
247
  requirements:
233
248
  - - ">="
234
249
  - !ruby/object:Gem::Version
235
- version: 3.1.2
250
+ version: 3.3.6
236
251
  required_rubygems_version: !ruby/object:Gem::Requirement
237
252
  requirements:
238
253
  - - ">="
239
254
  - !ruby/object:Gem::Version
240
255
  version: '0'
241
256
  requirements: []
242
- rubygems_version: 3.3.7
257
+ rubygems_version: 3.5.22
243
258
  signing_key:
244
259
  specification_version: 4
245
260
  summary: DaVinci US Drug Formulary Test Kit