added datepicker to immunization gui
[openemr.git] / library / classes / Patient.class.php
blob0fb126731ae38cfc34c7f647d416dd4454018a80
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 /**
12 * class Patient
16 class Patient extends ORDataObject{
17 var $id;
18 var $pubpid;
19 var $lname;
20 var $mname;
21 var $fname;
22 var $date_of_birth;
23 var $provider;
25 /**
26 * Constructor sets all Prescription attributes to their default value
28 function __construct($id = "") {
29 $this->id = $id;
30 $this->_table = "patient_data";
31 $this->pubpid = "";
32 $this->lname = "";
33 $this->mname = "";
34 $this->fname = "";
35 $this->dob = "";
36 $this->provider = new Provider();
37 $this->populate();
41 function populate() {
42 if (!empty($this->id)) {
43 $res = sqlQuery("SELECT providerID,fname,lname,mname ".
44 ", DATE_FORMAT(DOB,'%m/%d/%Y') as date_of_birth ".
45 ", pubpid ".
46 " from " . $this->_table ." where pid =". add_escape_custom($this->id));
47 if (is_array($res)) {
48 $this->pubpid = $res['pubpid'];
49 $this->lname = $res['lname'];
50 $this->mname = $res['mname'];
51 $this->fname = $res['fname'];
52 $this->provider = new Provider($res['providerID']);
53 $this->date_of_birth = $res['date_of_birth'];
57 function get_id() { return $this->id; }
58 function get_pubpid() { return $this->pubpid; }
59 function get_lname() { return $this->lname; }
60 function get_name_display() { return $this->fname . " " . $this->lname; }
61 function get_provider_id() { return $this->provider->id; }
62 function get_provider() { return $this->provider; }
63 function get_dob () { return $this->date_of_birth; }
65 } // end of Patient