From ed4e81c68d953e0f7d45ba819cd600aa3103d1f5 Mon Sep 17 00:00:00 2001 From: vinish Date: Tue, 14 Feb 2012 12:01:13 +0530 Subject: [PATCH] corrected Signed-off-by: vinish --- library/Claim.class.php | 9 +++++++++ library/classes/X12Partner.class.php | 9 +++++++++ library/gen_x12_837.inc.php | 2 +- sql/4_1_0-to-4_1_1_upgrade.sql | 4 ++++ sql/database.sql | 1 + templates/x12_partners/general_edit.html | 4 ++++ version.php | 2 +- 7 files changed, 29 insertions(+), 2 deletions(-) diff --git a/library/Claim.class.php b/library/Claim.class.php index ab9121035..f3197087b 100644 --- a/library/Claim.class.php +++ b/library/Claim.class.php @@ -537,6 +537,15 @@ class Claim { return $tmp; } + function x12gs03() { + //In some clearing houses ISA08 and GS03 are different + //Example: http://www.acs-gcro.com/downloads/DOL/DOL_CG_X12N_5010_837_v1_02.pdf - Page 18 + if($this->x12_partner['x12_gs03'] !== '') + return $this->x12_partner['x12_gs03']; + else + return $this->x12gsreceiverid(); + } + function x12gsreceiverid() { $tmp = $this->x12_partner['x12_receiver_id']; while (strlen($tmp) < 15) $tmp .= " "; diff --git a/library/classes/X12Partner.class.php b/library/classes/X12Partner.class.php index 78608d515..8a584194a 100644 --- a/library/classes/X12Partner.class.php +++ b/library/classes/X12Partner.class.php @@ -22,6 +22,7 @@ class X12Partner extends ORDataObject{ var $x12_version; var $processing_format; var $processing_format_array; + var $x12_gs03; // Application Sender's Code. Default to ISA08. /** * Constructor sets all Insurance attributes to their default value @@ -171,6 +172,14 @@ class X12Partner extends ORDataObject{ function set_processing_format($string) { $this->processing_format = $string; } + + function get_x12_gs03() { + return $this->x12_gs03; + } + + function set_x12_gs03($string) { + $this->x12_gs03 = $string; + } function get_x12_isa14_array() { return array( diff --git a/library/gen_x12_837.inc.php b/library/gen_x12_837.inc.php index c01779b23..7ebc1e1b0 100644 --- a/library/gen_x12_837.inc.php +++ b/library/gen_x12_837.inc.php @@ -50,7 +50,7 @@ function gen_x12_837($pid, $encounter, &$log, $encounter_claim=false) { $out .= "GS" . "*HC" . "*" . $claim->x12gsgs02() . - "*" . trim($claim->x12gsreceiverid()) . + "*" . trim($claim->x12gs03()) . "*" . date('Ymd', $today) . "*" . date('Hi', $today) . "*1" . diff --git a/sql/4_1_0-to-4_1_1_upgrade.sql b/sql/4_1_0-to-4_1_1_upgrade.sql index 8bd73ad3f..71994e2a0 100644 --- a/sql/4_1_0-to-4_1_1_upgrade.sql +++ b/sql/4_1_0-to-4_1_1_upgrade.sql @@ -166,4 +166,8 @@ CREATE TABLE `dated_reminders_link` ( KEY `to_id` (`to_id`), KEY `dr_id` (`dr_id`) ) ENGINE=MyISAM AUTO_INCREMENT=1; +#EndIf + +#IfMissingColumn x12_partners x12_gs03 +ALTER TABLE `x12_partners` ADD COLUMN `x12_gs03` VARCHAR(15) NOT NULL DEFAULT ''; #EndIf \ No newline at end of file diff --git a/sql/database.sql b/sql/database.sql index 69e57dbe1..ffb47110b 100644 --- a/sql/database.sql +++ b/sql/database.sql @@ -4841,6 +4841,7 @@ CREATE TABLE `x12_partners` ( `x12_isa15` char(1) NOT NULL DEFAULT 'P', `x12_gs02` varchar(15) NOT NULL DEFAULT '', `x12_per06` varchar(80) NOT NULL DEFAULT '', + `x12_gs03` varchar(15) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM; diff --git a/templates/x12_partners/general_edit.html b/templates/x12_partners/general_edit.html index 0b971ce67..dee0b6af3 100644 --- a/templates/x12_partners/general_edit.html +++ b/templates/x12_partners/general_edit.html @@ -78,6 +78,10 @@ document.x12_partner.name.focus(); {xl t='Processing'} {xl t='Format'} {html_options name="processing_format" options=$partner->get_processing_format_array() selected=$partner->get_processing_format()} + + {xl t='Application Receiver Code (GS03 - If blank ISA08 will be used)'} + +   diff --git a/version.php b/version.php index 7775ba19d..fb952e722 100644 --- a/version.php +++ b/version.php @@ -17,5 +17,5 @@ $v_realpatch = '0'; // is a database change in the course of development. It is used // internally to determine when a database upgrade is needed. // -$v_database = 58; +$v_database = 59; ?> -- 2.11.4.GIT