add insert value to google_signin_email column in users table (#7472)
[openemr.git] / library / classes / Patient.class.php
blob3e86ae72ba456d1cdda0e66343feefe2875dd49d
1 <?php
3 /************************************************************************
4 aptient.php - Copyright duhlman
6 /usr/share/apps/umbrello/headings/heading.php
8 This file was generated on %date% at %time%
9 The original location of this file is /home/duhlman/uml-generated-code/prescription.php
10 **************************************************************************/
12 /**
13 * class Patient
17 use OpenEMR\Common\ORDataObject\ORDataObject;
19 class Patient extends ORDataObject
21 var $id;
22 var $pubpid;
23 var $lname;
24 var $mname;
25 var $fname;
26 var $date_of_birth;
27 var $dob;
28 var $provider;
30 /**
31 * Constructor sets all Prescription attributes to their default value
33 function __construct($id = "")
35 $this->id = $id;
36 $this->_table = "patient_data";
37 $this->pubpid = "";
38 $this->lname = "";
39 $this->mname = "";
40 $this->fname = "";
41 $this->dob = "";
42 $this->provider = new Provider();
43 $this->populate();
45 function populate()
47 if (!empty($this->id)) {
48 $res = sqlQuery("SELECT providerID , fname , lname , mname, " .
49 "DATE_FORMAT(DOB,'%m/%d/%Y') as date_of_birth, " .
50 "pubpid " .
51 "FROM " . escape_table_name($this->_table) . " " .
52 "WHERE pid = ?", [$this->id]);
53 if (is_array($res)) {
54 $this->pubpid = $res['pubpid'];
55 $this->lname = $res['lname'];
56 $this->mname = $res['mname'];
57 $this->fname = $res['fname'];
58 $this->provider = new Provider($res['providerID']);
59 $this->date_of_birth = $res['date_of_birth'];
63 function get_id()
65 return $this->id;
67 function get_pubpid()
69 return $this->pubpid;
71 function get_lname()
73 return $this->lname;
75 function get_name_display()
77 return $this->fname . " " . $this->lname;
79 function get_provider_id()
81 return $this->provider->id;
83 function get_provider()
85 return $this->provider;
87 function get_dob()
89 return $this->date_of_birth;
91 } // end of Patient