Skip to content

Instantly share code, notes, and snippets.

@iaditya
Created April 28, 2017 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iaditya/fec07ffa55840e7ee49df7f5338da131 to your computer and use it in GitHub Desktop.
Save iaditya/fec07ffa55840e7ee49df7f5338da131 to your computer and use it in GitHub Desktop.
EventsController/ patientfeed() function
$patient_uuid = !$event->patient->external_patient_id ? $event->patient->patient_uuid : $event->patient->external_patient_id;
// aditya changes -
$last_visit_date = $this->lastVisitDate($event->patient->id, $event->facility->id);
// For last_vist date , please check for null then appply below date function, whereever you call
$last_visit_date = ($last_visit_date != null) ? (new Date($last_visit_date))->timeAgoInWords() : null;
$age = !($event->patient->age == "Not Defined") ? (" | ". $event->patient->age . " years old ") : "";
/*
* 'title' => $patient . " | " . $event->patient->sex . $age . $last_visit_date,
*/
$data[] = array(
'id' => $event->id,
'title' => $event->title,
'start' => $event->start,
'end' => $end,
'allDay' => $allday,
// 'url' => '/events/view/'.$event->id,
'patient_uuid' => $patient_uuid,
'provider' => $provider,
'patient' => $patient,
'facility' => $facility,
'url' => '/events/edit/' . $event->id,
'teleurl' => $teleurl,
'description' => $event->details,
'status' => $event->status,
'color' => $color
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment