diff --git a/lib/resource_generator.rb b/lib/resource_generator.rb index aeb3958..0b3fac5 100644 --- a/lib/resource_generator.rb +++ b/lib/resource_generator.rb @@ -249,7 +249,7 @@ def self.minimal_humanname(name='Name', namespace = FHIR) hn = namespace.const_get(:HumanName).new hn.use = 'official' hn.family = 'Crucible' - hn.given = [ name ] + hn.given = [ name ] if name.present? hn.text = "#{hn.given[0]} #{hn.family}" hn end diff --git a/lib/tests/suites/connectathon_care_plan_track.rb b/lib/tests/suites/connectathon_care_plan_track.rb index 801059f..5337b42 100644 --- a/lib/tests/suites/connectathon_care_plan_track.rb +++ b/lib/tests/suites/connectathon_care_plan_track.rb @@ -37,7 +37,7 @@ def setup # Create some cancer-category care plans @num_cancer_care_plans = rand(1..3) @cancer_care_plan_category = FHIR::STU3::CodeableConcept.new(text: "Cancer care plan") - @cancer_care_plan_category.coding = FHIR::STU3::Coding.new(code: "395082007", system: "http://snomed.info/sct", display: "Cancer care plan") + @cancer_care_plan_category.coding = [FHIR::STU3::Coding.new(code: "395082007", system: "http://snomed.info/sct", display: "Cancer care plan")] @num_cancer_care_plans.times do |t| care_plan = @resources.generate(FHIR::STU3::CarePlan, 3) care_plan.subject = patient.to_reference @@ -129,7 +129,7 @@ def teardown reply.resource.entry.each do |entry| assert entry.resource.subject.equals?(@records["patient"].to_reference), "care plan #{entry.resource.id} subject ID doesn't match given subject ID #{@records["patient"].to_reference}" - assert entry.resource.category.first.coding.first.equals?(@cancer_care_plan_category.coding), "care plan category code doesn't match cancer category code #{@cancer_care_plan_category} (#{entry.resource.category.first.coding.first.mismatch(@cancer_care_plan_category.coding)})" + assert entry.resource.category.first.coding.first.equals?(@cancer_care_plan_category.coding.first), "care plan category code doesn't match cancer category code #{@cancer_care_plan_category} (#{entry.resource.category.first.coding.first.mismatch(@cancer_care_plan_category.coding.first)})" end end