Created
April 28, 2017 07:16
-
-
Save iaditya/fec07ffa55840e7ee49df7f5338da131 to your computer and use it in GitHub Desktop.
EventsController/ patientfeed() function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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