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 **************************************************************************/
11 require_once("ORDataObject.class.php");
12 require_once("InsuranceNumbers.class.php");
17 class Provider
extends ORDataObject
{
23 var $insurance_numbers;
27 * Constructor sets all Prescription attributes to their default value
29 function Provider ($id = "", $prefix = "") {
31 $this->federal_drug_id
= "";
32 $this->_table
= "users";
33 $this->insurance_numbers
= array();
40 $res = sqlQuery("SELECT fname,lname,federaldrugid, specialty FROM users where id =". mysql_real_escape_string($this->id
));
43 $this->lname
= $res['lname'];
44 $this->fname
= $res['fname'];
45 $this->federal_drug_id
= $res['federaldrugid'];
46 $this->specialty
= $res['specialty'];
49 $ins = new InsuranceNumbers();
50 $this->insurance_numbers
= $ins->insurance_numbers_factory($this->id
);
53 function utility_provider_array() {
54 $provider_array = array();
55 $res = sqlQ("Select id,fname,lname from users where authorized = 1");
56 while ($row = mysql_fetch_array($res) ) {
57 $provider_array[$row['id']] = $row['fname'] . " " . $row['lname'];
59 return $provider_array;
62 function providers_factory($sort = "ORDER BY lname,fname") {
64 $sql = "SELECT id FROM " . $this->_table
. " where authorized = 1 " . $sort;
65 $results = sqlQ($sql);
67 while($row = mysql_fetch_array($results) ) {
68 $psa[] = new Provider($row['id']);
78 function get_name_display() {
79 return $this->fname
. " " . $this->lname
;
82 function get_specialty() {
83 return $this->specialty
;
86 function get_provider_number_default() {
87 if (!empty($this->insurance_numbers
)) {
88 return $this->insurance_numbers
[0]->get_provider_number();
92 function get_rendering_provider_number_default() {
93 if (!empty($this->insurance_numbers
)) {
94 return $this->insurance_numbers
[0]->get_rendering_provider_number();
98 function get_insurance_numbers() {
99 return $this->insurance_numbers
;
101 function get_insurance_numbers_default() {
102 return $this->insurance_numbers
[0];
105 function get_group_number_default() {
106 if (!empty($this->insurance_numbers
)) {
107 return $this->insurance_numbers
[0]->get_group_number();