FHIR Testing IG
0.1.0-SNAPSHOT - Draft International flag

FHIR Testing IG, published by HL7 International / FHIR Infrastructure. This guide is not an authorized publication; it is the continuous build for version 0.1.0-SNAPSHOT built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/fhir-testing-ig/ and changes regularly. See the Directory of published versions

TestScript: TestScript Example Search

Computable Name:

Language: en

url: http://hl7.org/fhir/TestScript/testscript-example-search

identifier: Uniform Resource Identifier (URI)/urn:oid:2.16.840.1.113883.4.642.12.3

version: 1.0

name: TestScriptExampleSearch

title: TestScript Example Search

status: Draft

experimental: true

date: 2017-01-18

publisher: HL7

contact: Support: support@HL7.org

description:

TestScript example resource with simple Patient search test. The read tests will utilize user defined dynamic variables that will hold the Patient search parameter values.

jurisdiction: United States of America

purpose:

Patient Search Operation

copyright:

© HL7.org 2011+

metadata

Links

-UrlDescription
*http://hl7.org/fhir/patient.htmlDemographics and other administrative information about an individual or animal receiving care or other health-related services.

Capabilities

-RequiredValidatedDescriptionLinkCapabilities
*truefalsePatient Search Operationhttp://hl7.org/fhir/http.html#searchhttp://hl7.org/fhir/CapabilityStatement/example

fixture

id

fixture-patient-create

autocreate: false

autodelete: false

resource: Peter Chalmers

profile: Bundle

variable

name: PatientCreateLocation

headerField: Location

sourceId: PatientCreateResponse

variable

name: PatientSearchFamilyName

description: Enter patient search criteria for a known family name on the target system

hint: [Family name]

variable

name: PatientSearchGivenName

description: Enter patient search criteria for a known given name on the target system

hint: [Given name]

variable

name: PatientSearchBundleTotal

description: Evaluate the returned Patient searchset Bundle.total value

Expressions

-LanguageExpression
*text/fhirpathBundle.total.toInteger()

setup

action

Operations

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
*FHIR Restful Interactions: search (search)http://hl7.org/fhir/StructureDefinition/PatientTest simple search to verify server support.xmltrue?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH

action

Asserts

-DescriptionDirectionOperatorRequestURLStopTestOnFailWarningOnly
*Confirm that the request url contains the family search parameter.requestcontainsfamilyfalsefalse

action

Asserts

-DescriptionDirectionResponseCodeStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 200(OK).response200falsefalse

action

Asserts

-DescriptionResourceStopTestOnFailWarningOnly
*Confirm that the returned resource type is Bundle.http://hl7.org/fhir/StructureDefinition/Bundlefalsefalse

action

Asserts

-DescriptionNavigationLinksStopTestOnFailWarningOnly
*Confirm that the returned Bundle correctly defines the navigation links.truefalsefalse

test

id

01-PatientCreateSearch

name: Patient Create Search

description: Create a Patient resource and capture the returned HTTP Header Location. Then search for (read) that Patient using the Location URL value and validate the response.

action

Operations

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlResponseIdSourceId
*FHIR Restful Interactions: create (create)http://hl7.org/fhir/StructureDefinition/PatientCreate a Patient resource and capture the returned HTTP Header Location.xmlxmltruePatientCreateResponsefixture-patient-create

action

Asserts

-DescriptionResponseStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 201(Created).Createdfalsefalse

action

Asserts

-DescriptionDirectionHeaderFieldOperatorStopTestOnFailWarningOnly
*Confirm that the returned HTTP Header Location is present.responseLocationnotEmptyfalsefalse

action

Operations

-TypeDescriptionAcceptEncodeRequestUrlUrl
*FHIR Restful Interactions: read (read)Read the created Patient using the captured Location URL value.xmltrue${PatientCreateLocation}

action

Asserts

-DescriptionResponseStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 200(OK).OKfalsefalse

action

Asserts

-DescriptionResourceStopTestOnFailWarningOnly
*Confirm that the returned resource type is Patient.http://hl7.org/fhir/StructureDefinition/Patientfalsefalse

test

id

02-PatientSearchDynamic

name: Patient Search Dynamic

description: Search for Patient resources using the user defined dynamic variables ${PatientSearchFamilyName} and ${PatientSearchGivenName} and validate response.

action

Operations

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
*FHIR Restful Interactions: search (search)http://hl7.org/fhir/StructureDefinition/PatientSearch for Patient resources on the destination test system.xmltrue?family=${PatientSearchFamilyName}&given=${PatientSearchGivenName}

action

Asserts

-DescriptionResponseStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 200(OK).OKfalsefalse

action

Asserts

-DescriptionContentTypeStopTestOnFailWarningOnly
*Confirm that the returned format is XML.xmlfalsefalse

action

Asserts

-DescriptionResourceStopTestOnFailWarningOnly
*Confirm that the returned resource type is Bundle.http://hl7.org/fhir/StructureDefinition/Bundletruefalse

action

Asserts

-DescriptionStopTestOnFailValidateProfileIdWarningOnly
*Confirm that the returned Bundle conforms to the base FHIR specification.falsebundle-profilefalse

action

assert

description: Confirm that the returned Bundle type equals 'searchset'.

Expressions

-LanguageExpression
*application/xmlfhir:Bundle/fhir:type/@value

operator: equals

stopTestOnFail: false

value: searchset

warningOnly: false

action

assert

description: Confirm that the returned Bundle total is greater than or equal to the number of returned entries.

Expressions

-LanguageExpression
*text/fhirpathBundle.total.toInteger() >= entry.count()

stopTestOnFail: false

warningOnly: false