package |
Gems |
subpackage |
Model_Translator |
copyright |
Copyright (c) 2014 Erasmus MC |
license |
New BSD License |
since |
Class available since version 1.6.3 24-apr-2014 14:46:04 |
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract |
Methods
Add the current row to a (possibly separate) batch that does the importing.
addSaveTask(\MUtil_Task_TaskBatch $importBatch, string $key, array $row) : \MUtil_Model_ModelTranslatorAbstract
Inherited
Parameters
$importBatch
\MUtil_Task_TaskBatch
The import batch to impor this row into
$key
string
The current iterator key
$row
array
translated and validated row
Returns
\MUtil_Model_ModelTranslatorAbstract
(continuation pattern)
Called after the check that all required registry values
have been set correctly has run.
afterRegistry() : void
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract::afterRegistry() |
Called after the check that all required registry values
have been set correctly has run.
afterRegistry() : void
Inherited
Should be called after answering the request to allow the Target
to check if all required registry values have been set correctly.
checkRegistryRequestsAnswers() : boolean
Inherited
Returns
boolean
False if required values are missing.
Get information on the field translations
getFieldsTranslations() : array
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract::getFieldsTranslations() |
Exceptions
\MUtil_Model_ModelException |
|
Returns
array
of fields sourceName => targetName
Get information on the field translations
getFieldsTranslations() : array
Inherited
Exceptions
\MUtil_Model_ModelException |
|
Returns
array
of fields sourceName => targetName
Get the treatment when no token exists
getNoToken() : string
Inherited
Returns
string
One of the TOKEN_ constants.
Get the error message for when no token exists
getNoTokenError(array $row, $key) : string
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract::getNoTokenError() |
Parameters
$row
$key
Returns
string
Get the error message for when no token exists
getNoTokenError(array $row, $key) : string
Inherited
Parameters
$row
$key
Returns
string
Get the id of the survey to import to
getSurveyId() : integer
Inherited
Get the treatment for completed tokens
getTokenCompleted() : string
Inherited
Returns
string
One of the TOKEN_ constants.
Get the id of the track to import to or null
getTrackId() : integer
Inherited
Get the treatment when no token exists
setNoToken(string $noToken) : \Gems_Model_Translator_AnswerTranslatorAbstract
Inherited
Parameters
$noToken
string
One of the TOKEN_ constants, but not TOKEN_OVERWRITE.
Returns
\Gems_Model_Translator_AnswerTranslatorAbstract
(continuation pattern)
Get the treatment when no token exists
setSkipUnknownPatients(boolean $skip = false
) : \Gems_Model_Translator_AnswerTranslatorAbstract
Inherited
Parameters
$skip
boolean
Returns
\Gems_Model_Translator_AnswerTranslatorAbstract
(continuation pattern)
Set the id of the survey to import to
setSurveyId(integer $surveyId) : \Gems_Model_Translator_AnswerTranslatorAbstract
Inherited
Parameters
$surveyId
integer
Returns
\Gems_Model_Translator_AnswerTranslatorAbstract
(continuation pattern)
Set the treatment for answered or double tokens
setTokenCompleted(string $tokenCompleted) : \Gems_Model_Translator_AnswerTranslatorAbstract
Inherited
Parameters
$tokenCompleted
string
One f the TOKEN_ constants.
Returns
\Gems_Model_Translator_AnswerTranslatorAbstract
(continuation pattern)
Set the id of the track to import to or null
setTrackId(integer $trackId) : \Gems_Model_Translator_AnswerTranslatorAbstract
Inherited
Parameters
$trackId
integer
Returns
\Gems_Model_Translator_AnswerTranslatorAbstract
(continuation pattern)
Perform any translations necessary for the code to work
translateRowValues(mixed $row, scalar $key) : mixed
Inherited
Parameters
$row
mixed
array or \Traversable row
$key
scalar
Returns
mixed
Row array or false when errors occurred
Validate the data against the target form
validateRowValues(array $row, scalar $key) : mixed
Inherited
Parameters
$row
array
$key
scalar
Returns
mixed
Row array or false when errors occurred
Check should a patient be imported
checkPatient(string $patientNr, integer $orgId) : boolean
Inherited
Parameters
$patientNr
string
$orgId
integer
Returns
boolean
If the token can be created find the respondent track for the token
findRespondentTrackFor(array $row) : integer | null
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract::findRespondentTrackFor() |
Parameters
$row
array
Returns
integer
null
If the token can be created find the respondent track for the token
findRespondentTrackFor(array $row) : integer | null
Inherited
Parameters
$row
array
Returns
integer
null
Find the token id using the passed row data and
the other translator parameters.
findTokenFor(array $row) : string | null
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract::findTokenFor() |
Parameters
$row
array
Returns
string
null
Find the token id using the passed row data and
the other translator parameters.
findTokenFor(array $row) : string | null
Inherited
Parameters
$row
array
Returns
string
null
Properties
One of the TOKEN_ constants telling what to do when no token exists
$_noToken : string
Default
self::TOKEN_ERROR
$_skipUnknownPatients
$_skipUnknownPatients : boolean
The Gems id of the survey to import to
$_surveyId : integer
One of the TOKEN_ constants telling what to do when the token is completed
$_tokenCompleted : string
Default
self::TOKEN_ERROR
The id of the track to import to or null
$_trackId : integer
$db
$db : \Zend_Db_Adapter_Abstract
$loader
$loader : \Gems_Loader
inherited_from |
\Gems_Model_Translator_AnswerTranslatorAbstract::loader |
$loader
$loader : \Gems_Loader
The name of the field to (temporarily) store the organization id in
$orgIdField : string
Default
'organization_id'
Extra values the origanization id field accepts
$orgTranslations : array
The name of the field to (temporarily) store the patient nr in
$patientNrField : string
The task used for import
$saveTask : string
Default
'Import_SaveAnswerTask'
$tokenLibrary
$tokenLibrary : \Gems_Tracker_Token_TokenLibrary
Constants
Constant for creating an extra token when a token was already filled in.
TOKEN_DOUBLE = 'double'
Constant for generating an error when a token does not exist or is already filled in.
TOKEN_ERROR = 'error'
Constant for creating a new token, while disabling the existing token
TOKEN_OVERWRITE = 'overwrite'
Constant for creating a new token, while disabling the existing token
TOKEN_SKIP = 'skip'