Generated Narrative: TestScript 02-Search-for-a-Consent Profile: AEGIS Touchstone Testing TestScript Profile AEGIS Touchstone Testing TestScript Rule Extension ruleId: AssertBodyExists path: /FHIRCommon/_reference/rule/AssertBodyExists.groovy StructureDefinition Work Group: cbcc url: TestScript 01 Read Simple Search - All SUT | 02 Search for a Consent version: 1.0.0-ballot name: Test_02_Search_for_a_Consent title: 01 Read Simple Search - All SUT | 02 Search for a Consent status: Active date: 2026-03-30 publisher: HL7 International / Community Based Collaborative Care contact: HL7 International / Community Based Collaborative Care: http://www.hl7.org/Special/committees/cbcc description: Test a client and server to verify support for the Consent search interaction and the return of at least one valid Consent resource conforming to the FASTConsent profile. This scenario is generic and can be used with any FHIR format and query parameters. Test case supporting the FAST Consent Management IG Version: CI. See https://wildfhir4.wildfhir.org/ig/fhir-consent-management-tg/rtm_test_cases.html#testcase-2 Test System Details (in order of appearance): [Origin 1: Consent Client's RESTful client. System Under Test: this must be an external test system (not Touchstone).] [Destination 1: Consent Admin Service's RESTful FHIR Server. System Under Test: this must be an external test system (not a mock).] jurisdiction: United States of America copyright: (c) AEGIS.net, Inc. 2026 Origins - Index Profile * 1 Test script profile origin type: FHIR-Client (FHIR Client) Destinations - Index Profile * 1 Test script profile destination type: FHIR-Server (FHIR Server) profile: http://hl7.org/fhir/StructureDefinition/Bundle test name: Step_001_Consent_search description: Consent Client searches for Consent resources at Consent Admin Service. action Operations - Type Resource Description Destination EncodeRequestUrl Origin RequestId ResponseId * Test script operation code: search (Search) Consent Search for Consent resources. 1 true 1 dest-1-FHIRSearch-1-request dest-1-FHIRSearch-1-response action Asserts - Extension Description Direction Operator ResponseCode SourceId WarningOnly * Confirm that the returned HTTP status is 200 OK. response in 200 dest-1-FHIRSearch-1-response false action Asserts - Extension Description Direction WarningOnly * Confirm that the response body exists. response false action Asserts - Extension Description Direction Resource WarningOnly * Confirm that the response resource type is Bundle. response Bundle false action Asserts - Extension Description Direction ValidateProfileId WarningOnly * Confirm that the response Bundle conforms to the base FHIR Bundle profile. This also validates the contents against any declared profiles. response Bundle-profile false action Asserts - Extension Description Direction Expression Operator Value WarningOnly * Confirm that the response Bundle type is searchset. response Bundle.type equals searchset false action Asserts - Extension Description Direction Expression Operator SourceId Value WarningOnly * Confirm that at least one Consent resource is in the response. response Bundle.entry.select(resource as Consent).exists() equals dest-1-FHIRSearch-1-response true false action Asserts - Extension Description Direction Expression Operator SourceId Value WarningOnly * Confirm that at least one Consent resource in the response declares the FASTConsent profile. response Bundle.entry.select(resource as Consent).where('http://hl7.org/fhir/us/consent-management/StructureDefinition/FASTConsent' in meta.profile).exists() equals dest-1-FHIRSearch-1-response true false
01 Read Simple Search - All SUT | 02 Search for a Consent
HL7 International / Community Based Collaborative Care
Test a client and server to verify support for the Consent search interaction and the return of at least one valid Consent resource conforming to the FASTConsent profile. This scenario is generic and can be used with any FHIR format and query parameters. Test case supporting the FAST Consent Management IG Version: CI. See https://wildfhir4.wildfhir.org/ig/fhir-consent-management-tg/rtm_test_cases.html#testcase-2 Test System Details (in order of appearance): [Origin 1: Consent Client's RESTful client. System Under Test: this must be an external test system (not Touchstone).] [Destination 1: Consent Admin Service's RESTful FHIR Server. System Under Test: this must be an external test system (not a mock).]
Consent Client searches for Consent resources at Consent Admin Service.
Confirm that the returned HTTP status is 200 OK.
Confirm that the response resource type is Bundle.
Confirm that the response Bundle conforms to the base FHIR Bundle profile. This also validates the contents against any declared profiles.
Confirm that the response Bundle type is searchset.
Confirm that at least one Consent resource is in the response.
Bundle.entry.select(resource as Consent).exists()
Confirm that at least one Consent resource in the response declares the FASTConsent profile.
Bundle.entry.select(resource as Consent).where('http://hl7.org/fhir/us/consent-management/StructureDefinition/FASTConsent' in meta.profile).exists()