<?xml version=“1.0” encoding=“UTF-8”?> <TestScript xmlns=“hl7.org/fhir”>
<id value="connectathon-14-patient-fhirserver-03-read-server-id-json"/> <url value="http://wildfhir.aegis.net/fhir/TestScript/connectathon-14-patient-fhirserver-03-read-server-id-json"/> <name value="FHIR Connectathon 14 - Patient - Formal Testing - FHIR Server - Read - Server Assigned Resource Id - JSON"/> <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-12-30"/> <description value="Patient Track - Formal Testing - tests FHIR Server using the JSON format to read a Patient resource instance created in the test setup where the server assigns the resource id. The destination server must support the create (POST), read, search and delete to insure the Patient resource does not exist or is removed prior to test execution."/> <copyright value="© AEGIS.net, Inc. 2015+"/> <metadata> <capability> <required value="true"/> <description value="Patient create, read, search and delete operations"/> <link value="http://hl7.org/fhir/2017Jan/http.html#create"/> <link value="http://hl7.org/fhir/2017Jan/http.html#read"/> <link value="http://hl7.org/fhir/2017Jan/http.html#delete"/> <link value="http://hl7.org/fhir/2017Jan/http.html#search"/> <link value="http://hl7.org/fhir/2017Jan/patient.html"/> <capabilities> <reference value="../_reference/capabilities/PatientCapabilityStatement.json" /> </capabilities> </capability> </metadata> <fixture id="patient-create"> <resource> <reference value="../_reference/resources/patient-create-server-id.json"/> </resource> </fixture> <profile id="patient-profile"> <reference value="http://hl7.org/fhir/StructureDefinition/Patient"/> </profile> <variable> <name value="patientResourceId"/> <path value="Patient/id"/> <sourceId value="patient-create-search-response"/> </variable> <variable> <name value="patientIdentifier"/> <path value="Patient/identifier/value"/> <sourceId value="patient-create"/> </variable> <variable> <name value="patientFamilyName"/> <path value="Patient/name/family"/> <sourceId value="patient-create"/> </variable> <variable> <name value="patientGivenName"/> <path value="Patient/name/given"/> <sourceId value="patient-create"/> </variable> <variable> <name value="patientGender"/> <path value="Patient/gender"/> <sourceId value="patient-create"/> </variable> <variable> <name value="patientBirthDate"/> <path value="Patient/birthDate"/> <sourceId value="patient-create"/> </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="json"/> <contentType value="json"/> <params value="?identifier=${patientIdentifier}&given=${patientGivenName}&family=${patientFamilyName}"/> </operation> </action> <action> <operation> <type> <system value="http://hl7.org/fhir/testscript-operation-codes"/> <code value="create"/> </type> <resource value="Patient"/> <description value="Create the Patient resource in JSON format on the destination server for subsequent testing of the update operation."/> <accept value="json"/> <contentType value="json"/> <sourceId value="patient-create"/> </operation> </action> <action> <assert> <description value="Confirm that the returned HTTP status is 201(Created)."/> <direction value="response"/> <responseCode value="201"/> </assert> </action> <action> <operation> <type> <system value="http://hl7.org/fhir/testscript-operation-codes"/> <code value="search"/> </type> <resource value="Patient"/> <description value="Search for the created Patient by the unique identifier."/> <accept value="json"/> <contentType value="json"/> <params value="?identifier=${patientIdentifier}"/> <responseId value="patient-create-search-response" /> </operation> </action> <action> <assert> <description value="Confirm that the returned HTTP status is 200(OK)."/> <direction value="response"/> <responseCode value="200"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+json'."/> <direction value="response"/> <contentType value="json"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource type is Bundle."/> <direction value="response"/> <resource value="Bundle"/> </assert> </action> </setup> <test id="01-ReadPatient"> <name value="ReadPatient"/> <description value="Test the update operation with JSON content. The expected response content is the created Patient resource from the setup in JSON format."/> <action> <operation> <type> <system value="http://hl7.org/fhir/testscript-operation-codes"/> <code value="read"/> </type> <resource value="Patient"/> <description value="Read the updated Patient and verify the contents match the updated version 2."/> <accept value="json"/> <contentType value="json"/> <params value="/${patientResourceId}"/> </operation> </action> <action> <assert> <description value="Confirm that the returned HTTP status is 200(OK)."/> <direction value="response"/> <responseCode value="200"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+json'."/> <direction value="response"/> <contentType value="json"/> </assert> </action> <action> <assert> <description value="Confirm that the returned HTTP Header ETag is present. Warning only as the server may not support versioning."/> <direction value="response"/> <headerField value="ETag"/> <operator value="notEmpty"/> <warningOnly value="true"/> </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."/> <direction value="response"/> <headerField value="Last-Modified"/> <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."/> <direction value="response"/> <headerField value="Location"/> <operator value="notEmpty"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource type is Patient."/> <direction value="response"/> <resource value="Patient"/> </assert> </action> <action> <assert> <description value="Confirm that the returned Patient conforms to the base FHIR specification."/> <direction value="response"/> <validateProfileId value="patient-profile"/> </assert> </action> <action> <assert> <description value="Confirm that the resource version is present. Warning only as the server may not support versioning."/> <direction value="response"/> <operator value="notEmpty"/> <path value=".meta.versionId"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource contains the expected retained identifier element and value. Warning only to provide users with reviewable results."/> <direction value="response"/> <operator value="equals"/> <path value=".identifier[0].value"/> <value value="${patientIdentifier}"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource contains the expected retained family name element and value. Warning only to provide users with reviewable results."/> <direction value="response"/> <operator value="equals"/> <path value=".name[0].family"/> <value value="${patientFamilyName}"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource contains the expected retained given name element and value. Warning only to provide users with reviewable results."/> <direction value="response"/> <operator value="equals"/> <path value=".name[0].given[0]"/> <value value="${patientGivenName}"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource contains the expected retained gender element and value. Warning only to provide users with reviewable results."/> <direction value="response"/> <operator value="equals"/> <path value=".gender"/> <value value="${patientGender}"/> <warningOnly value="true"/> </assert> </action> <action> <assert> <description value="Confirm that the returned resource contains the expected retained birthDate element and value. Warning only to provide users with reviewable results."/> <direction value="response"/> <operator value="equals"/> <path value=".birthDate"/> <value value="${patientBirthDate}"/> <warningOnly value="true"/> </assert> </action> </test>
</TestScript>