8 class X12Partner
extends ORDataObject
{
17 var $x12_isa05; // Sender Interchange ID Qualifier. ZZ = mutually defined, 01 = Duns, etc.
18 var $x12_sender_id; // ISA06
19 var $x12_isa07; // Receiver Interchange ID Qualifier.
20 var $x12_receiver_id; // ISA08
21 var $x12_isa14; // Acknowledgment Requested. 0 = No, 1 = Yes.
22 var $x12_isa15; // Usage Indicator. T = testing, P = production.
23 var $x12_gs02; // Application Sender's Code. Default to ISA06.
24 var $x12_per06; // The submitter's EDI Access Number, if any.
26 var $processing_format;
27 var $processing_format_array;
28 var $x12_gs03; // Application Sender's Code. If this isn't set then we will use the $x12_receiver_id(ISA08).
31 * Constructor sets all Insurance attributes to their default value
34 function __construct ($id = "", $prefix = "") {
35 parent
::__construct();
37 $this->_table
= "x12_partners";
38 $this->processing_format_array
= $this->_load_enum("processing_format",false);
39 $this->processing_format
= $this->processing_format_array
[0];
40 //most recent x12 version mandated by HIPAA and CMS
41 // $this->x12_version = "004010X098A1";
42 $this->x12_version
= "005010X222A1";
43 $this->x12_isa05
= "ZZ";
44 $this->x12_isa07
= "ZZ";
45 $this->x12_isa14
= "0";
51 function x12_partner_factory() {
53 $x = new X12Partner();
54 $sql = "SELECT id FROM " . $x->_table
. " order by name";
55 $result = $x->_db
->Execute($sql);
56 while($result && !$result->EOF
) {
57 $partners[] = new X12Partner($result->fields
['id']);
67 function set_id($id) {
68 if (is_numeric($id)) {
77 function set_name($string) {
78 $this->name
= $string;
81 function get_id_number() {
82 return $this->id_number
;
85 function set_id_number($string) {
86 $this->id_number
= $string;
89 function get_x12_sender_id() {
90 return $this->x12_sender_id
;
93 function set_x12_sender_id($string) {
94 $this->x12_sender_id
= $string;
97 function get_x12_receiver_id() {
98 return $this->x12_receiver_id
;
101 function set_x12_receiver_id($string) {
102 $this->x12_receiver_id
= $string;
105 function get_x12_version() {
106 return $this->x12_version
;
109 function set_x12_version($string) {
110 $this->x12_version
= $string;
113 function get_x12_isa01() {
114 return $this->x12_isa01
;
117 function set_x12_isa01($string) {
118 $this->x12_isa01
= $string;
121 function get_x12_isa02() {
122 return $this->x12_isa02
;
125 function set_x12_isa02($string) {
126 $this->x12_isa02
= $string;
129 function get_x12_isa03() {
130 return $this->x12_isa03
;
133 function set_x12_isa03($string) {
134 $this->x12_isa03
= $string;
137 function get_x12_isa04() {
138 return $this->x12_isa04
;
141 function set_x12_isa04($string) {
142 $this->x12_isa04
= $string;
145 function get_x12_isa05() {
146 return $this->x12_isa05
;
149 function set_x12_isa05($string) {
150 $this->x12_isa05
= $string;
153 function get_x12_isa07() {
154 return $this->x12_isa07
;
157 function set_x12_isa07($string) {
158 $this->x12_isa07
= $string;
161 function get_x12_isa14() {
162 return $this->x12_isa14
;
165 function set_x12_isa14($string) {
166 $this->x12_isa14
= $string;
169 function get_x12_isa15() {
170 return $this->x12_isa15
;
173 function set_x12_isa15($string) {
174 $this->x12_isa15
= $string;
177 function get_x12_gs02() {
178 return $this->x12_gs02
;
181 function set_x12_gs02($string) {
182 $this->x12_gs02
= $string;
185 function get_x12_per06() {
186 return $this->x12_per06
;
189 function set_x12_per06($string) {
190 $this->x12_per06
= $string;
193 function get_processing_format() {
194 //this is enum so it can be string or int
195 if (!is_numeric($this->processing_format
)) {
196 $ta = $this->processing_format_array
;
197 return $ta[$this->processing_format
];
199 return $this->processing_format
;
202 function get_processing_format_array() {
203 //flip it because normally it is an id to name lookup, for templates it needs to be a name to id lookup
204 return array_flip($this->processing_format_array
);
207 function set_processing_format($string) {
208 $this->processing_format
= $string;
211 function get_x12_gs03() {
212 return $this->x12_gs03
;
215 function set_x12_gs03($string) {
216 $this->x12_gs03
= $string;
219 function get_x12_isa14_array() {
226 function get_x12_isa15_array() {
233 function get_idqual_array() {
235 '01' => 'Duns (Dun & Bradstreet)',
236 '14' => 'Duns Plus Suffix',
237 '20' => 'Health Industry Number (HIN)',
238 '27' => 'Carrier ID from HCFA',
239 '28' => 'Fiscal Intermediary ID from HCFA',
240 '29' => 'Medicare ID from HCFA',
241 '30' => 'U.S. Federal Tax ID Number',
242 '33' => 'NAIC Company Code',
243 'ZZ' => 'Mutually Defined',
247 function get_x12_version_array() {
249 '005010X222A1' => '005010X222A1',
250 '004010X098A1' => '004010X098A1',