{
"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.r6.examples",
"date": "2017-01-18",
"variable": [ {
"name": "createResourceId",
"path": "Patient/id",
"sourceId": "fixture-patient-create"
} ],
"publisher": "HL7 International / FHIR Infrastructure",
"jurisdiction": [ {
"coding": [ {
"code": "US",
"system": "urn:iso:std:iso:3166",
"display": "United States of America"
} ]
} ],
"purpose": "Patient (Conditional) Create, Update, Delete Operations",
"name": "TestScriptExampleUpdate",
"copyright": "© HL7.org 2011+",
"type": null,
"experimental": "true",
"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": "6.0.0-ballot1",
"extension": [ {
"url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
"valueCode": "fhir"
} ],
"status": "draft",
"id": "96df61b4-446f-47b2-9166-162ddc018aa8",
"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": "http://www.hl7.org/Special/committees/fiwg",
"system": "url"
} ]
} ],
"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,
"validated": false,
"description": "Patient Update and Delete Operations",
"capabilities": "http://hl7.org/fhir/CapabilityStatement/example"
} ]
},
"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" ]
}