public function dih_search_insurance($insurance, $AllResultArray, $matchpoint = 170) { $matchpoint = count($AllResultArray) * 2; // added by jitu on 12 Feb //echo "<pre>";print_r($AllResultArray); if (!empty($AllResultArray)) { $DoctorInsurance = new Application_Model_DoctorInsurance(); $where = "doctor_id IN (" . implode(',', array_keys($AllResultArray)) . ") AND insurance_id='{$insurance}'"; //echo "whereclause =".$where; $insObject = $DoctorInsurance->fetchAll($where); if (!empty($insObject)) { foreach ($insObject as $ins) { if (isset($AllResultArray[$ins->getDoctorId()]) && $AllResultArray[$ins->getDoctorId()] > 0) { $AllResultArray[$ins->getDoctorId()] = $AllResultArray[$ins->getDoctorId()] + $matchpoint; } } } //$where = array_keys($AllResultArray); } //echo "<pre>";print_r($AllResultArray);exit; }
public function insuranceAction() { $this->_helper->layout->disableLayout(); $drids = trim($this->_getParam('drids')); $comp_id = $this->_getParam('comp_id'); $DoctorInsurance = new Application_Model_DoctorInsurance(); if ($comp_id > 0) { $Company = new Application_Model_InsuranceCompany(); $insuranceCompany = $Company->find($comp_id); } $returnArray = array(); $dridArray = explode(' ', $drids); if (count($dridArray)) { foreach ($dridArray as $drid) { if ($comp_id > 0) { $object = $DoctorInsurance->fetchRow("doctor_id={$drid} AND insurance_id={$comp_id}"); if (!empty($object)) { $returnArray[$drid] = "<div class=\"in-network\">In Network</div>\r\n <img width=\"125\" alt=\"{$insuranceCompany->getCompany()}\" src=\"/images/insurance/{$insuranceCompany->getLogo()}\">"; } else { $returnArray[$drid] = "<strong>Out of network.</strong><br />Please contact the Doctor's office to see if they file paperwork."; } } elseif ($comp_id == -1) { $returnArray[$drid] = "<span class='na'>N/A</span>"; } else { $returnArray[$drid] = "Please enter your insurance at the top of the page."; } } } echo Zend_Json::encode($returnArray); exit; }