Name | /FHIR4-0-1-Basic/A-C/AppointmentResponse/Server Assigned Id/AppointmentResponse-server-id-json |
Description | FHIR Server AppointmentResponse Basic Operation Tests - JSON - Server Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. Support for referenced resource type Appointment Create, 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="AppointmentResponse-server-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 AppointmentResponse Basic Operation Tests - JSON - Server 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="AppointmentResponse"/>
</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="AppointmentResponse"/>
</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="AppointmentResponse,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="AppointmentResponse"/>
</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="AppointmentResponse,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="AppointmentResponse"/>
</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="AppointmentResponse"/>
</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="AppointmentResponse"/>
</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="AppointmentResponse"/>
</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="AppointmentResponse"/>
</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="AppointmentResponse"/>
</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="AppointmentResponse,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="AppointmentResponse"/>
</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/AppointmentResponse-server-id-json"/>
<name value="AppointmentResponse_server_id_json"/>
<title value="FHIR Server AppointmentResponse Basic Operation Tests - JSON - Server 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 AppointmentResponse Basic Operation Tests - JSON - Server Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. Support for referenced resource type Appointment Create, 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/AppointmentResponse-create-server-id.json"/>
</resource>
</fixture>
<fixture id="resource-update">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="../_reference/resources/AppointmentResponse-update-server-id.json"/>
</resource>
</fixture>
<fixture id="reference-appointment-create">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="../_reference/resources/Appointment-create-server-id.json"/>
</resource>
</fixture>
<fixture id="reference-practitioner-create">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="../_reference/resources/Practitioner-create-server-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/AppointmentResponse"/>
</profile>
<variable>
<name value="createResourceId"/>
<path value=".entry[0].resource.id"/>
<sourceId value="create-search-response"/>
</variable>
<variable>
<name value="createVersionId"/>
<path value=".entry[0].resource.meta.versionId"/>
<sourceId value="create-search-response"/>
</variable>
<variable>
<name value="searchParamIdentifier"/>
<path value=".identifier[0].value"/>
<sourceId value="resource-create"/>
</variable>
<variable>
<name value="referenceAppointmentResourceId"/>
<path value=".entry[0].resource.id"/>
<sourceId value="setup-create-appointment-search-response"/>
</variable>
<variable>
<name value="searchReferenceAppointmentIdentifier"/>
<path value=".identifier[0].value"/>
<sourceId value="reference-appointment-create"/>
</variable>
<variable>
<name value="referencePractitionerResourceId"/>
<path value=".entry[0].resource.id"/>
<sourceId value="setup-create-practitioner-search-response"/>
</variable>
<variable>
<name value="searchReferencePractitionerIdentifier"/>
<path value=".identifier[0].value"/>
<sourceId value="reference-practitioner-create"/>
</variable>
<setup>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="AppointmentResponse"/>
<description value="Delete operation to ensure the AppointmentResponse does not exist on the server."/>
<accept value="json"/>
<encodeRequestUrl value="true"/>
<params value="?identifier=${searchParamIdentifier}"/>
</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="Appointment"/>
<description value="Delete operation to ensure the referenced Appointment does not exist on the server."/>
<accept value="json"/>
<encodeRequestUrl value="true"/>
<params value="?identifier=${searchReferenceAppointmentIdentifier}"/>
</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="Practitioner"/>
<description value="System-generated search and delete operations from conditional delete to ensure the referenced Practitioner does not exist on the server."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="?identifier=${searchReferencePractitionerIdentifier}"/>
</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="create"/>
</type>
<resource value="Appointment"/>
<description value="Create the referenced Appointment resource needed for referential integrity from the AppointmentResponse."/>
<accept value="json"/>
<contentType value="json"/>
<encodeRequestUrl value="true"/>
<sourceId value="reference-appointment-create"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 201(Created)."/>
<response value="created"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Appointment"/>
<description value="Search for the created Appointment by the unique identifier."/>
<accept value="json"/>
<encodeRequestUrl value="true"/>
<params value="?identifier=${searchReferenceAppointmentIdentifier}"/>
<responseId value="setup-create-appointment-search-response"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="create"/>
</type>
<description value="Create the referenced Practitioner resource needed for referential integrity from the AppointmentResponse."/>
<accept value="json"/>
<contentType value="json"/>
<encodeRequestUrl value="true"/>
<sourceId value="reference-practitioner-create"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 201(Created)."/>
<response value="created"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Practitioner"/>
<description value="Search for the created Practitioner by the unique identifier."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="?identifier=${searchReferencePractitionerIdentifier}"/>
<responseId value="setup-create-practitioner-search-response"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<response value="okay"/>
<warningOnly value="false"/>
</assert>
</action>
</setup>
<test id="Step1-CreateNewAppointmentResponse">
<name value="Step1-CreateNewAppointmentResponse"/>
<description value="Create a new AppointmentResponse in JSON format where the server assigns the resource id. The expected response code is 201 (Created) with a content of either the created AppointmentResponse 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="create"/>
</type>
<description value="AppointmentResponse create operation with HTTP Header Accept and Content-Type set to JSON format."/>
<accept value="json"/>
<contentType value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<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>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="AppointmentResponse"/>
<description value="Search for the created AppointmentResponse by the unique identifier."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="?identifier=${searchParamIdentifier}"/>
<responseId value="create-search-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 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>
</test>
<test id="Step2-ReadAppointmentResponse">
<name value="Step2-ReadAppointmentResponse"/>
<description value="Read the AppointmentResponse in JSON format created in step 1. The expected response code is 200 (OK) with a content of the found AppointmentResponse resource in JSON format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="AppointmentResponse"/>
<description value="AppointmentResponse 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 AppointmentResponse."/>
<direction value="response"/>
<resource value="AppointmentResponse"/>
<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-UpdateAppointmentResponse">
<name value="Step3-UpdateAppointmentResponse"/>
<description value="Update the AppointmentResponse created in step 1 in JSON format. The expected response code is 200 (OK) with a content of either the updated AppointmentResponse 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="AppointmentResponse"/>
<description value="AppointmentResponse 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="AppointmentResponse"/>
<description value="Read the AppointmentResponse in order to verify the updated contents."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}"/>
<responseId value="resource-read"/>
</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-AppointmentResponseHistoryInstance">
<name value="Step4-AppointmentResponseHistoryInstance"/>
<description value="Retrieve the updated AppointmentResponse 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 AppointmentResponse."/>
<action>
<operation>
<!-- <type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="history"/>
</type> -->
<resource value="AppointmentResponse"/>
<description value="Retrieve the history for a single, known AppointmentResponse."/>
<accept value="json"/>
<destination value="1"/>
<encodeRequestUrl value="true"/>
<origin value="1"/>
<params value="/${createResourceId}/_history"/>
<!-- <targetId value="resource-read"/> -->
</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-AppointmentResponseVersionRead">
<name value="Step5-AppointmentResponseVersionRead"/>
<description value="Retrieve a initially created version of a AppointmentResponse instance in JSON format. The expected response code, if versioning is supported, is 200 (OK) with a content of the updated AppointmentResponse 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="AppointmentResponse"/>
<description value="Retrieve initially created version of the AppointmentResponse 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-AppointmentResponseSearchType">
<name value="Step6-AppointmentResponseSearchType"/>
<description value="Search for AppointmentResponse 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 AppointmentResponse."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="AppointmentResponse"/>
<description value="Search for the AppointmentResponse 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 AppointmentResponse 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-AppointmentResponseDelete">
<name value="Step7-AppointmentResponseDelete"/>
<description value="Delete a AppointmentResponse 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="AppointmentResponse"/>
<description value="Delete the AppointmentResponse 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>