Name | /FHIR1-6-0-Basic/P-R/Patient/Client Assigned Id/Patient-client-id-xml |
Description | FHIR Server Patient Basic Operation Tests - XML - Client Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. Support for referenced resource type Organization Update, Delete and Search is also required. |
Version | 1 | Latest | 1 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="Patient-client-id-xml"/>
<url value="http://wildfhir.aegis.net/fhir/TestScript/Patient-client-id-xml"/>
<name value="FHIR Server Patient Basic Operation Tests - XML - Client Assigned Resource Id"/>
<status value="active"/>
<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-10-06"/>
<description value="FHIR Server Patient Basic Operation Tests - XML - Client Assigned Resource Id - Create, Delete, History, Read, Search, Update, Vread. Support for referenced resource type Organization Update, Delete and Search is also required."/>
<useContext>
<coding>
<system value="urn:iso:std:iso:3166"/>
<code value="US"/>
<display value="United States of America (the)"/>
</coding>
</useContext>
<requirements value="Patient Create, Delete, History, Read, Search, Update, Vread; Organization Update, Delete and Search"/>
<copyright value="© AEGIS.net, Inc. 2015+"/>
<metadata>
<capability>
<required value="true"/>
<description value="Patient and Organization required capabilities."/>
<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"/>
<link value="http://hl7.org/fhir/http.html#history"/>
<link value="http://hl7.org/fhir/http.html#vread"/>
<link value="http://hl7.org/fhir/http.html#search"/>
<link value="http://hl7.org/fhir/patient.html"/>
<conformance>
<reference value="../_reference/conformance/PatientConformance.xml"/>
</conformance>
</capability>
</metadata>
<fixture id="resource-create">
<resource>
<reference value="../_reference/resources/Patient-create-client-id.xml"/>
</resource>
</fixture>
<fixture id="resource-create-min">
<resource>
<reference value="../_reference/resources/Patient-create-min.xml"/>
</resource>
</fixture>
<fixture id="resource-update">
<resource>
<reference value="../_reference/resources/Patient-update.xml"/>
</resource>
</fixture>
<fixture id="resource-update-min">
<resource>
<reference value="../_reference/resources/Patient-update-min.xml"/>
</resource>
</fixture>
<fixture id="reference-organization-create">
<resource>
<reference value="../_reference/resources/Organization-create-client-id.xml"/>
</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/Patient"/>
</profile>
<variable>
<name value="createResourceId"/>
<path value="Patient/id"/>
<sourceId value="resource-create"/>
</variable>
<variable>
<name value="createVersionId"/>
<path value="Patient/meta/versionId"/>
<sourceId value="create-read-response"/>
</variable>
<variable>
<name value="searchParamIdentifier"/>
<path value="Patient/identifier/value"/>
<sourceId value="resource-create"/>
</variable>
<variable>
<name value="referenceOrganizationResourceId"/>
<path value="Organization/id"/>
<sourceId value="reference-organization-create"/>
</variable>
<setup>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="Patient"/>
<description value="Delete operation to insure the Patient does not exist on the server."/>
<accept value="xml"/>
<contentType value="none"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="Organization"/>
<description value="Delete operation to insure the referenced Organization does not exist on the server."/>
<accept value="xml"/>
<contentType value="none"/>
<params value="/${referenceOrganizationResourceId}"/>
</operation>
</action>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="updateCreate"/>
</type>
<resource value="Organization"/>
<description value="Create the referenced Organization resource needed for referential integrity from the Patient."/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${referenceOrganizationResourceId}"/>
<sourceId value="reference-organization-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"/>
</assert>
</action>
</setup>
<test id="Step1-CreateNewPatient">
<name value="Step1-CreateNewPatient"/>
<description value="Create a new Patient in XML format where the client assigns the resource id."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="updateCreate"/>
</type>
<resource value="Patient"/>
<description value="Create Patient with client assigned resource id."/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}"/>
<sourceId value="resource-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"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
</test>
<test id="Step2-ReadPatient">
<name value="Step2-ReadPatient"/>
<description value="Read the Patient in XML format created in step 1."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Read using params element"/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}"/>
<responseId value="create-read-response"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<response value="okay"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
<action>
<assert>
<description value="Validate that the returned resource conforms to the corresponding FHIR resource profile."/>
<validateProfileId value="resource-profile"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource contains the expected retained elements and values. Warning only to provide users with reviewable results."/>
<minimumId value="resource-create-min"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="Step3-UpdatePatient">
<name value="Step3-UpdatePatient"/>
<description value="Update the Patient in XML format created in step 1 then Read it again for verification."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="update"/>
</type>
<resource value="Patient"/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}"/>
<sourceId value="resource-update"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<responseCode value="200"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Location is present. Warning only as this is optional but servers are encouraged to return this."/>
<headerField value="Location"/>
<operator value="notEmpty"/>
<warningOnly value="true"/>
</assert>
</action>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<responseCode value="200"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
<action>
<assert>
<description value="Validate that the returned resource conforms to the corresponding FHIR resource profile."/>
<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. Warning only to provide users with reviewable results."/>
<minimumId value="resource-update-min"/>
<warningOnly value="true"/>
</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="Patient/meta/versionId"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="Step4-PatientHistoryInstance">
<name value="Step4-PatientHistoryInstance"/>
<description value="Retrieve the updated Patient instance's history in XML format."/>
<action>
<operation>
<resource value="Patient"/>
<description value="Retrieve the history for a single, known Patient using the known identifier."/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}/_history"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<responseCode value="200"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the response payload contains the Bundle resource type."/>
<resource value="Bundle"/>
</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."/>
<operator value="greaterThan"/>
<path value="/Bundle/total"/>
<value value="1"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that returned bundle first entry contains the most recent updated version of the resource. Warning only to provide users with reviewable results."/>
<minimumId value="resource-update-min"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="Step5-PatientVersionRead">
<name value="Step5-PatientVersionRead"/>
<description value="Retrieve a specific version of a Patient instance in XML format."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="vread"/>
</type>
<resource value="Patient"/>
<description value="Retrieve initially created version of the Patient instance."/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}/_history/${createVersionId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<responseCode value="200"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the response payload contains the expected resource type."/>
<resource value="Patient"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the response payload contains the created version of the resource. Warning only to provide users with reviewable results."/>
<minimumId value="resource-create-min"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="Step6-PatientSearchType">
<name value="Step6-PatientSearchType"/>
<description value="Search for Patient resources in XML format with a identifier = ${searchParamIdentifier}."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="search"/>
</type>
<resource value="Patient"/>
<description value="Search for the Patient by identifier."/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="?identifier=${searchParamIdentifier}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 200(OK)."/>
<responseCode value="200"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned content format is XML ('application/fhir+xml')."/>
<contentType value="xml"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the response payload contains the Bundle resource type."/>
<resource value="Bundle"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that there is at least one record returned. There could be other Patient records returned."/>
<operator value="greaterThan"/>
<path value="/Bundle/total"/>
<value value="0"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that returned bundle first entry contains the most recent updated version of the resource. Warning only to provide users with reviewable results."/>
<minimumId value="resource-update-min"/>
<warningOnly value="true"/>
</assert>
</action>
</test>
<test id="Step7-PatientDelete">
<name value="Step7-PatientDelete"/>
<description value="Delete a Patient instance in XML format."/>
<action>
<operation>
<type>
<system value="http://hl7.org/fhir/testscript-operation-codes"/>
<code value="delete"/>
</type>
<resource value="Patient"/>
<description value="Delete the Patient instance."/>
<accept value="xml"/>
<contentType value="xml"/>
<params value="/${createResourceId}"/>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 204(No Content)."/>
<responseCode value="204"/>
</assert>
</action>
</test>
</TestScript>