Name | /FHIR3-5-0-Advanced/Patient/01-read/fhir-api-r4-patient-read-04-conditional-found-notmodified |
Description | FHIR API R4 (v3.5.0) Advanced Operation Tests - Patient conditional read test suite against a single server for a known, valid resource instance. All tests perform the read operation for a specified Patient resource id representing a known valid Patient. Assertions test all required and optional response HTTP Headers and validate the returned payload. |
Version | 2 | Latest | 2 |
<?xml version="1.0" encoding="UTF-8"?>
<TestScript xmlns="http://hl7.org/fhir">
<id value="fhir-api-r4-patient-read-04-conditional-found-notmodified"/>
<text>
<status value="generated"/>
<div xmlns="http://www.w3.org/1999/xhtml">
<p>FHIR API R4 (v3.5.0) - Patient Conditional Read Found and Not Modified Resource Suite</p>
</div>
</text>
<url value="http://wildfhir.aegis.net/fhir3-3-0/TestScript/fhir-api-r4-patient-read-04-conditional-found-notmodified"/>
<name value="FHIR API R4 (v3.5.0) - Patient Conditional Read Found and Not Modified Resource Suite"/>
<status value="active"/>
<date value="2018-08-24"/>
<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 API R4 (v3.5.0) Advanced Operation Tests - Patient conditional read test suite against a single server for a known, valid resource instance. All tests perform the read operation for a specified Patient resource id representing a known valid Patient. Assertions test all required and optional response HTTP Headers and validate the returned payload."/>
<copyright value="(c) AEGIS.net, Inc. 2015+"/>
<fixture id="resource-read-json-min">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="./_reference/resources/Patient-read-json-min.json"/>
</resource>
</fixture>
<fixture id="resource-read-xml-min">
<autocreate value="false"/>
<autodelete value="false"/>
<resource>
<reference value="./_reference/resources/Patient-read-xml-min.xml"/>
</resource>
</fixture>
<profile id="resource-profile">
<reference value="http://hl7.org/fhir/StructureDefinition/Patient"/>
</profile>
<variable>
<name value="ValidPatientResourceId"/>
<description value="Enter a resource id for a valid Patient resource on the destination system."/>
<hint value="[Valid Resource Id]"/>
</variable>
<variable>
<name value="DateTimeIfModifiedSinceFalse"/>
<description value="Enter a datetime value after the lastUpdated value for the Patient resource. The If-Modified-Since condition operation is expected to return false for this value."/>
<hint value="[wkday, dd Mmm yyy hh:mm:ss GMT]"/>
</variable>
<variable>
<name value="DateTimeIfModifiedSinceTrue"/>
<description value="Enter a datetime value before the lastUpdated value for the Patient resource. The If-Modified-Since condition operation is expected to return true for this value."/>
<hint value="[wkday, dd Mmm yyy hh:mm:ss GMT]"/>
</variable>
<variable>
<name value="ETagIfNoneMatchFalse"/>
<description value="Enter the ETag value that represents the versionId where the If-None-Match conditional operation is expected to return false."/>
<hint value="[W/"versionId"]"/>
</variable>
<variable>
<name value="ETagIfNoneMatchTrue"/>
<description value="Enter the ETag value that represents the versionId where the If-None-Match conditional operation is expected to return true."/>
<hint value="[W/"versionId"]"/>
</variable>
<rule id="rule-assertContentTypeIfBody">
<resource>
<reference value="/FHIRCommon/_reference/rule/AssertHeaderIfBody.groovy"/>
</resource>
<param>
<name value="header"/>
<value value="Content-Type"/>
</param>
<param>
<name value="headerOperator"/>
<value value="notEmpty"/>
</param>
<param>
<name value="bodyOperator"/>
<value value="notEmpty"/>
</param>
</rule>
<ruleset id="ruleset-versioning-headers">
<resource>
<reference value="/FHIRCommon/_reference/ruleset/RuleSet-VersioningHeaders-Groovy.xml"/>
</resource>
<rule>
<ruleId value="assertETagIfSupported"/>
<param>
<name value="resource"/>
<value value="Patient"/>
</param>
</rule>
<rule>
<ruleId value="assertLastModifiedIfSupported"/>
<param>
<name value="resource"/>
<value value="Patient"/>
</param>
</rule>
</ruleset>
<test id="01-ReadValidJSONIfModifiedSinceFalse">
<name value="ReadValidJSONIfModifiedSinceFalse"/>
<description value="Test the conditional read operation with HTTP Header If-Modified-Since set to the false value. The expected HTTP response is 304 (Not Modified) and no response content returned."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-Modified-Since set to the false value. The response content is expected to be empty."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-Modified-Since"/>
<value value="${DateTimeIfModifiedSinceFalse}"/>
</requestHeader>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 304(Not Modified)."/>
<direction value="response"/>
<responseCode value="304"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected HTTP Header Content-Type."/>
<direction value="response"/>
<rule>
<ruleId value="rule-assertContentTypeIfBody"/>
</rule>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="02-ReadValidXMLIfModifiedSinceFalse">
<name value="ReadValidXMLIfModifiedSinceFalse"/>
<description value="Test the conditional read operation with HTTP Header If-Modified-Since set to the false value. The expected HTTP response is 304 (Not Modified) and no response content returned."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-Modified-Since set to the false value. The response content is expected to be empty."/>
<accept value="xml"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-Modified-Since"/>
<value value="${DateTimeIfModifiedSinceFalse}"/>
</requestHeader>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 304(Not Modified)."/>
<direction value="response"/>
<responseCode value="304"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected HTTP Header Content-Type."/>
<direction value="response"/>
<rule>
<ruleId value="rule-assertContentTypeIfBody"/>
</rule>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="03-ReadValidJSONIfModifiedSinceTrue">
<name value="ReadValidJSONIfModifiedSinceTrue"/>
<description value="Test the conditional read operation with HTTP Header If-Modified-Since set to the true value. The expected response content is the found Patient resource in JSON format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-Modified-Since set to the true value."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-Modified-Since"/>
<value value="${DateTimeIfModifiedSinceTrue}"/>
</requestHeader>
</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 HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="false"/>
</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"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="application/fhir+json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only due to case-sensitive comparison."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="charset=utf-8"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<ruleset>
<rulesetId value="ruleset-versioning-headers"/>
</ruleset>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource type is Patient."/>
<resource value="Patient"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient conforms to the base FHIR specification."/>
<validateProfileId value="resource-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient contains the minimum JSON format."/>
<minimumId value="resource-read-json-min"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="04-ReadValidXMLIfModifiedSinceTrue">
<name value="ReadValidXMLIfModifiedSinceTrue"/>
<description value="Test the conditional read operation with HTTP Header If-Modified-Since set to the true value. The expected response content is the found Patient resource in XML format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-Modified-Since set to the true value."/>
<accept value="xml"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-Modified-Since"/>
<value value="${DateTimeIfModifiedSinceTrue}"/>
</requestHeader>
</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 HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only due to case-sensitive comparison."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="charset=utf-8"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<ruleset>
<rulesetId value="ruleset-versioning-headers"/>
</ruleset>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource type is Patient."/>
<resource value="Patient"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient conforms to the base FHIR specification."/>
<validateProfileId value="resource-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient contains the minimum XML format."/>
<minimumId value="resource-read-xml-min"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="05-ReadValidJSONIfNoneMatchFalse">
<name value="ReadValidJSONIfNoneMatchFalse"/>
<description value="Test the conditional read operation with HTTP Header If-None-Match set to the false value. The expected HTTP response is 304 (Not Modified) and no response content returned."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-None-Match set to the false value. The response content is expected to be empty."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-None-Match"/>
<value value="${ETagIfNoneMatchFalse}"/>
</requestHeader>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 304(Not Modified)."/>
<direction value="response"/>
<responseCode value="304"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected HTTP Header Content-Type."/>
<direction value="response"/>
<rule>
<ruleId value="rule-assertContentTypeIfBody"/>
</rule>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="06-ReadValidXMLIfNoneMatchFalse">
<name value="ReadValidXMLIfNoneMatchFalse"/>
<description value="Test the conditional read operation with HTTP Header If-None-Match set to the false value. The expected HTTP response is 304 (Not Modified) and no response content returned."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-None-Match set to the false value. The response content is expected to be empty."/>
<accept value="xml"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-None-Match"/>
<value value="${ETagIfNoneMatchFalse}"/>
</requestHeader>
</operation>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP status is 304(Not Modified)."/>
<direction value="response"/>
<responseCode value="304"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected HTTP Header Content-Type."/>
<direction value="response"/>
<rule>
<ruleId value="rule-assertContentTypeIfBody"/>
</rule>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="07-ReadValidJSONIfNoneMatchTrue">
<name value="ReadValidJSONIfNoneMatchTrue"/>
<description value="Test the conditional read operation with HTTP Header If-None-Match set to the true value. The expected response content is the found Patient resource in JSON format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-None-Match set to the true value. The response asserts for all the optional HTTP Headers will be warning only."/>
<accept value="json"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-None-Match"/>
<value value="${ETagIfNoneMatchTrue}"/>
</requestHeader>
</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 HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="false"/>
</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"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="application/fhir+json"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only due to case-sensitive comparison."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="charset=utf-8"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<ruleset>
<rulesetId value="ruleset-versioning-headers"/>
</ruleset>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource type is Patient."/>
<resource value="Patient"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient conforms to the base FHIR specification."/>
<validateProfileId value="resource-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient contains the minimum JSON format."/>
<minimumId value="resource-read-json-min"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
<test id="08-ReadValidXMLIfNoneMatchTrue">
<name value="ReadValidXMLIfNoneMatchTrue"/>
<description value="Test the conditional read operation with HTTP Header If-None-Match set to the true value. The expected response content is the found Patient resource in XML format."/>
<action>
<operation>
<type>
<system value="http://terminology.hl7.org/CodeSystem/testscript-operation-codes"/>
<code value="read"/>
</type>
<resource value="Patient"/>
<description value="Patient read operation with HTTP Header If-None-Match set to the true value. The response asserts for all the optional HTTP Headers will be warning only."/>
<accept value="xml"/>
<contentType value="none"/>
<encodeRequestUrl value="true"/>
<params value="/${ValidPatientResourceId}"/>
<requestHeader>
<field value="If-None-Match"/>
<value value="${ETagIfNoneMatchTrue}"/>
</requestHeader>
</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 HTTP Header Content-Type is present."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="notEmpty"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type contains the FHIR mime-type 'application/fhir+xml'."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="application/fhir+xml"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned HTTP Header Content-Type contains 'charset=utf-8'. Warning only due to case-sensitive comparison."/>
<direction value="response"/>
<headerField value="Content-Type"/>
<operator value="contains"/>
<value value="charset=utf-8"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Complex ruleset assertion to conditionally validate expected versioning HTTP Headers."/>
<direction value="response"/>
<ruleset>
<rulesetId value="ruleset-versioning-headers"/>
</ruleset>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned resource type is Patient."/>
<resource value="Patient"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient conforms to the base FHIR specification."/>
<validateProfileId value="resource-profile"/>
<warningOnly value="false"/>
</assert>
</action>
<action>
<assert>
<description value="Confirm that the returned Patient contains the minimum XML format."/>
<minimumId value="resource-read-xml-min"/>
<warningOnly value="false"/>
</assert>
</action>
</test>
</TestScript>