-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from inferno-framework/fi-3336-us-core-tests
Add USCore 3.1.1 test group, CRD profile tests
- Loading branch information
Showing
31 changed files
with
1,397 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
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
29 changes: 29 additions & 0 deletions
29
lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_read.rb
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,29 @@ | ||
require_relative '../../read_test' | ||
|
||
module DaVinciDTRTestKit | ||
class CommunicationRequestReadTest < Inferno::Test | ||
include DaVinciDTRTestKit::ReadTest | ||
|
||
title 'Server returns correct CommunicationRequest resource from CommunicationRequest read interaction' | ||
description 'A server SHOULD support the CommunicationRequest read interaction.' | ||
|
||
id :communication_request_read | ||
output :communication_request_resources | ||
|
||
def resource_type | ||
'CommunicationRequest' | ||
end | ||
|
||
def communication_request_id_list | ||
return [nil] unless respond_to? :communication_request_ids | ||
|
||
communication_request_ids.split(',').map(&:strip) | ||
end | ||
|
||
run do | ||
resources = perform_read_test(communication_request_id_list, resource_type) | ||
|
||
output communication_request_resources: resources.to_json | ||
end | ||
end | ||
end |
33 changes: 33 additions & 0 deletions
33
lib/davinci_dtr_test_kit/profiles/communication_request/communication_request_validation.rb
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,33 @@ | ||
require_relative '../../validation_test' | ||
|
||
module DaVinciDTRTestKit | ||
class CommunicationRequestValidationTest < Inferno::Test | ||
include DaVinciDTRTestKit::ValidationTest | ||
|
||
title 'CommunicationRequest resources returned during previous tests conform to the CRD CommunicationRequest' | ||
description %( | ||
This test verifies resources returned from the first read conform to | ||
the [CRD CommunicationRequest](https://hl7.org/fhir/us/davinci-crd/STU2/StructureDefinition-profile-communicationrequest). | ||
Systems must demonstrate at least one valid example in order to pass this test. | ||
It verifies the presence of mandatory elements and that elements with | ||
required bindings contain appropriate values. CodeableConcept element | ||
bindings will fail if none of their codings have a code/system belonging | ||
to the bound ValueSet. Quantity, Coding, and code element bindings will | ||
fail if their code/system are not found in the valueset. | ||
) | ||
|
||
id :communication_request_validation | ||
input :communication_request_resources | ||
|
||
def resource_type | ||
'CommunicationRequest' | ||
end | ||
|
||
run do | ||
perform_profile_validation_test(communication_request_resources, resource_type, | ||
'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/profile-communicationrequest|2.0.1') | ||
end | ||
end | ||
end |
29 changes: 29 additions & 0 deletions
29
lib/davinci_dtr_test_kit/profiles/coverage/coverage_read.rb
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,29 @@ | ||
require_relative '../../read_test' | ||
|
||
module DaVinciDTRTestKit | ||
class CoverageReadTest < Inferno::Test | ||
include DaVinciDTRTestKit::ReadTest | ||
|
||
title 'Server returns correct Coverage resource from Coverage read interaction' | ||
description 'A server SHALL support the Coverage read interaction.' | ||
|
||
id :coverage_read | ||
output :coverage_resources | ||
|
||
def resource_type | ||
'Coverage' | ||
end | ||
|
||
def coverage_id_list | ||
return [nil] unless respond_to? :coverage_ids | ||
|
||
coverage_ids.split(',').map(&:strip) | ||
end | ||
|
||
run do | ||
resources = perform_read_test(coverage_id_list, resource_type) | ||
|
||
output coverage_resources: resources.to_json | ||
end | ||
end | ||
end |
Oops, something went wrong.