Skip to content

Commit

Permalink
added easy printing of a patient note
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsetsystems committed May 6, 2007
1 parent a1c2bfc commit 44e594b
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 2 deletions.
15 changes: 13 additions & 2 deletions interface/patient_file/summary/pnotes_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,24 @@
</tr>
</table>

<a href="javascript:document.new_note.submit();" class='link_submit'>
<?php if ($noteid) { ?>

<a href="javascript:document.new_note.submit();" class='link_submit'>
[<? xl('Append to This Note','e'); ?>]
</a>
&nbsp;&nbsp;&nbsp;&nbsp;
<a href='pnotes_print.php?noteid=<?php echo $noteid; ?>' class='link_submit' target='_blank'>
[<? xl('Print This Note','e'); ?>]
</a>

<?php } else { ?>

<a href="javascript:document.new_note.submit();" class='link_submit'>
[<? xl('Add New Note','e'); ?>]
<?php } ?>
</a>

<?php } ?>

<br>
</form>

Expand Down
50 changes: 50 additions & 0 deletions interface/patient_file/summary/pnotes_print.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php
include_once("../../globals.php");
include_once("$srcdir/pnotes.inc");
include_once("$srcdir/patient.inc");
include_once("$srcdir/acl.inc");

// Check authorization.
$thisauth = acl_check('patients', 'notes');
if (!$thisauth)
die("Not authorized.");
$tmp = getPatientData($pid, "squad");
if ($tmp['squad'] && ! acl_check('squads', $tmp['squad']))
die("Not authorized for this squad.");

$noteid = $_REQUEST['noteid'];

$title = '';
$assigned_to = '';
$body = '';
$activity = 0;
if ($noteid) {
$prow = getPnoteById($noteid, 'title,assigned_to,activity,body');
$title = $prow['title'];
$assigned_to = $prow['assigned_to'];
$activity = $prow['activity'];
$body = $prow['body'];
}
?>
<html>
<head>
<link rel='stylesheet' href="<?echo $css_header;?>" type="text/css">
</head>

<body <?echo $top_bg_line;?> topmargin='0' rightmargin='0' leftmargin='2'
bottommargin='0' marginwidth='2' marginheight='0'>

<p><b><?php echo $title; ?></b></p>

<p>Assigned To: <?php echo $assigned_to; ?></p>

<p>Active: <?php echo $activity ? 'Yes' : 'No'; ?></p>

<p><?php echo $body; ?></p>

<script language='JavaScript'>
window.print();
</script>

</body>
</html>

0 comments on commit 44e594b

Please sign in to comment.