Release 5 Ballot

This page is part of the FHIR Specification (v5.0.0-ballot: R5 Ballot - see ballot notes). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions . Page versions: R5 R4B R4 R3 R2

Example TestScript/testscript-example (Narrative)

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: TestScript

Resource TestScript "testscript-example"

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

identifier: id: urn:oid:2.16.840.1.113883.4.642.12.4

version: 1.0

name: TestScript Example

status: draft

experimental: true

date: 2017-01-18

publisher: HL7

contact: Support: support@HL7.org

description: TestScript example resource with setup to delete if present and create a new instance of a Patient; and single test definition to read the created Patient with various asserts.

UseContexts

-CodeValue[x]
*Clinical Focus (Details: http://terminology.hl7.org/CodeSystem/usage-context-type code focus = 'Clinical Focus', stated as 'null')positive (sequenceStatus#positive)
*Program (Details: http://terminology.hl7.org/CodeSystem/usage-context-type code program = 'Program', stated as 'null')2018-? year

jurisdiction: United States of America (the) (unknown#US)

purpose: Patient Conditional Create (Update), Read and Delete Operations

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 Update, Read and Delete Operationshttp://hl7.org/fhir/http.html#delete, http://hl7.org/fhir/http.html#read, http://hl7.org/fhir/http.html#updatehttp://hl7.org/fhir/CapabilityStatement/example

fixture

autocreate: false

autodelete: false

resource: Patient/example: Peter Chalmers "Peter CHALMERS"

fixture

autocreate: false

autodelete: false

resource: Patient/example: Peter Chalmers (minimum) "Peter CHALMERS"

profile: http://hl7.org/fhir/StructureDefinition/Patient "Patient"

Variables

-NamePathSourceId
*createResourceIdPatient/idfixture-patient-create

setup

action

Operations

-TypeResourceLabelDescriptionAcceptEncodeRequestUrlParams
*delete (Details: http://hl7.org/fhir/restful-interaction code delete = 'delete', stated as 'null')PatientSetupDeletePatientExecute a delete operation to insure the patient does not exist on the server.jsontrue/${createResourceId}

action

Asserts

-DescriptionDirectionOperatorResponseCodeStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 200(OK) or 204(No Content).responsein200,204falsefalse

action

Operations

-TypeResourceLabelDescriptionAcceptContentTypeEncodeRequestUrlParamsSourceId
*update (Details: http://hl7.org/fhir/restful-interaction code update = 'update', stated as 'null')PatientSetupCreatePatientCreate patient resource on test server using the contents of fixture-patient-createjsonjsontrue/${createResourceId}fixture-patient-create

action

Asserts

-DescriptionDirectionResponseCodeStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 201(Created).response201falsefalse

action

Operations

-TypeResourceDescriptionEncodeRequestUrlTargetId
*read (Details: http://hl7.org/fhir/restful-interaction code read = 'read', stated as 'null')PatientRead the created patient resource on the test server using the id from fixture-patient-create. Verify contents.truefixture-patient-create

action

Asserts

-DescriptionDirectionResponseStopTestOnFailWarningOnly
*Confirm that the returned HTTP status is 200(OK).responseokayfalsefalse

action

Asserts

-DescriptionCompareToSourceIdCompareToSourceExpressionOperatorStopTestOnFailWarningOnly
*Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit compareToSourceId reference to fixture-patient-create used to create the Patient.fixture-patient-createPatient.name.first().familyequalsfalsefalse

test

name: Read Patient

description: Read a Patient and validate response.

action

Operations

-TypeResourceDescriptionEncodeRequestUrlResponseIdTargetId
*read (Details: http://hl7.org/fhir/restful-interaction code read = 'read', stated as 'null')PatientRead the patient resource on the test server using the id from fixture-patient-create. Prevent URL encoding of the request.falsefixture-patient-readfixture-patient-create

action

Asserts

-LabelDescriptionDirectionResponseStopTestOnFailWarningOnly
*01-ReadPatientOKConfirm that the returned HTTP status is 200(OK).responseokayfalsefalse

action

Asserts

-DescriptionDirectionHeaderFieldOperatorStopTestOnFailWarningOnly
*Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server might not support versioning.responseLast-ModifiednotEmptyfalsetrue

action

Asserts

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

action

Asserts

-DescriptionStopTestOnFailValidateProfileIdWarningOnly
*Confirm that the returned Patient conforms to the base FHIR specification.falsepatient-profilefalse

action

Asserts

-DescriptionOperatorPathSourceIdStopTestOnFailValueWarningOnly
*Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit sourceId reference to read responseId fixture.equalsfhir:Patient/fhir:name/fhir:family/@valuefixture-patient-readfalseChalmersfalse

action

Asserts

-DescriptionOperatorPathSourceIdStopTestOnFailValueWarningOnly
*Confirm that the returned Patient contains the expected given name 'Peter'. Uses explicit sourceId reference to read responseId fixture.equalsfhir:Patient/fhir:name/fhir:given/@valuefixture-patient-readfalsePeterfalse

action

Asserts

-DescriptionCompareToSourceIdCompareToSourcePathOperatorPathStopTestOnFailWarningOnly
*Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit compareToSourceId reference to fixture-patient-create used to create the Patient and implicit reference to read response payload.fixture-patient-createfhir:Patient/fhir:name/fhir:family/@valueequalsfhir:Patient/fhir:name/fhir:family/@valuefalsefalse

action

Asserts

-DescriptionCompareToSourceIdCompareToSourcePathPathSourceIdStopTestOnFailWarningOnly
*Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit compareToSourceId reference to fixture-patient-create used to create the Patient and explicit reference to read response payload and default operator of 'equals'.fixture-patient-createfhir:Patient/fhir:name/fhir:given/@valuefhir:Patient/fhir:name/fhir:given/@valuefixture-patient-readfalsefalse

action

Asserts

-DescriptionMinimumIdStopTestOnFailWarningOnly
*Confirm that the returned resource contains the expected retained elements and values. Warning only to provide users with reviewable results.fixture-patient-minimumfalsetrue

teardown

action

Operations

-TypeResourceDescriptionEncodeRequestUrlTargetId
*delete (Details: http://hl7.org/fhir/restful-interaction code delete = 'delete', stated as 'null')PatientDelete the patient resource on the test server using the id from fixture-patient-create.truefixture-patient-create

 

 

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.