====== panelRecords() ======
''array **panelRecords**(array //variables//, [array //filters//, string //person identifier//])''
The function panelRecords() provides you with data of other cases (CASE) in your data set which have the same personal identifier (SERIAL) as the current interview. This can for example be used in diary studies to assess process data or historical data.
**Note:** This function provides the assessed data with a delay of up to 30 minutes. That means: other interviews edited in the past 30 minutes will potentially not appear in the data in their updated form. This does not apply to the present interview (filter ''%%'current'%%'').
* //Variables//\\ A list of variable-identifiers, which are to be extracted from other cases.
* //Filters//\\ In an associative array, limits can be set to data retrieval. Possible filters are:
* ''%%'QUESTNNR'%%'' -- only retrieve cases for which this survey was used.
* ''%%'STARTED.min'%%'' -- only retrieve cases started at this point in time or later.
* ''%%'STARTED.max'%%'' -- only retrieve cases startet at this point in time or before.
* ''%%'current'%%'' -- Add the current interview to the data set (true) or not (false, default).
* //Person identifier//\\ Extracts cases for a different person identifier (SERIAL) as the current interview.
==== Return value ====
This function provides an indicated array, which contains an associative array for each case - sorted by case number CASE. These arrays use the variable names as key variable and the response codes as content.
[
['CASE' => 1, 'STARTED' => 1650470506, 'AB01' => 1, 'SK01_01' => 1, 'SK01_01' => 2],
['CASE' => 3, 'STARTED' => 1650470617, 'AB01' => 2, 'SK01_01' => 2, 'SK01_01' => 4],
['CASE' => 5, 'STARTED' => 1650471728, 'AB01' => 1, 'SK01_01' => 3, 'SK01_01' => 5],
['CASE' => 9, 'STARTED' => 1650482839, 'AB01' => 3, 'SK01_01' => 4, 'SK01_01' => 5]
]
===== Example: Filters =====
The following PHP-Code provides all responses of the present participant which were given at least one day ago and which used the questionnaire "main".
$data = panelRecords(
['CASE', 'STARTED'],
[
'STARTED.max' => strtotime('-1 day'),
'QUESTNNR' => 'main'
]
);
The following code retrieves all responses of the present participant begun after the date of 01.01.2022.
$data = panelRecords(
['CASE', 'STARTED', 'AB01', 'AB02', 'BB01'],
['STARTED.min' => '2022-01-01']
);