PHP Класс WorklistManager

Class WorklistManager
Наследование: extends CComponent
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$AUDIT_TARGET_AUTO
$AUDIT_TARGET_MANUAL

Защищенные свойства (Protected)

Свойство Тип Описание
$DEFAULT_DASHBOARD_FUTURE_DAYS string The interval between now and the future used for determining which Automatic Worklists should be rendered on the dashboard.
$DEFAULT_DASHBOARD_SKIP_DAYS array Array of 3 letter days of the week that should be skipped for picking dates to render worklist dashboards for.
$DEFAULT_DUPLICATE_PATIENTS boolean Whether patients can be added to the same automatic worklist more than once.
$DEFAULT_GENERATION_LIMIT string
$DEFAULT_SHOW_EMPTY boolean Whether worklists with no patient assignments should be displayed or not.
$DEFAULT_WORKLIST_END_TIME string
$DEFAULT_WORKLIST_PAGE_SIZE integer
$DEFAULT_WORKLIST_START_TIME string
$do_audit boolean Flag to turn off auditing.
$errors array Internal store of error messages.
$yii CApplication

Открытые методы

Метод Описание
__construct ( CApplication $yii = null )
addPatientToWorklist ( Patient $patient, Worklist $worklist, DateTime $when = null, array $attributes = [] ) : WorklistPatient | null If the given Patient is successfully added to the given Worklist, returns true. false otherwise.
addWorklistToUserDisplay ( $worklist, $user, null $display_order = null ) : mixed
allowDuplicatePatients ( ) : boolean
canUpdateWorklistDefinition ( WorklistDefinition $definition ) : integer
createWorklistForUser ( Worklist $worklist, null $user = null, boolean $display = true ) : boolean
deleteWorklistDefinitionInstances ( WorklistDefinition $definition ) : boolean
disableAudit ( ) Simple function for use during bulk procesess.
enableAudit ( ) Re-enable after disabling auditing.
generateAllAutomaticWorklists ( DateTime $date_limit = null ) : boolean | integer Iterate through all the worklist definitions and generate the instances up until the given date limit.
generateAutomaticWorklists ( WorklistDefinition $definition, DateTime $date_limit = null ) : boolean Generate worklist instances for the given definition up until the given date limit If false is returned, getErrors should be used to determine the issue.
generateWorklistName ( $definition, DateTime $date ) : string Generates a Worklist instance name from the given definition and date.
getAvailableManualWorklistsForUser ( $user ) : mixed
getCurrentAutomaticWorklistsForUserContext ( $user, Site $site, Firm $firm, DateTime $when ) : array
getCurrentManualWorklistsForUser ( $user ) : array
getDashboardRenderDates ( DateTime $date ) : array Works out the dates we should retrieve Worklists for rendering.
getDefaultEndTime ( ) : string Wrapper for managing default end time for scheduled worklists.
getDefaultStartTime ( ) : string Wrapper for managing default start time for scheduled worklists.
getErrors ( ) : array
getGenerationTimeLimitDate ( ) : DateTime
getPatientsForWorklist ( $worklist ) : CActiveDataProvider
getWorklist ( $id ) : Worklist
getWorklistDefinition ( null $id = null ) : WorklistDefinition | null
getWorklistDefinitions ( ) : WorklistDefinition[]
getWorklistIgnoreDate ( ) : DateTime The time before which we are relaxed about appointments not finding matches.
getWorklistPageSize ( ) : integer
getWorklistPatient ( Worklist $worklist, Patient $patient ) : array | CActiveRecord | mixed | null
hasErrors ( ) : boolean
mapPatientToWorklistDefinition ( Patient $patient, DateTime $when, array $attributes = [] ) : WorklistPatient | null
renderAutomaticDashboard ( CWebUser $user = null ) : array | null Render the automatic dashboard for the given user.
renderManualDashboard ( User | null $user = null ) : array | null
renderWorklistForDashboard ( $worklist ) : mixed
saveWorklistDefinition ( WorklistDefinition $definition ) : boolean
setAttributesForWorklistPatient ( WorklistPatient $worklist_patient, array $attributes = [] ) : boolean
setDateLimitOnRrule ( string $rrule, DateTime $limit ) : string Manipulates the given RRULE string so that it finishes on the given date.
setWorklistDefinitionDisplayOrder ( array $ids = [], null $start = null, null $end = null ) : boolean Set the display order for the worklist definitions The start and end values will support a re-ordering request from a paginated list.
setWorklistDefinitionMappingDisplayOrder ( WorklistDefinition $definition, array $ids = [] ) : boolean
setWorklistDisplayOrderForUser ( $user, array $worklist_ids = [] ) : boolean
shouldDisplayWorklistForContext ( Worklist $worklist, Site $site, Firm $firm )
shouldRenderEmptyWorklist ( ) : boolean
updateWorklistDefinitionMapping ( WorklistDefinitionMapping $mapping, $key, string $values, $display = true ) : boolean Update the mapping specification for an automatic worklist definition.
updateWorklistPatientFromMapping ( WorklistPatient $worklist_patient, DateTime $when, array $attributes = [], boolean $allow_worklist_change = false ) : WorklistPatient | null

Защищенные методы

Метод Описание
addError ( string $message )
addModelErrors ( $errors )
audit ( $target, $action, null $data = null, null $log_message = null, array $properties = [] ) Audit Wrapper.
checkWorklistMappingMatch ( Worklist $wl, $attributes ) : boolean
createAutomaticWorklist ( WorklistDefinition $definition, DateTime $date ) : boolean Create a worklist instance from the given definition for the given date.
getAppParam ( $name ) : array | string | null Wrapper for retrieve app parameters.
getCurrentFirm ( ) : Firm | null
getCurrentSite ( ) : Site | null
getCurrentUser ( ) : mixed Wrapper for retrieving current active User.
getInstanceForClass ( $class, $args = [] ) : mixed Abstraction for getting instance of class.
getModelForClass ( $class ) : mixed Abstraction for getting model instance of class.
getWorklistForMapping ( DateTime $when, array $attributes = [] ) : Worklist | null
renderPartial ( $view, array $parameters = [] ) : mixed Wrapper for partial rendering to encapsulate the call out to the static app for retrieving the controller object.
reset ( ) Internal method to reset state for error tracking.
startTransaction ( ) : CDbTransaction | null Wrapper for starting a transaction.

Описание методов

__construct() публичный Метод

public __construct ( CApplication $yii = null )
$yii CApplication

addError() защищенный Метод

protected addError ( string $message )
$message string

addModelErrors() защищенный Метод

protected addModelErrors ( $errors )
$errors

addPatientToWorklist() публичный Метод

If the given Patient is successfully added to the given Worklist, returns true. false otherwise.
public addPatientToWorklist ( Patient $patient, Worklist $worklist, DateTime $when = null, array $attributes = [] ) : WorklistPatient | null
$patient Patient
$worklist Worklist
$when DateTime
$attributes array
Результат WorklistPatient | null

addWorklistToUserDisplay() публичный Метод

public addWorklistToUserDisplay ( $worklist, $user, null $display_order = null ) : mixed
$worklist
$user
$display_order null
Результат mixed

allowDuplicatePatients() публичный Метод

public allowDuplicatePatients ( ) : boolean
Результат boolean

audit() защищенный Метод

Audit Wrapper.
protected audit ( $target, $action, null $data = null, null $log_message = null, array $properties = [] )
$target
$action
$data null
$log_message null
$properties array

canUpdateWorklistDefinition() публичный Метод

public canUpdateWorklistDefinition ( WorklistDefinition $definition ) : integer
$definition WorklistDefinition
Результат integer

checkWorklistMappingMatch() защищенный Метод

protected checkWorklistMappingMatch ( Worklist $wl, $attributes ) : boolean
$wl Worklist
$attributes
Результат boolean

createAutomaticWorklist() защищенный Метод

Create a worklist instance from the given definition for the given date.
protected createAutomaticWorklist ( WorklistDefinition $definition, DateTime $date ) : boolean
$definition WorklistDefinition
$date DateTime
Результат boolean - indicate whether the instance was created (true) or if it already existed (false)

createWorklistForUser() публичный Метод

public createWorklistForUser ( Worklist $worklist, null $user = null, boolean $display = true ) : boolean
$worklist Worklist
$user null
$display boolean
Результат boolean

deleteWorklistDefinitionInstances() публичный Метод

public deleteWorklistDefinitionInstances ( WorklistDefinition $definition ) : boolean
$definition WorklistDefinition
Результат boolean

disableAudit() публичный Метод

Simple function for use during bulk procesess.
public disableAudit ( )

enableAudit() публичный Метод

Re-enable after disabling auditing.
public enableAudit ( )

generateAllAutomaticWorklists() публичный Метод

Returns false for errors, otherwise a total count of worklist instances that have been created.
public generateAllAutomaticWorklists ( DateTime $date_limit = null ) : boolean | integer
$date_limit DateTime
Результат boolean | integer

generateAutomaticWorklists() публичный Метод

Generate worklist instances for the given definition up until the given date limit If false is returned, getErrors should be used to determine the issue.
public generateAutomaticWorklists ( WorklistDefinition $definition, DateTime $date_limit = null ) : boolean
$definition WorklistDefinition
$date_limit DateTime
Результат boolean - true if the process had no failures, false otherwise.

generateWorklistName() публичный Метод

Generates a Worklist instance name from the given definition and date.
public generateWorklistName ( $definition, DateTime $date ) : string
$definition
$date DateTime
Результат string

getAppParam() защищенный Метод

Wrapper for retrieve app parameters.
protected getAppParam ( $name ) : array | string | null
$name
Результат array | string | null

getAvailableManualWorklistsForUser() публичный Метод

public getAvailableManualWorklistsForUser ( $user ) : mixed
$user
Результат mixed

getCurrentAutomaticWorklistsForUserContext() публичный Метод

public getCurrentAutomaticWorklistsForUserContext ( $user, Site $site, Firm $firm, DateTime $when ) : array
$user
$site Site
$firm Firm
$when DateTime
Результат array

getCurrentFirm() защищенный Метод

protected getCurrentFirm ( ) : Firm | null
Результат Firm | null

getCurrentManualWorklistsForUser() публичный Метод

public getCurrentManualWorklistsForUser ( $user ) : array
$user
Результат array

getCurrentSite() защищенный Метод

protected getCurrentSite ( ) : Site | null
Результат Site | null

getCurrentUser() защищенный Метод

Wrapper for retrieving current active User.
protected getCurrentUser ( ) : mixed
Результат mixed

getDashboardRenderDates() публичный Метод

Works out the dates we should retrieve Worklists for rendering.
public getDashboardRenderDates ( DateTime $date ) : array
$date DateTime
Результат array

getDefaultEndTime() публичный Метод

Wrapper for managing default end time for scheduled worklists.
public getDefaultEndTime ( ) : string
Результат string

getDefaultStartTime() публичный Метод

Wrapper for managing default start time for scheduled worklists.
public getDefaultStartTime ( ) : string
Результат string

getErrors() публичный Метод

public getErrors ( ) : array
Результат array

getGenerationTimeLimitDate() публичный Метод

public getGenerationTimeLimitDate ( ) : DateTime
Результат DateTime

getInstanceForClass() защищенный Метод

Abstraction for getting instance of class.
protected getInstanceForClass ( $class, $args = [] ) : mixed
$class
Результат mixed

getModelForClass() защищенный Метод

Abstraction for getting model instance of class.
protected getModelForClass ( $class ) : mixed
$class
Результат mixed

getPatientsForWorklist() публичный Метод

public getPatientsForWorklist ( $worklist ) : CActiveDataProvider
$worklist
Результат CActiveDataProvider

getWorklist() публичный Метод

public getWorklist ( $id ) : Worklist
$id
Результат Worklist

getWorklistDefinition() публичный Метод

public getWorklistDefinition ( null $id = null ) : WorklistDefinition | null
$id null
Результат WorklistDefinition | null

getWorklistDefinitions() публичный Метод

public getWorklistDefinitions ( ) : WorklistDefinition[]
Результат WorklistDefinition[]

getWorklistForMapping() защищенный Метод

protected getWorklistForMapping ( DateTime $when, array $attributes = [] ) : Worklist | null
$when DateTime
$attributes array
Результат Worklist | null

getWorklistIgnoreDate() публичный Метод

The time before which we are relaxed about appointments not finding matches.
public getWorklistIgnoreDate ( ) : DateTime
Результат DateTime

getWorklistPageSize() публичный Метод

public getWorklistPageSize ( ) : integer
Результат integer

getWorklistPatient() публичный Метод

public getWorklistPatient ( Worklist $worklist, Patient $patient ) : array | CActiveRecord | mixed | null
$worklist Worklist
$patient Patient
Результат array | CActiveRecord | mixed | null

hasErrors() публичный Метод

public hasErrors ( ) : boolean
Результат boolean

mapPatientToWorklistDefinition() публичный Метод

public mapPatientToWorklistDefinition ( Patient $patient, DateTime $when, array $attributes = [] ) : WorklistPatient | null
$patient Patient
$when DateTime
$attributes array
Результат WorklistPatient | null

renderAutomaticDashboard() публичный Метод

Render the automatic dashboard for the given user.
public renderAutomaticDashboard ( CWebUser $user = null ) : array | null
$user CWebUser
Результат array | null

renderManualDashboard() публичный Метод

public renderManualDashboard ( User | null $user = null ) : array | null
$user User | null
Результат array | null

renderPartial() защищенный Метод

Wrapper for partial rendering to encapsulate the call out to the static app for retrieving the controller object.
protected renderPartial ( $view, array $parameters = [] ) : mixed
$view
$parameters array
Результат mixed

renderWorklistForDashboard() публичный Метод

public renderWorklistForDashboard ( $worklist ) : mixed
$worklist
Результат mixed

reset() защищенный Метод

Internal method to reset state for error tracking.
protected reset ( )

saveWorklistDefinition() публичный Метод

public saveWorklistDefinition ( WorklistDefinition $definition ) : boolean
$definition WorklistDefinition
Результат boolean

setAttributesForWorklistPatient() публичный Метод

public setAttributesForWorklistPatient ( WorklistPatient $worklist_patient, array $attributes = [] ) : boolean
$worklist_patient WorklistPatient
$attributes array
Результат boolean

setDateLimitOnRrule() публичный Метод

Manipulates the given RRULE string so that it finishes on the given date.
public setDateLimitOnRrule ( string $rrule, DateTime $limit ) : string
$rrule string
$limit DateTime
Результат string

setWorklistDefinitionDisplayOrder() публичный Метод

Set the display order for the worklist definitions The start and end values will support a re-ordering request from a paginated list.
public setWorklistDefinitionDisplayOrder ( array $ids = [], null $start = null, null $end = null ) : boolean
$ids array
$start null
$end null
Результат boolean

setWorklistDefinitionMappingDisplayOrder() публичный Метод

public setWorklistDefinitionMappingDisplayOrder ( WorklistDefinition $definition, array $ids = [] ) : boolean
$definition WorklistDefinition
$ids array
Результат boolean

setWorklistDisplayOrderForUser() публичный Метод

public setWorklistDisplayOrderForUser ( $user, array $worklist_ids = [] ) : boolean
$user
$worklist_ids array
Результат boolean

shouldDisplayWorklistForContext() публичный Метод

public shouldDisplayWorklistForContext ( Worklist $worklist, Site $site, Firm $firm )
$worklist Worklist
$site Site
$firm Firm

shouldRenderEmptyWorklist() публичный Метод

public shouldRenderEmptyWorklist ( ) : boolean
Результат boolean

startTransaction() защищенный Метод

Wrapper for starting a transaction.
protected startTransaction ( ) : CDbTransaction | null
Результат CDbTransaction | null

updateWorklistDefinitionMapping() публичный Метод

Update the mapping specification for an automatic worklist definition.
public updateWorklistDefinitionMapping ( WorklistDefinitionMapping $mapping, $key, string $values, $display = true ) : boolean
$mapping WorklistDefinitionMapping
$key
$values string
Результат boolean

updateWorklistPatientFromMapping() публичный Метод

public updateWorklistPatientFromMapping ( WorklistPatient $worklist_patient, DateTime $when, array $attributes = [], boolean $allow_worklist_change = false ) : WorklistPatient | null
$worklist_patient WorklistPatient
$when DateTime
$attributes array
$allow_worklist_change boolean - only allow values to change that don't affect which worklist is mapped
Результат WorklistPatient | null

Описание свойств

$AUDIT_TARGET_AUTO публичное статическое свойство

public static $AUDIT_TARGET_AUTO

$AUDIT_TARGET_MANUAL публичное статическое свойство

public static $AUDIT_TARGET_MANUAL

$DEFAULT_DASHBOARD_FUTURE_DAYS защищенное статическое свойство

The interval between now and the future used for determining which Automatic Worklists should be rendered on the dashboard.
protected static string $DEFAULT_DASHBOARD_FUTURE_DAYS
Результат string

$DEFAULT_DASHBOARD_SKIP_DAYS защищенное статическое свойство

Array of 3 letter days of the week that should be skipped for picking dates to render worklist dashboards for.
protected static array $DEFAULT_DASHBOARD_SKIP_DAYS
Результат array

$DEFAULT_DUPLICATE_PATIENTS защищенное статическое свойство

Whether patients can be added to the same automatic worklist more than once.
protected static bool $DEFAULT_DUPLICATE_PATIENTS
Результат boolean

$DEFAULT_GENERATION_LIMIT защищенное статическое свойство

protected static string $DEFAULT_GENERATION_LIMIT
Результат string

$DEFAULT_SHOW_EMPTY защищенное статическое свойство

Whether worklists with no patient assignments should be displayed or not.
protected static bool $DEFAULT_SHOW_EMPTY
Результат boolean

$DEFAULT_WORKLIST_END_TIME защищенное статическое свойство

protected static string $DEFAULT_WORKLIST_END_TIME
Результат string

$DEFAULT_WORKLIST_PAGE_SIZE защищенное статическое свойство

protected static int $DEFAULT_WORKLIST_PAGE_SIZE
Результат integer

$DEFAULT_WORKLIST_START_TIME защищенное статическое свойство

protected static string $DEFAULT_WORKLIST_START_TIME
Результат string

$do_audit защищенное свойство

Flag to turn off auditing.
protected bool $do_audit
Результат boolean

$errors защищенное свойство

Internal store of error messages.
protected array $errors
Результат array

$yii защищенное свойство

protected CApplication $yii
Результат CApplication