Skip to main content
POST/transactional-api/create-patient-contact

Create Patient Contact

Adds a contact (next of kin, emergency contact, etc.) to a patient record. User-restricted only.

Authorization: Bearer token (JWT). See Authentication.

Request​

curl -L -X POST 'https://{tenantId}.api.england.medicus.health/transactional-api/create-patient-contact' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <token>' \
-d '{
"patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"title": "Mrs",
"firstName": "Jane",
"middleNames": "Elizabeth",
"lastName": "Doe",
"relationship": "Spouse",
"homePhoneNumber": "01632 960001",
"mobilePhoneNumber": "07700 900001",
"workPhoneNumber": "01632 960002",
"emailAddress": "jane.doe@example.com",
"address": {
"line1": "90 York Way",
"line2": "Kings Cross",
"line3": "string",
"locality": "London",
"administrativeArea": "Greater London",
"postalCode": "N1 9AG",
"country": "GBR"
},
"isNextOfKin": true,
"notes": "Prefers to be contacted after 6pm.",
"copyCorrespondence": false
}'

Body parameters

FieldTypeRequiredDescription
patientIdstring<uuid>YesMedicus patient identifier.
titlestringNo
firstNamestringYes
middleNamesstringNo
lastNamestringYes
relationshipstringYesFree text, e.g. Spouse, Parent, Carer.
homePhoneNumberstringNo
mobilePhoneNumberstringYes
workPhoneNumberstringNo
emailAddressstring<email>Yes
addressobjectNoObject with: line1, line2, line3, locality, administrativeArea, postalCode, country.
isNextOfKinbooleanNo
notesstringNo
copyCorrespondencebooleanNoCopy patient correspondence to this contact.

Responses​

200 Patient contact created.

Response fields

FieldTypeDescription
patientContactIdstring<uuid>
patientContactRelationshipIdstring<uuid>
{
"patientContactId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"patientContactRelationshipId": "9a1e2d3c-4b5f-4a6e-8c7d-1e2f3a4b5c6d"
}
400 Validation error.
12 possible code values
CodeDescriptionWhen
missing-patient-idThe patientId is required.patientId is blank
invalid-patient-idThe patientId is not valid.patientId is not a valid UUID
missing-first-nameThe firstName is required.firstName is blank
missing-last-nameThe lastName is required.lastName is blank
missing-relationshipThe relationship is required.relationship is blank
missing-mobile-phone-numberThe mobilePhoneNumber is required.mobilePhoneNumber is blank
missing-email-addressThe emailAddress is required.emailAddress is blank
invalid-home-phone-number'<value>' is not a valid telephone number.homePhoneNumber is present but not a valid telephone number
invalid-mobile-phone-number'<value>' is not a valid telephone number.mobilePhoneNumber is not a valid telephone number
invalid-work-phone-number'<value>' is not a valid telephone number.workPhoneNumber is present but not a valid telephone number
invalid-email-addressThis value is not a valid email address.emailAddress is not a valid email address
invalid-address-countryThe address country is not a recognised value.address.country is present but not a recognised ISO 3166-1 alpha-3 code

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required."
}
]
}
403 The call is application-restricted rather than user-restricted.

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "application-restricted-not-supported",
"description": "This endpoint is only available to user-restricted callers."
}
]
}
404 patientId doesn't correspond to a patient.

Response fields

FieldTypeDescription
errors[].codestring
errors[].descriptionstring
{
"errors": [
{
"code": "patient-not-found",
"description": "Patient not found for the id: <patientId>"
}
]
}