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

Create Encounter

Creates a finalised encounter (consultation) against a patient record, with one or more topics, each carrying one or more headings. Coded entries are SNOMED CT conceptId + description pairs 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-encounter' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"encounterType": {
"conceptId": "string",
"description": "string"
},
"startDate": "2024-07-29",
"startTime": "string",
"hiddenFromPatientFacingServices": false,
"confidentialFromThirdParties": false,
"topics": [
{
"code": {
"conceptId": "string",
"description": "string"
},
"headings": [
{
"code": {
"conceptId": "string",
"description": "string"
}
}
]
}
]
}'

Body parameters

FieldTypeRequiredDescription
patientIdstring<uuid>YesMedicus patient identifier.
encounterTypeobjectYesSNOMED CT coded encounter type. Required.
startDatestring<date>NoEncounter start date (YYYY-MM-DD). Defaults to today.
startTimestringNoEncounter start time (HH:MM:SS).
hiddenFromPatientFacingServicesbooleanNoIf true, hidden from Patient Facing Services (IM1) such as the NHS App.
confidentialFromThirdPartiesbooleanNo
topicsarray<object>YesOne or more consultation topics. At least one is required, and each topic must contain at least one heading.

Responses

200 Encounter created.
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"topics": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": {
"conceptId": "string",
"description": "string"
},
"headings": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"code": {
"conceptId": "string",
"description": "string"
}
}
]
}
]
}
400 Validation error.
10 possible code values
CodeDescriptionWhen
missing-patient-idThe patientId is requiredpatientId missing
invalid-patient-idThe patientId is not validpatientId not a valid UUID
patient-not-foundPatient not found for this patientIdpatientId doesn't exist
invalid-codeCould not resolve conceptId into a SNOMED CT code. Check the NHS term browser.a conceptId doesn't resolve to a SNOMED CT code
no-encounter-typeYou must specify an encounter type.encounterType missing
invalid-start-dateThe startDate is not a valid date in Y-m-d format.startDate not a valid date in Y-m-d format
invalid-start-timeThe startTime is not a valid time in H:i:s format.startTime not a valid time in H:i:s format
no-topicsYou must specify at least one topic.topics missing or empty
no-headingsYou must specify at least one heading.a topic's headings missing or empty
no-heading-codeYou must specify a code for the heading.a heading is missing a code
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required"
}
]
}