Skip to content
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

FI-2325: Check fhirContext #56

Merged
merged 4 commits into from
Dec 5, 2023
Merged

FI-2325: Check fhirContext #56

merged 4 commits into from
Dec 5, 2023

Conversation

emichaud998
Copy link
Contributor

Summary

fhirContext is optional in SMART app launch, but we still want to validate its format when it is present. This PR adds a validation function in the smart_token_response_body test to validate the fhirContext if it is present.

Testing Guidance

spec tests for the fhirContext tests have been added and they can be ran to test this PR by running bundle exec rspec spec/smart_app_launch/token_response_body_test_spec.rb and making sure all the tests pass. Can also run Inferno locally and test in browser to make sure fhirContext tests work as expected.

it 'fails if fhirContext is not an Array'
it 'passes if fhirContext valid' do
numericalElement = 123
body = valid_body.merge(fhirContext: ["Organization/123", "DiagnosticReport/123"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you include a version-specific reference here as well?

http://hl7.org/fhir/R4/references.html#literal

@emichaud998 emichaud998 merged commit e08d513 into main Dec 5, 2023
2 checks passed
@emichaud998 emichaud998 deleted the fi-2325-check-fhir-context branch December 5, 2023 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants