02-Obtain-server-CapabilityStatement-JSON
type: TestScript
node role: treeRoot
id:
  v: 02-Obtain-server-CapabilityStatement-JSON
meta:
  profile:
    v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript
    l: testscript
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: TestScript 02-Obtain-server-CapabilityStatement-JSON 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 00 Capabilities | 02 Obtain server CapabilityStatement - JSON version: 1.0.0-ballot name: Test_02_Obtain_server_CapabilityStatement_JSON title: 00 Capabilities | 02 Obtain server CapabilityStatement - JSON 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 single server to verify support for the capabilities interaction 'HTTP GET metadata' and the return of a valid CapabilityStatement resource supporting the FAST Consent Management IG Version: CI, using JSON syntax. Test System Details (in order of appearance): [Origin 1: Consent Client's RESTful client. System Under Test or Simulated: this can test an external test system, or choose Touchstone to simulate the client.] [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/CapabilityStatement test name: Step_001_Read_capabilities description: Consent Client reads server capabilities at Consent Admin Service. action operation type: Test script operation code: capabilities (Capabilities) description: Read a server's capabilities. accept: json destination: 1 encodeRequestUrl: true method: GET origin: 1 params: metadata RequestHeaders - Field Value * Accept appli…
extension:
  extension:
    url:
      v: ruleId
      l: ruleId
    value: Id
      v: AssertBodyExists
  extension:
    url:
      v: path
      l: path
    value: String
      v: /FHIRCommon/_reference/rule/AssertBodyExists.groovy
  url:
    v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule
    l: testscript-rule
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: cbcc
url:
  v: http://hl7.org/fhir/us/consent-management-tg/TestScript/02-Obtain-server-CapabilityStatement-JSON
  l: 02-Obtain-server-CapabilityStatement-JSON
version:
  v: 1.0.0-ballot
name:
  v: Test_02_Obtain_server_CapabilityStatement_JSON
title:
  v: 00 Capabilities | 02 Obtain server CapabilityStatement - JSON
status:
  v: active
date:
  v: 2026-03-30
publisher:
  v: HL7 International / Community Based Collaborative Care
contact:
  name:
    v: HL7 International / Community Based Collaborative Care
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/cbcc
description:
  v: Test a single server to verify support for the capabilities interaction 'HTTP GET metadata' and the return of a valid CapabilityStatement resource supporting the FAST Consent Management IG Version: CI, using JSON syntax. Test System Details (in order of appearance): [Origin 1: Consent Client's RESTful client. System Under Test or Simulated: this can test an external test system, or choose Touchstone to simulate the client.] [Destination 1: Consent Admin Service's RESTful FHIR Server. System Under Test: this must be an external test system (not a mock).]
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
    display:
      v: United States of America
copyright:
  v: (c) AEGIS.net, Inc. 2026
origin:
  index:
    v: 1
  profile:
    system:
      v: http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types
      l: testscript-profile-origin-types
    code:
      v: FHIR-Client
destination:
  index:
    v: 1
  profile:
    system:
      v: http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types
      l: testscript-profile-destination-types
    code:
      v: FHIR-Server
profile:
  l: CapabilityStatement
  id:
    v: CapabilityStatement-profile
  reference:
    v: http://hl7.org/fhir/StructureDefinition/CapabilityStatement
test:
  name:
    v: Step_001_Read_capabilities
  description:
    v: Consent Client reads server capabilities at Consent Admin Service.
  action:
    operation:
      description:
        v: Read a server's capabilities.
      accept:
        v: json
      destination:
        v: 1
      encode request url:
        v: true
      method:
        v: get
      origin:
        v: 1
      params:
        v: metadata
      request id:
        v: dest-1-FHIRCapabilities-1-request
      response id:
        v: dest-1-FHIRCapabilities-1-response
  action:
    assert:
      extension:
        value: Boolean
      description:
        v: Confirm that the returned HTTP status is 200 OK.
      direction:
        v: response
      operator:
        v: in
      response code:
        v: 200
      source id:
        v: dest-1-FHIRCapabilities-1-response
      warning only:
        v: false
  action:
    assert:
      description:
        v: Confirm that the response body exists.
      direction:
        v: response
      warning only:
        v: false
  action:
    assert:
      description:
        v: Confirm that the response format is the FHIR JSON format.
      direction:
        v: response
      content type:
        v: json
      warning only:
        v: false
  action:
    assert:
      extension:
        value: Boolean
      description:
        v: Confirm that the response body is a CapabilityStatement resource.
      direction:
        v: response
      resource:
        v: CapabilityStatement
      warning only:
        v: false
  action:
    assert:
      extension:
        value: Boolean
      description:
        v: Confirm that the response body conforms to the base FHIR CapabilityStatement profile. This also checks any declared profiles within.
      direction:
        v: response
      validate profile id:
        v: CapabilityStatement-profile
      warning only:
        v: false
  action:
    assert:
      extension:
        value: Boolean
      description:
        v: Confirm that the CapabilityStatement defines a system instance.
      direction:
        v: response
      expression:
        v: CapabilityStatement.kind = 'instance'
      operator:
        v: equals
      source id:
        v: dest-1-FHIRCapabilities-1-response
      value:
        v: true
      warning only:
        v: false
  action:
    assert:
      extension:
        value: Boolean
      description:
        v: Confirm that the CapabilityStatement uses FHIR version 4.0.1 (R4).
      direction:
        v: response

v: capabilities

v: Accept

v: application/fhir+json

Boolean
v: false

url:
  v: ruleId
  l: ruleId
value: Id
  v: AssertBodyExists

extension:
  url:
    v: name
    l: name
  value: String
    v: errorMessage
extension:
  url:
    v: value
    l: value
  value: String
    v: the response body does not exist.
url:
  v: param
  l: param

Boolean
v: false

Boolean
v: false

Boolean
v: false

Boolean
v: false

v: CapabilityStatement.fhirVersion = '4.0.1'

v: equals

v: dest-1-FHIRCapabilities-1-response

v: true

v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the CapabilityStatement declares support for the FAST Consent Management IG.
  direction:
    v: response
  expression:
    v: 'http://hl7.org/fhir/us/consent-management/ImplementationGuide/hl7.fhir.us.consent-management' in CapabilityStatement.implementationGuide
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support JSON FHIR.
  direction:
    v: response
  expression:
    v: 'json' in CapabilityStatement.format
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support XML FHIR.
  direction:
    v: response
  expression:
    v: 'xml' in CapabilityStatement.format
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the returned CapabilityStatement resource minimally contains the declaration of a RESTful server.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.where(mode = 'server').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the Consent resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent resources that conform to the FASTConsent profile.
  direction:
    v: response
  expression:
    v: 'http://hl7.org/fhir/us/consent-management/StructureDefinition/FASTConsent' in CapabilityStatement.rest.resource.where(type = 'Consent').supportedProfile
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent read.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').interaction.where(code = 'read').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').interaction.where(code = 'search-type').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by _id (either at the REST or the resource level).
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.exists(searchParam.exists(name = '_id') or CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.exists(name = '_id'))
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by FASTConsentController.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'controller' and type = 'reference' and definition = 'http://hl7.org/fhir/us/consent-management/SearchParameter/fast-consent-controller').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by date.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'date' and type = 'date').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by FASTConsentGrantee.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'grantee' and type = 'reference' and definition = 'http://hl7.org/fhir/us/consent-management/SearchParameter/fast-consent-grantee').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by FASTConsentManager.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'manager' and type = 'reference' and definition = 'http://hl7.org/fhir/us/consent-management/SearchParameter/fast-consent-manager').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by FASTConsentOrganizationId.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'organizationId' and type = 'token' and definition = 'http://hl7.org/fhir/us/consent-management/SearchParameter/fast-consent-organizationId').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by patient.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'patient' and type = 'reference').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by FASTConsentPatientId.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'patientId' and type = 'token' and definition = 'http://hl7.org/fhir/us/consent-management/SearchParameter/fast-consent-patientId').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by scope.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'scope' and type = 'token').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent search by status.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').searchParam.where(name = 'status' and type = 'token').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the $fileConsent operation against the Consent resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').operation.where(name = 'fileConsent' and definition = 'http://hl7.org/fhir/us/consent-management/OperationDefinition/file-consent').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the $revokeConsent operation against the Consent resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Consent').operation.where(name = 'revokeConsent' and definition = 'http://hl7.org/fhir/us/consent-management/OperationDefinition/revoke-consent').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the AuditEvent resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'AuditEvent').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support AuditEvent resources that conform to the FASTConsentAuditEvent profile.
  direction:
    v: response
  expression:
    v: 'http://hl7.org/fhir/us/consent-management/StructureDefinition/FASTConsentAuditEvent' in CapabilityStatement.rest.resource.where(type = 'AuditEvent').supportedProfile
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support AuditEvent read.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'AuditEvent').interaction.where(code = 'read').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support AuditEvent search.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'AuditEvent').interaction.where(code = 'search-type').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support AuditEvent search by FASTAuditEventConsent.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'AuditEvent').searchParam.where(name = 'consent' and type = 'reference' and definition = 'http://hl7.org/fhir/us/consent-management/SearchParameter/fast-auditevent-consent').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support AuditEvent search by patient.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'AuditEvent').searchParam.where(name = 'patient' and type = 'reference').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the $recordDisclosure operation against the AuditEvent resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'AuditEvent').operation.where(name = 'recordDisclosure' and definition = 'http://hl7.org/fhir/us/consent-management/OperationDefinition/record-disclosure').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the Subscription resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Consent subscriptions as defined by the FASTConsentSubscriptionTopic for FHIR R4 with Subscriptions Backport.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').extension.where(url = 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/capabilitystatement-subscriptiontopic-canonical' and value as canonical = 'http://hl7.org/fhir/us/consent-management/SubscriptionTopic/FASTConsentSubscriptionTopic').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription resources that conform to the FASTSubscription profile.
  direction:
    v: response
  expression:
    v: 'http://hl7.org/fhir/us/consent-management/StructureDefinition/FASTSubscription' in CapabilityStatement.rest.resource.where(type = 'Subscription').supportedProfile
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription create.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').interaction.where(code = 'create').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription update.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').interaction.where(code = 'update').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription delete.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').interaction.where(code = 'delete').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the CapabilityStatement SHOULD declare conformance with the Backport Subscription Server Capability Statement.
  direction:
    v: response
  expression:
    v: 'http://hl7.org/fhir/uv/subscriptions-backport/CapabilityStatement/backport-subscription-server-r4' in CapabilityStatement.instantiates
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: true

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription resources that conform to the Backport Subscription Profile.
  direction:
    v: response
  expression:
    v: 'http://hl7.org/fhir/uv/subscriptions-backport/StructureDefinition/backport-subscription' in CapabilityStatement.rest.resource.where(type = 'Subscription').supportedProfile
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription read.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').interaction.where(code = 'read').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHOULD support Subscription search.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').interaction.where(code = 'search-type').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: true

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support Subscription search by url.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').searchParam.where(name = 'url' and type = 'uri' and definition = 'http://hl7.org/fhir/SearchParameter/Subscription-url').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHOULD support Subscription search by status.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').searchParam.where(name = 'status' and type = 'token' and definition = 'http://hl7.org/fhir/SearchParameter/Subscription-status').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: true

assert:
  extension:
    url:
      v: http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail
      l: testscript-assert-stopTestOnFail
    value: Boolean
      v: false
  description:
    v: Confirm that the Consent Administration Service SHALL support the $status operation against the Subscription resource.
  direction:
    v: response
  expression:
    v: CapabilityStatement.rest.resource.where(type = 'Subscription').operation.where(name = 'status' and definition = 'http://hl7.org/fhir/uv/subscriptions-backport/OperationDefinition/backport-subscription-status').exists()
  operator:
    v: equals
  source id:
    v: dest-1-FHIRCapabilities-1-response
  value:
    v: true
  warning only:
    v: false