Scalable Consent Management Testing Guide
1.0.0-ballot - ci-build United States of America flag

Scalable Consent Management Testing Guide - Local Development build (v1.0.0-ballot) built by the FHIR (HL7® FHIR® Standard) Build Tools. See the Directory of published versions

TestScript: 04 Basic REST-hook Subs - All SUT | 02 Create subscription then handshake

Official URL: http://hl7.org/fhir/us/consent-management-tg/TestScript/02-Create-subscription-then-handshake Version: 1.0.0-ballot
Standards status: Trial-use Maturity Level: 1 Computable Name: Test_02_Create_subscription_then_handshake

Copyright/Legal: (c) AEGIS.net, Inc. 2026

Alternate success: Create a Subscriptions R5 Backport REST-hook Subscription followed by a handshake. Test a client and server to verify support for POST of a REST-hook Subscription. This scenario includes the optional step of the Consent Server sending a handshake. 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-232 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).] [Origin 2: Consent Admin Service's Subscription REST-hook notification sender. System Under Test: this must be an external test system (not Touchstone).] [Destination 2: Consent Client's Subscription REST-hook notification endpoint. System Under Test: this must be an external test system (not a mock).]

AEGIS Touchstone Testing TestScript Rule Extension

  • ruleId: AssertBodyExists
  • path: /FHIRCommon/_reference/rule/AssertBodyExists.groovy

StructureDefinition Work Group: cbcc

url: TestScript 04 Basic REST-hook Subs - All SUT | 02 Create subscription then handshake

version: 1.0.0-ballot

name: Test_02_Create_subscription_then_handshake

title: 04 Basic REST-hook Subs - All SUT | 02 Create subscription then handshake

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:

Alternate success: Create a Subscriptions R5 Backport REST-hook Subscription followed by a handshake. Test a client and server to verify support for POST of a REST-hook Subscription. This scenario includes the optional step of the Consent Server sending a handshake. 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-232 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).] [Origin 2: Consent Admin Service's Subscription REST-hook notification sender. System Under Test: this must be an external test system (not Touchstone).] [Destination 2: Consent Client's Subscription REST-hook notification endpoint. System Under Test: this must be an external test system (not a mock).]

jurisdiction: United States of America

copyright:

(c) AEGIS.net, Inc. 2026

origin

index: 1

profile: Test script profile origin type: FHIR-Client (FHIR Client)

origin

index: 2

profile: Test script profile origin type: FHIR-Client (FHIR Client)

destination

index: 1

profile: Test script profile destination type: FHIR-Server (FHIR Server)

destination

index: 2

profile: Test script profile destination type: FHIR-Server (FHIR Server)

profile:

Variables

-NameDescriptionHint
*dest-2-FHIRR5BackportNotification-1-needed-notification-endpointConsent Client's 's REST Hook Subscription notification endpoint, available at Destination 2.[Enter Consent Client's 's REST Hook Subscription notification endpoint, available at Destination 2]

test

name: Step_001_POST_Subscription_create

description: Consent Client creates with POST a Subscription resource at Consent Admin Service.

action

Operations

-TypeResourceDescriptionDestinationEncodeRequestUrlMethodOriginRequestIdResponseIdUrl
*Test script operation code: create (Create)SubscriptionCreate a Subscription resource.1truePOST1dest-1-FHIRCreate-1-requestdest-1-FHIRCreate-1-response${dest1SystemConfig.baseUrl}/Subscription

action

Asserts

-ExtensionDescriptionDirectionWarningOnly
*Confirm that the request body exists.requestfalse

action

Asserts

-ExtensionDescriptionDirectionResourceWarningOnly
*Confirm that the request body is a Subscription resource.requestSubscriptionfalse

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Confirm that the request body conforms to the base FHIR Subscription profile. This also checks any declared profiles within.requestSubscription-profilefalse

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeSourceIdWarningOnly
*Confirm that the returned HTTP status is 201 Created.responsein201dest-1-FHIRCreate-1-responsefalse

action

Asserts

-ExtensionDescriptionDirectionWarningOnly
*Confirm that the response body exists.responsefalse

action

Asserts

-ExtensionDescriptionDirectionResourceWarningOnly
*Confirm that the response body is a Subscription resource.responseSubscriptiontrue

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Confirm that the response body conforms to the base FHIR Subscription profile. This also checks any declared profiles within.responseSubscription-profiletrue

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorSourceIdValueWarningOnly
*Confirm that the request body is a Subscription resource that should declare the FASTSubscription profile.requestSubscription.meta.profile contains 'https://hl7.org/fhir/us/consent-management/StructureDefinition/FASTSubscription'equalsdest-1-FHIRCreate-1-requesttruetrue

action

Asserts

-ExtensionDescriptionDirectionExpressionValidateProfileIdWarningOnly
*Confirm that the resource(s) in the request body at FHIRPath 'Subscription' should conform to profile 'FASTSubscription'.requestSubscriptionFASTSubscriptiontrue

test

name: Step_002_Send_Subscription_notification

description: Consent Admin Service sends a Subscription notification to Consent Client's notification endpoint.

action

operation

type: AEGIS Touchstone Testing FHIR Operation Codes: post (POST)

resource: Bundle

description: POST a Subscriptions R5 Backport REST-hook Notification Bundle.

contentType: json

destination: 2

encodeRequestUrl: true

method: POST

origin: 2

RequestHeaders

-FieldValue
*Authorizationnone

requestId: dest-2-FHIRR5BackportNotification-1-request

responseId: dest-2-FHIRR5BackportNotification-1-response

url: ${dest-2-FHIRR5BackportNotification-1-needed-notification-endpoint}

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeSourceIdWarningOnly
*Confirm that the returned HTTP status is 200 OK.responsein200dest-2-FHIRR5BackportNotification-1-responsefalse

action

Asserts

-ExtensionDescriptionDirectionWarningOnly
*Confirm that the request body exists.requestfalse

action

Asserts

-ExtensionDescriptionDirectionResourceWarningOnly
*Confirm that the request resource type is Bundle.requestBundlefalse

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Confirm that the request Bundle conforms to the base FHIR Bundle profile. This also validates the contents against any declared profiles.requestBundle-profilefalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*Confirm that the request Bundle type is history.requestBundle.typeequalshistoryfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionWarningOnly
*Confirm that the request Bundle declares the backport-subscription-notification-r4 profile.requestBundle.where('http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription-notification-r4' in meta.profile).exists()false

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorSourceIdValueWarningOnly
*Confirm that the Notification type is handshake.requestBundle.entry.resource.ofType(Parameters).parameter.where(name='type').value = 'handshake'equalsdest-2-FHIRR5BackportNotification-1-requesttruefalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorSourceIdValueWarningOnly
*Confirm that every Consent resource in the request declares the FASTConsent profile.requestBundle.entry.resource.where(resourceType = 'Consent').all('https://hl7.org/fhir/us/consent-management/StructureDefinition/FASTConsent' in meta.profile)equalsdest-2-FHIRR5BackportNotification-1-requesttruefalse