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
stringTranslation 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)
\typeA container acting as source for \MUtil_Registry_Source
arrayThe directories where to look for requested classes
__construct(mixed $container, array $dirs)
mixedA container acting as source for \MUtil_Registry_Source
arrayThe directories where to look for requested classes
__get($name)
addPrefixPath(string $prefix, $path, boolean $prepend = true) : \Gems_Loader_LoaderAbstract
string
booleanPut 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
stringName of resource to set
mixedThe resource.
booleanTrue if $resource was OKcheckRegistryRequestsAnswers() : boolean
booleanFalse if required values are missing.createAgendaClass(string $className, mixed $param1= null, mixed $param2= null) : object
string
mixed
mixed
objectcreateAppointmentSelect(string|array $fields = '*') : \Gems\Agenda\AppointmentSelect
stringarrayThe appointment fields to select
\Gems\Agenda\AppointmentSelectgetActiveAppointments(integer $respondentId, integer $organizationId, string $patientNr= null, string $where= null) : integer: array
integerWhen null $patientNr is required
integer
stringOptional for when $respondentId is null
stringOptional extra where statement
integerThe 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 userarrayappointmentId => appointment descriptiongetActivities(integer $organizationId = null) : array
integerOptional
arrayactivity_id => namegetAppointment(mixed $appointmentData) : \Gems_Agenda_Appointment
mixedAppointment id or array containing appintment data
\Gems_Agenda_AppointmentgetAppointmentDisplay(array $row) : string
getAppointments(integer $respondentId, integer $organizationId, string $patientNr= null, string $where= null) : array
integerWhen null $patientNr is required
integer
stringOptional for when $respondentId is null
stringOptional extra where statement
arrayappointmentId => appointment descriptiongetFieldLabels() : array
arrayfieldname => labelgetFilter($filterId) : \Gems\Agenda\AppointmentFilterInterface
Id of a single filter
\Gems\Agenda\AppointmentFilterInterfaceor nullgetFilterList() : array
arrayfilter_id => labelgetFilters($sql) : array
SQL statement
arrayof AppointmentFilterInterface objectsgetHealthcareStaff(integer $organizationId = null) : array
integerOptional
arrayactivity_id => namegetLocations(integer $orgId = null) : array
integerOptional to slect for single organization
arraygetProcedures(integer $organizationId = null) : array
integerOptional
arrayactivity_id => namegetRegistryRequests() : array
Returns those object variables defined by the subclass but not at the level of this definition.
Can be overruled.
arrayof string namesgetStatusCodes() : array
arraycode => labelgetStatusCodesActive() : array
arraycode => labelgetStatusCodesInactive() : array
arraycode => labelgetStatusKeysActive() : array
arraynr => codegetStatusKeysActiveDbQuoted() : \Zend_Db_Expr
\Zend_Db_ExprgetStatusKeysInactive() : array
arraynr => codegetStatusKeysInactiveDbQuoted() : \Zend_Db_Expr
\Zend_Db_ExprgetTypeCodes() : array
arraycode => labelisStatusActive(string $code) : boolean
string
booleanmatchActivity(string $name, integer $organizationId, boolean $create = true) : integer
stringThe name to match against
integerOrganization id
booleanCreate a match when it does not exist
integeror nullmatchFilters(\Gems_Agenda_Appointment $appointment) : array
\Gems_Agenda_Appointment
arrayof AppointmentFilterInterfacematchHealthcareStaff(string $name, integer $organizationId, boolean $create = true) : integer
stringThe name to match against
integerOrganization id
booleanCreate a match when it does not exist
integergas_id_staff staff idmatchLocation(string $name, integer $organizationId, boolean $create = true) : array
stringThe name to match against
integerOrganization id
booleanCreate a match when it does not exist
arraylocationmatchProcedure(string $name, integer $organizationId, boolean $create = true) : integer
stringThe name to match against
integerOrganization id
booleanCreate a match when it does not exist
integeror nullnewFilterModel() : \Gems\Agenda\AppointmentFilterModel
\Gems\Agenda\AppointmentFilterModelnewFilterObject(string $className) : object
stringThe part after *_AgendaFilter
objectplural(string $singular, string $plural, integer $number, string|\Zend_Locale $locale = null) : string
Translates the given string using plural notations Returns the translated string
| see |
|---|
stringSingular translation string
stringPlural translation string
integerNumber 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
arrayprefix => path
stringThe sub directories to cascade to
booleanAllows full class name specification instead of just plugin name part
arrayprefix => path_getAppointmentSelect() : \Zend_Db_Select
Allows for overruling on project level
\Zend_Db_Select_getClass(string $name, string $className= null, array $arguments= array()) : mixed
stringThe $name of the variable to store this object in.
stringClass name or null if the same as $name, prepending $this->_dirs.
arrayClass initialization arguments.
mixedInstance of $className_loadClass(string $name, boolean $create= false, array $arguments= array()) : mixed
filterRequestNames(string $name) : boolean
Can be overriden.
string
booleangetFieldData() : array
arrayfieldname => 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
arrayof 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()