Skip to content

Commit

Permalink
Fix group generator so that search test generator does not exclude Pa…
Browse files Browse the repository at this point in the history
…tient, Practitioner, Organization, and Related Person resource. Creates the id and lastUpdated test for all of these resources and makes lastUpdated optional
  • Loading branch information
emichaud998 committed Oct 31, 2023
1 parent 2dd956c commit d98d926
Show file tree
Hide file tree
Showing 34 changed files with 748 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@
:file_name: organization_validation_test.rb
- :id: c4bb_v200devnonfinancial_organization_must_support_test
:file_name: organization_must_support_test.rb
- :id: c4bb_v200devnonfinancial_organization__id_search_test
:file_name: organization_id_search_test.rb
- :id: c4bb_v200devnonfinancial_organization__lastUpdated_search_test
:file_name: organization_lastupdated_search_test.rb
:id: c4bb_v200devnonfinancial_organization
:file_name: organization_group.rb
:delayed_references: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
require_relative '../../../carin_search_test'
require_relative '../../../generator/group_metadata'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
class OrganizationIdSearchTest < Inferno::Test
include CarinForBlueButtonTestKit::CarinSearchTest

title 'Server returns valid results for Organization search by _id'
description %(
A server SHALL support searching by
_id on the Organization resource. This test
will pass if resources are returned and match the search criteria. If
none are returned, the test is skipped.
Because this is the first search of the sequence, resources in the
response will be used for subsequent tests.
Additionally, this test will check that GET and POST search methods
return the same number of results. Search by POST is required by the
FHIR R4 specification, and these tests interpret search by GET as a
requirement of CARIN IG for Blue Button® v2.0.0-dev-nonfinancial.
)

id :c4bb_v200devnonfinancial_organization__id_search_test

input :c4bb_v200devnonfinancial_organization__id_search_test_param,
title: 'Organization search parameter for _id
',
type: 'text',
description: 'Organization search parameter: _id
'

def self.properties
@properties ||= SearchTestProperties.new(
first_search: true,
resource_type: 'Organization',
search_param_names: ['_id'],
test_post_search: true
)
end

def self.metadata
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
end

def scratch_resources
scratch[:organization_resources] ||= {}
end

run do
run_search_test(c4bb_v200devnonfinancial_organization__id_search_test_param)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
require_relative '../../../carin_search_test'
require_relative '../../../generator/group_metadata'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
class OrganizationLastupdatedSearchTest < Inferno::Test
include CarinForBlueButtonTestKit::CarinSearchTest

title 'Server returns valid results for Organization search by _lastUpdated'
description %(
A server SHOULD support searching by
_lastUpdated on the Organization resource. This test
will pass if resources are returned and match the search criteria. If
none are returned, the test is skipped.
)

id :c4bb_v200devnonfinancial_organization__lastUpdated_search_test
optional


input :c4bb_v200devnonfinancial_organization__lastUpdated_search_test_param,
title: 'Organization search parameter for _lastUpdated
',
type: 'text',
description: 'Organization search parameter: _lastUpdated
',
optional: true

def self.properties
@properties ||= SearchTestProperties.new(
resource_type: 'Organization',
search_param_names: ['_lastUpdated']
)
end

def self.metadata
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
end

def scratch_resources
scratch[:organization_resources] ||= {}
end

run do
run_search_test(c4bb_v200devnonfinancial_organization__lastUpdated_search_test_param)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require_relative 'organization/organization_read_test'
require_relative 'organization/organization_validation_test'
require_relative 'organization/organization_must_support_test'
require_relative 'organization/organization_id_search_test'
require_relative 'organization/organization_lastupdated_search_test'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
Expand Down Expand Up @@ -75,6 +77,8 @@ def self.metadata
test from: :c4bb_v200devnonfinancial_organization_read_test
test from: :c4bb_v200devnonfinancial_organization_validation_test
test from: :c4bb_v200devnonfinancial_organization_must_support_test
test from: :c4bb_v200devnonfinancial_organization__id_search_test
test from: :c4bb_v200devnonfinancial_organization__lastUpdated_search_test
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@
:file_name: patient_validation_test.rb
- :id: c4bb_v200devnonfinancial_patient_must_support_test
:file_name: patient_must_support_test.rb
- :id: c4bb_v200devnonfinancial_patient__id_search_test
:file_name: patient_id_search_test.rb
- :id: c4bb_v200devnonfinancial_patient__lastUpdated_search_test
:file_name: patient_lastupdated_search_test.rb
:id: c4bb_v200devnonfinancial_patient
:file_name: patient_group.rb
:delayed_references: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
require_relative '../../../carin_search_test'
require_relative '../../../generator/group_metadata'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
class PatientIdSearchTest < Inferno::Test
include CarinForBlueButtonTestKit::CarinSearchTest

title 'Server returns valid results for Patient search by _id'
description %(
A server SHALL support searching by
_id on the Patient resource. This test
will pass if resources are returned and match the search criteria. If
none are returned, the test is skipped.
Because this is the first search of the sequence, resources in the
response will be used for subsequent tests.
Additionally, this test will check that GET and POST search methods
return the same number of results. Search by POST is required by the
FHIR R4 specification, and these tests interpret search by GET as a
requirement of CARIN IG for Blue Button® v2.0.0-dev-nonfinancial.
)

id :c4bb_v200devnonfinancial_patient__id_search_test

input :c4bb_v200devnonfinancial_patient__id_search_test_param,
title: 'Patient search parameter for _id
',
type: 'text',
description: 'Patient search parameter: _id
'

def self.properties
@properties ||= SearchTestProperties.new(
first_search: true,
resource_type: 'Patient',
search_param_names: ['_id'],
test_post_search: true
)
end

def self.metadata
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
end

def scratch_resources
scratch[:patient_resources] ||= {}
end

run do
run_search_test(c4bb_v200devnonfinancial_patient__id_search_test_param)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
require_relative '../../../carin_search_test'
require_relative '../../../generator/group_metadata'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
class PatientLastupdatedSearchTest < Inferno::Test
include CarinForBlueButtonTestKit::CarinSearchTest

title 'Server returns valid results for Patient search by _lastUpdated'
description %(
A server SHOULD support searching by
_lastUpdated on the Patient resource. This test
will pass if resources are returned and match the search criteria. If
none are returned, the test is skipped.
)

id :c4bb_v200devnonfinancial_patient__lastUpdated_search_test
optional


input :c4bb_v200devnonfinancial_patient__lastUpdated_search_test_param,
title: 'Patient search parameter for _lastUpdated
',
type: 'text',
description: 'Patient search parameter: _lastUpdated
',
optional: true

def self.properties
@properties ||= SearchTestProperties.new(
resource_type: 'Patient',
search_param_names: ['_lastUpdated']
)
end

def self.metadata
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
end

def scratch_resources
scratch[:patient_resources] ||= {}
end

run do
run_search_test(c4bb_v200devnonfinancial_patient__lastUpdated_search_test_param)
end
end
end
end
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require_relative 'patient/patient_read_test'
require_relative 'patient/patient_validation_test'
require_relative 'patient/patient_must_support_test'
require_relative 'patient/patient_id_search_test'
require_relative 'patient/patient_lastupdated_search_test'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
Expand Down Expand Up @@ -75,6 +77,8 @@ def self.metadata
test from: :c4bb_v200devnonfinancial_patient_read_test
test from: :c4bb_v200devnonfinancial_patient_validation_test
test from: :c4bb_v200devnonfinancial_patient_must_support_test
test from: :c4bb_v200devnonfinancial_patient__id_search_test
test from: :c4bb_v200devnonfinancial_patient__lastUpdated_search_test
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
:file_name: practitioner_validation_test.rb
- :id: c4bb_v200devnonfinancial_practitioner_must_support_test
:file_name: practitioner_must_support_test.rb
- :id: c4bb_v200devnonfinancial_practitioner__id_search_test
:file_name: practitioner_id_search_test.rb
- :id: c4bb_v200devnonfinancial_practitioner__lastUpdated_search_test
:file_name: practitioner_lastupdated_search_test.rb
:id: c4bb_v200devnonfinancial_practitioner
:file_name: practitioner_group.rb
:delayed_references: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
require_relative '../../../carin_search_test'
require_relative '../../../generator/group_metadata'

module CarinForBlueButtonTestKit
module CARIN4BBV200DEVNONFINANCIAL
class PractitionerIdSearchTest < Inferno::Test
include CarinForBlueButtonTestKit::CarinSearchTest

title 'Server returns valid results for Practitioner search by _id'
description %(
A server SHALL support searching by
_id on the Practitioner resource. This test
will pass if resources are returned and match the search criteria. If
none are returned, the test is skipped.
Because this is the first search of the sequence, resources in the
response will be used for subsequent tests.
Additionally, this test will check that GET and POST search methods
return the same number of results. Search by POST is required by the
FHIR R4 specification, and these tests interpret search by GET as a
requirement of CARIN IG for Blue Button® v2.0.0-dev-nonfinancial.
)

id :c4bb_v200devnonfinancial_practitioner__id_search_test

input :c4bb_v200devnonfinancial_practitioner__id_search_test_param,
title: 'Practitioner search parameter for _id
',
type: 'text',
description: 'Practitioner search parameter: _id
'

def self.properties
@properties ||= SearchTestProperties.new(
first_search: true,
resource_type: 'Practitioner',
search_param_names: ['_id'],
test_post_search: true
)
end

def self.metadata
@metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
end

def scratch_resources
scratch[:practitioner_resources] ||= {}
end

run do
run_search_test(c4bb_v200devnonfinancial_practitioner__id_search_test_param)
end
end
end
end
Loading

0 comments on commit d98d926

Please sign in to comment.