Touchstone FHIR Testing
2.0.0 - current International flag

Touchstone FHIR Testing v2.0.0. This is the current published version. For a full list of available versions, see the Directory of published versions

Example TestScript: TestScript NDJSON Assertion Prefix Example

Active as of 2023-07-03

Generated Narrative: TestScript

Resource TestScript "ndjson-assertion-prefix"

Profile: AEGIS Touchstone Testing TestScript Profile

url: http://touchstone.aegis.net/touchstone/fhir/testing/TestScript/ndjson-assertion-prefix

version: 2.0.0

name: NDJSONAssertionPrefixSyntax

title: Demonstrate NDJSON Assertion Prefix Syntax

status: active

date: 2023-07-03

publisher: AEGIS.net, Inc.

contact: AEGIS.net, Inc.: https://www.aegis.net, Richard Ettema: mailto:richard.ettema@aegis.net

description: Demonstrate NDJSON Assertion Prefix Syntax

jurisdiction: World (m49.htm#001)

copyright: (c) AEGIS.net, Inc. 2015+

destination

id

Server

index: 1

profile: FHIR Server (Details: http://terminology.hl7.org/CodeSystem/testscript-profile-destination-types code FHIR-Server = 'FHIR Server', stated as 'null')

profile:

Variables

-NameDefaultValue
*outputBaseUrlhttp://localhost:33000/bulk-api/output

test

id

AssertContentTypeResourceAndValidation

name: AssertContentTypeResourceAndValidation

description: Demonstrates contentType, resource and validateProfile assertions with no filters.

action

Operations

-TypeDescriptionAcceptDestinationEncodeRequestUrlUrl
*get (Details: http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes code get = 'get', stated as 'null')Request BulkDatandjson1true${outputBaseUrl}/1/Patient.ndjson

action

Asserts

-ExtensionDescriptionDirectionHeaderFieldOperatorValueWarningOnly
*Confirm that the client requested an Accept of the FHIR JSON mime type 'application/fhir+json'.requestAcceptcontainsndjsonfalse

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200.responseequals200false

action

Asserts

-ExtensionDirectionContentTypeWarningOnly
*responsendjsonfalse

action

Asserts

-ExtensionDirectionResourceWarningOnly
*responsePatientfalse

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Validate that the returned resource conforms to the corresponding FHIR resource profile.responseresource-profilefalse

test

id

AssertResourceType

name: AssertResourceType

description: Demonstrates resource assertions.

action

Operations

-TypeDescriptionAcceptDestinationEncodeRequestUrlUrl
*get (Details: http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes code get = 'get', stated as 'null')Retrieve invalid NDJSON that contains mix of Patient and Person resource types.ndjson1true${outputBaseUrl}/2/patient-person-mix.ndjson

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200.responseequals200false

action

Asserts

-ExtensionDescriptionDirectionResourceWarningOnly
*<resource value="Patient"/>responsePatientfalse

test

id

AssertResourceCount

name: AssertResourceCount

description: Demonstrates resource-count assertions (only works with NDJSON responses).

action

Operations

-TypeDescriptionAcceptDestinationEncodeRequestUrlUrl
*get (Details: http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes code get = 'get', stated as 'null')Retrieve NDJSON response that contains 5 Patient resources.ndjson1true${outputBaseUrl}/1/Patient.ndjson

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200.responseequals200false

action

Asserts

-DescriptionDirectionOperatorPathValueWarningOnly
*<path value="resource-count"/> <operator value="equals"/> <value value="5"/>responseequalsresource-count5false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="resource-count"/> <operator value="equals"/> <value value="6"/>responseequalsresource-count6false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="resource-count"/> <operator value="greaterThan"/> <value value="4"/>responsegreaterThanresource-count4false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner}resource-count"/> <operator value="greaterThan"/> <value value="4"/>responsegreaterThan{generalPractitioner}resource-count4false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner[?(@.reference=='Practitioner/4')]}resource-count"/> <operator value="greaterThan"/> <value value="4"/>responsegreaterThan{generalPractitioner[?(@.reference=='Practitioner/4')]}resource-count4false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner[?(@.reference=='Practitioner/4')]}resource-count"/> <operator value="equals"/> <value value="1"/>responseequals{generalPractitioner[?(@.reference=='Practitioner/4')]}resource-count1false

test

id

AssertPath

name: AssertPath

description: Demonstrates path assertions.

action

Operations

-TypeDescriptionAcceptDestinationEncodeRequestUrlUrl
*get (Details: http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes code get = 'get', stated as 'null')Retrieve NDJSON response that contains 5 Patient resources.ndjson1true${outputBaseUrl}/1/Patient.ndjson

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200.responseequals200false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="generalPractitioner.reference"/> <operator value="contains"/> <value value="Practitioner/"/>responsecontainsgeneralPractitioner.referencePractitioner/false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="generalPractitioner.reference"/> <operator value="equals"/> <value value="Practitioner/2"/>responseequalsgeneralPractitioner.referencePractitioner/2false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{any}generalPractitioner.reference"/> <operator value="equals"/> <value value="Practitioner/2"/>responseequals{any}generalPractitioner.referencePractitioner/2false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{2}generalPractitioner.reference"/> <operator value="equals"/> <value value="Practitioner/2"/>responseequals{2}generalPractitioner.referencePractitioner/2false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{3}generalPractitioner.reference"/> <operator value="equals"/> <value value="Practitioner/2"/>responseequals{3}generalPractitioner.referencePractitioner/2false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{2-5}generalPractitioner.reference"/> <operator value="contains"/> <value value="Practitioner/"/>responsecontains{2-5}generalPractitioner.referencePractitioner/false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{2-100}generalPractitioner.reference"/> <operator value="contains"/> <value value="Practitioner/"/>responsecontains{2-100}generalPractitioner.referencePractitioner/false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{6-100}generalPractitioner.reference"/> <operator value="contains"/> <value value="Practitioner/"/>responsecontains{6-100}generalPractitioner.referencePractitioner/false

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner[?(@.reference=='Practitioner/3')]}name.family"/> <operator value="equals"/> <value value="Allen"/>responseequals{generalPractitioner[?(@.reference=='Practitioner/3')]}name.familyAllenfalse

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner[?(@.reference=='Practitioner/3')]}name.family"/> <operator value="equals"/> <value value="Gracia"/>responseequals{generalPractitioner[?(@.reference=='Practitioner/3')]}name.familyGraciafalse

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner}name.family"/> <operator value="in"/> <value value="Gracia,McKay,Allen,Williams,Hill"/>responsein{generalPractitioner}name.familyGracia,McKay,Allen,Williams,Hillfalse

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner}name.family"/> <operator value="in"/> <value value="a,b,c,d,e"/>responsein{generalPractitioner}name.familya,b,c,d,efalse

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{generalPractitioner}name.family"/> <operator value="in"/> <value value="a,b,Allen,d,e"/>responsein{generalPractitioner}name.familya,b,Allen,d,efalse

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{any|generalPractitioner}name.family"/> <operator value="in"/> <value value="a,b,Allen,d,e"/>responsein{any|generalPractitioner}name.familya,b,Allen,d,efalse

action

Asserts

-ExtensionDescriptionDirectionOperatorPathValueWarningOnly
*<path value="{any|generalPractiXXXXXXXXXXXXXioner}name.family"/> <operator value="in"/> <value value="a,b,Allen,d,e"/>responsein{any|generalPractiXXXXXXXXXXXXXioner}name.familya,b,Allen,d,efalse

test

id

AssertFhirPath

name: AssertFhirPath

description: Demonstrates expression assertions.

action

Operations

-TypeDescriptionAcceptDestinationEncodeRequestUrlUrl
*get (Details: http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes code get = 'get', stated as 'null')Retrieve NDJSON response that contains 5 Patient resources.ndjson1true${outputBaseUrl}/1/Patient.ndjson

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200.responseequals200false

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="Patient.name.family"/> <operator value="in"/> <value value="Allen,Gracia"/>responsePatient.name.familyinAllen,Graciafalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{any}Patient.name.family"/> <operator value="in"/> <value value="Allen,Gracia"/>response{any}Patient.name.familyinAllen,Graciafalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{all}Patient.name.family"/> <operator value="equals"/> <value value="Allen"/>response{all}Patient.name.familyequalsAllenfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{1-3}Patient.name.family"/> <operator value="in"/> <value value="McKay,Gracia,Allen"/>response{1-3}Patient.name.familyinMcKay,Gracia,Allenfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{1-100}Patient.name.family"/> <operator value="in"/> <value value="McKay,Gracia,Allen"/>response{1-100}Patient.name.familyinMcKay,Gracia,Allenfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="Patient.name.given"/> <operator value="in"/> <value value="Joshua,P"/>responsePatient.name.giveninJoshua,Pfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{any}Patient.name.given"/> <operator value="equals"/> <value value="George"/>response{any}Patient.name.givenequalsGeorgefalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{1-3}Patient.name.given"/> <operator value="in"/> <value value="Brian,Q,George,Carol,G"/>response{1-3}Patient.name.giveninBrian,Q,George,Carol,Gfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{1-100}Patient.name.given"/> <operator value="in"/> <value value="Brian,Q,George,Carol,G"/>response{1-100}Patient.name.giveninBrian,Q,George,Carol,Gfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{1-100}Patient.name.given"/> <operator value="in"/> <value value="Brian,Q,George,Carol,G,Joshua,H,P"/>response{1-100}Patient.name.giveninBrian,Q,George,Carol,G,Joshua,H,Pfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{.name[?(@.family=='Allen')]}Patient.name.given"/> <operator value="in"/> <value value="Carol,G"/>response{.name[?(@.family=='Allen')]}Patient.name.giveninCarol,Gfalse

action

Asserts

-ExtensionDescriptionDirectionExpressionOperatorValueWarningOnly
*<expression value="{.name[?(@.family=='McKay')]}Patient.name.given"/> <operator value="equals"/> <value value="George"/>response{.name[?(@.family=='McKay')]}Patient.name.givenequalsGeorgefalse

action

Asserts

-ExtensionDescriptionDirectionExpressionWarningOnly
*<expression value="Patient.name.where(family='Gracia')"/>responsePatient.name.where(family='Gracia')false

action

Asserts

-ExtensionDescriptionDirectionExpressionWarningOnly
*<expression value="{any}Patient.name.where(family='Gracia')"/>response{any}Patient.name.where(family='Gracia')false

test

id

AssertProfileValidation

name: AssertProfileValidation

description: Demonstrates validateProfileId assertions.

action

Operations

-TypeDescriptionAcceptDestinationEncodeRequestUrlUrl
*get (Details: http://touchstone.aegis.net/touchstone/fhir/testing/CodeSystem/codesystem-testscript-operation-codes code get = 'get', stated as 'null')Retrieve NDJSON response that contains 5 Patient resources. Some of the resources are invalid (will fail AEGIS Validator validation)ndjson1true${outputBaseUrl}/3/patient-some-invalid.ndjson

action

Asserts

-ExtensionDescriptionDirectionOperatorResponseCodeWarningOnly
*Confirm that the returned HTTP status is 200.responseequals200false

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Validate that the returned resource conforms to the corresponding FHIR resource profile.responseresource-profilefalse

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Validate that the returned resource conforms to the corresponding FHIR resource profile.responseresource-profile-for-anyfalse

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Validate that the returned resource conforms to the corresponding FHIR resource profile.responseresource-profile-for-firstfalse

action

Asserts

-ExtensionDescriptionDirectionValidateProfileIdWarningOnly
*Validate that the returned resource conforms to the corresponding FHIR resource profile.responseresource-profile-for-Graciafalse