本文整理汇总了PHP中sqlNumRows函数的典型用法代码示例。如果您正苦于以下问题:PHP sqlNumRows函数的具体用法?PHP sqlNumRows怎么用?PHP sqlNumRows使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sqlNumRows函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getLayoutLabel
function getLayoutLabel($value, $form_id)
{
// get from layout_options
$sql = sqlStatement("SELECT title from layout_options WHERE form_id = ? and field_id = ?", array($form_id, $value));
if (sqlNumRows($sql) > 0) {
$result = sqlFetchArray($sql);
return xl($result['title']);
}
// if not found, default to the passed-in value
return $value;
}
示例2: test
public function test(CqmPatient $patient, $beginDate, $endDate)
{
// Flow of control loop
$return = false;
do {
// See if BMI has been recorded between >=22kg/m2 and <30kg/m2 6 months before, or simultanious to the encounter
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( form_vitals.pid = form_encounter.pid ) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? AND form_vitals.BMI >= 22 AND form_vitals.BMI < 30 " . "AND DATE( form_vitals.date ) >= DATE_ADD( form_encounter.date, INTERVAL -6 MONTH ) " . "AND DATE( form_vitals.date ) <= DATE( form_encounter.date ) " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' )";
$res = sqlStatement($query, array($patient->id));
$number = sqlNumRows($res);
if ($number >= 1) {
$return = true;
break;
}
// See if BMI has been recorded >=30kg/m2 6 months before, or simultanious to the encounter
// AND ÒCare goal: follow-up plan BMI managementÓ OR ÒCommunication provider to provider: dietary consultation orderÓ
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( form_vitals.pid = form_encounter.pid ) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? AND form_vitals.BMI >= 30 " . "AND ( DATE( form_vitals.date ) >= DATE_ADD( form_encounter.date, INTERVAL -6 MONTH ) ) " . "AND ( DATE( form_vitals.date ) <= DATE( form_encounter.date ) ) " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' )";
$res = sqlStatement($query, array($patient->id));
$number = sqlNumRows($res);
if ($number >= 1 && (Helper::check(ClinicalType::CARE_GOAL, CareGoal::FOLLOW_UP_PLAN_BMI_MGMT, $patient) || Helper::check(ClinicalType::COMMUNICATION, Communication::DIET_CNSLT, $patient))) {
$return = true;
break;
}
// See if BMI has been recorded <22kg/m2 6 months before, or simultanious to the encounter
// AND ÒCare goal: follow-up plan BMI managementÓ OR ÒCommunication provider to provider: dietary consultation orderÓ
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( form_vitals.pid = form_encounter.pid ) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? AND form_vitals.BMI < 22 " . "AND ( DATE( form_vitals.date ) >= DATE_ADD( form_encounter.date, INTERVAL -6 MONTH ) ) " . "AND ( DATE( form_vitals.date ) <= DATE( form_encounter.date ) ) " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' )";
$res = sqlStatement($query, array($patient->id));
$number = sqlNumRows($res);
if ($number >= 1 && (Helper::check(ClinicalType::CARE_GOAL, CareGoal::FOLLOW_UP_PLAN_BMI_MGMT, $patient) || Helper::check(ClinicalType::COMMUNICATION, Communication::DIET_CNSLT, $patient))) {
$return = true;
break;
}
} while (false);
return $return;
}
示例3: portal_connection
/**
* Offsite Portal connection function library.
*
* Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
*
* LICENSE: This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Eldho Chacko <eldho@zhservices.com>
* @author Vinish K <vinish@zhservices.com>
* @link http://www.open-emr.org
*/
function portal_connection(){
global $credentials;
$password = $GLOBALS['portal_offsite_password'];
$randkey = '';
$timminus = date("Y-m-d H:m",(strtotime(date("Y-m-d H:m"))-7200)).":00";
sqlStatement("DELETE FROM audit_details WHERE audit_master_id IN(SELECT id FROM audit_master WHERE type=5 AND created_time<=?)",array($timminus));
sqlStatement("DELETE FROM audit_master WHERE type=5 AND created_time<=?",array($timminus));
do{
$randkey = substr(md5(rand().rand()), 0, 8);
$res = sqlStatement("SELECT * FROM audit_details WHERE field_value = ?",array($randkey));
$cnt = sqlNumRows($res);
}
while($cnt>0);
$password = sha1($password.gmdate("Y-m-d H").$randkey);
$grpID = sqlInsert("INSERT INTO audit_master SET type=5");
sqlStatement("INSERT INTO audit_details SET field_value=? , audit_master_id=?",array($randkey,$grpID));
$credentials = array($GLOBALS['portal_offsite_username'],$password,$randkey);
//CALLING WEBSERVICE ON THE PATIENT-PORTAL
$client = new SoapClient(null, array(
'location' => $GLOBALS['portal_offsite_address_patient_link']."/webservice/webserver.php",
'uri' => "urn://portal/req"
)
);
return $client;
}
示例4: doPatientCheck
public function doPatientCheck(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
{
$data = Codes::lookup($this->getOptionId());
$range = new Range(Range::NEG_INF, Range::POS_INF);
if (isset($options[self::OPTION_RANGE]) && is_a($options[self::OPTION_RANGE], 'Range')) {
$range = $options[self::OPTION_RANGE];
}
foreach ($data as $codeType => $codes) {
foreach ($codes as $code) {
// search through vitals to find the most recent lab result in the date range
// if the result value is within range using Range->test(val), return true
$sql = "SELECT procedure_result.result, procedure_result.date " . "FROM `procedure_type`, " . "`procedure_order`, " . "`procedure_report`, " . "`procedure_result` " . "WHERE procedure_type.procedure_type_id = procedure_order.procedure_type_id " . "AND procedure_order.procedure_order_id = procedure_report.procedure_order_id " . "AND procedure_report.procedure_report_id = procedure_result.procedure_report_id " . "AND ( procedure_type.standard_code = ? OR procedure_type.procedure_code = ? ) " . "AND procedure_report.date_collected >= ? " . "AND procedure_report.date_collected <= ? " . "AND procedure_order.patient_id = ? ";
if ($range->lowerBound != Range::NEG_INF) {
$sql .= "AND procedure_result.result >= ? ";
}
if ($range->upperBound != Range::POS_INF) {
$sql .= "AND procedure_result.result < ? ";
}
$bindings = array($codeType . ':' . $code, $code, $beginDate, $endDate, $patient->id);
if ($range->lowerBound != Range::NEG_INF) {
$bindings[] = $range->lowerBound;
}
if ($range->upperBound != Range::POS_INF) {
$bindings[] = $range->upperBound;
}
$result = sqlStatement($sql, $bindings);
$number = sqlNumRows($result);
if ($number > 0) {
return true;
}
}
}
return false;
}
示例5: test
public function test(CqmPatient $patient, $beginDate, $endDate)
{
// See if BP has been done within the measurement period (on a day of a specified encounter)
$query = "SELECT form_vitals.bps, form_vitals.bpd " . "FROM `form_vitals` " . "LEFT JOIN `form_encounter` " . "ON ( DATE(form_vitals.date) = DATE(form_encounter.date)) " . "LEFT JOIN `enc_category_map` " . "ON (enc_category_map.main_cat_id = form_encounter.pc_catid) " . "WHERE form_vitals.pid = ?" . "AND form_vitals.bps IS NOT NULL AND form_vitals.bps between 100 and 140 " . "AND form_vitals.bpd IS NOT NULL AND form_vitals.bpd between 60 and 90 " . "AND form_vitals.date >= ? " . "AND form_vitals.date <= ? " . "AND ( enc_category_map.rule_enc_id = 'enc_outpatient' OR enc_category_map.rule_enc_id = 'enc_nurs_fac' )";
$res = sqlStatement($query, array($patient->id, $beginDate, $endDate));
$number = sqlNumRows($res);
if ($number > 0) {
return true;
}
return false;
}
示例6: md5_pass
function md5_pass($length = 8)
{
$randkey = substr(md5(rand() . rand()), 0, $length);
$res = sqlStatement("SELECT * FROM audit_master AS am LEFT OUTER JOIN audit_details AS ad ON ad.audit_master_id=am.id WHERE type=5 AND field_value=?", array($randkey));
if (sqlNumRows($res)) {
md5_pass();
} else {
$grpID = sqlInsert("INSERT INTO audit_master SET type=5");
sqlStatement("INSERT INTO audit_details SET field_value=? , audit_master_id=?", array($randkey, $grpID));
return $randkey;
}
}
示例7: checkIfPatientValidationHookIsActive
function checkIfPatientValidationHookIsActive()
{
$module_query = sqlStatement("SELECT * FROM modules WHERE mod_name= 'Patientvalidation' and mod_active=1");
if (sqlNumRows($module_query)) {
//if you want to check inactive active hook please uncheck the following comment
//$s = "<div style='margin-bottom:10px; border:1px solid black;padding: 5px 5px 5px 5px;width:300px;background-color: #79bbff'><center> " . xl("You are using patient validation module") . "</center></div>";
// echo $s;
return true;
}
else
return false;
}
示例8: lookup_openemr_patient
function lookup_openemr_patient($wp_login)
{
if (empty($wp_login)) {
die(xlt('The patient was not logged in when submitting this form'));
}
$ptres = sqlStatement("SELECT pid FROM patient_data WHERE cmsportal_login = ?", array($wp_login));
if (sqlNumRows($ptres) < 1) {
die(xlt('There is no patient with portal login') . " '{$wp_login}'");
}
if (sqlNumRows($ptres) > 1) {
die(xlt('There are multiple patients with portal login') . " '{$wp_login}'");
}
$ptrow = sqlFetchArray($ptres);
return $ptrow['pid'];
}
示例9: lookup_pt
function lookup_pt($wp_login)
{
if (empty($wp_login)) {
return false;
}
$ptres = sqlStatement("SELECT pid FROM patient_data WHERE cmsportal_login = ?", array($wp_login));
if (sqlNumRows($ptres) < 1) {
return false;
}
if (sqlNumRows($ptres) > 1) {
return false;
}
$ptrow = sqlFetchArray($ptres);
return $ptrow['pid'];
}
示例10: update_visit_forms
function update_visit_forms(&$menu_list)
{
$baseURL = "/interface/patient_file/encounter/load_form.php?formname=";
$menu_list->children = array();
$lres = sqlStatement("SELECT * FROM list_options " . "WHERE list_id = 'lbfnames' AND activity = 1 ORDER BY seq, title");
if (sqlNumRows($lres)) {
while ($lrow = sqlFetchArray($lres)) {
$option_id = $lrow['option_id'];
// should start with LBF
$title = $lrow['title'];
$formURL = $baseURL . urlencode($option_id);
$formEntry = new stdClass();
$formEntry->label = xl_form_title($title);
$formEntry->url = $formURL;
$formEntry->requirement = 2;
$formEntry->target = 'enc';
array_push($menu_list->children, $formEntry);
}
}
$reg = getRegistered();
if (!empty($reg)) {
foreach ($reg as $entry) {
$option_id = $entry['directory'];
$title = trim($entry['nickname']);
if ($option_id == 'fee_sheet') {
continue;
}
if ($option_id == 'newpatient') {
continue;
}
if (empty($title)) {
$title = $entry['name'];
}
$formURL = $baseURL . urlencode($option_id);
$formEntry = new stdClass();
$formEntry->label = xl_form_title($title);
$formEntry->url = $formURL;
$formEntry->requirement = 2;
$formEntry->target = 'enc';
array_push($menu_list->children, $formEntry);
}
}
}
示例11: getQRDAStratumInfo
function getQRDAStratumInfo($patArr, $begin_date)
{
$startumArr = array();
if (count($patArr) > 0) {
//Age Between 3 and 11
$stratumOneQry = "SELECT FLOOR( DATEDIFF( '" . add_escape_custom($begin_date) . "' , DOB ) /365 ) as pt_age FROM patient_data WHERE pid IN (" . add_escape_custom(implode(",", $patArr)) . ") HAVING (pt_age BETWEEN 1 AND 10) ";
$stratumOneRes = sqlStatement($stratumOneQry);
$stratumOneRows = sqlNumRows($stratumOneRes);
//Age Between 12 and 17
$stratumTwoQry = "SELECT FLOOR( DATEDIFF( '" . add_escape_custom($begin_date) . "' , DOB ) /365 ) as pt_age FROM patient_data WHERE pid IN (" . add_escape_custom(implode(",", $patArr)) . ") HAVING (pt_age BETWEEN 11 AND 16) ";
$stratumTwoRes = sqlStatement($stratumTwoQry);
$stratumTwoRows = sqlNumRows($stratumTwoRes);
$startumArr[1] = $stratumOneRows;
$startumArr[2] = $stratumTwoRows;
} else {
$startumArr[1] = 0;
$startumArr[2] = 0;
}
return $startumArr;
}
示例12: doPatientCheck
public function doPatientCheck(RsPatient $patient, $beginDate = null, $endDate = null, $options = null)
{
$data = Codes::lookup($this->getOptionId());
$type = $this->getListType();
foreach ($data as $codeType => $codes) {
foreach ($codes as $code) {
if (exist_lists_item($patient->id, $type, $codeType . '::' . $code, $endDate)) {
return true;
}
}
}
if ($this->getOptionId() == self::FINDING_BMI_PERC) {
// check for any BMI percentile finding
// there are a few BMI codes, but it doesn't matter,
// because we just want to check for any finding
$query = "SELECT form_vitals.BMI " . "FROM `form_vitals` " . "WHERE form_vitals.BMI IS NOT NULL " . "AND form_vitals.pid = ? " . "AND DATE( form_vitals.date ) >= ? " . "AND DATE( form_vitals.date ) <= ? ";
$res = sqlStatement($query, array($patient->id, $beginDate, $endDate));
$number = sqlNumRows($res);
if ($number >= 1) {
return true;
}
}
return false;
}
示例13: MIN
if ($to_date) {
$query .= "AND fe.date >= '{$from_date} 00:00:00' AND fe.date <= '{$to_date} 23:59:59' ";
} else {
$query .= "AND fe.date >= '{$from_date} 00:00:00' AND fe.date <= '{$from_date} 23:59:59' ";
}
if ($provider) {
$query .= "AND fe.provider_id = '{$provider}' ";
}
if ($facility) {
$query .= "AND fe.facility_id = '{$facility}' ";
}
if ($new_patients) {
$query .= "AND fe.date = (SELECT MIN(fe2.date) FROM form_encounter AS fe2 WHERE fe2.pid = fe.pid) ";
}
$res = sqlStatement($query);
$numRows = sqlNumRows($res);
if ($numRows > 0) {
$lastdocname = "";
$doc_encounters = 0;
while ($row = sqlFetchArray($res)) {
$patient_id = $row['pid'];
$docname = '';
if (!empty($row['ulname']) || !empty($row['ufname'])) {
$docname = $row['ulname'];
if (!empty($row['ufname']) || !empty($row['umname'])) {
$docname .= ', ' . $row['ufname'] . ' ' . $row['umname'];
}
}
$errmsg = "";
if ($details) {
// Fetch all other forms for this encounter.
示例14: xlt
}
</script>
</head>
<body class="body_top">
<form action="list_amendments.php" name="list_amendments" id="list_amendments" method="post" onsubmit='return top.restoreSession()'>
<span class="title"><?php
echo xlt('List');
?>
</span>
<?php
$query = "SELECT * FROM amendments WHERE pid = ? ORDER BY amendment_date DESC";
$resultSet = sqlStatement($query, array($pid));
if (sqlNumRows($resultSet)) {
?>
<table cellspacing="0" cellpadding="0" style="width:100%">
<tr>
<td><a href="javascript:checkForAmendments();" class="css_button"><span><?php
echo xlt("Print Amendments");
?>
</span></a></td>
<td align="right">
<a href="#" class="small" onClick="checkUncheck(1);"><span><?php
echo xlt('Check All');
?>
</span></a> |
<a href="#" class="small" onClick="checkUncheck(0);"><span><?php
echo xlt('Clear All');
?>
示例15: generate_receipt
}
// If an encounter ID was given, then we must generate a receipt.
//
if (!empty($_GET['enc'])) {
generate_receipt($patient_id, $_GET['enc']);
exit;
}
// Get the unbilled billing table items and product sales for
// this patient.
$query = "SELECT id, date, code_type, code, modifier, code_text, " . "provider_id, payer_id, units, fee, encounter " . "FROM billing WHERE pid = ? AND activity = 1 AND " . "billed = 0 AND code_type != 'TAX' " . "ORDER BY encounter DESC, id ASC";
$bres = sqlStatement($query, array($patient_id));
$query = "SELECT s.sale_id, s.sale_date, s.prescription_id, s.fee, " . "s.quantity, s.encounter, s.drug_id, d.name, r.provider_id " . "FROM drug_sales AS s " . "LEFT JOIN drugs AS d ON d.drug_id = s.drug_id " . "LEFT OUTER JOIN prescriptions AS r ON r.id = s.prescription_id " . "WHERE s.pid = ? AND s.billed = 0 " . "ORDER BY s.encounter DESC, s.sale_id ASC";
$dres = sqlStatement($query, array($patient_id));
// If there are none, just redisplay the last receipt and exit.
//
if (sqlNumRows($bres) == 0 && sqlNumRows($dres) == 0) {
generate_receipt($patient_id);
exit;
}
// Get the valid practitioners, including those not active.
$arr_users = array();
$ures = sqlStatement("SELECT id, username FROM users WHERE " . "( authorized = 1 OR info LIKE '%provider%' ) AND username != ''");
while ($urow = sqlFetchArray($ures)) {
$arr_users[$urow['id']] = '1';
}
// Now write a data entry form:
// List unbilled billing items (cpt, hcpcs, copays) for the patient.
// List unbilled product sales for the patient.
// Present an editable dollar amount for each line item, a total
// which is also the default value of the input payment amount,
// and OK and Cancel buttons.