コード例 #1
0
ファイル: add_bandalarga.php プロジェクト: jquerubim10/laudos
<?
	Util::VerificaChamada();
	$o = new Interpretacao();

	foreach($o->propertiesGetConfig() as $campo => $config){
		$tpl->assign($campo, 		$_POST[$campo]);
		//$o->set($campo,				$_POST[$campo]);
		//util::prt($campo, $_POST[$campo]);
	}
	$tpl->assign("vet_exames", 	Exame::getOptions());
	$tpl->assign("vet_convenios", 	Convenio::getOptions());
	if ($_POST[form] == "ok"){
		$data_cadastro		= date("Y-m-d H:i:s");
		$con		= new Convenio($_POST["con_id"]);
		$hos		= new Hospital($con->get("hos_id"));
		$exa		= new Exame($_POST["exa_id"]);
		
		$o->set("hos_id"				, $con->get("hos_id"));
		$o->set("con_id"   				, $_POST["con_id"]);
		$o->set("exa_id"   				, $_POST["exa_id"]);
		
		$o->set("int_status"   					, "nao_interpretado");
		$o->set("int_data_cadastro"				, $data_cadastro);
		
		$o->set("int_paciente_nome"   			, $_POST["int_paciente_nome"]);
		$o->set("int_paciente_sexo"   			, $_POST["int_paciente_sexo"]);
		$o->set("int_paciente_nascimento"		, Formatacao::formatData($_POST["int_paciente_nascimento"]));
		$o->set("int_paciente_prontuario"   	, $_POST["int_paciente_prontuario"]);
		$o->set("int_opcional"   				, $_POST["int_opcional"]);
		$o->set("int_tecnico_rx"   				, $_POST["int_tecnico_rx"]);
		$o->set("int_requisitante"   			, $_POST["int_requisitante"]);
コード例 #2
0
    /**
     * monta um array com os dados que deverão ser exibidos em options de select
	 *
     * @return array
     */
	function getOptions(){
		$objs	= Interpretacao::getAll();
        $out 	= array();
        foreach($objs as $o) {
            $out[$o->get("int_id")] = $o->get("int_paciente_nome");
        }
        return $out;
	}
コード例 #3
0
ファイル: class.Laudos.php プロジェクト: jquerubim10/laudos
    /**
     * gera um pdf dos laudos
	 *
	 * @param array $r
     */
	function pdfLaudos($rs){
	
		//error_reporting(E_ALL);
		set_time_limit(1800);
		include 'lib/php/classes/class.ezpdf.php';
		
		$pdf = new Cezpdf('a4','portrait');
		$pdf -> ezSetMargins(50,70,50,50);
		$all = $pdf->openObject();
		$pdf->saveState();
		$pdf->setStrokeColor(0,0,0,1);
		$pdf->restoreState();
		$pdf->closeObject();
		$pdf->addObject($all,'all');
		$mainFont = './fonts/Courier.afm';
		$codeFont = './fonts/Courier.afm';
		$pdf->selectFont($mainFont);
		$n_rows = sizeof($rs);

		$c = 0;
		$t=945;
		$fator = 25;
		foreach($rs as $id => $r){
			$o = new Interpretacao($r["int_id"]);
			
			$hos = new Hospital($o->get("hos_id"));
			$hos_nome = $hos->get("hos_nome");
			
			$con = new Convenio($o->get("con_id"));
			$con_nome = $con->get("con_nome");
			
			$exa = new Exame($o->get("exa_id"));
			$exa_nome = $exa->get("exa_nome");
			
			$pdf->ezText($hos_nome,18,array('justification'=>'center')); 
			$pdf->ezText(" ",20,array('justification'=>'left'));
			$pdf->ezText("PACIENTE      : ".$r["int_paciente_prontuario"]."   ".$r["int_paciente_nome"],10,array('justification'=>'left'));

			if ($r["int_paciente_nascimento"] == "0000-00-00")
				$pdf->ezText("NASCIMENTO    :                                   SEXO: ".$r["int_paciente_sexo"],10,array('justification'=>'left'));
			else
				$pdf->ezText("NASCIMENTO    : ".Formatacao::formatBrData($r["int_paciente_nascimento"])."                        SEXO: ".$r["int_paciente_sexo"],10,array('justification'=>'left'));
		
			$pdf->ezText("CONVÊNIO      : ".$con_nome,10,array('justification'=>'left'));
			$pdf->ezText("EXAME         : ".$exa_nome,10,array('justification'=>'left'));

			$pdf->ezText(" ",20,array('justification'=>'left'));

			$pdf->ezText("                                                  DATA: ".Formatacao::formatBrDataHoraminSeg($r["int_data_interpretacao"]),10,array('justification'=>'left'));
			$pdf->ezText("N DO EXAME               : ".$r["int_opcional"],10,array('justification'=>'left'));
			$pdf->ezText("MÉDICO REQUISITANTE      : ".$r["int_requisitante"],10,array('justification'=>'left'));
			$pdf->ezText("EXAME INTERPRETADO POR   : 9679 Ernesto Sousa Nunes",10,array('justification'=>'left'));
			$pdf->ezText("TÉCNICO RX               : ".$r["int_tecnico_rx"],10,array('justification'=>'left'));
			
			$pdf->ezText(" ",20,array('justification'=>'left'));
			
			$pdf->ezText("I N T E R P R E T A Ç Ã O",18,array('justification'=>'center')); 
			
			$pdf->ezText(" ",20,array('justification'=>'left'));
			
			$vet_txt = split("\n",$r["int_texto"]);
			
			$pdf->ezText("============================================================================",10,array('justification'=>'left'));
			
			$pdf->ezText(" ",8,array('justification'=>'left'));
			
			foreach($vet_txt as $linha){
				$pdf->ezText("      ".$linha,10,array('justification'=>'left'));
			}
			$pdf->ezText(" ",8,array('justification'=>'left'));
			
			$pdf->ezText("============================================================================",10,array('justification'=>'left'));
			
			$pdf->ezText("              Exame interpretado por: 9676 - Dr. Ernesto Sousa Nunes",10,array('justification'=>'left'));
			$pdf->addJpegFromFile('ass.jpg',250, 0);
			$pdf->openHere('Fit');
			if ($c+1 < $n_rows)
				$pdf->ezNewPage();
			$c++;
			
			$o->informaImpressao();
			//$sql = "update laudo set LAU_DATA_EXPORTACAO = now() where LAU_ID = ".$r["LAU_ID"]." LIMIT 1";
			//$up = mysql_query($sql, $db) or die(mysql_error());
		 }
		
		$pdfcode = $pdf->Output();
		//$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
		//$cont = trim($pdfcode);
		$fh = fopen("laudos_prontos.pdf", 'w+');
		fwrite($fh, $pdfcode);
		fclose($fh);
		?><script language="javascript">document.location.href="laudos_prontos.pdf";</script><?

	}
コード例 #4
0
ファイル: add_discado.php プロジェクト: jquerubim10/laudos
		$_POST[$name]		= split($sep,$_POST[$name]);
		unset($_POST[$name][0]);
		$name				= "opcionais";
		$_POST[$name]		= split($sep,$_POST[$name]);
		unset($_POST[$name][0]);
		$name				= "requisitantes";
		$_POST[$name]		= split($sep,$_POST[$name]);
		unset($_POST[$name][0]);
		$name				= "tecnicos";
		$_POST[$name]		= split($sep,$_POST[$name]);
		unset($_POST[$name][0]);
	//	prt("", $_POST);
	//	exit();
		$data_cadastro		= date("Y-m-d H:i:s");
		for($i=1; $i<=intval($_POST["contador"]); $i++){
			$o = new Interpretacao();
			$con		= new Convenio($_POST["convenios"][$i]);
			$hos		= new Hospital($con->get("hos_id"));
			$exa		= new Exame($_POST["exames"][$i]);
			
			$o->set("hos_id"				, $con->get("hos_id"));
			$o->set("con_id"   				, $_POST["convenios"][$i]);
			$o->set("exa_id"   				, $_POST["exames"][$i]);
			
			$o->set("int_status"   					, "nao_interpretado");
			$o->set("int_data_cadastro"				, $data_cadastro);
			
			$o->set("int_paciente_nome"   			, $_POST["nomes"][$i]);
			$o->set("int_paciente_sexo"   			, $_POST["sexos"][$i]);
			$o->set("int_paciente_nascimento"		, Formatacao::formatData($_POST["datas"][$i]));
			$o->set("int_paciente_prontuario"   	, $_POST["prontuarios"][$i]);
コード例 #5
0
ファイル: update.php プロジェクト: jquerubim10/laudos
<?
	Util::VerificaChamada();
	if(is_numeric($_GET[id])){
		if($_SESSION["medico"] == "1"){
			$o = new Interpretacao($_GET[id]);
			
			foreach($o->propertiesGetConfig() as $campo => $config){
				$tpl->assign($campo, 		(empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo]));
				//util::prt($campo, (empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo]));
				//$o->set($campo,				$_POST[$campo]);
			}
			$hos = new Hospital($o->get("hos_id"));
			$tpl->assign("hos_nome", 	$hos->get("hos_nome"));
			
			$con = new Convenio($o->get("con_id"));
			$tpl->assign("con_nome", 	$con->get("con_nome"));
			
			$exa = new Exame($o->get("exa_id"));
			$tpl->assign("exa_nome", 	$exa->get("exa_nome"));
			
			$tpl->assign("textos", 	TextoPadrao::getToJs());
			
			if ($_POST[form] == "ok"){
				$o->propertiesClearConfig();
				$o->propertiesSetConfig(
					array(
						"int_status"	=> array(
							"titulo"		=> "Situação",
							"requerido"		=> "",
							"validacao"		=> "Text",
						),
コード例 #6
0
ファイル: index.php プロジェクト: jquerubim10/laudos
		$tpl->assign("link_ordenacao", 			$o->getLinksOrdenacao());
		$tpl->assign("vet_tamanho_pagina", 		array("10", "20", "30", "50", "100", "300", "500"));
		$tpl->assign("tamanho_pagina", 			$tamanho_pagina);
		$tpl->assign("total_registros", 		$p->getTotalRegistros());
		$tpl->assign("registros", 				$p->getRegistrosPagina());
		$tpl->assign("paginacao", 				$p->getHtml());
		$template_html = $path_tpl."gerenciar.tpl";
	} else {
		//util::prt("", $p->getRegistrosPagina());
		$max_caracteres = 75;
		$rs = array();
		$i = 0;
		foreach($p->getRegistrosPagina() as $id => $r){
			//util::prt("", $r);
			$rs[$i]	= $r;
			$o = new Interpretacao($r["int_id"]);
			$hos = new Hospital($o->get("hos_id"));
			$rs[$i]["hos_nome"] = $hos->get("hos_nome");
			$con = new Convenio($o->get("con_id"));
			$rs[$i]["con_nome"] = $con->get("con_nome");
			$exa = new Exame($o->get("exa_id"));
			$rs[$i]["exa_nome"] = $exa->get("exa_nome");
			$vet_txt = split("\n",$r["int_texto"]);
			$rs[$i]["int_texto"] = "";
			foreach($vet_txt as $linha){
				if(strlen($linha) > $max_caracteres){
					//util::prt(strlen($linha), $linha);
					$parte1	= substr($linha,0,$max_caracteres)."\n";
					$parte2	= substr($linha,$max_caracteres,$max_caracteres)."\n";
					$parte3	= substr($linha,$max_caracteres*2,$max_caracteres)."\n";
					$parte4	= substr($linha,$max_caracteres*3,$max_caracteres)."\n";