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;
     }
 }
Beispiel #2
0
function TrataDadosExamesDetalhes($template)
{
    if (isset($_SESSION['caso']) && $_SESSION['caso'] != 0) {
        $codexame = base64_decode($_POST['r']);
        $_SESSION['exame'] = $codexame;
        $e = new Exame();
        $t = new TipoExame();
        $e->Carrega($_SESSION['caso'], $codexame);
        $t->Carrega($e->getTipo());
        if ($t->getPodeImgs()) {
            $listaimgs = '<h4>@lng[Imagens anexadas ao exame] <span class="nomeexame">"' . $e->getDescricao() . '"</span></h4>';
            $listaimgs .= '<div id="lista-imgs">';
            $listaimgs .= $e->ListaArquivosExame($_SESSION['caso'], $codexame, "img");
            $listaimgs .= '</div>';
            $template = str_replace("<!--listaimagens-->", $listaimgs, $template);
        } else {
            $template = str_replace("<!--listaimagens-->", "", $template);
        }
        if ($t->getPodeDocs()) {
            $listadocs = '<h4>@lng[Documentos anexados ao exame] <span class="nomeexame">"' . $e->getDescricao() . '"</span></h4>';
            $listadocs .= '<div id="lista-docs">';
            $listadocs .= $e->ListaArquivosExame($_SESSION['caso'], $codexame, "doc");
            $listadocs .= '</div>';
            $template = str_replace("<!--listadocs-->", $listadocs, $template);
        } else {
            $template = str_replace("<!--listadocs-->", "", $template);
        }
        if ($t->getPodeVals()) {
            $listavalref = '<div id="divLancaValores">';
            $listavalref .= $e->ListaValoresReferencia($_SESSION['caso'], $codexame);
            $listavalref .= '</div>';
            $template = str_replace("<!--lancavaloresrefexame-->", $listavalref, $template);
        } else {
            $template = str_replace("<!--lancavaloresrefexame-->", "", $template);
        }
        $template = str_replace("<!--laudo-->", is_null($e->getLaudo()) ? "" : $e->getLaudo(), $template);
        return $template;
    } else {
        return "@lng[Erro ao localizar o caso de estudo]";
    }
}