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,40 @@
1
+ require_relative '../../../search_test'
2
+ require_relative '../../../generator/group_metadata'
3
+
4
+ module DaVinciUSDrugFormularyTestKit
5
+ module DaVinciUSDrugFormularyV201
6
+ class BasicSubjectIncludeSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns MedicationKnowledge resources from Basic search by _include=subject'
10
+ description %(
11
+ A server SHALL be capable of supporting _includes for subject.
12
+
13
+ This test will perform a search using _include=subject and
14
+ will pass if the referenced MedicationKnowledge is included in the response.
15
+ )
16
+
17
+ id :usdf_v201_basic_subject_include_search_test
18
+
19
+ def self.properties
20
+ @properties ||= SearchTestProperties.new(
21
+ resource_type: 'Basic',
22
+ search_param_names: ["code"],
23
+ include_param: 'subject'
24
+ )
25
+ end
26
+
27
+ def self.metadata
28
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml')))
29
+ end
30
+
31
+ def self.include_metadata
32
+ @include_metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, '..', 'MedicationKnowledge', 'metadata.yml'), aliases: true))
33
+ end
34
+
35
+ run do
36
+ run_include_search_test
37
+ end
38
+ end
39
+ end
40
+ 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 BasicSubjectSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for Basic search by subject'
10
+ description %(
11
+ A server SHALL support searching by
12
+ subject on the Basic 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_basic_subject_search_test
21
+
22
+ def self.properties
23
+ @properties ||= SearchTestProperties.new(
24
+ resource_type: 'Basic',
25
+ search_param_names: ['subject'],
26
+ test_reference_variants: true
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[:basic_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 BasicValidationTest < Inferno::Test
6
+ include DaVinciUSDrugFormularyTestKit::ValidationTest
7
+
8
+ id :usdf_v201_basic_validation_test
9
+ title 'Basic resources returned during previous tests conform to the Formulary Item profile'
10
+ description %(
11
+ This test verifies resources returned from the first search conform to
12
+ the [Formulary Item profile](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyItem).
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
+ 'Basic'
26
+ end
27
+
28
+ def scratch_resources
29
+ scratch[:basic_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-FormularyItem',
35
+ '2.0.1')
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,292 @@
1
+ ---
2
+ :name: usdf_FormularyItem
3
+ :class_name: UsdfFormularyitemSequence
4
+ :version: v2.0.1
5
+ :reformatted_version: v201
6
+ :resource: Basic
7
+ :profile_url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyItem
8
+ :profile_name: Formulary Item
9
+ :profile_version: 2.0.1
10
+ :title: Formulary Item
11
+ :short_description: Verify support for the server capabilities required by the Formulary
12
+ Item.
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
+ - code
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
+ - subject
50
+ :expectation: SHALL
51
+ :names_not_must_support_or_mandatory: []
52
+ :must_support_or_mandatory: true
53
+ - :names:
54
+ - status
55
+ :expectation: SHALL
56
+ :names_not_must_support_or_mandatory: []
57
+ :must_support_or_mandatory: true
58
+ - :names:
59
+ - period
60
+ :expectation: SHALL
61
+ :names_not_must_support_or_mandatory: []
62
+ :must_support_or_mandatory: true
63
+ - :names:
64
+ - formulary
65
+ :expectation: SHALL
66
+ :names_not_must_support_or_mandatory: []
67
+ :must_support_or_mandatory: true
68
+ - :names:
69
+ - pharmacy-benefit-type
70
+ :expectation: SHALL
71
+ :names_not_must_support_or_mandatory: []
72
+ :must_support_or_mandatory: true
73
+ - :names:
74
+ - drug-tier
75
+ :expectation: SHALL
76
+ :names_not_must_support_or_mandatory: []
77
+ :must_support_or_mandatory: true
78
+ :search_definitions:
79
+ :_id:
80
+ :paths:
81
+ - Resource.id
82
+ :full_paths:
83
+ - Resource.id
84
+ :comparators: {}
85
+ :values: []
86
+ :type: token
87
+ :contains_multiple: false
88
+ :_lastUpdated:
89
+ :paths:
90
+ - Resource.meta.lastUpdated
91
+ :full_paths:
92
+ - Resource.meta.lastUpdated
93
+ :comparators:
94
+ :eq: MAY
95
+ :ne: MAY
96
+ :gt: MAY
97
+ :ge: MAY
98
+ :lt: MAY
99
+ :le: MAY
100
+ :sa: MAY
101
+ :eb: MAY
102
+ :ap: MAY
103
+ :values: []
104
+ :type: date
105
+ :contains_multiple: false
106
+ :code:
107
+ :paths:
108
+ - code
109
+ :full_paths:
110
+ - Basic.code
111
+ :comparators: {}
112
+ :values:
113
+ - formulary-item
114
+ :type: CodeableConcept
115
+ :contains_multiple: false
116
+ :multiple_or: true
117
+ :subject:
118
+ :paths:
119
+ - subject
120
+ :full_paths:
121
+ - Basic.subject
122
+ :comparators: {}
123
+ :values: []
124
+ :type: Reference
125
+ :target: MedicationKnowledge
126
+ :contains_multiple: false
127
+ :multiple_or: true
128
+ :status:
129
+ :paths:
130
+ - extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-AvailabilityStatus-extension').value
131
+ :full_paths:
132
+ - Basic.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-AvailabilityStatus-extension').value
133
+ :comparators: {}
134
+ :values:
135
+ - draft
136
+ - active
137
+ - retired
138
+ - unknown
139
+ :type: code
140
+ :contains_multiple: false
141
+ :multiple_or: true
142
+ :period:
143
+ :paths:
144
+ - extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-AvailabilityPeriod-extension').value
145
+ :full_paths:
146
+ - Basic.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-AvailabilityPeriod-extension').value
147
+ :comparators:
148
+ :eq: MAY
149
+ :lt: MAY
150
+ :le: MAY
151
+ :gt: MAY
152
+ :ge: MAY
153
+ :sa: MAY
154
+ :eb: MAY
155
+ :values: []
156
+ :type: Period
157
+ :contains_multiple: false
158
+ :multiple_or: true
159
+ :formulary:
160
+ :paths:
161
+ - extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyReference-extension').value
162
+ :full_paths:
163
+ - Basic.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyReference-extension').value
164
+ :comparators: {}
165
+ :values: []
166
+ :type: Reference
167
+ :target: InsurancePlan
168
+ :contains_multiple: false
169
+ :multiple_or: true
170
+ :pharmacy-benefit-type:
171
+ :paths:
172
+ - extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-PharmacyBenefitType-extension').value
173
+ :full_paths:
174
+ - Basic.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-PharmacyBenefitType-extension').value
175
+ :comparators: {}
176
+ :values:
177
+ - 1-month-in-retail
178
+ - 1-month-out-retail
179
+ - 1-month-in-mail
180
+ - 1-month-out-mail
181
+ - 3-month-in-retail
182
+ - 3-month-out-retail
183
+ - 3-month-in-mail
184
+ - 3-month-out-mail
185
+ :type: CodeableConcept
186
+ :contains_multiple: true
187
+ :multiple_or: true
188
+ :drug-tier:
189
+ :paths:
190
+ - extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-DrugTierID-extension').value
191
+ :full_paths:
192
+ - Basic.extension.where(url='http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-DrugTierID-extension').value
193
+ :comparators: {}
194
+ :values:
195
+ - generic
196
+ - preferred-generic
197
+ - non-preferred-generic
198
+ - specialty
199
+ - brand
200
+ - preferred-brand
201
+ - non-preferred-brand
202
+ - zero-cost-share-preventative
203
+ - medical-service
204
+ :type: CodeableConcept
205
+ :contains_multiple: false
206
+ :multiple_or: true
207
+ :include_params:
208
+ - subject
209
+ - formulary
210
+ :must_supports:
211
+ :extensions:
212
+ - :id: Basic.extension:usdf-FormularyReference-extension
213
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyReference-extension
214
+ :path: extension
215
+ - :id: Basic.extension:usdf-AvailabilityStatus-extension
216
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-AvailabilityStatus-extension
217
+ :path: extension
218
+ - :id: Basic.extension:usdf-AvailabilityPeriod-extension
219
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-AvailabilityPeriod-extension
220
+ :path: extension
221
+ - :id: Basic.extension:usdf-PharmacyBenefitType-extension
222
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-PharmacyBenefitType-extension
223
+ :path: extension
224
+ - :id: Basic.extension:usdf-DrugTierID-extension
225
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-DrugTierID-extension
226
+ :path: extension
227
+ - :id: Basic.extension:usdf-PriorAuthorization-extension
228
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-PriorAuthorization-extension
229
+ :path: extension
230
+ - :id: Basic.extension:usdf-StepTherapyLimit-extension
231
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-StepTherapyLimit-extension
232
+ :path: extension
233
+ - :id: Basic.extension:usdf-QuantityLimit-extension
234
+ :url: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-QuantityLimit-extension
235
+ :path: extension
236
+ :slices: []
237
+ :elements:
238
+ - :path: meta.lastUpdated
239
+ - :path: subject
240
+ :types:
241
+ - Reference
242
+ :references:
243
+ - :path: subject
244
+ :target_profile: http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug
245
+ :mandatory_elements:
246
+ - Basic.extension
247
+ - Basic.code
248
+ - Basic.subject
249
+ :references:
250
+ - :path: Basic.subject
251
+ :profiles:
252
+ - http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyDrug
253
+ - :path: Basic.author
254
+ :profiles:
255
+ - http://hl7.org/fhir/StructureDefinition/Practitioner
256
+ - http://hl7.org/fhir/StructureDefinition/PractitionerRole
257
+ - http://hl7.org/fhir/StructureDefinition/Patient
258
+ - http://hl7.org/fhir/StructureDefinition/RelatedPerson
259
+ - http://hl7.org/fhir/StructureDefinition/Organization
260
+ :tests:
261
+ - :id: usdf_v201_basic_code_search_test
262
+ :file_name: basic_code_search_test.rb
263
+ - :id: usdf_v201_basic__id_search_test
264
+ :file_name: basic_id_search_test.rb
265
+ - :id: usdf_v201_basic__lastUpdated_search_test
266
+ :file_name: basic_lastupdated_search_test.rb
267
+ - :id: usdf_v201_basic_subject_search_test
268
+ :file_name: basic_subject_search_test.rb
269
+ - :id: usdf_v201_basic_status_search_test
270
+ :file_name: basic_status_search_test.rb
271
+ - :id: usdf_v201_basic_period_search_test
272
+ :file_name: basic_period_search_test.rb
273
+ - :id: usdf_v201_basic_formulary_search_test
274
+ :file_name: basic_formulary_search_test.rb
275
+ - :id: usdf_v201_basic_pharmacy_benefit_type_search_test
276
+ :file_name: basic_pharmacy_benefit_type_search_test.rb
277
+ - :id: usdf_v201_basic_drug_tier_search_test
278
+ :file_name: basic_drug_tier_search_test.rb
279
+ - :id: usdf_v201_basic_read_test
280
+ :file_name: basic_read_test.rb
281
+ - :id: usdf_v201_basic_subject_include_search_test
282
+ :file_name: basic_subject_include_search_test.rb
283
+ - :id: usdf_v201_basic_formulary_include_search_test
284
+ :file_name: basic_formulary_include_search_test.rb
285
+ - :id: usdf_v201_basic_validation_test
286
+ :file_name: basic_validation_test.rb
287
+ - :id: usdf_v201_basic_must_support_test
288
+ :file_name: basic_must_support_test.rb
289
+ - :id: usdf_v201_basic_reference_resolution_test
290
+ :file_name: basic_reference_resolution_test.rb
291
+ :id: usdf_v201_basic
292
+ :file_name: basic_group.rb
@@ -0,0 +1,107 @@
1
+ require_relative 'basic/basic_code_search_test'
2
+ require_relative 'basic/basic_id_search_test'
3
+ require_relative 'basic/basic_lastupdated_search_test'
4
+ require_relative 'basic/basic_subject_search_test'
5
+ require_relative 'basic/basic_status_search_test'
6
+ require_relative 'basic/basic_period_search_test'
7
+ require_relative 'basic/basic_formulary_search_test'
8
+ require_relative 'basic/basic_pharmacy_benefit_type_search_test'
9
+ require_relative 'basic/basic_drug_tier_search_test'
10
+ require_relative 'basic/basic_read_test'
11
+ require_relative 'basic/basic_subject_include_search_test'
12
+ require_relative 'basic/basic_formulary_include_search_test'
13
+ require_relative 'basic/basic_validation_test'
14
+ require_relative 'basic/basic_must_support_test'
15
+ require_relative 'basic/basic_reference_resolution_test'
16
+
17
+ module DaVinciUSDrugFormularyTestKit
18
+ module USDFV201
19
+ class BasicGroup < Inferno::TestGroup
20
+ title 'Formulary Item Tests'
21
+ short_description 'Verify support for the server capabilities required by the Formulary Item.'
22
+ description %(
23
+ # Background
24
+
25
+ The USDF Formulary Item sequence verifies that the system under test is
26
+ able to provide correct responses for Basic queries. These queries
27
+ must contain resources conforming to the Formulary Item as
28
+ specified in the USDF v2.0.1 Implementation Guide.
29
+
30
+ # Testing Methodology
31
+ ## Searching
32
+ This test sequence will first perform each required search associated
33
+ with this resource. This sequence will perform searches with the
34
+ following parameters:
35
+
36
+ * code
37
+ * _id
38
+ * _lastUpdated
39
+ * subject
40
+ * status
41
+ * period
42
+ * formulary
43
+ * pharmacy-benefit-type
44
+ * drug-tier
45
+
46
+ ### Search Parameters
47
+ The first search uses the selected resources from the prior launch
48
+ sequence. Any subsequent searches will look for its parameter values
49
+ from the results of the first search. If a value cannot be found this way, the search is skipped.
50
+
51
+ ### Search Validation
52
+ Inferno will retrieve up to the first 20 bundle pages of the reply for
53
+ Basic resources and save them for subsequent tests. Each of
54
+ these resources is then checked to see if it matches the searched
55
+ parameters in accordance with [FHIR search
56
+ guidelines](https://www.hl7.org/fhir/search.html).
57
+
58
+
59
+ ## Must Support
60
+ Each profile contains elements marked as "must support". This test
61
+ sequence expects to see each of these elements at least once. If at
62
+ least one cannot be found, the test will fail. The test will look
63
+ through the Basic resources found in the first test for these
64
+ elements.
65
+
66
+ ## Profile Validation
67
+ Each resource returned from the first search is expected to conform to
68
+ the [Formulary Item](http://hl7.org/fhir/us/davinci-drug-formulary/StructureDefinition/usdf-FormularyItem). Each element is checked against
69
+ teminology binding and cardinality requirements.
70
+
71
+ Elements with a required binding are validated against their bound
72
+ ValueSet. If the code/system in the element is not part of the ValueSet,
73
+ then the test will fail.
74
+
75
+ ## Reference Validation
76
+ At least one instance of each external reference in elements marked as
77
+ "must support" within the resources provided by the system must resolve.
78
+ The test will attempt to read each reference found and will fail if no
79
+ read succeeds.
80
+
81
+ )
82
+
83
+ id :usdf_v201_basic
84
+ run_as_group
85
+
86
+ def self.metadata
87
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'basic', 'metadata.yml'), aliases: true))
88
+ end
89
+
90
+ test from: :usdf_v201_basic_code_search_test
91
+ test from: :usdf_v201_basic__id_search_test
92
+ test from: :usdf_v201_basic__lastUpdated_search_test
93
+ test from: :usdf_v201_basic_subject_search_test
94
+ test from: :usdf_v201_basic_status_search_test
95
+ test from: :usdf_v201_basic_period_search_test
96
+ test from: :usdf_v201_basic_formulary_search_test
97
+ test from: :usdf_v201_basic_pharmacy_benefit_type_search_test
98
+ test from: :usdf_v201_basic_drug_tier_search_test
99
+ test from: :usdf_v201_basic_read_test
100
+ test from: :usdf_v201_basic_subject_include_search_test
101
+ test from: :usdf_v201_basic_formulary_include_search_test
102
+ test from: :usdf_v201_basic_validation_test
103
+ test from: :usdf_v201_basic_must_support_test
104
+ test from: :usdf_v201_basic_reference_resolution_test
105
+ end
106
+ end
107
+ 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 FormularyCoverageAreaSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by coverage-area'
10
+ description %(
11
+ A server SHALL support searching by
12
+ coverage-area 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_coverage_area_search_test
21
+ optional
22
+
23
+
24
+ def self.properties
25
+ @properties ||= SearchTestProperties.new(
26
+ resource_type: 'InsurancePlan',
27
+ search_param_names: ['coverage-area'],
28
+ test_reference_variants: true
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[:formulary_resources] ||= {}
38
+ end
39
+
40
+ run do
41
+ run_search_test
42
+ end
43
+ end
44
+ end
45
+ 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 FormularyCoverageTypeSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by coverage-type'
10
+ description %(
11
+ A server SHALL support searching by
12
+ coverage-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_coverage_type_search_test
21
+ optional
22
+
23
+
24
+ def self.properties
25
+ @properties ||= SearchTestProperties.new(
26
+ resource_type: 'InsurancePlan',
27
+ search_param_names: ['coverage-type'],
28
+ token_search_params: ['coverage-type']
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[:formulary_resources] ||= {}
38
+ end
39
+
40
+ run do
41
+ run_search_test
42
+ end
43
+ end
44
+ end
45
+ 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 FormularyFormularyCoverageSearchTest < Inferno::Test
7
+ include DaVinciUSDrugFormularyTestKit::SearchTest
8
+
9
+ title 'Server returns valid results for InsurancePlan search by formulary-coverage'
10
+ description %(
11
+ A server SHALL support searching by
12
+ formulary-coverage 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_formulary_coverage_search_test
21
+ optional
22
+
23
+
24
+ def self.properties
25
+ @properties ||= SearchTestProperties.new(
26
+ resource_type: 'InsurancePlan',
27
+ search_param_names: ['formulary-coverage'],
28
+ test_reference_variants: true
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[:formulary_resources] ||= {}
38
+ end
39
+
40
+ run do
41
+ run_search_test
42
+ end
43
+ end
44
+ end
45
+ end