PHP Class Patient

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

Méthodes publiques

Свойство Type Description
$use_pas

Protected Properties

Свойство Type Description
$_clinical_warnings storage of warning data
$_nonclinical_warnings

Méthodes publiques

Méthode Description
__get ( string $prop ) : mixed | null I think this override is here to enforce the override of the medications relation and merge in the prescription items as appropriate.
__isset ( string $prop ) : boolean I think this override is here to enforce the override of the medications relation and merge in the prescription items as appropriate.
addAllergy ( Allergy $allergy, string $other = null, $comments = null, $startTransaction = true ) adds an allergy to the patient.
addDiagnosis ( $disorder_id, $eye_id = false, $date = false )
addEpisode ( $firm ) : Episode add an episode to the patient for the given Firm.
addFamilyHistory ( $relative_id, $other_relative, $side_id, $condition_id, $other_condition, $comments ) Adds FamilyHistory entry to the patient if it's not a duplicate.
addPreviousOperation ( $operation, $side_id, $date )
addRisk ( Risk $risk, string $other = null, $comments = null ) adds a risk to the patient.
ageOn ( string $check_date ) : string Calculate the patient's age.
attributeLabels ( ) : array
audit ( $target, $action, $data = null, $log = false, $properties = [] )
beforeSave ( )
beforeValidate ( )
behaviors ( )
cmp ( $a, $b ) sort the remainder
currentContactIDS ( )
editOphInfo ( PatientOphInfoCviStatus $cvi_status, string $cvi_status_date ) : true | array update the patient's ophthalmic information.
getAge ( ) : string Get the patient's age.
getAllDisorders ( $eye_id = null ) * returns all disorders for the patient.
getAllergiesString ( ) : string returns a standard allergy string for the patient.
getBecomesAdultDate ( ) : null | string Returns the date on which the patient will become an adult.
getCataractEpisodeId ( ) : mixed Get the episode ID of the patient's cataract if it exists.
getChildPrefix ( )
getCommissioningBodyOfType ( CommissioningBodyType $type ) : CommissioningBody get the CommissioningBody of the CommissioningBodyType $type currently assumes there would only ever be one commissioning body of a given type.
getContactAddress ( $contact_id, $location_type = false, $location_id = false )
getCorrespondenceName ( ) : string
getDiabetes ( ) : Disorder | null Get the patient diabetes type as Disorder instance - will return generic Diabetes if no specific type available, but patient has diabetes.
getDiabetesType ( ) : Disorder | null Get the Diabetes Type as a Disorder instance.
getDisordersOfType ( int[] $snomeds ) : Disorder[] get the patient disorders that are of the type in the list of disorder ids provided.
getDisplayName ( )
getDistinctCommissioningBodiesByType ( ) : array[string][CommissioningBody] get an associative array of CommissioningBody for this patient and the patient's practice indexed by CommissioningBodyType id.
getDmt ( ) : string Diabetes mellitus as a letter string.
getEdl ( )
getEdr ( )
getEmail ( ) : mixed Returns the contact address email
getEpc ( )
getEpd ( )
getEpisodeForCurrentSubspecialty ( ) : Episode Get the episode for the subspecialty of the firm (or no subspecialty when the firm doesn't have one).
getEps ( )
getEpv ( )
getEthnicGroupString ( )
getFirst_name ( )
getFullName ( ) : string
getGenderString ( )
getHSCICName ( $bold = false ) : string get the Patient name according to HSCIC guidelines.
getLast_name ( )
getLatestEvent ( )
getLatestOperationNoteEventUniqueCode ( )
getNhsnum ( )
getNick_name ( )
getObj ( )
getOpenEpisodeOfSubspecialty ( $subspecialty_id ) : CActiveRecord | null return the open episode of the given subspecialty if there is one, null otherwise.
getOphInfo ( ) : PatientOphInfo returns the ophthalmic information object for this patient (creates a default one if one does not exist - but does not save it).
getOphthalmicDiagnoses ( )
getOrCreateEpisodeForFirm ( $firm, boolean $include_closed = false ) : CActiveRecord | Episode | null Get or create an episode for the patient under the given Firm (Note that an episode will be returned if there is match on Firm Subspecialty rather than on Firm).
getOrderedEpisodes ( ) * will group episodes by specialty, ordered by the configuration key of specialty sort, and alphanumeric for any specialties not configured.
getPos ( )
getPrefix ( )
getPrimary_phone ( )
getPro ( )
getRisksString ( ) : string returns a standard risk string for the patient.
getSalutationName ( ) : string
getSdl ( )
getSpecialtyCodes ( ) * returns the specialty codes that are relevant to the patient. Determined by looking at the diagnoses related to the patient.
getSub ( )
getSummaryAddress ( $delimiter = '<br/>' )
getSyd ( ) : string Systemic diagnoses shortcode.
getSystemicDiagnoses ( )
getTitle ( )
getUniqueCodeForEvent ( $id )
getWarnings ( boolean $clinical = true ) : {'short_msg' return the patient warnings that have been defined for the patient. If $clinical is false only non-clinical warnings will be returned.
get_medications ( ) : array Gets the current medications linked with items from the prescription events.
get_previous_medications ( ) : array Gets the previous medications linked with items from the prescription events.
hasAllergy ( $allergy ) : boolean returns true if the patient has the allergy passed in.
hasAllergyStatus ( ) : boolean returns true if the allergy status of the patient is known (has allergies, or no known allergies) false otherwise.
hasDisorderTypeByIds ( $snomeds ) * checks if the patient has a disorder that is defined as being within the SNOMED tree specified by the given $snomed id.
hasDrugAllergy ( integer $drug_id = null ) : boolean
hasLegacyLetters ( )
hasOpenEpisodeOfSubspecialty ( $subspecialty_id ) : boolean returns true if patient has an open episode for the given subspecialty id.
hasRisk ( $riskCompare ) : boolean Check if the patient has a given risk.
hasRiskStatus ( ) : boolean returns true if the risk status of the patient is known (has risks, or no known risks) false otherwise.
isChild ( string $check_date = null ) : boolean
isDeceased ( ) : boolean
model ( $className = __CLASS__ ) : Patient Returns the static model of the specified AR class.
noPas ( ) : Patient Suppress PAS integration.
patientMedications ( $medicationCriteria ) : array
prescriptionItems ( array $exclude ) : array | CActiveRecord[] | null
prescriptionMedicationIds ( ) : mixed
relations ( ) : array
removeDiagnosis ( $diagnosis_id )
rules ( ) : array
search ( array $params = [] ) : CActiveDataProvider Retrieves a list of models based on the current search/filter conditions.
search_nr ( $params )
setNoAllergies ( ) marks the patient as having no allergies as of now.
setNoFamilyHistory ( ) marks the patient as having no family history.
setNoRisks ( ) marks the patient as having no allergies as of now.
tableName ( ) : string
validateDeceased ( $attribute, $params )

Méthodes protégées

Méthode Description
afterFind ( ) Raise event to allow external data sources to update patient.
instantiate ( $attributes ) Pass through use_pas flag to allow pas supression.
mergeItemToMedications ( $medicationList, $prescription ) : mixed
sortMedications ( $item1, $item2 ) : boolean Sort the medications by start date.

Private Methods

Méthode Description
getAllDisorderIds ( $eye_id = null ) * returns all disorder ids for the patient, aggregating the principal diagnosis for each patient episode, and any secondary diagnosis on the patient
randomData ( $field )
randomDate ( $startDate = '1931-01-01', $endDate = '2010-12-12' )

Method Details

__get() public méthode

I think this override is here to enforce the override of the medications relation and merge in the prescription items as appropriate.
public __get ( string $prop ) : mixed | null
$prop string
Résultat mixed | null

__isset() public méthode

I think this override is here to enforce the override of the medications relation and merge in the prescription items as appropriate.
public __isset ( string $prop ) : boolean
$prop string
Résultat boolean

addAllergy() public méthode

adds an allergy to the patient.
public addAllergy ( Allergy $allergy, string $other = null, $comments = null, $startTransaction = true )
$allergy Allergy
$other string

addDiagnosis() public méthode

public addDiagnosis ( $disorder_id, $eye_id = false, $date = false )

addEpisode() public méthode

add an episode to the patient for the given Firm.
public addEpisode ( $firm ) : Episode
$firm
Résultat Episode

addFamilyHistory() public méthode

Adds FamilyHistory entry to the patient if it's not a duplicate.
public addFamilyHistory ( $relative_id, $other_relative, $side_id, $condition_id, $other_condition, $comments )
$relative_id
$other_relative
$side_id
$condition_id
$other_condition
$comments

addPreviousOperation() public méthode

public addPreviousOperation ( $operation, $side_id, $date )

addRisk() public méthode

adds a risk to the patient.
public addRisk ( Risk $risk, string $other = null, $comments = null )
$risk Risk
$other string

afterFind() protected méthode

Raise event to allow external data sources to update patient.
See also: CActiveRecord::afterFind()
protected afterFind ( )

ageOn() public méthode

Calculate the patient's age.
public ageOn ( string $check_date ) : string
$check_date string Date to check age on (default is today)
Résultat string

attributeLabels() public méthode

public attributeLabels ( ) : array
Résultat array customized attribute labels (name=>label)

audit() public méthode

public audit ( $target, $action, $data = null, $log = false, $properties = [] )

beforeSave() public méthode

public beforeSave ( )

beforeValidate() public méthode

public beforeValidate ( )

behaviors() public méthode

public behaviors ( )

cmp() public méthode

sort the remainder
public cmp ( $a, $b )

currentContactIDS() public méthode

public currentContactIDS ( )

editOphInfo() public méthode

update the patient's ophthalmic information.
public editOphInfo ( PatientOphInfoCviStatus $cvi_status, string $cvi_status_date ) : true | array
$cvi_status PatientOphInfoCviStatus
$cvi_status_date string - fuzzy date string of the format yyyy-mm-dd
Résultat true | array True or array of errors

getAge() public méthode

Get the patient's age.
public getAge ( ) : string
Résultat string

getAllDisorders() public méthode

FIXME: some of this can be abstracted to a relation when we upgrade from yii 1.1.8, which has some problems with yii relations: http://www.yiiframework.com/forum/index.php/topic/26806-relations-through-problem-wrong-on-clause-in-sql-generated/
public getAllDisorders ( $eye_id = null )

getAllergiesString() public méthode

returns a standard allergy string for the patient.
public getAllergiesString ( ) : string
Résultat string

getBecomesAdultDate() public méthode

Returns the date on which the patient will become an adult.
public getBecomesAdultDate ( ) : null | string
Résultat null | string

getCataractEpisodeId() public méthode

Get the episode ID of the patient's cataract if it exists.
public getCataractEpisodeId ( ) : mixed
Résultat mixed

getChildPrefix() public méthode

public getChildPrefix ( )

getCommissioningBodyOfType() public méthode

get the CommissioningBody of the CommissioningBodyType $type currently assumes there would only ever be one commissioning body of a given type.
public getCommissioningBodyOfType ( CommissioningBodyType $type ) : CommissioningBody
$type CommissioningBodyType
Résultat CommissioningBody

getContactAddress() public méthode

public getContactAddress ( $contact_id, $location_type = false, $location_id = false )

getCorrespondenceName() public méthode

public getCorrespondenceName ( ) : string
Résultat string Patient name for prefixing an address

getDiabetes() public méthode

Get the patient diabetes type as Disorder instance - will return generic Diabetes if no specific type available, but patient has diabetes.
public getDiabetes ( ) : Disorder | null
Résultat Disorder | null

getDiabetesType() public méthode

Get the Diabetes Type as a Disorder instance.
public getDiabetesType ( ) : Disorder | null
Résultat Disorder | null

getDisordersOfType() public méthode

get the patient disorders that are of the type in the list of disorder ids provided.
public getDisordersOfType ( int[] $snomeds ) : Disorder[]
$snomeds int[] - disorder ids to check for
Résultat Disorder[]

getDisplayName() public méthode

public getDisplayName ( )

getDistinctCommissioningBodiesByType() public méthode

get an associative array of CommissioningBody for this patient and the patient's practice indexed by CommissioningBodyType id.
public getDistinctCommissioningBodiesByType ( ) : array[string][CommissioningBody]
Résultat array[string][CommissioningBody]

getDmt() public méthode

Diabetes mellitus as a letter string.
public getDmt ( ) : string
Résultat string

getEdl() public méthode

public getEdl ( )

getEdr() public méthode

public getEdr ( )

getEmail() public méthode

Returns the contact address email
public getEmail ( ) : mixed
Résultat mixed

getEpc() public méthode

public getEpc ( )

getEpd() public méthode

public getEpd ( )

getEpisodeForCurrentSubspecialty() public méthode

Get the episode for the subspecialty of the firm (or no subspecialty when the firm doesn't have one).
public getEpisodeForCurrentSubspecialty ( ) : Episode
Résultat Episode

getEps() public méthode

public getEps ( )

getEpv() public méthode

public getEpv ( )

getEthnicGroupString() public méthode

getFirst_name() public méthode

public getFirst_name ( )

getFullName() public méthode

public getFullName ( ) : string
Résultat string Full name

getGenderString() public méthode

public getGenderString ( )

getHSCICName() public méthode

get the Patient name according to HSCIC guidelines.
public getHSCICName ( $bold = false ) : string
Résultat string

getLast_name() public méthode

public getLast_name ( )

getLatestEvent() public méthode

public getLatestEvent ( )

getLatestOperationNoteEventUniqueCode() public méthode

getNhsnum() public méthode

public getNhsnum ( )

getNick_name() public méthode

public getNick_name ( )

getObj() public méthode

public getObj ( )

getOpenEpisodeOfSubspecialty() public méthode

return the open episode of the given subspecialty if there is one, null otherwise.
public getOpenEpisodeOfSubspecialty ( $subspecialty_id ) : CActiveRecord | null
$subspecialty_id
Résultat CActiveRecord | null

getOphInfo() public méthode

returns the ophthalmic information object for this patient (creates a default one if one does not exist - but does not save it).
public getOphInfo ( ) : PatientOphInfo
Résultat PatientOphInfo

getOphthalmicDiagnoses() public méthode

getOrCreateEpisodeForFirm() public méthode

Get or create an episode for the patient under the given Firm (Note that an episode will be returned if there is match on Firm Subspecialty rather than on Firm).
public getOrCreateEpisodeForFirm ( $firm, boolean $include_closed = false ) : CActiveRecord | Episode | null
$firm
$include_closed boolean
Résultat CActiveRecord | Episode | null

getOrderedEpisodes() public méthode

* will group episodes by specialty, ordered by the configuration key of specialty sort, and alphanumeric for any specialties not configured.
public getOrderedEpisodes ( )

getPos() public méthode

public getPos ( )

getPrefix() public méthode

public getPrefix ( )

getPrimary_phone() public méthode

public getPrimary_phone ( )

getPro() public méthode

public getPro ( )

getRisksString() public méthode

returns a standard risk string for the patient.
public getRisksString ( ) : string
Résultat string

getSalutationName() public méthode

public getSalutationName ( ) : string
Résultat string Patient name for using as a salutation

getSdl() public méthode

public getSdl ( )

getSpecialtyCodes() public méthode

* returns the specialty codes that are relevant to the patient. Determined by looking at the diagnoses related to the patient.
public getSpecialtyCodes ( )

getSub() public méthode

public getSub ( )

getSummaryAddress() public méthode

public getSummaryAddress ( $delimiter = '<br/>' )

getSyd() public méthode

Systemic diagnoses shortcode.
public getSyd ( ) : string
Résultat string

getSystemicDiagnoses() public méthode

getTitle() public méthode

public getTitle ( )

getUniqueCodeForEvent() public méthode

public getUniqueCodeForEvent ( $id )

getWarnings() public méthode

return the patient warnings that have been defined for the patient. If $clinical is false only non-clinical warnings will be returned.
public getWarnings ( boolean $clinical = true ) : {'short_msg'
$clinical boolean
Résultat {'short_msg'

get_medications() public méthode

Gets the current medications linked with items from the prescription events.
public get_medications ( ) : array
Résultat array

get_previous_medications() public méthode

Gets the previous medications linked with items from the prescription events.
public get_previous_medications ( ) : array
Résultat array

hasAllergy() public méthode

returns true if the patient has the allergy passed in.
public hasAllergy ( $allergy ) : boolean
$allergy
Résultat boolean

hasAllergyStatus() public méthode

returns true if the allergy status of the patient is known (has allergies, or no known allergies) false otherwise.
public hasAllergyStatus ( ) : boolean
Résultat boolean

hasDisorderTypeByIds() public méthode

* checks if the patient has a disorder that is defined as being within the SNOMED tree specified by the given $snomed id.
public hasDisorderTypeByIds ( $snomeds )

hasDrugAllergy() public méthode

public hasDrugAllergy ( integer $drug_id = null ) : boolean
$drug_id integer
Résultat boolean Is patient allergic?

hasLegacyLetters() public méthode

public hasLegacyLetters ( )

hasOpenEpisodeOfSubspecialty() public méthode

returns true if patient has an open episode for the given subspecialty id.
public hasOpenEpisodeOfSubspecialty ( $subspecialty_id ) : boolean
$subspecialty_id
Résultat boolean

hasRisk() public méthode

Check if the patient has a given risk.
public hasRisk ( $riskCompare ) : boolean
$riskCompare
Résultat boolean

hasRiskStatus() public méthode

returns true if the risk status of the patient is known (has risks, or no known risks) false otherwise.
public hasRiskStatus ( ) : boolean
Résultat boolean

instantiate() protected méthode

Pass through use_pas flag to allow pas supression.
See also: CActiveRecord::instantiate()
protected instantiate ( $attributes )

isChild() public méthode

public isChild ( string $check_date = null ) : boolean
$check_date string Optional date to check age on (default is today)
Résultat boolean Is patient a child?

isDeceased() public méthode

public isDeceased ( ) : boolean
Résultat boolean Is patient deceased?

mergeItemToMedications() protected méthode

protected mergeItemToMedications ( $medicationList, $prescription ) : mixed
$medicationList
$prescription
Résultat mixed

model() public static méthode

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : Patient
Résultat Patient the static model class

noPas() public méthode

Suppress PAS integration.
public noPas ( ) : Patient
Résultat Patient

patientMedications() public méthode

public patientMedications ( $medicationCriteria ) : array
$medicationCriteria
Résultat array

prescriptionItems() public méthode

public prescriptionItems ( array $exclude ) : array | CActiveRecord[] | null
$exclude array
Résultat array | CActiveRecord[] | null

prescriptionMedicationIds() public méthode

public prescriptionMedicationIds ( ) : mixed
Résultat mixed

relations() public méthode

public relations ( ) : array
Résultat array relational rules.

removeDiagnosis() public méthode

public removeDiagnosis ( $diagnosis_id )

rules() public méthode

public rules ( ) : array
Résultat array validation rules for model attributes.

search_nr() public méthode

public search_nr ( $params )

setNoAllergies() public méthode

marks the patient as having no allergies as of now.
public setNoAllergies ( )

setNoFamilyHistory() public méthode

marks the patient as having no family history.
public setNoFamilyHistory ( )

setNoRisks() public méthode

marks the patient as having no allergies as of now.
public setNoRisks ( )

sortMedications() protected méthode

Sort the medications by start date.
protected sortMedications ( $item1, $item2 ) : boolean
$item1
$item2
Résultat boolean

tableName() public méthode

public tableName ( ) : string
Résultat string the associated database table name

validateDeceased() public méthode

public validateDeceased ( $attribute, $params )

Property Details

$_clinical_warnings protected_oe property

storage of warning data
protected $_clinical_warnings

$_nonclinical_warnings protected_oe property

protected $_nonclinical_warnings

$use_pas public_oe property

public $use_pas