R6 Ballot (2nd Draft)

Publish-box (todo)

Example TestScript/testscript-example-search (Narrative)

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: No defined compartments

This is the narrative for the resource. See also the XML, JSON or Turtle format. This example conforms to the profile TestScript.


Generated Narrative: TestScript testscript-example-search

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 International / FHIR Infrastructure

contact: http://www.hl7.org/Special/committees/fiwg

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.html Demographics and other administrative information about an individual or animal receiving care or other health-related services.

Capabilities

-RequiredValidatedDescriptionLinkCapabilities
* true false Patient Search Operation http://hl7.org/fhir/http.html#search http://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

expression: Bundle.total.toInteger()

setup

action

Operations

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
* FHIR Restful Interactions search: search Patient Test simple search to verify server support. xml true ?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH

action

Asserts

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

action

Asserts

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

action

Asserts

-DescriptionResourceStopTestOnFailWarningOnly
* Confirm that the returned resource type is Bundle. Bundle false false

action

Asserts

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

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 Patient Create a Patient resource and capture the returned HTTP Header Location. xml xml true PatientCreateResponse fixture-patient-create

action

Asserts

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

action

Asserts

-DescriptionDirectionHeaderFieldOperatorStopTestOnFailWarningOnly
* Confirm that the returned HTTP Header Location is present. response Location notEmpty false false

action

Operations

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

action

Asserts

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

action

Asserts

-DescriptionResourceStopTestOnFailWarningOnly
* Confirm that the returned resource type is Patient. Patient false false

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 Patient Search for Patient resources on the destination test system. xml true ?family=${PatientSearchFamilyName}&given=${PatientSearchGivenName}

action

Asserts

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

action

Asserts

-DescriptionContentTypeStopTestOnFailWarningOnly
* Confirm that the returned format is XML. xml false false

action

Asserts

-DescriptionResourceStopTestOnFailWarningOnly
* Confirm that the returned resource type is Bundle. Bundle true false

action

Asserts

-DescriptionStopTestOnFailValidateProfileIdWarningOnly
* Confirm that the returned Bundle conforms to the base FHIR specification. false bundle-profile false

action

Asserts

-DescriptionOperatorPathStopTestOnFailValueWarningOnly
* Confirm that the returned Bundle type equals 'searchset'. equals fhir:Bundle/fhir:type/@value false searchset false

action

Asserts

-DescriptionExpressionStopTestOnFailWarningOnly
* Confirm that the returned Bundle total is greater than or equal to the number of returned entries. Bundle.total.toInteger() >= entry.count() false false

 

 

Usage note: every effort has been made to ensure that the examples are correct and useful, but they are not a normative part of the specification.