Xplain.Db.Selection

Xplain.Db.Selection(settings)

This class represents an Xplain selection. Use this class to define a selection which later on can be used within an Xplain.Db.Query.

The following example depicts how to use a Selection within a query. This would select the states 1 and 2 within the attribute Patient.EGK.EGK.:

...
var selection = new Xplain.Db.Selection({
   attribute: 'Patient.EGK.EGK',
   selectedStates: ['1', '2']
});

Alternatively, you may construct a selection from a an object returned by the backend. E.g. you may also use the following syntax:

...
var selection = new Xplain.Db.Selection({
   attribute: {
      object: 'Patient',
      dimension: 'EGK',
      attribute: 'EGK'
   },
   selectedStates: ['1', '2']
});

A Selection is a query property - more details can be [found here](https://docs.xplain-data.de/xplaindoc/interfaces/xplainjs/xplainDb/Query.html).

getAttribute

getAttribute(format)

return this selection’s attribute as object {object, dimension, attribute} or as string (in the form “object.dimension.attribute”) or as an instance of Xplain.Db.Attribute.

Parameters

format (string) – Set this parameter to string if the attribute should be returned as string. Set it to attribute to return it as instance of Xplain.Db.Attribute. Default = object, which returns it as plain object.

Returns

{object | string} the attribute

getId

getId()

return the ID of this Selection

Returns

ID {string}

getNegate

getNegate()

returns the negate status of this selection.

Returns

{boolean} the negate status or undefined

getSelectedStates

getSelectedStates()

return all selected states in this selection as array of strings.

Returns

{array} all selected states

toJson

toJson()

generates a part of the openQuery/executeQuery method the backend expects for this selection

Returns

{Object} an object representing this selection’s ajax request.