From c2b3a995813667f6513adfdb7924cf596076cc87 Mon Sep 17 00:00:00 2001 From: bradymiller Date: Fri, 15 Oct 2010 07:31:20 +0000 Subject: [PATCH] Modifications for selecting EIN/SSN in facility page for the BOX No. 25 of claim form. Contributed by zhhealthcare. Signed-off-by: Jacob Paul --- interface/usergroup/facilities.php | 4 +++- interface/usergroup/facilities_add.php | 2 +- interface/usergroup/facility_admin.php | 12 +++++++++++- library/Claim.class.php | 10 ++++++++++ library/gen_hcfa_1500.inc.php | 7 ++++++- library/gen_x12_837.inc.php | 11 ++++++++--- sql/3_2_0-to-4_0_0_upgrade.sql | 4 ++++ sql/database.sql | 3 ++- version.php | 2 +- 9 files changed, 46 insertions(+), 9 deletions(-) diff --git a/interface/usergroup/facilities.php b/interface/usergroup/facilities.php index a5477f287..4190d87a7 100644 --- a/interface/usergroup/facilities.php +++ b/interface/usergroup/facilities.php @@ -24,6 +24,7 @@ if (isset($_POST["mode"]) && $_POST["mode"] == "facility" && $_POST["newmode"] ! "pos_code = '" . trim(formData('pos_code' )) . "', " . "domain_identifier = '" . trim(formData('domain_identifier' )) . "', " . "attn = '" . trim(formData('attn' )) . "', " . + "tax_id_type = '" . trim(formData('tax_id_type' )) . "', " . "facility_npi = '" . trim(formData('facility_npi')) . "'"); } @@ -46,7 +47,8 @@ if ($_POST["mode"] == "facility" && $_POST["newmode"] == "admin_facility") pos_code='" . trim(formData('pos_code')) . "', domain_identifier='" . trim(formData('domain_identifier')) . "', facility_npi='" . trim(formData('facility_npi')) . "', - attn='" . trim(formData('attn')) . "' + attn='" . trim(formData('attn')) . "' , + tax_id_type='" . trim(formData('tax_id_type')) . "' where id='" . trim(formData('fid')) . "'" ); } diff --git a/interface/usergroup/facilities_add.php b/interface/usergroup/facilities_add.php index a91b348f2..36614a920 100644 --- a/interface/usergroup/facilities_add.php +++ b/interface/usergroup/facilities_add.php @@ -134,7 +134,7 @@ $(document).ready(function(){ :   - : + : : diff --git a/interface/usergroup/facility_admin.php b/interface/usergroup/facility_admin.php index 955518b69..0a0026563 100644 --- a/interface/usergroup/facility_admin.php +++ b/interface/usergroup/facility_admin.php @@ -95,9 +95,19 @@ $(document).ready(function(){ "> : "> + : "> - : "> + : "> : "> diff --git a/library/Claim.class.php b/library/Claim.class.php index 8ba418cd3..fcc2cf0eb 100644 --- a/library/Claim.class.php +++ b/library/Claim.class.php @@ -542,6 +542,16 @@ class Claim { function billingFacilityNPI() { return x12clean(trim($this->billing_facility['facility_npi'])); } + + function federalIdType() { + if ($this->billing_facility['tax_id_type']) + { + return $this->billing_facility['tax_id_type']; + } + else{ + return null; + } + } # The billing facility and the patient must both accept for this to return true. function billingFacilityAssignment($ins=0) { diff --git a/library/gen_hcfa_1500.inc.php b/library/gen_hcfa_1500.inc.php index 972aaaa26..908fd2e4d 100644 --- a/library/gen_hcfa_1500.inc.php +++ b/library/gen_hcfa_1500.inc.php @@ -501,9 +501,14 @@ function gen_hcfa_1500_page($pid, $encounter, &$log, &$claim) { } // 25. Federal Tax ID Number - // Using the Billing Facility EIN because that's what FreeB did. + // FrreB hard coded EIN. Changed it to included SSN as well. put_hcfa(56, 1, 15, $claim->billingFacilityETIN()); + if($claim->federalIdType()=='SY'){ + put_hcfa(56, 16, 1, 'X'); // The SSN checkbox + } + else{ put_hcfa(56, 19, 1, 'X'); // The EIN checkbox + } // 26. Patient's Account No. // Instructions say hyphens are not allowed, but freeb used them. diff --git a/library/gen_x12_837.inc.php b/library/gen_x12_837.inc.php index 40cb4bd4f..f83a98a56 100644 --- a/library/gen_x12_837.inc.php +++ b/library/gen_x12_837.inc.php @@ -154,9 +154,14 @@ function gen_x12_837($pid, $encounter, &$log, $encounter_claim=false) { // Add a REF*EI* segment if NPI was specified in the NM1 above. if ($claim->billingFacilityNPI() && $claim->billingFacilityETIN()) { ++$edicount; - $out .= "REF" . - "*EI" . - "*" . $claim->billingFacilityETIN() . + $out .= "REF" ; + if($claim->federalIdType()){ + $out .= "*" . $claim->federalIdType(); + } + else{ + $out .= "*EI";//For dealing with the situation before adding selection for TaxId type In facility ie default to EIN. + } + $out .= "*" . $claim->billingFacilityETIN() . "~\n"; } diff --git a/sql/3_2_0-to-4_0_0_upgrade.sql b/sql/3_2_0-to-4_0_0_upgrade.sql index 7bc2637f9..c48134a7f 100644 --- a/sql/3_2_0-to-4_0_0_upgrade.sql +++ b/sql/3_2_0-to-4_0_0_upgrade.sql @@ -793,3 +793,7 @@ ALTER TABLE lists ALTER TABLE form_encounter ADD referral_source varchar(31) NOT NULL DEFAULT ''; #EndIf +#IfMissingColumn facility tax_id_type +ALTER TABLE facility ADD COLUMN tax_id_type VARCHAR(31) NOT NULL DEFAULT '' AFTER facility_npi; +#EndIf + diff --git a/sql/database.sql b/sql/database.sql index fb80c7538..3b0782f24 100644 --- a/sql/database.sql +++ b/sql/database.sql @@ -422,6 +422,7 @@ CREATE TABLE `facility` ( `attn` varchar(65) default NULL, `domain_identifier` varchar(60) default NULL, `facility_npi` varchar(15) default NULL, + `tax_id_type` VARCHAR(31) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=4 ; @@ -429,7 +430,7 @@ CREATE TABLE `facility` ( -- Dumping data for table `facility` -- -INSERT INTO `facility` VALUES (3, 'Your Clinic Name Here', '000-000-0000', '000-000-0000', '', '', '', '', '', '', 1, 0, 0, NULL, '', '', '', ''); +INSERT INTO `facility` VALUES (3, 'Your Clinic Name Here', '000-000-0000', '000-000-0000', '', '', '', '', '', '', 1, 0, 0, NULL, '', '', '', '', ''); -- -------------------------------------------------------- diff --git a/version.php b/version.php index ddec5cb1c..791e920e1 100644 --- a/version.php +++ b/version.php @@ -11,5 +11,5 @@ $v_tag = '-dev'; // minor revision number, should be empty for production rele // Database version identifier, this is to be incremented whenever there // is a database change in the course of development. It is used // internally to determine when a database upgrade is needed. -$v_database = 2; +$v_database = 3; ?> -- 2.11.4.GIT