R6 Ballot (2nd Draft)

Publish-box (todo)

Example TestScript/testscript-example-multisystem (Turtle)

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

Raw Turtle (+ also see Turtle/RDF Format Specification)

Multisystem TestScript Example

@prefix fhir: <http://hl7.org/fhir/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

# - resource -------------------------------------------------------------------

[a fhir:TestScript ;
  fhir:nodeRole fhir:treeRoot ;
  fhir:id [ fhir:v "testscript-example-multisystem"] ; # 
  fhir:extension ( [
     fhir:url [ fhir:v "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg"^^xsd:anyURI ] ;
     fhir:value [ fhir:v "fhir" ]
  ] ) ; # 
  fhir:url [ fhir:v "http://hl7.org/fhir/TestScript/testscript-example-multisystem"^^xsd:anyURI] ; # 
  fhir:identifier ( [
     fhir:system [ fhir:v "urn:ietf:rfc:3986"^^xsd:anyURI ] ;
     fhir:value [ fhir:v "urn:oid:2.16.840.1.113883.4.642.12.6" ]
  ] ) ; # 
  fhir:version [ fhir:v "1.0"] ; # 
  fhir:name [ fhir:v "Testscriptexamplemultisystem"] ; # 
  fhir:title [ fhir:v "Multisystem Test Script"] ; # 
  fhir:status [ fhir:v "draft"] ; # 
  fhir:experimental [ fhir:v "true"^^xsd:boolean] ; # 
  fhir:date [ fhir:v "2017-01-18"^^xsd:date] ; # 
  fhir:publisher [ fhir:v "HL7 International / FHIR Infrastructure"] ; # 
  fhir:contact ( [
     fhir:telecom ( [
       fhir:system [ fhir:v "url" ] ;
       fhir:value [ fhir:v "http://www.hl7.org/Special/committees/fiwg" ]
     ] )
  ] ) ; # 
  fhir:description [ fhir:v "TestScript example resource showing use of origin and destination for multisystem support. The single origin will execute a Patient read against the two destination systems using user defined dynamic variables. The test engine will wait at each operation action with a defined origin and destination for the origin test system to send the expected FHIR operation to the destination test system. Once the expected request and response is observed, the test engine will continue with the test execution."] ; # 
  fhir:jurisdiction ( [
     fhir:coding ( [
       fhir:system [ fhir:v "urn:iso:std:iso:3166"^^xsd:anyURI ] ;
       fhir:code [ fhir:v "US" ] ;
       fhir:display [ fhir:v "United States of America" ]
     ] )
  ] ) ; # 
  fhir:purpose [ fhir:v "Patient Read Operation"] ; # 
  fhir:copyright [ fhir:v "© HL7.org 2011+"] ; # 
  fhir:origin ( [
     fhir:index [ fhir:v "1"^^xsd:integer ] ;
     fhir:profile [
       fhir:code [ fhir:v "FHIR-Client" ]
     ]
  ] ) ; # 
  fhir:destination ( [
     fhir:index [ fhir:v "1"^^xsd:integer ] ;
     fhir:profile [
       fhir:code [ fhir:v "FHIR-Server" ]
     ] ;
     fhir:url [ fhir:v "http://acme.com/fhir/test"^^xsd:anyURI ]
  ] [
     fhir:index [ fhir:v "2"^^xsd:integer ] ;
     fhir:profile [
       fhir:code [ fhir:v "FHIR-Server" ]
     ]
  ] ) ; # 
  fhir:metadata [
     fhir:link ( [
       fhir:url [ fhir:v "http://hl7.org/fhir/patient.html"^^xsd:anyURI ] ;
       fhir:description [ fhir:v "Demographics and other administrative information about an individual or animal receiving care or other health-related services." ]
     ] ) ;
     fhir:capability ( [
       fhir:required [ fhir:v "true"^^xsd:boolean ] ;
       fhir:validated [ fhir:v "false"^^xsd:boolean ] ;
       fhir:description [ fhir:v "Patient Read Operation" ] ;
       fhir:origin ( [ fhir:v "1"^^xsd:integer ] ) ;
       fhir:destination [ fhir:v "1"^^xsd:integer ] ;
       fhir:link ( [ fhir:v "http://hl7.org/fhir/http.html#read"^^xsd:anyURI ] ) ;
       fhir:capabilities [
         fhir:v "http://hl7.org/fhir/CapabilityStatement/example"^^xsd:anyURI ;
         fhir:link <http://hl7.org/fhir/CapabilityStatement/example>
       ]
     ] [
       fhir:required [ fhir:v "true"^^xsd:boolean ] ;
       fhir:validated [ fhir:v "false"^^xsd:boolean ] ;
       fhir:description [ fhir:v "Patient Read Operation" ] ;
       fhir:origin ( [ fhir:v "1"^^xsd:integer ] ) ;
       fhir:destination [ fhir:v "2"^^xsd:integer ] ;
       fhir:link ( [ fhir:v "http://hl7.org/fhir/http.html#read"^^xsd:anyURI ] ) ;
       fhir:capabilities [
         fhir:v "http://hl7.org/fhir/CapabilityStatement/example"^^xsd:anyURI ;
         fhir:link <http://hl7.org/fhir/CapabilityStatement/example>
       ]
     ] )
  ] ; # 
  fhir:variable ( [
     fhir:name [ fhir:v "Dest1PatientResourceId" ] ;
     fhir:defaultValue [ fhir:v "example" ]
  ] [
     fhir:name [ fhir:v "Dest2PatientResourceId" ] ;
     fhir:defaultValue [ fhir:v "example" ]
  ] ) ; # 
  fhir:test ( [
     fhir:id [ fhir:v "01-ReadPatient-Destination1" ] ;
     fhir:name [ fhir:v "ReadPatient-Destination1" ] ;
     fhir:description [ fhir:v "Read a Patient from the first destination test system using the user defined dynamic variable ${Dest1PatientResourceId}. Perform basic validation." ] ;
     fhir:action ( [
       fhir:operation [
         fhir:type [
           fhir:system [ fhir:v "http://hl7.org/fhir/restful-interaction"^^xsd:anyURI ] ;
           fhir:code [ fhir:v "read" ]
         ] ;
         fhir:resource [ fhir:v "Patient"^^xsd:anyURI ] ;
         fhir:description [ fhir:v "Read a Patient from the first destination test system and perform basic validation." ] ;
         fhir:accept [ fhir:v "xml" ] ;
         fhir:contentType [ fhir:v "xml" ] ;
         fhir:destination [ fhir:v "1"^^xsd:integer ] ;
         fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
         fhir:origin [ fhir:v "1"^^xsd:integer ] ;
         fhir:params [ fhir:v "/${Dest1PatientResourceId}" ] ;
         fhir:requestId [ fhir:v "request-read-patient-01" ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the request method GET was sent by the client system under test." ] ;
         fhir:requestMethod [ fhir:v "get" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the client requested an Accept of xml." ] ;
         fhir:direction [ fhir:v "request" ] ;
         fhir:headerField [ fhir:v "Accept" ] ;
         fhir:operator [ fhir:v "contains" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:value [ fhir:v "xml" ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the returned HTTP status is 200(OK)." ] ;
         fhir:direction [ fhir:v "response" ] ;
         fhir:response [ fhir:v "okay" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the returned format is XML." ] ;
         fhir:direction [ fhir:v "response" ] ;
         fhir:contentType [ fhir:v "xml" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the returned resource type is Patient." ] ;
         fhir:direction [ fhir:v "response" ] ;
         fhir:resource [ fhir:v "Patient"^^xsd:anyURI ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] )
  ] [
     fhir:id [ fhir:v "02-ReadPatient-Destination2" ] ;
     fhir:name [ fhir:v "ReadPatient-Destination2" ] ;
     fhir:description [ fhir:v "Read a Patient from the second destination test system using the user defined dynamic variable ${Dest2PatientResourceId}. Perform basic validation." ] ;
     fhir:action ( [
       fhir:operation [
         fhir:type [
           fhir:system [ fhir:v "http://hl7.org/fhir/restful-interaction"^^xsd:anyURI ] ;
           fhir:code [ fhir:v "read" ]
         ] ;
         fhir:resource [ fhir:v "Patient"^^xsd:anyURI ] ;
         fhir:description [ fhir:v "Read a Patient from the second destination test system and perform basic validation." ] ;
         fhir:accept [ fhir:v "xml" ] ;
         fhir:contentType [ fhir:v "xml" ] ;
         fhir:destination [ fhir:v "2"^^xsd:integer ] ;
         fhir:encodeRequestUrl [ fhir:v "true"^^xsd:boolean ] ;
         fhir:origin [ fhir:v "1"^^xsd:integer ] ;
         fhir:params [ fhir:v "/${Dest2PatientResourceId}" ] ;
         fhir:requestHeader ( [
           fhir:field [ fhir:v "Accept-Charset" ] ;
           fhir:value [ fhir:v "utf-8" ]
         ] )
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the client requested an Accept of xml." ] ;
         fhir:direction [ fhir:v "request" ] ;
         fhir:headerField [ fhir:v "Accept" ] ;
         fhir:operator [ fhir:v "contains" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:value [ fhir:v "xml" ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the returned HTTP status is 200(OK)." ] ;
         fhir:direction [ fhir:v "response" ] ;
         fhir:response [ fhir:v "okay" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the returned format is XML." ] ;
         fhir:direction [ fhir:v "response" ] ;
         fhir:contentType [ fhir:v "xml" ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] [
       fhir:assert [
         fhir:description [ fhir:v "Confirm that the returned resource type is Patient." ] ;
         fhir:direction [ fhir:v "response" ] ;
         fhir:resource [ fhir:v "Patient"^^xsd:anyURI ] ;
         fhir:stopTestOnFail [ fhir:v "false"^^xsd:boolean ] ;
         fhir:warningOnly [ fhir:v "false"^^xsd:boolean ]
       ]
     ] )
  ] )] . # 

# -------------------------------------------------------------------------------------


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.