Example #1
0
// JavaScript stuff to do when a new patient is set.
//
function setMyPatient() {
<?php 
if ($GLOBALS['concurrent_layout']) {
    ?>
 // Avoid race conditions with loading of the left_nav or Title frame.
 if (!parent.allFramesLoaded()) {
  setTimeout("setMyPatient()", 500);
  return;
 }
<?php 
    if (isset($_GET['set_pid'])) {
        ?>
 parent.left_nav.setPatient(<?php 
        echo "'" . htmlspecialchars($result['fname'] . " " . $result['lname'], ENT_QUOTES) . "'," . htmlspecialchars($pid, ENT_QUOTES) . ",'" . htmlspecialchars($result['pubpid'], ENT_QUOTES) . "','', ' " . htmlspecialchars(xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAgeDisplay($result['DOB_YMD']), ENT_QUOTES) . "'";
        ?>
);
 var EncounterDateArray = new Array;
 var CalendarCategoryArray = new Array;
 var EncounterIdArray = new Array;
 var Count = 0;
<?php 
        //Encounter details are stored to javacript as array.
        $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_encounter AS fe " . " left join openemr_postcalendar_categories on fe.pc_catid=openemr_postcalendar_categories.pc_catid  WHERE fe.pid = ? order by fe.date desc", array($pid));
        if (sqlNumRows($result4) > 0) {
            while ($rowresult4 = sqlFetchArray($result4)) {
                ?>
 EncounterIdArray[Count] = '<?php 
                echo htmlspecialchars($rowresult4['encounter'], ENT_QUOTES);
                ?>
Example #2
0
});

// JavaScript stuff to do when a new patient is set.
//
function setMyPatient() {
 // Avoid race conditions with loading of the left_nav or Title frame.
 if (!parent.allFramesLoaded()) {
  setTimeout("setMyPatient()", 500);
  return;
 }
<?php 
if (isset($_GET['set_pid'])) {
    ?>
 parent.left_nav.setPatient(<?php 
    echo "'" . addslashes($result['fname']) . " " . addslashes($result['lname']) . "'," . addslashes($pid) . ",'" . addslashes($result['pubpid']) . "','', ' " . xls('DOB') . ": " . addslashes(oeFormatShortDate($result['DOB_YMD'])) . " " . xls('Age') . ": " . addslashes(getPatientAgeDisplay($result['DOB_YMD'])) . "'";
    ?>
);
 var EncounterDateArray = new Array;
 var CalendarCategoryArray = new Array;
 var EncounterIdArray = new Array;
 var Count = 0;
<?php 
    //Encounter details are stored to javacript as array.
    $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_encounter AS fe " . " left join openemr_postcalendar_categories on fe.pc_catid=openemr_postcalendar_categories.pc_catid  WHERE fe.pid = ? order by fe.date desc", array($pid));
    if (sqlNumRows($result4) > 0) {
        while ($rowresult4 = sqlFetchArray($result4)) {
            ?>
 EncounterIdArray[Count] = '<?php 
            echo addslashes($rowresult4['encounter']);
            ?>
/**
 *  This is currently a floating div top with patient demographics and such.
 *  Used in fullscreen mode at the top and in AnythingSlider at the bottom.
 *  Moving towards containing info similar to main_title.php.
 *
 *  @param string $pid patient_id
 *  @param string $encounter is the current encounter number
 *  @return nothing, outputs directly to screen
 */
function menu_overhaul_left($pid, $encounter)
{
    global $form_folder;
    global $pat_data;
    global $visit_date;
    global $documents;
    global $dated;
    global $display;
    global $providerNAME;
    /*
     * find out if the patient has a photo
     */
    if (!$documents) {
        list($documents) = document_engine($pid);
    }
    ?>
    <div class="borderShadow" style="font-size:1.2em;width:80%;display:inline-block;">
        <div id="left_menu" name="left_menu" class="col-md-4">
            <div style="padding-left: 18px;">
                <table style="text-align:left;">
                    <?php 
    if ($display == 'fullscreen') {
        ?>
                    <tr><td class="right" >
                            <?php 
        $age = getPatientAgeDisplay($pat_data['DOB'], $encounter_date);
        $DOB = oeFormatShortDate($pat_data['DOB']);
        echo "<b>" . xlt('Name') . ":</b> </td><td nowrap> &nbsp;" . text($pat_data['fname']) . "  " . text($pat_data['lname']) . " (" . text($pid) . ")</td></tr>\n                                    <tr><td class='right'><b>" . xlt('DOB') . ":</b></td><td  nowrap> &nbsp;" . text($DOB) . "&nbsp;&nbsp;(" . text($age) . ")";
        ?>
                            <?php 
        ?>
                        </td>
                    </tr>
                    <?php 
    }
    echo "<tr><td class='right' nowrap><b>" . xlt('Visit Date') . ":</b></td><td>&nbsp;" . $visit_date . "</td></tr>";
    ?>
                    <tr><td class="right" style="vertical-align:top;" nowrap><b><?php 
    echo xlt("Provider");
    ?>
:</b>&nbsp;</td>
                        <td><?php 
    echo text($providerNAME);
    ?>
</td>
                    </tr>

                    <tr><td class="right" style="vertical-align:top;" nowrap><b><?php 
    echo xlt("Reason/Plan");
    ?>
:</b>&nbsp;</td>
                        <td style="vertical-align:top;">
                            <?php 
    // Start with Appt reason from calendar
    // Consider using last visit's PLAN field?
    //think about this space and how to use it...
    $query = "select * from  openemr_postcalendar_events where pc_pid=? and pc_eventDate=?";
    $res = sqlStatement($query, array($pid, $dated));
    $reason = sqlFetchArray($res);
    ?>
&nbsp;<?php 
    echo text($reason['pc_hometext']);
    global $priors;
    $PLAN_today = preg_replace("/\\|/", "<br />", $earlier['PLAN']);
    if ($PLAN_today) {
        echo "<br />" . text($PLAN_today);
    }
    ?>
                        </td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="left_menu3" name="left_menu3" class="col-md-3" style="font-size:1.0em;">
            <?php 
    //if the patient has a photograph, use it else use generic avitar thing.
    if ($documents['docs_in_name']['Patient Photograph'][0]['id']) {
        ?>
                <object><embed src="<?php 
        echo $GLOBALS['webroot'];
        ?>
/controller.php?document&amp;retrieve&amp;patient_id=<?php 
        echo attr($pid);
        ?>
&amp;document_id=<?php 
        echo attr($documents['docs_in_name']['Patient Photograph'][0]['id']);
        ?>
&amp;as_file=false" frameborder="0"
                     type="<?php 
        echo attr($documents['docs_in_name']['Patient Photograph'][0]['mimetype']);
        ?>
" allowscriptaccess="always" allowfullscreen="false" height="50"></embed></object>
            <?php 
    } else {
        ?>
            <object><embed src="<?php 
        echo $GLOBALS['web_root'];
        ?>
/interface/forms/<?php 
        echo $form_folder;
        ?>
/images/anon.gif" frameborder="0"
                 type="image/gif" height="50"></embed></object>
                <?php 
    }
    ?>
        </div>

        <div id="left_menu2" name="left_menu2" class="col-md-4" style="font-size:1.0em;">
            <?php 
    $query = "Select * from users where id =?";
    $prov = sqlQuery($query, array($pat_data['ref_providerID']));
    $Ref_provider = $prov['fname'] . " " . $prov['lname'];
    $prov = sqlQuery($query, array($pat_data['providerID']));
    // $PCP = $prov['fname']." ".$prov['lname'];
    $query = "Select * from insurance_companies where id in (select provider from insurance_data where pid =? and type='primary')";
    $ins = sqlQuery($query, array($pid));
    $ins_co1 = $ins['name'];
    $query = "Select * from insurance_companies where id in (select provider from insurance_data where pid =? and type='secondary')";
    $ins = sqlQuery($query, array($pid));
    $ins_co2 = $ins['name'];
    ?>

            <div style="position:relative;float:left;padding-left:18px;top:0px;">
            <table style="border:1pt;font-size:1.0em;">
                <tr>
                    <td class="right"><b><?php 
    echo xlt("PCP");
    ?>
:</b>&nbsp;</td><td style="font-size:0.8em;">&nbsp;
                        <?php 
    $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND ( authorized = 1 OR ( username = '' AND npi != '' ) ) " . "ORDER BY lname, fname");
    echo "<select name='form_PCP' id='form_PCP' title='" . xla('Primary Care Provider') . "'>";
    echo "<option value=''>" . xlt($empty_title) . "</option>";
    $got_selected = false;
    while ($urow = sqlFetchArray($ures)) {
        $uname = text($urow['lname'] . ' ' . $urow['fname']);
        $optionId = attr($urow['id']);
        echo "<option value='{$optionId}'";
        if ($urow['id'] == $pat_data['providerID']) {
            echo " selected";
            $got_selected = true;
        }
        echo ">{$uname}</option>";
    }
    if (!$got_selected && $currvalue) {
        echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>";
        echo "</select>";
        echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>";
    } else {
        echo "</select>";
    }
    //need to develop a select list that when changed updates the PCP for this patient
    ?>
                    </td>
                </tr>
                <tr><td class="right" nowrap><b><?php 
    echo xlt("Referred By");
    ?>
:</b>&nbsp;</td><td style="font-size:0.8em;">&nbsp;
                    <?php 
    $ures = sqlStatement("SELECT id, fname, lname, specialty FROM users " . "WHERE active = 1 AND ( info IS NULL OR info NOT LIKE '%Inactive%' ) " . "AND ( authorized = 1 OR ( username = '') ) " . "ORDER BY lname, fname");
    echo "<select name='form_rDOC' id='form_rDOC' title='" . xla('Every name in the address book appears here, not only physicians.') . "'>";
    echo "<option value=''>" . xlt($empty_title) . "</option>";
    $got_selected = false;
    while ($urow = sqlFetchArray($ures)) {
        $uname = text($urow['lname'] . ' ' . $urow['fname']);
        $optionId = attr($urow['id']);
        echo "<option value='{$optionId}'";
        if ($urow['id'] == $pat_data['ref_providerID']) {
            echo " selected";
            $got_selected = true;
        }
        echo ">{$uname}</option>";
    }
    if (!$got_selected && $currvalue) {
        echo "<option value='" . attr($currvalue) . "' selected>* " . text($currvalue) . " *</option>";
        echo "</select>";
        echo " <font color='red' title='" . xla('Please choose a valid selection from the list.') . "'>" . xlt('Fix this') . "!</font>";
    } else {
        echo "</select>";
    }
    //need to develop a select list that when changed updates the PCP for this patient
    ?>
                    </td></tr>
                <tr><td class="right"><b><?php 
    echo xlt("Insurance");
    ?>
:</b>&nbsp;</td><td>&nbsp;<?php 
    echo text($ins_co1);
    ?>
</td></tr>
                <tr><td class="right"><b><?php 
    echo xlt("Secondary");
    ?>
:</b>&nbsp;</td><td>&nbsp;<?php 
    echo text($ins_co2);
    ?>
</td></tr>
            </table>
            </div>
        </div>

    </div>
    <?php 
}
Example #4
0
});

// JavaScript stuff to do when a new patient is set.
//
function setMyPatient() {
<?php if ($GLOBALS['concurrent_layout']) { ?>
 // Avoid race conditions with loading of the left_nav or Title frame.
 if (!parent.allFramesLoaded()) {
  setTimeout("setMyPatient()", 500);
  return;
 }
<?php if (isset($_GET['set_pid'])) { ?>
 parent.left_nav.setPatient(<?php echo "'" . htmlspecialchars(($result['fname']) . " " . ($result['lname']),ENT_QUOTES) .
   "'," . htmlspecialchars($pid,ENT_QUOTES) . ",'" . htmlspecialchars(($result['pubpid']),ENT_QUOTES) .
   "','', ' " . htmlspecialchars(xl('DOB') . ": " . oeFormatShortDate($result['DOB_YMD']) . " " . xl('Age') . ": " . getPatientAgeDisplay($result['DOB_YMD']), ENT_QUOTES) . "'"; ?>);
 var EncounterDateArray = new Array;
 var CalendarCategoryArray = new Array;
 var EncounterIdArray = new Array;
 var Count = 0;
<?php
  //Encounter details are stored to javacript as array.
  $result4 = sqlStatement("SELECT fe.encounter,fe.date,openemr_postcalendar_categories.pc_catname FROM form_encounter AS fe ".
    " left join openemr_postcalendar_categories on fe.pc_catid=openemr_postcalendar_categories.pc_catid  WHERE fe.pid = ? order by fe.date desc", array($pid));
  if(sqlNumRows($result4)>0) {
    while($rowresult4 = sqlFetchArray($result4)) {
?>
 EncounterIdArray[Count] = '<?php echo htmlspecialchars($rowresult4['encounter'], ENT_QUOTES); ?>';
 EncounterDateArray[Count] = '<?php echo htmlspecialchars(oeFormatShortDate(date("Y-m-d", strtotime($rowresult4['date']))), ENT_QUOTES); ?>';
 CalendarCategoryArray[Count] = '<?php echo htmlspecialchars(xl_appt_category($rowresult4['pc_catname']), ENT_QUOTES); ?>';
 Count++;