Class: CancerPathologyDataSharingTestKit::ContentBundleValidationTest

Inherits:
Inferno::Test
  • Object
show all
Includes:
BundleParse, ValidationTest
Defined in:
lib/cancer_pathology_data_sharing_test_kit/report_generation_suite/exchange_bundle/us_pathology_exchange_bundle/exchange_bundle_validation_test.rb

Constant Summary

Constants included from BundleParse

BundleParse::PE_BUNDLE_SLICE_RESOURCES

Constants included from ValidationTest

ValidationTest::CARDINALITY_RESTRICTIONS, ValidationTest::DAR_CODE_SYSTEM_URL, ValidationTest::DAR_EXTENSION_URL

Instance Method Summary collapse

Methods included from BundleParse

#clear_unresolved_references, #filter_exchange_bundle_resources, #find_resource_in_bundle, #parse_bundle, #pe_bundle_resource_types, #unresolved_references

Methods included from ValidationTest

#check_for_dar, #check_for_dar_code, #check_for_dar_extension, #check_for_errors, #perform_strict_validation_test

Instance Method Details

#add_to_scratch(bundles_array) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/cancer_pathology_data_sharing_test_kit/report_generation_suite/exchange_bundle/us_pathology_exchange_bundle/exchange_bundle_validation_test.rb', line 22

def add_to_scratch(bundles_array)
  scratch[:cpds_resources] ||= {}
  scratch[:cpds_exchange_bundles] ||= []
  bundles_array.each do |report|
    bundle = FHIR.from_contents(report.to_json)
    assert_resource_type('Bundle', resource: bundle)
    bundle_id = bundle.id
    scratch[:cpds_exchange_bundles] << bundle
    scratch[:cpds_resources][bundle_id] = parse_bundle(bundle)
  end
end

#resource_typeObject



18
19
20
# File 'lib/cancer_pathology_data_sharing_test_kit/report_generation_suite/exchange_bundle/us_pathology_exchange_bundle/exchange_bundle_validation_test.rb', line 18

def resource_type
  'Bundle'
end