Permalink
Browse files

Some sizing tweaks for patient PDF report, and cosmetic cleanup of vi…

…tals report code.
  • Loading branch information...
1 parent 58640c9 commit fc6105b361aeef5584509fe30da8b02927522edd @sunsetsystems sunsetsystems committed Oct 7, 2012
@@ -34,7 +34,13 @@ function scanned_notes_report($pid, $useless_encounter, $cols, $id) {
$imageurl = "$web_root/sites/" . $_SESSION['site_id'] .
"/documents/$pid/encounters/${thisenc}_$id$suffix.jpg";
if (is_file($imagepath)) {
- echo " <img src='$imageurl' />\n";
+ echo " <img src='$imageurl'";
+ // Flag images with excessive width for possible stylesheet action.
+ $asize = getimagesize($imagepath);
+ if ($asize[0] > 750) {
+ echo " class='bigimage'";
+ }
+ echo " />\n";
echo " <br />\n";
}
else {
@@ -4,133 +4,133 @@
include_once ($GLOBALS['fileroot']."/library/patient.inc");
function vitals_report( $pid, $encounter, $cols, $id, $print = true) {
- $count = 0;
- $data = formFetch("form_vitals", $id);
- $patient_data = getPatientData($GLOBALS['pid']);
- $patient_age = getPatientAge($patient_data['DOB']);
+ $count = 0;
+ $data = formFetch("form_vitals", $id);
+ $patient_data = getPatientData($GLOBALS['pid']);
+ $patient_age = getPatientAge($patient_data['DOB']);
- if ($data) {
- $vitals .= "<table><tr>";
+ if ($data) {
+ $vitals .= "<table><tr>";
- foreach($data as $key => $value) {
-
- if ($key == "id" || $key == "pid" ||
- $key == "user" || $key == "groupname" ||
- $key == "authorized" || $key == "activity" ||
- $key == "date" || $value == "" ||
- $value == "0000-00-00 00:00:00" || $value == "0.0" )
- {
- // skip certain data
- continue;
- }
+ foreach($data as $key => $value) {
- if ($value == "on") { $value = "yes"; }
+ if ($key == "id" || $key == "pid" ||
+ $key == "user" || $key == "groupname" ||
+ $key == "authorized" || $key == "activity" ||
+ $key == "date" || $value == "" ||
+ $value == "0000-00-00 00:00:00" || $value == "0.0" )
+ {
+ // skip certain data
+ continue;
+ }
- $key=ucwords(str_replace("_"," ",$key));
+ if ($value == "on") { $value = "yes"; }
- //modified by BM 06-2009 for required translation
- if ($key == "Temp Method" || $key == "BMI Status") {
- if ($key == "BMI Status") {
- if ($patient_age <= 20 || (preg_match('/month/', $patient_age))) {
- $value = "See Growth-Chart";
- }
- }
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . xl($value) . "</span></td>";
- }
- elseif ($key == "Bps") {
- $bps = $value;
- if ($bpd) {
- $vitals .= "<td><span class=bold>" . xl('Blood Pressure') . ": </span><span class=text>" . $bps . "/". $bpd . "</span></td>";
- }
- else {
- continue;
- }
- }
- elseif ($key == "Bpd") {
- $bpd = $value;
- if ($bps) {
- $vitals .= "<td><span class=bold>" . xl('Blood Pressure') . ": </span><span class=text>" . $bps . "/". $bpd . "</span></td>";
- }
- else {
- continue;
- }
- }
- elseif ($key == "Weight") {
- $convValue = number_format($value*0.45359237,2);
- // show appropriate units
- if ($GLOBALS['units_of_measurement'] == 2) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('kg') . " (" . $value . " " . xl('lb') . ")</span></td>";
- }
- elseif ($GLOBALS['units_of_measurement'] == 3) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('lb') . "</span></td>";
- }
- elseif ($GLOBALS['units_of_measurement'] == 4) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('kg') . "</span></td>";
- }
- else { // = 1 or not set
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('lb') . " (" . $convValue . " " . xl('kg') . ")</span></td>";
- }
- }
- elseif ($key == "Height" || $key == "Waist Circ" || $key == "Head Circ") {
- $convValue = number_format($value*2.54,2);
- // show appropriate units
- if ($GLOBALS['units_of_measurement'] == 2) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('cm') . " (" . $value . " " . xl('in') . ")</span></td>";
- }
- elseif ($GLOBALS['units_of_measurement'] == 3) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('in') . "</span></td>";
- }
- elseif ($GLOBALS['units_of_measurement'] == 4) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('cm') . "</span></td>";
- }
- else { // = 1 or not set
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('in') . " (" . $convValue . " " . xl('cm') . ")</span></td>";
- }
- }
- elseif ($key == "Temperature") {
- $convValue = number_format((($value-32)*0.5556),2);
- // show appropriate units
- if ($GLOBALS['units_of_measurement'] == 2) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('C') . " (" . $value . " " . xl('F') . ")</span></td>";
- }
- elseif ($GLOBALS['units_of_measurement'] == 3) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('F') . "</span></td>";
- }
- elseif ($GLOBALS['units_of_measurement'] == 4) {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('C') . "</span></td>";
- }
- else { // = 1 or not set
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('F') . " (" . $convValue . " " . xl('C') . ")</span></td>";
- }
- }
+ $key = ucwords(str_replace("_"," ",$key));
- elseif ($key == "Pulse" || $key == "Respiration" || $key == "Oxygen Saturation" || $key == "BMI") {
- $value = number_format($value,0);
- if ($key == "Oxygen Saturation") {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('%') . "</span></td>";
- }
- elseif ($key == "BMI") {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('kg/m^2') . "</span></td>";
- }
- else { //pulse and respirations
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('per min') . "</span></td>";
- }
- }
- else {
- $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>$value</span></td>";
- }
-
- $count++;
+ //modified by BM 06-2009 for required translation
+ if ($key == "Temp Method" || $key == "BMI Status") {
+ if ($key == "BMI Status") {
+ if ($patient_age <= 20 || (preg_match('/month/', $patient_age))) {
+ $value = "See Growth-Chart";
+ }
+ }
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . xl($value) . "</span></td>";
+ }
+ elseif ($key == "Bps") {
+ $bps = $value;
+ if ($bpd) {
+ $vitals .= "<td><span class=bold>" . xl('Blood Pressure') . ": </span><span class=text>" . $bps . "/". $bpd . "</span></td>";
+ }
+ else {
+ continue;
+ }
+ }
+ elseif ($key == "Bpd") {
+ $bpd = $value;
+ if ($bps) {
+ $vitals .= "<td><span class=bold>" . xl('Blood Pressure') . ": </span><span class=text>" . $bps . "/". $bpd . "</span></td>";
+ }
+ else {
+ continue;
+ }
+ }
+ elseif ($key == "Weight") {
+ $convValue = number_format($value*0.45359237,2);
+ // show appropriate units
+ if ($GLOBALS['units_of_measurement'] == 2) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('kg') . " (" . $value . " " . xl('lb') . ")</span></td>";
+ }
+ elseif ($GLOBALS['units_of_measurement'] == 3) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('lb') . "</span></td>";
+ }
+ elseif ($GLOBALS['units_of_measurement'] == 4) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('kg') . "</span></td>";
+ }
+ else { // = 1 or not set
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('lb') . " (" . $convValue . " " . xl('kg') . ")</span></td>";
+ }
+ }
+ elseif ($key == "Height" || $key == "Waist Circ" || $key == "Head Circ") {
+ $convValue = number_format($value*2.54,2);
+ // show appropriate units
+ if ($GLOBALS['units_of_measurement'] == 2) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('cm') . " (" . $value . " " . xl('in') . ")</span></td>";
+ }
+ elseif ($GLOBALS['units_of_measurement'] == 3) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('in') . "</span></td>";
+ }
+ elseif ($GLOBALS['units_of_measurement'] == 4) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('cm') . "</span></td>";
+ }
+ else { // = 1 or not set
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('in') . " (" . $convValue . " " . xl('cm') . ")</span></td>";
+ }
+ }
+ elseif ($key == "Temperature") {
+ $convValue = number_format((($value-32)*0.5556),2);
+ // show appropriate units
+ if ($GLOBALS['units_of_measurement'] == 2) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('C') . " (" . $value . " " . xl('F') . ")</span></td>";
+ }
+ elseif ($GLOBALS['units_of_measurement'] == 3) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('F') . "</span></td>";
+ }
+ elseif ($GLOBALS['units_of_measurement'] == 4) {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $convValue . " " . xl('C') . "</span></td>";
+ }
+ else { // = 1 or not set
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('F') . " (" . $convValue . " " . xl('C') . ")</span></td>";
+ }
+ }
- if ($count == $cols) {
- $count = 0;
- $vitals .= "</tr><tr>\n";
- }
+ elseif ($key == "Pulse" || $key == "Respiration" || $key == "Oxygen Saturation" || $key == "BMI") {
+ $value = number_format($value,0);
+ if ($key == "Oxygen Saturation") {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('%') . "</span></td>";
+ }
+ elseif ($key == "BMI") {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('kg/m^2') . "</span></td>";
+ }
+ else { //pulse and respirations
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>" . $value . " " . xl('per min') . "</span></td>";
}
+ }
+ else {
+ $vitals .= "<td><span class=bold>" . xl($key) . ": </span><span class=text>$value</span></td>";
+ }
- $vitals .= "</tr></table>";
+ $count++;
+
+ if ($count == $cols) {
+ $count = 0;
+ $vitals .= "</tr><tr>\n";
+ }
}
- if($print) echo $vitals ;
- else return $vitals;
+
+ $vitals .= "</tr></table>";
+ }
+ if ($print) echo $vitals ;
+ else return $vitals;
}
-?>
+?>
@@ -39,7 +39,9 @@
if ($PDF_OUTPUT) $printable = true;
unset($_GET['printable']);
-$N = 6;
+// Number of columns in tables for insurance and encounter forms.
+$N = $PDF_OUTPUT ? 4 : 6;
+
$first_issue = 1;
function getContent() {
@@ -42,7 +42,7 @@ a:hover {
font-family: Arial;
text-decoration: none;
color: #000000;
- font-size: 10pt;
+ font-size: 9pt;
}
.required {
@@ -56,7 +56,7 @@ a:hover {
.bold {
font-family: Arial;
text-decoration: none;
- font-size: 10pt;
+ font-size: 9pt;
color: #000000;
font-weight: bold;
}
@@ -512,11 +512,9 @@ font-weight: bold;
#report_custom {
width:100%;
}
-
#report_custom table {
width:100%;
}
-
#report_custom hr {
border: 2px dotted black;
}
@@ -557,6 +555,9 @@ font-weight: bold;
margin: 5px;
padding: 5px;
}
+#report_custom .insurance td {
+ width: 24%;
+}
#report_custom .history {
margin: 5px;
padding: 5px;
@@ -591,7 +592,12 @@ font-weight: bold;
padding: 10px;
border-top: 1px solid gray;
}
-
+#report_custom .encounter_form td {
+ width: 24%;
+}
+#report_custom img.bigimage {
+ width: 540pt; /* 540pt = 7.5 inches */
+}
#addressbook_list tr.evenrow {
background-color:#ddddff;
}

0 comments on commit fc6105b

Please sign in to comment.