3 * Inc file for the 270 / 271 creation and uploading
5 * This program creates the segments for the x12 270 eligibility file
6 * It also allows the reading and storing of the x12 271 file
8 * Copyright (C) 2016 Terry Hill <terry@lillysystems.com>
9 * Copyright (C) 2010 MMF Systems, Inc
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see http://opensource.org/licenses/gpl-license.php.
23 * @author Terry Hill <terry@lilysystems.com>
24 * @link http://www.open-emr.org
27 // SEGMENT FUNCTION START
29 // ISA Segment - EDI-270 format
31 function create_ISA($row,$X12info,$segTer,$compEleSep) {
35 $ISA[0] = "ISA"; // Interchange Control Header Segment ID
37 $ISA[1] = "00"; // Author Info Qualifier
39 $ISA[2] = str_pad("0000000",10," "); // Author Information
41 $ISA[3] = "00"; // Security Information Qualifier
42 // MEDI-CAL NOTE: For Leased-Line & Dial-Up use '01',
43 // for BATCH use '00'.
44 // '00' No Security Information Present
45 // (No Meaningful Information in I04)
47 $ISA[4] = str_pad("0000000000",10," "); // Security Information
49 $ISA[5] = str_pad("ZZ",2," "); // Interchange ID Qualifier
51 $ISA[6] = str_pad($X12info[2],15," "); // INTERCHANGE SENDER ID
53 $ISA[7] = str_pad("ZZ",2," "); // Interchange ID Qualifier
55 $ISA[8] = str_pad($X12info[3],15," "); // INTERCHANGE RECEIVER ID
57 $ISA[9] = str_pad(date('ymd'),6," "); // Interchange Date (YYMMDD)
59 $ISA[10] = str_pad(date('Hi'),4," "); // Interchange Time (HHMM)
61 $ISA[11] = "^"; // Interchange Control Standards Identifier
63 $ISA[12] = str_pad("00501",5," "); // Interchange Control Version Number
65 $ISA[13] = str_pad("000000001",9," "); // INTERCHANGE CONTROL NUMBER
67 $ISA[14] = str_pad("1",1," "); // Acknowledgment Request [0= not requested, 1= requested]
69 $ISA[15] = str_pad("P",1," "); // Usage Indicator [ P = Production Data, T = Test Data ]
71 $ISA['Created'] = implode('*', $ISA); // Data Element Separator
73 $ISA['Created'] = $ISA['Created'] ."*";
75 $ISA['Created'] = $ISA ['Created'] . $compEleSep . $segTer;
77 return trim($ISA['Created']);
81 // GS Segment - EDI-270 format
83 function create_GS($row,$X12info,$segTer,$compEleSep) {
87 $GS[0] = "GS"; // Functional Group Header Segment ID
89 $GS[1] = "HS"; // Functional ID Code [ HS = Eligibility, Coverage or Benefit Inquiry (270) ]
91 $GS[2] = $X12info[2]; // Application Sender's ID
93 $GS[3] = $X12info[3]; // Application Receiver's ID
95 $GS[4] = date('Ymd'); // Date [CCYYMMDD]
97 $GS[5] = date('His'); // Time [HHMM] Group Creation Time
99 $GS[6] = "2"; // Group Control Number No zeros for 5010
101 $GS[7] = "X"; // Responsible Agency Code Accredited Standards Committee X12 ]
103 $GS[8] = "005010X279A1"; // Version Release / Industry[ Identifier Code Query 005010X279A1
105 $GS['Created'] = implode('*', $GS); // Data Element Separator
107 $GS['Created'] = $GS ['Created'] . $segTer; // change the information in the tag or change the tag
109 return trim($GS['Created']);
113 // ST Segment - EDI-270 format
115 function create_ST($row,$X12info,$segTer,$compEleSep) {
119 $ST[0] = "ST"; // Transaction Set Header Segment ID
121 $ST[1] = "270"; // Transaction Set Identifier Code (Inquiry Request)
123 $ST[2] = "000000003"; // Transaction Set Control Number - Must match SE's
125 $ST[3] = "005010X279A1"; // Standard 005010X279A1 in $ST[3]
127 $ST['Created'] = implode('*', $ST); // Data Element Separator
129 $ST['Created'] = $ST ['Created'] . $segTer;
131 return trim($ST['Created']);
135 // BHT Segment - EDI-270 format
137 function create_BHT($row,$X12info,$segTer,$compEleSep) {
141 $BHT[0] = "BHT"; // Beginning of Hierarchical Transaction Segment ID
143 $BHT[1] = "0022"; // Subscriber Structure Code
145 $BHT[2] = "13"; // Purpose Code - This is a Request
147 $BHT[3] = "PROVTest600"; // Submitter Transaction Identifier
148 //This information is required by the information Receiver
149 //when using Real Time transactions.
150 //For BATCH this can be used for optional information.
152 $BHT[4] = str_pad(date('Ymd'),8," "); // Date Transaction Set Created
154 $BHT[5] = str_pad(date('Hi'),4," "); // Time Transaction Set Created no space after and 1300 is plenty
156 $BHT['Created'] = implode('*', $BHT); // Data Element Separator
158 $BHT['Created'] = $BHT ['Created'] . $segTer;
160 return trim($BHT['Created']);
164 // HL Segment - EDI-270 format
166 function create_HL($row, $nHlCounter,$X12info,$segTer,$compEleSep) {
170 $HL[0] = "HL"; // Hierarchical Level Segment ID
173 $HL[1] = $nHlCounter; // Hierarchical ID No.
178 $HL[3] = 20; // Description: Identifies the payor, maintainer, or source of the information.
179 $HL[4] = 1; // 1 Additional Subordinate HL Data Segment in This Hierarchical Structure.
181 else if($nHlCounter == 2)
183 $HL[2] = 1; // Hierarchical Parent ID Number
184 $HL[3] = 21; // Hierarchical Level Code. '21' Information Receiver
185 $HL[4] = 1; // 1 Additional Subordinate HL Data Segment in This Hierarchical Structure.
190 $HL[3] = 22; // Hierarchical Level Code.'22' Subscriber
191 $HL[4] = 0; // 0 no Additional Subordinate in the Hierarchical Structure.
194 $HL['Created'] = implode('*', $HL); // Data Element Separator
196 $HL['Created'] = $HL ['Created'] . $segTer;
198 return trim($HL['Created']);
202 // NM1 Segment - EDI-270 format
204 function create_NM1($row,$nm1Cast,$X12info,$segTer,$compEleSep) {
208 $NM1[0] = "NM1"; // Subscriber Name Segment ID
212 $NM1[1] = "PR"; // Entity ID Code - Payer [PR Payer]
213 $NM1[2] = "2"; // Entity Type - Non-Person
214 $NM1[3] = $row["payer_name"]; // Organizational Name
215 $NM1[4] = ""; // Data Element not required.
216 $NM1[5] = ""; // Data Element not required.
217 $NM1[6] = ""; // Data Element not required.
218 $NM1[7] = ""; // Data Element not required.
219 $NM1[8] = "46"; // 46 - Electronic Transmitter Identification Number (ETIN)
220 $NM1[9] = $X12info[3]; // Application Sender's ID
222 else if($nm1Cast == 'FA')
224 $NM1[1] = "FA"; // Entity ID Code - Facility [FA Facility]
225 $NM1[2] = "2"; // Entity Type - Non-Person
226 $NM1[3] = $row['facility_name']; // Organizational Name
227 $NM1[4] = ""; // Data Element not required.
228 $NM1[5] = ""; // Data Element not required.
229 $NM1[6] = ""; // Data Element not required.
230 $NM1[7] = ""; // Data Element not required.
232 $NM1[9] = $row['facility_npi'];
234 else if($nm1Cast == 'IL')
236 $NM1[1] = "IL"; // Insured or Subscriber
237 $NM1[2] = "1"; // Entity Type - Person
238 $NM1[3] = $row['lname']; // last Name
239 $NM1[4] = $row['fname']; // first Name
240 $NM1[5] = $row['mname']; // middle Name
241 $NM1[6] = ""; // data element
242 $NM1[7] = ""; // data element
243 $NM1[8] = "MI"; // Identification Code Qualifier
244 $NM1[9] = $row['subscriber_ss']; // Identification Code
247 $NM1['Created'] = implode('*', $NM1); // Data Element Separator
249 $NM1['Created'] = $NM1['Created'] . $segTer;
251 return trim($NM1['Created']);
255 // REF Segment - EDI-270 format
257 function create_REF($row,$ref,$X12info,$segTer,$compEleSep) {
261 $REF[0] = "REF"; // Subscriber Additional Identification does not want this for anything
265 $REF[1] = "4A"; // Reference Identification Qualifier
266 $REF[2] = $row['provider_pin']; // Provider Pin.
270 $REF[1] = "EJ"; // 'EJ' for Patient Account Number does not want this for patient
271 $REF[2] = $row['pid']; // Patient Account No.
273 $REF['Created'] = implode('*', $REF); // Data Element Separator
275 $REF['Created'] = $REF['Created'] . $segTer;
277 return trim($REF['Created']);
281 // TRN Segment - EDI-270 format
283 function create_TRN($row,$tracno,$refiden,$X12info,$segTer,$compEleSep) {
287 $TRN[0] = "TRN"; // Subscriber Trace Number Segment ID
289 $TRN[1] = "1"; // Trace Type Code � Current Transaction Trace Numbers
291 $TRN[2] = $tracno; // Trace Number
293 $TRN[3] = "9000000000"; // Originating Company ID � must be 10 positions in length
295 $TRN[4] = $refiden; // Additional Entity Identifier (i.e. Subdivision)
297 $TRN['Created'] = implode('*', $TRN); // Data Element Separator
299 $TRN['Created'] = $TRN['Created'] . $segTer;
301 return trim($TRN['Created']);
305 // DMG Segment - EDI-270 format
307 function create_DMG($row,$X12info,$segTer,$compEleSep) {
311 $DMG[0] = "DMG"; // Date or Time or Period Segment ID
313 $DMG[1] = "D8"; // Date Format Qualifier - (D8 means CCYYMMDD)
315 $DMG[2] = $row['dob']; // Subscriber's Birth date
317 $DMG['Created'] = implode('*', $DMG); // Data Element Separator
319 $DMG['Created'] = $DMG['Created'] . $segTer;
321 return trim($DMG['Created']);
324 // DTP Segment - EDI-270 format
326 function create_DTP($row,$qual,$X12info,$segTer,$compEleSep) {
330 $DTP[0] = "DTP"; // Date or Time or Period Segment ID
332 $DTP[1] = $qual; // Qualifier - Date of Service
334 $DTP[2] = "D8"; // Date Format Qualifier - (D8 means CCYYMMDD)
337 $DTP[3] = $row['date']; // Date
339 $DTP[3] = $row['pc_eventDate']; // Date of Service
341 $DTP['Created'] = implode('*', $DTP); // Data Element Separator
343 $DTP['Created'] = $DTP['Created'] . $segTer;
345 return trim($DTP['Created']);
348 // EQ Segment - EDI-270 format
350 function create_EQ($row,$X12info,$segTer,$compEleSep) {
354 $EQ[0] = "EQ"; // Subscriber Eligibility or Benefit Inquiry Information
356 $EQ[1] = "30"; // Service Type Code
358 $EQ['Created'] = implode('*', $EQ); // Data Element Separator
360 $EQ['Created'] = $EQ['Created'] . $segTer;
362 return trim($EQ['Created']);
365 // SE Segment - EDI-270 format
367 function create_SE($row,$segmentcount,$X12info,$segTer,$compEleSep) {
371 $SE[0] = "SE"; // Transaction Set Trailer Segment ID
373 $SE[1] = $segmentcount; // Segment Count
375 $SE[2] = "000000003"; // Transaction Set Control Number - Must match ST's
377 $SE['Created'] = implode('*', $SE); // Data Element Separator
379 $SE['Created'] = $SE['Created'] . $segTer;
381 return trim($SE['Created']);
384 // GE Segment - EDI-270 format
386 function create_GE($row,$X12info,$segTer,$compEleSep) {
390 $GE[0] = "GE"; // Functional Group Trailer Segment ID
392 $GE[1] = "1"; // Number of included Transaction Sets
394 $GE[2] = "2"; // Group Control Number
396 $GE['Created'] = implode('*', $GE); // Data Element Separator
398 $GE['Created'] = $GE['Created'] . $segTer;
400 return trim($GE['Created']);
403 // IEA Segment - EDI-270 format
405 function create_IEA($row,$X12info,$segTer,$compEleSep) {
409 $IEA[0] = "IEA"; // Interchange Control Trailer Segment ID
411 $IEA[1] = "1"; // Number of included Functional Groups
413 $IEA[2] = "000000001"; // Interchange Control Number
415 $IEA['Created'] = implode('*', $IEA);
417 $IEA['Created'] = $IEA['Created'] . $segTer;
419 return trim($IEA['Created']);
422 function translate_relationship($relationship) {
423 switch ($relationship) {
436 // EDI-270 Batch file Generation
438 function print_elig($res,$X12info,$segTer,$compEleSep){
444 // For Header Segment
451 while ($row = sqlFetchArray($res))
457 $PATEDI = create_ISA($row,$X12info,$segTer,$compEleSep);
460 $PATEDI .= create_GS($row,$X12info,$segTer,$compEleSep);
463 $PATEDI .= create_ST($row,$X12info,$segTer,$compEleSep);
466 $PATEDI .= create_BHT($row,$X12info,$segTer,$compEleSep);
470 $PATEDI .= create_HL($row,1,$X12info,$segTer,$compEleSep);
471 $PATEDI .= create_NM1($row,'PR',$X12info,$segTer,$compEleSep);
473 // For Provider Segment
475 $PATEDI .= create_HL($row,2,$X12info,$segTer,$compEleSep);
476 $PATEDI .= create_NM1($row,'FA',$X12info,$segTer,$compEleSep);
478 $nHlCounter = $nHlCounter + 2;
479 $segmentcount = 7; // segement counts - start from ST
482 // For Subscriber Segment
484 $PATEDI .= create_HL($row,$nHlCounter,$X12info,$segTer,$compEleSep);
485 $PATEDI .= create_NM1($row,'IL',$X12info,$segTer,$compEleSep);
486 $PATEDI .= create_DMG($row,$X12info,$segTer,$compEleSep);
488 $PATEDI .= create_DTP($row,'291',$X12info,$segTer,$compEleSep);
489 $PATEDI .= create_EQ($row,$X12info,$segTer,$compEleSep);
491 $segmentcount = $segmentcount + 7;
492 $nHlCounter = $nHlCounter + 1;
493 $rowCount = $rowCount + 1;
495 $refiden = $refiden + 1;
498 if($rowCount == sqlNumRows($res))
500 $segmentcount = $segmentcount + 1;
501 $PATEDI .= create_SE($row,$segmentcount,$X12info,$segTer,$compEleSep);
502 $PATEDI .= create_GE($row,$X12info,$segTer,$compEleSep);
503 $PATEDI .= create_IEA($row,$X12info,$segTer,$compEleSep);
512 function show_elig($res,$X12info,$segTer,$compEleSep){
515 echo " <div id='report_results'>
519 <th style='width:12%;'> ". htmlspecialchars( xl('Facility Name'), ENT_NOQUOTES) ."</th>
520 <th style='width:9%;' > ". htmlspecialchars( xl('Facility NPI'), ENT_NOQUOTES) ."</th>
521 <th style='width:15%;'> ". htmlspecialchars( xl('Insurance Comp'), ENT_NOQUOTES) ."</th>
522 <th style='width:8%;' > ". htmlspecialchars( xl('Policy No'), ENT_NOQUOTES) ."</th>
523 <th style='width:16%;'> ". htmlspecialchars( xl('Patient Name'), ENT_NOQUOTES) ."</th>
524 <th style='width:7%;' > ". htmlspecialchars( xl('DOB'), ENT_NOQUOTES) ."</th>
525 <th style='width:6%;' > ". htmlspecialchars( xl('Gender'), ENT_NOQUOTES) ."</th>
526 <th style='width:9%;' > ". htmlspecialchars( xl('SSN'), ENT_NOQUOTES) ."</th>
527 <th style='width:2%;' > </th>
534 while ($row = sqlFetchArray($res)) {
540 $background = '#FFF';
542 $background = '#FFF';
546 $elig[0] = $row['facility_name']; // Inquiring Provider Name calendadr
547 $elig[1] = $row['facility_npi']; // Inquiring Provider NPI
548 $elig[2] = $row['payer_name']; // Payer Name our insurance co name
549 $elig[3] = $row['policy_number']; // Subscriber ID
550 $elig[4] = $row['subscriber_lname']; // Subscriber Last Name
551 $elig[5] = $row['subscriber_fname']; // Subscriber First Name
552 $elig[6] = $row['subscriber_mname']; // Subscriber Middle Initial
553 $elig[7] = $row['subscriber_dob']; // Subscriber Date of Birth
554 $elig[8] = substr($row['subscriber_sex'], 0, 1); // Subscriber Sex
555 $elig[9] = $row['subscriber_ss']; // Subscriber SSN
556 $elig[10] = translate_relationship($row['subscriber_relationship']); // Pt Relationship to insured
557 $elig[11] = $row['lname']; // Dependent Last Name
558 $elig[12] = $row['fname']; // Dependent First Name
559 $elig[13] = $row['mname']; // Dependent Middle Initial
560 $elig[14] = $row['dob']; // Dependent Date of Birth
561 $elig[15] = substr($row['sex'], 0, 1); // Dependent Sex
562 $elig[16] = $row['pc_eventDate']; // Date of service
563 $elig[17] = "30"; // Service Type
564 $elig[18] = $row['pubpid']; // Patient Account Number pubpid
566 echo " <tr id='PR".$i."_". htmlspecialchars( $row['policy_number'], ENT_QUOTES)."'>
567 <td class ='detail' style='width:12%;'>". htmlspecialchars( $row['facility_name'], ENT_NOQUOTES) ."</td>
568 <td class ='detail' style='width:9%;'>". htmlspecialchars( $row['facility_npi'], ENT_NOQUOTES) ."</td>
569 <td class ='detail' style='width:15%;'>". htmlspecialchars( $row['payer_name'], ENT_NOQUOTES) ."</td>
570 <td class ='detail' style='width:8%;'>". htmlspecialchars( $row['policy_number'], ENT_NOQUOTES) ."</td>
571 <td class ='detail' style='width:16%;'>". htmlspecialchars( $row['subscriber_lname']." ".$row['subscriber_fname'], ENT_NOQUOTES) ."</td>
572 <td class ='detail' style='width:7%;'>". htmlspecialchars( $row['subscriber_dob'], ENT_NOQUOTES) ."</td>
573 <td class ='detail' style='width:6%;'>". htmlspecialchars( $row['subscriber_sex'], ENT_NOQUOTES) ."</td>
574 <td class ='detail' style='width:9%;'>". htmlspecialchars( $row['subscriber_ss'], ENT_NOQUOTES) ."</td>
575 <td class ='detail' style='width:2%;'>
576 <img src='../../images/deleteBtn.png' title=' .htmlspecialchars( xl('Delete Row'), ENT_QUOTES) . ' style='cursor:pointer;cursor:hand;' onclick='deletetherow(\"" . $i."_". htmlspecialchars( $row['policy_number'], ENT_QUOTES) . "\")'>
588 <td class='norecord' colspan=9>
589 <div style='padding:5px;font-family:arial;font-size:13px;text-align:center;'>". htmlspecialchars( xl('No records found'), ENT_NOQUOTES) . "</div>
597 // To Show Eligibility Verification data
599 function show_eligibility_information($pid)
602 $query = " SELECT eligr.response_description as ResponseMessage,
603 DATE_FORMAT(eligv.eligibility_check_date, '%d %M %Y') as VerificationDate,
604 eligv.copay, eligv.deductible, eligv.deductiblemet,
605 if(eligr.response_status = 'A','Active','Inactive') as Status,
607 FROM eligibility_verification eligv
608 INNER JOIN eligibility_response eligr on eligr.response_id = eligv.response_id
609 INNER JOIN insurance_data insd on insd.id = eligv.insurance_id
610 INNER JOIN insurance_companies insc on insc.id = insd.provider
612 AND eligr.response_status = 'A'
613 AND eligv.eligibility_check_date = (SELECT max(eligibility_check_date)
614 FROM eligibility_verification
615 WHERE insurance_id = eligv.insurance_id)";
616 $result = sqlStatement($query, array($pid) );
618 $row = sqlFetchArray($result);
621 $showString .= "<br><div class='text'>" .
623 htmlspecialchars( xl('Insurance Provider'), ENT_NOQUOTES) . ":</b> " .
624 (!empty($row['name']) ? htmlspecialchars( $row['name'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
627 htmlspecialchars( xl('Status'), ENT_NOQUOTES) . ":</b> " .
628 (!empty($row['ResponseMessage']) ? htmlspecialchars( $row['ResponseMessage'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
631 htmlspecialchars( xl('Last Verified On'), ENT_NOQUOTES) . ":</b> " .
632 (!empty($row['VerificationDate']) ? htmlspecialchars( $row['VerificationDate'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
634 "<b>" . htmlspecialchars( xl('Copay'), ENT_NOQUOTES) . ":</b> " .
635 (!empty($row['copay']) ? htmlspecialchars( $row['copay'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
636 "<br><b>" . htmlspecialchars( xl('Deductible'), ENT_NOQUOTES) . ":</b> " .
637 (!empty($row['deductible']) ? htmlspecialchars( $row['deductible'], ENT_NOQUOTES) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
638 "<br><b>" . htmlspecialchars( xl('Deductible Met'), ENT_NOQUOTES) . ":</b> " .
639 (!empty($row['deductiblemet']) ? ($row['deductiblemet'] == 'Y' ? htmlspecialchars( xl('Yes'), ENT_NOQUOTES) : htmlspecialchars( xl('No'), ENT_NOQUOTES)) : htmlspecialchars( xl('n/a'), ENT_NOQUOTES)) .
648 // Function to save the values in eligibility_response table
650 function eligibility_response_save($segmentVal,$vendorID)
655 $query = " SELECT count(*) as RecordsCount
656 FROM eligibility_response
657 WHERE response_description = ? and
658 response_vendor_id = ?";
660 $resCount = sqlStatement($query, array($segmentVal, $vendorID) );
666 $row = sqlFetchArray($resCount);
668 $resCount = $row['RecordsCount'];
675 $query = "INSERT into eligibility_response SET response_description =?,
676 response_vendor_id = ?,
677 response_create_date = now(),
678 response_modify_date = now()";
679 $res = sqlStatement($query, array($segmentVal, $vendorID) );
684 // Function to save the values in eligibility_verification table
686 function eligibility_verification_save($segmentVal,$x12PartnerId,$patientId)
691 // For fetching the response Id
693 $query = " SELECT response_id
694 FROM eligibility_response
695 WHERE response_description = ? and
696 response_vendor_id = ?";
698 $resId = sqlStatement($query, array($segmentVal, $x12PartnerId) );
700 // For fetching the insuarace data Id
702 $query = " SELECT id,copay
704 WHERE type = 'primary' and
707 $insId = sqlStatement($query, array($patientId) );
712 $row = sqlFetchArray($resId);
714 $responseId = $row['response_id'];
720 $row = sqlFetchArray($insId);
722 $insuranceId = $row['id'];
723 $copay = $row['copay'];
730 if(isset($insuranceId) && !empty($insuranceId)){
732 //Set up the sql variable binding array (this prevents sql-injection attacks)
733 $sqlBindArray = array();
734 $query = "INSERT into eligibility_verification SET response_id = ? ,
736 array_push($sqlBindArray, $responseId, $insuranceId);
740 $query .= "copay = ?,";
741 array_push($sqlBindArray, $copay);
743 $query .= "eligibility_check_date = now(),
744 create_date = now()";
745 $res = sqlStatement($query, $sqlBindArray);
750 // Function to fetch the Patient information - eligibility
752 function eligibility_information($insuranceId)
757 FROM eligibility_verification
758 WHERE insuranceid = ?";
760 $result = sqlStatement($query, array($insuranceId) );
761 $row = sqlFetchArray($result);
765 // return array of X12 partners
767 function getX12Partner() {
768 $rez = sqlStatement("select * from x12_partners");
769 for($iter=0; $row=sqlFetchArray($rez); $iter++)
770 $returnval[$iter]=$row;
775 // return array of provider usernames
776 function getUsernames() {
777 $rez = sqlStatement("select distinct username, lname, fname,id from users " .
778 "where authorized = 1 and username != ''");
779 for($iter=0; $row=sqlFetchArray($rez); $iter++)
780 $returnval[$iter]=$row;
785 // return formated array
787 function arrFormated(&$item, $key){
788 $item = strstr($item, '_');
789 $item = substr($item,1,strlen($item)-1);