☰ Scenario Search for Procedures by Status 'completed' and Patient
When Get FHIR resource at "http://fhirserver/Procedure/?status=completed&patient=Patient/${data.medication-patient-id}" with content type "xml"
And FHIR current response body evaluates the FHIRPath 'entry.resource.count() > 0 and entry.resource.count() <= ${data.search-count}' with error message 'No valid search results were found'
INFO
entry.resource.count() > 0 and entry.resource.count() <= 20
["BooleanType[true]"]
And FHIR current response body evaluates the FHIRPath "entry.resource.all((status = 'completed').exists())" with error message 'There are search results, but they do not fully match the search criteria'
INFO
entry.resource.all((status = 'completed').exists())
["BooleanType[true]"]
And element "subject" in all bundle resources references resource with ID "${data.medication-patient-id}"
INFO
entry.resource.all(subject.reference.replaceMatches('/_history/.+','').matches('\\bPatient-Read-Example$'))
["BooleanType[true]"]
And response bundle contains resource with ID "${data.medication-procedure-id}" with error message "The requested Procedure ${data.medication-procedure-id} is not contained in the response bundle"
INFO
entry.resource.where(id.replaceMatches('/_history/.+','').matches('\\bProcedure-Read-Example$')).count() = 1
["BooleanType[true]"]