<?xml version=“1.0” encoding=“UTF-8”?> <TestScript xmlns=“hl7.org/fhir”>
<id value="connectathon-14-patient-base-client-id-xml"/> <url value="http://wildfhir.aegis.net/fhir/TestScript/connectathon-14-patient-base-client-id-xml"/> <name value="FHIR Connectathon 14 - Patient - 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-12-10"/> <description value="Baseline tests using the XML format to create, update, retrieve history and search a patient without extensions where the client assigns the resource id. The destination server must support conditional create."/> <copyright value="© AEGIS.net, Inc. 2015+"/> <metadata> <capability> <required value="true"/> <description value="Patient read, update, delete, history-instance and search-type operations"/> <link value="http://hl7.org/fhir/207Jan/http.html#read"/> <link value="http://hl7.org/fhir/207Jan/http.html#update"/> <link value="http://hl7.org/fhir/207Jan/http.html#delete"/> <link value="http://hl7.org/fhir/207Jan/http.html#history"/> <link value="http://hl7.org/fhir/207Jan/http.html#search"/> <link value="http://hl7.org/fhir/207Jan/patient.html"/> <capabilities> <reference value="../_reference/capabilities/PatientCapabilityStatement.xml" /> </capabilities> </capability> </metadata> <fixture id="patient-create-PeterChalmers"> <resource> <reference value="../_reference/resources/patient-create-client-id-PeterChalmers.xml"/> </resource> </fixture> <fixture id="patient-create-PeterChalmers-min"> <resource> <reference value="../_reference/resources/patient-create-PeterChalmers-min.xml"/> </resource> </fixture> <fixture id="patient-update-PeterChalmers"> <resource> <reference value="../_reference/resources/patient-update-PeterChalmers.xml"/> </resource> </fixture> <fixture id="patient-update-PeterChalmers-min"> <resource> <reference value="../_reference/resources/patient-update-PeterChalmers-min.xml"/> </resource> </fixture> <profile id="bundle-profile"> <reference value="http://hl7.org/fhir/StructureDefinition/Bundle"/> </profile> <profile id="patient-profile"> <reference value="http://hl7.org/fhir/StructureDefinition/Patient"/> </profile> <variable> <name value="createResourceId"/> <path value="Patient/id"/> <sourceId value="patient-read-PeterChalmers"/> </variable> <variable> <name value="createIdentifier"/> <path value="Patient/identifier/value"/> <sourceId value="patient-create-PeterChalmers"/> </variable> <variable> <name value="searchFamilyName"/> <path value="Patient/name/family"/> <sourceId value="patient-create-PeterChalmers"/> </variable> <variable> <name value="searchGivenName"/> <path value="Patient/name/given"/> <sourceId value="patient-create-PeterChalmers"/> </variable> <setup> <action> <operation> <type> <system value="http://hl7.org/fhir/testscript-operation-codes"/> <code value="delete"/> </type> <resource value="Patient"/> <description value="System-generated search and delete operations from conditional delete to insure the patient does not exist on the server."/> <accept value="xml"/> <contentType value="xml"/> <params value="?given=${searchGivenName}&family=${searchFamilyName}"/> </operation> </action> </setup> <test id="Step1-RegisterNewPatient"> <name value="RegisterNewPatient"/> <description value="Create a new patient, no extensions where the client assigns the resource id using XML."/> <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="/${createIdentifier}"/> <responseId value="create-response" /> <sourceId value="patient-create-PeterChalmers"/> </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 format is XML."/> <contentType value="xml"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/> <headerField value="Last-Modified"/> <operator value="notEmpty"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/> <headerField value="ETag"/> <operator value="notEmpty"/> <warningOnly value="true"/> </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"/> <description value="Read using params element"/> <accept value="xml"/> <contentType value="xml"/> <params value="/${createIdentifier}"/> <responseId value="patient-read-PeterChalmers" /> </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 format is XML."/> <contentType value="xml"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource type is Patient."/> <resource value="Patient"/> </assert> </action> <action> <assert> <description value="Validate that the returned resource conforms to the base FHIR Patient profile."/> <validateProfileId value="patient-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="patient-create-PeterChalmers-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="Step2-UpdatePatient"> <name value="Step2-UpdatePatient"/> <description value="Update the patient's birth date, no extensions."/> <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}"/> <responseId value="update-birth-response" /> <sourceId value="patient-update-PeterChalmers"/> </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 format is XML."/> <contentType value="xml"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning."/> <headerField value="Last-Modified"/> <operator value="notEmpty"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/> <headerField value="ETag"/> <operator value="notEmpty"/> <warningOnly value="true"/> </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)."/> <response value="okay"/> </assert> </action> <action> <assert> <description value="Confirm that the returned format is XML."/> <contentType value="xml"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource type is Patient."/> <resource value="Patient"/> </assert> </action> <action> <assert> <description value="Validate that the returned resource conforms to the base FHIR Patient profile."/> <validateProfileId value="patient-profile"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource contains the expected updated and retained elements and values. Warning only to provide users with reviewable results."/> <minimumId value="patient-update-PeterChalmers-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> <action> <assert> <description value="Additional confirmation that birthDate got updated to the expected value."/> <path value="Patient/birthDate"/> <value value="1975-01-02"/> </assert> </action> </test> <test id="Step3-PatientHistory"> <name value="Step3-PatientHistory"/> <description value="Retrieve the patient's history."/> <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)."/> <response value="okay"/> </assert> </action> <action> <assert> <description value="Confirm that the returned format is XML."/> <contentType value="xml"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource type is Bundle."/> <resource value="Bundle"/> </assert> </action> <action> <assert> <description value="Validate that the returned resource conforms to the base FHIR Bundle profile."/> <validateProfileId value="bundle-profile"/> </assert> </action> <action> <assert> <description value="Confirm that the returned Bundle.type is history."/> <path value="/Bundle/type"/> <value value="history"/> </assert> </action> <action> <assert> <description value="Confirm that there is more than one patient history resource returned. Warning only as the server may not support versioning."/> <operator value="greaterThan"/> <path value="/Bundle/total"/> <value value="1"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the Bundle total value matches or is greater than the number of entries in the Bundle. Warning only to provide users with reviewable results."/> <expression value="Bundle.total.toInteger() >= entry.count()"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that bundle contains the most recent updated version of the patient. Warning only to provide users with reviewable results."/> <minimumId value="patient-update-PeterChalmers-min"/> <warningOnly value="true"/> </assert> </action> </test> <test id="Step4-PatientSearch"> <name value="Step4-PatientSearch"/> <description value="Search for a patient with the name 'James Chalmers'."/> <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 James Chalmers. The destination server must support the family and given search parameters."/> <accept value="xml"/> <contentType value="xml"/> <params value="?given=${searchGivenName}&family=${searchFamilyName}"/> </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 format is XML."/> <contentType value="xml"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource type is Bundle."/> <resource value="Bundle"/> </assert> </action> <action> <assert> <description value="Validate that the returned resource conforms to the base FHIR Bundle profile."/> <validateProfileId value="bundle-profile"/> </assert> </action> <action> <assert> <description value="Confirm that the returned Bundle.type is searchset."/> <path value="/Bundle/type"/> <value value="searchset"/> </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 the Bundle total value matches or is greater than the number of entries in the Bundle. Warning only to provide users with reviewable results."/> <expression value="Bundle.total.toInteger() >= entry.count()"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that bundle contains the most recent updated version of the patient. Warning only to provide users with reviewable results."/> <minimumId value="patient-update-PeterChalmers-min"/> <warningOnly value="true"/> </assert> </action> </test> <test id="Step5-PatientDelete"> <name value="Step5-PatientDelete"/> <description value="Delete the patient James Chalmers. Execute a subsequent read with an expected response of gone or not found."/> <action> <operation> <type> <system value="http://hl7.org/fhir/testscript-operation-codes"/> <code value="delete"/> </type> <resource value="Patient"/> <description value="Delete the patient James Chalmers on the destination server in order to leave the server in the same state before this test execution."/> <accept value="xml"/> <contentType value="xml"/> <params value="/${createResourceId}"/> </operation> </action> <action> <assert> <description value="Confirm that the returned HTTP status is 200(OK) or 204(No Content)."/> <operator value="in"/> <responseCode value="200,204"/> </assert> </action> <action> <operation> <type> <system value="http://hl7.org/fhir/testscript-operation-codes"/> <code value="read"/> </type> <resource value="Patient"/> <description value="Read deleted patient resource with an expected response of gone or not found"/> <accept value="xml"/> <contentType value="xml"/> <params value="/${createResourceId}"/> </operation> </action> <action> <assert> <description value="Confirm that the returned HTTP status is 404(Not Found) or 410(Gone)."/> <operator value="in"/> <responseCode value="404,410"/> </assert> </action> </test>
</TestScript>