-
Notifications
You must be signed in to change notification settings - Fork 3
FQM-306: Verify server does not require billing options extension #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0b5e9db
add test to verify server does not require billing options extension
Jammjammjamm 303afa4
add spec for billing options test
Jammjammjamm 4ab4378
update group title/description
Jammjammjamm 1b45d9d
add requirement mapping
Jammjammjamm 990502f
regenerate coverage csv
Jammjammjamm 05d78cf
fix purple error in cross-hook test
Jammjammjamm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
lib/davinci_crd_test_kit/requirements/generated/crd_server_v221_requirements_coverage.csv
This file contains hidden or 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 hidden or 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
43 changes: 43 additions & 0 deletions
43
...rd_test_kit/server/v2.2.1/verify_response/verify_response_without_billing_options_test.rb
This file contains hidden or 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,43 @@ | ||
| require_relative '../../server_hook_helper' | ||
| require_relative '../../../cross_suite/tags' | ||
|
|
||
| module DaVinciCRDTestKit | ||
| module V221 | ||
| class VerifyResponseWithoutBillingOptionsTest < Inferno::Test | ||
| include DaVinciCRDTestKit::ServerHookHelper | ||
|
|
||
| title 'Server does not require Billing Options Extension' | ||
| id :verify_response_without_billing_options | ||
| description <<~DESCRIPTION | ||
| The IG states that, "CRD servers **SHALL NOT** depend on the | ||
| billing-options extension being present in order to provide a response." | ||
|
|
||
| This test verifies that a successful response was received for a request | ||
| without any billing-options extensions. | ||
| DESCRIPTION | ||
|
|
||
| verifies_requirements 'hl7.fhir.us.davinci-crd_2.2.1@billopt-2' | ||
|
|
||
| BILLING_OPTIONS_URL = 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/ext-billing-options'.freeze | ||
|
|
||
| run do | ||
| ALL_HOOK_TAGS.each do |tag| | ||
| load_tagged_requests(tag) | ||
| end | ||
|
|
||
| skip_if requests.blank?, 'No requests were made in a previous test as expected.' | ||
|
|
||
| successful_requests = requests.select { |request| request.status == 200 } | ||
| skip_if successful_requests.empty?, 'All service requests were unsuccessful.' | ||
|
|
||
| requests_without_billing_options = | ||
| successful_requests.reject { |request| request.request_body.include? BILLING_OPTIONS_URL } | ||
|
|
||
| skip_if requests_without_billing_options.blank?, | ||
| 'All successful requests included the billing options extension. ' \ | ||
| 'Provide service call inputs which do not include the billing options extension ' \ | ||
| 'to verify that the server does not require the extension.' | ||
| end | ||
| end | ||
| end | ||
| end |
126 changes: 126 additions & 0 deletions
126
spec/davinci_crd_test_kit/v2.2.1/verify_response_without_billing_options_test_spec.rb
This file contains hidden or 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,126 @@ | ||
| RSpec.describe DaVinciCRDTestKit::V221::VerifyResponseWithoutBillingOptionsTest do | ||
| let(:suite_id) { 'crd_server_v221' } | ||
| let(:result) { repo_create(:result, test_session_id: test_session.id) } | ||
| let(:runnable) { described_class } | ||
| let(:appointment) { { resourceType: 'Appointment' } } | ||
| let(:appointment_with_coverage_info) do | ||
| appointment.merge( | ||
| extension: [ | ||
| { url: 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/ext-coverage-information' } | ||
| ] | ||
| ) | ||
| end | ||
|
|
||
| it 'passes if a successful request without a billing options extension has been made' do | ||
| bundle = FHIR::Bundle.new( | ||
| entry: [ | ||
| { | ||
| resource: FHIR::Appointment.new(appointment) | ||
| } | ||
| ] | ||
| ) | ||
|
|
||
| request_body = { context: { appointments: bundle.to_hash } }.to_json | ||
|
|
||
| repo_create( | ||
| :request, | ||
| direction: 'outgoing', | ||
| test_session_id: test_session.id, | ||
| result:, | ||
| request_body:, | ||
| response_body: '', | ||
| tags: [DaVinciCRDTestKit::APPOINTMENT_BOOK_TAG], | ||
| status: 200 | ||
| ) | ||
|
|
||
| result = run(runnable) | ||
|
|
||
| expect(result.result).to eq('pass'), result.result_message | ||
| end | ||
|
|
||
| it 'skips if no requests could be found' do | ||
| result = run(runnable) | ||
|
|
||
| expect(result.result).to eq('skip'), result.result_message | ||
| expect(result.result_message).to match(/No requests were made/) | ||
| end | ||
|
|
||
| it 'skips if no successful requests were made' do | ||
| bundle = FHIR::Bundle.new( | ||
| entry: [ | ||
| { | ||
| resource: FHIR::Appointment.new(appointment) | ||
| } | ||
| ] | ||
| ) | ||
|
|
||
| request_body = { context: { appointments: bundle.to_hash } }.to_json | ||
|
|
||
| repo_create( | ||
| :request, | ||
| direction: 'outgoing', | ||
| test_session_id: test_session.id, | ||
| result:, | ||
| request_body:, | ||
| response_body: '', | ||
| tags: [DaVinciCRDTestKit::APPOINTMENT_BOOK_TAG], | ||
| status: 500 | ||
| ) | ||
|
|
||
| result = run(runnable) | ||
|
|
||
| expect(result.result).to eq('skip'), result.result_message | ||
| expect(result.result_message).to match(/were unsuccessful/) | ||
| end | ||
|
|
||
| it 'skips if all successful requests contain the billing options extension' do | ||
| appointment.merge!( | ||
| serviceType: [ | ||
| { | ||
| coding: [ | ||
| { | ||
| code: 'ABC' | ||
| } | ||
| ], | ||
| extension: [ | ||
| { | ||
| url: 'http://hl7.org/fhir/us/davinci-crd/StructureDefinition/ext-billing-options', | ||
| valueCodeableConcept: { | ||
| coding: [ | ||
| { | ||
| code: 'DEF' | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| ) | ||
| bundle = FHIR::Bundle.new( | ||
| entry: [ | ||
| { | ||
| resource: FHIR::Appointment.new(appointment) | ||
| } | ||
| ] | ||
| ) | ||
|
|
||
| request_body = { context: { appointments: bundle.to_hash } }.to_json | ||
|
|
||
| repo_create( | ||
| :request, | ||
| direction: 'outgoing', | ||
| test_session_id: test_session.id, | ||
| result:, | ||
| request_body:, | ||
| response_body: '', | ||
| tags: [DaVinciCRDTestKit::APPOINTMENT_BOOK_TAG], | ||
| status: 200 | ||
| ) | ||
|
|
||
| result = run(runnable) | ||
|
|
||
| expect(result.result).to eq('skip'), result.result_message | ||
| expect(result.result_message).to match(/All successful requests included the billing options extension/) | ||
| end | ||
| end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this causes a 'purple error' due to this line https://github.com/inferno-framework/davinci-crd-test-kit/blame/fa44599cbc460698e0b8f48c4ae26cdab987357f/lib/davinci_crd_test_kit/server/server_test_helper.rb#L10