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,104 @@
|
|
1
|
+
require_relative 'formulary/formulary_status_search_test'
|
2
|
+
require_relative 'formulary/formulary_id_search_test'
|
3
|
+
require_relative 'formulary/formulary_lastupdated_search_test'
|
4
|
+
require_relative 'formulary/formulary_identifier_search_test'
|
5
|
+
require_relative 'formulary/formulary_period_search_test'
|
6
|
+
require_relative 'formulary/formulary_type_search_test'
|
7
|
+
require_relative 'formulary/formulary_name_search_test'
|
8
|
+
require_relative 'formulary/formulary_coverage_type_search_test'
|
9
|
+
require_relative 'formulary/formulary_formulary_coverage_search_test'
|
10
|
+
require_relative 'formulary/formulary_coverage_area_search_test'
|
11
|
+
require_relative 'formulary/formulary_read_test'
|
12
|
+
require_relative 'formulary/formulary_validation_test'
|
13
|
+
require_relative 'formulary/formulary_must_support_test'
|
14
|
+
|
15
|
+
module DaVinciUSDrugFormularyTestKit
|
16
|
+
module USDFV201
|
17
|
+
class FormularyGroup < Inferno::TestGroup
|
18
|
+
title 'Formulary Tests'
|
19
|
+
short_description 'Verify support for the server capabilities required by the Formulary.'
|
20
|
+
description %(
|
21
|
+
# Background
|
22
|
+
|
23
|
+
The USDF Formulary sequence verifies that the system under test is
|
24
|
+
able to provide correct responses for InsurancePlan queries. These queries
|
25
|
+
must contain resources conforming to the Formulary as
|
26
|
+
specified in the USDF v2.0.1 Implementation Guide.
|
27
|
+
|
28
|
+
# Testing Methodology
|
29
|
+
## Searching
|
30
|
+
This test sequence will first perform each required search associated
|
31
|
+
with this resource. This sequence will perform searches with the
|
32
|
+
following parameters:
|
33
|
+
|
34
|
+
* status
|
35
|
+
* _id
|
36
|
+
* _lastUpdated
|
37
|
+
* identifier
|
38
|
+
* period
|
39
|
+
* type
|
40
|
+
* name
|
41
|
+
* coverage-type
|
42
|
+
* formulary-coverage
|
43
|
+
* coverage-area
|
44
|
+
|
45
|
+
### Search Parameters
|
46
|
+
The first search uses the selected resources from the prior launch
|
47
|
+
sequence. Any subsequent searches will look for its parameter values
|
48
|
+
from the results of the first search. If a value cannot be found this way, the search is skipped.
|
49
|
+
|
50
|
+
### Search Validation
|
51
|
+
Inferno will retrieve up to the first 20 bundle pages of the reply for
|
52
|
+
InsurancePlan resources and save them for subsequent tests. Each of
|
53
|
+
these resources is then checked to see if it matches the searched
|
54
|
+
parameters in accordance with [FHIR search
|
55
|
+
guidelines](https://www.hl7.org/fhir/search.html).
|
56
|
+
|
57
|
+
|
58
|
+
## Must Support
|
59
|
+
Each profile contains elements marked as "must support". This test
|
60
|
+
sequence expects to see each of these elements at least once. If at
|
61
|
+
least one cannot be found, the test will fail. The test will look
|
62
|
+
through the InsurancePlan resources found in the first test for these
|
63
|
+
elements.
|
64
|
+
|
65
|
+
## Profile Validation
|
66
|
+
Each resource returned from the first search is expected to conform to
|
67
|
+
the [Formulary](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-Formulary). Each element is checked against
|
68
|
+
teminology binding and cardinality requirements.
|
69
|
+
|
70
|
+
Elements with a required binding are validated against their bound
|
71
|
+
ValueSet. If the code/system in the element is not part of the ValueSet,
|
72
|
+
then the test will fail.
|
73
|
+
|
74
|
+
## Reference Validation
|
75
|
+
At least one instance of each external reference in elements marked as
|
76
|
+
"must support" within the resources provided by the system must resolve.
|
77
|
+
The test will attempt to read each reference found and will fail if no
|
78
|
+
read succeeds.
|
79
|
+
|
80
|
+
)
|
81
|
+
|
82
|
+
id :usdf_v201_formulary
|
83
|
+
run_as_group
|
84
|
+
|
85
|
+
def self.metadata
|
86
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'formulary', 'metadata.yml'), aliases: true))
|
87
|
+
end
|
88
|
+
|
89
|
+
test from: :usdf_v201_formulary_status_search_test
|
90
|
+
test from: :usdf_v201_formulary__id_search_test
|
91
|
+
test from: :usdf_v201_formulary__lastUpdated_search_test
|
92
|
+
test from: :usdf_v201_formulary_identifier_search_test
|
93
|
+
test from: :usdf_v201_formulary_period_search_test
|
94
|
+
test from: :usdf_v201_formulary_type_search_test
|
95
|
+
test from: :usdf_v201_formulary_name_search_test
|
96
|
+
test from: :usdf_v201_formulary_coverage_type_search_test
|
97
|
+
test from: :usdf_v201_formulary_formulary_coverage_search_test
|
98
|
+
test from: :usdf_v201_formulary_coverage_area_search_test
|
99
|
+
test from: :usdf_v201_formulary_read_test
|
100
|
+
test from: :usdf_v201_formulary_validation_test
|
101
|
+
test from: :usdf_v201_formulary_must_support_test
|
102
|
+
end
|
103
|
+
end
|
104
|
+
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 LocationAddressCitySearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Location search by address-city'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
address-city on the Location 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_location_address_city_search_test
|
21
|
+
optional
|
22
|
+
|
23
|
+
|
24
|
+
def self.properties
|
25
|
+
@properties ||= SearchTestProperties.new(
|
26
|
+
resource_type: 'Location',
|
27
|
+
search_param_names: ['address-city']
|
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[:location_resources] ||= {}
|
37
|
+
end
|
38
|
+
|
39
|
+
run do
|
40
|
+
run_search_test
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
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 LocationAddressPostalcodeSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Location search by address-postalcode'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
address-postalcode on the Location 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_location_address_postalcode_search_test
|
21
|
+
optional
|
22
|
+
|
23
|
+
|
24
|
+
def self.properties
|
25
|
+
@properties ||= SearchTestProperties.new(
|
26
|
+
resource_type: 'Location',
|
27
|
+
search_param_names: ['address-postalcode']
|
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[:location_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 LocationAddressSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Location search by address'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
address on the Location 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_location_address_search_test
|
21
|
+
|
22
|
+
def self.properties
|
23
|
+
@properties ||= SearchTestProperties.new(
|
24
|
+
resource_type: 'Location',
|
25
|
+
search_param_names: ['address']
|
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[:location_resources] ||= {}
|
35
|
+
end
|
36
|
+
|
37
|
+
run do
|
38
|
+
run_search_test
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
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 LocationAddressStateSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Location search by address-state'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
address-state on the Location 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_location_address_state_search_test
|
21
|
+
optional
|
22
|
+
|
23
|
+
|
24
|
+
def self.properties
|
25
|
+
@properties ||= SearchTestProperties.new(
|
26
|
+
resource_type: 'Location',
|
27
|
+
search_param_names: ['address-state']
|
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[:location_resources] ||= {}
|
37
|
+
end
|
38
|
+
|
39
|
+
run do
|
40
|
+
run_search_test
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_id_search_test.rb
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
require_relative '../../../search_test'
|
2
|
+
require_relative '../../../generator/group_metadata'
|
3
|
+
|
4
|
+
module DaVinciUSDrugFormularyTestKit
|
5
|
+
module DaVinciUSDrugFormularyV201
|
6
|
+
class LocationIdSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Location search by _id'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
_id on the Location 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_location__id_search_test
|
29
|
+
|
30
|
+
input :input_ids,
|
31
|
+
title: 'Location IDs',
|
32
|
+
description: 'Comma separated list of Location IDs that in sum contain all MUST SUPPORT elements'
|
33
|
+
|
34
|
+
def self.properties
|
35
|
+
@properties ||= SearchTestProperties.new(
|
36
|
+
first_search: true,
|
37
|
+
resource_type: 'Location',
|
38
|
+
search_param_names: ['_id'],
|
39
|
+
test_post_search: true
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.metadata
|
44
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
45
|
+
end
|
46
|
+
|
47
|
+
def scratch_resources
|
48
|
+
scratch[:location_resources] ||= {}
|
49
|
+
end
|
50
|
+
|
51
|
+
run do
|
52
|
+
run_search_test
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
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 LocationLastupdatedSearchTest < Inferno::Test
|
7
|
+
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
|
+
|
9
|
+
title 'Server returns valid results for Location search by _lastUpdated'
|
10
|
+
description %(
|
11
|
+
A server SHALL support searching by
|
12
|
+
_lastUpdated on the Location 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_location__lastUpdated_search_test
|
21
|
+
optional
|
22
|
+
|
23
|
+
|
24
|
+
def self.properties
|
25
|
+
@properties ||= SearchTestProperties.new(
|
26
|
+
resource_type: 'Location',
|
27
|
+
search_param_names: ['_lastUpdated']
|
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[:location_resources] ||= {}
|
37
|
+
end
|
38
|
+
|
39
|
+
run do
|
40
|
+
run_search_test
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_must_support_test.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require_relative '../../../must_support_test'
|
2
|
+
|
3
|
+
module DaVinciUSDrugFormularyTestKit
|
4
|
+
module DaVinciUSDrugFormularyV201
|
5
|
+
class LocationMustSupportTest < Inferno::Test
|
6
|
+
include DaVinciUSDrugFormularyTestKit::MustSupportTest
|
7
|
+
|
8
|
+
title 'All must support elements are provided in the Location 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 Location resources
|
13
|
+
found previously for the following must support elements:
|
14
|
+
|
15
|
+
* Location.address or Location.extension:region
|
16
|
+
)
|
17
|
+
|
18
|
+
id :usdf_v201_location_must_support_test
|
19
|
+
|
20
|
+
def resource_type
|
21
|
+
'Location'
|
22
|
+
end
|
23
|
+
|
24
|
+
def self.metadata
|
25
|
+
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
26
|
+
end
|
27
|
+
|
28
|
+
def scratch_resources
|
29
|
+
scratch[:location_resources] ||= {}
|
30
|
+
end
|
31
|
+
|
32
|
+
run do
|
33
|
+
perform_must_support_test(all_scratch_resources)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require_relative '../../../read_test'
|
2
|
+
|
3
|
+
module DaVinciUSDrugFormularyTestKit
|
4
|
+
module USDFV201
|
5
|
+
class LocationReadTest < Inferno::Test
|
6
|
+
include DaVinciUSDrugFormularyTestKit::ReadTest
|
7
|
+
|
8
|
+
title 'Server returns correct Location resource from Location read interaction'
|
9
|
+
description 'A server SHALL support the Location read interaction.'
|
10
|
+
|
11
|
+
id :usdf_v201_location_read_test
|
12
|
+
|
13
|
+
def resource_type
|
14
|
+
'Location'
|
15
|
+
end
|
16
|
+
|
17
|
+
def scratch_resources
|
18
|
+
scratch[:location_resources] ||= {}
|
19
|
+
end
|
20
|
+
|
21
|
+
run do
|
22
|
+
perform_read_test(all_scratch_resources)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_validation_test.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative '../../../validation_test'
|
2
|
+
|
3
|
+
module DaVinciUSDrugFormularyTestKit
|
4
|
+
module DaVinciUSDrugFormularyV201
|
5
|
+
class LocationValidationTest < Inferno::Test
|
6
|
+
include DaVinciUSDrugFormularyTestKit::ValidationTest
|
7
|
+
|
8
|
+
id :usdf_v201_location_validation_test
|
9
|
+
title 'Location resources returned during previous tests conform to the Insurance Plan Location profile'
|
10
|
+
description %(
|
11
|
+
This test verifies resources returned from the first search conform to
|
12
|
+
the [Insurance Plan Location profile](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-InsurancePlanLocation).
|
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
|
+
'Location'
|
26
|
+
end
|
27
|
+
|
28
|
+
def scratch_resources
|
29
|
+
scratch[:location_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-InsurancePlanLocation',
|
35
|
+
'2.0.1')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,177 @@
|
|
1
|
+
---
|
2
|
+
:name: usdf_InsurancePlanLocation
|
3
|
+
:class_name: UsdfInsuranceplanlocationSequence
|
4
|
+
:version: v2.0.1
|
5
|
+
:reformatted_version: v201
|
6
|
+
:resource: Location
|
7
|
+
:profile_url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-InsurancePlanLocation
|
8
|
+
:profile_name: Insurance Plan Location
|
9
|
+
:profile_version: 2.0.1
|
10
|
+
:title: Insurance Plan Location
|
11
|
+
:short_description: Verify support for the server capabilities required by the Insurance
|
12
|
+
Plan Location.
|
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
|
+
- _id
|
35
|
+
:expectation: SHALL
|
36
|
+
:names_not_must_support_or_mandatory: []
|
37
|
+
:must_support_or_mandatory: true
|
38
|
+
- :names:
|
39
|
+
- _lastUpdated
|
40
|
+
:expectation: SHALL
|
41
|
+
:names_not_must_support_or_mandatory:
|
42
|
+
- _lastUpdated
|
43
|
+
:must_support_or_mandatory: false
|
44
|
+
- :names:
|
45
|
+
- address
|
46
|
+
:expectation: SHALL
|
47
|
+
:names_not_must_support_or_mandatory: []
|
48
|
+
:must_support_or_mandatory: true
|
49
|
+
- :names:
|
50
|
+
- address-city
|
51
|
+
:expectation: SHALL
|
52
|
+
:names_not_must_support_or_mandatory:
|
53
|
+
- address-city
|
54
|
+
:must_support_or_mandatory: false
|
55
|
+
- :names:
|
56
|
+
- address-state
|
57
|
+
:expectation: SHALL
|
58
|
+
:names_not_must_support_or_mandatory:
|
59
|
+
- address-state
|
60
|
+
:must_support_or_mandatory: false
|
61
|
+
- :names:
|
62
|
+
- address-postalcode
|
63
|
+
:expectation: SHALL
|
64
|
+
:names_not_must_support_or_mandatory:
|
65
|
+
- address-postalcode
|
66
|
+
:must_support_or_mandatory: false
|
67
|
+
:search_definitions:
|
68
|
+
:_id:
|
69
|
+
:paths:
|
70
|
+
- Resource.id
|
71
|
+
:full_paths:
|
72
|
+
- Resource.id
|
73
|
+
:comparators: {}
|
74
|
+
:values: []
|
75
|
+
:type: token
|
76
|
+
:contains_multiple: false
|
77
|
+
:_lastUpdated:
|
78
|
+
:paths:
|
79
|
+
- Resource.meta.lastUpdated
|
80
|
+
:full_paths:
|
81
|
+
- Resource.meta.lastUpdated
|
82
|
+
:comparators:
|
83
|
+
:eq: MAY
|
84
|
+
:ne: MAY
|
85
|
+
:gt: MAY
|
86
|
+
:ge: MAY
|
87
|
+
:lt: MAY
|
88
|
+
:le: MAY
|
89
|
+
:sa: MAY
|
90
|
+
:eb: MAY
|
91
|
+
:ap: MAY
|
92
|
+
:values: []
|
93
|
+
:type: date
|
94
|
+
:contains_multiple: false
|
95
|
+
:address:
|
96
|
+
:paths:
|
97
|
+
- address
|
98
|
+
:full_paths:
|
99
|
+
- Location.address
|
100
|
+
:comparators: {}
|
101
|
+
:values: []
|
102
|
+
:type: Address
|
103
|
+
:contains_multiple: false
|
104
|
+
:address-city:
|
105
|
+
:paths:
|
106
|
+
- address.city
|
107
|
+
:full_paths:
|
108
|
+
- Location.address.city
|
109
|
+
:comparators: {}
|
110
|
+
:values: []
|
111
|
+
:type: string
|
112
|
+
:contains_multiple: false
|
113
|
+
:address-state:
|
114
|
+
:paths:
|
115
|
+
- address.state
|
116
|
+
:full_paths:
|
117
|
+
- Location.address.state
|
118
|
+
:comparators: {}
|
119
|
+
:values: []
|
120
|
+
:type: string
|
121
|
+
:contains_multiple: false
|
122
|
+
:address-postalcode:
|
123
|
+
:paths:
|
124
|
+
- address.postalCode
|
125
|
+
:full_paths:
|
126
|
+
- Location.address.postalCode
|
127
|
+
:comparators: {}
|
128
|
+
:values: []
|
129
|
+
:type: string
|
130
|
+
:contains_multiple: false
|
131
|
+
:include_params: []
|
132
|
+
:must_supports:
|
133
|
+
:extensions:
|
134
|
+
- :id: Location.extension:region
|
135
|
+
:url: http://hl7.org/fhir/StructureDefinition/location-boundary-geojson
|
136
|
+
:path: extension
|
137
|
+
:slices: []
|
138
|
+
:elements:
|
139
|
+
- :path: address
|
140
|
+
:references: []
|
141
|
+
:choices:
|
142
|
+
- :paths:
|
143
|
+
- address
|
144
|
+
:extension_ids:
|
145
|
+
- Location.extension:region
|
146
|
+
:mandatory_elements: []
|
147
|
+
:references:
|
148
|
+
- :path: Location.managingOrganization
|
149
|
+
:profiles:
|
150
|
+
- http://hl7.org/fhir/StructureDefinition/Organization
|
151
|
+
- :path: Location.partOf
|
152
|
+
:profiles:
|
153
|
+
- http://hl7.org/fhir/StructureDefinition/Location
|
154
|
+
- :path: Location.endpoint
|
155
|
+
:profiles:
|
156
|
+
- http://hl7.org/fhir/StructureDefinition/Endpoint
|
157
|
+
:tests:
|
158
|
+
- :id: usdf_v201_location__id_search_test
|
159
|
+
:file_name: location_id_search_test.rb
|
160
|
+
- :id: usdf_v201_location__lastUpdated_search_test
|
161
|
+
:file_name: location_lastupdated_search_test.rb
|
162
|
+
- :id: usdf_v201_location_address_search_test
|
163
|
+
:file_name: location_address_search_test.rb
|
164
|
+
- :id: usdf_v201_location_address_city_search_test
|
165
|
+
:file_name: location_address_city_search_test.rb
|
166
|
+
- :id: usdf_v201_location_address_state_search_test
|
167
|
+
:file_name: location_address_state_search_test.rb
|
168
|
+
- :id: usdf_v201_location_address_postalcode_search_test
|
169
|
+
:file_name: location_address_postalcode_search_test.rb
|
170
|
+
- :id: usdf_v201_location_read_test
|
171
|
+
:file_name: location_read_test.rb
|
172
|
+
- :id: usdf_v201_location_validation_test
|
173
|
+
:file_name: location_validation_test.rb
|
174
|
+
- :id: usdf_v201_location_must_support_test
|
175
|
+
:file_name: location_must_support_test.rb
|
176
|
+
:id: usdf_v201_location
|
177
|
+
:file_name: location_group.rb
|