Name | /FHIR1-2-0-Basic/A-C/Appointment/Client Assigned Id/Appointment-client-id-json |
Description | FHIR Server Appointment Basic Operation Tests - JSON - Client Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. |
Version | 1 | Latest | 1 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="Appointment-client-id-json"/>
<url value="http://wildfhir.aegis.net/dstu21/TestScript/Appointment-client-id-json"/>
<version value="2.1"/>
<name value="FHIR Server Appointment Basic Operation Tests - JSON - Client Assigned Resource Id"/>
<status value="draft"/>
<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>
<date value="2016-03-31"/>
<description value="FHIR Server Appointment Basic Operation Tests - JSON - Client Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread."/>
<useContext>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="US"/>
<display value="United States of America (the)"/>
</coding>
</useContext>
<requirements value="Appointment Create, Delete, History, Read, Search, Update, Vread Operations"/>
<copyright value="© AEGIS.net, Inc. 2015+"/>
<metadata>
<capability>
<required value="true"/>
<description value="Create, Delete, Read, Update Operations"/>
<link value="http://hl7.org/fhir/http.html#create"/>
<link value="http://hl7.org/fhir/http.html#delete"/>
<link value="http://hl7.org/fhir/http.html#read"/>
<link value="http://hl7.org/fhir/http.html#update"/>
<conformance>
<reference value="../_reference/conformance/AppointmentCreateDeleteReadUpdate.xml"/>
</conformance>
</capability>
<capability>
<required value="true"/>
<description value="History Instance, Vread Operations"/>
<link value="http://hl7.org/fhir/http.html#history"/>
<link value="http://hl7.org/fhir/http.html#vread"/>
<conformance>
<reference value="../_reference/conformance/AppointmentHistoryInstanceVread.xml"/>
</conformance>
</capability>
<capability>
<required value="true"/>
<description value="Search Type Operation"/>
<link value="http://hl7.org/fhir/http.html#search"/>
<conformance>
<reference value="../_reference/conformance/AppointmentSearchType.xml"/>
</conformance>
</capability>
</metadata>
<fixture id="resource-create">
<resource>
<reference value="../_reference/resources/Appointment-create-client-id.json"/>
</resource>
</fixture>
<fixture id="resource-create-min">
<resource>
<reference value="../_reference/resources/Appointment-create-min.json"/>
</resource>
</fixture>
<fixture id="resource-update">
<resource>
<reference value="../_reference/resources/Appointment-update.json"/>
</resource>
</fixture>
<fixture id="resource-update-min">
<resource>
<reference value="../_reference/resources/Appointment-update-min.json"/>
</resource>
</fixture>
<profile id="bundle-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/>
</profile>
<profile id="resource-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Appointment"/>
</profile>
<variable>
<name value="createResourceId"/>
<path value="Appointment/identifier/value"/>
<sourceId value="resource-create"/>
</variable>
<variable>
<name value="createVersionId"/>
<path value="Appointment/meta/versionId"/>
<sourceId value="create-read-response"/>
</variable>
<variable>
<name value="searchParamIdentifier"/>
<path value="Appointment/identifier/value"/>
<sourceId value="resource-create"/>
</variable>
<setup>
<!-- Appointment Delete -->
<action>
<operation>
<type>
<code value="delete"/>
</type>
<resource value="Appointment"/>
<description value="Use a conditional delete operation to insure the Appointment does not exist on the server."/>
<accept value="json"/>
<contentType value="json"/>
<params value="?identifier=${searchParamIdentifier}"/>
</operation>
</action>
</setup>
<test id="Step1-CreateNewAppointment">
<name value="Step1-CreateNewAppointment"/>
<description value="Create a new Appointment in JSON format where the client assigns the resource id."/>
<action>
<operation>
<type>
<code value="update"/>
</type>
<resource value="Appointment"/>
<description value="Create Appointment with client assigned resource id."/>
<accept value="json"/>
<contentType value="json"/>
<params value="/${createResourceId}"/>
<sourceId value="resource-create"/>
</operation>
</action>
<action>
<assert>
<operator value="in"/>
<responseCode value="200,201"/>
</assert>
</action>
<action>
<assert>
<contentType value="json"/>
</assert>
</action>
</test>
<test id="Step2-ReadAppointment">
<name value="Step2-ReadAppointment"/>
<description value="Read the Appointment in JSON format created in step 1."/>
<action>
<operation>
<type>
<code value="read"/>
</type>
<resource value="Appointment"/>
<description value="Read using params element"/>
<accept value="json"/>
<contentType value="json"/>
<params value="/${createResourceId}"/>
<responseId value="create-read-response"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
</assert>
</action>
<action>
<assert>
<validateProfileId value="resource-profile"/>
</assert>
</action>
<action>
<assert>
<minimumId value="resource-create-min"/>
</assert>
</action>
</test>
<test id="Step3-UpdateAppointment">
<name value="Step3-UpdateAppointment"/>
<description value="Update the Appointment in JSON format created in step 1 then Read it again for verification."/>
<action>
<operation>
<type>
<code value="update"/>
</type>
<resource value="Appointment"/>
<accept value="json"/>
<contentType value="json"/>
<params value="/${createResourceId}"/>
<responseId value="update-response"/>
<sourceId value="resource-update"/>
</operation>
</action>
<action>
<assert>
<operator value="in"/>
<responseCode value="200,201"/>
</assert>
</action>
<action>
<assert>
<headerField value="Location"/>
<operator value="notEmpty"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<operation>
<type>
<code value="read"/>
</type>
<resource value="Appointment"/>
<accept value="json"/>
<contentType value="json"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<assert>
<validateProfileId value="resource-profile"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that read returns updated version and that update did not delete previously created fields."/>
<minimumId value="resource-update-min"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the resource version is present. Warning only as the server may not support versioning."/>
<operator value="notEmpty"/>
<path value="Appointment/meta/versionId"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="Step4-AppointmentHistoryInstance">
<name value="Step4-AppointmentHistoryInstance"/>
<description value="Retrieve the updated Appointment instance's history in JSON format."/>
<action>
<operation>
<resource value="Appointment"/>
<description value="Retrieve the history for a single, known Appointment using the known identifier."/>
<accept value="json"/>
<contentType value="json"/>
<params value="/${createResourceId}/_history"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
</assert>
</action>
<action>
<assert>
<contentType value="json"/>
</assert>
</action>
<action>
<assert>
<resource value="Bundle"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is more than one record returned."/>
<operator value="greaterThan"/>
<path value="/Bundle/total"/>
<value value="1"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that bundle contains the most recent updated version of the Appointment."/>
<minimumId value="resource-update-min"/>
</assert>
</action>
</test>
<test id="Step5-AppointmentVersionRead">
<name value="Step5-AppointmentVersionRead"/>
<description value="Retrieve a specific version of a Appointment instance in JSON format."/>
<action>
<operation>
<type>
<code value="vread"/>
</type>
<resource value="Appointment"/>
<description value="Retrieve initially created version of the Appointment instance."/>
<accept value="json"/>
<contentType value="json"/>
<params value="/${createResourceId}/_history/${createVersionId}"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
</assert>
</action>
<action>
<assert>
<contentType value="json"/>
</assert>
</action>
<action>
<assert>
<resource value="Appointment"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that bundle contains the created version of the Appointment."/>
<minimumId value="resource-create-min"/>
</assert>
</action>
</test>
<test id="Step6-AppointmentSearchType">
<name value="Step6-AppointmentSearchType"/>
<description value="Search for Appointment resources in JSON format with a identifier = ${searchParamIdentifier}."/>
<action>
<operation>
<type>
<code value="search"/>
</type>
<resource value="Appointment"/>
<description value="Search for the Appointment by identifier."/>
<accept value="json"/>
<contentType value="json"/>
<params value="?identifier=${searchParamIdentifier}"/>
</operation>
</action>
<action>
<assert>
<response value="okay"/>
</assert>
</action>
<action>
<assert>
<contentType value="json"/>
</assert>
</action>
<action>
<assert>
<resource value="Bundle"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one record returned. There could be other Appointment records returned."/>
<operator value="greaterThan"/>
<path value="/Bundle/total"/>
<value value="0"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that bundle contains the most recent updated version of the Appointment."/>
<minimumId value="resource-update-min"/>
</assert>
</action>
</test>
<test id="Step7-AppointmentDelete">
<name value="Step7-AppointmentDelete"/>
<description value="Delete a Appointment instance in JSON format."/>
<action>
<operation>
<type>
<code value="delete"/>
</type>
<resource value="Appointment"/>
<description value="Delete the Appointment instance."/>
<accept value="json"/>
<contentType value="json"/>
<targetId value="update-response"/>
</operation>
</action>
<action>
<assert>
<operator value="in"/>
<responseCode value="200,204"/>
</assert>
</action>
</test>
</TestScript>