PHP Class WorklistManager

Class WorklistManager
Inheritance: extends CComponent
Afficher le fichier Open project: openeyes/openeyes Class Usage Examples

Méthodes publiques

Свойство Type Description
$AUDIT_TARGET_AUTO
$AUDIT_TARGET_MANUAL

Protected Properties

Свойство Type Description
$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

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
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.

Method Details

__construct() public méthode

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

addError() protected méthode

protected addError ( string $message )
$message string

addModelErrors() protected méthode

protected addModelErrors ( $errors )
$errors

addPatientToWorklist() public méthode

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
Résultat WorklistPatient | null

addWorklistToUserDisplay() public méthode

public addWorklistToUserDisplay ( $worklist, $user, null $display_order = null ) : mixed
$worklist
$user
$display_order null
Résultat mixed

allowDuplicatePatients() public méthode

public allowDuplicatePatients ( ) : boolean
Résultat boolean

audit() protected méthode

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 méthode

public canUpdateWorklistDefinition ( WorklistDefinition $definition ) : integer
$definition WorklistDefinition
Résultat integer

checkWorklistMappingMatch() protected méthode

protected checkWorklistMappingMatch ( Worklist $wl, $attributes ) : boolean
$wl Worklist
$attributes
Résultat boolean

createAutomaticWorklist() protected méthode

Create a worklist instance from the given definition for the given date.
protected createAutomaticWorklist ( WorklistDefinition $definition, DateTime $date ) : boolean
$definition WorklistDefinition
$date DateTime
Résultat boolean - indicate whether the instance was created (true) or if it already existed (false)

createWorklistForUser() public méthode

public createWorklistForUser ( Worklist $worklist, null $user = null, boolean $display = true ) : boolean
$worklist Worklist
$user null
$display boolean
Résultat boolean

deleteWorklistDefinitionInstances() public méthode

public deleteWorklistDefinitionInstances ( WorklistDefinition $definition ) : boolean
$definition WorklistDefinition
Résultat boolean

disableAudit() public méthode

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

enableAudit() public méthode

Re-enable after disabling auditing.
public enableAudit ( )

generateAllAutomaticWorklists() public méthode

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
Résultat boolean | integer

generateAutomaticWorklists() public méthode

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
Résultat boolean - true if the process had no failures, false otherwise.

generateWorklistName() public méthode

Generates a Worklist instance name from the given definition and date.
public generateWorklistName ( $definition, DateTime $date ) : string
$definition
$date DateTime
Résultat string

getAppParam() protected méthode

Wrapper for retrieve app parameters.
protected getAppParam ( $name ) : array | string | null
$name
Résultat array | string | null

getAvailableManualWorklistsForUser() public méthode

public getAvailableManualWorklistsForUser ( $user ) : mixed
$user
Résultat mixed

getCurrentAutomaticWorklistsForUserContext() public méthode

public getCurrentAutomaticWorklistsForUserContext ( $user, Site $site, Firm $firm, DateTime $when ) : array
$user
$site Site
$firm Firm
$when DateTime
Résultat array

getCurrentFirm() protected méthode

protected getCurrentFirm ( ) : Firm | null
Résultat Firm | null

getCurrentManualWorklistsForUser() public méthode

public getCurrentManualWorklistsForUser ( $user ) : array
$user
Résultat array

getCurrentSite() protected méthode

protected getCurrentSite ( ) : Site | null
Résultat Site | null

getCurrentUser() protected méthode

Wrapper for retrieving current active User.
protected getCurrentUser ( ) : mixed
Résultat mixed

getDashboardRenderDates() public méthode

Works out the dates we should retrieve Worklists for rendering.
public getDashboardRenderDates ( DateTime $date ) : array
$date DateTime
Résultat array

getDefaultEndTime() public méthode

Wrapper for managing default end time for scheduled worklists.
public getDefaultEndTime ( ) : string
Résultat string

getDefaultStartTime() public méthode

Wrapper for managing default start time for scheduled worklists.
public getDefaultStartTime ( ) : string
Résultat string

getErrors() public méthode

public getErrors ( ) : array
Résultat array

getGenerationTimeLimitDate() public méthode

public getGenerationTimeLimitDate ( ) : DateTime
Résultat DateTime

getInstanceForClass() protected méthode

Abstraction for getting instance of class.
protected getInstanceForClass ( $class, $args = [] ) : mixed
$class
Résultat mixed

getModelForClass() protected méthode

Abstraction for getting model instance of class.
protected getModelForClass ( $class ) : mixed
$class
Résultat mixed

getPatientsForWorklist() public méthode

public getPatientsForWorklist ( $worklist ) : CActiveDataProvider
$worklist
Résultat CActiveDataProvider

getWorklist() public méthode

public getWorklist ( $id ) : Worklist
$id
Résultat Worklist

getWorklistDefinition() public méthode

public getWorklistDefinition ( null $id = null ) : WorklistDefinition | null
$id null
Résultat WorklistDefinition | null

getWorklistDefinitions() public méthode

public getWorklistDefinitions ( ) : WorklistDefinition[]
Résultat WorklistDefinition[]

getWorklistForMapping() protected méthode

protected getWorklistForMapping ( DateTime $when, array $attributes = [] ) : Worklist | null
$when DateTime
$attributes array
Résultat Worklist | null

getWorklistIgnoreDate() public méthode

The time before which we are relaxed about appointments not finding matches.
public getWorklistIgnoreDate ( ) : DateTime
Résultat DateTime

getWorklistPageSize() public méthode

public getWorklistPageSize ( ) : integer
Résultat integer

getWorklistPatient() public méthode

public getWorklistPatient ( Worklist $worklist, Patient $patient ) : array | CActiveRecord | mixed | null
$worklist Worklist
$patient Patient
Résultat array | CActiveRecord | mixed | null

hasErrors() public méthode

public hasErrors ( ) : boolean
Résultat boolean

mapPatientToWorklistDefinition() public méthode

public mapPatientToWorklistDefinition ( Patient $patient, DateTime $when, array $attributes = [] ) : WorklistPatient | null
$patient Patient
$when DateTime
$attributes array
Résultat WorklistPatient | null

renderAutomaticDashboard() public méthode

Render the automatic dashboard for the given user.
public renderAutomaticDashboard ( CWebUser $user = null ) : array | null
$user CWebUser
Résultat array | null

renderManualDashboard() public méthode

public renderManualDashboard ( User | null $user = null ) : array | null
$user User | null
Résultat array | null

renderPartial() protected méthode

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
Résultat mixed

renderWorklistForDashboard() public méthode

public renderWorklistForDashboard ( $worklist ) : mixed
$worklist
Résultat mixed

reset() protected méthode

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

saveWorklistDefinition() public méthode

public saveWorklistDefinition ( WorklistDefinition $definition ) : boolean
$definition WorklistDefinition
Résultat boolean

setAttributesForWorklistPatient() public méthode

public setAttributesForWorklistPatient ( WorklistPatient $worklist_patient, array $attributes = [] ) : boolean
$worklist_patient WorklistPatient
$attributes array
Résultat boolean

setDateLimitOnRrule() public méthode

Manipulates the given RRULE string so that it finishes on the given date.
public setDateLimitOnRrule ( string $rrule, DateTime $limit ) : string
$rrule string
$limit DateTime
Résultat string

setWorklistDefinitionDisplayOrder() public méthode

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
Résultat boolean

setWorklistDefinitionMappingDisplayOrder() public méthode

public setWorklistDefinitionMappingDisplayOrder ( WorklistDefinition $definition, array $ids = [] ) : boolean
$definition WorklistDefinition
$ids array
Résultat boolean

setWorklistDisplayOrderForUser() public méthode

public setWorklistDisplayOrderForUser ( $user, array $worklist_ids = [] ) : boolean
$user
$worklist_ids array
Résultat boolean

shouldDisplayWorklistForContext() public méthode

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

shouldRenderEmptyWorklist() public méthode

public shouldRenderEmptyWorklist ( ) : boolean
Résultat boolean

startTransaction() protected méthode

Wrapper for starting a transaction.
protected startTransaction ( ) : CDbTransaction | null
Résultat CDbTransaction | null

updateWorklistDefinitionMapping() public méthode

Update the mapping specification for an automatic worklist definition.
public updateWorklistDefinitionMapping ( WorklistDefinitionMapping $mapping, $key, string $values, $display = true ) : boolean
$mapping WorklistDefinitionMapping
$key
$values string
Résultat boolean

updateWorklistPatientFromMapping() public méthode

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
Résultat WorklistPatient | null

Property Details

$AUDIT_TARGET_AUTO public_oe static_oe property

public static $AUDIT_TARGET_AUTO

$AUDIT_TARGET_MANUAL public_oe static_oe property

public static $AUDIT_TARGET_MANUAL

$DEFAULT_DASHBOARD_FUTURE_DAYS protected_oe static_oe property

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
Résultat string

$DEFAULT_DASHBOARD_SKIP_DAYS protected_oe static_oe property

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
Résultat array

$DEFAULT_DUPLICATE_PATIENTS protected_oe static_oe property

Whether patients can be added to the same automatic worklist more than once.
protected static bool $DEFAULT_DUPLICATE_PATIENTS
Résultat boolean

$DEFAULT_GENERATION_LIMIT protected_oe static_oe property

protected static string $DEFAULT_GENERATION_LIMIT
Résultat string

$DEFAULT_SHOW_EMPTY protected_oe static_oe property

Whether worklists with no patient assignments should be displayed or not.
protected static bool $DEFAULT_SHOW_EMPTY
Résultat boolean

$DEFAULT_WORKLIST_END_TIME protected_oe static_oe property

protected static string $DEFAULT_WORKLIST_END_TIME
Résultat string

$DEFAULT_WORKLIST_PAGE_SIZE protected_oe static_oe property

protected static int $DEFAULT_WORKLIST_PAGE_SIZE
Résultat integer

$DEFAULT_WORKLIST_START_TIME protected_oe static_oe property

protected static string $DEFAULT_WORKLIST_START_TIME
Résultat string

$do_audit protected_oe property

Flag to turn off auditing.
protected bool $do_audit
Résultat boolean

$errors protected_oe property

Internal store of error messages.
protected array $errors
Résultat array

$yii protected_oe property

protected CApplication $yii
Résultat CApplication