|
@@ -2,6 +2,12 @@
|
|
|
|
|
|
@section('content')
|
|
@section('content')
|
|
|
|
|
|
|
|
+ @if($pro->pro_type === 'ADMIN')
|
|
|
|
+ <link href="/c3/c3.min.css" rel="stylesheet">
|
|
|
|
+ <script src="/c3/d3.v5.min.js" charset="utf-8"></script>
|
|
|
|
+ <script src="/c3/c3.min.js"></script>
|
|
|
|
+ @endif
|
|
|
|
+
|
|
<?php
|
|
<?php
|
|
$showProgramsColumn = false;
|
|
$showProgramsColumn = false;
|
|
foreach($patients as $patient) {
|
|
foreach($patients as $patient) {
|
|
@@ -44,6 +50,13 @@
|
|
</select>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+
|
|
|
|
+ @if($pro->pro_type === 'ADMIN')
|
|
|
|
+ <div class="card-header px-3 py-4 d-flex align-items-center bg-white justify-content-center">
|
|
|
|
+ <div id="patientAcquisitionChart" class="w-75"></div>
|
|
|
|
+ </div>
|
|
|
|
+ @endif
|
|
|
|
+
|
|
<div class="card-body p-0">
|
|
<div class="card-body p-0">
|
|
<table class="table table-condensed p-0 m-0">
|
|
<table class="table table-condensed p-0 m-0">
|
|
<thead class="bg-light">
|
|
<thead class="bg-light">
|
|
@@ -232,7 +245,47 @@
|
|
}
|
|
}
|
|
$('#patients-search').off('submit').on('submit', submit);
|
|
$('#patients-search').off('submit').on('submit', submit);
|
|
$('#patients-filter').off('change').on('change', submit);
|
|
$('#patients-filter').off('change').on('change', submit);
|
|
|
|
+
|
|
|
|
+ @if($pro->pro_type === 'ADMIN')
|
|
|
|
+ patientAcquisitionChart();
|
|
|
|
+ @endif
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @if($pro->pro_type === 'ADMIN')
|
|
|
|
+ <?php
|
|
|
|
+ $dates = [];
|
|
|
|
+ $acquisitions = [];
|
|
|
|
+ for ($i = count($patientAcquisitionData) - 1; $i >= 0; $i--) {
|
|
|
|
+ $dates[] = $patientAcquisitionData[$i]->date;
|
|
|
|
+ $acquisitions[] = $patientAcquisitionData[$i]->count;
|
|
|
|
+ }
|
|
|
|
+ ?>
|
|
|
|
+ function patientAcquisitionChart() {
|
|
|
|
+ var chart = c3.generate({
|
|
|
|
+ bindto: '#patientAcquisitionChart',
|
|
|
|
+ data: {
|
|
|
|
+ x: 'x',
|
|
|
|
+ // xFormat: '%Y%m%d', // 'xFormat' can be used as custom format of 'x'
|
|
|
|
+ columns: [
|
|
|
|
+ ['x', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $dates)) ?>],
|
|
|
|
+ ['Patient Aquisition', <?= implode(", ", array_map(function($_x) { return "'" . $_x . "'"; }, $acquisitions)) ?>],
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ axis: {
|
|
|
|
+ x: {
|
|
|
|
+ type: 'timeseries',
|
|
|
|
+ tick: {
|
|
|
|
+ format: '%Y-%m-%d',
|
|
|
|
+ multiline: true,
|
|
|
|
+ fit: true,
|
|
|
|
+ rotate: -45
|
|
|
|
+ },
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ @endif
|
|
|
|
+
|
|
addMCInitializer('patients-list', init, '#patients-list');
|
|
addMCInitializer('patients-list', init, '#patients-list');
|
|
}).call(window);
|
|
}).call(window);
|
|
</script>
|
|
</script>
|