2 /*******************************************************************************\
3 * Copyright (C) Visolve (vicareplus_engg@visolve.com) *
5 * This program is free software; you can redistribute it and/or *
6 * modify it under the terms of the GNU General Public License *
7 * as published by the Free Software Foundation; either version 2 *
8 * of the License, or (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 ********************************************************************************/
20 //SANITIZE ALL ESCAPES
21 $sanitize_all_escapes=true;
24 //STOP FAKE REGISTER GLOBALS
25 $fake_register_globals=false;
28 require_once("../../globals.php");
29 require_once("$srcdir/sql.inc");
34 * Retrieve the recent 'N' disclosures.
35 * @param $pid - patient id.
36 * @param $limit - certain limit up to which the disclosures are to be displyed.
38 function getDisclosureByDate($pid,$limit)
40 $r1=sqlStatement("select event,recipient,description,date from extended_log where patient_id=? AND event in (select option_id from list_options where list_id='disclosure_type') order by date desc limit 0,$limit", array($pid) );
42 for ($iter = 0;$frow = sqlFetchArray($r1);$iter++
)
43 $result2[$iter] = $frow;
47 <div id
='pnotes' style
='margin-top: 3px; margin-left: 10px; margin-right: 10px'><!--outer div
-->
51 //display all the disclosures for the day, as well as others from previous dates, up to a certain number, $N
53 //$has_variable is set to 1 if there are disclosures recorded.
55 //retrieve all the disclosures.
56 $result=getDisclosureByDate($pid,$N);
58 $disclosure_count = 0;//number of disclosures so far displayed
59 foreach ($result as $iter)
62 $app_event=$iter{"event"};
63 $event=split("-",$app_event);
64 $description=nl2br(htmlspecialchars($iter{"description"},ENT_NOQUOTES
));//for line breaks.
65 //listing the disclosures
66 echo "<tr style='border-bottom:1px dashed' class='text'>";
67 echo "<td valign='top' class='text'>";
68 if($event[1]=='healthcareoperations'){ echo "<b>";echo htmlspecialchars(xl('health care operations'),ENT_NOQUOTES
);echo "</b>"; } else echo "<b>".htmlspecialchars($event[1],ENT_NOQUOTES
)."</b>";
70 echo "<td valign='top'class='text'>";
71 echo htmlspecialchars($iter{"date"}." (".xl('Recipient').":".$iter{"recipient"}.")",ENT_NOQUOTES
);
72 echo " ".$description;
81 if ( $has_disclosure == 0 ) //If there are no disclosures recorded
83 <span
class='text'> <?php
echo htmlspecialchars(xl("There are no disclosures recorded for this patient."),ENT_NOQUOTES
);
84 echo " "; echo htmlspecialchars(xl("To record disclosures, please click"),ENT_NOQUOTES
); echo " ";echo "<a href='disclosure_full.php'>"; echo htmlspecialchars(xl("here"),ENT_NOQUOTES
);echo "</a>.";
92 <span
class='text'> <?php
93 echo htmlspecialchars(xl('Displaying the following number of most recent disclosures:'),ENT_NOQUOTES
);?
><b
><?php
echo " ".htmlspecialchars($N,ENT_NOQUOTES
);?
></b
><br
>
94 <a href
='disclosure_full.php'><?php
echo htmlspecialchars(xl('Click here to view them all.'),ENT_NOQUOTES
);?
></a
>