PackagesCanonicalsLogsProblems
    Packages
    hl7.fhir.core@1.8.0
    http://hl7.org/fhir/TestScript/testscript-example-readtest
{
  "description": "TestScript example resource with ported Sprinkler basic read tests R001, R002, R003, R004. The read tests will utilize user defined dynamic variables that will hold the Patient resource id values.",
  "_filename": "testscript-example-readtest.json",
  "package_name": "hl7.fhir.core",
  "date": "2016-09-26",
  "variable": [ {
    "name": "KnownPatientResourceId",
    "defaultValue": "example"
  }, {
    "name": "NonExistsPatientResourceId",
    "defaultValue": "does-not-exist"
  } ],
  "publisher": "HL7",
  "jurisdiction": [ {
    "coding": [ {
      "code": "US",
      "system": "urn:iso:std:iso:3166",
      "display": "United States of America (the)"
    } ]
  } ],
  "purpose": "Patient Read Operation",
  "name": "TestScript Example Read Test",
  "copyright": "© HL7.org 2011+",
  "type": null,
  "experimental": "true",
  "resourceType": "TestScript",
  "title": null,
  "package_version": "1.8.0",
  "status": "draft",
  "id": "7ff58aad-e4de-4839-a55b-34092b1b1724",
  "kind": null,
  "url": "http://hl7.org/fhir/TestScript/testscript-example-readtest",
  "identifier": {
    "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9879",
    "system": "urn:ietf:rfc:3986"
  },
  "version": "1.0",
  "contact": [ {
    "name": "Support",
    "telecom": [ {
      "use": "work",
      "value": "support@HL7.org",
      "system": "email"
    } ]
  } ],
  "metadata": {
    "capability": [ {
      "link": [ "http://hl7.org/fhir/http.html#read", "http://hl7.org/fhir/patient.html" ],
      "required": true,
      "description": "Patient Read Operation",
      "capabilities": {
        "reference": "CapabilityStatement/example"
      }
    } ]
  },
  "test": [ {
    "id": "R001",
    "name": "Sprinkler Read Test R001",
    "action": [ {
      "operation": {
        "type": {
          "code": "read",
          "system": "http://hl7.org/fhir/testscript-operation-codes"
        },
        "accept": "xml",
        "params": "/${KnownPatientResourceId}",
        "resource": "Patient",
        "description": "Read the known Patient resource on the destination test system using the user defined dynamic variable ${KnownPatientResourceId}."
      }
    }, {
      "assert": {
        "response": "okay",
        "description": "Confirm that the returned HTTP status is 200(OK)."
      }
    }, {
      "assert": {
        "contentType": "xml",
        "description": "Confirm that the returned format is XML."
      }
    }, {
      "assert": {
        "operator": "notEmpty",
        "description": "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning.",
        "headerField": "Last-Modified",
        "warningOnly": true
      }
    }, {
      "assert": {
        "resource": "Patient",
        "description": "Confirm that the returned resource type is Patient."
      }
    }, {
      "assert": {
        "description": "Confirm that the returned Patient conforms to the base FHIR specification.",
        "validateProfileId": "patient-profile"
      }
    } ],
    "description": "Read a known Patient and validate response."
  }, {
    "id": "R002",
    "name": "Sprinkler Read Test R002",
    "action": [ {
      "operation": {
        "type": {
          "code": "read",
          "system": "http://hl7.org/fhir/testscript-operation-codes"
        },
        "accept": "xml",
        "params": "/1",
        "resource": "Patient",
        "description": "Attempt to read the Parameters resource type. What we really want here is an illegal type but the build process won't allow that. Parameters is a valid resource which doesn't have an end-point so, this should fail."
      }
    }, {
      "assert": {
        "response": "notFound",
        "description": "Confirm that the returned HTTP status is 404(Not Found)."
      }
    } ],
    "description": "Read an unknown Resource Type and validate response."
  }, {
    "id": "R003",
    "name": "Sprinkler Read Test R003",
    "action": [ {
      "operation": {
        "type": {
          "code": "read",
          "system": "http://hl7.org/fhir/testscript-operation-codes"
        },
        "accept": "xml",
        "params": "/${NonExistsPatientResourceId}",
        "resource": "Patient",
        "description": "Attempt to read the non-existing Patient resource on the destination test system using the user defined dynamic variable ${NonExistsPatientResourceId}."
      }
    }, {
      "assert": {
        "response": "notFound",
        "description": "Confirm that the returned HTTP status is 404(Not Found)."
      }
    } ],
    "description": "Read a known, non-existing Patient and validate response."
  }, {
    "id": "R004",
    "name": "Sprinkler Read Test R004",
    "action": [ {
      "operation": {
        "type": {
          "code": "read",
          "system": "http://hl7.org/fhir/testscript-operation-codes"
        },
        "accept": "xml",
        "params": "/ID-may-not-contain-CAPITALS",
        "resource": "Patient",
        "description": "Attempt to read a Patient resource on the destination test system using known bad formatted resource id."
      }
    }, {
      "assert": {
        "response": "bad",
        "description": "Confirm that the returned HTTP status is 400(Bad Request)."
      }
    } ],
    "description": "Read a Patient using a known bad formatted resource id and validate response."
  } ],
  "profile": [ {
    "id": "patient-profile",
    "reference": "http://hl7.org/fhir/StructureDefinition/Patient"
  } ]
}