示例#1
0
<?
	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
<?
	Util::VerificaChamada();
	if($_GET[id]){
		$o = new ValorExame($_GET[id]);
		//$o->setDependences();
		//util::prt("", get_class_methods($o));
		foreach($o->propertiesGetConfig() as $campo => $config){
			$tpl->assign($campo, 	$o->get($campo));
		}
		$exa = new Exame($o->get("exa_id"));
		$tpl->assign("exa_nome", 	$exa->get("exa_nome"));

		$con = new Convenio($o->get("con_id"));
		$tpl->assign("con_nome", 	$con->get("con_nome"));

		$hos = new Hospital($con->get("hos_id"));
		$tpl->assign("hos_nome", 	$hos->get("hos_nome"));
		
		if ($_GET[del] == "1" || $_POST[del] == "1"){
			if ($o->delete($_GET[delete_dependences])){
				Js::goto(array("url" => "index.php?s=valor_exame"));
			} else {
				$dep = $o->getDependences();
				if (sizeof($dep)){
					$tpl->assign("dependences", 	$dep);
				}
			}
		}
	} else {
		Js::goto(array("url" => "index.php?s=convenio"));
	}
示例#3
0
    /**
     * 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
<?
	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",
						),
示例#5
0
<?
	Util::VerificaChamada();
	if($_GET[id]){
		$o = new Convenio($_GET[id]);
		
		foreach($o->propertiesGetConfig() as $campo => $config){
			$tpl->assign($campo, 		(empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo]));
			$o->set($campo,				$_POST[$campo]);
		}
		$tpl->assign("vet_hospitais", 	Hospital::getOptions());
		$tpl->assign("vet_convenios", 	Convenio::getOptions());
		if ($_POST[form] == "ok"){
			if ($o->update()){
				if ($_POST["con_convenio_desc"] != ""){
					$o->descontaValores($_POST["con_desconto"], $_POST["con_convenio_desc"]);
				}
				Js::goto(array("url" => "index.php?s=convenio"));
			} else {
				foreach($o->errors as $campo => $erro){
					$tpl->assign($campo."_erro", $erro);
					$tpl->assign($campo, "");
				}
			}
		}
	} else {
		Js::goto(array("url" => "index.php?s=convenio"));
	}
	
	$template_html = $path_tpl."formulario.tpl";
?>
示例#6
0
<?
	Util::VerificaChamada();
	if($_GET[id]){
		$o = new ValorExame($_GET[id]);

		$con_id = (empty($_POST["con_id"]) ? $o->get("con_id") : $_POST["con_id"]);
		if ($con_id){
			$con = new Convenio($con_id);
			$tpl->assign("con_valor_ch", 	$con->get("con_valor_ch"));
			$tpl->assign("con_valor_filme",	$con->get("con_valor_filme"));
		}

		foreach($o->propertiesGetConfig() as $campo => $config){
			$tpl->assign($campo, 		(empty($_POST[$campo]) ? $o->get($campo) : $_POST[$campo]));
			$o->set($campo,				$_POST[$campo]);
		}
		$tpl->assign("vet_exames", 				Exame::getOptions());
		$tpl->assign("vet_convenios", 			Convenio::getOptions());
		
		if ($_POST[form] == "ok"){
			if ($o->update()){
				Js::goto(array("url" => "index.php?s=valor_exame"));
			} else {
				foreach($o->errors as $campo => $erro){
					$tpl->assign($campo."_erro", $erro);
					$tpl->assign($campo, "");
				}
			}
		}
	} else {
		Js::goto(array("url" => "index.php?s=valor_exame"));
示例#7
0
<?
	Util::VerificaChamada();
	if($_GET[id]){
		$o = new Convenio($_GET[id]);
		//$o->setDependences();
		//util::prt("", get_class_methods($o));
		foreach($o->propertiesGetConfig() as $campo => $config){
			$tpl->assign($campo, 	$o->get($campo));
		}
		$hos = new Hospital($o->get("hos_id"));
		$tpl->assign("hos_nome", 	$hos->get("hos_nome"));
		
		if ($_GET[del] == "1" || $_POST[del] == "1"){
			if ($o->delete($_GET[delete_dependences])){
				Js::goto(array("url" => "index.php?s=convenio"));
			} else {
				$dep = $o->getDependences();
				if (sizeof($dep)){
					$tpl->assign("dependences", 	$dep);
				}
			}
		}
	} else {
		Js::goto(array("url" => "index.php?s=convenio"));
	}
	$template_html = $path_tpl."show.tpl";
?>
示例#8
0
		$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";
					//util::prt("1", $parte1);
					//util::prt("2", $parte2);
					//util::prt("3", $parte3);
					//util::prt("4", $parte4);