if ($edit) {
     $sAend = '</a>';
 } else {
     $sAend = '';
 }
 # Assign the family and first names together with the <a href></a> tags
 # WITHOUT LINKS
 $smarty->assign('sFamilyName', $sFamNameBuffer);
 $smarty->assign('sName', $sNameBuffer);
 /* old code
 			$smarty->assign('sFamilyName',$sAstart.$sFamNameBuffer.$sAend);
 			$smarty->assign('sName',$sAstart.$sNameBuffer.$sAend);
 			*/
 # discharge without diagnosis
 $nodischarge = 0;
 $kct = $multi_obj->CheckDiagnosis($patient['encounter_nr']);
 if ($vct[9] == 1 && $patient['encounter_nr'] != '') {
     if ($kct < 1) {
         $smarty->assign('sFlagDiag', ' style="background-color:yellow !important; color:#000000;" ');
         $smarty->assign('sFlagDiag2', ' style="background-color:gold !important; color:#000000;" ');
         $smarty->assign('sNoDiag', ' [ No Dx ] ');
         $nodischarge = 1;
     }
 }
 if ($patient['date_birth']) {
     if (isset($sg) && $sg) {
         $smarty->assign('sBirthDate', eregi_replace($sg, "<font color=#ff0000><b>" . ucfirst($sg) . "</b></font>", formatDate2Local($patient['date_birth'], $date_format)));
     } else {
         $smarty->assign('sBirthDate', formatDate2Local($patient['date_birth'], $date_format));
     }
 }
     $smarty->assign('cComma', '');
 }
 if ($edit) {
     $sAend = '</a>';
 } else {
     $sAend = '';
 }
 # Assign the family and first names together with the <a href></a> tags
 if ($bed_locked) {
     $smarty->assign('sFamilyName', $sFamilyName);
 } else {
     $smarty->assign('sFamilyName', $sFamNameBuffer);
     $smarty->assign('sName', $sNameBuffer);
 }
 if ($vct[9] == 1) {
     $kct = $multi_obj->CheckDiagnosis($bed['encounter_nr']);
     if ($kct < 1 && $bed['encounter_nr'] != '') {
         $smarty->assign('sFlagDiag', ' style="background-color:yellow !important; color:#000000;" ');
         $smarty->assign('sFlagDiag2', ' style="background-color:gold !important; color:#000000;" ');
         $smarty->assign('sNoDiag', ' [ No Dx ] ');
     } else {
         $smarty->assign('sFlagDiag', '');
         $smarty->assign('sFlagDiag2', ' ');
         $smarty->assign('sNoDiag', '  ');
     }
 } else {
     $smarty->assign('sFlagDiag', '');
     $smarty->assign('sFlagDiag2', ' ');
     $smarty->assign('sNoDiag', '  ');
 }
 # old code