2 /************************************************************************
3 prescription.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 **************************************************************************/
15 class Provider
extends ORDataObject
22 var $insurance_numbers;
25 var $state_license_number;
28 * Constructor sets all Prescription attributes to their default value
30 function __construct($id = "", $prefix = "")
33 $this->federal_drug_id
= "";
34 $this->_table
= "users";
36 $this->insurance_numbers
= array();
37 $this->state_license_number
= "";
45 $res = sqlQuery("SELECT fname,lname,federaldrugid, specialty, npi, state_license_number FROM users where id =". add_escape_custom($this->id
));
48 $this->lname
= $res['lname'];
49 $this->fname
= $res['fname'];
50 $this->federal_drug_id
= $res['federaldrugid'];
51 $this->specialty
= $res['specialty'];
52 $this->npi
= $res['npi'];
53 $this->state_license_number
= $res['state_license_number'];
56 $ins = new InsuranceNumbers();
57 $this->insurance_numbers
= $ins->insurance_numbers_factory($this->id
);
60 function utility_provider_array()
62 $provider_array = array();
63 $res = sqlQ("Select id,fname,lname from users where authorized = 1");
64 while ($row = sqlFetchArray($res)) {
65 $provider_array[$row['id']] = $row['fname'] . " " . $row['lname'];
68 return $provider_array;
71 function providers_factory($sort = "ORDER BY lname,fname")
74 $sql = "SELECT id FROM " . $this->_table
. " where authorized = 1 " . $sort;
75 $results = sqlQ($sql);
77 while ($row = sqlFetchArray($results)) {
78 $psa[] = new Provider($row['id']);
89 function get_name_display()
91 return $this->fname
. " " . $this->lname
;
94 function get_specialty()
96 return $this->specialty
;
99 function get_provider_number_default()
101 if (!empty($this->insurance_numbers
)) {
102 return $this->insurance_numbers
[0]->get_provider_number();
106 function get_rendering_provider_number_default()
108 if (!empty($this->insurance_numbers
)) {
109 return $this->insurance_numbers
[0]->get_rendering_provider_number();
113 function get_insurance_numbers()
115 return $this->insurance_numbers
;
118 function get_insurance_numbers_default()
120 return $this->insurance_numbers
[0];
123 function get_group_number_default()
125 if (!empty($this->insurance_numbers
)) {
126 return $this->insurance_numbers
[0]->get_group_number();
135 function get_state_license_number()
137 return $this->state_license_number
;