{
"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": "TestScript-testscript-example-update.json",
"package_name": "hl7.fhir.core",
"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 Operations",
"name": "TestScript Example Update",
"copyright": "© HL7.org 2011+",
"type": null,
"experimental": "true",
"resourceType": "TestScript",
"title": null,
"setup": {
"action": [ {
"operation": {
"type": {
"code": "delete",
"system": "http://hl7.org/fhir/testscript-operation-codes"
},
"label": "SetupDeletePatient",
"accept": "xml",
"params": "/${createResourceId}",
"resource": "Patient",
"description": "Execute a delete operation to insure the patient does not exist on the server."
}
}, {
"assert": {
"operator": "in",
"direction": "response",
"description": "Confirm that the returned HTTP status is 200(OK) or 204(No Content).",
"responseCode": "200,204"
}
}, {
"operation": {
"type": {
"code": "update",
"system": "http://hl7.org/fhir/testscript-operation-codes"
},
"label": "SetupCreatePatient",
"accept": "xml",
"params": "/${createResourceId}",
"resource": "Patient",
"sourceId": "fixture-patient-create",
"contentType": "xml",
"description": "Create patient resource on test server using the contents of fixture-patient-create"
}
}, {
"assert": {
"direction": "response",
"description": "Confirm that the returned HTTP status is 201(Created).",
"responseCode": "201"
}
} ]
},
"package_version": "3.2.0",
"status": "draft",
"id": "a3bc0ce0-aa8a-4ce5-b1e0-534c240d36eb",
"kind": null,
"url": "http://hl7.org/fhir/TestScript/testscript-example-update",
"identifier": {
"value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.9882",
"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" ],
"required": true,
"description": "Patient Update and Delete Operations",
"capabilities": {
"reference": "CapabilityStatement/example"
}
} ]
},
"test": [ {
"id": "01-UpdatePatient",
"name": "Update Patient",
"action": [ {
"operation": {
"type": {
"code": "update",
"system": "http://hl7.org/fhir/testscript-operation-codes"
},
"label": "SetupUpdatePatient",
"accept": "xml",
"params": "/${createResourceId}",
"resource": "Patient",
"sourceId": "fixture-patient-update",
"contentType": "xml",
"description": "Update patient resource on test server using the contents of fixture-patient-update"
}
}, {
"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 might not support versioning.",
"headerField": "Last-Modified",
"warningOnly": true
}
} ],
"description": "Update a Patient and validate response."
} ],
"profile": [ {
"id": "patient-profile",
"reference": "http://hl7.org/fhir/StructureDefinition/Patient"
} ]
}