add feature to see appointment by clicking on its time
[openemr.git] / library / classes / Patient.class.php
blob5d7e8ee789e717b01bd239dd7cb745df1ac33bc2
1 <?php
2 /************************************************************************
3 aptient.php - Copyright duhlman
5 /usr/share/apps/umbrello/headings/heading.php
7 This file was generated on %date% at %time%
8 The original location of this file is /home/duhlman/uml-generated-code/prescription.php
9 **************************************************************************/
11 require_once("ORDataObject.class.php");
12 require_once("Provider.class.php");
13 /**
14 * class Patient
18 class Patient extends ORDataObject{
19 var $id;
20 var $lname;
21 var $mname;
22 var $fname;
23 var $date_of_birth;
24 var $provider;
26 /**
27 * Constructor sets all Prescription attributes to their default value
29 function Patient($id = "") {
30 $this->id = $id;
31 $this->_table = "patient_data";
32 $this->lname = "";
33 $this->mname = "";
34 $this->fname = "";
35 $this->provider = new Provider();
36 $this->populate();
40 function populate() {
41 if (!empty($this->id)) {
42 $res = sqlQuery("SELECT providerID,fname,lname,mname, DATE_FORMAT(DOB,'%m/%d/%Y') as date_of_birth from " . $this->_table ." where pid =". mysql_real_escape_string($this->id));
43 if (is_array($res)) {
44 $this->lname = $res['lname'];
45 $this->mname = $res['mname'];
46 $this->fname = $res['fname'];
47 $this->provider = new Provider($res['providerID']);
48 $this->date_of_birth = $res['date_of_birth'];
52 function get_id() {
53 return $this->id;
55 function get_lname() {
56 return $this->lname;
58 function get_name_display() {
59 return $this->fname . " " . $this->lname;
61 function get_provider_id() {
62 return $this->provider->id;
64 function get_provider() {
65 return $this->provider;
68 } // end of Patient