Class containing the Netherlands specific model extensions.

Extend your project specific RespondentModel from this model to make it go Dutch.

package Gems
subpackage Model
copyright Copyright (c) 2012 Erasmus MC
license New BSD License
since Class available since version 1.6
inherited_from \Gems_Model_RespondentModel

 Methods

Copy from \Zend_Translate_Adapter

_(string $text, string|\Zend_Locale $locale = null) : string
Inherited

Translates the given string returns the translation

Parameters

$text

string

Translation string

$locale

string\Zend_Locale

(optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

Create a model that joins two or more tables

__construct(string $name, string $startTable, string $fieldPrefix = null, mixed $saveable = null
Inherited

Parameters

$name

string

A name for the model

$startTable

string

The base table for the model

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Add a table to the model with a left join

addLeftTable(mixed $table, array $joinFields, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table

mixed

The name of the table to join or a table object or an array(corr_name => tablename) or array(int => tablename, corr_name)

$joinFields

array

Array of source->dest primary keys for this join

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Add the table and field to check for respondent login checks

addLoginCheck() : \Gems_Model_RespondentModel
Inherited

Returns

\Gems_Model_RespondentModel(continuation pattern)

Add the respondent name as a caclulated field to the model

addNameToModel(\Gems_Model_JoinModel $model, string $label) 
InheritedStatic

Parameters

$model

\Gems_Model_JoinModel

$label

string

Add a table to the model with a right join

addRightTable(mixed $table, array $joinFields, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table

mixed

The name of the table to join or a table object or an array(corr_name => tablename) or array(int => tablename, corr_name)

$joinFields

array

Array of source->dest primary keys for this join

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Add a table to the model with an inner join

addTable(mixed $table, array $joinFields, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table

mixed

The name of the table to join or a table object or an array(corr_name => tablename) or array(int => tablename, corr_name)

$joinFields

array

Array of source->dest primary keys for this join

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Called after the check that all required registry values have been set correctly has run.

afterRegistry() : void
Inherited

This function is no needed if the classes are setup correctly

Set those settings needed for the browse display

applyBrowseSettings() : \Gems_Model_RespondentModel
Inherited

Returns

\Gems_Model_RespondentModel

Set those settings needed for the detailed display

applyDetailSettings() : \Gems_Model_RespondentNlModel
inherited_from \Gems_Model_RespondentModel::applyDetailSettings()

Returns

\Gems_Model_RespondentNlModel

Set those settings needed for the detailed display

applyDetailSettings() : \Gems_Model_RespondentModel
Inherited

Returns

\Gems_Model_RespondentModel

Set those values needed for editing

applyEditSettings(boolean $create = false) : \Gems_Model_RespondentModel
inherited_from \Gems_Model_RespondentModel::applyEditSettings()

Parameters

$create

boolean

True when creating

Returns

\Gems_Model_RespondentModel

Set those values needed for editing

applyEditSettings(boolean $create = false) : \Gems_Model_RespondentModel
Inherited

Parameters

$create

boolean

True when creating

Returns

\Gems_Model_RespondentModel

Apply hash function for array_walk_recursive in _checkFilterUsed()

applyHash(string $filterValue, string $filterKey) 
Inherited
see

Parameters

$filterValue

string

$filterKey

string

Stores the fields that can be used for sorting or filtering in the sort / filter objects attached to this model.

applyParameters(array $parameters, boolean $includeNumericFilters = false) : array
Inherited

Parameters

$parameters

array

$includeNumericFilters

boolean

When true numeric filter keys (0, 1, 2...) are added to the filter as well

Returns

arrayThe $parameters minus the sort & textsearch keys

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

booleanFalse if required are missing.

copyKeys()

copyKeys($reset = false
Inherited

Parameters

$reset

Count the number of tracks the respondent has for this organization

countTracks(string $patientId, integer $organizationId, integer $respondentId = null, boolean $active = false) : boolean
Inherited

Parameters

$patientId

string

Can be empty if $respondentId is passed

$organizationId

integer

When null looks at all organizations

$respondentId

integer

Pass when at hand, is looked up otherwise

$active

boolean

When true only tracks with a success code are returned

Returns

boolean

The current organization id of the current user

getCurrentOrganization() : integer
Inherited

Returns

integer

Return an identifier the item specified by $forData

getKeyRef(mixed $forData, array $href = array(), $organizationInKey = null) : array
Inherited

basically transforms the fieldnames ointo oan IDn => value array

Parameters

$forData

mixed

Array value to vilter on

$href

array

Or \ArrayObject

$organizationInKey

Returns

arrayThat can by used as href

Get the current reception code for a respondent

getReceptionCode(string $patientId, integer $organizationId, integer $respondentId = null) : string
Inherited

Parameters

$patientId

string

Can be empty if $respondentId is passed

$organizationId

integer

$respondentId

integer

Pass when at hand, is looked up otherwise

Returns

stringThe current reception code

Create a database model for retrieving the respondent tracks

getRespondentTracksModel() : \Gems_Model_JoinModel
Inherited

Returns

\Gems_Model_JoinModelA NEW JoinModel, not a continuation pattern return

Has the respondent tracks

hasTracks(string $patientId, integer $organizationId, integer $respondentId = null, boolean $active = false) : boolean
Inherited

Parameters

$patientId

string

Can be empty if $respondentId is passed

$organizationId

integer

When null looks at all organizations

$respondentId

integer

Pass when at hand, is looked up otherwise

$active

boolean

When true we look only for tracks with a success code

Returns

boolean

Return a hashed version of the input value.

hideSSN(mixed $value, boolean $isNew = false, string $name = null, array $context = array(), $isPost = false) : string
Inherited

Parameters

$value

mixed

The value being saved

$isNew

boolean

True when a new item is being saved

$name

string

The name of the current field

$context

array

Optional, the other values being saved

$isPost

Returns

stringThe output to display

True when the default filter can contain multiple organizations

isMultiOrganization() : boolean
Inherited

Returns

boolean

Copy from \Zend_Translate_Adapter

plural(string $singular, string $plural, integer $number, string|\Zend_Locale $locale = null) : string
Inherited

Translates the given string using plural notations Returns the translated string

see

Parameters

$singular

string

Singular translation string

$plural

string

Plural translation string

$number

integer

Number for detecting the correct plural

$locale

string\Zend_Locale

(Optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information

Returns

string

Save a single model item.

save(array $newValues, array $filter = null, array $saveTables = null) : array
Inherited

Parameters

$newValues

array

The values to store for a single model item.

$filter

array

If the filter contains old key values these are used to decide on update versus insert.

$saveTables

Returns

arrayThe values as they are after saving (they may change).

Return a hashed version of the input value.

saveSSN(mixed $value, boolean $isNew = false, string $name = null, array $context = array()) : string
Inherited

Parameters

$value

mixed

The value being saved

$isNew

boolean

True when a new item is being saved

$name

string

The name of the current field

$context

array

Optional, the other values being saved

Returns

stringThe salted hash as a 32-character hexadecimal number.

Set the field values for a dutch social security number

setDutchSsn(\MUtil_Model_ModelAbstract $model, \Zend_Translate_Adapter $translator, string $fieldName = 'grs_ssn'
Static

Parameters

$model

\MUtil_Model_ModelAbstract

$translator

\Zend_Translate_Adapter

$fieldName

string

Set the field values for a dutch zipcode

setDutchZipcode(\MUtil_Model_ModelAbstract $model, \Zend_Translate_Adapter $translator, string $fieldName = 'grs_zipcode'
Static

Parameters

$model

\MUtil_Model_ModelAbstract

$translator

\Zend_Translate_Adapter

$fieldName

string

Set the reception code for a respondent and cascade non-success codes to the tracks / surveys.

setReceptionCode(string $patientId, integer $organizationId, string $newCode, integer $respondentId = null, string $oldCode = null) : \Gems_Util_ReceptionCode
Inherited

Parameters

$patientId

string

Can be empty if $respondentId is passed

$organizationId

integer

$newCode

string

String or \Gems_Util_ReceptionCode

$respondentId

integer

Pass when at hand, is looked up otherwise

$oldCode

string

Pass when at hand as tring or \Gems_Util_ReceptionCode, is looked up otherwise

Returns

\Gems_Util_ReceptionCodeThe new code reception code object for further processing

setTableSaveable()

setTableSaveable(string $table_name, string $fieldPrefix = null, mixed $saveable = null) : \Gems_Model_JoinModel
Inherited

Parameters

$table_name

string

Does not test for existence

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

Returns

\Gems_Model_JoinModel

Return a hashed version of the input value.

whenSSN(mixed $value, boolean $isNew = false, string $name = null, array $context = array()) : boolean
Inherited

Parameters

$value

mixed

The value being saved

$isNew

boolean

True when a new item is being saved

$name

string

The name of the current field

$context

array

Optional, the other values being saved

Returns

boolean

Add an organization filter if it wasn't specified in the filter.

_checkFilterUsed(mixed $filter) : array
Inherited

Checks the filter on sematic correctness and replaces the text seacrh filter with the real filter.

Parameters

$filter

mixed

True for the filter stored in this model or a filter array

Returns

arrayThe filter to use

_checkSaveable()

_checkSaveable(mixed $saveable, string $fieldPrefix) : mixed
Inherited

Parameters

$saveable

mixed

Will changes to this table be saved, true or a combination of SAVE_MODE constants

$fieldPrefix

string

Prefix to use for change fields (date/userid), if $saveable empty sets it to true

Returns

mixedThe saveable setting to use

Return a list of those who could be on the created_by, changed_by or opened_by fields

getChangersList() : array
Inherited

Returns

arrayid => name

Returns a translate adaptor

getTranslateAdapter() : \Zend_Translate_Adapter
Inherited

Returns

\Zend_Translate_Adapter

Function that checks the setup of this class/traight

initTranslateable() 
Inherited

This function is not needed if the variables have been defined correctly in the source for this object and theose variables have been applied.

return @void

 Properties

 

Determines the algorithm used to hash the social security number

$hashAlgorithm : integer

Default

'sha512'

Can be changed is derived classes, set to null to use old md5() method

 

Determines how the social security number is stored.

$hashSsn : integer

Default

self::SSN_HASH

Can be changed is derived classes.

 

$view

$view : \Zend_View

Default

 

$currentUser

$currentUser : \Gems_User_User

Default

 

$db

$db : \Zend_Db_Adapter_Abstract

Default

 

$loader

$loader : \Gems_Loader

Default

 

Should the logincheck be added automatically

$loginCheck : boolean

Default

false
 

$project

$project : \Gems_Project_ProjectSettings

Default

 

$translate

$translate : \Zend_Translate

Default

 

$translateAdapter

$translateAdapter : \Zend_Translate_Adapter

Default

 

$util

$util : \Gems_Util

Default

 Constants

 

Store the SSN hashed in the database and display only '*****'

SSN_HASH = 1 
 

Do not use the SSN

SSN_HIDE = 2 
 

Store the SSN as is and display the value.

SSN_OPEN = 4