410 lines
15 KiB
PHP
Executable File
410 lines
15 KiB
PHP
Executable File
<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>
|