Class: Lab

Source Location: /class_lab.php

Class Overview [line 16]

Core
   |
   --Notes
      |
      --Encounter
         |
         --Lab

Laboratory methods.

Author(s):

  • Elpidio Latorilla

Version:

  • beta 1.0.08

Copyright:

  • 2002,2003,2004 Elpidio Latorilla

Variables

Methods


Inherited Methods

Class: Encounter

Encounter::Encounter()
Constructor
Encounter::AdmitInWard()
Admits a patient in ward with a ward number, room number and bed number.
Encounter::AllAttDrServiceClassesObject()
Gets all service classes of 'att_dr' class.
Encounter::AllCareServiceClassesObject()
Gets all service classes of 'care' class.
Encounter::AllEncounterClassesObject()
Gets all info of all encounter classes.
Encounter::AllRoomServiceClassesObject()
Gets all service classes of 'room' class.
Encounter::allSicknessConfirm()
Gets all stored sickness confirmations of an encounter based on its department and encounter numbers.
Encounter::AllStatus()
Returns the status information and current locations of an encounter.
Encounter::assignInBed()
Saves the encounter's room location.
Encounter::assignInDept()
Saves the encounter's room location.
Encounter::assignInRoom()
Saves the encounter's room location.
Encounter::assignInWard()
Saves the encounter's ward location.
Encounter::AttDrServiceClass()
Gets the attending physician service class information of an encounter based on encounter number.
Encounter::BillingClass()
Alias of FinancialClass()
Encounter::BirthDate()
Returns date of birth in yyyy-mm-format.
Encounter::Cancel()
Cancels an encounter, but only when its encounter_status is set to '' (emtpy) or 'allow_cancel'.
Encounter::CareServiceClass()
Gets the Nursing care service class information of an encounter based on encounter number.
Encounter::ConsultingDr()
Returns consulting physician's name.
Encounter::createWaitingOutpatientList()
createWaitingOutpatientList() creates a list of outpatients waiting to be admitted in the clinic
Encounter::CurrentAttDrNr()
Returns current attending physician number.
Encounter::CurrentDeptNr()
Returns current department number.
Encounter::CurrentFirmNr()
Returns current firm number.
Encounter::CurrentRoomNr()
Returns current room number.
Encounter::CurrentWardNr()
Returns current ward number.
Encounter::Discharge()
Complete discharge of patient from the hospital or clinic.
Encounter::DischargeFromBed()
Complete discharge of patient from the bed but patient remains in room.
Encounter::DischargeFromDept()
Complete discharge of patient from the department, but patient remains admitted.
Encounter::DischargeFromRoom()
Complete discharge of patient from the room but patient remains in ward.
Encounter::DischargeFromWard()
Complete discharge of patient from the ward but patient remains admitted.
Encounter::EncounterClass()
Returns encounter or admission class.
Encounter::EncounterDate()
Returns date of admission.
Encounter::EncounterExists()
Checks if the encounter exists in the database based on the encounter number key.
Encounter::EncounterInsuranceData()
Returns the insurance relevant data of an encounter.
Encounter::EncounterStatus()
Returns encounter status.
Encounter::EncounterType()
Returns encounter type. Currently reserved.
Encounter::FinancialClass()
Returns financial class.
Encounter::FirstName()
Returns first or given name.
Encounter::FollowUpDate()
Returns follow-up date in yyyy-mm-dd format.
Encounter::FollowUpResponsibility()
Returns the name of physician or service responsible for follow-up.
Encounter::getAllServiceClassesObject()
Gets all service classes of a given class.
Encounter::getBasic4Data()
Gets an adodb object containing the "very basic" encounter's first name, family name, birth date and sex.
Encounter::getDischargeTypesData()
Gets the discharge types.
Encounter::getEncounterClassInfo()
Gets the encounter class' information based on its class_nr key.
Encounter::getInsuranceClassInfo()
Gets the insurance class' information based on its class_nr key.
Encounter::getLoadedEncounterData()
Returns the contents of the internal encounter data buffer $encounter
Encounter::getNewEncounterNr()
Gets a new encounter number.
Encounter::getServiceClass()
Gets the service class information of an encounter based on service type and encounter number.
Encounter::getSicknessConfirm()
Gets a stored sickness confirmation of an encounter.
Encounter::InBed()
Checks if the encounter has been finally assigned a bed.
Encounter::InDept()
Checks if the encounter (outpatient) is finally admitted to a department (or clinic).
Encounter::InRoom()
Checks if the encounter has been finally assigned a room.
Encounter::InsuranceFirmID()
Returns insurance company's id used in the encounter.
Encounter::InsuranceNr()
Returns insurance number used in the encounter.
Encounter::internResolveEncounterNr()
Resolves the encounter number internally.
Encounter::InWard()
Checks if the encounter is finally admitted in a ward.
Encounter::In_Dept()
Returns status flag if patient is finally admitted in department.
Encounter::In_Ward()
Returns status flag if patient is finally admitted in ward.
Encounter::isCurrentlyAdmitted()
Checks if an encounter number is currently admitted (both inpatient & outpatient).
Encounter::isENCCurrentlyAdmitted()
Checks if a given encounter number is currently admitted.
Encounter::isPIDCurrentlyAdmitted()
Checks if the person's is currently admitted based on his PID number.
Encounter::Is_Discharged()
Returns status flag if patient is finally discharged.
Encounter::LastName()
Returns last or family name.
Encounter::loadEncounterData()
Loads the encounter data including some data from the registration into an internal buffer array $encounter.
Encounter::markAppointmentDone()
Marks an appointment's status as "done" and links the encounter number resulting from the appointment.
Encounter::OutPatientsBasic()
Gets basic information of all outpatients.
Encounter::PhotoFilename()
Returns filename of the person's picture id.
Encounter::PID()
Returns PID number.
Encounter::PostEncounterNotes()
Returns post encounter notes. Short notes after discharge, not to be used for discharge summary report.
Encounter::RecordCreatorID()
Returns record's creator id or name. Technical.
Encounter::RecordHistory()
Returns record entry's history. This is the techical history of the record entry, not of the admission.
Encounter::RecordModifierID()
Returns record's modifier id or name. Technical.
Encounter::RecordStatus()
Returns the record entry's status. This status is technical and has nothing to do with the encounter status.
Encounter::Referer()
Returns referer's name.
Encounter::RefererDept()
Returns refererring department.
Encounter::RefererDiagnosis()
Returns referer's diagnosis text.
Encounter::RefererInstitution()
Returns referring institution.
Encounter::RefererNotes()
Returns referer's extra notes text.
Encounter::RefererRecomTherapy()
Returns referer's recommended therapy text.
Encounter::ReplaceWard()
Replaces the current ward number and resets the in_ward flag to 0: status is "not in ward".
Encounter::ResetAllCurrentPlaces()
Resets encounter's current locations to 0.
Encounter::resetCurrentDept()
Resets encounter's current department number to 0.
Encounter::resetCurrentWard()
Resets encounter's current ward number to 0.
Encounter::RoomServiceClass()
Gets the room service class information of an encounter based on encounter number.
Encounter::saveAttDrServiceClass()
Saves the attending service class information of an encounter based on service type and encounter number.
Encounter::saveCareServiceClass()
Saves the nursing care service class information of an encounter based on service type and encounter number.
Encounter::saveDischargeNotesFromArray()
Saves discharge notes of an encounter.
Encounter::saveRoomServiceClass()
Saves the room service class information of an encounter based on service type and encounter number.
Encounter::saveServiceClass()
Saves the service class information of an encounter based on service type and encounter number.
Encounter::saveSicknessConfirm()
Saves a sickness confirmation of an encounter.
Encounter::searchEncounterBasicInfo()
Search returning the basic admission information as outlined at _searchAdmissionBasicInfo().
Encounter::searchInpatientBasicInfo()
Searches and returns inpatient admissions based on a supplied keyword.
Encounter::searchInpatientNotInWardBasicInfo()
Search for inpatients who are not yet finally admittd in ward, returning basic information as outlined at _searchAdmissionBasicInfo().
Encounter::searchLimitEncounterBasicInfo()
Limited results search returning basic information as outlined at _searchAdmissionBasicInfo().
Encounter::searchOutpatientBasicInfo()
Searches and returns inpatient admissions based on a supplied keyword.
Encounter::setAdmittedInWard()
Sets encounter's two status to "In ward" and "disallow cancel". Sets the current ward number and current room number.
Encounter::setCoreTable()
Sets core's table name variable to a table name
Encounter::setCurrentAttdDr()
Sets encounter's current attending physician number.
Encounter::setCurrentDept()
Sets encounter's current department number.
Encounter::setCurrentDeptInDept()
Sets encounter's current department number and sets the "currently in department" status of the encounter..
Encounter::setCurrentFirm()
Sets encounter's current firm number.
Encounter::setCurrentRoom()
Sets encounter's current room number.
Encounter::setCurrentWard()
Sets encounter's current ward number.
Encounter::setCurrentWardInWard()
Sets encounter's current ward number and set the "currently in ward" status of the encounter.
Encounter::setEncoder()
Sets internal encoder buffer to current encoder's name
Encounter::setEncounterNr()
Sets internal encounter number buffer to current encounter number
Encounter::setGetEntireRecord()
Sets internal entire record flag to current record status
Encounter::setHistorySeen()
Adds a "View" note to the record's history data.
Encounter::setIgnoreStatus()
Sets internal ignore status flag to current ignore status
Encounter::setInDept()
Sets encounter's current "department" status to "In department". Sets the encounter to "disallow cancel".
Encounter::setInWard()
Sets encounter's current "ward" status to "In ward". Sets the encounter to "disallow cancel".
Encounter::setIsDischarged()
Sets the discharge status that the encounter/admission is fully discharged.
Encounter::setNotInDept()
Resets encounter's current "department" status to "not in department".
Encounter::setNotInWard()
Resets encounter's current "ward" status to "not in ward".
Encounter::setSingleResult()
Sets internal single result flag to current single result status
Encounter::updateAttDrServiceClass()
Updates the room service class information of an encounter based on service type and record's primary key number.
Encounter::updateCareServiceClass()
Updates the nursing care service class information of an encounter based on service type and record's primary key number.
Encounter::updateEncounterFromInternalArray()
Updates the encounter record with data from the internal buffer array.
Encounter::updateRoomServiceClass()
Updates the room service class information of an encounter based on service type and record's primary key number.
Encounter::updateServiceClass()
Update the service class information of an encounter based on service type record's primary key number.
Encounter::useSicknessConfirm()
Points the core to the care_encounter_sickconfirm table and fields
Encounter::_discharge()
Complete discharge or encounter.
Encounter::_InLocation()
Checks if the encounter is in a location based on the location's type number.
Encounter::_searchAdmissionBasicInfo()
Private search function, usually called by another method.
Encounter::_setCurrentAssignment()
Updates location assignment items. Generic method for setting location assigment information.
Encounter::_setLocation()
Saves the encounter location with a given location type, location group and location number.

Class: Notes

Notes::Notes()
Constructor
Notes::getAllTypes()
Gets all types of notes record. Unsorted result.
Notes::getAllTypesSort()
Gets all types of notes record. Sorted result.
Notes::getEncounterNotes()
Gets all notes of a given record number.
Notes::getType()
Gets notes type information based on the type number (nr key).
Notes::_Exists()
Checks if a certain notes record of a certain type exists in the database.
Notes::_getNotes()
Gets a notes record data based on a passed condition.
Notes::_getNotesDateRange()
Gets the date range of a certain notes type that fits to a given condition.
Notes::_insertNotesFromInternalArray()
Save a notes data of a given type number.
Notes::_updateNotesFromInternalArray()
Updates a notes data record based on the primary record key "nr".

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

Laboratory methods.

Note this class should be instantiated only after a "$db" adodb connector object has been established by an adodb instance

Tags:

[ Top ]


Class Variables

$en_prepend =

[line 36]

Prepend characters for english

Type: string

Overrides:

[ Top ]

$fld_find_chemlab = array(
            'batch_nr',
            'encounter_nr',
            'test_date',
            'test_time',
            'lab_notes',
            'job_id',
            'group_id',
            'serial_value',
            'validator',
            'validate_dt',
            'status',
            'history',
            'modify_id',
            'modify_time',
            'create_id',
            'create_time')

[line 51]

Field names for care_test_findings_chemlab table

Type: array

Overrides:

[ Top ]

$fld_test_param = array(
            'nr',
            'group_id',
            'name',
            'id',
            'msr_unit',
            'median',
            'hi_bound',
            'lo_bound',
            'hi_critical',
            'lo_critical',
            'hi_toxic',
            'lo_toxic',
            'status',
            'history',
            'modify_id',
            'modify_time',
            'create_id',
            'create_time')

[line 72]

Field names for care_test_param table

Type: array

Overrides:

[ Top ]

$tb_find_chemlab = 'care_test_findings_chemlab'

[line 21]

Table name for test findings for chemical lab

Type: string

Overrides:

[ Top ]

$tb_test_group = 'care_test_group'

[line 31]

Table name for test groups

Type: string

Overrides:

[ Top ]

$tb_test_param = 'care_test_param'

[line 26]

Table name for test paramaters

Type: string

Overrides:

[ Top ]

$tgroups =

[line 46]

Test groups

Type: string

Overrides:

[ Top ]

$tparams =

[line 41]

Test parameters

Type: string

Overrides:

[ Top ]


Class Methods

Lab

Lab Lab( [int $enc_nr = ''])

[line 95]

Constructor

Parameters:

  • int $enc_nr - Encounter number

[ Top ]

BatchNr

mixed BatchNr( int $enc_nr, int $job_id, int $grp_id)

[line 134]

Gets the batch number of a given encounter number and job id.

Tags:

  • return - integer or boolean
  • access - public

Parameters:

  • int $enc_nr - Encounter number
  • int $job_id - Job (test request) id
  • int $grp_id - Test group id

[ Top ]

createResultsList

mixed createResultsList( int $enc_nr)

[line 115]

Searches for existing laboratory reports for an encounter.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $enc_nr - Encounter number

[ Top ]

getAllResults

mixed getAllResults( [int $enc_nr = ''])

[line 217]

Gets all test result records for an encounter.

The returned adodb record object contains row of array. The array contains the test result data with index keys as outlined in the $fld_find_chemlab array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $enc_nr - Encounter number

[ Top ]

getBatchResult

mixed getBatchResult( int $bn)

[line 178]

Gets the test result data basing on the batch number key.

The returned adodb record object contains row of array. The array contains the test result data with index keys as outlined in the $fld_find_chemlab array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $bn - Batch number

[ Top ]

getLastModifyTime

mixed getLastModifyTime( [int $enc_nr = 0])

[line 386]

Gets the latest modify_time information of an encounter's laboratory result.

Tags:

  • return - integer or boolean
  • access - public

Parameters:

  • int $enc_nr - Encounter number

[ Top ]

getResult

mixed getResult( int $job_id, int $grp_id, [int $enc_nr = ''])

[line 198]

Gets the test result data basing on encounter number, job id, and test group id keys.

The returned adodb record object contains row of array. The array contains the test result data with index keys as outlined in the $fld_find_chemlab array.

Tags:

  • return - adodb record object or boolean
  • access - public

Overrides Core::getResult() (Feturns the value of result)

Parameters:

  • int $job_id - Job (test request) id
  • int $grp_id - Test group id
  • int $enc_nr - Encounter number

[ Top ]

getTestParam

mixed getTestParam( [int $nr = 0], [string $id = ''])

[line 291]

Gets all information of a test parameter.

The param $nr takes precedence. If it is not empty it will be used to find the test parameter. If the $id is needed, set $nr to empty character.

The returned adodb record object contains rows of arrays. Each array contain the test data with index keys as outlined in the $fld_test_param array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $nr - Key number
  • string $id - Key id

[ Top ]

hideResultIfExists

boolean hideResultIfExists( int $enc_nr, int $job_id, int $grp_id)

[line 163]

Hides the test result if it exists.

Parameters:

  • int $enc_nr - Encounter number
  • int $job_id - Job (test request) id
  • int $grp_id - Test group id

[ Top ]

JobIDExists

boolean JobIDExists( int $enc_nr, int $job_id, int $grp_id)

[line 151]

Checks if the job id is existing.

Parameters:

  • int $enc_nr - Encounter number
  • int $job_id - Job (test request) id
  • int $grp_id - Test group id

[ Top ]

ResultExists

boolean ResultExists( [int $enc_nr = ''])

[line 267]

Check if at least one laboratory result exists for the encounter.

Tags:

  • access - public

Parameters:

  • int $enc_nr - Encounter number

[ Top ]

searchEncounterLabResults

mixed searchEncounterLabResults( [string $key = ''], [string $add_opt = ''], [boolean $limit = FALSE], [int $len = 30], [int $so = 0])

[line 327]

Searches for encounters with existing laboratory results.

The returned adodb record object contains rows of arrays. Each array contains the encounter data with the following index keys:

  • encounter_nr = encounter number
  • encounter_class_nr = encounter class number e.g. 1 = inpatient, 2 = outpatient
  • pid = 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 - adodb record object or boolean
  • access - public

Parameters:

  • string $key - Search keyword
  • string $add_opt - Optional query append e.g sort directive
  • boolean $limit - Flags if search return is limited or not. Defaults to FALSE = unlimited return.
  • int $len - Maximum number or rows returned in case of limited return search. Defaults to 30 rows.
  • int $so - Start index of rows to be returned. Defaults to 0 = begin of rows block.

[ Top ]

searchLimitEncounterLabResults

mixed searchLimitEncounterLabResults( string $key, int $len, int $so, [string $sortitem = ''], [string $order = 'ASC'])

[line 372]

Searches for encounters with existing lab results.

Similar to searchEncounterLabResults() but returns a limited number of rows. For details of the returned data structure see the searchEncounterLabResults() method.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • string $key - Search keyword
  • int $len - Maximum number or rows returned in case of limited return search. Defaults to 30 rows.
  • int $so - Start index of rows to be returned. Defaults to 0 = begin of rows block.
  • string $sortitem - Field name for sorting. Defaults to empty = unsorted result.
  • string $order - Sort direction. Defaults to ascending order.

[ Top ]

TestGroups

mixed TestGroups( )

[line 252]

Returns all test groups.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

[ Top ]

TestParams

mixed TestParams( [int $group_id = ''])

[line 236]

Returns all test parameters belonging to a test group.

The returned adodb record object contains rows of arrays. Each array contains the test result data with index keys as outlined in the $fld_test_param array.

Tags:

  • return - adodb record object or boolean
  • access - public

Parameters:

  • int $group_id - Test group id

[ Top ]

useTestParams

void useTestParams( )

[line 105]

Sets the core table name and field names to the care_test_param table.

Tags:

  • access - public

Parameters:

[ Top ]


Documentation generated on Sun, 16 Nov 2003 01:02:48 +0100 by phpDocumentor 1.2.3