2 require_once("ORDataObject.class.php");
9 class X12Partner
extends ORDataObject
{
17 var $processing_format;
18 var $processing_format_array;
21 * Constructor sets all Insurance attributes to their default value
24 function X12Partner ($id = "", $prefix = "") {
25 parent
::ORDataObject();
27 $this->_table
= "x12_partners";
28 $this->processing_format_array
= $this->_load_enum("processing_format",false);
29 $this->processing_format
= $this->processing_format_array
[0];
30 //most recent x12 version mandated by HIPAA and CMS
31 $this->x12_version
= "004010X098A1";
37 function x12_partner_factory() {
39 $x = new X12Partner();
40 $sql = "SELECT id FROM " . $x->_table
. " order by name";
41 $result = $x->_db
->Execute($sql);
42 while($result && !$result->EOF
) {
43 $partners[] = new X12Partner($result->fields
['id']);
53 function set_id($id) {
54 if (is_numeric($id)) {
63 function set_name($string) {
64 $this->name
= $string;
67 function get_id_number() {
68 return $this->id_number
;
71 function set_id_number($string) {
72 $this->id_number
= $string;
75 function get_x12_sender_id() {
76 return $this->x12_sender_id
;
79 function set_x12_sender_id($string) {
80 $this->x12_sender_id
= $string;
83 function get_x12_receiver_id() {
84 return $this->x12_receiver_id
;
87 function set_x12_receiver_id($string) {
88 $this->x12_receiver_id
= $string;
91 function get_x12_version() {
92 return $this->x12_version
;
95 function set_x12_version($string) {
96 $this->x12_version
= $string;
99 function get_processing_format() {
100 //this is enum so it can be string or int
101 if (!is_numeric($this->processing_format
)) {
102 $ta = $this->processing_format_array
;
103 return $ta[$this->processing_format
];
105 return $this->processing_format
;
108 function get_processing_format_array() {
109 //flip it because normally it is an id to name lookup, for templates it needs to be a name to id lookup
110 return array_flip($this->processing_format_array
);
113 function set_processing_format($string) {
114 $this->processing_format
= $string;