Release 5 Preview #2

Testscript-example-search

FHIR Infrastructure Work GroupMaturity Level: N/AStandards Status: InformativeCompartments: Not linked to any 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

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: 2017-01-18

publisher: HL7

contact: Support: support@HL7.org(WORK)

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)

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

Fixtures

-AutocreateAutodeleteResource
*falsefalsePeter Chalmers. Generated Summary: id: example; Medical record number = 12345 (USUAL); active; Peter James Chalmers (OFFICIAL), Jim , Peter James Windsor (MAIDEN); -unknown-(HOME), ph: (03) 5555 6473(WORK), ph: (03) 3410 5613(MOBILE), ph: (03) 5555 8834(OLD); gender: male; birthDate: 1974-12-25;

profile: Generated Summary: id: Bundle; url: http://hl7.org/fhir/StructureDefinition/Bundle; version: 4.4.0; name: Bundle; ACTIVE; date: Aug 10, 2020 5:20:19 PM; publisher: Health Level Seven International (FHIR Infrastructure); http://hl7.org/fhir, http://www.hl7.org/Special/committees/fiwg/index.cfm; description: A container for a collection of resources.; 4.4.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

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
*SearchPatientTest simple search to verify server support.xmltrue?family=DONTEXPECTAMATCH&given=DONTEXPECTAMATCH

action

Asserts

-DescriptionDirectionOperatorRequestURLWarningOnly
*Confirm that the request url contains the family search parameter.requestcontainsfamilyfalse

action

Asserts

-DescriptionDirectionResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200(OK).response200false

action

Asserts

-DescriptionResourceWarningOnly
*Confirm that the returned resource type is Bundle.Bundlefalse

action

Asserts

-DescriptionNavigationLinksWarningOnly
*Confirm that the returned Bundle correctly defines the navigation links.truefalse

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

-TypeResourceDescriptionAcceptContentTypeEncodeRequestUrlResponseIdSourceId
*CreatePatientCreate a Patient resource and capture the returned HTTP Header Location.xmlxmltruePatientCreateResponsefixture-patient-create

action

Asserts

-DescriptionResponseWarningOnly
*Confirm that the returned HTTP status is 201(Created).createdfalse

action

Asserts

-DescriptionDirectionHeaderFieldOperatorWarningOnly
*Confirm that the returned HTTP Header Location is present.responseLocationnotEmptyfalse

action

Operations

-TypeDescriptionAcceptEncodeRequestUrlUrl
*ReadRead the created Patient using the captured Location URL value.xmltrue${PatientCreateLocation}

action

Asserts

-DescriptionResponseWarningOnly
*Confirm that the returned HTTP status is 200(OK).okayfalse

action

Asserts

-DescriptionResourceWarningOnly
*Confirm that the returned resource type is Patient.Patientfalse

test

name: Patient Search Dynamic

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

action

Operations

-TypeResourceDescriptionAcceptEncodeRequestUrlParams
*SearchPatientSearch for Patient resources on the destination test system.xmltrue?family=${PatientSearchFamilyName}&given=${PatientSearchGivenName}

action

Asserts

-DescriptionResponseWarningOnly
*Confirm that the returned HTTP status is 200(OK).okayfalse

action

Asserts

-DescriptionContentTypeWarningOnly
*Confirm that the returned format is XML.xmlfalse

action

Asserts

-DescriptionResourceWarningOnly
*Confirm that the returned resource type is Bundle.Bundlefalse

action

Asserts

-DescriptionValidateProfileIdWarningOnly
*Confirm that the returned Bundle conforms to the base FHIR specification.bundle-profilefalse

action

Asserts

-DescriptionOperatorPathValueWarningOnly
*Confirm that the returned Bundle type equals 'searchset'.equalsfhir:Bundle/fhir:type/@valuesearchsetfalse

action

Asserts

-DescriptionExpressionWarningOnly
*Confirm that the returned Bundle total is greater than or equal to the number of returned entries.Bundle.total.toInteger() >= entry.count()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.