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

getLetterOutcomeFollowUpPeriod() public method

get follow up period from clinical outcome.
public getLetterOutcomeFollowUpPeriod ( Patient $patient ) : string
$patient Patient
return string
    public function getLetterOutcomeFollowUpPeriod($patient)
    {
        if ($api = \Yii::app()->moduleAPI->get('PatientTicketing')) {
            if ($patient_ticket_followup = $api->getLatestFollowUp($patient)) {
                if (@$patient_ticket_followup['followup_quantity'] == 1 && @$patient_ticket_followup['followup_period']) {
                    $patient_ticket_followup['followup_period'] = rtrim($patient_ticket_followup['followup_period'], 's');
                }
                return $patient_ticket_followup['followup_quantity'] . ' ' . $patient_ticket_followup['followup_period'] . ' in the ' . $patient_ticket_followup['clinic_location'];
            }
        }
        if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
            if ($o = $this->getElementForLatestEventInEpisode($episode, 'models\\Element_OphCiExamination_ClinicOutcome')) {
                if ($o->followup_quantity) {
                    return $o->followup_quantity . ' ' . $o->followup_period;
                }
            }
        }
    }
OphCiExamination_API