generated from inferno-framework/inferno-template
-
Notifications
You must be signed in to change notification settings - Fork 0
2. Create a new search test
Elsa Perelli edited this page Oct 23, 2024
·
17 revisions
Let's say we're implementing the US Core version 3.1.1 implementation guide. The inferno-template test kit already includes a Patient search test and a validation test for us to start with. Looking at the US Core IG Condition profile, we see that Condition search by Patient is a SHALL requirement.
Our goal is to add a test that searches for Conditions that pertain to the Patient we already searched for. After performing this search, we want to assert the following:
-
httpresponse is200 - search result is a
resourceTypeofBundle - search result is a valid FHIR resource
- Inferno Framework Search Method DSL definition
- Inferno Framework Assertions overview
- Inferno Framework Assertions DSL definition
group do
id :search_tests
title 'Search Tests'
input :patient_id
test do
title 'Condition Search by Patient'
run do
fhir_search('Condition', params: { patient: patient_id })
assert_response_status(200)
assert_resource_type('Bundle')
assert_valid_bundle_entries()
end
end
endlink to the diff between step-2 and step-2-solution branches: https://github.com/inferno-training/inferno-tutorial/compare/step-2...step-2-solution