PackagesCanonicalsLogsProblems
    Packages
    hl7.fhir.r5.examples@5.0.0-snapshot2
    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.r5.examples",
  "date": "2017-01-18",
  "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",
  "scope": [ {
    "phase": {
      "coding": [ {
        "code": "unit",
        "system": "http://hl7.org/fhir/testscript-scope-phase-codes"
      } ]
    },
    "artifact": "http://hl7.org/fhir/StructureDefinition/Patient",
    "conformance": {
      "coding": [ {
        "code": "optional",
        "system": "http://hl7.org/fhir/testscript-scope-conformance-codes"
      } ]
    }
  } ],
  "title": null,
  "package_version": "5.0.0-snapshot2",
  "status": "draft",
  "id": "1ab25539-9a07-4bc8-b6c9-6616cdf5de0c",
  "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": {
    "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#read" ],
      "required": true,
      "validated": false,
      "description": "Patient Read Operation",
      "capabilities": "http://hl7.org/fhir/CapabilityStatement/example"
    } ]
  },
  "test": [ {
    "id": "R001",
    "name": "Sprinkler Read Test R001",
    "action": [ {
      "operation": {
        "type": {
          "code": "read",
          "system": "http://hl7.org/fhir/restful-interaction"
        },
        "accept": "xml",
        "params": "/${KnownPatientResourceId}",
        "resource": "Patient",
        "description": "Read the known Patient resource on the destination test system using the user defined dynamic variable ${KnownPatientResourceId}.",
        "encodeRequestUrl": true
      }
    }, {
      "assert": {
        "response": "okay",
        "description": "Confirm that the returned HTTP status is 200(OK).",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    }, {
      "assert": {
        "contentType": "xml",
        "description": "Confirm that the returned format is XML.",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    }, {
      "assert": {
        "operator": "notEmpty",
        "description": "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server might not support versioning.",
        "headerField": "Last-Modified",
        "warningOnly": true,
        "stopTestOnFail": false
      }
    }, {
      "assert": {
        "resource": "Patient",
        "description": "Confirm that the returned resource type is Patient.",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    }, {
      "assert": {
        "description": "Confirm that the returned Patient conforms to the base FHIR specification.",
        "warningOnly": false,
        "stopTestOnFail": false,
        "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/restful-interaction"
        },
        "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.",
        "encodeRequestUrl": true
      }
    }, {
      "assert": {
        "response": "notFound",
        "description": "Confirm that the returned HTTP status is 404(Not Found).",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    } ],
    "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/restful-interaction"
        },
        "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}.",
        "encodeRequestUrl": true
      }
    }, {
      "assert": {
        "response": "notFound",
        "description": "Confirm that the returned HTTP status is 404(Not Found).",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    } ],
    "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/restful-interaction"
        },
        "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.",
        "encodeRequestUrl": true
      }
    }, {
      "assert": {
        "response": "bad",
        "description": "Confirm that the returned HTTP status is 400(Bad Request).",
        "warningOnly": false,
        "stopTestOnFail": false
      }
    } ],
    "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"
  } ]
}