This interface lists all API-level methods in the Tracker class.

This interface only exists to prevent the \Gems_Loader_TargetLoaderAbstract functions of being accessible when working with a tracker. Do not create a second implementation is this interface but always create a subclass of the \Gems_Tracker class.

The tracker is the central access point doing anything with tracks or tokens.

Tracker contains a number of getXxx functions to create Token, Survey, RespondentTrack, [Survey]SourceInterface and TrackEngine objects.

Tracker also offers \MUtil_Model_ModelAbstract children for RespondentTracks, Surveys, Tokens and Tracks.

Other object classes accessible through gems_Tracker are TokenLibrary (defines how tokens are created and checked), TokenSelect (\Gems_Tracker_Token_TokenSelect extension) and TokenValidator.

Other functions are general utility functions, e.g. checkTrackRounds(), createToken(), processCompletedTokens() and recalculateTokens().

package Gems
subpackage Tracker
copyright Copyright (c) 2011 Erasmus MC
license New BSD License
since Class available since version 1.4

 Methods

Checks tracks for changes to the the track and round definitions and corrects them.

checkTrackRounds(string $batchId, integer $userId = null, string $cond = null) : \Gems_Task_TaskRunnerBatch

Does recalculate changed tracks

Parameters

$batchId

string

A unique identifier for the current batch

$userId

integer

Id of the user who takes the action (for logging)

$cond

string

Optional where statement for selecting tracks

Returns

\Gems_Task_TaskRunnerBatchA batch to process the changes

Create a new track for a patient

createRespondentTrack(integer $respondentId, integer $organizationId, integer $trackId, integer $userId, mixed $respTrackData = null, array $trackFieldsData = array()) : \Gems_Tracker_RespondentTrack

Parameters

$respondentId

integer

The real patientId (grs_id_user), not the patientnr (gr2o_patient_nr)

$organizationId

integer

$trackId

integer

$userId

integer

Id of the user who takes the action (for logging)

$respTrackData

mixed

Optional array containing field values or the start date.

$trackFieldsData

array

Returns

\Gems_Tracker_RespondentTrackThe newly created track

Dynamically load and create a [Gems|Project]_Tracker class

createTrackClass(string $className, mixed $param1 = null, mixed $param2 = null) : object

Parameters

$className

string

$param1

mixed

$param2

mixed

Returns

object

Utility function for detecting unchanged values.

filterChangesOnly(array $oldValues, array $newValues) : array

Parameters

$oldValues

array

$newValues

array

Returns

array

Removes all unacceptable characters from the input token and inserts any fixed characters left out

filterToken(string $tokenId) : string

Parameters

$tokenId

string

Returns

stringReformatted token

Returns an array of all field id's for all tracks that have a code id

getAllCodeFields() : array

Returns

arrayid => code

Get an appointment object

getAppointment(mixed $appointmentData) : \Gems_Agenda_Appointment

Parameters

$appointmentData

mixed

Appointment id or array containing appintment data

Returns

\Gems_Agenda_Appointment

Returns a form to ask for a token

getAskTokenForm(mixed $args_array = null) : \Gems_Tracker_Form_AskTokenForm

Parameters

$args_array

mixed

\MUtil_Ra::args array for Form initiation.

Returns

\Gems_Tracker_Form_AskTokenForm

getRespondentTrack()

getRespondentTrack(mixed $respTrackData) : \Gems_Tracker_RespondentTrack

Parameters

$respTrackData

mixed

Track id or array containing trackdata

Returns

\Gems_Tracker_RespondentTrack

Load project specific model or general Gems model otherwise

getRespondentTrackModel() : \Gems_Tracker_Model_RespondentTrackModel

Returns

\Gems_Tracker_Model_RespondentTrackModel

Get all tracks for a respondent

getRespondentTracks(integer $respondentId, integer $organizationId, mixed $order = array('gr2t_start_date')) : array

Specify the optional $order to sort other than on start date

Parameters

$respondentId

integer

$organizationId

integer

$order

mixed

The column(s) and direction to order by

Returns

arrayof \Gems_Tracker_RespondentTrack

Retrieve a SourceInterface with a given id

getSource(mixed $sourceData) : \Gems_Tracker_Source_SourceInterface

Should only be called by \Gems_Tracker, \Gems_Tracker_Survey or \Gems_Tracker_Token (or should this one use \Gems_Tracker_Survey instead?)

Parameters

$sourceData

mixed

Gems source id or array containing gems source data

Returns

\Gems_Tracker_Source_SourceInterface

Returns all registered source classes

getSourceClasses() : array

Returns

arrayOf classname => description

Returns all registered database source classes

getSourceDatabaseClasses() : array

Returns

arrayOf classname => description

getSurvey()

getSurvey(mixed $surveyData) : \Gems_Tracker_Survey

Parameters

$surveyData

mixed

Gems survey id or array containing gems survey data

Returns

\Gems_Tracker_Survey

getSurveyBySourceId()

getSurveyBySourceId(mixed $sourceSurveyId, integer $sourceId) : \Gems_Tracker_Survey

Parameters

$sourceSurveyId

mixed

The source survey id

$sourceId

integer

The gems source id of the source

Returns

\Gems_Tracker_Survey

getSurveyModel()

getSurveyModel(\Gems_Tracker_Survey $survey, \Gems_Tracker_Source_SourceInterface $source) : \Gems_Tracker_SurveyModel

Parameters

$survey

\Gems_Tracker_Survey

$source

\Gems_Tracker_Source_SourceInterface

Returns

\Gems_Tracker_SurveyModel

getToken()

getToken(mixed $tokenData) : \Gems_Tracker_Token

Parameters

$tokenData

mixed

Token id or array containing tokendata

Returns

\Gems_Tracker_Token

getTokenFilter()

getTokenFilter() : \Gems_Tracker_Token_TokenFilter

Returns

\Gems_Tracker_Token_TokenFilter

Use this function only within \Gems_Tracker!!

getTokenLibrary() : \Gems_Tracker_Token_TokenLibrary

Returns

\Gems_Tracker_Token_TokenLibrary

Returns a token model of the specified class with full display information

getTokenModel(string $modelClass = 'StandardTokenModel') : \Gems_Tracker_Model_StandardTokenModel

Parameters

$modelClass

string

Optional class to use instead of StandardTokenModel. Must be subclass.

Returns

\Gems_Tracker_Model_StandardTokenModel

Create a select statement on the token table

getTokenSelect($fields = '*') : \Gems_Tracker_Token_TokenSelect

Parameters

$fields

Returns

\Gems_Tracker_Token_TokenSelect

getTokenValidator()

getTokenValidator() : \Gems_Tracker_Token_TokenValidator

Returns

\Gems_Tracker_Token_TokenValidator

Get the allowed display groups for tracks in this project.

getTrackDisplayGroups() : array

Returns

array

getTrackEngine()

getTrackEngine(mixed $trackData) : \Gems_Tracker_Engine_TrackEngineInterface

Parameters

$trackData

mixed

Gems track id or array containing gems track data

Returns

\Gems_Tracker_Engine_TrackEngineInterface

Returns dummy objects for all registered track engines class names

getTrackEngineClasses() : array
Static

Instead of creating another object layer all classes defined by getTrackEngineClassNames() are loaded with dummy data so that the TrackEngineInterface functions containing general class information can be used.

see
static $dummyClasses Cache array

Returns

arrayOf \Gems_Tracker_Engine_TrackEngineInterface

Return the edit snippets for editing or creating a new track

getTrackEngineEditSnippets() : array

Returns

arrayof snippet names for creating a new track engine

Returns all registered track engines classes for use in drop down lists.

getTrackEngineList(boolean $extended = false, boolean $userCreatableOnly = false) : array

Parameters

$extended

boolean

When true return a longer name.

$userCreatableOnly

boolean

Return only the classes that can be created by the user interface

Returns

arrayOf classname => description

Simple function for a default track model.

getTrackModel() : \Gems_Tracker_Model_TrackModel

Returns

\Gems_Tracker_Model_TrackModel

Checks the token table to see if there are any answered surveys to be processed

processCompletedTokens(integer $respondentId, integer $userId = null, integer $orgId = null, boolean $quickCheck = false) : boolean

If the survey was started (and the token was forwarded to limesurvey) we need to check if is was completed. If so, we might want to check the track the survey is in to enable or disable future rounds

Does not reflect changes to tracks or rounds.

Parameters

$respondentId

integer

Id of the respondent to check for or NULL

$userId

integer

Id of the user who takes the action (for logging)

$orgId

integer

Optional Id of the organization to check for

$quickCheck

boolean

Check only tokens with recent gto_start_time's

Returns

booleanDid we find new answers?

Recalculates the fields in tracks.

recalcTrackFields(string $batchId, integer $userId = null, string $cond = null) : \Gems_Task_TaskRunnerBatch

Does recalculate changed tracks

Parameters

$batchId

string

A unique identifier for the current batch

$userId

integer

Id of the user who takes the action (for logging)

$cond

string

Optional where statement for selecting tracks

Returns

\Gems_Task_TaskRunnerBatchA batch to process the changes

Recalculates all token dates, timing and results and outputs text messages.

recalculateTokens(string $batch_id, integer $userId = null, string $cond = null) : \Gems_Task_TaskRunnerBatch

Does not reflect changes to tracks or rounds.

Parameters

$batch_id

string

A unique identifier for the current batch

$userId

integer

Id of the user who takes the action (for logging)

$cond

string

Returns

\Gems_Task_TaskRunnerBatchA batch to process the changes

Refreshes the tokens in the source

refreshTokenAttributes(string $batch_id, string $cond = null) : \Gems_Task_TaskRunnerBatch

Parameters

$batch_id

string

A unique identifier for the current batch

$cond

string

An optional where statement

Returns

\Gems_Task_TaskRunnerBatchA batch to process the changes

Remove token from cache for saving memory

removeToken(string|\Gems_Tracker_Token $token) : \Gems_Tracker

Parameters

$token

string\Gems_Tracker_Token

Returns

\Gems_Tracker(continuation pattern)

Recalculates all token dates, timing and results and outputs text messages.

synchronizeSources(integer $sourceId = null, integer $userId = null) : \Gems_Task_TaskRunnerBatch

Does not reflect changes to tracks or rounds.

Parameters

$sourceId

integer

A source identifier

$userId

integer

Id of the user who takes the action (for logging)

Returns

\Gems_Task_TaskRunnerBatchA batch to process the synchronization