security fix in master branch
[openemr.git] / library / classes / Patient.class.php
blob802212a14eaa705943e1025df019bece59df55ac
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
18 var $id;
19 var $pubpid;
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 __construct($id = "")
31 $this->id = $id;
32 $this->_table = "patient_data";
33 $this->pubpid = "";
34 $this->lname = "";
35 $this->mname = "";
36 $this->fname = "";
37 $this->dob = "";
38 $this->provider = new Provider();
39 $this->populate();
41 function populate()
43 if (!empty($this->id)) {
44 $res = sqlQuery("SELECT providerID,fname,lname,mname ".
45 ", DATE_FORMAT(DOB,'%m/%d/%Y') as date_of_birth ".
46 ", pubpid ".
47 " from " . $this->_table ." where pid =". add_escape_custom($this->id));
48 if (is_array($res)) {
49 $this->pubpid = $res['pubpid'];
50 $this->lname = $res['lname'];
51 $this->mname = $res['mname'];
52 $this->fname = $res['fname'];
53 $this->provider = new Provider($res['providerID']);
54 $this->date_of_birth = $res['date_of_birth'];
58 function get_id()
60 return $this->id;
62 function get_pubpid()
64 return $this->pubpid;
66 function get_lname()
68 return $this->lname;
70 function get_name_display()
72 return $this->fname . " " . $this->lname;
74 function get_provider_id()
76 return $this->provider->id;
78 function get_provider()
80 return $this->provider;
82 function get_dob()
84 return $this->date_of_birth;
86 } // end of Patient