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": "662edc61835c6a1ad9677334",
    "complaint_reported_date": "2024-04-16",
    "created": "2024-04-28 23:31:45",
    "location": "662edc59835c6a1ad9675cd0",
    "modified": "2024-04-28 23:31:45",
    "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": "662edc5d835c6a1ad9676b62",
    "subject_matter": "662edc59835c6a1ad9675c02"
}

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": "662edc61835c6a1ad9677336",
            "complaint_reported_date": "2023-06-22",
            "outcome": "partially_upheld",
            "subject_matter": "662edc59835c6a1ad9675c08"
        },
        {
            "_id": "662edc61835c6a1ad9677338",
            "complaint_reported_date": "2024-03-20",
            "outcome": "inconclusive",
            "subject_matter": "662edc59835c6a1ad9675c02"
        },
        {
            "_id": "662edc61835c6a1ad967733a",
            "complaint_reported_date": "2023-03-03",
            "outcome": "upheld",
            "subject_matter": "662edc59835c6a1ad9675c06"
        },
        {
            "_id": "662edc61835c6a1ad967733c",
            "complaint_reported_date": "2022-03-19",
            "outcome": "upheld",
            "subject_matter": "662edc59835c6a1ad9675c0a"
        },
        {
            "_id": "662edc61835c6a1ad967733e",
            "complaint_reported_date": "2024-04-27",
            "outcome": null,
            "subject_matter": "662edc59835c6a1ad9675c10"
        },
        {
            "_id": "662edc61835c6a1ad9677340",
            "complaint_reported_date": "2023-04-27",
            "outcome": "partially_upheld",
            "subject_matter": "662edc59835c6a1ad9675c08"
        },
        {
            "_id": "662edc61835c6a1ad9677342",
            "complaint_reported_date": "2023-08-10",
            "outcome": "upheld",
            "subject_matter": "662edc59835c6a1ad9675c04"
        },
        {
            "_id": "662edc61835c6a1ad9677344",
            "complaint_reported_date": "2024-03-18",
            "outcome": "not_upheld",
            "subject_matter": "662edc59835c6a1ad9675c0c"
        },
        {
            "_id": "662edc61835c6a1ad9677346",
            "complaint_reported_date": "2023-06-11",
            "outcome": "upheld",
            "subject_matter": "662edc59835c6a1ad9675c06"
        },
        {
            "_id": "662edc61835c6a1ad9677354",
            "complaint_reported_date": "2024-03-02",
            "outcome": "upheld",
            "subject_matter": "662edc59835c6a1ad9675c0e"
        }
    ],
    "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": "662edc61835c6a1ad9677334",
    "complaint_reported_date": "2024-04-16",
    "created": "2024-04-28 23:31:45",
    "location": "662edc59835c6a1ad9675cd0",
    "modified": "2024-04-28 23:31:45",
    "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": "662edc5d835c6a1ad9676b62",
    "subject_matter": "662edc59835c6a1ad9675c02"
}