Location: PHPKode > projects > WebETB > patient/reg.php4
<?php
/******************************************************************************/
/*	MODUL:	patient/reg.php4        														*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.:	Auflistung aller Datensaetze eines Patienten mit                  */
/*          Eingabemoeglichkeit fuer Gruppe "Registratur"                     */
/*																										*/
/*	AUTOR:   Marcus Groh																			*/
/*	LIZENZ:  GPL v2 vom Juni 1991 															*/
/*																										*/
/*	AENDERUNGEN:	13.01.2006        -initiale Version								   */
/*                27.03.2006 v 0.1, -Versionskennzeichnung eingefuehrt        */
/*                                  -Code unter GPL v2 gestellt               */
/*                                  -Tabellenname dynamisiert                 */
/*																										*/
/******************************************************************************/
$allowed_groups=array("elw","reg");
include ('../_include/header_1.php4');

//ETB-Entry Flag on modification
$etb_entry=0;

function init_form_data ()
{
   $AGE_SEL="";
   $GEB_SEL="";

   $GND_F_SEL="";
   $GND_M_SEL="";

   $KAT1_SEL_K0="";
   $KAT1_SEL_K1="";
   $KAT1_SEL_K2="";
   $KAT1_SEL_K3="";
   $KAT1_SEL_K4="";
   $KAT1_SEL_K5="";      

}

if ( $new_pat == TRUE )
{
   $pid=$frm_pat_pid;
   $new_pat="";
   $view=TRUE;
}

if ( $mod_pat == TRUE )
{
   // convert date-format
   $mod_frm_pat_geb=convdate($frm_pat_geb);
   $mod_frm_reg_date=conv_tactical_date($frm_reg_date);
   $mod_frm_reg_time=conv_tactical_time($frm_reg_time);
   $mod_frm_reg_tme1=conv_tactical_time($frm_reg_tme1);

   // update entry in db   
   $update_pat="Update $T_patient set      pat_nname='$frm_pat_nname',   pat_vname='$frm_pat_vname',   pat_geb='$mod_frm_pat_geb',   pat_alt='$frm_pat_alt', pat_min='N',
                pat_ort='$frm_pat_ort',   pat_str='$frm_pat_str',       pat_gnd='$frm_pat_gnd',       used='Y',
                reg_ort='$frm_reg_ort',   reg_date='$mod_frm_reg_date', reg_time='$mod_frm_reg_time', reg_diag='$frm_reg_diag',     reg_num='$frm_reg_num',
                reg_kat1='$frm_reg_kat1', reg_nam1='$frm_reg_nam1',     reg_tme1='$mod_frm_reg_tme1', reg_ort1='$frm_reg_ort1'
                where pid='$frm_pid'";
   mysql_db_query($database["database"],$update_pat,$db);
   #$etb_entry=1;
   $view=TRUE;
   $mod_pat="";
   $new_pat="";
   $pid=$frm_pid;
}


if ( $view == TRUE )
{
   init_form_data();
   $this_pnr="select * from $T_patient where pid=$pid";
   $result=@mysql_db_query($database["database"],$this_pnr,$db);
   while ( $row=mysql_fetch_array($result) )
               {
                  /*************************** Patientendaten aufbereiten **********************/
                  $this_pnr=$row['pat_nr'];
                  $db_rlsnr=checkval ($row['rlsnr']);
                  $db_pat_nname=checkval ($row['pat_nname']);
                  $db_pat_vname=checkval ($row['pat_vname']);
                  $db_pat_ort=checkval ($row['pat_ort']);
                  $db_pat_str=checkval ($row['pat_str']);
                
                  $db_pat_geb=checkdateval($row['pat_geb']);  
                  if (!$db_pat_geb)
                  { 
                     $AGE_SEL="checked"; 
                     $db_pat_alt=checkval($row['pat_alt']);
                  }
                  else
                  { 
                     $GEB_SEL="checked";                                     
                  }
      
                  $db_pat_min=checkval ($row['pat_min']);
                  $db_pat_gnd=checkval ($row['pat_gnd']);
 
 
                  switch ($db_pat_gnd)                  
                  {
                     case "M":   $GND_M_SEL="checked";
                                 break;
                     case "W":   $GND_F_SEL="checked";
                                 break;            
                  }
    
                  /*************************** Registraturdaten aufbereiten **********************/
                  $db_reg_ort=checkval ($row['reg_ort']);
                  $db_reg_date=checkdateval ($row['reg_date']);
                  if ( ! $db_reg_date )
                     {  $db_reg_date=date("d.m.Y");  }
                  $db_reg_time=checktimeval ($row['reg_time']);
                  if ( ! $db_reg_time )
                     {  $db_reg_time=date("H:i:s");  }
                  $db_reg_diag=checkval ($row['reg_diag']);
                  $db_reg_num=checkval ($row['reg_num']);
                  
                  /*************************** Triagedaten aufbereiten **********************/ 
                  $db_reg_nam1=checkval ($row['reg_nam1']);
                  $db_reg_tme1=checktimeval ($row['reg_tme1']);
                  $db_reg_ort1=checkval ($row['reg_ort1']);
                  $db_reg_kat1=checkval ($row['reg_kat1']);
                  switch ($db_reg_kat1)
                  {
                     case "0":   $KAT1_SEL_K0="checked";
                                 break;
                     case "1":   $KAT1_SEL_K1="checked";
                                 break;                                 
                     case "2":   $KAT1_SEL_K2="checked";
                                 break;
                     case "3":   $KAT1_SEL_K3="checked";
                                 break;
                     case "4":   $KAT1_SEL_K4="checked";
                                 break;
                     case "5":   $KAT1_SEL_K5="checked";
                                 break;                                                                                                                        
                  }


               }
   $view="";

}
?>
   <center>
   <br>
   <form action="" method=post name="insert_pat">
   <table border="0" cellspacing="0" cellpadding="0" width="800">
   <tr>
      <th colspan="10">Patienten Akte</th>
   </tr>
   <tr>
      <td colspan="10" height="5"><img src="../_img/spacer.gif" border="0" width="800" height="5"></td>
   </tr>
   <tr>
      <td width="5">&nbsp;</td>
      <td width="100"><p id="BL10">&nbsp;Patienten-Nr.:</p></td>
      <td width="80" ><p id="BL10">&nbsp;<? echo $this_pnr; ?></p></td>
      <td width="5"  >&nbsp;</td>
      <td width="100">Nachname:</td>
      <td width="200"><input type=text name="frm_pat_nname" value="<? echo $db_pat_nname; ?>" maxlength="255" style="width: 200px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="100">Vorname:</td>
      <td width="200"><input type=text name="frm_pat_vname" value="<? echo $db_pat_vname; ?>" maxlength="255" style="width: 200px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
   </tr>
   <tr>
      <td width="5">&nbsp;</td>
      <td width="185" colspan="3">&nbsp;</td>
      <td width="100">Strasse:</td>
      <td width="200"><input type=text name="frm_pat_str" value="<? echo $db_pat_str; ?>" maxlength="255" style="width: 200px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="100">Ort:</td>
      <td width="200"><input type=text name="frm_pat_ort" value="<? echo $db_pat_ort; ?>" maxlength="255" style="width: 200px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
   </tr>
   <tr>
      <td colspan="10" height="5"><img src="../_img/spacer.gif" border="0" width="800" height="5"></td>
   </tr>   
   <tr>
      <td width="105" colspan="2">&nbsp;</td>
      <td align="right"><input type=radio name="frm_age" <? echo $GEB_SEL; ?> value="TRUE" style="border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="100">Geb.-Datum:</td>
      <td width="200"><input type=text name="frm_pat_geb" value="<? echo $db_pat_geb; ?>" "maxlength="10" style="width: 80px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="100" rowspan="2">Geschlecht:</td>
      <td width="200"><input type=radio name="frm_pat_gnd" <? echo $GND_M_SEL; ?> value="M" style="border: 1px solid silver;">
                      <img src="../_img/male.png" border="0" width="15" height="15">&nbsp;&nbsp;M&auml;nnlich</td>
      <td width="5"  >&nbsp;</td>
   </tr>
   <tr>
      <td width="105" colspan="2">&nbsp;</td>
      <td align="right"><input type=radio name="frm_age" <? echo $AGE_SEL; ?> value="FALSE" style="border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="100">ca. Alter:</td>
      <td width="200"><input type=text name="frm_pat_alt" value="<? echo $db_pat_alt; ?>" maxlength="3" style="width: 30px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="200"><input type=radio name="frm_pat_gnd" <? echo $GND_F_SEL; ?> value="W" style="border: 1px solid silver;">
                      <img src="../_img/female.png" border="0" width="15" height="15">&nbsp;&nbsp;Weiblich</td>
      <td width="5"  >&nbsp;</td>
   </tr>
   <tr>
      <td colspan="10" height="5"><img src="../_img/spacer.gif" border="0" width="800" height="5"></td>
   </tr>   
   </table>
   <table border="0" cellspacing="0" cellpadding="0" width="800"> 
   <tr>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="50"><img src="../_img/spacer.gif" border="0" width="50" height="1"></td>
      <td width="5" ><img src="../_img/spacer.gif" border="0" width="5" height="1"></td>
   </tr>      
   <tr>
      <td width="5"><img src="../_img/spacer.gif" border="0" width="5" height="5"></td>
      <td width="200" colspan="4">REGISTRATUR:</td>
      <td colspan="20">&nbsp;</td>
   </tr>
   <tr>
      <td width="5">&nbsp;</td>
      <td width="100" colspan="2" >&nbsp;</td>
      <td width="100" colspan="2">Fundort:</td>
      <td width="275" colspan="10"><input type=text name="frm_reg_ort" value="<? echo $db_reg_ort; ?>" maxlength="130" style="width: 275px; border: 1px solid silver;"></td>
      <td width="5"  >&nbsp;</td>
      <td width="55" colspan="2">Datum:</td>
      <td width="105" colspan="3"><input type=text name="frm_reg_date" value="<? echo $db_reg_date; ?>" maxlength="10" style="width: 80px; border: 1px solid silver;">
                                  <a href="javascript:insert_tactical_date('insert_pat', 'frm_reg_date')" onFocus="blur();" style="text-decoration: none; font-size:15pt;">&larr;</a></td>
      <td width="50"  >Zeit:</td>
      <td width="100" colspan="2"><input type=text name="frm_reg_time" value="<? echo $db_reg_time; ?>" maxlength="10" style="width: 70px; border: 1px solid silver;">
                                  <a href="javascript:insert_tactical_time('insert_pat', 'frm_reg_time')" onFocus="blur();" style="text-decoration: none; font-size:15pt;">&larr;</a></td>
      <td width="5"  >&nbsp;</td>
   </tr>
   <tr>
      <td width="105" colspan="3">&nbsp;</td>
      <td width="100" colspan="2">Erstbefund:</td>
      <td width="275" colspan="10"><input type=text name="frm_reg_diag" value="<? echo $db_reg_diag; ?>" maxlength="130" style="width: 275px; border: 1px solid silver;"></td>
      <td width="115" colspan="5">&nbsp;</td>      
      <td width="100" colspan="2">Eigene-Nr.:</td>
      <td width="100" colspan="2"><input type=text name="frm_reg_num"   value="<? echo $db_reg_num; ?>" maxlength="5"   style="width: 70px;  border: 1px solid silver;"></td>
      <td width="5">&nbsp;</td>
   </tr>
   <tr>
      <td colspan="25" height="10"><img src="../_img/spacer.gif" border="0" width="800" height="10"></td>
   </tr>
  
   <tr>
      <td width="5">&nbsp;</td>
      <td width="100" colspan="2" >&nbsp;</td>
      <td width="100" colspan="2">1. Sichtung:</td> 
      <td width="55" colspan="2" align="middle" style="background-color: #ff0000"><input type=radio name="frm_reg_kat1" <? echo $KAT1_SEL_K1; ?> value="1"></td>
      <td width="55" colspan="2" align="middle" style="background-color: #ff0000"><input type=radio name="frm_reg_kat1" <? echo $KAT1_SEL_K5; ?> value="5"></td>
      <td width="55" colspan="2" align="middle" style="background-color: #ffff00"><input type=radio name="frm_reg_kat1" <? echo $KAT1_SEL_K2; ?> value="2"></td>
      <td width="55" colspan="2" align="middle" style="background-color: #00ff00"><input type=radio name="frm_reg_kat1" <? echo $KAT1_SEL_K3; ?> value="3"></td>
      <td width="55" colspan="2" align="middle" style="background-color: #3333ff"><input type=radio name="frm_reg_kat1" <? echo $KAT1_SEL_K4; ?> value="4"></td>
      <td width="5">&nbsp;</td>
      <td width="55" colspan="2">Name:</td>
      <td width="105" colspan="3"><input type=text name="frm_reg_nam1" value="<? echo $db_reg_nam1; ?>" maxlength="50" style="width: 100px; border: 1px solid silver;"></td>
      <td width="50">Zeit:</td>
      <td width="100" colspan="2"><input type=text name="frm_reg_tme1" value="<? echo $db_reg_tme1; ?>" maxlength="10" style="width: 70px; border: 1px solid silver;">
                                  <a href="javascript:insert_tactical_time('insert_pat', 'frm_reg_tme1')" onFocus="blur();" style="text-decoration: none; font-size:15pt;">&larr;</a></td>
      <td width="5">&nbsp;</td>
   </tr>
   <tr>
      <td width="5">&nbsp;</td>
      <td width="100" colspan="2" >&nbsp;</td>
      <td width="100" colspan="2" align="middle"><input type=radio name="frm_reg_kat1" <? echo $KAT1_SEL_K0; ?> value="0">&nbsp;Keine</td>
      <td width="55" colspan="2" align="middle" style="background-color: #ff0000">I</td>
      <td width="55" colspan="2" align="middle" style="background-color: #ff0000">Ip</td>
      <td width="55" colspan="2" align="middle" style="background-color: #ffff00">II</td>
      <td width="55" colspan="2" align="middle" style="background-color: #00ff00">III</td>
      <td width="55" colspan="2" align="middle" style="background-color: #3333ff">IV</td>
      <td width="5">&nbsp;</td>
      <td width="55" colspan="2">Ort:</td>
      <td width="255" colspan="6"><input type=text name="frm_reg_ort1" value="<? echo $db_reg_ort1; ?>" maxlength="25" style="width: 225px; border: 1px solid silver;"></td>
      <td width="5">&nbsp;</td>
   </tr>     
   <tr>
      <td colspan="25" height="5"><img src="../_img/spacer.gif" border="0" width="800" height="5"></td>
   </tr>
   </table>
   <br>
      <input type=hidden name="mod_pat" value="TRUE">
      <input type=hidden name="frm_pid" value="<? echo $pid;?>">
      <input type=submit VALUE="&Auml;nderung speichern" style="border: 1px solid silver;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <input type=reset VALUE="&Auml;nderung verwerfen" style="border: 1px solid silver;">   
   </form>
   </center>
<?   
include ('../_include/footer_1.php4');

?>
Return current item: WebETB