The home visit object

Attributes

  • _id
    string

    A unique Id for the home visit.

  • anonymized
    string

    The date/time the home visit was anonymized (if anonymized).

  • assigned_to
    string

    The user the home visit is assigned to.

  • cancelled
    string

    The date/time the home visit was cancelled (if cancelled).

  • care_enquiry
    string

    The Id of the care enquiry this home visit has been booked for.

  • completed
    string

    The date/time the home visit was completed (if completed).

  • created
    string

    The date/time the home visit was created.

  • date_time
    string

    The date/time of the visit.

  • host
    string

    The host for the visit designated by their role at the location; manager, deputy_manager, administrator, receptionist, senior_carer, carer, customer_relations_adviser, nurse, other.

  • location
    string

    The Id of the location this home visit is to.

  • modified
    string

    The date/time the home visit was modified.

  • notes
    string

    Notes regarding the visit.

  • service_user_contact
    string

    The Id of the service user contact who will attend the home during the visit. This is optional, if not specified then the care seeker associated with the care enquiry will be attending.

  • visit_type
    string

    The type of visit booked; in_person, virtual.

The home visit object
{
    "_id": "6724fbca4f73a2cebf63857b",
    "anonymized": null,
    "assigned_to": "6724fbc74f73a2cebf637806",
    "cancelled": null,
    "care_enquiry": "6724fbca4f73a2cebf638579",
    "completed": "2024-10-27 15:30:00",
    "created": "2024-11-01 16:03:22",
    "date_time": "2024-10-27 14:30:00",
    "host": "manager",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:22",
    "notes": "",
    "service_user_contact": null,
    "visit_type": "in_person"
}

Create a home visit

Unless suppressed creating a home visit will if possible send a confirmation email to the care seeker regarding their visit.

Parameters

  • assigned_to
    optional

    The Id of the user the home visit is assigned to. If you do not specify a user then CareHQ will allocate the home visit to the user the care enquiry is assigned to.

  • care_enquiry
    required

    The Id of the care enquiry the home visit relates to.

  • date_time
    required

    The date/time the home visit is booked for.

  • host
    required

    The job title of the staff member who will host the visit.

    • manager
    • deputy_manager
    • administrator
    • receptionist
    • senior_carer
    • carer
    • customer_relations_adviser
    • nurse
  • notes
    optional

    Any notes regarding the visit.

  • service_user_contact
    optional

    The Id of the service user contact that will attend the visit (if not specified then the care seeker for the care enquiry will be recorded as the attendee).

  • suppress_email
    optional

    Flag indicating if the email sent to care seekers confirming their visit should be suppressed.

  • visit_type
    required
    • in_person
    • virtual

Response

Returns the home visit object created.

PUT
/v1/home-visits
var homeVisit = apiClient.Request(
    HttpMethod.Put,
    "home-visits",
    null,
    new MultiValueDict()
        .Add("care_enquiry", care_enquiry_id)
        .Add("date_time", visit_date_time)
        .Add("host", "manager")
        .Add("notes", "Care seeker has requested to view ground floor rooms.")
        .Add("visit_type", "in_person")
);
<?php

$comment = $api_client->request(
    'PUT',
    'home-visits',
    NULL
    [
        'care_enquiry'=>$care_enquiry_id,
        'date_time'=>$visit_date_time,
        'host'=>'manager',
        'notes'=>'Care seeker has requested to view ground floor rooms.',
        'visit_type'=>'in_person'
    ]
);
home_visit = api_client(
    'PUT',
    'home-visits',
    data={
        'care_enquiry': care_enquiry_id,
        'date_time': visit_date_time,
        'host': 'manager',
        'notes': 'Care seeker has requested to view ground floor rooms.',
        'visit_type': 'in_person'
    }
)
home_visit = api_client.request(
    'PUT',
    'home-visits',
    data: {
        'care_enquiry' => care_enquiry_id,
        'date_time' => visit_date_time,
        'host' => 'manager',
        'notes' => 'Care seeker has requested to view ground floor rooms.',
        'visit_type' => 'in_person'
    }
)
Response
{
    "_id": "6724fbd63cd2cde34170f2c6",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "cancelled": null,
    "care_enquiry": "6724fbd64f73a2cebf638f33",
    "completed": null,
    "created": "2024-11-01 16:03:34",
    "date_time": "2024-11-03 11:00:00",
    "host": "manager",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:34",
    "notes": "Care seeker has requested to view ground floor rooms.",
    "service_user_contact": null,
    "visit_type": "in_person"
}

List all home visits

Return a list of home visits booked for care seekers.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-anonymized
    optional
    default unset

    A filter that allows home visits to be filtered by whether the visit is anonymized.

    • unset
    • yes
    • no
  • filters-assigned_to
    optional

    A filter that accepts a list of user Ids and filters home visits by the user they are assigned.

  • filters-cancelled
    optional
    default unset

    A filter that allows home visits to be filtered by whether the visit is cancelled.

    • unset
    • yes
    • no
  • filters-care_enquiry
    optional

    A filter that accepts a list of care enquiry Ids and filters home visits by the enquiry the visit has been booked for.

  • filters-completed
    optional
    default unset

    A filter that allows home visits to be filtered by whether the visit is completed.

    • unset
    • yes
    • no
  • filters-end_date
    optional

    A filter that accepts a date and filters home visits to those booked before or on the end date.

  • filters-ids
    optional

    A filter that accepts a list of Ids and filters the items returned to those with an Id in the list.

  • filters-location
    optional

    A filter that accepts a list of location Ids and filters home visits by the location they are to.

  • filters-modified_after
    optional

    A filter that accepts a date/time and filters the items returned to those modified after the date/time.

  • filters-modified_before
    optional

    A filter that accepts a date/time and filters the items returned to those modified before the date/time.

  • filters-q
    optional

    A case insensitive keyword filter applied to the following fields; notes.

  • filters-start_date
    optional

    A filter that accepts a date and filters home visits to those booked after or on the start date.

  • filters-visit_type
    optional

    A filter that allows home visits to be filtered by type.

    • in_person
    • virtual
  • page
    optional
    default 1

    The page number to fetch.

  • per_page
    optional
    default 10

    The number of items to return per page.

  • sort_by
    optional
    default _id

    A list of fields the returned items can be sorted by. Fields prefixed with minus (-) sign are sorted in descending order.

    • _id
    • created
    • modified

Response

Returns a page of home visits.

GET
/v1/home-visits
var homeVisits = apiClient.Request(
    HttpMethod.Get,
    "home-visits",
    new MultiValueDict()
        .Add("attributes", "care_enquiry", "date_time", "host", "notes")
        .Add("filters-cancelled", "no")
        .Add("filters-completed", "no")
);
<?php

$home_visits = $api_client->request(
    'GET',
    'home-visits',
    [
        'attributes'=>['care_enquiry', 'date_time', 'host', 'notes'],
        'filters-cancelled'=>'no',
        'filters-completed'=>'no'
    ]
);
home_visits = api_client(
    'GET',
    'home-visits',
    params={
        'attributes': ['care_enquiry', 'date_time', 'host', 'notes'],
        'filters-cancelled': 'no',
        'filters-completed': 'no'
    }
)
home_visits = api_client.request(
    'GET',
    'home-visits',
    params: {
        'attributes'=>['care_enquiry', 'date_time', 'host', 'notes'],
        'filters-cancelled'=>'no',
        'filters-completed'=>'no'
    }
)
Response
{
    "item_count": 23,
    "items": [
        {
            "_id": "6724fbc94f73a2cebf638224",
            "care_enquiry": "6724fbc94f73a2cebf638222",
            "date_time": "2023-02-17 12:52:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf638244",
            "care_enquiry": "6724fbc94f73a2cebf638242",
            "date_time": "2023-02-26 10:18:00",
            "host": "deputy_manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf6382a2",
            "care_enquiry": "6724fbc94f73a2cebf6382a0",
            "date_time": "2023-04-14 16:24:00",
            "host": "deputy_manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf6382db",
            "care_enquiry": "6724fbc94f73a2cebf6382d9",
            "date_time": "2023-05-28 16:22:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf638375",
            "care_enquiry": "6724fbc94f73a2cebf638373",
            "date_time": "2023-08-18 14:35:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf638384",
            "care_enquiry": "6724fbc94f73a2cebf638382",
            "date_time": "2023-09-01 14:13:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf638388",
            "care_enquiry": "6724fbc94f73a2cebf638386",
            "date_time": "2023-09-13 10:08:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbc94f73a2cebf638396",
            "care_enquiry": "6724fbc94f73a2cebf638394",
            "date_time": "2023-09-19 13:42:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbca4f73a2cebf6383bc",
            "care_enquiry": "6724fbca4f73a2cebf6383ba",
            "date_time": "2023-10-17 08:20:00",
            "host": "manager",
            "notes": ""
        },
        {
            "_id": "6724fbca4f73a2cebf6383d5",
            "care_enquiry": "6724fbca4f73a2cebf6383d3",
            "date_time": "2023-11-03 09:46:00",
            "host": "manager",
            "notes": ""
        }
    ],
    "page": 1,
    "page_count": 3,
    "per_page": 10
}

Retrieve a home visit

Retrieve a home visit object.

Response

Returns a home visit object.

GET
/v1/home-visits/<home_visit_id>
var homeVisit = apiClient.Request(
    HttpMethod.Get,
    $"home-visits/{homeVisitId}"
);
<?php

$home_visit = $api_client->request(
    'GET',
    'home-visits/' . $home_visit_id
);
home_visit = api_client('GET', f'home-visits/{home_visit_id}')
home_visit = api_client.request('GET', "home-visits/#{home_visit_id}")
Response
{
    "_id": "6724fbca4f73a2cebf63857b",
    "anonymized": null,
    "assigned_to": "6724fbc74f73a2cebf637806",
    "cancelled": null,
    "care_enquiry": "6724fbca4f73a2cebf638579",
    "completed": "2024-10-27 15:30:00",
    "created": "2024-11-01 16:03:22",
    "date_time": "2024-10-27 14:30:00",
    "host": "manager",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:22",
    "notes": "",
    "service_user_contact": null,
    "visit_type": "in_person"
}

Update a home visit

Home visits can only be updated if they are pending (not cancelled or completed).

Unless suppressed updating the date/time of a home visit will if possible send a confirmation email to the care seeker regarding their new visit time.

Parameters

  • assigned_to
    required

    The Id of the user the home visit is assigned to. If you do not specify a user then CareHQ will allocate the home visit to the user the care enquiry is assigned to.

  • date_time
    required

    The date/time the home visit is booked for.

  • host
    required

    The job title of the staff member who will host the visit.

    • manager
    • deputy_manager
    • administrator
    • receptionist
    • senior_carer
    • carer
    • customer_relations_adviser
    • nurse
  • notes
    optional

    Any notes regarding the visit.

  • suppress_email
    optional

    Flag indicating if the email sent to care seekers confirming their visit should be suppressed.

  • visit_type
    required
    • in_person
    • virtual

Response

Returns the home visit object updated.

PATCH
/v1/home-visits/<home_visit_id>
var action = apiClient.Request(
    HttpMethod.Patch,
    $"home-visits/{home_visit_id}",
    null,
    new MultiValueDict()
        .Add("date_time, visitDateTime)
);
<?php

$comment = $api_client->request(
    'PATCH',
    'home-visits/' . home_visit_id,
    NULL
    ['date_time'=>visit_date_time]
);
home_visit = api_client(
    'PATCH',
    f'home-visits/{home_visit_id}',
    data={'date_time': visit_date_time}
)
action = api_client.request(
    'PATCH',
    "home-visits/#{home_visit_id}",
    data: {
        'date_time'=>visit_date_time
    }
)
Response
{
    "_id": "6724fbd64f73a2cebf638f3b",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "cancelled": null,
    "care_enquiry": "6724fbd64f73a2cebf638f37",
    "completed": null,
    "created": "2024-11-01 16:03:34",
    "date_time": "2024-11-03 12:00:00",
    "host": "manager",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:34",
    "notes": "Care seeker has requested to view ground floor rooms.",
    "visit_type": "in_person"
}

Cancel a home visit

Response

Returns the home visit object cancelled.

PATCH
/v1/home-visits/<home_visit_id>/cancel
var homeVisit = apiClient.Request(
    HttpMethod.Patch,
    $"home-visits/{homeVisitId}/cancel"
);
<?php

$home_visit = $api_client->request(
    'PATCH',
    'home-visits/' . home_visit_id . '/cancel'
);
home_visit = api_client(
    'PATCH',
    f'home-visits/{home_visit_id}/cancel'
)
home_visit = api_client.request(
    'PATCH',
    "home-visits/#{home_visit_id}/cancel"
)
Response
{
    "_id": "6724fbd64f73a2cebf638f25",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "cancelled": "2024-11-01 16:03:34",
    "care_enquiry": "6724fbd64f73a2cebf638f21",
    "completed": null,
    "created": "2024-11-01 16:03:34",
    "date_time": "2024-11-03 11:00:00",
    "host": "manager",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:34",
    "notes": "Care seeker has requested to view ground floor rooms.",
    "visit_type": "in_person"
}

Mark a home visit as complete

Response

Returns the home visit object completed.

PATCH
/v1/home-visits/<home_visit_id>/complete
var homeVisit = apiClient.Request(
    HttpMethod.Patch,
    $"home-visits/{homeVisitId}/complete"
);
<?php

$comment = $api_client->request(
    'PATCH',
    'home-visits/' . home_visit_id . '/complete'
);
home_visit = api_client(
    'PATCH',
    f'home-visits/{home_visit_id}/complete'
)
home_visit = api_client.request(
    'PATCH',
    "home-visits/#{home_visit_id}/complete"
)
Response
{
    "_id": "6724fbd64f73a2cebf638f2e",
    "assigned_to": "6724fbc74f73a2cebf637800",
    "cancelled": null,
    "care_enquiry": "6724fbd64f73a2cebf638f2a",
    "completed": "2024-11-01 16:03:34",
    "created": "2024-11-01 16:03:34",
    "date_time": "2024-11-03 11:00:00",
    "host": "manager",
    "location": "6724fbc74f73a2cebf6377fa",
    "modified": "2024-11-01 16:03:34",
    "notes": "Care seeker has requested to view ground floor rooms.",
    "visit_type": "in_person"
}