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.
Files changed (116) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/conformance_support_test.rb +41 -0
  4. data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/fhir_version_test.rb +15 -0
  5. data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/instantiate_test.rb +19 -0
  6. data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/json_support_test.rb +40 -0
  7. data/lib/davinci_us_drug_formulary_test_kit/custom_groups/capability_statement/profile_support_test.rb +39 -0
  8. data/lib/davinci_us_drug_formulary_test_kit/custom_groups/v2.0.1/capability_statement_group.rb +78 -0
  9. data/lib/davinci_us_drug_formulary_test_kit/date_search_validation.rb +121 -0
  10. data/lib/davinci_us_drug_formulary_test_kit/fhir_resource_navigation.rb +155 -0
  11. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_code_search_test.rb +54 -0
  12. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_drug_tier_search_test.rb +43 -0
  13. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_formulary_include_search_test.rb +40 -0
  14. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_formulary_search_test.rb +43 -0
  15. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_id_search_test.rb +42 -0
  16. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_lastupdated_search_test.rb +42 -0
  17. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_must_support_test.rb +46 -0
  18. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_period_search_test.rb +42 -0
  19. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_pharmacy_benefit_type_search_test.rb +43 -0
  20. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_read_test.rb +26 -0
  21. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_reference_resolution_test.rb +40 -0
  22. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_status_search_test.rb +42 -0
  23. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_subject_include_search_test.rb +40 -0
  24. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_subject_search_test.rb +43 -0
  25. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_validation_test.rb +39 -0
  26. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/metadata.yml +292 -0
  27. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic_group.rb +107 -0
  28. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_coverage_area_search_test.rb +45 -0
  29. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_coverage_type_search_test.rb +45 -0
  30. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_formulary_coverage_search_test.rb +45 -0
  31. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_id_search_test.rb +42 -0
  32. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_identifier_search_test.rb +43 -0
  33. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_lastupdated_search_test.rb +42 -0
  34. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_must_support_test.rb +42 -0
  35. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_name_search_test.rb +42 -0
  36. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_period_search_test.rb +42 -0
  37. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_read_test.rb +26 -0
  38. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_status_search_test.rb +53 -0
  39. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_type_search_test.rb +43 -0
  40. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/formulary_validation_test.rb +39 -0
  41. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/metadata.yml +278 -0
  42. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary_group.rb +104 -0
  43. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_city_search_test.rb +44 -0
  44. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_postalcode_search_test.rb +44 -0
  45. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_search_test.rb +42 -0
  46. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_address_state_search_test.rb +44 -0
  47. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_id_search_test.rb +56 -0
  48. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_lastupdated_search_test.rb +44 -0
  49. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_must_support_test.rb +37 -0
  50. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_read_test.rb +26 -0
  51. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/location_validation_test.rb +39 -0
  52. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location/metadata.yml +177 -0
  53. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/location_group.rb +92 -0
  54. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_code_search_test.rb +43 -0
  55. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_doseform_search_test.rb +45 -0
  56. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_drug_name_search_test.rb +44 -0
  57. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_id_search_test.rb +42 -0
  58. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_lastupdated_search_test.rb +42 -0
  59. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_must_support_test.rb +47 -0
  60. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_read_test.rb +26 -0
  61. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_status_search_test.rb +53 -0
  62. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/medication_knowledge_validation_test.rb +39 -0
  63. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge/metadata.yml +214 -0
  64. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/medication_knowledge_group.rb +91 -0
  65. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/metadata.yml +1192 -0
  66. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/metadata.yml +371 -0
  67. 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
  68. 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
  69. 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
  70. 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
  71. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_id_search_test.rb +42 -0
  72. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_identifier_search_test.rb +43 -0
  73. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_lastupdated_search_test.rb +42 -0
  74. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_must_support_test.rb +66 -0
  75. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_name_search_test.rb +42 -0
  76. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_period_search_test.rb +42 -0
  77. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_read_test.rb +26 -0
  78. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_reference_resolution_test.rb +40 -0
  79. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_status_search_test.rb +53 -0
  80. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_type_search_test.rb +43 -0
  81. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_validation_test.rb +39 -0
  82. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan_group.rb +108 -0
  83. data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/usdf_test_suite.rb +114 -0
  84. data/lib/davinci_us_drug_formulary_test_kit/generator/group_generator.rb +181 -0
  85. data/lib/davinci_us_drug_formulary_test_kit/generator/group_metadata.rb +79 -0
  86. data/lib/davinci_us_drug_formulary_test_kit/generator/group_metadata_extractor.rb +329 -0
  87. data/lib/davinci_us_drug_formulary_test_kit/generator/ig_loader.rb +77 -0
  88. data/lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata.rb +33 -0
  89. data/lib/davinci_us_drug_formulary_test_kit/generator/ig_metadata_extractor.rb +40 -0
  90. data/lib/davinci_us_drug_formulary_test_kit/generator/ig_resources.rb +60 -0
  91. data/lib/davinci_us_drug_formulary_test_kit/generator/include_search_test_generator.rb +68 -0
  92. data/lib/davinci_us_drug_formulary_test_kit/generator/must_support_metadata_extractor.rb +384 -0
  93. data/lib/davinci_us_drug_formulary_test_kit/generator/must_support_test_generator.rb +117 -0
  94. data/lib/davinci_us_drug_formulary_test_kit/generator/naming.rb +28 -0
  95. data/lib/davinci_us_drug_formulary_test_kit/generator/read_test_generator.rb +92 -0
  96. data/lib/davinci_us_drug_formulary_test_kit/generator/reference_resolution_test_generator.rb +91 -0
  97. data/lib/davinci_us_drug_formulary_test_kit/generator/search_definition_metadata_extractor.rb +187 -0
  98. data/lib/davinci_us_drug_formulary_test_kit/generator/search_metadata_extractor.rb +59 -0
  99. data/lib/davinci_us_drug_formulary_test_kit/generator/search_test_generator.rb +270 -0
  100. data/lib/davinci_us_drug_formulary_test_kit/generator/suite_generator.rb +94 -0
  101. data/lib/davinci_us_drug_formulary_test_kit/generator/terminology_binding_metadata_extractor.rb +116 -0
  102. data/lib/davinci_us_drug_formulary_test_kit/generator/validation_test_generator.rb +102 -0
  103. data/lib/davinci_us_drug_formulary_test_kit/generator/value_extractor.rb +113 -0
  104. data/lib/davinci_us_drug_formulary_test_kit/generator.rb +94 -0
  105. data/lib/davinci_us_drug_formulary_test_kit/igs/package/r4_search-parameters.json +65408 -0
  106. data/lib/davinci_us_drug_formulary_test_kit/igs/package.tgz +0 -0
  107. data/lib/davinci_us_drug_formulary_test_kit/must_support_test.rb +224 -0
  108. data/lib/davinci_us_drug_formulary_test_kit/read_test.rb +62 -0
  109. data/lib/davinci_us_drug_formulary_test_kit/reference_resolution_test.rb +174 -0
  110. data/lib/davinci_us_drug_formulary_test_kit/request_logger.rb +46 -0
  111. data/lib/davinci_us_drug_formulary_test_kit/search_test.rb +767 -0
  112. data/lib/davinci_us_drug_formulary_test_kit/search_test_properties.rb +58 -0
  113. data/lib/davinci_us_drug_formulary_test_kit/validation_test.rb +56 -0
  114. data/lib/davinci_us_drug_formulary_test_kit/version.rb +5 -0
  115. data/lib/davinci_us_drug_formulary_test_kit.rb +1 -0
  116. metadata +245 -0
@@ -0,0 +1,42 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module DaVinciUSDrugFormularyTestKit
5
+ module DaVinciUSDrugFormularyV201
6
+ class FormularyIdSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by _id'
10
+ description %(
11
+ A server SHALL support searching by
12
+ _id on the InsurancePlan 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_formulary__id_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'InsurancePlan',
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[:formulary_resources] ||= {}
35
+ end
36
+
37
+ run do
38
+ run_search_test
39
+ end
40
+ end
41
+ end
42
+ 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 FormularyIdentifierSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by identifier'
10
+ description %(
11
+ A server SHALL support searching by
12
+ identifier on the InsurancePlan 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_formulary_identifier_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'InsurancePlan',
25
+ search_param_names: ['identifier'],
26
+ token_search_params: ['identifier']
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[:formulary_resources] ||= {}
36
+ end
37
+
38
+ run do
39
+ run_search_test
40
+ end
41
+ end
42
+ end
43
+ 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 FormularyLastupdatedSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by _lastUpdated'
10
+ description %(
11
+ A server SHALL support searching by
12
+ _lastUpdated on the InsurancePlan 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_formulary__lastUpdated_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'InsurancePlan',
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[:formulary_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 '../../../must_support_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module DaVinciUSDrugFormularyV201
5
+ class FormularyMustSupportTest < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::MustSupportTest
7
+
8
+ title 'All must support elements are provided in the InsurancePlan 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 InsurancePlan resources
13
+ found previously for the following must support elements:
14
+
15
+ * InsurancePlan.identifier
16
+ * InsurancePlan.meta.lastUpdated
17
+ * InsurancePlan.name
18
+ * InsurancePlan.period
19
+ * InsurancePlan.status
20
+ * InsurancePlan.type.coding.code
21
+ )
22
+
23
+ id :usdf_v201_formulary_must_support_test
24
+
25
+ def resource_type
26
+ 'InsurancePlan'
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[:formulary_resources] ||= {}
35
+ end
36
+
37
+ run do
38
+ perform_must_support_test(all_scratch_resources)
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 FormularyNameSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by name'
10
+ description %(
11
+ A server SHALL support searching by
12
+ name on the InsurancePlan 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_formulary_name_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'InsurancePlan',
25
+ search_param_names: ['name']
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[:formulary_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 FormularyPeriodSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by period'
10
+ description %(
11
+ A server SHALL support searching by
12
+ period on the InsurancePlan 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_formulary_period_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'InsurancePlan',
25
+ search_param_names: ['period']
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[:formulary_resources] ||= {}
35
+ end
36
+
37
+ run do
38
+ run_search_test
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,26 @@
1
+ require_relative '../../../read_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module USDFV201
5
+ class FormularyReadTest < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::ReadTest
7
+
8
+ title 'Server returns correct InsurancePlan resource from InsurancePlan read interaction'
9
+ description 'A server SHALL support the InsurancePlan read interaction.'
10
+
11
+ id :usdf_v201_formulary_read_test
12
+
13
+ def resource_type
14
+ 'InsurancePlan'
15
+ end
16
+
17
+ def scratch_resources
18
+ scratch[:formulary_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 FormularyStatusSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by status'
10
+ description %(
11
+ A server SHALL support searching by
12
+ status on the InsurancePlan 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_formulary_status_search_test
29
+
30
+ def self.properties
31
+ @properties ||= SearchTestProperties.new(
32
+ first_search: true,
33
+ fixed_value_search: true,
34
+ resource_type: 'InsurancePlan',
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[:formulary_resources] ||= {}
46
+ end
47
+
48
+ run do
49
+ run_search_test
50
+ end
51
+ end
52
+ end
53
+ 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 FormularyTypeSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by type'
10
+ description %(
11
+ A server SHALL support searching by
12
+ type on the InsurancePlan 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_formulary_type_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'InsurancePlan',
25
+ search_param_names: ['type'],
26
+ token_search_params: ['type']
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[:formulary_resources] ||= {}
36
+ end
37
+
38
+ run do
39
+ run_search_test
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,39 @@
1
+ require_relative '../../../validation_test'
2
+
3
+ module DaVinciUSDrugFormularyTestKit
4
+ module DaVinciUSDrugFormularyV201
5
+ class FormularyValidationTest < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::ValidationTest
7
+
8
+ id :usdf_v201_formulary_validation_test
9
+ title 'InsurancePlan resources returned during previous tests conform to the Formulary profile'
10
+ description %(
11
+ This test verifies resources returned from the first search conform to
12
+ the [Formulary profile](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-Formulary).
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
+ 'InsurancePlan'
26
+ end
27
+
28
+ def scratch_resources
29
+ scratch[:formulary_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-Formulary',
35
+ '2.0.1')
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,278 @@
1
+ ---
2
+ :name: usdf_Formulary
3
+ :class_name: UsdfFormularySequence
4
+ :version: v2.0.1
5
+ :reformatted_version: v201
6
+ :resource: InsurancePlan
7
+ :profile_url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-Formulary
8
+ :profile_name: Formulary
9
+ :profile_version: 2.0.1
10
+ :title: Formulary
11
+ :short_description: Verify support for the server capabilities required by the Formulary.
12
+ :interactions:
13
+ - :code: create
14
+ :expectation: MAY
15
+ - :code: search-type
16
+ :expectation: SHALL
17
+ - :code: read
18
+ :expectation: SHALL
19
+ - :code: vread
20
+ :expectation: SHOULD
21
+ - :code: update
22
+ :expectation: MAY
23
+ - :code: patch
24
+ :expectation: MAY
25
+ - :code: delete
26
+ :expectation: MAY
27
+ - :code: history-instance
28
+ :expectation: SHOULD
29
+ - :code: history-type
30
+ :expectation: MAY
31
+ :searches:
32
+ - :names:
33
+ - status
34
+ :expectation: SHALL
35
+ :names_not_must_support_or_mandatory: []
36
+ :must_support_or_mandatory: true
37
+ - :names:
38
+ - _id
39
+ :expectation: SHALL
40
+ :names_not_must_support_or_mandatory: []
41
+ :must_support_or_mandatory: true
42
+ - :names:
43
+ - _lastUpdated
44
+ :expectation: SHALL
45
+ :names_not_must_support_or_mandatory: []
46
+ :must_support_or_mandatory: true
47
+ - :names:
48
+ - identifier
49
+ :expectation: SHALL
50
+ :names_not_must_support_or_mandatory: []
51
+ :must_support_or_mandatory: true
52
+ - :names:
53
+ - period
54
+ :expectation: SHALL
55
+ :names_not_must_support_or_mandatory: []
56
+ :must_support_or_mandatory: true
57
+ - :names:
58
+ - type
59
+ :expectation: SHALL
60
+ :names_not_must_support_or_mandatory: []
61
+ :must_support_or_mandatory: true
62
+ - :names:
63
+ - name
64
+ :expectation: SHALL
65
+ :names_not_must_support_or_mandatory: []
66
+ :must_support_or_mandatory: true
67
+ - :names:
68
+ - coverage-type
69
+ :expectation: SHALL
70
+ :names_not_must_support_or_mandatory:
71
+ - coverage-type
72
+ :must_support_or_mandatory: false
73
+ - :names:
74
+ - formulary-coverage
75
+ :expectation: SHALL
76
+ :names_not_must_support_or_mandatory:
77
+ - formulary-coverage
78
+ :must_support_or_mandatory: false
79
+ - :names:
80
+ - coverage-area
81
+ :expectation: SHALL
82
+ :names_not_must_support_or_mandatory:
83
+ - coverage-area
84
+ :must_support_or_mandatory: false
85
+ :search_definitions:
86
+ :_id:
87
+ :paths:
88
+ - Resource.id
89
+ :full_paths:
90
+ - Resource.id
91
+ :comparators: {}
92
+ :values: []
93
+ :type: token
94
+ :contains_multiple: false
95
+ :_lastUpdated:
96
+ :paths:
97
+ - Resource.meta.lastUpdated
98
+ :full_paths:
99
+ - Resource.meta.lastUpdated
100
+ :comparators:
101
+ :eq: MAY
102
+ :ne: MAY
103
+ :gt: MAY
104
+ :ge: MAY
105
+ :lt: MAY
106
+ :le: MAY
107
+ :sa: MAY
108
+ :eb: MAY
109
+ :ap: MAY
110
+ :values: []
111
+ :type: date
112
+ :contains_multiple: false
113
+ :identifier:
114
+ :paths:
115
+ - identifier
116
+ :full_paths:
117
+ - InsurancePlan.identifier
118
+ :comparators: {}
119
+ :values: []
120
+ :type: Identifier
121
+ :contains_multiple: true
122
+ :multiple_or: true
123
+ :status:
124
+ :paths:
125
+ - status
126
+ :full_paths:
127
+ - InsurancePlan.status
128
+ :comparators: {}
129
+ :values:
130
+ - draft
131
+ - active
132
+ - retired
133
+ - unknown
134
+ :type: code
135
+ :contains_multiple: false
136
+ :multiple_or: true
137
+ :period:
138
+ :paths:
139
+ - period
140
+ :full_paths:
141
+ - InsurancePlan.period
142
+ :comparators:
143
+ :eq: MAY
144
+ :lt: MAY
145
+ :le: MAY
146
+ :gt: MAY
147
+ :ge: MAY
148
+ :sa: MAY
149
+ :eb: MAY
150
+ :values: []
151
+ :type: Period
152
+ :contains_multiple: false
153
+ :multiple_or: true
154
+ :type:
155
+ :paths:
156
+ - type
157
+ :full_paths:
158
+ - InsurancePlan.type
159
+ :comparators: {}
160
+ :values:
161
+ - DRUGPOL
162
+ :type: CodeableConcept
163
+ :contains_multiple: false
164
+ :multiple_or: true
165
+ :name:
166
+ :paths:
167
+ - name
168
+ :full_paths:
169
+ - InsurancePlan.name
170
+ :comparators: {}
171
+ :values: []
172
+ :type: string
173
+ :contains_multiple: false
174
+ :multiple_or: true
175
+ :coverage-type:
176
+ :paths:
177
+ - coverage.type
178
+ :full_paths:
179
+ - InsurancePlan.coverage.type
180
+ :comparators: {}
181
+ :values: []
182
+ :type: CodeableConcept
183
+ :contains_multiple: false
184
+ :multiple_or: true
185
+ :formulary-coverage:
186
+ :paths:
187
+ - coverage.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyReference-extension').value
188
+ :full_paths:
189
+ - InsurancePlan.coverage.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyReference-extension').value
190
+ :comparators: {}
191
+ :values: []
192
+ :type: Reference
193
+ :target: InsurancePlan
194
+ :contains_multiple: false
195
+ :multiple_or: true
196
+ :coverage-area:
197
+ :paths:
198
+ - coverageArea
199
+ :full_paths:
200
+ - InsurancePlan.coverageArea
201
+ :comparators: {}
202
+ :values: []
203
+ :type: Reference
204
+ :target: Location
205
+ :contains_multiple: true
206
+ :multiple_or: true
207
+ :include_params:
208
+ - formulary-coverage
209
+ :must_supports:
210
+ :extensions: []
211
+ :slices: []
212
+ :elements:
213
+ - :path: meta.lastUpdated
214
+ - :path: identifier
215
+ - :path: status
216
+ - :path: type.coding.code
217
+ :fixed_value: DRUGPOL
218
+ - :path: name
219
+ - :path: period
220
+ :references: []
221
+ :mandatory_elements:
222
+ - InsurancePlan.identifier
223
+ - InsurancePlan.status
224
+ - InsurancePlan.type
225
+ :references:
226
+ - :path: InsurancePlan.ownedBy
227
+ :profiles:
228
+ - http://hl7.org/fhir/StructureDefinition/Organization
229
+ - :path: InsurancePlan.administeredBy
230
+ :profiles:
231
+ - http://hl7.org/fhir/StructureDefinition/Organization
232
+ - :path: InsurancePlan.coverageArea
233
+ :profiles:
234
+ - http://hl7.org/fhir/StructureDefinition/Location
235
+ - :path: InsurancePlan.endpoint
236
+ :profiles:
237
+ - http://hl7.org/fhir/StructureDefinition/Endpoint
238
+ - :path: InsurancePlan.network
239
+ :profiles:
240
+ - http://hl7.org/fhir/StructureDefinition/Organization
241
+ - :path: InsurancePlan.coverage.network
242
+ :profiles:
243
+ - http://hl7.org/fhir/StructureDefinition/Organization
244
+ - :path: InsurancePlan.plan.coverageArea
245
+ :profiles:
246
+ - http://hl7.org/fhir/StructureDefinition/Location
247
+ - :path: InsurancePlan.plan.network
248
+ :profiles:
249
+ - http://hl7.org/fhir/StructureDefinition/Organization
250
+ :tests:
251
+ - :id: usdf_v201_formulary_status_search_test
252
+ :file_name: formulary_status_search_test.rb
253
+ - :id: usdf_v201_formulary__id_search_test
254
+ :file_name: formulary_id_search_test.rb
255
+ - :id: usdf_v201_formulary__lastUpdated_search_test
256
+ :file_name: formulary_lastupdated_search_test.rb
257
+ - :id: usdf_v201_formulary_identifier_search_test
258
+ :file_name: formulary_identifier_search_test.rb
259
+ - :id: usdf_v201_formulary_period_search_test
260
+ :file_name: formulary_period_search_test.rb
261
+ - :id: usdf_v201_formulary_type_search_test
262
+ :file_name: formulary_type_search_test.rb
263
+ - :id: usdf_v201_formulary_name_search_test
264
+ :file_name: formulary_name_search_test.rb
265
+ - :id: usdf_v201_formulary_coverage_type_search_test
266
+ :file_name: formulary_coverage_type_search_test.rb
267
+ - :id: usdf_v201_formulary_formulary_coverage_search_test
268
+ :file_name: formulary_formulary_coverage_search_test.rb
269
+ - :id: usdf_v201_formulary_coverage_area_search_test
270
+ :file_name: formulary_coverage_area_search_test.rb
271
+ - :id: usdf_v201_formulary_read_test
272
+ :file_name: formulary_read_test.rb
273
+ - :id: usdf_v201_formulary_validation_test
274
+ :file_name: formulary_validation_test.rb
275
+ - :id: usdf_v201_formulary_must_support_test
276
+ :file_name: formulary_must_support_test.rb
277
+ :id: usdf_v201_formulary
278
+ :file_name: formulary_group.rb