XUND API Documentation

POST /v1/services/filters/borderChange

Upon moving to a new location, it should be checked whether a border was crossed. In case a new country is viewed, the local specializations and supported filters will change.

This endpoint is meant to solve this problem by checking the old and new coordinates and converting both the filters and the filter values to the target country. Upon conversion unsupported filter types will be removed and supported ones will be added.

When the filters change, the specialization select values are modified. The converted filter values mark the new selection based on the previous one.

Request

Request Header additional fields

Parameter name

Parameter type

Parameter description

language

ClientLanguage

The expected language of the response

Request body parameters

Parameter name

Parameter type

Parameter description

fromCountryCode

CountryCode?

The previous and the current country code

toCountryCode

fromLocation

Location?

The previous and current latitude-longitude pairs

toLocation

specializationTypes

GenericSpecializationType []?

Generic specialization types for the same purpose than on GET /v1/services/filters endpoint

filterValues

Object

See https://xund.atlassian.net/wiki/spaces/PUB/pages/141656220/POST+v1+services+filters+apply#Request-body-parameters.

The currently used filter values, that need to be converted to be compatible with the new filters

Exactly one pair of fromCountryCode and toCountryCode or fromLocation and toLocation parameters is mandatory.


Response

Response Body data structure

Property name

Property type

Property description

isFilterChanged

boolean

Marks whether filter conversion is required

filters

Filters?

The response of GET /v1/services/filters endpoint for the new location

filterValues

Object?

See https://xund.atlassian.net/wiki/spaces/PUB/pages/141656220/POST+v1+services+filters+apply#Request-Body-parameters.

The currently used filter values converted to be compatible with the new filters property.

When conversion is not required, only { isFilterChanged: false } will be returned.

Examples

Example response

When no border was crossed, therefore there is no need for filter conversion, the response is a boolean:

{
    "isFilterChanged": false
}


When the from and to countries differ, the response is going to contain the new filters and the converted filter values:

JSON
{
    "isFilterChanged": true,
    "filters": {
        "name": {
            "text": "Name",
            "type": "TEXT"
        },
        "genders": {
            "text": "Genders",
            "type": "MULTISELECT",
            "values": [
                {
                    "value": "80e5d6f2-d486-45c7-8e3e-7e73e3dd0519",
                    "code": "FEMALE",
                    "text": "Female"
                },
                {
                    "value": "b23eb6b5-fc24-4a49-bf7d-ab695c8f04a1",
                    "code": "MALE",
                    "text": "Male"
                }
            ]
        },
        "specializations": {
            "type": "MULTISELECT",
            "text": "Specializations",
            "values": [
                {
                    "text": "Hospital",
                    "value": "1",
                    "code": "HOSPITAL"
                },
                {
                    "text": "Psychiatry and Neurology",
                    "value": "74c9d0f4-4ba5-4cf3-bfa1-583b81a146e3",
                    "code": "DOCTOR"
                },
                {
                    "text": "Neurology",
                    "value": "ef0ea38a-b3bf-4292-bc9a-49a3e233aded",
                    "code": "DOCTOR"
                }
            ],
            "selectionLimit": 15
        },
        "openingHours": {
            "text": "Opening Hours",
            "type": "FILTER_LIST",
            "filters": {
                "mon": {
                    "type": "MULTISELECT",
                    "text": "Monday",
                    "shortText": "Mon",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                },
                "tue": {
                    "type": "MULTISELECT",
                    "text": "Tuesday",
                    "shortText": "Tue",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                },
                "wed": {
                    "type": "MULTISELECT",
                    "text": "Wednesday",
                    "shortText": "Wed",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                },
                "thu": {
                    "type": "MULTISELECT",
                    "text": "Thursday",
                    "shortText": "Thu",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                },
                "fri": {
                    "type": "MULTISELECT",
                    "text": "Friday",
                    "shortText": "Fri",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                },
                "sat": {
                    "type": "MULTISELECT",
                    "text": "Saturday",
                    "shortText": "Sat",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                },
                "sun": {
                    "type": "MULTISELECT",
                    "text": "Sunday",
                    "shortText": "Sun",
                    "values": [
                        {
                            "value": "9f609b60-ab5a-42f9-8038-b1b8291f54db",
                            "code": "FORENOON",
                            "text": "Forenoon"
                        },
                        {
                            "value": "a806eb0f-8746-4b9c-a930-98e10efa7dfd",
                            "code": "AFTERNOON",
                            "text": "Afternoon"
                        }
                    ]
                }
            }
        },
        "location": {
            "text": "Location",
            "type": "LOCATION"
        }
    },
    "filterValues": {
        "name": "",
        "location": {
            "latitude": 48.103252,
            "longitude": 11.629402
        },
        "insurers": [],
        "genders": [],
        "openingHours": {
            "tue": [
                "9f609b60-ab5a-42f9-8038-b1b8291f54db"
            ]
        },
        "specializations": [
            "ef0ea38a-b3bf-4292-bc9a-49a3e233aded",
            "74c9d0f4-4ba5-4cf3-bfa1-583b81a146e3"
        ]
    }
}