class Crucible::Tests::ConnectathonPatientTrackTest
Public Class Methods
new(client1, client2=nil)
click to toggle source
Calls superclass method
Crucible::Tests::BaseTest::new
# File lib/tests/suites/connectathon_patient_track.rb, line 13 def initialize(client1, client2=nil) super(client1, client2) @tags.append('connectathon') @category = {id: 'connectathon', title: 'Connectathon'} end
Public Instance Methods
check_sort_order(entries)
click to toggle source
# File lib/tests/suites/connectathon_patient_track.rb, line 299 def check_sort_order(entries) entries.each_cons(2) do |left, right| assert !left.resource.meta.nil?, 'Unable to determine if entries are in the correct order -- no meta' assert !right.resource.meta.nil?, 'Unable to determine if entries are in the correct order -- no meta' if !left.resource.meta.versionId.nil? && !right.resource.meta.versionId.nil? assert (left.resource.meta.versionId > right.resource.meta.versionId), 'Result contains entries in the wrong order.' elsif !left.resource.meta.lastUpdated.nil? && !right.resource.meta.lastUpdated.nil? assert (left.resource.meta.lastUpdated >= right.resource.meta.lastUpdated), 'Result contains entries in the wrong order.' else raise AssertionException.new 'Unable to determine if entries are in the correct order -- no meta.versionId or meta.lastUpdated' end end end
description()
click to toggle source
# File lib/tests/suites/connectathon_patient_track.rb, line 9 def description 'Connectathon Patient Track tests: registering, updating, history, and search' end
id()
click to toggle source
# File lib/tests/suites/connectathon_patient_track.rb, line 5 def id 'Connectathon Patient Track' end
setup()
click to toggle source
# File lib/tests/suites/connectathon_patient_track.rb, line 19 def setup @resources = Crucible::Generator::Resources.new @patient = @resources.example_patient @patient.id = nil # clear the identifier, in case the server checks for duplicates @patient.identifier = nil # clear the identifier, in case the server checks for duplicates @patient_us = @resources.example_patient_us @patient_us.id = nil # clear the identifier, in case the server checks for duplicates @patient_us.identifier = nil # clear the identifier, in case the server checks for duplicates end
teardown()
click to toggle source
# File lib/tests/suites/connectathon_patient_track.rb, line 31 def teardown @client.destroy(FHIR::Patient, @patient_id) if !@patient_id.nil? @client.destroy(FHIR::Patient, @patient_us_id) if !@patient_us_id.nil? end