PHP Class OEModule\OphCoCvi\components\OphCoCvi_Manager

Inheritance: extends CComponent
Show file Open project: openeyes/openeyes

Public Properties

Property Type Description
$CLERICAL_COMPLETE
$CLINICAL_COMPLETE
$CONSENTED
$CONSULTANT_SIGNED
$DEMOGRAPHICS_COMPLETE
$ISSUED

Protected Properties

Property Type Description
$event_type EventType
$info_el_for_events
$yii

Public Methods

Method Description
__construct ( CApplication $yii = null, EventType $event_type = null )
calculateStatus ( Event $event ) : mixed
canCreateEventForPatient ( Patient $patient ) : boolean
canEditEvent ( Event $event ) : boolean
canIssueCvi ( Event $event ) : boolean
generateConsentForm ( Event $event ) : ODTTemplateManager Generate the CVI Consent Form for the patient to sign.
getClericalElementForEvent ( Event $event ) : null | Element_OphCoCvi_ClericalInfo
getClinicalConsultant ( Element_OphCoCvi_EventInfo $event_info ) : User | null
getClinicalElementForEvent ( Event $event ) : null | Element_OphCoCvi_ClinicalInfo
getConsentSignatureElementForEvent ( Event $event ) : null | Element_OphCoCvi_ConsentSignature
getDemographicsElementForEvent ( Event $event ) : Element_OphCoCvi_Demographics | null
getDisplayStatusDateForEvent ( Event $event ) : string | null
getDisplayStatusForEvent ( Event $event ) : string
getDisplayStatusFromEventInfo ( Element_OphCoCvi_EventInfo $element ) : string
getEventElements ( Event $event, boolean $for_editing = false ) : array | BaseEventTypeElement[] Wrapper to insert missing elements for a CVI event if they haven't been created (due to access restrictions)
getEventInfoElementForEvent ( Event $event ) : null | Element_OphCoCvi_EventInfo
getEventViewUri ( Event $event ) : string
getEventsForPatient ( Patient $patient ) : Event[]
getListDataProvider ( array $filter = [] ) : CActiveDataProvider Abstraction of the list provider
getStatusText ( $status ) : string
getTitle ( Event $event ) : string
isIssued ( Event $event ) : boolean
issueCvi ( Event $event, $user_id ) : boolean Issue the CVI for the given event (recording it as an action performed by the given user id).
removeConsentSignature ( Event $event, User $user, $signature_file_id ) : boolean
saveUserSignature ( $signatureFile, Event $event )
signCvi ( Event $event, User $user, $pin ) : boolean
updateEventInfo ( $event )

Protected Methods

Method Description
buildFilterCriteria ( array $filter = [] ) : CDbCriteria
determineEventType ( ) : EventType
generateCviCertificate ( Event $event ) : ProtectedFile Create the CVI Certificate and store it as a ProtectedFile.
getDisplayStatus ( Element_OphCoCvi_ClinicalInfo $clinical = null, Element_OphCoCvi_EventInfo $info ) : string Generate the text display of the status of the CVI
getElementForEvent ( $event, $element_class ) : CActiveRecord | null
getModuleClass ( ) : mixed Returns the non-namespaced module class of the module API Instance
getPatientForEvent ( Event $event ) : Patient
getStructuredDataForPrintPDF ( Event $event ) : array Element based name and value pair.
populateCviCertificate ( Event $event, boolean $ignore_portal = false ) : ODTTemplateManager Prepare the Certificate template with the data available from the given event.
resetElementStore ( Event $event = null ) Convenience wrapper to clear out element data when put into specific states that we don't want to keep
startTransaction ( ) : CDbTransaction | null Wrapper for starting a transaction.

Private Methods

Method Description
handleConsultantListFilter ( CDbCriteria $criteria, array $filter = [] )
handleDateRangeFilter ( CDbCriteria $criteria, array $filter = [] )
handleIssuedFilter ( CDbCriteria $criteria, array $filter = [] )
handleSiteListFilter ( CDbCriteria $criteria, array $filter = [] )
handleSubspecialtyListFilter ( CDbCriteria $criteria, array $filter = [] )

Method Details

__construct() public method

public __construct ( CApplication $yii = null, EventType $event_type = null )
$yii CApplication
$event_type EventType

buildFilterCriteria() protected method

protected buildFilterCriteria ( array $filter = [] ) : CDbCriteria
$filter array
return CDbCriteria

calculateStatus() public method

public calculateStatus ( Event $event ) : mixed
$event Event
return mixed

canCreateEventForPatient() public method

public canCreateEventForPatient ( Patient $patient ) : boolean
$patient Patient
return boolean

canEditEvent() public method

public canEditEvent ( Event $event ) : boolean
$event Event
return boolean

canIssueCvi() public method

public canIssueCvi ( Event $event ) : boolean
$event Event
return boolean

determineEventType() protected method

protected determineEventType ( ) : EventType
return EventType

generateConsentForm() public method

Generate the CVI Consent Form for the patient to sign.
public generateConsentForm ( Event $event ) : ODTTemplateManager
$event Event
return ODTTemplateManager

generateCviCertificate() protected method

Create the CVI Certificate and store it as a ProtectedFile.
protected generateCviCertificate ( Event $event ) : ProtectedFile
$event Event
return ProtectedFile

getClericalElementForEvent() public method

public getClericalElementForEvent ( Event $event ) : null | Element_OphCoCvi_ClericalInfo
$event Event
return null | OEModule\OphCoCvi\models\Element_OphCoCvi_ClericalInfo

getClinicalConsultant() public method

public getClinicalConsultant ( Element_OphCoCvi_EventInfo $event_info ) : User | null
$event_info OEModule\OphCoCvi\models\Element_OphCoCvi_EventInfo
return User | null

getClinicalElementForEvent() public method

public getClinicalElementForEvent ( Event $event ) : null | Element_OphCoCvi_ClinicalInfo
$event Event
return null | OEModule\OphCoCvi\models\Element_OphCoCvi_ClinicalInfo

getConsentSignatureElementForEvent() public method

public getConsentSignatureElementForEvent ( Event $event ) : null | Element_OphCoCvi_ConsentSignature
$event Event
return null | OEModule\OphCoCvi\models\Element_OphCoCvi_ConsentSignature

getDemographicsElementForEvent() public method

public getDemographicsElementForEvent ( Event $event ) : Element_OphCoCvi_Demographics | null
$event Event
return OEModule\OphCoCvi\models\Element_OphCoCvi_Demographics | null

getDisplayStatus() protected method

Generate the text display of the status of the CVI
protected getDisplayStatus ( Element_OphCoCvi_ClinicalInfo $clinical = null, Element_OphCoCvi_EventInfo $info ) : string
$clinical OEModule\OphCoCvi\models\Element_OphCoCvi_ClinicalInfo
$info OEModule\OphCoCvi\models\Element_OphCoCvi_EventInfo
return string

getDisplayStatusDateForEvent() public method

public getDisplayStatusDateForEvent ( Event $event ) : string | null
$event Event
return string | null

getDisplayStatusForEvent() public method

public getDisplayStatusForEvent ( Event $event ) : string
$event Event
return string

getDisplayStatusFromEventInfo() public method

public getDisplayStatusFromEventInfo ( Element_OphCoCvi_EventInfo $element ) : string
$element OEModule\OphCoCvi\models\Element_OphCoCvi_EventInfo
return string

getElementForEvent() protected method

protected getElementForEvent ( $event, $element_class ) : CActiveRecord | null
$event
$element_class
return CActiveRecord | null

getEventElements() public method

NB The inserted elements may be removed in the view context if the user still doesn't have the right to manage the data for that specific element.
public getEventElements ( Event $event, boolean $for_editing = false ) : array | BaseEventTypeElement[]
$event Event
$for_editing boolean
return array | BaseEventTypeElement[]

getEventInfoElementForEvent() public method

public getEventInfoElementForEvent ( Event $event ) : null | Element_OphCoCvi_EventInfo
$event Event
return null | OEModule\OphCoCvi\models\Element_OphCoCvi_EventInfo

getEventViewUri() public method

public getEventViewUri ( Event $event ) : string
$event Event
return string

getEventsForPatient() public method

public getEventsForPatient ( Patient $patient ) : Event[]
$patient Patient
return Event[]

getListDataProvider() public method

Abstraction of the list provider
public getListDataProvider ( array $filter = [] ) : CActiveDataProvider
$filter array
return CActiveDataProvider

getModuleClass() protected method

Returns the non-namespaced module class of the module API Instance
protected getModuleClass ( ) : mixed
return mixed

getPatientForEvent() protected method

protected getPatientForEvent ( Event $event ) : Patient
$event Event
return Patient

getStatusText() public method

public getStatusText ( $status ) : string
$status
return string

getStructuredDataForPrintPDF() protected method

Element based name and value pair.
protected getStructuredDataForPrintPDF ( Event $event ) : array
$event Event
return array

getTitle() public method

public getTitle ( Event $event ) : string
$event Event
return string

isIssued() public method

public isIssued ( Event $event ) : boolean
$event Event
return boolean

issueCvi() public method

Issue the CVI for the given event (recording it as an action performed by the given user id).
public issueCvi ( Event $event, $user_id ) : boolean
$event Event
$user_id
return boolean

populateCviCertificate() protected method

Prepare the Certificate template with the data available from the given event.
protected populateCviCertificate ( Event $event, boolean $ignore_portal = false ) : ODTTemplateManager
$event Event
$ignore_portal boolean - if true, will force the signature box to be rendered rather than checking the portal
return ODTTemplateManager

removeConsentSignature() public method

public removeConsentSignature ( Event $event, User $user, $signature_file_id ) : boolean
$event Event
$user User
$signature_file_id
return boolean

resetElementStore() protected method

Convenience wrapper to clear out element data when put into specific states that we don't want to keep
protected resetElementStore ( Event $event = null )
$event Event

saveUserSignature() public method

public saveUserSignature ( $signatureFile, Event $event )
$signatureFile
$event Event

signCvi() public method

public signCvi ( Event $event, User $user, $pin ) : boolean
$event Event
$user User
$pin
return boolean

startTransaction() protected method

Wrapper for starting a transaction.
protected startTransaction ( ) : CDbTransaction | null
return CDbTransaction | null

updateEventInfo() public method

public updateEventInfo ( $event )
$event

Property Details

$CLERICAL_COMPLETE public static property

public static $CLERICAL_COMPLETE

$CLINICAL_COMPLETE public static property

public static $CLINICAL_COMPLETE

$CONSENTED public static property

public static $CONSENTED

$CONSULTANT_SIGNED public static property

public static $CONSULTANT_SIGNED

$DEMOGRAPHICS_COMPLETE public static property

public static $DEMOGRAPHICS_COMPLETE

$ISSUED public static property

public static $ISSUED

$event_type protected property

protected EventType $event_type
return EventType

$info_el_for_events protected property

protected $info_el_for_events

$yii protected property

protected $yii