PackagesCanonicalsLogsProblems
    Packages
    hl7.fhir.r6.examples@6.0.0-ballot2
    http://hl7.org/fhir/TestScript/testscript-example-history
{
  "description": "TestScript example resource with setup to delete if present and create a new instance of a Patient then update that Patient to create a minimum history; and single test definition to get the history of that Patient with various asserts.",
  "_filename": "TestScript-testscript-example-history.json",
  "package_name": "hl7.fhir.r6.examples",
  "date": "2017-01-18",
  "variable": [ {
    "name": "createResourceId",
    "path": "Patient/id",
    "sourceId": "fixture-patient-create"
  } ],
  "publisher": "HL7 International / FHIR Infrastructure",
  "jurisdiction": [ {
    "coding": [ {
      "code": "US",
      "system": "urn:iso:std:iso:3166",
      "display": "United States of America"
    } ]
  } ],
  "purpose": "Patient (Conditional) Create, Update, Delete and History (Instance) Operations",
  "name": "TestScriptExampleHistory",
  "copyright": "© HL7.org 2011+",
  "type": null,
  "experimental": "true",
  "resourceType": "TestScript",
  "title": "TestScript Example History",
  "setup": {
    "action": [ {
      "operation": {
        "type": {
          "code": "delete",
          "system": "http://hl7.org/fhir/restful-interaction"
        },
        "label": "SetupDeletePatient",
        "accept": "json",
        "params": "/${createResourceId}",
        "resource": "Patient",
        "description": "Execute a delete operation to insure the patient does not exist on the server.",
        "encodeRequestUrl": true
      }
    }, {
      "assert": {
        "operator": "in",
        "direction": "response",
        "description": "Confirm that the returned HTTP status is 200(OK) or 204(No Content).",
        "warningOnly": false,
        "responseCode": "200,204",
        "stopTestOnFail": false
      }
    }, {
      "operation": {
        "description": "Create patient resource on test server using the contents of fixture-patient-create",
        "params": "/${createResourceId}",
        "type": {
          "code": "update",
          "system": "http://hl7.org/fhir/restful-interaction"
        },
        "encodeRequestUrl": true,
        "label": "SetupCreatePatient",
        "resource": "Patient",
        "contentType": "json",
        "sourceId": "fixture-patient-create",
        "accept": "json"
      }
    }, {
      "assert": {
        "direction": "response",
        "description": "Confirm that the returned HTTP status is 201(Created).",
        "warningOnly": false,
        "responseCode": "201",
        "stopTestOnFail": false
      }
    }, {
      "operation": {
        "description": "Update patient resource on test server using the contents of fixture-patient-update",
        "params": "/${createResourceId}",
        "type": {
          "code": "update",
          "system": "http://hl7.org/fhir/restful-interaction"
        },
        "encodeRequestUrl": true,
        "label": "SetupUpdatePatient",
        "resource": "Patient",
        "contentType": "json",
        "sourceId": "fixture-patient-update",
        "accept": "json"
      }
    }, {
      "assert": {
        "direction": "response",
        "description": "Confirm that the returned HTTP status is 200(OK).",
        "warningOnly": false,
        "responseCode": "200",
        "stopTestOnFail": false
      }
    } ]
  },
  "package_version": "6.0.0-ballot2",
  "extension": [ {
    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
    "valueCode": "fhir"
  } ],
  "status": "draft",
  "id": "30ce722f-4c45-4a54-aae2-7efad5345066",
  "kind": null,
  "url": "http://hl7.org/fhir/TestScript/testscript-example-history",
  "identifier": [ {
    "value": "urn:oid:2.16.840.1.113883.4.642.12.1",
    "system": "urn:ietf:rfc:3986"
  } ],
  "fixture": [ {
    "id": "fixture-patient-create",
    "resource": {
      "display": "Peter Chalmers",
      "reference": "Patient/example"
    },
    "autocreate": false,
    "autodelete": false
  }, {
    "id": "fixture-patient-update",
    "resource": {
      "display": "Donald Duck",
      "reference": "Patient/pat1"
    },
    "autocreate": false,
    "autodelete": false
  } ],
  "version": "1.0",
  "contact": [ {
    "telecom": [ {
      "value": "http://www.hl7.org/Special/committees/fiwg",
      "system": "url"
    } ]
  } ],
  "metadata": {
    "link": [ {
      "url": "http://hl7.org/fhir/patient.html",
      "description": "Demographics and other administrative information about an individual or animal receiving care or other health-related services."
    } ],
    "capability": [ {
      "link": [ "http://hl7.org/fhir/http.html#update", "http://hl7.org/fhir/http.html#delete", "http://hl7.org/fhir/http.html#history" ],
      "required": true,
      "validated": false,
      "description": "Patient Update, Delete and History (Instance) Operations",
      "capabilities": "http://hl7.org/fhir/CapabilityStatement/example"
    } ]
  },
  "test": [ {
    "id": "01-HistoryPatient",
    "name": "History Patient",
    "action": [ {
      "operation": {
        "type": {
          "code": "history",
          "system": "http://hl7.org/fhir/restful-interaction"
        },
        "accept": "json",
        "resource": "Patient",
        "targetId": "fixture-patient-create",
        "contentType": "json",
        "description": "Get the Patient history on the test server using the id from fixture-patient-create.",
        "encodeRequestUrl": true
      }
    }, {
      "assert": {
        "response": "okay",
        "direction": "response",
        "description": "Confirm that the returned HTTP status is 200(OK).",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    }, {
      "assert": {
        "resource": "Bundle",
        "description": "Confirm that the returned resource type is Bundle.",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    }, {
      "assert": {
        "description": "Confirm that the returned Bundle conforms to the base FHIR specification.",
        "warningOnly": false,
        "stopTestOnFail": false,
        "validateProfileId": "bundle-profile"
      }
    }, {
      "assert": {
        "path": "fhir:Bundle/fhir:type/@value",
        "value": "history",
        "operator": "equals",
        "description": "Confirm that the returned Bundle type equals 'history'.",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    } ],
    "description": "Get the history for a known Patient and validate response."
  } ],
  "profile": [ "http://hl7.org/fhir/StructureDefinition/Bundle" ]
}