Rooms

A room within a location.

The room object

Attributes

  • _id
    string

    A unique Id for the room.

  • archived
    boolean

    Flag indiciating if the room has been archived.

  • created
    string

    The date/time the group was created.

  • features
    list of strings

    A list of the room's features.

  • floor
    string

    The floor the room is located on; -1, 0, 1, 2, 3, 4.

  • funding_types
    list of strings

    A list of the funding types the room is available for; private, local_authority, local_authority_top_up, chc, chc_lifestyle, block_bed, dta_spot.

  • location
    string

    The Id of the location the room is in.

  • modified
    string

    The date/time the group was modified.

  • name_no
    string

    The name/no. of the room.

  • rates
    hash

    A hash of room rates, keys are room rate type Ids and values are the rate for the room rate type.

    • rates.{room_rate_type_id}
      integer

      The rate for the room (in pence).

  • suitable_for
    list of strings

    A list of the type of care the room is suitable for; bariatric_care, learning_disability_care, residential, residential_dementia, nursing, nursing_dementia.

The room object
{
    "_id": "6617e6e408a01173cf89319d",
    "archived": false,
    "created": "2024-04-11 13:34:28",
    "features": [
        "6617e6e308a01173cf893105",
        "6617e6e308a01173cf89310d"
    ],
    "floor": "0",
    "funding_types": [
        "private",
        "local_authority",
        "local_authority_top_up",
        "chc",
        "chc_lifestyle",
        "block_bed",
        "dta_spot"
    ],
    "location": "6617e6e308a01173cf893153",
    "modified": "2024-04-11 13:34:28",
    "name_no": "01",
    "rates": {
        "6617e6e408a01173cf893191": 113000,
        "6617e6e408a01173cf893193": 135000,
        "6617e6e408a01173cf893195": 106000,
        "6617e6e408a01173cf893197": 162000,
        "6617e6e408a01173cf893199": 174500,
        "6617e6e408a01173cf89319b": 155500
    },
    "suitable_for": [
        "residential"
    ]
}

List all rooms

Return a list of rooms.

Parameters

  • attributes
    optional
    default ['_id']

    A list of attributes to include for fetched objects.

  • filters-archived
    optional
    default no

    A filter that allows rooms that are currently archived to be included or excluded.

    • unset
    • yes
    • no
  • filters-features
    optional

    A filter that accepts a list of room feature (Group) Ids and filters rooms by the features they have.

  • filters-floor
    optional

    A filter that accepts a list of floors filters rooms by the floor they are located on.

    • -1
    • 0
    • 1
    • 2
    • 3
    • 4
  • filters-funding_types
    optional

    A filter that accepts a list of funding types and filters rooms by the funding types they are available for.

    • private
    • local_authority
    • local_authority_top_up
    • chc
    • chc_lifestyle
    • block_bed
    • dta_spot
  • 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 rooms by their location.

  • 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; name_no.

  • filters-suitable_for
    optional

    A filter that accepts a list of care types and filters rooms by the types of care they are suitable for.

    • bariatric_care
    • learning_disability_care
    • residential
    • residential_dementia
    • nursing
    • nursing_dementia
  • 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
    • floor
    • modified
    • name_no

Response

Returns a page of rooms.

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

$rooms = $api_client->request(
    'GET',
    'rooms',
    [
        'attributes'=>['name_no'],
        'filters-location'=>$location_id
    ]
);
rooms = api_client(
    'GET',
    'rooms',
    params={
        'attributes': ['name_no'],
        'filters-location': location_id
    }
)
rooms = api_client.request(
    'GET',
    'rooms',
    params: {
        'attributes' => ['name_no'],
        'filters-location' => location_id
    }
)
Response
{
    "item_count": 35,
    "items": [
        {
            "_id": "6617e6e408a01173cf89319d",
            "name_no": "01"
        },
        {
            "_id": "6617e6e408a01173cf89319f",
            "name_no": "02"
        },
        {
            "_id": "6617e6e408a01173cf8931a1",
            "name_no": "03"
        },
        {
            "_id": "6617e6e408a01173cf8931a3",
            "name_no": "04"
        },
        {
            "_id": "6617e6e408a01173cf8931a5",
            "name_no": "05"
        },
        {
            "_id": "6617e6e408a01173cf8931a7",
            "name_no": "06"
        },
        {
            "_id": "6617e6e408a01173cf8931a9",
            "name_no": "07"
        },
        {
            "_id": "6617e6e408a01173cf8931ab",
            "name_no": "08"
        },
        {
            "_id": "6617e6e408a01173cf8931ad",
            "name_no": "09"
        },
        {
            "_id": "6617e6e408a01173cf8931af",
            "name_no": "10"
        }
    ],
    "page": 1,
    "page_count": 4,
    "per_page": 10
}

Retrieve a room

Retrieve a room object.

Response

Returns a room object.

GET
/v1/rooms/<room_id>
var room = apiClient.Request(HttpMethod.Get, $"rooms/{roomId}");
<?php

$room = $api_client->request('GET', 'rooms/' . $room_id);
room = api_client('GET', f'rooms/{room_id}')
room = api_client.request('GET', "rooms/#{room_id}")
Response
{
    "_id": "6617e6e408a01173cf89319d",
    "archived": false,
    "created": "2024-04-11 13:34:28",
    "features": [
        "6617e6e308a01173cf893105",
        "6617e6e308a01173cf89310d"
    ],
    "floor": "0",
    "funding_types": [
        "private",
        "local_authority",
        "local_authority_top_up",
        "chc",
        "chc_lifestyle",
        "block_bed",
        "dta_spot"
    ],
    "location": "6617e6e308a01173cf893153",
    "modified": "2024-04-11 13:34:28",
    "name_no": "01",
    "rates": {
        "6617e6e408a01173cf893191": 113000,
        "6617e6e408a01173cf893193": 135000,
        "6617e6e408a01173cf893195": 106000,
        "6617e6e408a01173cf893197": 162000,
        "6617e6e408a01173cf893199": 174500,
        "6617e6e408a01173cf89319b": 155500
    },
    "suitable_for": [
        "residential"
    ]
}