27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
# File 'lib/shc_vaccination_test_kit/shc_vaccination_validation_test.rb', line 27
def validate_fhir_bundle(bundle)
assert_valid_resource(
resource: bundle,
profile_url: 'http://hl7.org/fhir/uv/smarthealthcards-vaccination/StructureDefinition/vaccination-credential-bundle'
)
warning do
assert_valid_resource(
resource: bundle,
profile_url: 'http://hl7.org/fhir/uv/smarthealthcards-vaccination/StructureDefinition/vaccination-credential-bundle-dm'
)
end
if bundle.entry.any? { |r| r.resource.is_a?(FHIR::Observation) }
assert_valid_resource(
resource: bundle,
profile_url: 'http://hl7.org/fhir/uv/smarthealthcards-vaccination/StructureDefinition/covid19-laboratory-bundle'
)
warning do
assert_valid_resource(
resource: bundle,
profile_url: 'http://hl7.org/fhir/uv/smarthealthcards-vaccination/StructureDefinition/covid19-laboratory-bundle-dm'
)
end
end
end
|