<?

//
//	2002.1.1
//	DICOM to WWW Gateway :PHP script
//	Made by Norya Yokohama % Medical Division @ WERC
//  2004.9.19
//  added by tadashi tsuchimoto @ MITT belong to yokohamazyuku
//  order related source
//






$ruid = $_GET['ruid'];


/*
  include "init.inc";
  include "param_setting.ini";
  include "sql_generator.ini";
  include "file_mod.inc";
  $include_path=".";
  require("$include_path/dbconnect.ini");


$db_handle = db_contact_start($db_type,$target_host,$target_db);
$sql = "select refimage6 from reportlevel where ruid = ?";
$stmt = $db_handle->prepare($sql);
$stmt->execute(array($_GET['ruid']));
$stmt->bindColumn(1, $lob, PDO::PARAM_LOB);
$stmt->fetch(PDO::FETCH_BOUND);
$obj = $db->pgsqlLOBOpen($oid, 'rb');


header("Content-type: image/jpeg");
fpassthru($lob);
*/


$refimage = $_GET['refimage'];

 $include_path=".";
  require("$include_path/dbconnect_old.ini");

class myDbConnect extends DbConnect {
      var $dbname = "pacsdb";
}

  $con = new myDbConnect;


$result = pg_query("BEGIN");
    pg_locreate();

    header("Content-type: image/jpeg");
    $obj = pg_loopen ($refimage, "rw");
    pg_lo_read_all($obj);

    pg_loclose ($obj);


$result = pg_query("commit");
$result = pg_query("END");

  $con->dbClose;




?>









</body>
</html>
