fixed typo in security checks for prescription access
[openemr.git] / library / classes / X12Partner.class.php
blob03dd65d53a4e8c909c4018d6eab354fdfd7975e4
1 <?php
2 require_once("ORDataObject.class.php");
4 /**
5 * class X12Partner
7 */
9 class X12Partner extends ORDataObject{
11 var $id;
12 var $name;
13 var $id_number;
14 var $x12_sender_id;
15 var $x12_receiver_id;
16 var $x12_version;
17 var $processing_format;
18 var $processing_format_array;
20 /**
21 * Constructor sets all Insurance attributes to their default value
24 function X12Partner ($id = "", $prefix = "") {
25 parent::ORDataObject();
26 $this->id = $id;
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";
32 if ($id != "") {
33 $this->populate();
37 function x12_partner_factory() {
38 $partners = array();
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']);
44 $result->MoveNext();
46 return $partners;
49 function get_id() {
50 return $this->id;
53 function set_id($id) {
54 if (is_numeric($id)) {
55 $this->id = $id;
59 function get_name() {
60 return $this->name;
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;