Complaints

A complaint reported relating to a service user.

Detailed complaint information is not intended to be captured or held on CareHQ, instead complaints provides a flag against users to indicate when there is an active complaint against them and allows for reporting on complaints in line with other data held on CareHQ.

The complaint object

Attributes

  • _id
    string

    A unique Id for the complaint.

  • complaint_reported_date
    string

    The date the complaint was reported by the complainant.

  • created
    string

    The date/time the complaint was created.

  • location
    string

    The Id of the location the complaint relates to.

  • modified
    string

    The date/time the booking was modified.

  • notes
    string

    Notes regarding the complaint.

  • outcome
    string

    The outcome of the complaint; upheld, partially_upheld, not_upheld, inconclusive, withdrawn.

  • outcome_reported_date
    string

    The date the outcome of an investigation into the complaint was reported to the complainant.

  • ref
    string

    A reference number for the complaint (e.g. a complaints number/reference on a dedicated complaints system).

  • referred_to_other_bodies
    boolean

    Flag indicating if the complaint was referred to any other regulatory bodies.

  • service_user
    string

    The Id of the service user the complaint relates to.

  • subject_matter
    string

    The subject matter of the complaint.

The complaint object
{
    "_id": "6724fbd04f73a2cebf638db2",
    "complaint_reported_date": "2024-10-19",
    "created": "2024-11-01 16:03:28",
    "location": "6724fbc74f73a2cebf6377fc",
    "modified": "2024-11-01 16:03:28",
    "notes": "Barry has reported that staff members are ignoring requests he's made to change the layout of his room so that he's able to see outside whilst in his bed.",
    "outcome": null,
    "outcome_reported_date": null,
    "ref": "140331",
    "referred_to_other_bodies": false,
    "service_user": "6724fbca4f73a2cebf638674",
    "subject_matter": "6724fbc74f73a2cebf637720"
}

List all complaints

Return a list of complaints.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-end_date
    optional

    A filter that accepts a date and filters complaints to those reported 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 complaints by the location the complaint relates 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-outcome
    optional

    A filter that allows complaints to be filtered to a list of outcomes.

    • upheld
    • partially_upheld
    • not_upheld
    • inconclusive
    • withdrawn
  • filters-q
    optional

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

  • filters-service_user
    optional

    A filter that accepts a list of service user Ids and filters complaints by the service user the complaint relates to.

  • filters-start_date
    optional

    A filter that accepts a date and filters complaints to those reported after or on the start date.

  • filters-subject_matter
    optional

    A filter that accepts a list of subject matters and filters complaints by the subject matter of the complaint.

  • 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 complaints.

GET
/v1/complaints
var complaints = apiClient.Request(
    HttpMethod.Get,
    "complaints",
    new MultiValueDict()
        .Add(
            "attributes", 
            "complaint_reported_date_str", 
            "subject_matter", 
            "outcome"
        )
        .Add("filters-location", locationId)
);
<?php

$complaints = $api_client->request(
    'GET',
    'complaints',
    [
        'attributes'=>[
            'complaint_reported_date_str',
            'subject_matter',
            'outcome'
        ],
        'filters-location'=>[$location_id]
    ]
);
complaints = api_client(
    'GET',
    'complaints',
    params={
        'attributes': [
            'complaint_reported_date_str',
            'subject_matter',
            'outcome'
        ],
        'filters-location': [location_id]
    }
)
complaints = api_client.request(
    'GET',
    'complaints',
    params: {
        'attributes' => [
                'complaint_reported_date_str',
                'subject_matter',
                'outcome'
        ],
        'filters-location' => [$location_id]
    }
)
Response
{
    "item_count": 12,
    "items": [
        {
            "_id": "6724fbd04f73a2cebf638db4",
            "complaint_reported_date": "2023-12-25",
            "outcome": "partially_upheld",
            "subject_matter": "6724fbc74f73a2cebf637726"
        },
        {
            "_id": "6724fbd04f73a2cebf638db6",
            "complaint_reported_date": "2024-09-22",
            "outcome": "inconclusive",
            "subject_matter": "6724fbc74f73a2cebf637720"
        },
        {
            "_id": "6724fbd04f73a2cebf638db8",
            "complaint_reported_date": "2023-09-05",
            "outcome": "upheld",
            "subject_matter": "6724fbc74f73a2cebf637724"
        },
        {
            "_id": "6724fbd04f73a2cebf638dba",
            "complaint_reported_date": "2022-09-21",
            "outcome": "upheld",
            "subject_matter": "6724fbc74f73a2cebf637728"
        },
        {
            "_id": "6724fbd04f73a2cebf638dbc",
            "complaint_reported_date": "2024-10-30",
            "outcome": null,
            "subject_matter": "6724fbc74f73a2cebf63772e"
        },
        {
            "_id": "6724fbd04f73a2cebf638dbe",
            "complaint_reported_date": "2023-10-30",
            "outcome": "partially_upheld",
            "subject_matter": "6724fbc74f73a2cebf637726"
        },
        {
            "_id": "6724fbd04f73a2cebf638dc0",
            "complaint_reported_date": "2024-02-12",
            "outcome": "upheld",
            "subject_matter": "6724fbc74f73a2cebf637722"
        },
        {
            "_id": "6724fbd04f73a2cebf638dc2",
            "complaint_reported_date": "2024-09-20",
            "outcome": "not_upheld",
            "subject_matter": "6724fbc74f73a2cebf63772a"
        },
        {
            "_id": "6724fbd04f73a2cebf638dc4",
            "complaint_reported_date": "2023-12-14",
            "outcome": "upheld",
            "subject_matter": "6724fbc74f73a2cebf637724"
        },
        {
            "_id": "6724fbd04f73a2cebf638dd2",
            "complaint_reported_date": "2024-09-04",
            "outcome": "upheld",
            "subject_matter": "6724fbc74f73a2cebf63772c"
        }
    ],
    "page": 1,
    "page_count": 2,
    "per_page": 10
}

Retrieve a complaint

Retrieve a complaint object.

Response

Returns a complaint object.

GET
/v1/complaints/<complaint_id>
var complaint = apiClient.Request(HttpMethod.Get, $"complaints/{complaintId}");
<?php

$complaint = $api_client->request('GET', 'complaints/' . $complaint_id);
complaint = api_client('GET', f'complaints/{complaint_id}')
complaint = api_client.request('GET', "complaints/#{complaint_id}")
Response
{
    "_id": "6724fbd04f73a2cebf638db2",
    "complaint_reported_date": "2024-10-19",
    "created": "2024-11-01 16:03:28",
    "location": "6724fbc74f73a2cebf6377fc",
    "modified": "2024-11-01 16:03:28",
    "notes": "Barry has reported that staff members are ignoring requests he's made to change the layout of his room so that he's able to see outside whilst in his bed.",
    "outcome": null,
    "outcome_reported_date": null,
    "ref": "140331",
    "referred_to_other_bodies": false,
    "service_user": "6724fbca4f73a2cebf638674",
    "subject_matter": "6724fbc74f73a2cebf637720"
}