# text.div
Generated Narrative with Details

id: testscript-example-search

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

identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.9881

version: 1.0

name: TestScript Example Search

status: draft

experimental: true

date: 18/01/2017

publisher: HL7

contact:

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 (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America (the)'})

purpose: Patient Search Operation

copyright: © HL7.org 2011+

metadata

Links

- | Url | Description
* | http://hl7.org/fhir/patient.html | Demographics and other administrative information about an individual or animal receiving care or other health-related services.

Capabilities

- | Required | Validated | Description | Link | Capabilities
* | true | false | Patient Search Operation | http://hl7.org/fhir/http.html#search | CapabilityStatement/example

Fixtures

- | Autocreate | Autodelete | Resource
* | false | false | Peter Chalmers

profile: Generated Summary: url: http://hl7.org/fhir/StructureDefinition/Bundle; version: 4.0.0; name: Bundle; ACTIVE; date: 27/12/2018 10:37:54 PM; publisher: Health Level Seven International (FHIR Infrastructure); description: A container for a collection of resources.; 4.0.0; RESOURCE; type: Bundle; baseDefinition: http://hl7.org/fhir/StructureDefinition/Resource; SPECIALIZATION

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

expression: Bundle.total.toInteger()

setup

action

Operations

- | Type | Resource | Description | Accept | EncodeRequestUrl | Params
* | Search (Details: http://terminology.hl7.org/CodeSystem/testscript-operation-codes code search = 'Search', stated as 'null') | Patient | Test simple search to verify server support. | xml | true | ?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH

action

Asserts

- | Description | Direction | Operator | RequestURL | WarningOnly
* | Confirm that the request url contains the family search parameter. | request | contains | family | false

action

Asserts

- | Description | Direction | ResponseCode | WarningOnly
* | Confirm that the returned HTTP status is 200(OK). | response | 200 | false

action

Asserts

- | Description | Resource | WarningOnly
* | Confirm that the returned resource type is Bundle. | Bundle | false

action

Asserts

- | Description | NavigationLinks | WarningOnly
* | Confirm that the returned Bundle correctly defines the navigation links. | true | false

test

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

-
*

action

Asserts

-
*

action

Asserts

-
*

action

Operations

-
*

action

Asserts

-
*

action

Asserts

-
*

test

name: Patient Search Dynamic

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

action

Operations

-
*

action

Asserts

-
*

action

Asserts

-
*

action

Asserts

-
*

action

Asserts

-
*

action

Asserts

-
*

action

Asserts

-
*

# 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.

# metadata.link[].description
Demographics and other administrative information about an individual or animal receiving care or other health-related services.

# variable[].description
Enter patient search criteria for a known family name on the target system

# variable[].description
Enter patient search criteria for a known given name on the target system

# variable[].description
Evaluate the returned Patient searchset Bundle.total value

# setup.action[].operation.description
Test simple search to verify server support.

# setup.action[].assert.description
Confirm that the request url contains the family search parameter.

# setup.action[].assert.description
Confirm that the returned HTTP status is 200(OK).

# setup.action[].assert.description
Confirm that the returned resource type is Bundle.

# setup.action[].assert.description
Confirm that the returned Bundle correctly defines the navigation links.

# test[].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.

# test[].action[].operation.description
Create a Patient resource and capture the returned HTTP Header Location.

# test[].action[].assert.description
Confirm that the returned HTTP status is 201(Created).

# test[].action[].assert.description
Confirm that the returned HTTP Header Location is present.

# test[].action[].operation.description
Read the created Patient using the captured Location URL value.

# test[].action[].assert.description
Confirm that the returned HTTP status is 200(OK).

# test[].action[].assert.description
Confirm that the returned resource type is Patient.

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

# test[].action[].operation.description
Search for Patient resources on the destination test system.

# test[].action[].assert.description
Confirm that the returned HTTP status is 200(OK).

# test[].action[].assert.description
Confirm that the returned format is XML.

# test[].action[].assert.description
Confirm that the returned resource type is Bundle.

# test[].action[].assert.description
Confirm that the returned Bundle conforms to the base FHIR specification.

# test[].action[].assert.description
Confirm that the returned Bundle type equals 'searchset'.

# test[].action[].assert.description
Confirm that the returned Bundle total is greater than or equal to the number of returned entries.