cfapress wrote on Thursday, March 12, 2009:
Rayaz,
Apparently the logic is a bit more difficult than I originally thought. When you choose a patient, in the radio-button/collapsible-tree view, the top title bar is changed via javascript in this file:
<oemr>/interface/main/left_nav.php
Around line 500 there is a function called setPatient which changes the content of some of the frames including the Title frame. The content is determined by the value in the ‘str’ variable.
function setPatient(pname, pid, pubpid, frname) {
var str = ‘<b>’ + pname + ’ (’ + pubpid + ‘)</b>’;
setDivContent(‘current_patient’, str);
setTitleContent(‘current_patient’, str);
The setPatient function is called from another file,
<oemr>interface/patient_file/summary/demographics_full.php
Around line 606 in that file you’ll see these lines:
<?php if ($GLOBALS[‘concurrent_layout’] && $set_pid) { ?>
parent.left_nav.setPatient(<?php echo “’” . addslashes($result[‘fname’]) . " " . addslashes($result[‘lname’]) . “’,$pid,’” . addslashes($result[‘pubpid’]) . “’,’’”; ?>);
parent.left_nav.setRadio(window.name, ‘dem’);
<?php } ?>
So… what does all this mean?
It means that code in the <oemr>/interface/main/left_nav.php file needs to be changed so that it loads the patient’s info. I suggest you rework the code to read something like this:
function setPatient(pname, pid, pubpid, frname) {
var str = ‘<b>’ + pname + ’ (’ + pubpid + ‘)</b>’;
setDivContent(‘current_patient’, str);
<?php
$result = getPatientData($pid, “fname,lname,pid,pubpid,phone_home,pharmacy_id,DOB,DATE_FORMAT(DOB,’%Y%m%d’) as DOB_YMD”);
$age = getPatientAge($result[“DOB_YMD”]);
?>
var str = ‘<b>’ + pname + ’ (’ + pubpid + ‘)</b>’ + ’ DOB: <?php echo $result[“DOB_YMD”]; ?> Age:’ + <?php echo $age; ?>;
*** AND ***
At around line 90 of the left_nav.php file you’ll need to add this line:
include_once("…/…/library/patient.inc");
Jason