Name | /FHIR4-0-1-Basic/A-C/Account/Client Assigned Id/Account-client-id-json |
Description | FHIR Server Account Basic Operation Tests - JSON - Client Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. Support for referenced resource type Patient Update, Delete and Search is also required. |
Version | 5 | Latest | 5 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="Account-client-id-json"/>
<meta>
<profile value="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript"/>
</meta>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<p>FHIR Server Account Basic Operation Tests - JSON - Client Assigned Resource Id</p>
</div>
</text>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-versioning-headers"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/ruleset/RuleSet-VersioningHeaders-Groovy.xml"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertETagIfSupported"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertLastModifiedIfSupported"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-createok-headers-body"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/ruleset/RuleSet-CreateOkHeadersBody-Groovy.xml"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeCharsetIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResourceTypesIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account,OperationOutcome"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfOperationOutcome"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="operationoutcome-profile"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfResource"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="resource-profile"/>
</extension>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-updateok-headers-body"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/ruleset/RuleSet-UpdateOkHeadersBody-Groovy.xml"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeCharsetIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResourceTypesIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account,OperationOutcome"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfOperationOutcome"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="operationoutcome-profile"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfResource"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="resource-profile"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertVersionIdIfResourceAndSupported"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resourceOperator"/>
</extension>
<extension url="value">
<valueString value="equals"/>
</extension>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-vreadok-headers-body-if-versioning"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/ruleset/RuleSet-VReadOkHeadersBodyIfVersioning-Groovy.xml"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResponseCodeOkIfVersioning"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResponseCodeNotFoundIfNotVersioning"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertETagIfSupported"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertLastModifiedIfSupported"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeMimeTypeIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeCharsetIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResourceTypesIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account,OperationOutcome"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfOperationOutcome"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="operationoutcome-profile"/>
</extension>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfResource"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="resource"/>
</extension>
<extension url="value">
<valueString value="Account"/>
</extension>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="resource-profile"/>
</extension>
</extension>
</extension>
</extension>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-deletevalid-headers-body"/>
</extension>
<extension url="path">
<valueString value="/FHIRCommon/_reference/ruleset/RuleSet-DeleteValidHeadersBody-NoVersioning-Groovy.xml"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResponseCodeOkIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertResponseCodeNoContentIfNoBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeCharsetIfBody"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertOperationOutcomeIfError"/>
</extension>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertProfileIfOperationOutcome"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="validateProfileId"/>
</extension>
<extension url="value">
<valueString value="operationoutcome-profile"/>
</extension>
</extension>
</extension>
</extension>
<url value="http://wildfhir.aegis.net/fhir4-0-1/TestScript/Account-client-id-json"/>
<name value="Account_client_id_json"/>
<title value="FHIR Server Account Basic Operation Tests - JSON - Client Assigned Resource Id"/>
<status value="active"/>
<date value="2020-02-02"/>
<publisher value="AEGIS.net, Inc."/>
<contact>
<name value="Touchstone Support"/>
<telecom>
<system value="email"/>
<value value="Touchstone_Support@aegis.net"/>
<use value="work"/>
</telecom>
</contact>
<description value="FHIR Server Account Basic Operation Tests - JSON - Client Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. Support for referenced resource type Patient Update, Delete and Search is also required."/>
<copyright value="This FHIR Test Script is licensed under Creative Commons (CC0) 'No Rights Reserved'. Learn more at https://creativecommons.org/licenses"/>
<origin>
<index value="1"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-origin-types"/>
<code value="FHIR-Client"/>
</profile>
</origin>
<destination>
<index value="1"/>
<profile>
<system value="http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types"/>
<code value="FHIR-Server"/>
</profile>
</destination>
<fixture id="resource-create">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="../_reference/resources/Account-create-client-id.json"/>
</resource>
</fixture>
<fixture id="resource-update">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="../_reference/resources/Account-update-client-id.json"/>
</resource>
</fixture>
<fixture id="reference-patient-create">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="../_reference/resources/Patient-create-client-id.json"/>
</resource>
</fixture>
<profile id="bundle-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</profile>
<profile id="operationoutcome-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/OperationOutcome"/>
</profile>
<profile id="resource-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Account"/>
</profile>
<variable>
<name value="createResourceId"/>
<path value=".id"/>
<sourceId value="resource-create"/>
</variable>
<variable>
<name value="createVersionId"/>
<path value=".meta.versionId"/>
<sourceId value="create-read-response"/>
</variable>
<variable>
<name value="searchParamIdentifier"/>
<path value=".identifier[0].value"/>
<sourceId value="resource-create"/>
</variable>
<variable>
<name value="referencePatientResourceId"/>
<path value=".id"/>
<sourceId value="reference-patient-create"/>
</variable>
<setup>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="Account"/>
<description value="Delete operation to ensure the Account does not exist on the server."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is either 200(OK), 204(No Content) or 404(Not Found)."/>
<operator value="in"/>
<responseCode value="200,204,404"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="Patient"/>
<description value="Delete operation to ensure the referenced Patient does not exist on the server."/>
<accept value="json"/>
<encodeRequestUrl value="true"/>
<params value="/${referencePatientResourceId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is either 200(OK), 204(No Content) or 404(Not Found)."/>
<operator value="in"/>
<responseCode value="200,204,404"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="updateCreate"/>
</type>
<resource value="Patient"/>
<description value="Create the referenced Patient resource needed for referential integrity from the Account."/>
<accept value="json"/>
<contentType value="json"/>
<encodeRequestUrl value="true"/>
<params value="/${referencePatientResourceId}"/>
<sourceId value="reference-patient-create"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK) or 201(Created)."/>
<operator value="in"/>
<responseCode value="200,201"/>
<warningOnly value="false"/>
</assert>
</action>
</setup>
<test id="Step1-CreateNewAccount">
<name value="Step1-CreateNewAccount"/>
<description value="Create a new Account in JSON format where the client assigns the resource id. The expected response code is 201 (Created) with a content of either the created Account resource in JSON format, an OperationOutcome resource in JSON format or an empty payload."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="updateCreate"/>
</type>
<resource value="Account"/>
<description value="Create Account with client assigned resource id."/>
<accept value="json"/>
<contentType value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}"/>
<sourceId value="resource-create"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 201(Created)."/>
<direction value="response"/>
<response value="created"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-versioning-headers"/>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-createok-headers-body"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeMimeTypeIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="headerExpectedValue"/>
</extension>
<extension url="value">
<valueString value="application/fhir+json"/>
</extension>
</extension>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected create ok response HTTP Headers and body."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="Step2-ReadAccount">
<name value="Step2-ReadAccount"/>
<description value="Read the Account in JSON format created in step 1. The expected response code is 200 (OK) with a content of the found Account resource in JSON format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Account"/>
<description value="Account read operation with HTTP Header Accept set to JSON format."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}"/>
<responseId value="create-read-response"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-versioning-headers"/>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource type is Account."/>
<direction value="response"/>
<resource value="Account"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate that the returned resource conforms to the corresponding FHIR resource profile."/>
<direction value="response"/>
<validateProfileId value="resource-profile"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="Step3-UpdateAccount">
<name value="Step3-UpdateAccount"/>
<description value="Update the Account created in step 1 in JSON format. The expected response code is 200 (OK) with a content of either the updated Account resource in JSON format, an OperationOutcome resource in JSON format or an empty payload."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="update"/>
</type>
<resource value="Account"/>
<description value="Account update operation with JSON content."/>
<accept value="json"/>
<contentType value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}"/>
<sourceId value="resource-update"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-versioning-headers"/>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-updateok-headers-body"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeMimeTypeIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="headerExpectedValue"/>
</extension>
<extension url="value">
<valueString value="application/fhir+json"/>
</extension>
</extension>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected update ok response HTTP Headers and body."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Account"/>
<description value="Read the Account in order to verify the updated contents."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is JSON ('application/fhir+json')."/>
<direction value="response"/>
<contentType value="json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate that the returned resource conforms to the corresponding FHIR resource profile."/>
<direction value="response"/>
<validateProfileId value="resource-profile"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="Step4-AccountHistoryInstance">
<name value="Step4-AccountHistoryInstance"/>
<description value="Retrieve the updated Account instance's history in JSON format. The expected response code is 200 (OK) with a Bundle resource in JSON format of type history containing the created and updated versions of the Account."/>
<action>
<operation>
<!-- <type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="history"/>
</type> -->
<resource value="Account"/>
<description value="Retrieve the history for a single, known Account."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}/_history"/>
<!--<targetId value="resource-update"/>-->
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is JSON ('application/fhir+json')."/>
<direction value="response"/>
<contentType value="json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the response payload contains the Bundle resource type."/>
<direction value="response"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate that the returned resource conforms to the corresponding FHIR bundle profile."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the Bundle type is 'history'."/>
<direction value="response"/>
<operator value="equals"/>
<path value=".type"/>
<value value="history"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is more than one resource instance returned. There should be at least two from the create and update operations."/>
<direction value="response"/>
<expression value="Bundle.entry.count()"/>
<operator value="greaterThan"/>
<value value="1"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="Step5-AccountVersionRead">
<name value="Step5-AccountVersionRead"/>
<description value="Retrieve a initially created version of a Account instance in JSON format. The expected response code, if versioning is supported, is 200 (OK) with a content of the updated Account resource in JSON format; if versioning is not supported, a 404 (Not Found) with an OperationOutcome resource in JSON format or an empty payload."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Account"/>
<description value="Retrieve initially created version of the Account instance."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}/_history/${createVersionId}"/>
</operation>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-vreadok-headers-body-if-versioning"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeMimeTypeIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="headerExpectedValue"/>
</extension>
<extension url="value">
<valueString value="application/fhir+json"/>
</extension>
</extension>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected vread ok response code, HTTP Headers and body."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="Step6-AccountSearchType">
<name value="Step6-AccountSearchType"/>
<description value="Search for Account resources in JSON format with an identifier equal to ${searchParamIdentifier}. The expected response code is 200 (OK) with a Bundle resource in JSON format of type history containing the found instances of the Account."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Account"/>
<description value="Search for the Account by identifier."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?identifier=${searchParamIdentifier}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<direction value="response"/>
<responseCode value="200"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is JSON ('application/fhir+json')."/>
<direction value="response"/>
<contentType value="json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the response payload contains the Bundle resource type."/>
<direction value="response"/>
<resource value="Bundle"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Validate that the returned resource conforms to the corresponding FHIR bundle profile."/>
<direction value="response"/>
<validateProfileId value="bundle-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the Bundle type is 'searchset'."/>
<direction value="response"/>
<operator value="equals"/>
<path value=".type"/>
<value value="searchset"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one record returned. There could be other Account records returned."/>
<direction value="response"/>
<expression value="Bundle.entry.count()"/>
<operator value="greaterThan"/>
<value value="0"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="Step7-AccountDelete">
<name value="Step7-AccountDelete"/>
<description value="Delete a Account instance in JSON format. The expected response is either a 200 (OK) with an optional OperationOutcome in JSON format or 204 (No Content) and the content is empty; i.e. no content."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="Account"/>
<description value="Delete the Account instance."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is either 200(OK), 204(No Content) or 404(Not Found)."/>
<direction value="response"/>
<operator value="in"/>
<responseCode value="200,204,404"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<extension url="http://touchstone.aegis.net/touchstone/fhir/testing/StructureDefinition/testscript-assert-ruleset">
<extension url="rulesetId">
<valueId value="ruleset-deletevalid-headers-body"/>
</extension>
<extension url="rule">
<extension url="ruleId">
<valueId value="assertContentTypeMimeTypeIfBody"/>
</extension>
<extension url="param">
<extension url="name">
<valueString value="headerExpectedValue"/>
</extension>
<extension url="value">
<valueString value="application/fhir+json"/>
</extension>
</extension>
</extension>
</extension>
<description value="Complex ruleset assertion to conditionally validate expected delete ok response HTTP Headers and body."/>
<direction value="response"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>