OEModule\OphCiExamination\components\OphCiExamination_API::getGlaucomaRisk PHP Method

getGlaucomaRisk() public method

Get the glaucoma risk as a string for the patient - we get this from the most recent examination that has a glaucoma risk recording as it's possible that it's not going to be recorded each time.
public getGlaucomaRisk ( Patient $patient ) : mixed
$patient Patient
return mixed
    public function getGlaucomaRisk($patient)
    {
        if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
            $event_type = $this->getEventType();
            if ($el = $this->getMostRecentElementInEpisode($episode->id, $event_type->id, 'models\\Element_OphCiExamination_GlaucomaRisk')) {
                return $el->risk->name;
            }
        }
    }
OphCiExamination_API