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": "4d59c916-9726-11ec-af3f-0a58a9feac02",
"code": {
"conceptId": "185389009",
"description": "Telephone encounter"
},
"clinicalSpecialty": {
"conceptId": "185389009",
"description": "Telephone encounter"
},
"authorDepartment": "Cardiology",
"additionalInformation": "Patient counselled on medication changes.",
"title": "Discharge Summary",
"data": "JVBERi0xLjQK...",
"fileName": "discharge-summary.pdf",
"contentType": "application/pdf",
"consultationTopicHeadingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"hiddenFromPatientFacingServices": false
}'

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.

Response fields

FieldTypeDescription
idstring<uuid>Identifier of the created document.
{
"id": "00000000-0000-0000-0000-000000000000"
}
400 Validation error.
6 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
consultation-topic-heading-not-foundConsultation topic heading not found for this consultationTopicHeadingIdconsultationTopicHeadingId belongs to another patient's record

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}
404 No patient found for the given patientId.

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "patient-not-found",
"description": "Patient not found for the id: 3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
]
}