From c38f64aa553acfc7340f692516309571d3295d90 Mon Sep 17 00:00:00 2001 From: Peter Hull Date: Wed, 29 Jul 2020 08:49:55 +0000 Subject: [PATCH 1/2] Create a patient on the client, if needed Also use the standard 'minimal_patient' resource instead of an ad-hoc definition --- lib/tests/suites/read_test.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/tests/suites/read_test.rb b/lib/tests/suites/read_test.rb index c6f5f942..b408b369 100644 --- a/lib/tests/suites/read_test.rb +++ b/lib/tests/suites/read_test.rb @@ -7,7 +7,7 @@ def id end def description - 'Initial Sprinkler tests (R001, R002, R003, R004) for testing basic READ requests.' + 'Initial Sprinkler tests (R001, R002, R003, R004, R005) for testing basic READ requests.' end def initialize(client1, client2=nil) @@ -16,6 +16,7 @@ def initialize(client1, client2=nil) end def setup + @resources = Crucible::Generator::Resources.new(fhir_version) # try to find a patient begin response = @client.read_feed(get_resource(:Patient)) @@ -23,7 +24,7 @@ def setup rescue # try to create a patient begin - @patient = get_resource(:Patient).new(meta: { tag: [{ system: 'http://projectcrucible.org', code: 'testdata'}] }, name: { family: 'Emerald', given: 'Caro' }) + @patient = @client.create(@resources.minimal_patient).resource @patient_created = true rescue @patient = nil From bd5743828ba05c805cb5f80411806c83b046e6db Mon Sep 17 00:00:00 2001 From: Peter Hull Date: Wed, 29 Jul 2020 15:03:59 +0100 Subject: [PATCH 2/2] Use a patient resource fixture with text in it. --- lib/tests/suites/read_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tests/suites/read_test.rb b/lib/tests/suites/read_test.rb index b408b369..14ae644b 100644 --- a/lib/tests/suites/read_test.rb +++ b/lib/tests/suites/read_test.rb @@ -24,7 +24,7 @@ def setup rescue # try to create a patient begin - @patient = @client.create(@resources.minimal_patient).resource + @patient = @client.create(@resources.example_patient).resource @patient_created = true rescue @patient = nil