View patientDashboardApi
//using on patientDashboard - from today
public function nextAppointment($patient_id) {
$start = Time::now()->toDateString(); // today
$event = $this->Events->findByPatientId($patient_id)
->contain(['Facilities', 'Providers' => ['Users']])
->where(['Events.start >= :now'])
->bind(':now', $start, 'time')->first();
$this->set(compact('event'));
View EncountersCtrl
public function bmiGraphApi($patient_id) {
if(!empty($patient_id)) {
$query = $this->Encounters->find()
->join(['Patients']);
$time = $query->func()->date_format([
'Encounters.visitdate' => 'identifier',
"'%m-%d-%y'" => 'literal'
]);
$data = $query->select([ 'visitdate' => $time, 'bmi' => 'Patients.bmi'])
View auto_sort_object
success: function (response) {
if (response) {
var eventData = response.events;
var arr = [], i;
for (i in eventData) arr.push([i, eventData[i]].join('$$'));
var reverseData = arr.reverse();
var append_text = "";
View city - select 2
<script>
$(".cd-select").select2({
placeholder: 'Click and type',
allowClear: true,
ajax: {
url: function (params) {
return '/citiesDistricts/searchDistricts.json?q=' + params.term;
},
dataType: 'json',
View ajax
select: function(startDate, endDate, jsEvent, view,resource) {
// here startDate and endDate will give you the date-range selected
//alert(startDate);
//alert(slotType);
console.log(view);
if (!startDate.hasTime()) {
// alert("Date has time: " + startDate.hasTime());
return false;
// should be all-day
}
View test.ctp
<?php
echo $this->Html->script('moment/moment.min');
echo $this->Html->css('AdminLTE./plugins/datepicker/datepicker3');
echo $this->Html->css('AdminLTE./bootstrap/css/bootstrap-datetimepicker.min');
echo $this->Html->script('AdminLTE./bootstrap/js/bootstrap-datetimepicker');
echo $this->Html->script('AdminLTE./plugins/datepicker/bootstrap-datepicker');
?>
<script type="text/javascript">
View ajax example
<script type="text/javascript">
function showAjaxModal(id) {
// alert(id);
// jQuery('#issue_modal').modal('show', {backdrop: 'static'});
$("#issue_modal").modal();
jQuery.ajax({
type: 'GET',
View notification.ctp
<?php
/** System Mail Notification **/
$notificationManager->addTemplate('messageNotificationToPatient', [
'title' => 'New Message from :from_user.',
'body' => 'Hello :to_user, :from_user has sent you a message. Please check your mailbox on your talkaDoc Account.',
'smsbody' => 'Hello :to_user, :from_user has sent you a message. Please check your mailbox on your talkaDoc Account.'
]);
$notificationManager->addTemplate('messageNotificationToFAdmin', [
'title' => 'New Message from :from_user.',
View Encounters...add.ctp
<?php
echo $this->Html->script('moment/moment.min');
echo $this->Html->css('AdminLTE./plugins/datepicker/datepicker3');
echo $this->Html->css('AdminLTE./bootstrap/css/bootstrap-datetimepicker.min');
echo $this->Html->script('AdminLTE./bootstrap/js/bootstrap-datetimepicker');
echo $this->Html->script('AdminLTE./plugins/datepicker/bootstrap-datepicker');
?>
<script type="text/javascript">
View report
public function report($id)
{
$role = $this->request->session()->read('Auth.User.role');
$facilitiesTable = TableRegistry::get('Facilities');
$providersTable = TableRegistry::get('providers');
if ($role == "Provider") {
$provider_user_id = $this->request->session()->read('Auth.User.id');
$provider_id = $providersTable->findByUserId($provider_user_id)->first()->id;