PHP Класс Patient

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

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

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

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

Свойство Тип Описание
$_clinical_warnings storage of warning data
$_nonclinical_warnings

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

Метод Описание
__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 )

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

Метод Описание
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.

Приватные методы

Метод Описание
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' )

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

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

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
Результат mixed | null

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

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
Результат boolean

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

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

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

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

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

add an episode to the patient for the given Firm.
public addEpisode ( $firm ) : Episode
$firm
Результат Episode

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

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 addPreviousOperation ( $operation, $side_id, $date )

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

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

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

Raise event to allow external data sources to update patient.
См. также: CActiveRecord::afterFind()
protected afterFind ( )

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

Calculate the patient's age.
public ageOn ( string $check_date ) : string
$check_date string Date to check age on (default is today)
Результат string

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

public attributeLabels ( ) : array
Результат array customized attribute labels (name=>label)

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

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

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

public beforeSave ( )

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

public beforeValidate ( )

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

public behaviors ( )

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

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

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

public currentContactIDS ( )

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

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
Результат true | array True or array of errors

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

Get the patient's age.
public getAge ( ) : string
Результат string

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

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() публичный Метод

returns a standard allergy string for the patient.
public getAllergiesString ( ) : string
Результат string

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

Returns the date on which the patient will become an adult.
public getBecomesAdultDate ( ) : null | string
Результат null | string

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

Get the episode ID of the patient's cataract if it exists.
public getCataractEpisodeId ( ) : mixed
Результат mixed

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

public getChildPrefix ( )

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

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
Результат CommissioningBody

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

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

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

public getCorrespondenceName ( ) : string
Результат string Patient name for prefixing an address

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

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
Результат Disorder | null

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

Get the Diabetes Type as a Disorder instance.
public getDiabetesType ( ) : Disorder | null
Результат Disorder | null

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

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
Результат Disorder[]

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

public getDisplayName ( )

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

get an associative array of CommissioningBody for this patient and the patient's practice indexed by CommissioningBodyType id.
public getDistinctCommissioningBodiesByType ( ) : array[string][CommissioningBody]
Результат array[string][CommissioningBody]

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

Diabetes mellitus as a letter string.
public getDmt ( ) : string
Результат string

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

public getEdl ( )

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

public getEdr ( )

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

Returns the contact address email
public getEmail ( ) : mixed
Результат mixed

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

public getEpc ( )

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

public getEpd ( )

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

Get the episode for the subspecialty of the firm (or no subspecialty when the firm doesn't have one).
public getEpisodeForCurrentSubspecialty ( ) : Episode
Результат Episode

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

public getEps ( )

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

public getEpv ( )

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

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

public getFirst_name ( )

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

public getFullName ( ) : string
Результат string Full name

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

public getGenderString ( )

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

get the Patient name according to HSCIC guidelines.
public getHSCICName ( $bold = false ) : string
Результат string

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

public getLast_name ( )

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

public getLatestEvent ( )

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

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

public getNhsnum ( )

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

public getNick_name ( )

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

public getObj ( )

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

return the open episode of the given subspecialty if there is one, null otherwise.
public getOpenEpisodeOfSubspecialty ( $subspecialty_id ) : CActiveRecord | null
$subspecialty_id
Результат CActiveRecord | null

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

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
Результат PatientOphInfo

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

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

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
Результат CActiveRecord | Episode | null

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

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

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

public getPos ( )

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

public getPrefix ( )

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

public getPrimary_phone ( )

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

public getPro ( )

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

returns a standard risk string for the patient.
public getRisksString ( ) : string
Результат string

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

public getSalutationName ( ) : string
Результат string Patient name for using as a salutation

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

public getSdl ( )

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

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

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

public getSub ( )

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

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

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

Systemic diagnoses shortcode.
public getSyd ( ) : string
Результат string

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

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

public getTitle ( )

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

public getUniqueCodeForEvent ( $id )

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

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
Результат {'short_msg'

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

Gets the current medications linked with items from the prescription events.
public get_medications ( ) : array
Результат array

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

Gets the previous medications linked with items from the prescription events.
public get_previous_medications ( ) : array
Результат array

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

returns true if the patient has the allergy passed in.
public hasAllergy ( $allergy ) : boolean
$allergy
Результат boolean

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

returns true if the allergy status of the patient is known (has allergies, or no known allergies) false otherwise.
public hasAllergyStatus ( ) : boolean
Результат boolean

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

* 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 hasDrugAllergy ( integer $drug_id = null ) : boolean
$drug_id integer
Результат boolean Is patient allergic?

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

public hasLegacyLetters ( )

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

returns true if patient has an open episode for the given subspecialty id.
public hasOpenEpisodeOfSubspecialty ( $subspecialty_id ) : boolean
$subspecialty_id
Результат boolean

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

Check if the patient has a given risk.
public hasRisk ( $riskCompare ) : boolean
$riskCompare
Результат boolean

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

returns true if the risk status of the patient is known (has risks, or no known risks) false otherwise.
public hasRiskStatus ( ) : boolean
Результат boolean

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

Pass through use_pas flag to allow pas supression.
См. также: CActiveRecord::instantiate()
protected instantiate ( $attributes )

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

public isChild ( string $check_date = null ) : boolean
$check_date string Optional date to check age on (default is today)
Результат boolean Is patient a child?

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

public isDeceased ( ) : boolean
Результат boolean Is patient deceased?

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

protected mergeItemToMedications ( $medicationList, $prescription ) : mixed
$medicationList
$prescription
Результат mixed

model() публичный статический Метод

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : Patient
Результат Patient the static model class

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

Suppress PAS integration.
public noPas ( ) : Patient
Результат Patient

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

public patientMedications ( $medicationCriteria ) : array
$medicationCriteria
Результат array

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

public prescriptionItems ( array $exclude ) : array | CActiveRecord[] | null
$exclude array
Результат array | CActiveRecord[] | null

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

public prescriptionMedicationIds ( ) : mixed
Результат mixed

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

public relations ( ) : array
Результат array relational rules.

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

public removeDiagnosis ( $diagnosis_id )

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

public rules ( ) : array
Результат array validation rules for model attributes.

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

public search_nr ( $params )

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

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

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

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

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

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

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

Sort the medications by start date.
protected sortMedications ( $item1, $item2 ) : boolean
$item1
$item2
Результат boolean

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

public tableName ( ) : string
Результат string the associated database table name

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

public validateDeceased ( $attribute, $params )

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

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

storage of warning data
protected $_clinical_warnings

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

protected $_nonclinical_warnings

$use_pas публичное свойство

public $use_pas