Beispiel #1
0
 private function RenderResultadoExame($codexame, $confs)
 {
     //Log::RegistraLog("DEBUG REGIS 19 - Ordem render exame. CodCaso: " . $this->codcaso . "; CodExame: " . $codexame);
     $exame = new Exame();
     $exame->setCodcaso($this->codcaso);
     if ($exame->Carrega($this->codcaso, $codexame)) {
         $temimgs = false;
         $temlabs = false;
         $temdocs = false;
         $html .= '<div class="tit-exame">' . $exame->getDescricao() . ' - resultado</div>';
         // Se foi cadastrado laudo, mostra o laudo
         if ($exame->getLaudo() != null) {
             $html .= '<div class="tit-item">@lng[Laudo]</div>';
             $html .= '<span>' . $exame->getLaudo() . '</span><br />';
         }
         // Busca as imagens do exame se tiver
         $imagens = $exame->ListaRecordSetImagensItensExame();
         if ($imagens !== false) {
             $html .= '<div class="recuo">';
             // se encontrou... mostra elas
             foreach ($imagens as $imgexame) {
                 $midia = new Midia();
                 $midia->setCodCaso($this->codcaso);
                 $midia->setCodMidia($imgexame->Valor);
                 $midia->CarregaPorCodigoEspecifico();
                 $html .= '<div class="descr-img"><strong>@lng[Descrição]</strong></div><div>' . $midia->getDescricao() . '</div>';
                 $html .= '<img class="img-apres thumbatual" src="viewimagem.php?img=' . base64_encode($imgexame->Valor) . '" title="@lng[Imagem]: ' . $midia->getDescricao() . '" alt="@lng[Imagem]: ' . $midia->getDescricao() . '">';
                 if (!is_null($midia->getComplemento()) && strip_tags($midia->getComplemento()) != '') {
                     $html .= '<div class="descr-img"><strong>@lng[Complemento]: </strong>' . $midia->getComplemento() . '</div>';
                 }
             }
             $temimgs = true;
             $html .= '</div>';
         }
         $documentos = $exame->ListaRecordSetDocumentosItensExame();
         if ($documentos !== false) {
             $html .= '<div class="recuo">';
             if ($temimgs) {
                 $html .= '<div class="separador"></div>';
             }
             // se encontrou... mostra eles
             foreach ($documentos as $docexame) {
                 $midia = new Midia();
                 $midia->setCodCaso($this->codcaso);
                 $midia->setCodMidia($docexame->Valor);
                 $midia->CarregaPorCodigoEspecifico();
                 $html .= '<img src="img/documento.png" title="' . $midia->getDescricao() . '" />';
                 $html .= '<a class="lnk-doc" href="' . $midia->getURL() . '" title="@lng[Clique para abrir/baixar o documento]">' . $midia->getDescricao() . '</a>';
                 if (strip_tags($midia->getComplemento()) != '') {
                     $html .= '<div class="descr-img"><strong>@lng[Complemento]: </strong>' . $midia->getComplemento() . '</div>';
                 }
             }
             $temdocs = true;
             $html .= '</div>';
         }
         // Exames laboratoriais
         $laboratoriais = $exame->ListaRecordSetResultadosExamesLaboratoriais();
         if ($laboratoriais !== false) {
             $html .= '<div class="recuo">';
             if ($temdocs || $temimgs) {
                 $html .= '<div class="separador"></div>';
             }
             if ($exame->getTemComponentes() == 1) {
                 $html .= '<div class="tit-item">@lng[Resultados do exame]</div>';
                 $html .= '<table class="tab-result-exame">';
                 $html .= '<tr>';
                 $html .= '<th>@lng[Item]</th>';
                 $html .= '<th>@lng[Valor]</th>';
                 $html .= '<th>@lng[Complemento]</th>';
                 $html .= '</tr>';
                 foreach ($laboratoriais as $componente) {
                     //CodComponente, NomeComponente e Valor
                     $html .= '<tr>';
                     $html .= '<td>' . $componente->NomeComponente . '</td>';
                     $html .= '<td>' . $componente->Valor . '</td>';
                     $html .= '<td>' . ($componente->Complemento != null ? $componente->Complemento : '') . '</td>';
                     $html .= '</tr>';
                 }
                 $html .= '</table>';
             } else {
                 $html .= '<div class="tit-item">@lng[Resultados do exame]</div>';
                 $html .= '<span>' . $laboratoriais[0]->Valor . ($componente->Complemento != null ? ' (' . $componente->Complemento . ')' : '') . '</span>';
             }
             $html .= '</div>';
             $temlabs = true;
         }
         if (!$temdocs && !$temimgs && !$temlabs && $exame->getLaudo() == null) {
             $html .= '<div class="recuo">';
             $html .= '<div class="tit-item"><span style="color:#ff0000;">@lng[Este exame não foi solicitado para este caso clínico].</span></div>';
             $html .= '</div>';
         }
         // Colocar o saiba mais aqui
         return $html;
     } else {
         return "@lng[Erro ao carregar o exame]" . $codexame;
     }
 }