Add Health Care Sheet Menu in hypervisor panel

This commit is contained in:
Djery-Tom 2021-11-25 07:58:56 +01:00
parent c7ebe15430
commit d1abfdf8a5
13 changed files with 896 additions and 10 deletions

View File

@ -286,11 +286,12 @@ class Admin extends CI_Controller
$email = $this->input->post('email'); $email = $this->input->post('email');
$phone = $this->input->post('contact'); $phone = $this->input->post('contact');
$provider_class_id = $this->input->post('provider_class_id'); $provider_class_id = $this->input->post('provider_class_id');
$network_agent_id = $this->input->post('network_agent_id');
$id = $this->user_model->getIdAgentByMemberCode($code,$cat); $id = $this->user_model->getIdAgentByMemberCode($code,$cat);
if($id!=false){ if($id!=false){
$update_info = $this->user_model->updateGeolocatedUser($id,$adresse,$lastname,$email,$provider_class_id); $update_info = $this->user_model->updateGeolocatedUser($id,$adresse,$lastname,$email,$network_agent_id,$provider_class_id);
if($update_info){ if($update_info){
$res = $this->user_model->updatePhoneAgent($id,$phone); $res = $this->user_model->updatePhoneAgent($id,$phone);
if($res){ if($res){

View File

@ -410,13 +410,23 @@ class Hyperviseur_dash extends CI_Controller
$this->load->view('header_hyp', $data); $this->load->view('header_hyp', $data);
$this->load->view('nano_health/hyper/infos_insurance'); $this->load->view('nano_health/hyper/infos_insurance');
}else{ }else if($history == 'insurance-subscriptions'){
$data['insurance_subscription_id'] = $this->input->get('id'); $data['insurance_subscription_id'] = $this->input->get('id');
$data['subscription'] = $this->nano_health_model->getInfosInsuranceSubscriptionById($this->input->get('id')); $data['subscription'] = $this->nano_health_model->getInfosInsuranceSubscriptionById($this->input->get('id'));
$data['beneficiaries'] = $this->nano_health_model->getSubscriptionBeneficiaries($data['subscription']->id ?? null); $data['beneficiaries'] = $this->nano_health_model->getSubscriptionBeneficiaries($data['subscription']->id ?? null);
$data['user'] = $this->db->get_where('user_infos',['user_id' => $data['subscription']->user_id ?? null])->first_row(); $data['user'] = $this->db->get_where('user_infos',['user_id' => $data['subscription']->user_id ?? null])->first_row();
$this->load->view('header_hyp', $data); $this->load->view('header_hyp', $data);
$this->load->view('nano_health/hyper/infos_insurance_subscription'); $this->load->view('nano_health/hyper/infos_insurance_subscription');
}else if($history == 'insurance-health_care_sheets'){
$data['active'] = "wallet_health_care_sheets";
$data['health_care_sheet_id'] = $this->input->get('id');
$data['health_care_sheet'] = $this->nano_health_model->getInfosHealthCareSheetById($this->input->get('id'));
$data['performances'] = $this->nano_health_model->getHealthCareSheetPerformances($data['health_care_sheet']->id ?? null);
$data['exams'] = $this->nano_health_model->getHealthCareSheetExams($data['health_care_sheet']->id ?? null);
$data['prescriptions'] = $this->nano_health_model->getHealthCareSheetPrescriptions($data['health_care_sheet']->id ?? null);
$this->load->view('header_hyp', $data);
$this->load->view('nano_health/hyper/infos_health_care_sheet');
} }
$this->load->view('footer'); $this->load->view('footer');
return; return;
@ -567,8 +577,8 @@ class Hyperviseur_dash extends CI_Controller
$data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id); $data['refunds'] = $this->wallet_model->getRefunds($startDate, $endDate, $network_id);
else if ($type == 'commission_payments') else if ($type == 'commission_payments')
$data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id); $data['payments'] = $this->wallet_model->getCommissionPayments($startDate, $endDate, $network_id);
else if ($type == 'insurance-subscriptions' || $type == 'insurance-insured'){ else if (strpos($type, 'insurance') !== false){
/// Historique de l'assurance
} }
else{ else{
$data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id); $data['transactions'] = $this->wallet_model->getRecharges($startDate, $endDate, $network_id);
@ -588,8 +598,9 @@ class Hyperviseur_dash extends CI_Controller
$data['id_network'] = $network_id; $data['id_network'] = $network_id;
$data['parrain_id'] = $parrainId; $data['parrain_id'] = $parrainId;
if($type == 'insurance-insured'){ if(strpos($type, 'insurance') !== false){
$data['active'] = "wallet_insured"; $array = explode('-',$type);
$data['active'] = "wallet_".$array[1];
} }
$this->load->view('header_hyp', $data); $this->load->view('header_hyp', $data);
@ -611,6 +622,8 @@ class Hyperviseur_dash extends CI_Controller
$this->load->view('nano_health/hyper/insurances_subscriptions.php'); $this->load->view('nano_health/hyper/insurances_subscriptions.php');
else if ($type == 'insurance-insured') else if ($type == 'insurance-insured')
$this->load->view('nano_health/hyper/insurances_insured.php'); $this->load->view('nano_health/hyper/insurances_insured.php');
else if ($type == 'insurance-health_care_sheets')
$this->load->view('nano_health/hyper/insurances_health_care_sheets.php');
else else
$this->load->view('historique_recharges'); $this->load->view('historique_recharges');
$this->load->view('footer'); $this->load->view('footer');

View File

@ -41,7 +41,7 @@ class GeolocatedUsers extends CI_Controller
// } // }
if ($this->session->userdata("category") == "0" or $this->session->userdata("category") == "hyper") if ($this->session->userdata("category") == "0" or $this->session->userdata("category") == "hyper")
array_push($data, "<button data-toggle='modal' data-category='$row->category' data-lastname='$row->lastname' data-adresse='$row->adresse' data-provider_class_id='$row->provider_class_id' array_push($data, "<button data-toggle='modal' data-category='$row->category' data-lastname='$row->lastname' data-adresse='$row->adresse' data-network_agent_id='$row->network_agent_id' data-provider_class_id='$row->provider_class_id'
data-network='$row->network' data-member_code='$row->code_membre' data-email='$row->email' data-phone='$row->phone' class='open-modal modif btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>"); data-network='$row->network' data-member_code='$row->code_membre' data-email='$row->email' data-phone='$row->phone' class='open-modal modif btn btn-success' data-target='#editModal'><i class='fa fa-edit'></i></button>");

View File

@ -0,0 +1,48 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
use Brick\Money\Context\AutoContext;
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\Money;
class HealthCareSheets extends CI_Controller
{
function __construct()
{
parent::__construct();
// Load member model
$this->load->model('pagination/HealthCareSheets_model', 'model');
}
function getLists()
{
$data = $row = array();
// Fetch member's records
$witData = $this->model->getRows($_POST);
$i = $_POST['start'];
$current_url = $_POST['currentURL'];
foreach ($witData as $row) {
$data[] = array($row->health_care_sheet_id , $row->type , $row->insured_id , $row->patient_lastname.' '.$row->patient_firstname, $this->lang->line($row->patient_situation),
$row->institution_name, $row->practitioner_lastname.' '.$row->practitioner_firstname, $this->lang->line($row->care_condition), $this->lang->line($row->state), $row->created_at,
'<a href="'.$current_url.'?history=insurance-health_care_sheets&id='.$row->health_care_sheet_id.'" class="btn btn-primary" > '.$this->lang->line('Voir plus...').'</a>');
}
$output = array(
"draw" => $_POST['draw'],
"recordsTotal" => $this->model->countAll($_POST),
"recordsFiltered" => $this->model->countFiltered($_POST),
"data" => $data,
);
// Output to JSON format
echo json_encode($output);
}
}

View File

@ -781,4 +781,39 @@ $lang['SOLUTION'] = "Solution";
$lang['SUPPOSITORY'] = "Suppository"; $lang['SUPPOSITORY'] = "Suppository";
$lang['DEVICE'] = "Apparatus"; $lang['DEVICE'] = "Apparatus";
$lang['provider_class'] = "Provider class"; $lang['provider_class'] = "Provider class";
$lang['health_care_sheets'] = "Care sheets";
$lang['manage_health_care_sheets'] = "Manage care sheets";
$lang['export_health_care_sheets_list'] = "Export the list of care sheets";
$lang['health_care_sheet_id'] = "Health care sheet ID";
$lang['patient_lastname'] = "Patient name";
$lang['patient_firstname'] = "Patient's first name";
$lang['patient_situation'] = "Patient's situation";
$lang['HAVING_RIGHT'] = "HAVING RIGHT";
$lang['INSURED'] = "INSURED";
$lang['institution_name'] = "Name of the institution";
$lang['institution_code'] = "Institution's approval code";
$lang['practitioner_lastname'] = "Name of practitioner";
$lang['practitioner_firstname'] = "First name of practitioner";
$lang['practitioner_provider_class'] = "Practitioner's provider class";
$lang['care_condition'] = "Care condition";
$lang['CURRENT_AFFECTION'] = "CURRENT AFFECTION";
$lang['LONG_TERM_AFFECTION'] = "LONG TERM AFFECTION";
$lang['EXONERATION'] = "EXONERATION";
$lang['health_care_sheet_infos'] = "Health care sheet information";
$lang['practitioner'] = "Practitioner";
$lang['accident_date'] = "Date of accident";
$lang['pregnancy_start_at'] = "Date of start of pregnancy";
$lang['pregnancy_end_at'] = "Date of end of pregnancy";
$lang['performances'] = "Prescriptions";
$lang['moderator_ticket'] = "Ticket modérateur";
$lang['home_visit_fees'] = "Home visit expenses";
$lang['act'] = "Act";
$lang['act_code'] = "Act code";
$lang['exams'] = "Exams";
$lang['exam_description'] = "Exam description";
$lang['exam_class'] = "Exam class";
$lang['quantity'] = "Quantity";
$lang['medical_prescriptions'] = "Medical prescriptions";
$lang['dosage'] = "Dosage";
$lang['drugs_or_device'] = "Drug / Device"
?> ?>

View File

@ -792,4 +792,39 @@ $lang['SOLUTION'] = "Solution";
$lang['SUPPOSITORY'] = "Suppositoire"; $lang['SUPPOSITORY'] = "Suppositoire";
$lang['DEVICE'] = "Appareillage"; $lang['DEVICE'] = "Appareillage";
$lang['provider_class'] = "Classe de prestataire"; $lang['provider_class'] = "Classe de prestataire";
$lang['health_care_sheets'] = "Feuilles de soins";
$lang['manage_health_care_sheets'] = "Gestion des feuilles de soins";
$lang['export_health_care_sheets_list'] = "Exporter la liste des feuilles de soins";
$lang['health_care_sheet_id'] = "ID de la feuille de soins";
$lang['patient_lastname'] = "Nom du patient";
$lang['patient_firstname'] = "Prenom du patient";
$lang['patient_situation'] = "Situation du patient";
$lang['HAVING_RIGHT'] = "AYANT DROIT";
$lang['INSURED'] = "ASSURÉ";
$lang['institution_name'] = "Nom de l'etablissement";
$lang['institution_code'] = "Code agrément de l'etablissement";
$lang['practitioner_lastname'] = "Nom du praticien";
$lang['practitioner_firstname'] = "Prenom du praticien";
$lang['practitioner_provider_class'] = "Classe de prestataire du praticien";
$lang['care_condition'] = "Condition de prise en charge";
$lang['CURRENT_AFFECTION'] = "AFFECTION COURANTE";
$lang['LONG_TERM_AFFECTION'] = "AFFECTION LONGUE DURÉE";
$lang['EXONERATION'] = "EXONERATION";
$lang['health_care_sheet_infos'] = "Informations sur la feuille de soins";
$lang['practitioner'] = "Praticien";
$lang['accident_date'] = "Date de l'accident";
$lang['pregnancy_start_at'] = "Date de debut de la grossesse";
$lang['pregnancy_end_at'] = "Date de fin de la grossesse";
$lang['performances'] = "Prescriptions";
$lang['moderator_ticket'] = "Ticket modérateur";
$lang['home_visit_fees'] = "Frais de déplacement à domicile";
$lang['act'] = "Acte";
$lang['act_code'] = "Code de l'acte";
$lang['exams'] = "Examens";
$lang['exam_description'] = "Description de l'examen";
$lang['exam_class'] = "Classe de l'examen";
$lang['quantity'] = "Quantité";
$lang['medical_prescriptions'] = "Prescriptions médicales";
$lang['dosage'] = "Posologie";
$lang['drugs_or_device'] = "Médicament / Appareillage"
?> ?>

View File

@ -76,4 +76,29 @@ class Nano_health_model extends CI_Model
->from('nh_having_rights b')->join('nh_insurances_having_rights i', 'b.id = i.having_right_id') ->from('nh_having_rights b')->join('nh_insurances_having_rights i', 'b.id = i.having_right_id')
->where('i.insurance_id',$insuranceId)->order_by('i.created_at','asc')->get(); ->where('i.insurance_id',$insuranceId)->order_by('i.created_at','asc')->get();
} }
public function getInfosHealthCareSheetById($healthCareSheetId){
return $this->db->get_where('nh_infos_health_care_sheets',['health_care_sheet_id'=> $healthCareSheetId])->first_row();
}
public function getHealthCareSheetPerformances($healthCareSheetId){
return $this->db->select('p.* , a.code as act_code , a.name as act_name')
->from('nh_performances p')->join('nh_health_care_sheets_performances sp', 'p.id = sp.performance_id')
->join('nh_acts a', 'a.id = p.act_id')
->where('sp.sheet_id',$healthCareSheetId)->order_by('sp.created_at','asc')->get();
}
public function getHealthCareSheetExams($healthCareSheetId){
return $this->db->select('e.* , a.code as act_code , a.name as act_name')
->from('nh_exams e')->join('nh_health_care_sheets_exams se', 'e.id = se.exam_id')
->join('nh_acts a', 'a.id = e.act_id')
->where('se.sheet_id',$healthCareSheetId)->order_by('se.created_at','asc')->get();
}
public function getHealthCareSheetPrescriptions($healthCareSheetId){
return $this->db->select('p.* , d.code as drug_or_device_code , d.name as drug_or_device_name')
->from('nh_medical_prescriptions p')->join('nh_health_care_sheets_prescriptions sp', 'p.id = sp.prescription_id')
->join('nh_drugs_and_devices d', 'd.id = p.drug_or_device_id')
->where('sp.sheet_id',$healthCareSheetId)->order_by('sp.created_at','asc')->get();
}
} }

View File

@ -1168,8 +1168,14 @@ class User_model extends CI_Model
} }
} }
public function updateGeolocatedUser($id,$adresse,$lastname,$email, $providerClassId = null){ public function updateGeolocatedUser($id,$adresse,$lastname,$email, $network_agent_id = null , $providerClassId = null){
$query = $this->db->query("UPDATE agents SET firstname='".$adresse."',lastname='".$lastname."',email='".$email."', nh_provider_class_id = $providerClassId WHERE id ='".$id."'"); // Update Provider class
if(isset($providerClassId) && isset($network_agent_id)){
$this->db->where('id', $network_agent_id);
$this->db->update('networks_agents', ['nh_provider_class_id' => $providerClassId]);
}
// Update agents infos
$query = $this->db->query("UPDATE agents SET firstname='".$adresse."',lastname='".$lastname."',email='".$email."' WHERE id ='".$id."'");
return $query; return $query;
} }
public function updatePhoneAgent($id,$phone){ public function updatePhoneAgent($id,$phone){

View File

@ -0,0 +1,99 @@
<?php
defined('BASEPATH') or exit('No direct script access allowed');
class HealthCareSheets_model extends CI_Model
{
function __construct()
{
// Set table name
$this->table = 'nh_infos_health_care_sheets';
// Set orderable column fields
$this->column_order = array('health_care_sheet_id','type','insured_id', 'patient_lastname', 'patient_situation', 'institution_name', 'practitioner_lastname', 'care_condition',
'state','created_at', null);
// Set searchable column fields
$this->column_search = array('health_care_sheet_id','type','insured_id', 'patient_lastname', 'patient_situation', 'institution_name', 'practitioner_lastname', 'care_condition',
'state', 'created_at');
// Set default order
$this->order = array('created_at' => 'desc');
}
/*
* Fetch members data from the database
* @param $_POST filter data based on the posted parameters
*/
public function getRows($postData)
{
$this->_get_datatables_query($postData);
if ($postData['length'] != -1) {
$this->db->limit($postData['length'], $postData['start']);
}
$query = $this->db->get();
return $query->result();
}
/*
* Count all records
*/
public function countAll($postData)
{
$this->db->from($this->table);
$this->db->where('network_id', $postData['id_network']);
return $this->db->count_all_results();
}
/*
* Count records based on the filter params
* @param $_POST filter data based on the posted parameters
*/
public function countFiltered($postData)
{
$this->_get_datatables_query($postData);
$query = $this->db->get();
return $query->num_rows();
}
/*
* Perform the SQL queries needed for an server-side processing requested
* @param $_POST filter data based on the posted parameters
*/
private function _get_datatables_query($postData)
{
$this->db->from($this->table);
$this->db->where('network_id', $postData['id_network']);
if (strlen($postData['startDate']) > 0 && strlen($postData['endDate']) > 0) {
$this->db->where('created_at >=', date('Y-m-d', strtotime($postData['startDate'])));
$this->db->where('created_at <', date('Y-m-d', strtotime($postData['endDate']. "+1 day")));
}
$i = 0;
// loop searchable columns
foreach ($this->column_search as $item) {
// if datatable send POST for search
if ($postData['search']['value']) {
// first loop
if ($i === 0) {
// open bracket
$this->db->group_start();
$this->db->like($item, $postData['search']['value']);
} else {
$this->db->or_like($item, $postData['search']['value']);
}
// last loop
if (count($this->column_search) - 1 == $i) {
// close bracket
$this->db->group_end();
}
}
$i++;
}
if (isset($postData['order'])) {
$this->db->order_by($this->column_order[$postData['order']['0']['column']], $postData['order']['0']['dir']);
} else if (isset($this->order)) {
$order = $this->order;
$this->db->order_by(key($order), $order[key($order)]);
}
}
}

View File

@ -215,6 +215,12 @@
<span><?php echo $this->lang->line('insured'); ?></span> <span><?php echo $this->lang->line('insured'); ?></span>
</a> </a>
</li> </li>
<li class="<?php if ($active == "wallet_health_care_sheets") {echo "active";} ?>">
<a href="<?php echo base_url('Hyperviseur_dash/wallet?history=insurance-health_care_sheets') ?>">
<i class="fa fa-file-text"></i>
<span><?php echo $this->lang->line('health_care_sheets'); ?></span>
</a>
</li>
<?php } ?> <?php } ?>
<li class="<?php if ($active == "wallet_password") { <li class="<?php if ($active == "wallet_password") {
echo "active"; echo "active";

View File

@ -0,0 +1,409 @@
<link rel="stylesheet"
href="<?= base_url('bower_components/bootstrap-datepicker/dist/css/bootstrap-datepicker.min.css') ?>">
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-multiselect/0.9.15/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="https://cdn.datatables.net/select/1.3.1/css/select.dataTables.min.css">
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
<link rel="stylesheet"
href="<?= base_url('bower_components/jquery-ui/themes/base/jquery-ui.css') ?>">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<section class="content-header">
<h1 style="margin-bottom: 20px">
<?= $this->lang->line('health_care_sheets'). ' - ' . $health_care_sheet_id; ?>
</h1>
<?php
use Brick\Money\Context\AutoContext;
use Brick\Money\CurrencyConverter;
use Brick\Money\ExchangeRateProvider\BaseCurrencyProvider;
use Brick\Money\ExchangeRateProvider\PDOProvider;
use Brick\Money\ExchangeRateProvider\PDOProviderConfiguration;
use Brick\Money\Money;
// set to whatever your rates are relative to
$baseCurrency = 'USD';
// use your own credentials, or re-use your existing PDO connection
$pdo = new PDO('mysql:host=' . $this->db->hostname . ';dbname=' . $this->db->database, $this->db->username, $this->db->password);
$configuration = new PDOProviderConfiguration();
$configuration->tableName = 'exchange_rate';
$configuration->exchangeRateColumnName = 'exchange_rate';
$configuration->targetCurrencyColumnName = 'target_currency';
$configuration->sourceCurrencyCode = $baseCurrency;
// this provider loads exchange rates from your database
$provider = new PDOProvider($pdo, $configuration);
// this provider calculates exchange rates relative to the base currency
$provider = new BaseCurrencyProvider($provider, $baseCurrency);
// this currency converter can now handle any currency pair
$this->converter = new CurrencyConverter($provider);
$this->context = new AutoContext();
$fmt = new NumberFormatter('fr_FR', NumberFormatter::DECIMAL);
?>
</section>
<section class="content">
<div class="box box-success">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('health_care_sheet_infos')?></h3>
</div>
<div class="box-body row" style="overflow-x:auto;">
<div class="col-lg-6" style="padding-left: 25px;">
<table style="width: 100% ; border-collapse: separate; border-spacing: 0.4em;">
<colgroup>
<col span="1" style="width: 30%;">
<col span="1" style="width: 70%;">
</colgroup>
<thead>
<tr>
<th align="center"><strong>Patient</strong></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><?= $this->lang->line('insured_id'); ?></td>
<td align="center"><strong><?= $health_care_sheet->insured_id ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('patient_lastname'); ?></td>
<td align="center"><strong><?= $health_care_sheet->patient_lastname ; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('patient_firstname')?></td>
<td align="center"><strong><?= $health_care_sheet->patient_firstname ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('patient_situation')?></td>
<td align="center"><strong><?= $this->lang->line($health_care_sheet->patient_situation) ?></strong></td>
</tr>
</tbody>
</table>
</div>
<div class="col-lg-6" style="padding-left: 25px;">
<table style="width: 100% ;border-collapse: separate; border-spacing: 0.4em;">
<colgroup>
<col span="1" style="width: 30%;">
<col span="1" style="width: 70%;">
</colgroup>
<thead>
<tr>
<th><?=$this->lang->line('practitioner') ?></th>
<th></th>
</tr>
</thead>
<tbody>
<tr>
<td><?= $this->lang->line('institution_name'); ?></td>
<td align="center"><strong><?= $health_care_sheet->institution_name ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('institution_code'); ?></td>
<td align="center"><strong><?= $health_care_sheet->institution_code ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('practitioner_lastname'); ?></td>
<td align="center"><strong><?= $health_care_sheet->practitioner_lastname ; ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('practitioner_firstname')?></td>
<td align="center"><strong><?= $health_care_sheet->practitioner_firstname ?></strong></td>
</tr>
<tr>
<td>Classification</td>
<td align="center"><strong><?= $health_care_sheet->practitioner_provider_class ?></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('care_condition')?></td>
<td align="center"><strong><?= $this->lang->line($health_care_sheet->care_condition) ?></strong></td>
</tr>
<?php if(isset($health_care_sheet->accident_date)){ ?>
<tr>
<td><?= $this->lang->line('accident_date'); ?></td>
<td><strong id="accident_date"></strong></td>
</tr>
<?php } ?>
<?php if(isset($health_care_sheet->pregnancy_start_at)){ ?>
<tr>
<td><?= $this->lang->line('pregnancy_start_at'); ?></td>
<td><strong id="pregnancy_start_at"></strong></td>
</tr>
<tr>
<td><?= $this->lang->line('pregnancy_end_at'); ?></td>
<td><strong id="pregnancy_end_at"></strong></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-blue-active">
<div class="inner">
<h3 style="white-space: pre-wrap; font-size: 1.9em;"><?=$health_care_sheet->type?> </h3>
<p>Type </p>
</div>
<div class="icon">
<i class="fa fa-info"></i>
</div>
</div>
</div>
<div class="col-lg-4 col-xs-6">
<div class="small-box bg-blue-active">
<div class="inner">
<h3 style="white-space: pre-wrap; font-size: 1.9em;"><?= $this->lang->line($health_care_sheet->state)?> </h3>
<p><?= $this->lang->line('Statut') ?></p>
</div>
<div class="icon">
<i class="fa fa-info"></i>
</div>
</div>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('performances') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="performances" class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th><?= $this->lang->line('act_code'); ?></th>
<th><?= $this->lang->line('Montant'); ?></th>
<th><?= $this->lang->line('moderator_ticket'); ?></th>
<th><?= $this->lang->line('insurance_amount'); ?></th>
<th><?= $this->lang->line('home_visit_fees'); ?></th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php
if (isset($performances)) {
foreach ($performances->result() as $i => $row) {
$amount = Money::of(round($row->amount, 2), $health_care_sheet->currency_code, $this->context)->formatTo('fr_FR');
$moderator_ticket = Money::of(round($row->moderator_ticket, 2), $health_care_sheet->currency_code, $this->context)->formatTo('fr_FR');
$insurance_amount = Money::of(round($row->insurance_amount, 2), $health_care_sheet->currency_code, $this->context)->formatTo('fr_FR');
$home_visit_fees = isset($row->home_visit_fees) ? Money::of(round($row->home_visit_fees, 2), $health_care_sheet->currency_code, $this->context)->formatTo('fr_FR') : '';
echo "<tr>
<td>" . ($i+1) . "</td>
<td>" . $row->act_code . "</td>
<td>" . $amount . "</td>
<td>" . $moderator_ticket . "</td>
<td>" . $insurance_amount . "</td>
<td>".$home_visit_fees."</td>
<td>" . $row->created_at. "</td>";
?>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('exams') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="exams" class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th><?= $this->lang->line('exam_class'); ?></th>
<th><?= $this->lang->line('exam_description'); ?></th>
<th><?= $this->lang->line('quantity'); ?></th>
</tr>
</thead>
<tbody>
<?php
if (isset($exams)) {
foreach ($exams->result() as $i => $row) {
// $amount = Money::of(round($row->amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR');
echo "<tr>
<td>" . ($i+1) . "</td>
<td>" . $row->act_name . "</td>
<td>" . $row->description . "</td>
<td>" . $row->quantity. "</td>"
?>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title"><?= $this->lang->line('medical_prescriptions') ?></h3>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="prescriptions" class="table table-bordered table-hover">
<thead>
<tr>
<th>#</th>
<th><?= $this->lang->line('drugs_or_device'); ?></th>
<th><?= $this->lang->line('dosage'); ?></th>
<th><?= $this->lang->line('quantity'); ?></th>
</tr>
</thead>
<tbody>
<?php
if (isset($prescriptions)) {
foreach ($prescriptions->result() as $i => $row) {
// $amount = Money::of(round($row->amount, 2), $insurance->currency_code, $this->context)->formatTo('fr_FR');
echo "<tr>
<td>" . ($i+1) . "</td>
<td>" . $row->drug_or_device_name . "</td>
<td>" . $row->dosage . "</td>
<td>" . $row->quantity. "</td>"
?>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- Slimscroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script src="<?= base_url('bower_components/jquery-ui/jquery-ui.js') ?>"></script>
<script src="<?= base_url('bower_components/moment/min/moment.min.js') ?>"></script>
<script src="https://cdn.datatables.net/select/1.3.1/js/dataTables.select.min.js"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
<script type="text/javascript">
toastr.options.closeButton = true;
toastr.options.closeMethod = 'fadeOut';
toastr.options.closeDuration = 5000;
toastr.options.closeEasing = 'swing';
$(document).ready(function () {
$('#accident_date').text(moment("<?=$health_care_sheet->accident_date?>", 'YYYY-MM-DD HH:mm:ss').format('D MMMM YYYY HH:mm:s'));
$('#pregnancy_start_at').text(moment("<?=$health_care_sheet->pregnancy_start_at?>", 'YYYY-MM-DD HH:mm:ss').format('D MMMM YYYY HH:mm:s'));
$('#pregnancy_end_at').text(moment("<?=$health_care_sheet->pregnancy_end_at?>", 'YYYY-MM-DD HH:mm:ss').format('D MMMM YYYY HH:mm:s'));
});
const format = "<?=$this->session->userdata('site_lang')?>" === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
$('#performances').DataTable(
{
order: [[1, 'asc']],
"columnDefs": [{
"targets": [6],
// "orderable": false,
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
"extend": 'excelHtml5',
title: "<?= $this->lang->line('performances') . ' :: ' . $this->lang->line('health_care_sheet_infos') . ' - ' . $health_care_sheet_id?>",
// exportOptions: {
// columns: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
// },
customizeData: function (data) {
for (var i = 0; i < data.body.length; i++) {
for (var j = 0; j < data.body[i].length; j++) {
// data.body[i][j] = '\u200C' + data.body[i][j];
if ([5].includes(j)) {
// Get the value and strip the non numeric characters
// var value = $(this).text();
value = data.body[i][j].replace(',', ".")
data.body[i][j] = Number(value.replace(/[^0-9\.-]+/g, ""));
}
}
}
},
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('performances') . ' :: ' . $this->lang->line('health_care_sheet_infos') . ' - ' . $health_care_sheet_id?>",
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('performances') . ' :: ' . $this->lang->line('health_care_sheet_infos') . ' - ' . $health_care_sheet_id?>",
},
// 'colvis'
]
}
);
$('#exams').DataTable(
{
order: [[1, 'asc']],
}
);
$('#prescriptions').DataTable(
{
order: [[1, 'asc']],
}
);
</script>

View File

@ -0,0 +1,206 @@
<!-- DataTables -->
<link rel="stylesheet"
href="<?= base_url('bower_components/datatables.net-bs/css/dataTables.bootstrap.min.css') ?>">
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css"/>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/buttons/1.6.2/css/buttons.dataTables.min.css">
<link rel="stylesheet" href="<?= base_url('bower_components/toastr/toastr.css') ?>">
<div class="content-wrapper">
<?php
?>
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
<?= $this->lang->line('manage_health_care_sheets') ?>
<!-- <input type="button" class="btn btn-primary pull-right" id="Bactiver"-->
<!-- value="Activer/Désactiver le(s) réseau(x)" />-->
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="info-box">
<span class="info-box-icon bg-aqua"><i class="ion ion-android-time"></i></span>
<div class="info-box-content">
<span class="info-box-text"><?= $this->lang->line('Période') ?> </span>
<span class="info-box-number">
<input id="picker"
style="background: #fff; cursor: pointer; padding: 1px 1px; border: 1px solid #ccc; width: 100%"
data-category="<?= isset($category) ? $category : null ?>"
type="text" name="daterange"
data-lang="<?= $this->session->userdata('site_lang') ?>"
value="<?= ($startDate != null & $endDate != null) ? $startDate . ' - ' . $endDate : '' ?>"/>
</span>
<span> Format : <?= $this->session->userdata('site_lang') === 'french' ? 'Jour - Mois - Année ' : 'Year - Month - Day' ?> </span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= $this->lang->line('export_health_care_sheets_list') ?></h3>
<div class="box-tools">
</div>
</div>
<div class="box-body" style="overflow-x:auto;">
<table id="subscriptions" class="table table-bordered table-striped">
<thead>
<tr>
<th align='center'><?= $this->lang->line('health_care_sheet_id') ?></th>
<th>Type</th>
<th><?= $this->lang->line('insured_id') ?></th>
<th><?= $this->lang->line('patient_lastname') ?></th>
<th><?= $this->lang->line('patient_situation') ?></th>
<th><?= $this->lang->line('institution_name') ?></th>
<th><?= $this->lang->line('practitioner_lastname') ?></th>
<th><?= $this->lang->line('care_condition') ?></th>
<th><?= $this->lang->line('state') ?></th>
<th align='center'>Date</th>
<th align='center'>Action</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<!-- jQuery 3 -->
<script src="<?= base_url('bower_components/jquery/dist/jquery.min.js') ?>"></script>
<!-- Bootstrap 3.3.7 -->
<script src="<?= base_url('bower_components/bootstrap/dist/js/bootstrap.min.js') ?>"></script>
<!-- DataTables -->
<script src="<?= base_url('bower_components/datatables.net/js/jquery.dataTables.min.js') ?>"></script>
<script src="<?= base_url('bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js') ?>"></script>
<!-- SlimScroll -->
<script src="<?= base_url('bower_components/jquery-slimscroll/jquery.slimscroll.min.js') ?>"></script>
<!-- FastClick -->
<script src="<?= base_url('bower_components/fastclick/lib/fastclick.js') ?>"></script>
<!-- AdminLTE App -->
<script src="<?= base_url('dist/js/adminlte.min.js') ?>"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?= base_url('dist/js/demo.js') ?>"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment-with-locales.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.19/sorting/datetime-moment.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/plug-ins/1.10.20/dataRender/datetime.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/dataTables.buttons.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/pdfmake.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.53/vfs_fonts.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.html5.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.print.min.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/buttons/1.6.2/js/buttons.colVis.min.js"></script>
<script src="<?= base_url('dist/js/sweetalert2.js') ?>"></script>
<script src="<?= base_url('bower_components/toastr/toastr.js') ?>"></script>
<script>
$(function () {
const lang = $('#picker').data('lang');
const format = lang === 'french' ? 'fr' : 'en';
moment.updateLocale(moment.locale(format), {invalidDate: ""}); // Blank text when is invalid date
var table = $('#subscriptions').DataTable({
// Processing indicator
"processing": true,
"language": {
"processing": "<?= $this->lang->line('loading') ?>",
"emptyTable" : "<?= $this->lang->line('no_insured') ?>"
},
// DataTables server-side processing mode
"serverSide": true,
// Initial no order.
"order": [],
// Load data from an Ajax source
"ajax": {
"url": "<?= base_url('pagination/HealthCareSheets/getLists'); ?>",
"data":{
"startDate" : "<?= $startDate?>",
"endDate" : "<?= $endDate?>",
"id_network" : "<?= $id_network ?>",
"currentURL" : "<?= current_url()?>"
},
"type": "POST"
},
"aaSorting": [[9, "desc"]],
"columnDefs": [{
"targets": [9],
// "orderable": false,
render: $.fn.dataTable.render.moment('YYYY-MM-DD HH:mm:ss', 'D MMMM YYYY HH:mm:ss', format)
}],
dom: 'Bfrtip',
"buttons": [
'pageLength',
{
"extend": 'excelHtml5',
title: "<?= $this->lang->line('subscriptions_history') ?>",
},
{
extend: 'csvHtml5',
title: "<?= $this->lang->line('subscriptions_history') ?>",
},
{
extend: 'pdfHtml5',
orientation: 'landscape',
pageSize: 'LEGAL',
title: "<?= $this->lang->line('subscriptions_history') ?>",
trim: false,
"action": newexportaction
},
// 'colvis'
]
});
table.buttons().container()
.appendTo('#example_wrapper .col-sm-6:eq(0)');
});
</script>
<script type="text/javascript">
var startDate;
var endDate;
$(function () {
const lang = $('#picker').data('lang');
const category = $('#picker').data('category');
const id_network = "<?= $id_network?>";
$('input[name="daterange"]').daterangepicker({
opens: 'left',
autoUpdateInput: false,
locale: {
format: lang === 'french' ? 'DD-MM-YYYY' : 'YYYY-MM-DD',
cancelLabel: 'Clear'
}
}, function (start, end, label) {
const debut = start.format('YYYY-MM-DD');
const fin = end.format('YYYY-MM-DD');
if(category)
window.location = "<?= current_url()?>" + "?history=insurance-health_care_sheets" + "&d=" + debut + "&f=" + fin;
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=insurance-health_care_sheets" + "&d=" + debut + "&f=" + fin;
});
$('input[name="daterange"]').on('cancel.daterangepicker', function(ev, picker) {
//do something, like clearing an input
$('#daterange').val('');
if(category)
window.location = "<?= current_url()?>" + "?history=insurance-health_care_sheets";
else
window.location = "<?= current_url()?>" + "?id="+id_network+"&history=insurance-health_care_sheets";
});
});
</script>

View File

@ -312,6 +312,7 @@
<script> <script>
var member_code = null; var member_code = null;
var categorie = null; var categorie = null;
var networkAgentId = null;
$(document).on("click", ".open-modal", function () { $(document).on("click", ".open-modal", function () {
member_code = $(this).data('member_code'); member_code = $(this).data('member_code');
@ -321,6 +322,7 @@
var email = $(this).data('email'); var email = $(this).data('email');
var contact = $(this).data('phone'); var contact = $(this).data('phone');
var provider_class_id = $(this).data('provider_class_id'); var provider_class_id = $(this).data('provider_class_id');
networkAgentId = $(this).data('network_agent_id');
$(".modal-body #nom").val(nom); $(".modal-body #nom").val(nom);
$(".modal-body #adresse").val(adresse); $(".modal-body #adresse").val(adresse);
@ -344,7 +346,8 @@
$.ajax({ $.ajax({
url: '<?= base_url('index.php/Admin/updateUser')?>', url: '<?= base_url('index.php/Admin/updateUser')?>',
type: 'post', type: 'post',
data: {code: m_code, nom: m_nom, adresse: m_adresse, email: m_email, contact: m_contact, cat: m_cat, provider_class_id : m_provider_class_id}, data: {code: m_code, nom: m_nom, adresse: m_adresse, email: m_email, contact: m_contact, cat: m_cat,
provider_class_id : m_provider_class_id, network_agent_id : networkAgentId },
dataType: 'json', dataType: 'json',
success: function (data) { success: function (data) {
if (data === 'completed') { if (data === 'completed') {