246 lines
9.3 KiB
PHP
Executable File
246 lines
9.3 KiB
PHP
Executable File
<?php
|
|
|
|
if (!defined('BASEPATH'))
|
|
exit('No direct script access allowed');
|
|
|
|
class physicianDashboard extends MX_Controller {
|
|
|
|
function __construct() {
|
|
parent::__construct();
|
|
|
|
$this->load->model('physician/Physician_model');
|
|
$this->load->model('home/Home_model');
|
|
|
|
}
|
|
|
|
public function index() {
|
|
// die;
|
|
$id = $this->session->userdata('user_id');
|
|
|
|
$this->load->view('home/dashboard',$data); // just the header file
|
|
$this->load->view('dashboard',$data);
|
|
$this->load->view('home/footer',$data);
|
|
}
|
|
|
|
public function patientList()
|
|
{
|
|
|
|
$id = $this->session->userdata('user_id');
|
|
$physicianDetails=$this->Physician_model->getPhysicianByIonId($id);
|
|
$npi = $physicianDetails->npi;
|
|
$data['patients']=$this->Physician_model->getPatientList($npi);
|
|
|
|
//echo '<pre>'; print_r($data); echo '</pre>'; exit;
|
|
$this->load->view('home/dashboard',$data);
|
|
$this->load->view('namelist',$data);
|
|
$this->load->view('home/footer',$data);
|
|
|
|
}
|
|
public function getList()
|
|
{
|
|
$id = $this->session->userdata('user_id');
|
|
$physicianDetails=$this->Physician_model->getPhysicianByIonId($id);
|
|
$npi = $physicianDetails->npi;
|
|
$requestData = $_REQUEST;
|
|
$start = $requestData['start'];
|
|
$limit = $requestData['length'];
|
|
|
|
$orderColumn=$requestData['order'][0]['column'];
|
|
$orderType=$requestData['order'][0]['dir'];
|
|
|
|
$search = $this->input->post('search')['value'];
|
|
if (!empty($search)) {
|
|
$data['npi'] = $this->Physician_model->getNameByLimitBySearch($limit, $start, $search,$orderColumn, $orderType,$npi);
|
|
} else {
|
|
|
|
$data['npi'] = $this->Physician_model->getNameByLimit($limit, $start, $orderColumn, $orderType,$npi);
|
|
}
|
|
//echo '<pre>'; print_r($data); echo '</pre>';die;
|
|
$listCount = sizeof($data['npi']);
|
|
|
|
foreach ($data['npi'] as $data) {
|
|
//echo '<pre>'; print_r($data); echo '</pre>';die;
|
|
$id=$data->id;
|
|
static $slno = 1;
|
|
$statusChk = '';
|
|
if($data->status == "0"){
|
|
$statusChk = '';
|
|
}else{
|
|
$statusChk = 'checked';
|
|
}
|
|
// $options1 = '<a class="btn btn-success" title="' . lang('View') .'" href="" ><i class="la la-eye"></i>' . lang('view') .' </a>';
|
|
$options2 = '<a class="btn btn-success" title="' . lang('Orders') .'"href='.base_url().'md_order?id='.$id.' ><i class="la la-sticky-note"></i>' . lang('MD Order') .' </a>';
|
|
|
|
|
|
$info[] = array(
|
|
$slno,
|
|
$data->primaryCarePhyMdNpi,
|
|
$data->first_name." ".$data->last_name,
|
|
$options1.' '.$options2,
|
|
);
|
|
$slno++;
|
|
}
|
|
//echo '<pre>'; print_r($info); echo '</pre>';die;
|
|
$csrf_name = $this->security->get_csrf_token_name();
|
|
$csrf_hash = $this->security->get_csrf_hash();
|
|
if ($listCount > 0) {
|
|
$output = array(
|
|
"draw" => intval($requestData['draw']),
|
|
"recordsTotal" => count($this->Physician_model->getPatientList($npi)),
|
|
"recordsFiltered" => count($this->Physician_model->getPatientList($npi)),
|
|
"data" => $info
|
|
);
|
|
}
|
|
else {
|
|
$output = array(
|
|
// "draw" => 1,
|
|
"recordsTotal" => 0,
|
|
"recordsFiltered" => 0,
|
|
"data" => []
|
|
);
|
|
$output[$csrf_name] = $csrf_hash;
|
|
}
|
|
|
|
//echo '<pre>'; print_r($output); echo '</pre>';die;
|
|
echo json_encode($output);
|
|
}
|
|
|
|
///Pending Order List
|
|
function pendingOrder(){
|
|
$this->load->view('home/dashboard');
|
|
$this->load->view('pendingOrder');
|
|
$this->load->view('home/footer');
|
|
}
|
|
function getPendingList(){
|
|
|
|
$Ion_id = $this->session->userdata('user_id');
|
|
$physicianDetails=$this->Physician_model->getPhysicianByIonId($Ion_id);
|
|
$phyId = $physicianDetails->id;
|
|
$requestData = $_REQUEST;
|
|
$start = $requestData['start'];
|
|
$limit = $requestData['length'];
|
|
$orderColumn=$requestData['order'][0]['column'];
|
|
$orderType=$requestData['order'][0]['dir'];
|
|
|
|
$search = $this->input->post('search')['value'];
|
|
if (!empty($search)) {
|
|
//$data['npi'] = $this->Physician_model->getNameByLimitBySearch($limit, $start, $search,$orderColumn, $orderType,$npi);
|
|
} else {
|
|
$pendingList = $this->Physician_model->getPendingOrderListByLimit($limit, $start, $orderColumn, $orderType,$phyId);
|
|
}
|
|
//echo '<pre>'; print_r($pendingList); echo '</pre>';die;
|
|
$listCount = sizeof($pendingList);
|
|
|
|
foreach ($pendingList as $data) {
|
|
$pid=$data->patient_id;
|
|
$oid=$data->id;
|
|
static $slno = 1;
|
|
$options1 = '<a class="btn btn-sm btn-info" title="' . lang('Approve') .'"href='.base_url().'md_order/AddNew?id='.$pid.'&order_id='.$oid.' ><i class="la la-sticky-note"></i>' . lang('Approve') .' </a>';
|
|
|
|
|
|
$info[] = array(
|
|
$slno,
|
|
$data->patient_name,
|
|
$options1,
|
|
);
|
|
$slno++;
|
|
}
|
|
$csrf_name = $this->security->get_csrf_token_name();
|
|
$csrf_hash = $this->security->get_csrf_hash();
|
|
if ($listCount > 0) {
|
|
$output = array(
|
|
"draw" => intval($requestData['draw']),
|
|
"recordsTotal" => count($this->Physician_model->getPatientList($npi)),
|
|
"recordsFiltered" => count($this->Physician_model->getPatientList($npi)),
|
|
"data" => $info
|
|
);
|
|
}
|
|
else {
|
|
$output = array(
|
|
"recordsTotal" => 0,
|
|
"recordsFiltered" => 0,
|
|
"data" => []
|
|
);
|
|
$output[$csrf_name] = $csrf_hash;
|
|
}
|
|
|
|
//echo '<pre>'; print_r($output); echo '</pre>';die;
|
|
echo json_encode($output);
|
|
}
|
|
function orderList(){
|
|
$this->load->view('home/dashboard');
|
|
$this->load->view('orderList');
|
|
$this->load->view('home/footer');
|
|
}
|
|
function getApprovedList(){
|
|
|
|
$Ion_id = $this->session->userdata('user_id');
|
|
$physicianDetails=$this->Physician_model->getPhysicianByIonId($Ion_id);
|
|
$phyId = $physicianDetails->id;
|
|
$requestData = $_REQUEST;
|
|
$start = $requestData['start'];
|
|
$limit = $requestData['length'];
|
|
$orderColumn=$requestData['order'][0]['column'];
|
|
$orderType=$requestData['order'][0]['dir'];
|
|
|
|
$search = $this->input->post('search')['value'];
|
|
if (!empty($search)) {
|
|
//$data['npi'] = $this->Physician_model->getNameByLimitBySearch($limit, $start, $search,$orderColumn, $orderType,$npi);
|
|
} else {
|
|
$pendingList = $this->Physician_model->getApprovedOrderListByLimit($limit, $start, $orderColumn, $orderType,$phyId);
|
|
}
|
|
//echo '<pre>'; print_r($pendingList); echo '</pre>';die;
|
|
$listCount = sizeof($pendingList);
|
|
|
|
foreach ($pendingList as $data) {
|
|
$today=date('m-d-Y');
|
|
$orderData=json_decode($data->orderData);
|
|
$expire_date=date('m-d-Y',strtotime($orderData->Expire_date));
|
|
if($expire_date>$today){
|
|
$expire_date='<span class="text-danger">'.date('m-d-Y',strtotime($orderData->Expire_date)).'</span>';
|
|
}else{
|
|
$expire_date='<span class="text-success">'.date('m-d-Y',strtotime($orderData->Expire_date)).'</span>';
|
|
}
|
|
$order_date='<span class="text-primary">'.date('m-d-Y',strtotime($orderData->OrderDateTime)).'</span>';
|
|
|
|
$pid=$data->patient_id;
|
|
$oid=$data->id;
|
|
static $slno = 1;
|
|
$options1 = '<a class="btn btn-sm btn-info" title="' . lang('View') .'"href='.base_url().'md_order/AddNew?id='.$pid.'&order_id='.$oid.' ><i class="la la-sticky-note"></i>' . lang('View') .' </a>';
|
|
|
|
|
|
$info[] = array(
|
|
$slno,
|
|
$data->patient_name,
|
|
$order_date,
|
|
$expire_date,
|
|
$options1,
|
|
);
|
|
$slno++;
|
|
}
|
|
$csrf_name = $this->security->get_csrf_token_name();
|
|
$csrf_hash = $this->security->get_csrf_hash();
|
|
if ($listCount > 0) {
|
|
$output = array(
|
|
"draw" => intval($requestData['draw']),
|
|
"recordsTotal" => count($this->Physician_model->getPatientList($npi)),
|
|
"recordsFiltered" => count($this->Physician_model->getPatientList($npi)),
|
|
"data" => $info
|
|
);
|
|
}
|
|
else {
|
|
$output = array(
|
|
"recordsTotal" => 0,
|
|
"recordsFiltered" => 0,
|
|
"data" => []
|
|
);
|
|
$output[$csrf_name] = $csrf_hash;
|
|
}
|
|
|
|
//echo '<pre>'; print_r($output); echo '</pre>';die;
|
|
echo json_encode($output);
|
|
}
|
|
}
|
|
|
|
|