3 define ("CLAIM_TARGET_TXT",1);
4 define ("CLAIM_TARGET_PDF",2);
5 define ("CLAIM_FORMAT_X12",1);
6 define ("CLAIM_TARGET_HCFA",2);
8 require_once("ORDataObject.class.php");
13 class Claim
extends ORDataObject
{
23 * Constructor sets all Company attributes to their default value
25 function claim($id = "") {
27 $this->billing_key
= md5($GLOBALS['billing_key_salt'] . rand() . time());
28 $this->target
= CLAIM_TARGET_TXT
;
29 $this->target
= CLAIM_FORMAT_X12
;
30 $this->date
= date("Y-m-d h:m");
31 $this->procedures
= new array();
32 $this->_table
= "claims";
39 function factory_company($foreign_id = "") {
40 if (empty($foreign_id)) {
41 $foreign_id= "like '%'";
44 $foreign_id= " = '" . mysql_real_escape_string(strval($foreign_id)) . "'";
47 $sql = "SELECT id FROM " . $a->_table
. " WHERE foreign_id " .$foreign_id ;
48 //echo $sql . "<bR />";
49 $results = sqlQ($sql);
51 $row = mysql_fetch_array($results);
53 $a = new Address($row['id']);
59 function toString($html = false) {
61 . "ID: " . $this->id
."\n"
62 . "FID: " . $this->foreign_id
."\n"
65 .$this->city
. ", " . strtoupper($this->state
) . " " . $this->zip
. "-" . $this->plus_four
. "\n"
66 .$this->country
. "\n";
69 return nl2br($string);
76 function set_id($id) {
82 function set_name($name) {
88 function set_foreign_id($fid) {
89 $this->foreign_id
= $fid;
91 function get_foreign_id() {
92 return $this->foreign_id
;
94 function set_line1($line1) {
95 $this->line1
= $line1;
97 function get_line1() {
100 function set_line2($line2) {
101 $this->line2
= $line2;
103 function get_line2() {
106 function set_city($city) {
109 function get_city() {
112 function set_state($state) {
113 $this->state
= $state;
115 function get_state() {
118 function set_zip($zip) {
124 function set_plus_four($plus_four) {
125 $this->plus_four
= $plus_four;
127 function get_plus_four() {
128 return $this->plus_four
;
130 function set_country($country) {
131 $this->country
= $country;
133 function get_country() {
134 return $this->country
;
136 function persist($fid ="") {
138 $this->foreign_id
= $fid;