Skip to main content
POST/transactional-api/create-document

Create 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

FieldTypeRequiredDescription
patientIdstring<uuid>YesMedicus patient identifier.
codeobject (nullable)NoSNOMED CT coded entry for the document. Resolved against the NHS term browser.
clinicalSpecialtyobject (nullable)NoSNOMED CT coded clinical specialty. Resolved against the NHS term browser.
authorDepartmentstring (nullable)NoDepartment of the filing author.
additionalInformationstring (nullable)NoFree-text additional information about the document.
titlestring (nullable)NoDocument title.
datastring (nullable)NoBase64-encoded file content.
fileNamestring (nullable)NoOriginal file name.
contentTypestring (nullable)NoMIME content type of the file.
consultationTopicHeadingIdstring<uuid> (nullable)No
hiddenFromPatientFacingServicesbooleanNoIf 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
CodeDescriptionWhen
missing-patient-idThe patientId is requiredpatientId missing
invalid-patient-idThe patientId is not validpatientId not a valid UUID
invalid-codeCould not resolve conceptId into a SNOMED CT code. Check the NHS term browser.conceptId doesn't resolve to a SNOMED CT code
invalid-clinical-specialtyCould not resolve conceptId into a SNOMED CT clinical specialty. Check the NHS term browser.clinicalSpecialty conceptId doesn't resolve
invalid-consultation-topic-heading-idThe consultationTopicHeadingId is not a UUIDconsultationTopicHeadingId 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"
}
]
}