us_core_test_kit 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/us_core_test_kit/generated/v3.1.1/allergy_intolerance/allergy_intolerance_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/allergy_intolerance/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bodyheight/bodyheight_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bodyheight/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bodytemp/bodytemp_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bodytemp/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bodyweight/bodyweight_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bodyweight/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bp/bp_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/bp/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/care_plan/care_plan_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/care_plan/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/care_team/care_team_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/care_team/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/condition/condition_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/condition/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/device/device_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/device/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/diagnostic_report_lab/diagnostic_report_lab_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/diagnostic_report_lab/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/diagnostic_report_note/diagnostic_report_note_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/diagnostic_report_note/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/document_reference/document_reference_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/document_reference/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/encounter/encounter_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/encounter/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/goal/goal_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/goal/metadata.yml +2 -1
- data/lib/us_core_test_kit/generated/v3.1.1/head_circumference/head_circumference_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/head_circumference/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/heartrate/heartrate_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/heartrate/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/immunization/immunization_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/immunization/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/medication_request/medication_request_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/medication_request/medication_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/medication_request/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/metadata.yml +33 -1
- data/lib/us_core_test_kit/generated/v3.1.1/observation_lab/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/observation_lab/observation_lab_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/organization/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/organization/organization_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/patient/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/patient/patient_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/pediatric_bmi_for_age/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/pediatric_bmi_for_age/pediatric_bmi_for_age_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/pediatric_weight_for_height/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/pediatric_weight_for_height/pediatric_weight_for_height_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/practitioner/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/practitioner/practitioner_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/procedure/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/procedure/procedure_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/provenance/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/provenance/provenance_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/pulse_oximetry/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/pulse_oximetry/pulse_oximetry_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/resprate/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/resprate/resprate_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/smokingstatus/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v3.1.1/smokingstatus/smokingstatus_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/allergy_intolerance/allergy_intolerance_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/allergy_intolerance/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/blood_pressure/blood_pressure_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/blood_pressure/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/bmi/bmi_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/bmi/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/body_height/body_height_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/body_height/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/body_temperature/body_temperature_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/body_temperature/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/body_weight/body_weight_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/body_weight/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/care_plan/care_plan_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/care_plan/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/care_team/care_team_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/care_team/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/condition/condition_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/condition/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/device/device_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/device/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/diagnostic_report_lab/diagnostic_report_lab_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/diagnostic_report_lab/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/diagnostic_report_note/diagnostic_report_note_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/diagnostic_report_note/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/document_reference/document_reference_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/document_reference/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/encounter/encounter_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/encounter/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/goal/goal_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/goal/metadata.yml +2 -1
- data/lib/us_core_test_kit/generated/v4.0.0/head_circumference/head_circumference_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/head_circumference/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/head_circumference_percentile/head_circumference_percentile_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/head_circumference_percentile/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/heart_rate/heart_rate_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/heart_rate/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/immunization/immunization_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/immunization/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/medication_request/medication_request_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/medication_request/medication_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/medication_request/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/metadata.yml +36 -9
- data/lib/us_core_test_kit/generated/v4.0.0/observation_lab/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/observation_lab/observation_lab_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/organization/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/organization/organization_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/patient/metadata.yml +1 -8
- data/lib/us_core_test_kit/generated/v4.0.0/patient/patient_must_support_test.rb +4 -6
- data/lib/us_core_test_kit/generated/v4.0.0/patient/patient_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/pediatric_bmi_for_age/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/pediatric_bmi_for_age/pediatric_bmi_for_age_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/pediatric_weight_for_height/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/pediatric_weight_for_height/pediatric_weight_for_height_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/practitioner/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/practitioner/practitioner_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/procedure/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/procedure/procedure_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/provenance/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/provenance/provenance_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/pulse_oximetry/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/pulse_oximetry/pulse_oximetry_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/respiratory_rate/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/respiratory_rate/respiratory_rate_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/smokingstatus/metadata.yml +1 -0
- data/lib/us_core_test_kit/generated/v4.0.0/smokingstatus/smokingstatus_validation_test.rb +1 -0
- data/lib/us_core_test_kit/generator/group_metadata.rb +1 -0
- data/lib/us_core_test_kit/generator/group_metadata_extractor.rb +5 -0
- data/lib/us_core_test_kit/generator/ig_loader.rb +12 -5
- data/lib/us_core_test_kit/generator/must_support_metadata_extractor.rb +0 -12
- data/lib/us_core_test_kit/generator/validation_test_generator.rb +4 -0
- data/lib/us_core_test_kit/generator.rb +9 -14
- data/lib/us_core_test_kit/igs/{v311 → us_core_311}/StructureDefinition-bodyheight.json +0 -0
- data/lib/us_core_test_kit/igs/{v311 → us_core_311}/StructureDefinition-bodytemp.json +0 -0
- data/lib/us_core_test_kit/igs/{v311 → us_core_311}/StructureDefinition-bodyweight.json +0 -0
- data/lib/us_core_test_kit/igs/{v311 → us_core_311}/StructureDefinition-bp.json +0 -0
- data/lib/us_core_test_kit/igs/{v311 → us_core_311}/StructureDefinition-heartrate.json +0 -0
- data/lib/us_core_test_kit/igs/{v311 → us_core_311}/StructureDefinition-resprate.json +0 -0
- data/lib/us_core_test_kit/igs/{v311/package.tgz → us_core_311.tgz} +0 -0
- data/lib/us_core_test_kit/igs/{v400/package.tgz → us_core_400.tgz} +0 -0
- data/lib/us_core_test_kit/must_support_test.rb +6 -0
- data/lib/us_core_test_kit/search_test.rb +3 -2
- data/lib/us_core_test_kit/validation_test.rb +4 -2
- data/lib/us_core_test_kit/version.rb +1 -1
- metadata +13 -13
@@ -16,26 +16,21 @@ require_relative 'generator/validation_test_generator'
|
|
16
16
|
module USCoreTestKit
|
17
17
|
class Generator
|
18
18
|
def self.generate
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
.map { |path| File.join(base_ig_directory, path) }
|
24
|
-
.select { |path| File.directory? path }
|
25
|
-
|
26
|
-
ig_directories.each do |ig_directory|
|
27
|
-
new(ig_directory).generate
|
19
|
+
ig_packages = Dir.glob(File.join(Dir.pwd, 'lib', 'us_core_test_kit', 'igs', '*.tgz'))
|
20
|
+
|
21
|
+
ig_packages.each do |ig_package|
|
22
|
+
new(ig_package).generate
|
28
23
|
end
|
29
24
|
end
|
30
25
|
|
31
|
-
attr_accessor :ig_resources, :ig_metadata, :
|
26
|
+
attr_accessor :ig_resources, :ig_metadata, :ig_file_name
|
32
27
|
|
33
|
-
def initialize(
|
34
|
-
self.
|
28
|
+
def initialize(ig_file_name)
|
29
|
+
self.ig_file_name = ig_file_name
|
35
30
|
end
|
36
31
|
|
37
32
|
def generate
|
38
|
-
puts "Generating tests for IG
|
33
|
+
puts "Generating tests for IG #{File.basename(ig_file_name)}"
|
39
34
|
load_ig_package
|
40
35
|
extract_metadata
|
41
36
|
generate_resource_list
|
@@ -68,7 +63,7 @@ module USCoreTestKit
|
|
68
63
|
|
69
64
|
def load_ig_package
|
70
65
|
FHIR.logger = Logger.new('/dev/null')
|
71
|
-
self.ig_resources = IGLoader.new(
|
66
|
+
self.ig_resources = IGLoader.new(ig_file_name).load
|
72
67
|
end
|
73
68
|
|
74
69
|
def generate_resource_list
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -228,8 +228,9 @@ module USCoreTestKit
|
|
228
228
|
|
229
229
|
search_and_check_response(params_with_comparator)
|
230
230
|
|
231
|
-
fetch_all_bundled_resources
|
232
|
-
|
231
|
+
fetch_all_bundled_resources.each do |resource|
|
232
|
+
check_resource_against_params(resource, params_with_comparator) if resource.resourceType == resource_type
|
233
|
+
end
|
233
234
|
end
|
234
235
|
|
235
236
|
search_variant_test_records[:comparator_searches] << name
|
@@ -5,6 +5,7 @@ module USCoreTestKit
|
|
5
5
|
|
6
6
|
def perform_validation_test(resources,
|
7
7
|
profile_url,
|
8
|
+
profile_version,
|
8
9
|
skip_if_empty: true)
|
9
10
|
|
10
11
|
skip_if skip_if_empty && resources.blank?,
|
@@ -13,14 +14,15 @@ module USCoreTestKit
|
|
13
14
|
omit_if resources.blank?,
|
14
15
|
"No #{resource_type} resources provided so the #{profile_url} profile does not apply"
|
15
16
|
|
17
|
+
profile_with_version = "#{profile_url}|#{profile_version}"
|
16
18
|
resources.each do |resource|
|
17
|
-
resource_is_valid?(resource: resource, profile_url:
|
19
|
+
resource_is_valid?(resource: resource, profile_url: profile_with_version)
|
18
20
|
check_for_dar(resource)
|
19
21
|
end
|
20
22
|
|
21
23
|
errors_found = messages.any? { |message| message[:type] == 'error' }
|
22
24
|
|
23
|
-
assert !errors_found, "Resource does not conform to the profile #{
|
25
|
+
assert !errors_found, "Resource does not conform to the profile #{profile_with_version}"
|
24
26
|
end
|
25
27
|
|
26
28
|
def check_for_dar(resource)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: us_core_test_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen MacVicar
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inferno_core
|
@@ -818,14 +818,14 @@ files:
|
|
818
818
|
- lib/us_core_test_kit/generator/suite_generator.rb
|
819
819
|
- lib/us_core_test_kit/generator/terminology_binding_metadata_extractor.rb
|
820
820
|
- lib/us_core_test_kit/generator/validation_test_generator.rb
|
821
|
-
- lib/us_core_test_kit/igs/
|
822
|
-
- lib/us_core_test_kit/igs/
|
823
|
-
- lib/us_core_test_kit/igs/
|
824
|
-
- lib/us_core_test_kit/igs/
|
825
|
-
- lib/us_core_test_kit/igs/
|
826
|
-
- lib/us_core_test_kit/igs/
|
827
|
-
- lib/us_core_test_kit/igs/
|
828
|
-
- lib/us_core_test_kit/igs/
|
821
|
+
- lib/us_core_test_kit/igs/us_core_311.tgz
|
822
|
+
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-bodyheight.json
|
823
|
+
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-bodytemp.json
|
824
|
+
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-bodyweight.json
|
825
|
+
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-bp.json
|
826
|
+
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-heartrate.json
|
827
|
+
- lib/us_core_test_kit/igs/us_core_311/StructureDefinition-resprate.json
|
828
|
+
- lib/us_core_test_kit/igs/us_core_400.tgz
|
829
829
|
- lib/us_core_test_kit/must_support_test.rb
|
830
830
|
- lib/us_core_test_kit/read_test.rb
|
831
831
|
- lib/us_core_test_kit/reference_resolution_test.rb
|
@@ -840,7 +840,7 @@ licenses:
|
|
840
840
|
metadata:
|
841
841
|
homepage_uri: https://github.com/inferno_framework/us-core-test-kit
|
842
842
|
source_code_uri: https://github.com/inferno_framework/us-core-test-kit
|
843
|
-
post_install_message:
|
843
|
+
post_install_message:
|
844
844
|
rdoc_options: []
|
845
845
|
require_paths:
|
846
846
|
- lib
|
@@ -856,7 +856,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
856
856
|
version: '0'
|
857
857
|
requirements: []
|
858
858
|
rubygems_version: 3.1.6
|
859
|
-
signing_key:
|
859
|
+
signing_key:
|
860
860
|
specification_version: 4
|
861
861
|
summary: US Core Inferno tests
|
862
862
|
test_files: []
|