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

: 03 Operations - All SUT | 02 Operation: Revoke a Consent - JSON Representation

Page standards status: Trial-use Maturity Level: 1

Raw json | Download

{
  "resourceType" : "TestScript",
  "id" : "02-Operation-Revoke-a-Consent",
  "meta" : {
    "profile" : [
      🔗 "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"
    ]
  },
  "text" : {
    "status" : "extensions",
    "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p class=\"res-header-id\"><b>Generated Narrative: TestScript 02-Operation-Revoke-a-Consent</b></p><a name=\"02-Operation-Revoke-a-Consent\"> </a><a name=\"hc02-Operation-Revoke-a-Consent\"> </a><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\"/><p style=\"margin-bottom: 0px\">Profile: <a href=\"file://D:\\GitHub\\Touchstone\\testing-ig\\output/StructureDefinition-testscript.html\">AEGIS Touchstone Testing TestScript Profile</a></p></div><blockquote><p><b>AEGIS Touchstone Testing TestScript Rule Extension</b></p><ul><li>ruleId: GetVariable-JsonPath</li><li>path: /FHIRCommon/_reference/rule/GetVariable-JsonPath.groovy</li></ul></blockquote><blockquote><p><b>AEGIS Touchstone Testing TestScript Rule Extension</b></p><ul><li>ruleId: AssertBodyExists</li><li>path: /FHIRCommon/_reference/rule/AssertBodyExists.groovy</li></ul></blockquote><p><b>StructureDefinition Work Group</b>: cbcc</p><p><b>url</b>: <a href=\"TestScript-02-Operation-Revoke-a-Consent.html\">TestScript 03 Operations - All SUT | 02 Operation: Revoke a Consent</a></p><p><b>version</b>: 1.0.0-ballot</p><p><b>name</b>: Test_02_Operation_Revoke_a_Consent</p><p><b>title</b>: 03 Operations - All SUT | 02 Operation: Revoke a Consent</p><p><b>status</b>: Active</p><p><b>date</b>: 2026-03-30</p><p><b>publisher</b>: HL7 International / Community Based Collaborative Care</p><p><b>contact</b>: HL7 International / Community Based Collaborative Care: <a href=\"http://www.hl7.org/Special/committees/cbcc\">http://www.hl7.org/Special/committees/cbcc</a></p><p><b>description</b>: </p><div><p>Happy Path: Perform a successful Consent/$revokeConsent operation.\nTest a client and server to verify support for the Consent $revokeConsent operation,\nsupporting the FAST Consent Management IG Version: CI.\nThis scenario is generic and can be used with any FHIR format and query parameters.\nSee https://wildfhir4.wildfhir.org/ig/fhir-consent-management-tg/rtm_test_cases.html#testcase-70\nTest System Details (in order of appearance):\n[Origin 1: Consent Client's RESTful client. System Under Test: this must be an external test system (not Touchstone).]\n[Destination 1: Consent Admin Service's RESTful FHIR Server. System Under Test: this must be an external test system (not a mock).]\n[Origin 2: Touchstone's RESTful client. Simulated: this requires Touchstone to be chosen as the test system.]</p>\n</div><p><b>jurisdiction</b>: <span title=\"Codes:{urn:iso:std:iso:3166 US}\">United States of America</span></p><p><b>copyright</b>: </p><div><p>(c) AEGIS.net, Inc. 2026</p>\n</div><blockquote><p><b>origin</b></p><p><b>index</b>: 1</p><p><b>profile</b>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-testscript-profile-origin-types.html#testscript-profile-origin-types-FHIR-Client\">Test script profile origin type: FHIR-Client</a> (FHIR Client)</p></blockquote><blockquote><p><b>origin</b></p><p><b>index</b>: 2</p><p><b>profile</b>: <a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-testscript-profile-origin-types.html#testscript-profile-origin-types-FHIR-Client\">Test script profile origin type: FHIR-Client</a> (FHIR Client)</p></blockquote><h3>Destinations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Index</b></td><td><b>Profile</b></td></tr><tr><td style=\"display: none\">*</td><td>1</td><td><a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-testscript-profile-destination-types.html#testscript-profile-destination-types-FHIR-Server\">Test script profile destination type: FHIR-Server</a> (FHIR Server)</td></tr></table><p><b>profile</b>: </p><ul><li><a href=\"http://hl7.org/fhir/us/consent-management/2026Jan/StructureDefinition-RevokeConsentParameters.html\">http://hl7.org/fhir/us/consent-management/StructureDefinition/RevokeConsentParameters</a></li><li><a href=\"http://hl7.org/fhir/R4/consent.html\">http://hl7.org/fhir/StructureDefinition/Consent</a></li></ul><blockquote><p><b>test</b></p><p><b>name</b>: Step_001_Consent_slash_dollar_revokeConsent_operation</p><p><b>description</b>: Consent Client invokes the Consent/$revokeConsent operation at Consent Admin Service.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Method</b></td><td><b>Origin</b></td><td><b>Params</b></td><td><b>RequestId</b></td><td><b>ResponseId</b></td></tr><tr><td style=\"display: none\">*</td><td>testscript-operation-codes-extended: post (post)</td><td>Consent</td><td>Consent/$revokeConsent operation.</td><td>1</td><td>true</td><td>POST</td><td>1</td><td>/$revokeConsent</td><td>dest-1-FHIRExtendedOperation-1-request</td><td>dest-1-FHIRExtendedOperation-1-response</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>Confirm that the resource(s) in the request body at FHIRPath 'Parameters' conform to profile 'RevokeConsentParameters'.</td><td>request</td><td>Parameters</td><td>RevokeConsentParameters</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>SourceId</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td>, </td><td>Save the reference from the request so we can read it in the next step and check its status.</td><td>request</td><td>dest-1-FHIRExtendedOperation-1-request</td><td>true</td></tr></table></blockquote></blockquote><blockquote><p><b>test</b></p><p><b>name</b>: Step_002_Consent_read</p><p><b>description</b>: Touchstone reads a Consent resource at Consent Admin Service. Read the revoked Consent using the reference we saved from\r\nthe $revokeConsent request, confirm it still exists, and is inactive.</p><blockquote><p><b>action</b></p><h3>Operations</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Type</b></td><td><b>Resource</b></td><td><b>Description</b></td><td><b>Accept</b></td><td><b>Destination</b></td><td><b>EncodeRequestUrl</b></td><td><b>Method</b></td><td><b>Origin</b></td><td><b>RequestId</b></td><td><b>ResponseId</b></td><td><b>Url</b></td></tr><tr><td style=\"display: none\">*</td><td><a href=\"http://terminology.hl7.org/7.1.0/CodeSystem-testscript-operation-codes.html#testscript-operation-codes-read\">Test script operation code: read</a> (Read)</td><td>Consent</td><td>Read a Consent resource.</td><td>json</td><td>1</td><td>true</td><td>GET</td><td>2</td><td>dest-1-FHIRRead-1-request</td><td>dest-1-FHIRRead-1-response</td><td>${dest1SystemConfig.baseUrl}/${ConsentReference}</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Operator</b></td><td><b>ResponseCode</b></td><td><b>SourceId</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>Confirm that the returned HTTP status is 200 OK.</td><td>response</td><td>in</td><td>200</td><td>dest-1-FHIRRead-1-response</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>Confirm that the response body exists.</td><td>response</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Resource</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>Confirm that the response body is a Consent resource.</td><td>response</td><td>Consent</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>ValidateProfileId</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>Confirm that the response body conforms to the base FHIR Consent profile. This also checks any declared profiles within.</td><td>response</td><td>Consent-profile</td><td>false</td></tr></table></blockquote><blockquote><p><b>action</b></p><h3>Asserts</h3><table class=\"grid\"><tr><td style=\"display: none\">-</td><td><b>Extension</b></td><td><b>Description</b></td><td><b>Direction</b></td><td><b>Expression</b></td><td><b>Operator</b></td><td><b>SourceId</b></td><td><b>Value</b></td><td><b>WarningOnly</b></td></tr><tr><td style=\"display: none\">*</td><td/><td>Confirm the status of the Consent just revoked is inactive.</td><td>response</td><td>Consent.status = 'inactive'</td><td>equals</td><td>dest-1-FHIRRead-1-response</td><td>true</td><td>false</td></tr></table></blockquote></blockquote></div>"
  },
  "extension" : [
    {
      "extension" : [
        {
          "url" : "ruleId",
          "valueId" : "GetVariable-JsonPath"
        },
        {
          "url" : "path",
          "valueString" : "/FHIRCommon/_reference/rule/GetVariable-JsonPath.groovy"
        }
      ],
      "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"
    },
    {
      "extension" : [
        {
          "url" : "ruleId",
          "valueId" : "AssertBodyExists"
        },
        {
          "url" : "path",
          "valueString" : "/FHIRCommon/_reference/rule/AssertBodyExists.groovy"
        }
      ],
      "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-rule"
    },
    {
      "url" : "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
      "valueCode" : "cbcc"
    }
  ],
  "url" : "http://hl7.org/fhir/us/consent-management-tg/TestScript/02-Operation-Revoke-a-Consent",
  "version" : "1.0.0-ballot",
  "name" : "Test_02_Operation_Revoke_a_Consent",
  "title" : "03 Operations - All SUT | 02 Operation: Revoke a Consent",
  "status" : "active",
  "date" : "2026-03-30",
  "publisher" : "HL7 International / Community Based Collaborative Care",
  "contact" : [
    {
      "name" : "HL7 International / Community Based Collaborative Care",
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://www.hl7.org/Special/committees/cbcc"
        }
      ]
    }
  ],
  "description" : "Happy Path: Perform a successful Consent/$revokeConsent operation.\r\nTest a client and server to verify support for the Consent $revokeConsent operation,\r\nsupporting the FAST Consent Management IG Version: CI.\r\nThis scenario is generic and can be used with any FHIR format and query parameters.\r\nSee https://wildfhir4.wildfhir.org/ig/fhir-consent-management-tg/rtm_test_cases.html#testcase-70\r\n Test System Details (in order of appearance):\r\n [Origin 1: Consent Client's RESTful client. System Under Test: this must be an external test system (not Touchstone).]\r\n [Destination 1: Consent Admin Service's RESTful FHIR Server. System Under Test: this must be an external test system (not a mock).]\r\n [Origin 2: Touchstone's RESTful client. Simulated: this requires Touchstone to be chosen as the test system.]",
  "jurisdiction" : [
    {
      "coding" : [
        {
          "system" : "urn:iso:std:iso:3166",
          "code" : "US",
          "display" : "United States of America"
        }
      ]
    }
  ],
  "copyright" : "(c) AEGIS.net, Inc. 2026",
  "origin" : [
    {
      "index" : 1,
      "profile" : {
        "system" : "http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types",
        "code" : "FHIR-Client"
      }
    },
    {
      "index" : 2,
      "profile" : {
        "system" : "http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types",
        "code" : "FHIR-Client"
      }
    }
  ],
  "destination" : [
    {
      "index" : 1,
      "profile" : {
        "system" : "http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types",
        "code" : "FHIR-Server"
      }
    }
  ],
  "profile" : [
    {
      🔗 "id" : "RevokeConsentParameters",
      "reference" : "http://hl7.org/fhir/us/consent-management/StructureDefinition/RevokeConsentParameters"
    },
    {
      🔗 "id" : "Consent-profile",
      "reference" : "http://hl7.org/fhir/StructureDefinition/Consent"
    }
  ],
  "test" : [
    {
      "name" : "Step_001_Consent_slash_dollar_revokeConsent_operation",
      "description" : "Consent Client invokes the Consent/$revokeConsent operation at Consent Admin Service.",
      "action" : [
        {
          "operation" : {
            "type" : {
              "system" : "http://touchstone.com/fhir/testscript-operation-codes-extended",
              "code" : "post"
            },
            "resource" : "Consent",
            "description" : "Consent/$revokeConsent operation.",
            "destination" : 1,
            "encodeRequestUrl" : true,
            "method" : "post",
            "origin" : 1,
            "params" : "/$revokeConsent",
            "requestId" : "dest-1-FHIRExtendedOperation-1-request",
            "responseId" : "dest-1-FHIRExtendedOperation-1-response"
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail",
                "valueBoolean" : false
              }
            ],
            "description" : "Confirm that the resource(s) in the request body at FHIRPath 'Parameters' conform to profile 'RevokeConsentParameters'.",
            "direction" : "request",
            "expression" : "Parameters",
            "validateProfileId" : "RevokeConsentParameters",
            "warningOnly" : false
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail",
                "valueBoolean" : false
              },
              {
                "extension" : [
                  {
                    "url" : "ruleId",
                    "valueId" : "GetVariable-JsonPath"
                  },
                  {
                    "extension" : [
                      {
                        "url" : "name",
                        "valueString" : "jsonPath"
                      },
                      {
                        "url" : "value",
                        "valueString" : "$.parameter[?(@.name == 'consent')].valueReference.reference"
                      }
                    ],
                    "url" : "param"
                  },
                  {
                    "extension" : [
                      {
                        "url" : "name",
                        "valueString" : "outputName"
                      },
                      {
                        "url" : "value",
                        "valueString" : "ConsentReference"
                      }
                    ],
                    "url" : "param"
                  },
                  {
                    "extension" : [
                      {
                        "url" : "name",
                        "valueString" : "ConsentReference"
                      }
                    ],
                    "url" : "output"
                  }
                ],
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule"
              }
            ],
            "description" : "Save the reference from the request so we can read it in the next step and check its status.",
            "direction" : "request",
            "sourceId" : "dest-1-FHIRExtendedOperation-1-request",
            "warningOnly" : true
          }
        }
      ]
    },
    {
      "name" : "Step_002_Consent_read",
      "description" : "Touchstone reads a Consent resource at Consent Admin Service. Read the revoked Consent using the reference we saved from\r\nthe $revokeConsent request, confirm it still exists, and is inactive.",
      "action" : [
        {
          "operation" : {
            "type" : {
              "system" : "http://terminology.hl7.org/CodeSystem/testscript-operation-codes",
              "code" : "read"
            },
            "resource" : "Consent",
            "description" : "Read a Consent resource.",
            "accept" : "json",
            "destination" : 1,
            "encodeRequestUrl" : true,
            "method" : "get",
            "origin" : 2,
            "requestId" : "dest-1-FHIRRead-1-request",
            "responseId" : "dest-1-FHIRRead-1-response",
            "url" : "${dest1SystemConfig.baseUrl}/${ConsentReference}"
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail",
                "valueBoolean" : false
              }
            ],
            "description" : "Confirm that the returned HTTP status is 200 OK.",
            "direction" : "response",
            "operator" : "in",
            "responseCode" : "200",
            "sourceId" : "dest-1-FHIRRead-1-response",
            "warningOnly" : false
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "extension" : [
                  {
                    "url" : "ruleId",
                    "valueId" : "AssertBodyExists"
                  },
                  {
                    "extension" : [
                      {
                        "url" : "name",
                        "valueString" : "errorMessage"
                      },
                      {
                        "url" : "value",
                        "valueString" : "the response body does not exist."
                      }
                    ],
                    "url" : "param"
                  }
                ],
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-rule"
              }
            ],
            "description" : "Confirm that the response body exists.",
            "direction" : "response",
            "warningOnly" : false
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail",
                "valueBoolean" : false
              }
            ],
            "description" : "Confirm that the response body is a Consent resource.",
            "direction" : "response",
            "resource" : "Consent",
            "warningOnly" : false
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail",
                "valueBoolean" : false
              }
            ],
            "description" : "Confirm that the response body conforms to the base FHIR Consent profile. This also checks any declared profiles within.",
            "direction" : "response",
            "validateProfileId" : "Consent-profile",
            "warningOnly" : false
          }
        },
        {
          "assert" : {
            "extension" : [
              {
                "url" : "http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-stopTestOnFail",
                "valueBoolean" : false
              }
            ],
            "description" : "Confirm the status of the Consent just revoked is inactive.",
            "direction" : "response",
            "expression" : "Consent.status = 'inactive'",
            "operator" : "equals",
            "sourceId" : "dest-1-FHIRRead-1-response",
            "value" : "true",
            "warningOnly" : false
          }
        }
      ]
    }
  ]
}