getEpisodeForCurrentSubspecialty() public method

Get the episode for the subspecialty of the firm (or no subspecialty when the firm doesn't have one).
public getEpisodeForCurrentSubspecialty ( ) : Episode
return Episode
 /**
  * get the prescription letter text for the latest prescription in the episode for the patient.
  *
  * @param Patient $patient
  * @param Episode $episode
  *
  * @return string
  */
 public function getLetterPrescription($patient)
 {
     if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
         if ($details = $this->getElementForLatestEventInEpisode($episode, 'Element_OphDrPrescription_Details')) {
             return $details->getLetterText();
         }
     }
 }
 /**
  * Return the list of procedures as a string for use in correspondence for the given patient and episode.
  * if the $snomed_terms is true, return the snomed_term, otherwise the standard text term.
  *
  * @param Patient $patient
  * @param Episode $episode
  * @param bool    $snomed_terms
  *
  * @return string
  */
 public function getLetterProcedures($patient)
 {
     $return = '';
     if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
         if ($plist = $this->getElementForLatestEventInEpisode($episode, 'Element_OphTrOperationnote_ProcedureList')) {
             foreach ($plist->procedures as $i => $procedure) {
                 if ($i) {
                     $return .= ', ';
                 }
                 $return .= $plist->eye->adjective . ' ' . $procedure->term;
             }
         }
     }
     return $return;
 }
 /**
  * get the therapy application diagnosis description for the right if there is one.
  *
  * @param Patient $patient
  *
  * @return mixed
  */
 public function getLetterApplicationDiagnosisRight($patient)
 {
     if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
         return $this->getLetterApplicationDiagnosisForSide($patient, $episode, 'right');
     }
 }
 /**
  * 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.
  *
  * @param \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;
         }
     }
 }
 /**
  * get the procedures for this patient and episode as a string for use in correspondence.
  *
  * @param Patient $patient
  * @param Episode $episode
  *
  * @return string
  */
 public function getLetterProcedures($patient)
 {
     if ($episode = $patient->getEpisodeForCurrentSubspecialty()) {
         $return = '';
         if ($operation = $this->getElementForLatestEventInEpisode($episode, 'Element_OphTrOperationbooking_Operation')) {
             foreach ($operation->procedures as $i => $procedure) {
                 if ($i) {
                     $return .= ', ';
                 }
                 $return .= $operation->eye->adjective . ' ' . $procedure->term;
             }
         }
         return strtolower($return);
     }
 }