-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for DSTU2/STU3 set_client_on_resource (#144)
* fix setting client on dstu2 and stu3 references * bump version
- Loading branch information
1 parent
a69338c
commit 42c675d
Showing
3 changed files
with
50 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module FHIR | ||
class Client | ||
VERSION = '5.0.0'.freeze | ||
VERSION = '5.0.1'.freeze | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |