Skip to content

Commit 75bfd78

Browse files
author
pdorsaint3
committed
moved if statements to a new line. Use predefined value of instead of 20.
1 parent 7df3077 commit 75bfd78

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

htdocs/includes/db_lib.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6622,11 +6622,11 @@ function search_patients_by_id($q, $labsection = 0)
66226622
function search_patients_by_id_dyn($q, $cap, $counter, $labsection = 0, $satellite_lab_id)
66236623
{
66246624
# Searches for patients with similar name
6625-
global $con;
6625+
global $con, $LIS_SATELLITE_LAB_USER;
66266626
$offset = $cap * ($counter - 1);
66276627
$q = mysql_real_escape_string($q, $con);
66286628

6629-
if ($_SESSION['user_level'] == 20){
6629+
if ($_SESSION['user_level'] == $LIS_SATELLITE_LAB_USER){
66306630
if($labsection == 0){
66316631
$query_string =
66326632
"SELECT * FROM patient ".
@@ -6638,7 +6638,8 @@ function search_patients_by_id_dyn($q, $cap, $counter, $labsection = 0, $satelli
66386638
"(select specimen_id from specimen where specimen_type_id in (select specimen_type_id from specimen_test where test_type_id in ".
66396639
"(select test_type_id as lab_section from test_type where test_category_id = '$labsection'))) ORDER BY p.ts DESC LIMIT $offset,$cap";
66406640
}
6641-
} if(is_admin_check(get_user_by_id($_SESSION['user_id']))) {
6641+
}
6642+
if(is_admin_check(get_user_by_id($_SESSION['user_id']))) {
66426643
if($labsection == 0){
66436644
$query_string =
66446645
"SELECT * FROM patient ".
@@ -6766,15 +6767,15 @@ function search_patients_by_name($q, $labsection = 0,$c="")
67666767
function search_patients_by_name_dyn($q, $cap, $counter, $c="", $labsection = 0, $satellite_lab_id)
67676768
{
67686769
# Searches for patients with similar name
6769-
global $con;
6770+
global $con, $LIS_SATELLITE_LAB_USER;
67706771
$offset = $cap * ($counter - 1);
67716772
$q = mysql_real_escape_string($q, $con);
67726773
if(empty($c))
67736774
$q.='%';
67746775
else
67756776
$q=str_replace('[pq]',$q,$c);
67766777

6777-
if ($_SESSION['user_level'] == 20){
6778+
if ($_SESSION['user_level'] == $LIS_SATELLITE_LAB_USER){
67786779
if($labsection == 0){
67796780
$query_string =
67806781
"SELECT * FROM patient ".
@@ -6786,7 +6787,8 @@ function search_patients_by_name_dyn($q, $cap, $counter, $c="", $labsection = 0,
67866787
"(select specimen_id from specimen where specimen_type_id in (select specimen_type_id from specimen_test where test_type_id in ".
67876788
"(select test_type_id as lab_section from test_type where test_category_id = '$labsection'))) ORDER BY p.name ASC LIMIT $offset,$cap";
67886789
}
6789-
} if(is_admin_check(get_user_by_id($_SESSION['user_id']))) {
6790+
}
6791+
if(is_admin_check(get_user_by_id($_SESSION['user_id']))) {
67906792
if($labsection == 0){
67916793
$query_string =
67926794
"SELECT * FROM patient ".
@@ -6909,12 +6911,12 @@ function search_patients_by_addlid($q, $labsection = 0, $satellite_lab_id)
69096911
function search_patients_by_addlid_dyn($q, $cap, $counter, $labsection = 0, $satellite_lab_id)
69106912
{
69116913
# Searches for patients with similar name
6912-
global $con;
6914+
global $con, $LIS_SATELLITE_LAB_USER;
69136915
$offset = $cap * ($counter - 1);
69146916
$q = mysql_real_escape_string($q, $con);
69156917
$user = get_user_by_id($_SESSION['user_id']);
69166918

6917-
if ($_SESSION['user_level'] == 20){
6919+
if ($_SESSION['user_level'] == $LIS_SATELLITE_LAB_USER){
69186920
if($labsection == 0){
69196921
$query_string =
69206922
"SELECT * FROM patient ".
@@ -6927,7 +6929,8 @@ function search_patients_by_addlid_dyn($q, $cap, $counter, $labsection = 0, $sat
69276929
"(select test_type_id as lab_section from test_type where test_category_id = '$labsection'))) ORDER BY p.addl_id ASC LIMIT $offset,$cap";
69286930

69296931
}
6930-
} if(is_admin_check(get_user_by_id($_SESSION['user_id']))){
6932+
}
6933+
if(is_admin_check(get_user_by_id($_SESSION['user_id']))){
69316934
if($labsection == 0){
69326935
$query_string =
69336936
"SELECT * FROM patient ".

0 commit comments

Comments
 (0)