TargetLoaderAbstract is used for classes that chain from \Gems_Loader but are also a target themselves.
As these classes may need setting of values this subclass implements the checkRegistryRequestsAnswers() easy access to resources.
package | Gems |
---|---|
subpackage | Agenda |
copyright | Copyright (c) 2013 Erasmus MC |
license | New BSD License |
since | Class available since version 1.6.2 |
inherited_from | \Gems_Loader_TargetLoaderAbstract |
_(string $text, string|\Zend_Locale $locale = null
) : string
Translates the given string returns the translation
string
Translation string
string
\Zend_Locale
(optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information
string
__construct(\type $container, array $dirs)
\type
A container acting as source for \MUtil_Registry_Source
array
The directories where to look for requested classes
__construct(mixed $container, array $dirs)
mixed
A container acting as source for \MUtil_Registry_Source
array
The directories where to look for requested classes
__get($name)
addPrefixPath(string $prefix, $path, boolean $prepend = true
) : \Gems_Loader_LoaderAbstract
string
boolean
Put path at the beginning of the stack (has no effect when prefix / dir already set)
\Gems_Loader_LoaderAbstract
(continuation pattern)afterRegistry() : void
This function is no needed if the classes are setup correctly
inherited_from | \Gems_Loader_TargetLoaderAbstract::afterRegistry() |
---|
afterRegistry() : void
answerRegistryRequest(string $name, mixed $resource) : boolean
string
Name of resource to set
mixed
The resource.
boolean
True if $resource was OKcheckRegistryRequestsAnswers() : boolean
boolean
False if required values are missing.createAgendaClass(string $className, mixed $param1= null
, mixed $param2= null
) : object
string
mixed
mixed
object
createAppointmentSelect(string|array $fields = '*'
) : \Gems\Agenda\AppointmentSelect
string
array
The appointment fields to select
\Gems\Agenda\AppointmentSelect
getActiveAppointments(integer $respondentId, integer $organizationId, string $patientNr= null
, string $where= null
) : integer: array
integer
When null $patientNr is required
integer
string
Optional for when $respondentId is null
string
Optional extra where statement
integer
The first found appointment id or false
/
public function findFirstAppointmentId($filterId, \Gems_Tracker_RespondentTrack $respTrack,
$from = null, $oper = '>=', $uniqueness = 0)
{
$filter = $this->getFilter($filterId);
if (! $filter) {
return false;
}
$respondentId = $respTrack->getRespondentId();
$orgId = $respTrack->getOrganizationId();
$select = $this->db->select();
$select->from('gems__appointments', 'gap_id_appointment')
->where('gap_id_user = ?', $respondentId)
->where('gap_id_organization = ?', $orgId)
->where('gap_status IN (?)', $this->getStatusKeysActiveDbQuoted())
->where($filter->getSqlWhere())
->limit(1);
if ($from) {
if ($from instanceof \Gems_Agenda_Appointment) {
$from = $from->getAdmissionTime();
}
if ($from instanceof \Zend_Date) {
$from = $from->toString('yyyy-MM-dd HH:mm:ss');
}
$select->where("gap_admission_time $oper ?", $from);
}
if ('<' === $oper[0]) {
$select->order('gap_admission_time DESC');
} else {
$select->order('gap_admission_time ASC');
}
if ($uniqueness) {
$fieldId = intval($filter->getAppointmentFieldId());
$respTrackId = intval($respTrack->getRespondentTrackId());
switch ($uniqueness) {
case 1:
$select->where(
"gap_id_appointment NOT IN
(SELECT gr2t2a_id_appointment FROM gems__respondent2track2appointment
WHERE gr2t2a_id_appointment IS NOT NULL AND
gr2t2a_id_respondent_track = $respTrackId AND
gr2t2a_id_app_field != $fieldId)"
);
break;
case 2:
$trackId = $respTrack->getTrackId();
$select->where(
"gap_id_appointment NOT IN
(SELECT gr2t2a_id_appointment FROM gems__respondent2track2appointment
INNER JOIN gems__respondent2track
ON gr2t2a_id_respondent_track = gr2t_id_respondent_track
WHERE gr2t2a_id_appointment IS NOT NULL AND
gr2t_id_track = $trackId AND
NOT (gr2t2a_id_respondent_track = $respTrackId AND
gr2t2a_id_app_field = $fieldId))"
);
break;
// case 3:
// $select->where(
// "gap_id_appointment NOT IN
// (SELECT gr2t2a_id_appointment FROM gems__respondent2track2appointment
// WHERE gr2t2a_id_appointment IS NOT NULL AND
// NOT (gr2t2a_id_respondent_track = $respTrackId AND
// gr2t2a_id_app_field = $fieldId))"
// );
// break;
// default:
}
}
// \MUtil_Echo::track($select->__toString(), $uniqueness, $filter->getSqlWhere());
return $this->db->fetchOne($select);
}
Get all active respondents for this userarray
appointmentId => appointment descriptiongetActivities(integer $organizationId = null
) : array
integer
Optional
array
activity_id => namegetAppointment(mixed $appointmentData) : \Gems_Agenda_Appointment
mixed
Appointment id or array containing appintment data
\Gems_Agenda_Appointment
getAppointmentDisplay(array $row) : string
getAppointments(integer $respondentId, integer $organizationId, string $patientNr= null
, string $where= null
) : array
integer
When null $patientNr is required
integer
string
Optional for when $respondentId is null
string
Optional extra where statement
array
appointmentId => appointment descriptiongetFieldLabels() : array
array
fieldname => labelgetFilter($filterId) : \Gems\Agenda\AppointmentFilterInterface
Id of a single filter
\Gems\Agenda\AppointmentFilterInterface
or nullgetFilterList() : array
array
filter_id => labelgetFilters($sql) : array
SQL statement
array
of AppointmentFilterInterface objectsgetHealthcareStaff(integer $organizationId = null
) : array
integer
Optional
array
activity_id => namegetLocations(integer $orgId = null
) : array
integer
Optional to slect for single organization
array
getProcedures(integer $organizationId = null
) : array
integer
Optional
array
activity_id => namegetRegistryRequests() : array
Returns those object variables defined by the subclass but not at the level of this definition.
Can be overruled.
array
of string namesgetStatusCodes() : array
array
code => labelgetStatusCodesActive() : array
array
code => labelgetStatusCodesInactive() : array
array
code => labelgetStatusKeysActive() : array
array
nr => codegetStatusKeysActiveDbQuoted() : \Zend_Db_Expr
\Zend_Db_Expr
getStatusKeysInactive() : array
array
nr => codegetStatusKeysInactiveDbQuoted() : \Zend_Db_Expr
\Zend_Db_Expr
getTypeCodes() : array
array
code => labelisStatusActive(string $code) : boolean
string
boolean
matchActivity(string $name, integer $organizationId, boolean $create = true
) : integer
string
The name to match against
integer
Organization id
boolean
Create a match when it does not exist
integer
or nullmatchFilters(\Gems_Agenda_Appointment $appointment) : array
\Gems_Agenda_Appointment
array
of AppointmentFilterInterfacematchHealthcareStaff(string $name, integer $organizationId, boolean $create = true
) : integer
string
The name to match against
integer
Organization id
boolean
Create a match when it does not exist
integer
gas_id_staff staff idmatchLocation(string $name, integer $organizationId, boolean $create = true
) : array
string
The name to match against
integer
Organization id
boolean
Create a match when it does not exist
array
locationmatchProcedure(string $name, integer $organizationId, boolean $create = true
) : integer
string
The name to match against
integer
Organization id
boolean
Create a match when it does not exist
integer
or nullnewFilterModel() : \Gems\Agenda\AppointmentFilterModel
\Gems\Agenda\AppointmentFilterModel
newFilterObject(string $className) : object
string
The part after *_AgendaFilter
object
plural(string $singular, string $plural, integer $number, string|\Zend_Locale $locale = null
) : string
Translates the given string using plural notations Returns the translated string
see |
---|
string
Singular translation string
string
Plural translation string
integer
Number for detecting the correct plural
string
\Zend_Locale
(Optional) Locale/Language to use, identical with locale identifier, @see \Zend_Locale for more information
string
_cascadedDirs(array $dirs, string $cascade, boolean $fullClassnameFallback = true
) : array
array
prefix => path
string
The sub directories to cascade to
boolean
Allows full class name specification instead of just plugin name part
array
prefix => path_getAppointmentSelect() : \Zend_Db_Select
Allows for overruling on project level
\Zend_Db_Select
_getClass(string $name, string $className= null
, array $arguments= array()
) : mixed
string
The $name of the variable to store this object in.
string
Class name or null if the same as $name, prepending $this->_dirs.
array
Class initialization arguments.
mixed
Instance of $className_loadClass(string $name, boolean $create= false
, array $arguments= array()
) : mixed
filterRequestNames(string $name) : boolean
Can be overriden.
string
boolean
getFieldData() : array
array
fieldname => array(label[, tableName, tableId, tableLikeFilter))initTranslateable()
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
loadDefaultFilters() : array
array
of AppointmentFilterInterface$appointmentDisplayFormat : string
'dd-MM-yyyy HH:mm'
$_dirs : array
The standard value is
But an alternative could be:
$_loader : \MUtil_Loader_PluginLoader
$cache : \Zend_Cache_Core
$cascade : string
'Agenda'
$cascade : string
null
$db : \Zend_Db_Adapter_Abstract
$loader : \Gems_Loader
$translate : \Zend_Translate
$translateAdapter : \Zend_Translate_Adapter
$_appointments : array
array()
$_filters : array
array()