Created
March 16, 2017 04:38
-
-
Save iaditya/3733577a51527ac1c43fc1e5b43688ea to your computer and use it in GitHub Desktop.
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
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']) | |
->where(['Encounters.patient_id' => $patient_id]) | |
->order(['Encounters.id' => 'DESC']) | |
->limit(15); | |
//debug($data); exit; | |
} | |
$this->set(compact('data')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment