davinci_us_drug_formulary_test_kit 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_formulary_include_search_test.rb +5 -4
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/basic_subject_include_search_test.rb +5 -4
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/basic/metadata.yml +2 -2
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/formulary/metadata.yml +1 -1
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/metadata.yml +3 -3
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/metadata.yml +1 -1
- data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/payer_insurance_plan_formulary_coverage_include_search_test.rb +5 -4
- data/lib/davinci_us_drug_formulary_test_kit/generator/ig_loader.rb +20 -3
- data/lib/davinci_us_drug_formulary_test_kit/generator/include_search_test_generator.rb +15 -3
- data/lib/davinci_us_drug_formulary_test_kit/igs/package_supersede/CapabilityStatement-usdf-server.json +896 -0
- data/lib/davinci_us_drug_formulary_test_kit/search_test.rb +3 -1
- data/lib/davinci_us_drug_formulary_test_kit/search_test_properties.rb +1 -0
- data/lib/davinci_us_drug_formulary_test_kit/version.rb +1 -1
- metadata +4 -3
- /data/lib/davinci_us_drug_formulary_test_kit/igs/{package → package_supplement}/r4_search-parameters.json +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1d80f365197a7b85d33e06ac063779f8f9ee3a96ce65fec1755bca0e268a997
|
4
|
+
data.tar.gz: cdf090825199aa640c155ba2059759b516efedddfb62996ee4adfda3fa31c74c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e16f6ae0f5f5dc1eeb20d0bad1e5a21e16dac1c15bf188b77bd3eed62bb509640bfc17bedf9d0c9b41a033b5928f432b98dcdd2a19678460dcf8524743e6942f
|
7
|
+
data.tar.gz: 98eeb731bfda89af7d039609558f8ce40a4ce96bee3f278b25ea6dd77a11a4459d42c68844aefbe6a63ae75d2a7ad2cfcab4be756d00f5dda3b19ad292bd04b4
|
@@ -6,11 +6,11 @@ module DaVinciUSDrugFormularyTestKit
|
|
6
6
|
class BasicFormularyIncludeSearchTest < Inferno::Test
|
7
7
|
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
8
|
|
9
|
-
title 'Server returns InsurancePlan resources from Basic search by _include=formulary'
|
9
|
+
title 'Server returns InsurancePlan resources from Basic search by _include=Basic:formulary'
|
10
10
|
description %(
|
11
|
-
A server SHALL be capable of supporting _includes for formulary.
|
11
|
+
A server SHALL be capable of supporting _includes for Basic:formulary.
|
12
12
|
|
13
|
-
This test will perform a search using _include=formulary and
|
13
|
+
This test will perform a search using _include=Basic:formulary and
|
14
14
|
will pass if the referenced InsurancePlan is included in the response.
|
15
15
|
)
|
16
16
|
|
@@ -20,7 +20,8 @@ module DaVinciUSDrugFormularyTestKit
|
|
20
20
|
@properties ||= SearchTestProperties.new(
|
21
21
|
resource_type: 'Basic',
|
22
22
|
search_param_names: ["code"],
|
23
|
-
include_param: 'formulary'
|
23
|
+
include_param: 'Basic:formulary',
|
24
|
+
include_search_look_up_param: 'formulary'
|
24
25
|
)
|
25
26
|
end
|
26
27
|
|
@@ -6,11 +6,11 @@ module DaVinciUSDrugFormularyTestKit
|
|
6
6
|
class BasicSubjectIncludeSearchTest < Inferno::Test
|
7
7
|
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
8
|
|
9
|
-
title 'Server returns MedicationKnowledge resources from Basic search by _include=subject'
|
9
|
+
title 'Server returns MedicationKnowledge resources from Basic search by _include=Basic:subject'
|
10
10
|
description %(
|
11
|
-
A server SHALL be capable of supporting _includes for subject.
|
11
|
+
A server SHALL be capable of supporting _includes for Basic:subject.
|
12
12
|
|
13
|
-
This test will perform a search using _include=subject and
|
13
|
+
This test will perform a search using _include=Basic:subject and
|
14
14
|
will pass if the referenced MedicationKnowledge is included in the response.
|
15
15
|
)
|
16
16
|
|
@@ -20,7 +20,8 @@ module DaVinciUSDrugFormularyTestKit
|
|
20
20
|
@properties ||= SearchTestProperties.new(
|
21
21
|
resource_type: 'Basic',
|
22
22
|
search_param_names: ["code"],
|
23
|
-
include_param: 'subject'
|
23
|
+
include_param: 'Basic:subject',
|
24
|
+
include_search_look_up_param: 'subject'
|
24
25
|
)
|
25
26
|
end
|
26
27
|
|
@@ -215,7 +215,7 @@
|
|
215
215
|
:contains_multiple: true
|
216
216
|
:multiple_or: true
|
217
217
|
:include_params: &1
|
218
|
-
- formulary-coverage
|
218
|
+
- InsurancePlan:formulary-coverage
|
219
219
|
:must_supports:
|
220
220
|
:extensions:
|
221
221
|
- :id: InsurancePlan.coverage:drug-coverage.extension:usdf-FormularyReference-extension
|
@@ -791,8 +791,8 @@
|
|
791
791
|
:contains_multiple: false
|
792
792
|
:multiple_or: true
|
793
793
|
:include_params:
|
794
|
-
- subject
|
795
|
-
- formulary
|
794
|
+
- Basic:subject
|
795
|
+
- Basic:formulary
|
796
796
|
:must_supports:
|
797
797
|
:extensions:
|
798
798
|
- :id: Basic.extension:usdf-FormularyReference-extension
|
data/lib/davinci_us_drug_formulary_test_kit/generated/v2.0.1/payer_insurance_plan/metadata.yml
CHANGED
@@ -213,7 +213,7 @@
|
|
213
213
|
:contains_multiple: true
|
214
214
|
:multiple_or: true
|
215
215
|
:include_params:
|
216
|
-
- formulary-coverage
|
216
|
+
- InsurancePlan:formulary-coverage
|
217
217
|
:must_supports:
|
218
218
|
:extensions:
|
219
219
|
- :id: InsurancePlan.coverage:drug-coverage.extension:usdf-FormularyReference-extension
|
@@ -6,11 +6,11 @@ module DaVinciUSDrugFormularyTestKit
|
|
6
6
|
class PayerInsurancePlanFormularyCoverageIncludeSearchTest < Inferno::Test
|
7
7
|
include DaVinciUSDrugFormularyTestKit::SearchTest
|
8
8
|
|
9
|
-
title 'Server returns InsurancePlan resources from InsurancePlan search by _include=formulary-coverage'
|
9
|
+
title 'Server returns InsurancePlan resources from InsurancePlan search by _include=InsurancePlan:formulary-coverage'
|
10
10
|
description %(
|
11
|
-
A server SHALL be capable of supporting _includes for formulary-coverage.
|
11
|
+
A server SHALL be capable of supporting _includes for InsurancePlan:formulary-coverage.
|
12
12
|
|
13
|
-
This test will perform a search using _include=formulary-coverage and
|
13
|
+
This test will perform a search using _include=InsurancePlan:formulary-coverage and
|
14
14
|
will pass if the referenced InsurancePlan is included in the response.
|
15
15
|
)
|
16
16
|
|
@@ -20,7 +20,8 @@ module DaVinciUSDrugFormularyTestKit
|
|
20
20
|
@properties ||= SearchTestProperties.new(
|
21
21
|
resource_type: 'InsurancePlan',
|
22
22
|
search_param_names: ["coverage-type"],
|
23
|
-
include_param: 'formulary-coverage'
|
23
|
+
include_param: 'InsurancePlan:formulary-coverage',
|
24
|
+
include_search_look_up_param: 'formulary-coverage'
|
24
25
|
)
|
25
26
|
end
|
26
27
|
|
@@ -19,11 +19,18 @@ module DaVinciUSDrugFormularyTestKit
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def load
|
22
|
+
# `IGResources` uses the first resource it finds for a resource type.
|
23
|
+
# To "supercede" resources, load them first. Any duplicate resources will
|
24
|
+
# be accessed instead of the IG resources because they are "first."
|
25
|
+
# To "supplement" resources, load them last. Any duplicate resources will
|
26
|
+
# be ignored because the IG resources are "first."
|
27
|
+
load_supersede_resources
|
22
28
|
load_ig
|
23
|
-
|
29
|
+
load_supplement_resources
|
24
30
|
end
|
25
31
|
|
26
32
|
def load_ig
|
33
|
+
|
27
34
|
tar = Gem::Package::TarReader.new(
|
28
35
|
Zlib::GzipReader.open(ig_file_name)
|
29
36
|
)
|
@@ -51,8 +58,16 @@ module DaVinciUSDrugFormularyTestKit
|
|
51
58
|
ig_resources
|
52
59
|
end
|
53
60
|
|
54
|
-
def
|
55
|
-
|
61
|
+
def load_supersede_resources
|
62
|
+
load_standalone_resources('_supersede')
|
63
|
+
end
|
64
|
+
|
65
|
+
def load_supplement_resources
|
66
|
+
load_standalone_resources('_supplement')
|
67
|
+
end
|
68
|
+
|
69
|
+
def load_standalone_resources(appendage = '')
|
70
|
+
ig_directory = "#{ig_file_name.chomp('.tgz')}#{appendage}"
|
56
71
|
|
57
72
|
Dir.glob(File.join(ig_directory, '*.json')).each do |file_path|
|
58
73
|
resource = FHIR.from_contents(File.read(file_path))
|
@@ -63,6 +78,8 @@ module DaVinciUSDrugFormularyTestKit
|
|
63
78
|
resource_arr.each do |entry|
|
64
79
|
ig_resources.add(entry.resource)
|
65
80
|
end
|
81
|
+
else
|
82
|
+
ig_resources.add(resource)
|
66
83
|
end
|
67
84
|
rescue StandardError
|
68
85
|
file_name = file_path.split('/').last
|
@@ -39,7 +39,7 @@ module DaVinciUSDrugFormularyTestKit
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def search_identifier
|
42
|
-
|
42
|
+
include_search_look_up_param.gsub(/[-:]/, '_').underscore
|
43
43
|
end
|
44
44
|
|
45
45
|
def class_name
|
@@ -51,16 +51,28 @@ module DaVinciUSDrugFormularyTestKit
|
|
51
51
|
properties[:resource_type] = "'#{resource_type}'"
|
52
52
|
properties[:search_param_names] = search_param_names
|
53
53
|
properties[:include_param] = "'#{include_param}'"
|
54
|
+
properties[:include_search_look_up_param] = "'#{include_search_look_up_param}'"
|
54
55
|
end
|
55
56
|
end
|
56
57
|
|
58
|
+
def include_search_look_up_param
|
59
|
+
# Returns the `searchParam` part of the `include_param` string, which should be
|
60
|
+
# formatted as `SourceType:searchParam(:targetType)`. See (https://hl7.org/fhir/R4/search.html#table)
|
61
|
+
# If the `include_param` is formatted incorrectly, returns `include_param`.
|
62
|
+
#
|
63
|
+
# The `searchParam` part of `include_param` is necessary for indexing dictionaries generated
|
64
|
+
# from the `searchParams` list in the Capability Statement.
|
65
|
+
params = include_param.split(':')
|
66
|
+
params.length > 1 ? params[1] : include_param
|
67
|
+
end
|
68
|
+
|
57
69
|
def include_param_string
|
58
70
|
"_include=#{include_param}"
|
59
71
|
end
|
60
72
|
|
61
73
|
def include_param_resource
|
62
|
-
res_type = group_metadata.search_definitions[:"#{
|
63
|
-
res_type = group_metadata.search_definitions[:"#{
|
74
|
+
res_type = group_metadata.search_definitions[:"#{include_search_look_up_param}"][:type]
|
75
|
+
res_type = group_metadata.search_definitions[:"#{include_search_look_up_param}"][:target] if res_type == 'Reference'
|
64
76
|
res_type
|
65
77
|
end
|
66
78
|
end
|