POST
/transactional-api/create-patient-contactCreate 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
| Field | Type | Required | Description |
|---|---|---|---|
patientId | string<uuid> | Yes | Medicus patient identifier. |
title | string | No | |
firstName | string | Yes | |
middleNames | string | No | |
lastName | string | Yes | |
relationship | string | Yes | Free text, e.g. Spouse, Parent, Carer. |
homePhoneNumber | string | No | |
mobilePhoneNumber | string | Yes | |
workPhoneNumber | string | No | |
emailAddress | string<email> | Yes | |
address | object | No | Object with: line1, line2, line3, locality, administrativeArea, postalCode, country. |
isNextOfKin | boolean | No | |
notes | string | No | |
copyCorrespondence | boolean | No | Copy patient correspondence to this contact. |
Responses
200 Patient contact created.
Response fields
| Field | Type | Description |
|---|---|---|
patientContactId | string<uuid> | |
patientContactRelationshipId | string<uuid> |
{
"patientContactId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"patientContactRelationshipId": "9a1e2d3c-4b5f-4a6e-8c7d-1e2f3a4b5c6d"
}
400 Validation error.
12 possible code values
| Code | Description | When |
|---|---|---|
missing-patient-id | The patientId is required. | patientId is blank |
invalid-patient-id | The patientId is not valid. | patientId is not a valid UUID |
missing-first-name | The firstName is required. | firstName is blank |
missing-last-name | The lastName is required. | lastName is blank |
missing-relationship | The relationship is required. | relationship is blank |
missing-mobile-phone-number | The mobilePhoneNumber is required. | mobilePhoneNumber is blank |
missing-email-address | The 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-address | This value is not a valid email address. | emailAddress is not a valid email address |
invalid-address-country | The address country is not a recognised value. | address.country is present but not a recognised ISO 3166-1 alpha-3 code |
Response fields
| Field | Type | Description |
|---|---|---|
errors[].code | string | |
errors[].description | string |
{
"errors": [
{
"code": "missing-patient-id",
"description": "The patientId is required."
}
]
}
403 The call is application-restricted rather than user-restricted.
Response fields
| Field | Type | Description |
|---|---|---|
errors[].code | string | |
errors[].description | string |
{
"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
| Field | Type | Description |
|---|---|---|
errors[].code | string | |
errors[].description | string |
{
"errors": [
{
"code": "patient-not-found",
"description": "Patient not found for the id: <patientId>"
}
]
}