STU 3 Candidate

This page is part of the FHIR Specification (v1.4.0: STU 3 Ballot 3). The current version which supercedes this version is 5.0.0. For a full list of available versions, see the Directory of published versions

Testscript-example-multiserver.ttl

Raw Turtle, JSON-LD

Multiserver 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 xs: <http://www.w3.org/2001/XMLSchema#> .

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

<http://hl7.org/fhir//TestScript/multiserver> a fhir:TestScript;
  fhir:nodeRole fhir:treeRoot;
  fhir:Resource.id [ fhir:value "multiserver"];
  fhir:DomainResource.text [
     fhir:Narrative.status [ fhir:value "generated" ]
  ];
  fhir:TestScript.url [ fhir:value "http://hl7.org/fhir/TestScript/multiserver"];
  fhir:TestScript.name [ fhir:value "Multiserver Test Script"];
  fhir:TestScript.status [ fhir:value "draft"];
  fhir:TestScript.description [ fhir:value "Multiserver Test Script"];
  fhir:TestScript.origin [
     fhir:index 0;
     fhir:TestScript.origin.index [ fhir:value "1"^^xs:int ];
     fhir:TestScript.origin.profile [
       fhir:Coding.code [ fhir:value "FHIR-Client" ]     ]
  ];
  fhir:TestScript.destination [
     fhir:index 0;
     fhir:TestScript.destination.index [ fhir:value "1"^^xs:int ];
     fhir:TestScript.destination.profile [
       fhir:Coding.code [ fhir:value "FHIR-Server" ]     ]
  ];
  fhir:TestScript.fixture [
     fhir:index 0;
     fhir:Element.id [ fhir:value "F1" ];
     fhir:TestScript.fixture.resource [
       fhir:reference <http://hl7.org/fhir/Patient/example>;
       fhir:Reference.reference [ fhir:value "Patient/example" ]     ]
  ];
  fhir:TestScript.setup [
     fhir:TestScript.setup.metadata [
       fhir:TestScript.metadata.link [
         fhir:index 0;
         fhir:TestScript.metadata.link.url [ fhir:value "http://hl7.org/implement/standards/FHIR-Develop/patient.html" ];
         fhir:TestScript.metadata.link.description [ fhir:value "FHIR Patient" ]       ];
       fhir:TestScript.metadata.capability [
         fhir:index 0;
         fhir:TestScript.metadata.capability.required [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.validated [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.description [ fhir:value "Patient Create Operation" ];
         fhir:TestScript.metadata.capability.origin [
           fhir:value "1"^^xs:int;
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.destination [ fhir:value "1"^^xs:int ];
         fhir:TestScript.metadata.capability.link [
           fhir:value "http://hl7.org/implement/standards/FHIR-Develop/http.html#create";
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.conformance [
           fhir:reference <http://hl7.org/fhir/Conformance/example>;
           fhir:Reference.reference [ fhir:value "Conformance/example" ]         ]       ]     ];
     fhir:TestScript.setup.action [
       fhir:index 0;
       fhir:TestScript.setup.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "create" ]         ];
         fhir:TestScript.setup.action.operation.contentType [ fhir:value "xml" ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "0"^^xs:int ];
         fhir:TestScript.setup.action.operation.origin [ fhir:value "0"^^xs:int ];
         fhir:TestScript.setup.action.operation.sourceId [ fhir:value "F1" ]       ]     ]
  ];
  fhir:TestScript.test [
     fhir:index 0;
     fhir:Element.id [ fhir:value "READ01" ];
     fhir:TestScript.test.name [ fhir:value "Read Patient" ];
     fhir:TestScript.test.description [ fhir:value "Read the patient from server 0." ];
     fhir:TestScript.test.metadata [
       fhir:TestScript.metadata.capability [
         fhir:index 0;
         fhir:TestScript.metadata.capability.required [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.validated [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.description [ fhir:value "Patient Read Operation" ];
         fhir:TestScript.metadata.capability.origin [
           fhir:value "1"^^xs:int;
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.destination [ fhir:value "1"^^xs:int ];
         fhir:TestScript.metadata.capability.link [
           fhir:value "http://hl7.org/implement/standards/FHIR-Develop/http.html#read";
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.conformance [
           fhir:reference <http://hl7.org/fhir/Conformance/example>;
           fhir:Reference.reference [ fhir:value "Conformance/example" ]         ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 0;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "read" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "0"^^xs:int ];
         fhir:TestScript.setup.action.operation.responseId [ fhir:value "R1" ];
         fhir:TestScript.setup.action.operation.targetId [ fhir:value "F1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 1;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 2;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.headerField [ fhir:value "Last-Modified" ];
         fhir:TestScript.setup.action.assert.operator [ fhir:value "notEmpty" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 3;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.resource [ fhir:value "Patient" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 4;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.minimumId [ fhir:value "F1" ]       ]     ]
  ];
  fhir:TestScript.test [
     fhir:index 1;
     fhir:Element.id [ fhir:value "WRITE01" ];
     fhir:TestScript.test.name [ fhir:value "Write Patient" ];
     fhir:TestScript.test.description [ fhir:value "Write the patient read from server 0 to server 1." ];
     fhir:TestScript.test.metadata [
       fhir:TestScript.metadata.capability [
         fhir:index 0;
         fhir:TestScript.metadata.capability.validated [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.description [ fhir:value "Patient Create Operation" ];
         fhir:TestScript.metadata.capability.link [
           fhir:value "http://hl7.org/implement/standards/FHIR-Develop/http.html#create";
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.conformance [
           fhir:reference <http://hl7.org/fhir/Conformance/example>;
           fhir:Reference.reference [ fhir:value "Conformance/example" ]         ]       ];
       fhir:TestScript.metadata.capability [
         fhir:index 1;
         fhir:TestScript.metadata.capability.validated [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.description [ fhir:value "Patient Read Operation" ];
         fhir:TestScript.metadata.capability.link [
           fhir:value "http://hl7.org/implement/standards/FHIR-Develop/http.html#read";
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.conformance [
           fhir:reference <http://hl7.org/fhir/Conformance/example>;
           fhir:Reference.reference [ fhir:value "Conformance/example" ]         ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 0;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "create" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "1"^^xs:int ];
         fhir:TestScript.setup.action.operation.sourceId [ fhir:value "R1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 1;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 2;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "read" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "1"^^xs:int ];
         fhir:TestScript.setup.action.operation.responseId [ fhir:value "R2" ];
         fhir:TestScript.setup.action.operation.targetId [ fhir:value "R1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 3;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 4;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.headerField [ fhir:value "Last-Modified" ];
         fhir:TestScript.setup.action.assert.operator [ fhir:value "notEmpty" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 5;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.resource [ fhir:value "Patient" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 6;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.minimumId [ fhir:value "F1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 7;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.minimumId [ fhir:value "R1" ]       ]     ]
  ];
  fhir:TestScript.test [
     fhir:index 2;
     fhir:Element.id [ fhir:value "UPDATE01" ];
     fhir:TestScript.test.name [ fhir:value "Update Patient" ];
     fhir:TestScript.test.description [ fhir:value "Update the patient on server 0 with the one read from server 1." ];
     fhir:TestScript.test.metadata [
       fhir:TestScript.metadata.capability [
         fhir:index 0;
         fhir:TestScript.metadata.capability.validated [ fhir:value "true"^^xs:boolean ];
         fhir:TestScript.metadata.capability.description [ fhir:value "Patient Update Operation" ];
         fhir:TestScript.metadata.capability.link [
           fhir:value "http://hl7.org/implement/standards/FHIR-Develop/http.html#update";
           fhir:index 0         ];
         fhir:TestScript.metadata.capability.conformance [
           fhir:reference <http://hl7.org/fhir/Conformance/example>;
           fhir:Reference.reference [ fhir:value "Conformance/example" ]         ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 0;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "update" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "0"^^xs:int ];
         fhir:TestScript.setup.action.operation.sourceId [ fhir:value "R2" ];
         fhir:TestScript.setup.action.operation.targetId [ fhir:value "R1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 1;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 2;
       fhir:TestScript.test.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "read" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "0"^^xs:int ];
         fhir:TestScript.setup.action.operation.responseId [ fhir:value "R3" ];
         fhir:TestScript.setup.action.operation.targetId [ fhir:value "R1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 3;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.response [ fhir:value "okay" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 4;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.headerField [ fhir:value "Last-Modified" ];
         fhir:TestScript.setup.action.assert.operator [ fhir:value "notEmpty" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 5;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.resource [ fhir:value "Patient" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 6;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.minimumId [ fhir:value "F1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 7;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.minimumId [ fhir:value "R1" ]       ]     ];
     fhir:TestScript.test.action [
       fhir:index 8;
       fhir:TestScript.test.action.assert [
         fhir:TestScript.setup.action.assert.minimumId [ fhir:value "R2" ]       ]     ]
  ];
  fhir:TestScript.teardown [
     fhir:TestScript.teardown.action [
       fhir:index 0;
       fhir:TestScript.teardown.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "delete" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "0"^^xs:int ];
         fhir:TestScript.setup.action.operation.targetId [ fhir:value "F1" ]       ]     ];
     fhir:TestScript.teardown.action [
       fhir:index 1;
       fhir:TestScript.teardown.action.operation [
         fhir:TestScript.setup.action.operation.type [
           fhir:Coding.code [ fhir:value "delete" ]         ];
         fhir:TestScript.setup.action.operation.destination [ fhir:value "1"^^xs:int ];
         fhir:TestScript.setup.action.operation.targetId [ fhir:value "F1" ]       ]     ]
  ].

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


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.