Inherited Variables
Inherited Methods
Class: Core
- Core::coreFieldNames()
- Returns the core field names of the core table in an array.
- Core::deleteDBCache()
- Deletes data from the database cache based on the id key.
- Core::FilesListArray()
- Returns a list of filename within a path in array.
- Core::getAllDataArray()
- Returns all records with the all items from the table.
- Core::getAllDataObject()
- Returns all records with all items from the table.
- Core::getAllItemsArray()
- Similar to getAllItemsObject() method but returns the records in an associative array.
- Core::getAllItemsObject()
- Returns all records with the needed items from the table.
- Core::getDBCache()
- Gets temporary data from the database cache.
- Core::getErrorMsg()
- Feturns the value of error_msg, the internal error message.
- Core::getLastQuery()
- Returns the the last sql query string
- Core::getResult()
- Feturns the value of result
- Core::insertDataFromArray()
- Inserts data from an array (passed by reference) into a table.
- Core::insertDataFromInternalArray()
- Inserts data from the internal array previously filled with data by the setDataArray() method.
- Core::isPreLoaded()
- Returns the value of is_preloaded that is set by methods that preload large number of data.
- Core::LastRecordCount()
- Returns the value of rec_count
- Core::saveDBCache()
- Saves temporary data to a cache in database.
- Core::setDataArray()
- Points the core data array to the external array that holds the data to be stored.
- Core::setRefArray()
- Points the reference variable $ref_array to the field names' array.
- Core::setSQL()
- Sets the internal sql query variable to the sql query.
- Core::setTable()
- Sets the coretable variable to the name of the database table.
- Core::setWhereCondition()
- Sets the "where" condition in an update query used with the updateDataFromInternalArray() method.
- Core::Transact()
- Transaction routine, ADODB transaction. It internally uses the ADODB transaction routine.
- Core::updateDataFromArray()
- Updates a record with the data from an array (passed by reference) based on the primary key.
- Core::updateDataFromInternalArray()
- Updates a table using data from an internal array previously filled with data by the setDataArray() method.
- Core::_prepSaveArray()
- Filters the data array intended for saving, removing the key-value pairs that do not correspond to the table's field names.
- Core::_RecordExists()
- Checks if a certain database record exists based onthe supplied query condition.
Class Details
Person methods.
Note this class should be instantiated only after a "$db" adodb connector object has been established by an adodb instance
Tags:
- copyright - 2002,2003 Elpidio Latorilla
- version - beta 1.0.08
- author - Elpidio Latorilla
[ Top ]
Class Variables
$basic_list = 'pid,title,name_first,name_last,name_2,name_3,name_middle,name_maiden,name_others,date_birth,
sex,addr_str,addr_str_nr,addr_zip,addr_citytown_nr,photo_filename'
[line 95]
Field names of basic registration data to be returned.
Type: array
Overrides:
[ Top ]
$buffer =
[line 70]
Universal buffer
Type: mixed
Overrides: Array
[ Top ]
$data_array =
[line 65]
Internal data buffer
Type: array
Overrides: Array
[ Top ]
$elems_array = array(
'pid',
'title',
'date_reg',
'name_last',
'name_first',
'date_birth',
'sex',
'name_2',
'name_3',
'name_middle',
'name_maiden',
'name_others',
'date_birth',
'blood_group',
'addr_str',
'addr_str_nr',
'addr_zip',
'addr_citytown_nr',
'phone_1_code',
'phone_1_nr',
'phone_2_code',
'phone_2_nr',
'cellphone_1_nr',
'cellphone_2_nr',
'fax',
'email',
'civil_status',
'photo_filename',
'ethnic_orig',
'org_id',
'sss_nr',
'nat_id_nr',
'religion',
'mother_pid',
'father_pid',
'contact_person',
'contact_pid',
'contact_relation',
'death_date',
'death_encounter_nr',
'death_cause',
'death_cause_code',
'status',
'history',
'modify_id',
'modify_time',
'create_id',
'create_time')
[line 100]
Field names of table care_person
Type: array
Overrides:
[ Top ]
$is_nr = false
[line 90]
Valid number flag
Type: boolean
Overrides:
[ Top ]
$is_preloaded = false
[line 85]
Preloaded data flag
Type: boolean
Overrides: Array
[ Top ]
$ok =
[line 60]
Universal flag
Type: boolean
Overrides: Array
[ Top ]
$person = array()
[line 80]
Returned person data buffer
Type: array
Overrides:
[ Top ]
$pid =
[line 50]
PID number
Type: int
Overrides:
[ Top ]
$result =
[line 55]
Sql query result buffer
Tags:
- var - record object
Type: adodb
Overrides: Array
[ Top ]
$row =
[line 75]
Returned row buffer
Type: array
Overrides:
[ Top ]
$sql =
[line 44]
SQL query
Tags:
- access - private
Type: mixed
Overrides: Array
[ Top ]
$tb_citytown = 'care_address_citytown'
[line 30]
Table name for city town name.
Tags:
- access - private
Type: string
Overrides:
[ Top ]
$tb_employ = 'care_personell'
[line 40]
Table name for employee data.
Tags:
- access - private
Type: string
Overrides:
[ Top ]
$tb_enc = 'care_encounter'
[line 35]
Table name for encounter data.
Tags:
- access - private
Type: string
Overrides:
[ Top ]
$tb_person = 'care_person'
[line 25]
Table name for person registration data.
Tags:
- access - private
Type: string
Overrides:
[ Top ]
Class Methods
Person
Person Person(
[int
$pid = ''])
[line 153]
Constructor
Parameters:
- int $pid - PID number
[ Top ]
BasicDataArray
mixed BasicDataArray(
int
$pid)
[line 672]
Returns person registration items as listed in the $basic_list array based on pid key.
The data is returned as associative array.
Tags:
- return - string or boolean
- access - public
Parameters:
- int $pid - PID number
[ Top ]
BirthDate
void BirthDate(
)
[line 468]
Returns person's date of birth.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
Citizenship
void Citizenship(
)
[line 504]
Returns citizenship.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
CityTownCode
void CityTownCode(
)
[line 498]
Returns the city or town code number. Reserved.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
CityTownName
mixed CityTownName(
[mixed
$code_nr = ''])
[line 653]
Returns city or town name based on its "nr" key.
Tags:
- return - string or boolean
- access - public
Parameters:
[ Top ]
CurrentEmployment
mixed CurrentEmployment(
int
$pid)
[line 791]
Checks if the person is currently employed in this hospital.
If currently employed the employee number is returned, else FALSE.
Tags:
- return - integer or boolean
- access - public
Parameters:
- int $pid - PID number
[ Top ]
CurrentEncounter
mixed CurrentEncounter(
int
$pid)
[line 701]
Checks if a person is currently admitted (either inpatient & outpatient).
If person is currently admitted, his current encounter number is returned, else FALSE.
Tags:
- return - integer or boolean
- access - public
Parameters:
- int $pid - PID number
[ Top ]
DeathCause
void DeathCause(
)
[line 624]
Returns case of death. In case person is deceased.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
DeathDate
void DeathDate(
)
[line 618]
Returns date of death. In case person is deceased.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
DeathEncounterNumber
int DeathEncounterNumber(
)
[line 645]
Returns encounter number in case person died during that encounter.
Tags:
- access - public
Parameters:
[ Top ]
EmailAddress
void EmailAddress(
)
[line 552]
Returns email address.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
EncounterList
mixed EncounterList(
int
$pid)
[line 728]
Gets all encounters of a person based on its pid key.
The returned adodb record object contains rows of arrays. Each array contains the encounter data with the following index keys:
- encounter_nr = the encounter number
- encounter_class_nr = encountr class number, contains 1 (inpatient) or 2 (outpatient), etc.
- is_discharged = discharge flag, contains 0 (not discharged) or 1 (discharged)
- discharge_date = date of discharge (end of encounter)
Tags:
- return - integer or boolean
- access - public
Parameters:
- int $pid - PID number
[ Top ]
EthnicOrigin
void EthnicOrigin(
)
[line 576]
Returns ethnic origin.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
FatherPID
void FatherPID(
)
[line 612]
Returns pid number of father.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
FaxNumber
void FaxNumber(
)
[line 546]
Returns fax number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
FirstCellphoneNumber
void FirstCellphoneNumber(
)
[line 534]
Returns first cellphone number. Can be used as private cellphone number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
FirstName
void FirstName(
)
[line 426]
Returns person's first name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
FirstPhoneAreaCode
void FirstPhoneAreaCode(
)
[line 510]
Returns first phone area code.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
FirstPhoneNumber
void FirstPhoneNumber(
)
[line 516]
Returns first phone number. Can be used as private phone number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
getAllInfoArray
mixed getAllInfoArray(
[int
$pid = ''])
[line 324]
Same as getAllInfoObject() but returns a 2 dimensional array.
The returned data in the array have the following index keys:
- all index keys as outlined in the $elems_array array
- citytown = name of the city or town
Tags:
- return - array or boolean
- access - public
Parameters:
- int $pid - PID number
[ Top ]
getAllInfoObject
mixed getAllInfoObject(
[int
$pid = ''])
[line 297]
Gets all person registration information based on its PID number key.
The returned adodb record object contains a row or array. This array contains data with the following index keys:
- all index keys as outlined in the $elems_array array
- addr_citytown_name = name of the city or town
Tags:
- return - adodb object or boolean
- access - public
Parameters:
- int $pid - PID number
[ Top ]
getValue
mixed getValue(
string
$item, [int
$pid = ''])
[line 354]
Gets a particular registration item based on its PID number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method. For details on field names of items that can be fetched, see the $elems_array array.
Tags:
- return - string, integer, or boolean
- access - private
Parameters:
- string $item - Field name of the item to be fetched
- int $pid - PID number
[ Top ]
getValueByList
mixed getValueByList(
string
$list, [int
$pid = ''])
[line 380]
Gets registration items based on an item list and PID number.
For details on field names of items that can be fetched, see the $elems_array array. Several items can be fetched at once but their field names must be separated by comma.
Tags:
- access - public
Parameters:
- string $list - Field names of items to be fetched separated by comma.
- int $pid - PID number
[ Top ]
InitPIDExists
boolean InitPIDExists(
int
$init_nr)
[line 188]
Checks if PID number exists in the database.
Tags:
- access - public
Parameters:
- int $init_nr - PID number
[ Top ]
insertDataFromArray
boolean insertDataFromArray(
int
&$array)
[line 235]
Inserts the data into the care_person table.
Tags:
- access - private
Overrides Core::insertDataFromArray() (Inserts data from an array (passed by reference) into a table.)
Parameters:
- int &$array - PID number
[ Top ]
insertDataFromInternalArray
boolean insertDataFromInternalArray(
)
[line 259]
Inserts the data from the internal buffer array into the care_person table.
The data must be packed in the buffer array with index keys as outlined in the $elems_array array.
Tags:
- access - public
Overrides Core::insertDataFromInternalArray() (Inserts data from the internal array previously filled with data by the setDataArray() method.)
Parameters:
[ Top ]
internResolvePID
boolean internResolvePID(
int
$pid)
[line 172]
Resolves the PID number to used in the methods.
Tags:
- access - public
Parameters:
- int $pid - PID number
[ Top ]
isValidAddress
void isValidAddress(
)
[line 492]
Returns the valid address status. Returns 1 or 0.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
LastName
void LastName(
)
[line 432]
Returns person's last or family name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
MaidenName
void MaidenName(
)
[line 456]
Returns person's maiden (unmarried) name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
MiddleName
void MiddleName(
)
[line 450]
Returns person's middle name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
MotherPID
void MotherPID(
)
[line 606]
Returns pid number of mother.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
NationalIDNumber
void NationalIDNumber(
)
[line 594]
Returns national id number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
OrgID
void OrgID(
)
[line 582]
Returns organization id.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
OtherName
void OtherName(
)
[line 462]
Returns person's other name(s).
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
Persons
mixed Persons(
[string
$searchkey = ''])
[line 753]
Searches and returns a list of persons based on search key.
The returned adodb record object contains rows of arrays. Each array contains the encounter data with the following index keys:
- pid = the PID number
- name_last = person's last or family name
- name_first = person's first or given name
- date_birth = date of birth
- sex = sex
Tags:
- return - integer or boolean
- access - public
Parameters:
- string $searchkey - Search keyword
[ Top ]
PhotoFilename
void PhotoFilename(
)
[line 570]
Returns filename of stored id photo.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
preloadPersonInfo
boolean preloadPersonInfo(
int
$pid)
[line 404]
Preloads the person registration data in the internal buffer $person.
The preload success status is stored in the $is_preloaded variable. The buffered adodb record object contains a row or array. This array contains data with index keys as outlined in the $elems_array array
Tags:
- access - public
Parameters:
- int $pid - PID number
[ Top ]
prepInsertArray
void prepInsertArray(
)
[line 201]
Prepares the internal buffer array for insertion routine.
Tags:
- access - private
Parameters:
[ Top ]
RecordHistory
void RecordHistory(
)
[line 636]
Returns table record's history.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
RecordStatus
void RecordStatus(
)
[line 630]
Returns table record's technical status.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
Religion
void Religion(
)
[line 600]
Returns religion.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
SecondCellphoneNumber
void SecondCellphoneNumber(
)
[line 540]
Returns second cellphone number.Can be used as business cellphone number
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
SecondName
void SecondName(
)
[line 438]
Returns person's second name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
SecondPhoneAreaCode
void SecondPhoneAreaCode(
)
[line 522]
Returns second phone area code.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
SecondPhoneNumber
void SecondPhoneNumber(
)
[line 528]
Returns second phone number. Can be used as business phone number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
setDeathInfo
mixed setDeathInfo(
int
$pid, array
&$data)
[line 822]
Sets death information.
The data must be passed by reference with associative array. Data array must have the following index keys.
- 'death_date' = date of death
- 'death_encounter_nr' = encounter number in case person died during that encounter
- 'death_cause' = text of death cause
- 'death_cause_code' = code of death cause (if available)
- 'history' = text to be appended to "history" item
- 'modify_id' = name of user
- 'modify_time' = time of this modification in yyyymmddhhMMss format
Tags:
- return - integer or boolean
- access - public
Parameters:
- int $pid - PID number
- array &$data - Death information.
[ Top ]
setHistorySeen
mixed setHistorySeen(
[string
$encoder = ''], [int
$pid = ''])
[line 684]
Adds a "View" note in the history field of the person's registration record.
Tags:
- return - string or boolean
- access - public
Parameters:
- string $encoder - Name of viewing person
- int $pid - PID number
[ Top ]
setPID
void setPID(
int
$pid)
[line 163]
Sets the PID number.
Tags:
- access - public
Parameters:
- int $pid - PID number
[ Top ]
Sex
void Sex(
)
[line 558]
Returns sex.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
SSSNumber
void SSSNumber(
)
[line 588]
Returns social security (system) number.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
StreetName
void StreetName(
)
[line 480]
Returns street name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
StreetNr
void StreetNr(
)
[line 474]
Returns street number. Not stricly numeric. Could be alphanumeric.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
ThirdName
void ThirdName(
)
[line 444]
Returns person's third name.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
Title
void Title(
)
[line 564]
Returns title.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]
Transact
void Transact(
)
[line 215]
Database transaction. Uses the adodb transaction method.
Tags:
- access - private
Overrides Core::Transact() (Transaction routine, ADODB transaction. It internally uses the ADODB transaction routine.)
Parameters:
[ Top ]
ZIPCode
void ZIPCode(
)
[line 486]
Returns ZIP code.
Use this preferably after the person registration data was successfully preloaded in the internal buffer with the preloadPersonInfo() method.
Tags:
- access - public
Parameters:
[ Top ]