Class: Appointment

Source Location: /class_appointment.php

Class Overview [line 18]

Core
   |
   --Appointment

Appointment methods.

Author(s):

  • Elpidio Latorilla

Version:

  • beta 1.0.08

Copyright:

  • 2002,2003 Elpidio Latorilla

Variables

Methods


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

Appointment 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

$count =

[line 43]

Resulting record count

Type: int

Overrides:

[ Top ]

$pid =

[line 33]

Person ID

Type: int

Overrides:

[ Top ]

$result =

[line 38]

SQL query result. Resulting ADODB record object.

Type: object

Overrides: Array

[ Top ]

$tabfields = array('nr',
                           'pid',
                           'date',
                           'time',
                           'to_dept_id',
                           'to_dept_nr',
                           'to_personell_nr',
                           'to_personell_name',
                           'purpose',
                           'urgency',
                           'remind',
                           'remind_email',
                           'remind_mail',
                           'remind_phone',
                           'appt_status',
                           'cancel_by',
                           'cancel_date',
                           'cancel_reason',
                           'encounter_class_nr',
                           'encounter_nr',
                           'status',
                           'history',
                           'modify_id',
                           'modify_time',
                           'create_id',
                           'create_time')

[line 48]

Fieldnames of the care_appointment table.

Type: array

Overrides:

[ Top ]

$tb_appt = 'care_appointment'

[line 23]

Database table for the appointment data.

Type: string

Overrides:

[ Top ]

$tb_person = 'care_person'

[line 28]

Database table for the person data.

Type: string

Overrides:

[ Top ]


Class Methods

Appointment

Appointment Appointment( int $pid)

[line 79]

Constructor

Parameters:

  • int $pid - Person ID

[ Top ]

cancelAppointment

boolean cancelAppointment( [int $nr = ''], [string $reason = ''], [string $by = ''])

[line 246]

Cancels an appointment based on the primary record key "nr".

The cancel reason and name of person who made the cancellation can be passed.

Parameters:

  • int $nr - Appointment record number
  • string $reason - Reason of cancellation
  • string $by - Person who made the cancellation

[ Top ]

getAllByDateObj

mixed getAllByDateObj( [int $y = 0], [int $m = 0], [int $d = 0])

[line 189]

Gets all appointments by a given date.

Returns an adodb record object or boolean.

For example:


1 $obj->getAllByDateObj(2003,12,1);
2 while($row=$obj->FetchRow()){
3 echo $row['purpose']; # Displays the appointment purpose
4 }

Tags:

  • access - public

Parameters:

  • int $y - Year of appointment
  • int $m - Month of appointment
  • int $d - Day of appointment

[ Top ]

getAllByDeptObj

mixed getAllByDeptObj( [int $y = 0], [int $m = 0], [int $d = 0], int $nr)

[line 212]

Gets all appointments by a given date and department number.

Returns an adodb record object or boolean.

For example:


1 $dept_nr=13
2 $obj->getAllByDeptObj(2003,12,1,$dept_nr);
3 while($row=$obj->FetchRow()){
4 echo $row['purpose']; # Displays the appointment purpose
5 }

Tags:

  • access - public

Parameters:

  • int $y - Year of appointment
  • int $m - Month of appointment
  • int $d - Day of appointment
  • int $nr - Department number

[ Top ]

getAllByDocObj

mixed getAllByDocObj( [int $y = 0], [int $m = 0], [int $d = 0], string $doc)

[line 235]

Gets all appointments by a given date and doctor's name.

Returns an adodb record object or boolean.

For example:


1 $doctor='Whitbey';
2 $obj->getAllByDocObj(2003,12,1,$doctor);
3 while($row=$obj->FetchRow()){
4 echo $row['purpose']; # Displays the appointment purpose
5 }

Tags:

  • access - public

Parameters:

  • int $y - Year of appointment
  • int $m - Month of appointment
  • int $d - Day of appointment
  • string $doc - Doctor's name

[ Top ]

getAllObject

mixed getAllObject( int $pid)

[line 112]

Alias of getPersonsAppointmentObj()

Parameters:

  • int $pid - Person ID

[ Top ]

getAppointment

mixed getAppointment( int $nr)

[line 128]

Gets appointment data based on primary record key "nr".

Returns array or boolean. The returned array has index keys corresponding to fieldnames in the $tabfields array.

For example:


1 $row=$obj->getAppointment(155);
2 echo $row['purpose'];

Parameters:

  • int $nr - Record number

[ Top ]

getPersonsAppointmentsObj

mixed getPersonsAppointmentsObj( [int $pid = ''])

[line 99]

Gets person's appointment data based on his pid key.

Returns an ADODB record object or boolean. The return adodb record contains rows of associative array with index keys corresponding to fieldnames in the $tabfields array.

For example:


1 $obj->getPersonsAppointmentObj(100033344);
2 $row=$obj->FetchRow();
3 echo $row['purpose'];

Parameters:

  • int $pid - Person ID

[ Top ]

_getAll

mixed _getAll( [int $y = 0], [int $m = 0], [int $d = 0], [string $by = ''], [string $val = ''])

[line 151]

Gets a list of appointments based on a constraint type.

Constraint types are:

  • '_DEPT' = by department nr
  • '_DOC' = by doctor
  • '_PRIO' = by priority

Tags:

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

Parameters:

  • int $y - Year of appointment
  • int $m - Month of appointment
  • int $d - Day of appointment
  • string $by - Condition
  • string $val - Value of constraint.

[ Top ]


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