{
"description": "TestScript example resource with setup to delete if present and create a new instance of a Patient; and single test definition to update that Patient with various asserts.",
"_filename": "example/TestScript-testscript-example-update.json",
"package_name": "hl7.fhir.uv.testing",
"date": "2017-01-18",
"variable": [ {
"name": "createResourceId",
"sourceId": "fixture-patient-create",
"expression": {
"language": "application/xml",
"expression": "Patient/id"
}
} ],
"publisher": "HL7 International / FHIR Infrastructure",
"purpose": "Patient (Conditional) Create, Update, Delete Operations",
"resourceDefinition": "http://hl7.org/fhir/StructureDefinition/TestScript|0.1.0-snapshot1",
"name": "TestScriptExampleUpdate",
"copyright": "© HL7.org 2011+",
"type": null,
"experimental": "false",
"resourceType": "TestScript",
"title": "TestScript Example Update",
"_profile": [ {
"id": "patient-profile"
} ],
"setup": {
"action": [ {
"operation": {
"type": {
"code": "delete",
"system": "http://hl7.org/fhir/restful-interaction"
},
"label": "SetupDeletePatient",
"accept": "xml",
"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": "xml",
"sourceId": "fixture-patient-create",
"accept": "xml"
}
}, {
"assert": {
"direction": "response",
"description": "Confirm that the returned HTTP status is 201(Created).",
"warningOnly": false,
"responseCode": "201",
"stopTestOnFail": false
}
} ]
},
"package_version": "0.1.0-snapshot1",
"status": "draft",
"id": "fd3891a4-4986-440e-b085-a8d954614cf5",
"kind": null,
"url": "http://hl7.org/fhir/TestScript/testscript-example-update",
"identifier": [ {
"value": "urn:oid:2.16.840.1.113883.4.642.12.5",
"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"
} ]
} ],
"test": [ {
"id": "01-UpdatePatient",
"name": "Update Patient",
"action": [ {
"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": "xml",
"sourceId": "fixture-patient-update",
"accept": "xml"
}
}, {
"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
}
} ],
"description": "Update a Patient and validate response."
} ],
"profile": [ "http://hl7.org/fhir/StructureDefinition/Patient" ]
}