davinci_us_drug_formulary_test_kit 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/conformance_support_test.rb +41 -0
- data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/fhir_version_test.rb +15 -0
- data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/instantiate_test.rb +19 -0
- data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/json_support_test.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/profile_support_test.rb +39 -0
- data/lib/davinci_us_drug_formulary_test_kit/custom_groups/v2.0.1/capability_statement_group.rb +78 -0
- data/lib/davinci_us_drug_formulary_test_kit/date_search_validation.rb +121 -0
- data/lib/davinci_us_drug_formulary_test_kit/fhir_resource_navigation.rb +155 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_code_search_test.rb +54 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_drug_tier_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_formulary_include_search_test.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_formulary_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_id_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_lastupdated_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_must_support_test.rb +46 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_period_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_pharmacy_benefit_type_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_read_test.rb +26 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_reference_resolution_test.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_status_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_subject_include_search_test.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_subject_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_validation_test.rb +39 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/metadata.yml +292 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic_group.rb +107 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_coverage_area_search_test.rb +45 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_coverage_type_search_test.rb +45 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_formulary_coverage_search_test.rb +45 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_id_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_identifier_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_lastupdated_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_must_support_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_name_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_period_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_read_test.rb +26 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_status_search_test.rb +53 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_type_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_validation_test.rb +39 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/metadata.yml +278 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary_group.rb +104 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_city_search_test.rb +44 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_postalcode_search_test.rb +44 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_state_search_test.rb +44 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_id_search_test.rb +56 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_lastupdated_search_test.rb +44 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_must_support_test.rb +37 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_read_test.rb +26 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_validation_test.rb +39 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/metadata.yml +177 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location_group.rb +92 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_code_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_doseform_search_test.rb +45 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_drug_name_search_test.rb +44 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_id_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_lastupdated_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_must_support_test.rb +47 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_read_test.rb +26 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_status_search_test.rb +53 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_validation_test.rb +39 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/metadata.yml +214 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge_group.rb +91 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/metadata.yml +1192 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/metadata.yml +371 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_coverage_area_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_coverage_type_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_formulary_coverage_include_search_test.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_formulary_coverage_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_id_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_identifier_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_lastupdated_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_must_support_test.rb +66 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_name_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_period_search_test.rb +42 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_read_test.rb +26 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_reference_resolution_test.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_status_search_test.rb +53 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_type_search_test.rb +43 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_validation_test.rb +39 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan_group.rb +108 -0
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/usdf_test_suite.rb +114 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/group_generator.rb +181 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/group_metadata.rb +79 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/group_metadata_extractor.rb +329 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/ig_loader.rb +77 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb +33 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb +40 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/ig_resources.rb +60 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/include_search_test_generator.rb +68 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/must_support_metadata_extractor.rb +384 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/must_support_test_generator.rb +117 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/naming.rb +28 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/read_test_generator.rb +92 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/reference_resolution_test_generator.rb +91 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/search_definition_metadata_extractor.rb +187 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/search_metadata_extractor.rb +59 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/search_test_generator.rb +270 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/suite_generator.rb +94 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/terminology_binding_metadata_extractor.rb +116 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/validation_test_generator.rb +102 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator/value_extractor.rb +113 -0
- data/lib/davinci_us_drug_formulary_test_kit/generator.rb +94 -0
- data/lib/davinci_us_drug_formulary_test_kit/igs/package/r4_search-parameters.json +65408 -0
- data/lib/davinci_us_drug_formulary_test_kit/igs/package.tgz +0 -0
- data/lib/davinci_us_drug_formulary_test_kit/must_support_test.rb +224 -0
- data/lib/davinci_us_drug_formulary_test_kit/read_test.rb +62 -0
- data/lib/davinci_us_drug_formulary_test_kit/reference_resolution_test.rb +174 -0
- data/lib/davinci_us_drug_formulary_test_kit/request_logger.rb +46 -0
- data/lib/davinci_us_drug_formulary_test_kit/search_test.rb +767 -0
- data/lib/davinci_us_drug_formulary_test_kit/search_test_properties.rb +58 -0
- data/lib/davinci_us_drug_formulary_test_kit/validation_test.rb +56 -0
- data/lib/davinci_us_drug_formulary_test_kit/version.rb +5 -0
- data/lib/davinci_us_drug_formulary_test_kit.rb +1 -0
- metadata +245 -0
@@ -0,0 +1,92 @@
|
|
1
|
+
require_relative 'location/location_id_search_test'
|
2
|
+
require_relative 'location/location_lastupdated_search_test'
|
3
|
+
require_relative 'location/location_address_search_test'
|
4
|
+
require_relative 'location/location_address_city_search_test'
|
5
|
+
require_relative 'location/location_address_state_search_test'
|
6
|
+
require_relative 'location/location_address_postalcode_search_test'
|
7
|
+
require_relative 'location/location_read_test'
|
8
|
+
require_relative 'location/location_validation_test'
|
9
|
+
require_relative 'location/location_must_support_test'
|
10
|
+
|
11
|
+
module DaVinciUSDrugFormularyTestKit
|
12
|
+
module USDFV201
|
13
|
+
class LocationGroup < Inferno::TestGroup
|
14
|
+
title 'Insurance Plan Location Tests'
|
15
|
+
short_description 'Verify support for the server capabilities required by the Insurance Plan Location.'
|
16
|
+
description %(
|
17
|
+
# Background
|
18
|
+
|
19
|
+
The USDF Insurance Plan Location sequence verifies that the system under test is
|
20
|
+
able to provide correct responses for Location queries. These queries
|
21
|
+
must contain resources conforming to the Insurance Plan Location as
|
22
|
+
specified in the USDF v2.0.1 Implementation Guide.
|
23
|
+
|
24
|
+
# Testing Methodology
|
25
|
+
## Searching
|
26
|
+
This test sequence will first perform each required search associated
|
27
|
+
with this resource. This sequence will perform searches with the
|
28
|
+
following parameters:
|
29
|
+
|
30
|
+
* _id
|
31
|
+
* _lastUpdated
|
32
|
+
* address
|
33
|
+
* address-city
|
34
|
+
* address-state
|
35
|
+
* address-postalcode
|
36
|
+
|
37
|
+
### Search Parameters
|
38
|
+
The first search uses the selected resources from the prior launch
|
39
|
+
sequence. Any subsequent searches will look for its parameter values
|
40
|
+
from the results of the first search. If a value cannot be found this way, the search is skipped.
|
41
|
+
|
42
|
+
### Search Validation
|
43
|
+
Inferno will retrieve up to the first 20 bundle pages of the reply for
|
44
|
+
Location resources and save them for subsequent tests. Each of
|
45
|
+
these resources is then checked to see if it matches the searched
|
46
|
+
parameters in accordance with [FHIR search
|
47
|
+
guidelines](https://www.hl7.org/fhir/search.html).
|
48
|
+
|
49
|
+
|
50
|
+
## Must Support
|
51
|
+
Each profile contains elements marked as "must support". This test
|
52
|
+
sequence expects to see each of these elements at least once. If at
|
53
|
+
least one cannot be found, the test will fail. The test will look
|
54
|
+
through the Location resources found in the first test for these
|
55
|
+
elements.
|
56
|
+
|
57
|
+
## Profile Validation
|
58
|
+
Each resource returned from the first search is expected to conform to
|
59
|
+
the [Insurance Plan Location](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-InsurancePlanLocation). Each element is checked against
|
60
|
+
teminology binding and cardinality requirements.
|
61
|
+
|
62
|
+
Elements with a required binding are validated against their bound
|
63
|
+
ValueSet. If the code/system in the element is not part of the ValueSet,
|
64
|
+
then the test will fail.
|
65
|
+
|
66
|
+
## Reference Validation
|
67
|
+
At least one instance of each external reference in elements marked as
|
68
|
+
"must support" within the resources provided by the system must resolve.
|
69
|
+
The test will attempt to read each reference found and will fail if no
|
70
|
+
read succeeds.
|
71
|
+
|
72
|
+
)
|
73
|
+
|
74
|
+
id :usdf_v201_location
|
75
|
+
run_as_group
|
76
|
+
|
77
|
+
def self.metadata
|
78
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'location', 'metadata.yml'), aliases: true))
|
79
|
+
end
|
80
|
+
|
81
|
+
test from: :usdf_v201_location__id_search_test
|
82
|
+
test from: :usdf_v201_location__lastUpdated_search_test
|
83
|
+
test from: :usdf_v201_location_address_search_test
|
84
|
+
test from: :usdf_v201_location_address_city_search_test
|
85
|
+
test from: :usdf_v201_location_address_state_search_test
|
86
|
+
test from: :usdf_v201_location_address_postalcode_search_test
|
87
|
+
test from: :usdf_v201_location_read_test
|
88
|
+
test from: :usdf_v201_location_validation_test
|
89
|
+
test from: :usdf_v201_location_must_support_test
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class MedicationKnowledgeCodeSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for MedicationKnowledge search by code'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
code on the MedicationKnowledge resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
[US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2/CapabilityStatement-usdf-server.html)
|
17
|
+
|
18
|
+
)
|
19
|
+
|
20
|
+
id :usdf_v201_medication_knowledge_code_search_test
|
21
|
+
|
22
|
+
def self.properties
|
23
|
+
@properties ||= SearchTestProperties.new(
|
24
|
+
resource_type: 'MedicationKnowledge',
|
25
|
+
search_param_names: ['code'],
|
26
|
+
token_search_params: ['code']
|
27
|
+
)
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.metadata
|
31
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
32
|
+
end
|
33
|
+
|
34
|
+
def scratch_resources
|
35
|
+
scratch[:medication_knowledge_resources] ||= {}
|
36
|
+
end
|
37
|
+
|
38
|
+
run do
|
39
|
+
run_search_test
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class MedicationKnowledgeDoseformSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for MedicationKnowledge search by doseform'
|
10
|
+
description %(
|
11
|
+
A server SHOULD support searching by
|
12
|
+
doseform on the MedicationKnowledge resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
[US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2/CapabilityStatement-usdf-server.html)
|
17
|
+
|
18
|
+
)
|
19
|
+
|
20
|
+
id :usdf_v201_medication_knowledge_doseform_search_test
|
21
|
+
optional
|
22
|
+
|
23
|
+
|
24
|
+
def self.properties
|
25
|
+
@properties ||= SearchTestProperties.new(
|
26
|
+
resource_type: 'MedicationKnowledge',
|
27
|
+
search_param_names: ['doseform'],
|
28
|
+
token_search_params: ['doseform']
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.metadata
|
33
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
34
|
+
end
|
35
|
+
|
36
|
+
def scratch_resources
|
37
|
+
scratch[:medication_knowledge_resources] ||= {}
|
38
|
+
end
|
39
|
+
|
40
|
+
run do
|
41
|
+
run_search_test
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class MedicationKnowledgeDrugNameSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for MedicationKnowledge search by drug-name'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
drug-name on the MedicationKnowledge resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
[US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2/CapabilityStatement-usdf-server.html)
|
17
|
+
|
18
|
+
)
|
19
|
+
|
20
|
+
id :usdf_v201_medication_knowledge_drug_name_search_test
|
21
|
+
optional
|
22
|
+
|
23
|
+
|
24
|
+
def self.properties
|
25
|
+
@properties ||= SearchTestProperties.new(
|
26
|
+
resource_type: 'MedicationKnowledge',
|
27
|
+
search_param_names: ['drug-name']
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.metadata
|
32
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
33
|
+
end
|
34
|
+
|
35
|
+
def scratch_resources
|
36
|
+
scratch[:medication_knowledge_resources] ||= {}
|
37
|
+
end
|
38
|
+
|
39
|
+
run do
|
40
|
+
run_search_test
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class MedicationKnowledgeIdSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for MedicationKnowledge search by _id'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
_id on the MedicationKnowledge resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
[US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2/CapabilityStatement-usdf-server.html)
|
17
|
+
|
18
|
+
)
|
19
|
+
|
20
|
+
id :usdf_v201_medication_knowledge__id_search_test
|
21
|
+
|
22
|
+
def self.properties
|
23
|
+
@properties ||= SearchTestProperties.new(
|
24
|
+
resource_type: 'MedicationKnowledge',
|
25
|
+
search_param_names: ['_id']
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.metadata
|
30
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
31
|
+
end
|
32
|
+
|
33
|
+
def scratch_resources
|
34
|
+
scratch[:medication_knowledge_resources] ||= {}
|
35
|
+
end
|
36
|
+
|
37
|
+
run do
|
38
|
+
run_search_test
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class MedicationKnowledgeLastupdatedSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for MedicationKnowledge search by _lastUpdated'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
_lastUpdated on the MedicationKnowledge resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
[US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2/CapabilityStatement-usdf-server.html)
|
17
|
+
|
18
|
+
)
|
19
|
+
|
20
|
+
id :usdf_v201_medication_knowledge__lastUpdated_search_test
|
21
|
+
|
22
|
+
def self.properties
|
23
|
+
@properties ||= SearchTestProperties.new(
|
24
|
+
resource_type: 'MedicationKnowledge',
|
25
|
+
search_param_names: ['_lastUpdated']
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.metadata
|
30
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
31
|
+
end
|
32
|
+
|
33
|
+
def scratch_resources
|
34
|
+
scratch[:medication_knowledge_resources] ||= {}
|
35
|
+
end
|
36
|
+
|
37
|
+
run do
|
38
|
+
run_search_test
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
require_relative '../../../must_support_test'
|
2
|
+
|
3
|
+
module DaVinciUSDrugFormularyTestKit
|
4
|
+
module DaVinciUSDrugFormularyV201
|
5
|
+
class MedicationKnowledgeMustSupportTest < Inferno::Test
|
6
|
+
include DaVinciUSDrugFormularyTestKit::MustSupportTest
|
7
|
+
|
8
|
+
title 'All must support elements are provided in the MedicationKnowledge 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 MedicationKnowledge resources
|
13
|
+
found previously for the following must support elements:
|
14
|
+
|
15
|
+
* MedicationKnowledge.code
|
16
|
+
* MedicationKnowledge.code.coding
|
17
|
+
* MedicationKnowledge.code.coding:semantic-drug
|
18
|
+
* MedicationKnowledge.code.coding:semantic-drug-form-group
|
19
|
+
* MedicationKnowledge.code.coding:semantic-drug-form-group.code
|
20
|
+
* MedicationKnowledge.code.coding:semantic-drug-form-group.system
|
21
|
+
* MedicationKnowledge.code.coding:semantic-drug.code
|
22
|
+
* MedicationKnowledge.code.coding:semantic-drug.system
|
23
|
+
* MedicationKnowledge.doseForm
|
24
|
+
* MedicationKnowledge.meta.lastUpdated
|
25
|
+
* MedicationKnowledge.status
|
26
|
+
)
|
27
|
+
|
28
|
+
id :usdf_v201_medication_knowledge_must_support_test
|
29
|
+
|
30
|
+
def resource_type
|
31
|
+
'MedicationKnowledge'
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.metadata
|
35
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
36
|
+
end
|
37
|
+
|
38
|
+
def scratch_resources
|
39
|
+
scratch[:medication_knowledge_resources] ||= {}
|
40
|
+
end
|
41
|
+
|
42
|
+
run do
|
43
|
+
perform_must_support_test(all_scratch_resources)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../../../read_test'
|
2
|
+
|
3
|
+
module DaVinciUSDrugFormularyTestKit
|
4
|
+
module USDFV201
|
5
|
+
class MedicationKnowledgeReadTest < Inferno::Test
|
6
|
+
include DaVinciUSDrugFormularyTestKit::ReadTest
|
7
|
+
|
8
|
+
title 'Server returns correct MedicationKnowledge resource from MedicationKnowledge read interaction'
|
9
|
+
description 'A server SHALL support the MedicationKnowledge read interaction.'
|
10
|
+
|
11
|
+
id :usdf_v201_medication_knowledge_read_test
|
12
|
+
|
13
|
+
def resource_type
|
14
|
+
'MedicationKnowledge'
|
15
|
+
end
|
16
|
+
|
17
|
+
def scratch_resources
|
18
|
+
scratch[:medication_knowledge_resources] ||= {}
|
19
|
+
end
|
20
|
+
|
21
|
+
run do
|
22
|
+
perform_read_test(all_scratch_resources)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class MedicationKnowledgeStatusSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for MedicationKnowledge search by status'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
status on the MedicationKnowledge resource. This test
|
13
|
+
will pass if resources are returned and match the search criteria. If
|
14
|
+
none are returned, the test is skipped.
|
15
|
+
|
16
|
+
Because this is the first search of the sequence, resources in the
|
17
|
+
response will be used for subsequent tests.
|
18
|
+
|
19
|
+
Additionally, this test will check that GET and POST search methods
|
20
|
+
return the same number of results. Search by POST is required by the
|
21
|
+
FHIR R4 specification, and these tests interpret search by GET as a
|
22
|
+
requirement of US Core v2.0.1.
|
23
|
+
|
24
|
+
[US Drug Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/STU2/CapabilityStatement-usdf-server.html)
|
25
|
+
|
26
|
+
)
|
27
|
+
|
28
|
+
id :usdf_v201_medication_knowledge_status_search_test
|
29
|
+
|
30
|
+
def self.properties
|
31
|
+
@properties ||= SearchTestProperties.new(
|
32
|
+
first_search: true,
|
33
|
+
fixed_value_search: true,
|
34
|
+
resource_type: 'MedicationKnowledge',
|
35
|
+
search_param_names: ['status'],
|
36
|
+
test_post_search: true
|
37
|
+
)
|
38
|
+
end
|
39
|
+
|
40
|
+
def self.metadata
|
41
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
42
|
+
end
|
43
|
+
|
44
|
+
def scratch_resources
|
45
|
+
scratch[:medication_knowledge_resources] ||= {}
|
46
|
+
end
|
47
|
+
|
48
|
+
run do
|
49
|
+
run_search_test
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative '../../../validation_test'
|
2
|
+
|
3
|
+
module DaVinciUSDrugFormularyTestKit
|
4
|
+
module DaVinciUSDrugFormularyV201
|
5
|
+
class MedicationKnowledgeValidationTest < Inferno::Test
|
6
|
+
include DaVinciUSDrugFormularyTestKit::ValidationTest
|
7
|
+
|
8
|
+
id :usdf_v201_medication_knowledge_validation_test
|
9
|
+
title 'MedicationKnowledge resources returned during previous tests conform to the Formulary Drug profile'
|
10
|
+
description %(
|
11
|
+
This test verifies resources returned from the first search conform to
|
12
|
+
the [Formulary Drug profile](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug).
|
13
|
+
|
14
|
+
Systems must demonstrate at least one valid example in order to pass this test.
|
15
|
+
It verifies the presence of mandatory elements and that elements with
|
16
|
+
required bindings contain appropriate values. CodeableConcept element
|
17
|
+
bindings will fail if none of their codings have a code/system belonging
|
18
|
+
to the bound ValueSet. Quantity, Coding, and code element bindings will
|
19
|
+
fail if their code/system are not found in the valueset.
|
20
|
+
|
21
|
+
)
|
22
|
+
output :dar_code_found, :dar_extension_found
|
23
|
+
|
24
|
+
def resource_type
|
25
|
+
'MedicationKnowledge'
|
26
|
+
end
|
27
|
+
|
28
|
+
def scratch_resources
|
29
|
+
scratch[:medication_knowledge_resources] ||= {}
|
30
|
+
end
|
31
|
+
|
32
|
+
run do
|
33
|
+
perform_validation_test(scratch_resources[:all] || [],
|
34
|
+
'http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug',
|
35
|
+
'2.0.1')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/metadata.yml
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
---
|
2
|
+
:name: usdf_FormularyDrug
|
3
|
+
:class_name: UsdfFormularydrugSequence
|
4
|
+
:version: v2.0.1
|
5
|
+
:reformatted_version: v201
|
6
|
+
:resource: MedicationKnowledge
|
7
|
+
:profile_url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug
|
8
|
+
:profile_name: Formulary Drug
|
9
|
+
:profile_version: 2.0.1
|
10
|
+
:title: Formulary Drug
|
11
|
+
:short_description: Verify support for the server capabilities required by the Formulary
|
12
|
+
Drug.
|
13
|
+
:interactions:
|
14
|
+
- :code: create
|
15
|
+
:expectation: MAY
|
16
|
+
- :code: search-type
|
17
|
+
:expectation: SHALL
|
18
|
+
- :code: read
|
19
|
+
:expectation: SHALL
|
20
|
+
- :code: vread
|
21
|
+
:expectation: SHOULD
|
22
|
+
- :code: update
|
23
|
+
:expectation: MAY
|
24
|
+
- :code: patch
|
25
|
+
:expectation: MAY
|
26
|
+
- :code: delete
|
27
|
+
:expectation: MAY
|
28
|
+
- :code: history-instance
|
29
|
+
:expectation: SHOULD
|
30
|
+
- :code: history-type
|
31
|
+
:expectation: MAY
|
32
|
+
:searches:
|
33
|
+
- :names:
|
34
|
+
- status
|
35
|
+
:expectation: SHALL
|
36
|
+
:names_not_must_support_or_mandatory: []
|
37
|
+
:must_support_or_mandatory: true
|
38
|
+
- :names:
|
39
|
+
- _id
|
40
|
+
:expectation: SHALL
|
41
|
+
:names_not_must_support_or_mandatory: []
|
42
|
+
:must_support_or_mandatory: true
|
43
|
+
- :names:
|
44
|
+
- _lastUpdated
|
45
|
+
:expectation: SHALL
|
46
|
+
:names_not_must_support_or_mandatory: []
|
47
|
+
:must_support_or_mandatory: true
|
48
|
+
- :names:
|
49
|
+
- code
|
50
|
+
:expectation: SHALL
|
51
|
+
:names_not_must_support_or_mandatory: []
|
52
|
+
:must_support_or_mandatory: true
|
53
|
+
- :names:
|
54
|
+
- drug-name
|
55
|
+
:expectation: SHALL
|
56
|
+
:names_not_must_support_or_mandatory:
|
57
|
+
- drug-name
|
58
|
+
:must_support_or_mandatory: false
|
59
|
+
- :names:
|
60
|
+
- doseform
|
61
|
+
:expectation: SHOULD
|
62
|
+
:names_not_must_support_or_mandatory: []
|
63
|
+
:must_support_or_mandatory: true
|
64
|
+
:search_definitions:
|
65
|
+
:_id:
|
66
|
+
:paths:
|
67
|
+
- Resource.id
|
68
|
+
:full_paths:
|
69
|
+
- Resource.id
|
70
|
+
:comparators: {}
|
71
|
+
:values: []
|
72
|
+
:type: token
|
73
|
+
:contains_multiple: false
|
74
|
+
:_lastUpdated:
|
75
|
+
:paths:
|
76
|
+
- Resource.meta.lastUpdated
|
77
|
+
:full_paths:
|
78
|
+
- Resource.meta.lastUpdated
|
79
|
+
:comparators:
|
80
|
+
:eq: MAY
|
81
|
+
:ne: MAY
|
82
|
+
:gt: MAY
|
83
|
+
:ge: MAY
|
84
|
+
:lt: MAY
|
85
|
+
:le: MAY
|
86
|
+
:sa: MAY
|
87
|
+
:eb: MAY
|
88
|
+
:ap: MAY
|
89
|
+
:values: []
|
90
|
+
:type: date
|
91
|
+
:contains_multiple: false
|
92
|
+
:status:
|
93
|
+
:paths:
|
94
|
+
- status
|
95
|
+
:full_paths:
|
96
|
+
- MedicationKnowledge.status
|
97
|
+
:comparators: {}
|
98
|
+
:values:
|
99
|
+
- active
|
100
|
+
- inactive
|
101
|
+
- entered-in-error
|
102
|
+
:type: code
|
103
|
+
:contains_multiple: false
|
104
|
+
:multiple_or: true
|
105
|
+
:code:
|
106
|
+
:paths:
|
107
|
+
- code
|
108
|
+
:full_paths:
|
109
|
+
- MedicationKnowledge.code
|
110
|
+
:comparators: {}
|
111
|
+
:values: []
|
112
|
+
:type: CodeableConcept
|
113
|
+
:contains_multiple: false
|
114
|
+
:multiple_or: true
|
115
|
+
:drug-name:
|
116
|
+
:paths:
|
117
|
+
- code.coding.display
|
118
|
+
- synonym
|
119
|
+
:full_paths:
|
120
|
+
- 'MedicationKnowledge.code.coding.display '
|
121
|
+
- " synonym"
|
122
|
+
:comparators: {}
|
123
|
+
:values: []
|
124
|
+
:type: string
|
125
|
+
:contains_multiple: false
|
126
|
+
:multiple_or: true
|
127
|
+
:doseform:
|
128
|
+
:paths:
|
129
|
+
- doseForm
|
130
|
+
:full_paths:
|
131
|
+
- MedicationKnowledge.doseForm
|
132
|
+
:comparators: {}
|
133
|
+
:values: []
|
134
|
+
:type: CodeableConcept
|
135
|
+
:contains_multiple: false
|
136
|
+
:multiple_or: true
|
137
|
+
:include_params: []
|
138
|
+
:must_supports:
|
139
|
+
:extensions: []
|
140
|
+
:slices:
|
141
|
+
- :slice_id: MedicationKnowledge.code.coding:semantic-drug
|
142
|
+
:slice_name: semantic-drug
|
143
|
+
:path: code.coding
|
144
|
+
:discriminator:
|
145
|
+
:type: value
|
146
|
+
:values:
|
147
|
+
- :path: code.coding
|
148
|
+
:value: http://hl7.org/fhir/us/davinci-drug-formulary/ValueSet/SemanticDrugVS
|
149
|
+
- :slice_id: MedicationKnowledge.code.coding:semantic-drug-form-group
|
150
|
+
:slice_name: semantic-drug-form-group
|
151
|
+
:path: code.coding
|
152
|
+
:discriminator:
|
153
|
+
:type: value
|
154
|
+
:values:
|
155
|
+
- :path: code.coding
|
156
|
+
:value: http://hl7.org/fhir/us/davinci-drug-formulary/ValueSet/SemanticDrugFormGroupVS
|
157
|
+
:elements:
|
158
|
+
- :path: meta.lastUpdated
|
159
|
+
- :path: code
|
160
|
+
- :path: code.coding
|
161
|
+
- :path: code.coding:semantic-drug.system
|
162
|
+
- :path: code.coding:semantic-drug.code
|
163
|
+
- :path: code.coding:semantic-drug-form-group.system
|
164
|
+
- :path: code.coding:semantic-drug-form-group.code
|
165
|
+
- :path: status
|
166
|
+
- :path: doseForm
|
167
|
+
:references: []
|
168
|
+
:mandatory_elements:
|
169
|
+
- MedicationKnowledge.code
|
170
|
+
- MedicationKnowledge.code.coding
|
171
|
+
- MedicationKnowledge.code.coding.system
|
172
|
+
- MedicationKnowledge.code.coding.code
|
173
|
+
- MedicationKnowledge.status
|
174
|
+
:references:
|
175
|
+
- :path: MedicationKnowledge.manufacturer
|
176
|
+
:profiles:
|
177
|
+
- http://hl7.org/fhir/StructureDefinition/Organization
|
178
|
+
- :path: MedicationKnowledge.relatedMedicationKnowledge.reference
|
179
|
+
:profiles:
|
180
|
+
- http://hl7.org/fhir/StructureDefinition/MedicationKnowledge
|
181
|
+
- :path: MedicationKnowledge.associatedMedication
|
182
|
+
:profiles:
|
183
|
+
- http://hl7.org/fhir/StructureDefinition/Medication
|
184
|
+
- :path: MedicationKnowledge.monograph.source
|
185
|
+
:profiles:
|
186
|
+
- http://hl7.org/fhir/StructureDefinition/DocumentReference
|
187
|
+
- http://hl7.org/fhir/StructureDefinition/Media
|
188
|
+
- :path: MedicationKnowledge.contraindication
|
189
|
+
:profiles:
|
190
|
+
- http://hl7.org/fhir/StructureDefinition/DetectedIssue
|
191
|
+
- :path: MedicationKnowledge.regulatory.regulatoryAuthority
|
192
|
+
:profiles:
|
193
|
+
- http://hl7.org/fhir/StructureDefinition/Organization
|
194
|
+
:tests:
|
195
|
+
- :id: usdf_v201_medication_knowledge_status_search_test
|
196
|
+
:file_name: medication_knowledge_status_search_test.rb
|
197
|
+
- :id: usdf_v201_medication_knowledge__id_search_test
|
198
|
+
:file_name: medication_knowledge_id_search_test.rb
|
199
|
+
- :id: usdf_v201_medication_knowledge__lastUpdated_search_test
|
200
|
+
:file_name: medication_knowledge_lastupdated_search_test.rb
|
201
|
+
- :id: usdf_v201_medication_knowledge_code_search_test
|
202
|
+
:file_name: medication_knowledge_code_search_test.rb
|
203
|
+
- :id: usdf_v201_medication_knowledge_drug_name_search_test
|
204
|
+
:file_name: medication_knowledge_drug_name_search_test.rb
|
205
|
+
- :id: usdf_v201_medication_knowledge_doseform_search_test
|
206
|
+
:file_name: medication_knowledge_doseform_search_test.rb
|
207
|
+
- :id: usdf_v201_medication_knowledge_read_test
|
208
|
+
:file_name: medication_knowledge_read_test.rb
|
209
|
+
- :id: usdf_v201_medication_knowledge_validation_test
|
210
|
+
:file_name: medication_knowledge_validation_test.rb
|
211
|
+
- :id: usdf_v201_medication_knowledge_must_support_test
|
212
|
+
:file_name: medication_knowledge_must_support_test.rb
|
213
|
+
:id: usdf_v201_medication_knowledge
|
214
|
+
:file_name: medication_knowledge_group.rb
|