Added a graphing functionality with Open Flash Chart, and added ability to graph...
[openemr.git] / interface / patient_file / encounter / trend_form.php
blobd85e56fe447132affcbfce8b5eb34d66099f66fa
1 <?php
2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
7 $special_timeout = 3600;
8 include_once("../../globals.php");
10 //Bring in the style sheet
12 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
13 <?php
14 // Hide the current value css entries. This is currently specific
15 // for the vitals form but could use this mechanism for other
16 // forms.
17 // Hiding classes:
18 // currentvalues - input boxes
19 // valuesunfocus - input boxes that are auto-calculated
20 // editonly - the edit and cancel buttons
21 // Showing class:
22 // readonly - the link back to summary screen
23 // Also customize the 'graph' class to look like links.
25 <style>
26 .currentvalues { display: none;}
27 .valuesunfocus { display: none;}
28 .editonly { display: none;}
30 .graph {color:#0000cc;}
32 #chart {
33 border-style:solid;
34 border-width:2px;
35 margin:0em 1em 2em 2em;
37 </style>
39 <script type="text/javascript" src="../../../library/js/jquery.1.3.2.js"></script>
40 <script type="text/javascript" src="../../../library/openflashchart/js/swfobject.js"></script>
41 <script type="text/javascript">
43 // Show the selected chart in the 'chart' div element
44 function show_graph(name,table)
46 top.restoreSession();
47 //function only appears to allow passing of one parameter to data-file, so combine name____table for passing
48 parameters=name + "___" + table;
49 a=encodeURIComponent(parameters);
50 swfobject.embedSWF('../../../library/openflashchart/open-flash-chart.swf', "chart", "650", "200", "9.0.0", "", {"data-file":"../../../library/openflashchart/graphs.php?params=" + a} );
53 $(document).ready(function(){
55 // Use jquery to show the 'readonly' class entries
56 $('.readonly').show();
58 // Place click callback for graphing
59 $(".graph").click(function(e){show_graph(this.id,'form_vitals'); });
61 // Show hovering effects for the .graph links
62 $(".graph").hover(
63 function(){
64 $(this).css({color:'#ff5555'}); //mouseover
66 function(){
67 $(this).css({color:'#0000cc'}); // mouseout
71 // show blood pressure graph by default
72 show_graph('bps','form_vitals');
74 });
75 </script>
77 <?php
78 if (substr($_GET["formname"], 0, 3) === 'LBF') {
79 // Use the List Based Forms engine for all LBFxxxxx forms.
80 include_once("$incdir/forms/LBF/new.php");
82 else {
83 include_once("$incdir/forms/" . $_GET["formname"] . "/new.php");