public function getInjectionQuestionsForSide($side)
{
// need to get the questions for the set disorders. And then check if there are already answers on the side
// if there are, then check for any missing questions, in case they've been disabled since
$answered_question_ids = array();
foreach ($this->{$side . '_answers'} as $answer) {
$answered_question_ids[] = $answer->question_id;
}
$questions = array();
$qids = array();
if ($did = $this->{$side . '_diagnosis1_id'}) {
foreach ($this->getInjectionQuestionsForDisorderId($did, $answered_question_ids) as $question) {
$questions[] = $question;
$qids[] = $question->id;
}
}
if ($did = $this->{$side . '_diagnosis2_id'}) {
foreach ($this->getInjectionQuestionsForDisorderId($did, $answered_question_ids) as $question) {
$questions[] = $question;
$qids[] = $question->id;
}
}
foreach ($this->{$side . '_answers'} as $answer) {
if (!in_array($answer->question_id, $qids)) {
$questions[] = $answer->question;
}
}
return $questions;
}