POST
/transactional-api/create-documentCreate Document
Files a document against a patient record. The file content is supplied base64-encoded in data. Optionally tag the document with a SNOMED CT code and/or clinicalSpecialty, both resolved against the NHS term browser.
Authorization: Bearer token (JWT). See Authentication.
Request
curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/create-document' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": {
"conceptId": "string",
"description": "string"
},
"clinicalSpecialty": {
"conceptId": "string",
"description": "string"
},
"authorDepartment": "string",
"additionalInformation": "string",
"title": "string",
"data": "string",
"fileName": "string",
"contentType": "string",
"consultationTopicHeadingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"hiddenFromPatientFacingServices": true
}'
Body parameters
| Field | Type | Required | Description |
|---|---|---|---|
patientId | string<uuid> | Yes | Medicus patient identifier. |
code | object (nullable) | No | SNOMED CT coded entry for the document. Resolved against the NHS term browser. |
clinicalSpecialty | object (nullable) | No | SNOMED CT coded clinical specialty. Resolved against the NHS term browser. |
authorDepartment | string (nullable) | No | Department of the filing author. |
additionalInformation | string (nullable) | No | Free-text additional information about the document. |
title | string (nullable) | No | Document title. |
data | string (nullable) | No | Base64-encoded file content. |
fileName | string (nullable) | No | Original file name. |
contentType | string (nullable) | No | MIME content type of the file. |
consultationTopicHeadingId | string<uuid> (nullable) | No | |
hiddenFromPatientFacingServices | boolean | No | If true, hidden from Patient Facing Services (IM1) such as the NHS App. |
Responses
200 Document created.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
400 Validation error.
5 possible code values
| Code | Description | When |
|---|---|---|
missing-patient-id | The patientId is required | patientId missing |
invalid-patient-id | The patientId is not valid | patientId not a valid UUID |
invalid-code | Could not resolve conceptId into a SNOMED CT code. Check the NHS term browser. | conceptId doesn't resolve to a SNOMED CT code |
invalid-clinical-specialty | Could not resolve conceptId into a SNOMED CT clinical specialty. Check the NHS term browser. | clinicalSpecialty conceptId doesn't resolve |
invalid-consultation-topic-heading-id | The consultationTopicHeadingId is not a UUID | consultationTopicHeadingId is not a UUID |
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}
404 No patient found for the given patientId.
{
"errors": [
{
"code": "patient-not-found",
"description": "Patient not found for the id: 3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}