PackagesCanonicalsLogsProblems
    Packages
    hl7.fhir.r4b.examples@4.3.0
    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.r4b.examples",
  "date": "2017-01-18",
  "variable": [ {
    "name": "createResourceId",
    "path": "Patient/id",
    "sourceId": "fixture-patient-create"
  } ],
  "publisher": "HL7",
  "jurisdiction": [ {
    "coding": [ {
      "code": "US",
      "system": "urn:iso:std:iso:3166",
      "display": "United States of America (the)"
    } ]
  } ],
  "purpose": "Patient (Conditional) Create, Update, Delete and History (Instance) Operations",
  "name": "TestScript Example History",
  "copyright": "© HL7.org 2011+",
  "type": null,
  "experimental": "true",
  "resourceType": "TestScript",
  "title": null,
  "setup": {
    "action": [ {
      "operation": {
        "type": {
          "code": "delete",
          "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"
        },
        "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"
      }
    }, {
      "operation": {
        "description": "Create patient resource on test server using the contents of fixture-patient-create",
        "params": "/${createResourceId}",
        "type": {
          "code": "update",
          "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"
        },
        "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"
      }
    }, {
      "operation": {
        "description": "Update patient resource on test server using the contents of fixture-patient-update",
        "params": "/${createResourceId}",
        "type": {
          "code": "update",
          "system": "http://terminology.hl7.org/CodeSystem/testscript-operation-codes"
        },
        "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"
      }
    } ]
  },
  "package_version": "4.3.0",
  "status": "draft",
  "id": "b519af57-a274-4466-bf8e-09b53bda5d27",
  "kind": null,
  "url": "http://hl7.org/fhir/TestScript/testscript-example-history",
  "identifier": {
    "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9877",
    "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": [ {
    "name": "Support",
    "telecom": [ {
      "use": "work",
      "value": "support@HL7.org",
      "system": "email"
    } ]
  } ],
  "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://terminology.hl7.org/CodeSystem/testscript-operation-codes"
        },
        "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
      }
    }, {
      "assert": {
        "resource": "Bundle",
        "description": "Confirm that the returned resource type is Bundle.",
        "warningOnly": false
      }
    }, {
      "assert": {
        "description": "Confirm that the returned Bundle conforms to the base FHIR specification.",
        "warningOnly": 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
      }
    } ],
    "description": "Get the history for a known Patient and validate response."
  } ],
  "profile": [ {
    "id": "bundle-profile",
    "reference": "http://hl7.org/fhir/StructureDefinition/Bundle"
  } ]
}