Esempio n. 1
0
function doSubs($s)
{
    global $ptrow, $hisrow, $enrow, $nextLocation, $keyLocation, $keyLength;
    global $groupLevel, $groupCount, $itemSeparator, $pid, $encounter;
    $nextLocation = 0;
    $groupLevel = 0;
    $groupCount = 0;
    while (($keyLocation = strpos($s, '{', $nextLocation)) !== FALSE) {
        $nextLocation = $keyLocation + 1;
        if (keySearch($s, '{PatientName}')) {
            $tmp = $ptrow['fname'];
            if ($ptrow['mname']) {
                if ($tmp) {
                    $tmp .= ' ';
                }
                $tmp .= $ptrow['mname'];
            }
            if ($ptrow['lname']) {
                if ($tmp) {
                    $tmp .= ' ';
                }
                $tmp .= $ptrow['lname'];
            }
            $s = keyReplace($s, dataFixup($tmp, xl('Name')));
        } else {
            if (keySearch($s, '{PatientID}')) {
                $s = keyReplace($s, dataFixup($ptrow['pubpid'], xl('Chart ID')));
            } else {
                if (keySearch($s, '{Address}')) {
                    $s = keyReplace($s, dataFixup($ptrow['street'], xl('Street')));
                } else {
                    if (keySearch($s, '{City}')) {
                        $s = keyReplace($s, dataFixup($ptrow['city'], xl('City')));
                    } else {
                        if (keySearch($s, '{State}')) {
                            $s = keyReplace($s, dataFixup(getListItemTitle('state', $ptrow['state']), xl('State')));
                        } else {
                            if (keySearch($s, '{Zip}')) {
                                $s = keyReplace($s, dataFixup($ptrow['postal_code'], xl('Postal Code')));
                            } else {
                                if (keySearch($s, '{PatientPhone}')) {
                                    $ptphone = $ptrow['phone_contact'];
                                    if (empty($ptphone)) {
                                        $ptphone = $ptrow['phone_home'];
                                    }
                                    if (empty($ptphone)) {
                                        $ptphone = $ptrow['phone_cell'];
                                    }
                                    if (empty($ptphone)) {
                                        $ptphone = $ptrow['phone_biz'];
                                    }
                                    if (preg_match("/([2-9]\\d\\d)\\D*(\\d\\d\\d)\\D*(\\d\\d\\d\\d)/", $ptphone, $tmp)) {
                                        $ptphone = '(' . $tmp[1] . ')' . $tmp[2] . '-' . $tmp[3];
                                    }
                                    $s = keyReplace($s, dataFixup($ptphone, xl('Phone')));
                                } else {
                                    if (keySearch($s, '{PatientDOB}')) {
                                        $s = keyReplace($s, dataFixup(oeFormatShortDate($ptrow['DOB']), xl('Birth Date')));
                                    } else {
                                        if (keySearch($s, '{PatientSex}')) {
                                            $s = keyReplace($s, dataFixup(getListItemTitle('sex', $ptrow['sex']), xl('Sex')));
                                        } else {
                                            if (keySearch($s, '{DOS}')) {
                                                $s = keyReplace($s, dataFixup(oeFormatShortDate(substr($enrow['date'], 0, 10)), xl('Service Date')));
                                            } else {
                                                if (keySearch($s, '{ChiefComplaint}')) {
                                                    $cc = $enrow['reason'];
                                                    $patientid = $ptrow['pid'];
                                                    $DOS = substr($enrow['date'], 0, 10);
                                                    // Prefer appointment comment if one is present.
                                                    $evlist = fetchEvents($DOS, $DOS, " AND pc_pid = ? ", null, false, 0, array($patientid));
                                                    foreach ($evlist as $tmp) {
                                                        if ($tmp['pc_pid'] == $pid && !empty($tmp['pc_hometext'])) {
                                                            $cc = $tmp['pc_hometext'];
                                                        }
                                                    }
                                                    $s = keyReplace($s, dataFixup($cc, xl('Chief Complaint')));
                                                } else {
                                                    if (keySearch($s, '{ReferringDOC}')) {
                                                        $tmp = empty($ptrow['ur_fname']) ? '' : $ptrow['ur_fname'];
                                                        if (!empty($ptrow['ur_mname'])) {
                                                            if ($tmp) {
                                                                $tmp .= ' ';
                                                            }
                                                            $tmp .= $ptrow['ur_mname'];
                                                        }
                                                        if (!empty($ptrow['ur_lname'])) {
                                                            if ($tmp) {
                                                                $tmp .= ' ';
                                                            }
                                                            $tmp .= $ptrow['ur_lname'];
                                                        }
                                                        $s = keyReplace($s, dataFixup($tmp, xl('Referer')));
                                                    } else {
                                                        if (keySearch($s, '{Allergies}')) {
                                                            $tmp = generate_plaintext_field(array('data_type' => '24', 'list_id' => ''), '');
                                                            $s = keyReplace($s, dataFixup($tmp, xl('Allergies')));
                                                        } else {
                                                            if (keySearch($s, '{Medications}')) {
                                                                $s = keyReplace($s, dataFixup(getIssues('medication'), xl('Medications')));
                                                            } else {
                                                                if (keySearch($s, '{ProblemList}')) {
                                                                    $s = keyReplace($s, dataFixup(getIssues('medical_problem'), xl('Problem List')));
                                                                } else {
                                                                    if (keySearch($s, '{GRP}')) {
                                                                        ++$groupLevel;
                                                                        $groupCount = 0;
                                                                        $s = keyReplace($s, '');
                                                                    } else {
                                                                        if (keySearch($s, '{/GRP}')) {
                                                                            if ($groupLevel > 0) {
                                                                                --$groupLevel;
                                                                            }
                                                                            $s = keyReplace($s, '');
                                                                        } else {
                                                                            if (preg_match('/^\\{ITEMSEP\\}(.*?)\\{\\/ITEMSEP\\}/', substr($s, $keyLocation), $matches)) {
                                                                                $itemSeparator = $matches[1];
                                                                                $keyLength = strlen($matches[0]);
                                                                                $s = keyReplace($s, '');
                                                                            } else {
                                                                                if (preg_match('/^\\{(LBF\\w+):(\\w+)\\}/', substr($s, $keyLocation), $matches)) {
                                                                                    $formname = $matches[1];
                                                                                    $fieldid = $matches[2];
                                                                                    $keyLength = 3 + strlen($formname) + strlen($fieldid);
                                                                                    $data = '';
                                                                                    $currvalue = '';
                                                                                    $title = '';
                                                                                    $frow = sqlQuery("SELECT * FROM layout_options " . "WHERE form_id = ? AND field_id = ? LIMIT 1", array($formname, $fieldid));
                                                                                    if (!empty($frow)) {
                                                                                        $ldrow = sqlQuery("SELECT ld.field_value " . "FROM lbf_data AS ld, forms AS f WHERE " . "f.pid = ? AND f.encounter = ? AND f.formdir = ? AND f.deleted = 0 AND " . "ld.form_id = f.form_id AND ld.field_id = ? " . "ORDER BY f.form_id DESC LIMIT 1", array($pid, $encounter, $formname, $fieldid));
                                                                                        if (!empty($ldrow)) {
                                                                                            $currvalue = $ldrow['field_value'];
                                                                                            $title = $frow['title'];
                                                                                        }
                                                                                        if ($currvalue !== '') {
                                                                                            $data = generate_plaintext_field($frow, $currvalue);
                                                                                        }
                                                                                    }
                                                                                    $s = keyReplace($s, dataFixup($data, $title));
                                                                                } else {
                                                                                    if (preg_match('/^\\{(DEM|HIS):(\\w+)\\}/', substr($s, $keyLocation), $matches)) {
                                                                                        $formname = $matches[1];
                                                                                        $fieldid = $matches[2];
                                                                                        $keyLength = 3 + strlen($formname) + strlen($fieldid);
                                                                                        $data = '';
                                                                                        $currvalue = '';
                                                                                        $title = '';
                                                                                        $frow = sqlQuery("SELECT * FROM layout_options " . "WHERE form_id = ? AND field_id = ? LIMIT 1", array($formname, $fieldid));
                                                                                        if (!empty($frow)) {
                                                                                            $tmprow = $formname == 'DEM' ? $ptrow : $hisrow;
                                                                                            if (isset($tmprow[$fieldid])) {
                                                                                                $currvalue = $tmprow[$fieldid];
                                                                                                $title = $frow['title'];
                                                                                            }
                                                                                            if ($currvalue !== '') {
                                                                                                $data = generate_plaintext_field($frow, $currvalue);
                                                                                            }
                                                                                        }
                                                                                        $s = keyReplace($s, dataFixup($data, $title));
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // End if { character found.
    return $s;
}
Esempio n. 2
0
if (!is_null($gui->execSet)) {
    $gui->execSet = testcase::addExecIcons($gui->execSet, $smarty->tlImages);
}
$node['basic'] = $tcase_mgr->tree_manager->get_node_hierarchy_info($args->tcase_id);
$node['specific'] = $tcase_mgr->getExternalID($args->tcase_id);
$idCard = $node['specific'][0] . ' : ' . $node['basic']['name'];
$gui->warning_msg = !is_null($gui->execSet) ? '' : lang_get('tcase_never_executed');
$gui->user_is_admin = $_SESSION['currentUser']->globalRole->name == 'admin' ? true : false;
if (!is_null($gui->execSet)) {
    $gui->execPlatformSet = $tcase_mgr->getExecutedPlatforms($args->tcase_id);
    // get issue tracker config and object to manage TestLink - BTS integration
    $its = null;
    $tproject_mgr = new testproject($db);
    $info = $tproject_mgr->get_by_id($gui->tproject_id);
    if ($info['issue_tracker_enabled']) {
        $gui->bugs = getIssues($db, $gui->execSet, $gui->tproject_id);
    }
    // get custom fields brute force => do not check if this call is needed
    $gui->cfexec = getCustomFields($tcase_mgr, $gui->execSet);
    $gui->attachments = null;
    //getAttachments($db,$gui->execSet);
}
$gui->displayPlatformCol = !is_null($gui->execPlatformSet) ? 1 : 0;
$gui->detailed_descr = lang_get('test_case') . ' ' . $idCard;
$smarty->assign('gui', $gui);
$smarty->display($templateCfg->template_dir . $templateCfg->default_template);
function init_args()
{
    $args = new stdClass();
    $_REQUEST = strings_stripSlashes($_REQUEST);
    $iParams = array("tcase_id" => array(tlInputParameter::INT_N));
Esempio n. 3
0
<?php

require_once 'config.php';
require 'design_head.php';
echo '<h1>Issues</h1>';
$list = getIssues(0);
d($list);
require 'design_foot.php';
                                        </select>
                                        

                                        </div>
                                    </div>
                                    <br>

                                 <div class="control-group ">
                                    <label class="control-label">Issue<span class="required">*</span></label>
                                    <div class="controls">
                                        <select class="span4" name="issue" <?php 
echo isset($_GET['update']) ? "disabled" : "";
?>
>
                                            <?php 
$issues = getIssues();
while ($issue = mysqli_fetch_object($issues)) {
    echo "<option value=\"{$issue->issue_id}\" " . ($case ? $case->issue_id == $issue->issue_id ? "selected" : "" : "") . ">{$issue->issue_name}</option>";
}
?>
                                           
                                            
                                        </select>
                                        

                                    </div>
                                </div>
                                    <br>
                                <div class"two">
                                    
                                        <label class="control-label">Category<span class="required">*</span></label>
Esempio n. 5
0
/**
 * getGuthubData
 * retrieve data through github API
 */
function getGHData($params)
{
    switch ($params['type']) {
        case "issues":
            return getIssues($params['user'], $params['repo']);
            break;
        case "milestone":
            return getMilestone($params['user'], $params['repo'], $params);
            break;
    }
    return $params;
}