@@ -6622,11 +6622,11 @@ function search_patients_by_id($q, $labsection = 0)
6622
6622
function search_patients_by_id_dyn($q, $cap, $counter, $labsection = 0, $satellite_lab_id)
6623
6623
{
6624
6624
# Searches for patients with similar name
6625
- global $con;
6625
+ global $con, $LIS_SATELLITE_LAB_USER ;
6626
6626
$offset = $cap * ($counter - 1);
6627
6627
$q = mysql_real_escape_string($q, $con);
6628
6628
6629
- if ($_SESSION['user_level'] == 20 ){
6629
+ if ($_SESSION['user_level'] == $LIS_SATELLITE_LAB_USER ){
6630
6630
if($labsection == 0){
6631
6631
$query_string =
6632
6632
"SELECT * FROM patient ".
@@ -6638,7 +6638,8 @@ function search_patients_by_id_dyn($q, $cap, $counter, $labsection = 0, $satelli
6638
6638
"(select specimen_id from specimen where specimen_type_id in (select specimen_type_id from specimen_test where test_type_id in ".
6639
6639
"(select test_type_id as lab_section from test_type where test_category_id = '$labsection'))) ORDER BY p.ts DESC LIMIT $offset,$cap";
6640
6640
}
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']))) {
6642
6643
if($labsection == 0){
6643
6644
$query_string =
6644
6645
"SELECT * FROM patient ".
@@ -6766,15 +6767,15 @@ function search_patients_by_name($q, $labsection = 0,$c="")
6766
6767
function search_patients_by_name_dyn($q, $cap, $counter, $c="", $labsection = 0, $satellite_lab_id)
6767
6768
{
6768
6769
# Searches for patients with similar name
6769
- global $con;
6770
+ global $con, $LIS_SATELLITE_LAB_USER ;
6770
6771
$offset = $cap * ($counter - 1);
6771
6772
$q = mysql_real_escape_string($q, $con);
6772
6773
if(empty($c))
6773
6774
$q.='%';
6774
6775
else
6775
6776
$q=str_replace('[pq]',$q,$c);
6776
6777
6777
- if ($_SESSION['user_level'] == 20 ){
6778
+ if ($_SESSION['user_level'] == $LIS_SATELLITE_LAB_USER ){
6778
6779
if($labsection == 0){
6779
6780
$query_string =
6780
6781
"SELECT * FROM patient ".
@@ -6786,7 +6787,8 @@ function search_patients_by_name_dyn($q, $cap, $counter, $c="", $labsection = 0,
6786
6787
"(select specimen_id from specimen where specimen_type_id in (select specimen_type_id from specimen_test where test_type_id in ".
6787
6788
"(select test_type_id as lab_section from test_type where test_category_id = '$labsection'))) ORDER BY p.name ASC LIMIT $offset,$cap";
6788
6789
}
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']))) {
6790
6792
if($labsection == 0){
6791
6793
$query_string =
6792
6794
"SELECT * FROM patient ".
@@ -6909,12 +6911,12 @@ function search_patients_by_addlid($q, $labsection = 0, $satellite_lab_id)
6909
6911
function search_patients_by_addlid_dyn($q, $cap, $counter, $labsection = 0, $satellite_lab_id)
6910
6912
{
6911
6913
# Searches for patients with similar name
6912
- global $con;
6914
+ global $con, $LIS_SATELLITE_LAB_USER ;
6913
6915
$offset = $cap * ($counter - 1);
6914
6916
$q = mysql_real_escape_string($q, $con);
6915
6917
$user = get_user_by_id($_SESSION['user_id']);
6916
6918
6917
- if ($_SESSION['user_level'] == 20 ){
6919
+ if ($_SESSION['user_level'] == $LIS_SATELLITE_LAB_USER ){
6918
6920
if($labsection == 0){
6919
6921
$query_string =
6920
6922
"SELECT * FROM patient ".
@@ -6927,7 +6929,8 @@ function search_patients_by_addlid_dyn($q, $cap, $counter, $labsection = 0, $sat
6927
6929
"(select test_type_id as lab_section from test_type where test_category_id = '$labsection'))) ORDER BY p.addl_id ASC LIMIT $offset,$cap";
6928
6930
6929
6931
}
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']))){
6931
6934
if($labsection == 0){
6932
6935
$query_string =
6933
6936
"SELECT * FROM patient ".
0 commit comments