forked from fhir-crucible/fhir_client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
set_client_on_resource_test.rb
46 lines (39 loc) · 1.03 KB
/
set_client_on_resource_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require_relative '../test_helper'
class SetClientOnResourceTest < Test::Unit::TestCase
def client
@client ||= FHIR::Client.new('abc')
end
def test_r4
condition = FHIR::Condition.new(
resourceType: 'Condition',
subject: {
reference: 'Patient/123'
}
)
client.set_client_on_resource(condition)
assert_equal(client, condition.client)
assert_equal(client, condition.subject.client)
end
def test_stu3
condition = FHIR::STU3::Condition.new(
resourceType: 'Condition',
subject: {
reference: 'Patient/123'
}
)
client.set_client_on_resource(condition)
assert_equal(client, condition.client)
assert_equal(client, condition.subject.client)
end
def test_dstu2
condition = FHIR::DSTU2::Condition.new(
resourceType: 'Condition',
patient: {
reference: 'Patient/123'
}
)
client.set_client_on_resource(condition)
assert_equal(client, condition.client)
assert_equal(client, condition.patient.client)
end
end