some assorted updates
[openemr.git] / library / classes / Patient.class.php
blobaaaa92983c5c362cb0442f7df9fd390e5192cc42
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->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, DATE_FORMAT(DOB,'%m/%d/%Y') as date_of_birth from " . $this->_table ." where pid =". mysql_real_escape_string($this->id));
44 if (is_array($res)) {
45 $this->lname = $res['lname'];
46 $this->mname = $res['mname'];
47 $this->fname = $res['fname'];
48 $this->provider = new Provider($res['providerID']);
49 $this->date_of_birth = $res['date_of_birth'];
53 function get_id() {
54 return $this->id;
56 function get_lname() {
57 return $this->lname;
59 function get_name_display() {
60 return $this->fname . " " . $this->lname;
62 function get_provider_id() {
63 return $this->provider->id;
65 function get_provider() {
66 return $this->provider;
68 function get_dob () {
69 return $this->date_of_birth;
72 } // end of Patient