From 0b252efc51a772c38354c023d0586e4e108a8ec3 Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Fri, 25 May 2018 14:47:07 -0700 Subject: [PATCH] psr2 fixes to prior commit --- interface/forms/requisition/barcode.php | 262 +++++++++++++++---------------- interface/forms/requisition/new.php | 263 +++++++++++++++++--------------- interface/forms/requisition/view.php | 1 - library/lab.inc | 30 ++-- library/patient.inc | 19 +-- 5 files changed, 291 insertions(+), 284 deletions(-) rewrite interface/forms/requisition/barcode.php (97%) diff --git a/interface/forms/requisition/barcode.php b/interface/forms/requisition/barcode.php dissimilarity index 97% index e11169fb3..5e66e9d73 100644 --- a/interface/forms/requisition/barcode.php +++ b/interface/forms/requisition/barcode.php @@ -1,129 +1,133 @@ - - */ - - // Get pararameters that are passed in through $_GET or set to the default value - $text = (isset($_GET["text"])?$_GET["text"]:"0"); - $size = (isset($_GET["size"])?$_GET["size"]:"20"); - $orientation = (isset($_GET["orientation"])?$_GET["orientation"]:"horizontal"); - $code_type = (isset($_GET["codetype"])?$_GET["codetype"]:"code128"); - $code_string = ""; - - // Translate the $text into barcode the correct $code_type - if ( in_array(strtolower($code_type), array("code128", "code128b")) ) { - $chksum = 104; - // Must not change order of array elements as the checksum depends on the array's key to validate final code - $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","\`"=>"111422","a"=>"121124","b"=>"121421","c"=>"141122","d"=>"141221","e"=>"112214","f"=>"112412","g"=>"122114","h"=>"122411","i"=>"142112","j"=>"142211","k"=>"241211","l"=>"221114","m"=>"413111","n"=>"241112","o"=>"134111","p"=>"111242","q"=>"121142","r"=>"121241","s"=>"114212","t"=>"124112","u"=>"124211","v"=>"411212","w"=>"421112","x"=>"421211","y"=>"212141","z"=>"214121","{"=>"412121","|"=>"111143","}"=>"111341","~"=>"131141","DEL"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","FNC 4"=>"114131","CODE A"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); - $code_keys = array_keys($code_array); - $code_values = array_flip($code_keys); - for ( $X = 1; $X <= strlen($text); $X++ ) { - $activeKey = substr( $text, ($X-1), 1); - $code_string .= $code_array[$activeKey]; - $chksum=($chksum + ($code_values[$activeKey] * $X)); - } - $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; - - $code_string = "211214" . $code_string . "2331112"; - } elseif ( strtolower($code_type) == "code128a" ) { - $chksum = 103; - $text = strtoupper($text); // Code 128A doesn't support lower case - // Must not change order of array elements as the checksum depends on the array's key to validate final code - $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","NUL"=>"111422","SOH"=>"121124","STX"=>"121421","ETX"=>"141122","EOT"=>"141221","ENQ"=>"112214","ACK"=>"112412","BEL"=>"122114","BS"=>"122411","HT"=>"142112","LF"=>"142211","VT"=>"241211","FF"=>"221114","CR"=>"413111","SO"=>"241112","SI"=>"134111","DLE"=>"111242","DC1"=>"121142","DC2"=>"121241","DC3"=>"114212","DC4"=>"124112","NAK"=>"124211","SYN"=>"411212","ETB"=>"421112","CAN"=>"421211","EM"=>"212141","SUB"=>"214121","ESC"=>"412121","FS"=>"111143","GS"=>"111341","RS"=>"131141","US"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","CODE B"=>"114131","FNC 4"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); - $code_keys = array_keys($code_array); - $code_values = array_flip($code_keys); - for ( $X = 1; $X <= strlen($text); $X++ ) { - $activeKey = substr( $text, ($X-1), 1); - $code_string .= $code_array[$activeKey]; - $chksum=($chksum + ($code_values[$activeKey] * $X)); - } - $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; - - $code_string = "211412" . $code_string . "2331112"; - } elseif ( strtolower($code_type) == "code39" ) { - $code_array = array("0"=>"111221211","1"=>"211211112","2"=>"112211112","3"=>"212211111","4"=>"111221112","5"=>"211221111","6"=>"112221111","7"=>"111211212","8"=>"211211211","9"=>"112211211","A"=>"211112112","B"=>"112112112","C"=>"212112111","D"=>"111122112","E"=>"211122111","F"=>"112122111","G"=>"111112212","H"=>"211112211","I"=>"112112211","J"=>"111122211","K"=>"211111122","L"=>"112111122","M"=>"212111121","N"=>"111121122","O"=>"211121121","P"=>"112121121","Q"=>"111111222","R"=>"211111221","S"=>"112111221","T"=>"111121221","U"=>"221111112","V"=>"122111112","W"=>"222111111","X"=>"121121112","Y"=>"221121111","Z"=>"122121111","-"=>"121111212","."=>"221111211"," "=>"122111211","$"=>"121212111","/"=>"121211121","+"=>"121112121","%"=>"111212121","*"=>"121121211"); - - // Convert to uppercase - $upper_text = strtoupper($text); - - for ( $X = 1; $X<=strlen($upper_text); $X++ ) { - $code_string .= $code_array[substr( $upper_text, ($X-1), 1)] . "1"; - } - - $code_string = "1211212111" . $code_string . "121121211"; - } elseif ( strtolower($code_type) == "code25" ) { - $code_array1 = array("1","2","3","4","5","6","7","8","9","0"); - $code_array2 = array("3-1-1-1-3","1-3-1-1-3","3-3-1-1-1","1-1-3-1-3","3-1-3-1-1","1-3-3-1-1","1-1-1-3-3","3-1-1-3-1","1-3-1-3-1","1-1-3-3-1"); - - for ( $X = 1; $X <= strlen($text); $X++ ) { - for ( $Y = 0; $Y < count($code_array1); $Y++ ) { - if ( substr($text, ($X-1), 1) == $code_array1[$Y] ) - $temp[$X] = $code_array2[$Y]; - } - } - - for ( $X=1; $X<=strlen($text); $X+=2 ) { - if ( isset($temp[$X]) && isset($temp[($X + 1)]) ) { - $temp1 = explode( "-", $temp[$X] ); - $temp2 = explode( "-", $temp[($X + 1)] ); - for ( $Y = 0; $Y < count($temp1); $Y++ ) - $code_string .= $temp1[$Y] . $temp2[$Y]; - } - } - - $code_string = "1111" . $code_string . "311"; - } elseif ( strtolower($code_type) == "codabar" ) { - $code_array1 = array("1","2","3","4","5","6","7","8","9","0","-","$",":","/",".","+","A","B","C","D"); - $code_array2 = array("1111221","1112112","2211111","1121121","2111121","1211112","1211211","1221111","2112111","1111122","1112211","1122111","2111212","2121112","2121211","1121212","1122121","1212112","1112122","1112221"); - - // Convert to uppercase - $upper_text = strtoupper($text); - - for ( $X = 1; $X<=strlen($upper_text); $X++ ) { - for ( $Y = 0; $Y \ No newline at end of file + + */ + + // Get pararameters that are passed in through $_GET or set to the default value + $text = (isset($_GET["text"])?$_GET["text"]:"0"); + $size = (isset($_GET["size"])?$_GET["size"]:"20"); + $orientation = (isset($_GET["orientation"])?$_GET["orientation"]:"horizontal"); + $code_type = (isset($_GET["codetype"])?$_GET["codetype"]:"code128"); + $code_string = ""; + + // Translate the $text into barcode the correct $code_type +if (in_array(strtolower($code_type), array("code128", "code128b"))) { + $chksum = 104; + // Must not change order of array elements as the checksum depends on the array's key to validate final code + $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","\`"=>"111422","a"=>"121124","b"=>"121421","c"=>"141122","d"=>"141221","e"=>"112214","f"=>"112412","g"=>"122114","h"=>"122411","i"=>"142112","j"=>"142211","k"=>"241211","l"=>"221114","m"=>"413111","n"=>"241112","o"=>"134111","p"=>"111242","q"=>"121142","r"=>"121241","s"=>"114212","t"=>"124112","u"=>"124211","v"=>"411212","w"=>"421112","x"=>"421211","y"=>"212141","z"=>"214121","{"=>"412121","|"=>"111143","}"=>"111341","~"=>"131141","DEL"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","FNC 4"=>"114131","CODE A"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); + $code_keys = array_keys($code_array); + $code_values = array_flip($code_keys); + for ($X = 1; $X <= strlen($text); $X++) { + $activeKey = substr($text, ($X-1), 1); + $code_string .= $code_array[$activeKey]; + $chksum=($chksum + ($code_values[$activeKey] * $X)); + } + $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; + + $code_string = "211214" . $code_string . "2331112"; +} elseif (strtolower($code_type) == "code128a") { + $chksum = 103; + $text = strtoupper($text); // Code 128A doesn't support lower case + // Must not change order of array elements as the checksum depends on the array's key to validate final code + $code_array = array(" "=>"212222","!"=>"222122","\""=>"222221","#"=>"121223","$"=>"121322","%"=>"131222","&"=>"122213","'"=>"122312","("=>"132212",")"=>"221213","*"=>"221312","+"=>"231212",","=>"112232","-"=>"122132","."=>"122231","/"=>"113222","0"=>"123122","1"=>"123221","2"=>"223211","3"=>"221132","4"=>"221231","5"=>"213212","6"=>"223112","7"=>"312131","8"=>"311222","9"=>"321122",":"=>"321221",";"=>"312212","<"=>"322112","="=>"322211",">"=>"212123","?"=>"212321","@"=>"232121","A"=>"111323","B"=>"131123","C"=>"131321","D"=>"112313","E"=>"132113","F"=>"132311","G"=>"211313","H"=>"231113","I"=>"231311","J"=>"112133","K"=>"112331","L"=>"132131","M"=>"113123","N"=>"113321","O"=>"133121","P"=>"313121","Q"=>"211331","R"=>"231131","S"=>"213113","T"=>"213311","U"=>"213131","V"=>"311123","W"=>"311321","X"=>"331121","Y"=>"312113","Z"=>"312311","["=>"332111","\\"=>"314111","]"=>"221411","^"=>"431111","_"=>"111224","NUL"=>"111422","SOH"=>"121124","STX"=>"121421","ETX"=>"141122","EOT"=>"141221","ENQ"=>"112214","ACK"=>"112412","BEL"=>"122114","BS"=>"122411","HT"=>"142112","LF"=>"142211","VT"=>"241211","FF"=>"221114","CR"=>"413111","SO"=>"241112","SI"=>"134111","DLE"=>"111242","DC1"=>"121142","DC2"=>"121241","DC3"=>"114212","DC4"=>"124112","NAK"=>"124211","SYN"=>"411212","ETB"=>"421112","CAN"=>"421211","EM"=>"212141","SUB"=>"214121","ESC"=>"412121","FS"=>"111143","GS"=>"111341","RS"=>"131141","US"=>"114113","FNC 3"=>"114311","FNC 2"=>"411113","SHIFT"=>"411311","CODE C"=>"113141","CODE B"=>"114131","FNC 4"=>"311141","FNC 1"=>"411131","Start A"=>"211412","Start B"=>"211214","Start C"=>"211232","Stop"=>"2331112"); + $code_keys = array_keys($code_array); + $code_values = array_flip($code_keys); + for ($X = 1; $X <= strlen($text); $X++) { + $activeKey = substr($text, ($X-1), 1); + $code_string .= $code_array[$activeKey]; + $chksum=($chksum + ($code_values[$activeKey] * $X)); + } + $code_string .= $code_array[$code_keys[($chksum - (intval($chksum / 103) * 103))]]; + + $code_string = "211412" . $code_string . "2331112"; +} elseif (strtolower($code_type) == "code39") { + $code_array = array("0"=>"111221211","1"=>"211211112","2"=>"112211112","3"=>"212211111","4"=>"111221112","5"=>"211221111","6"=>"112221111","7"=>"111211212","8"=>"211211211","9"=>"112211211","A"=>"211112112","B"=>"112112112","C"=>"212112111","D"=>"111122112","E"=>"211122111","F"=>"112122111","G"=>"111112212","H"=>"211112211","I"=>"112112211","J"=>"111122211","K"=>"211111122","L"=>"112111122","M"=>"212111121","N"=>"111121122","O"=>"211121121","P"=>"112121121","Q"=>"111111222","R"=>"211111221","S"=>"112111221","T"=>"111121221","U"=>"221111112","V"=>"122111112","W"=>"222111111","X"=>"121121112","Y"=>"221121111","Z"=>"122121111","-"=>"121111212","."=>"221111211"," "=>"122111211","$"=>"121212111","/"=>"121211121","+"=>"121112121","%"=>"111212121","*"=>"121121211"); + + // Convert to uppercase + $upper_text = strtoupper($text); + + for ($X = 1; $X<=strlen($upper_text); $X++) { + $code_string .= $code_array[substr($upper_text, ($X-1), 1)] . "1"; + } + + $code_string = "1211212111" . $code_string . "121121211"; +} elseif (strtolower($code_type) == "code25") { + $code_array1 = array("1","2","3","4","5","6","7","8","9","0"); + $code_array2 = array("3-1-1-1-3","1-3-1-1-3","3-3-1-1-1","1-1-3-1-3","3-1-3-1-1","1-3-3-1-1","1-1-1-3-3","3-1-1-3-1","1-3-1-3-1","1-1-3-3-1"); + + for ($X = 1; $X <= strlen($text); $X++) { + for ($Y = 0; $Y < count($code_array1); $Y++) { + if (substr($text, ($X-1), 1) == $code_array1[$Y]) { + $temp[$X] = $code_array2[$Y]; + } + } + } + + for ($X=1; $X<=strlen($text); $X+=2) { + if (isset($temp[$X]) && isset($temp[($X + 1)])) { + $temp1 = explode("-", $temp[$X]); + $temp2 = explode("-", $temp[($X + 1)]); + for ($Y = 0; $Y < count($temp1); $Y++) { + $code_string .= $temp1[$Y] . $temp2[$Y]; + } + } + } + + $code_string = "1111" . $code_string . "311"; +} elseif (strtolower($code_type) == "codabar") { + $code_array1 = array("1","2","3","4","5","6","7","8","9","0","-","$",":","/",".","+","A","B","C","D"); + $code_array2 = array("1111221","1112112","2211111","1121121","2111121","1211112","1211211","1221111","2112111","1111122","1112211","1122111","2111212","2121112","2121211","1121212","1122121","1212112","1112122","1112221"); + + // Convert to uppercase + $upper_text = strtoupper($text); + + for ($X = 1; $X<=strlen($upper_text); $X++) { + for ($Y = 0; $Y".xlt('No Order found, please enter procedure order first').""; - exit; + print "
".xlt('No Order found, please enter procedure order first')."
"; + exit; } - $patient_id = $pid; - $pdata = getPatientData($pid); - $facility = getFacility(); - $ins = getAllinsurances($pid); + $patient_id = $pid; + $pdata = getPatientData($pid); + $facility = getFacility(); + $ins = getAllinsurances($pid); if (empty($ins)) { - $responsibleParty = getSelfPay($pid); -} - $order = getProceduresInfo($oid, $encounter); + $responsibleParty = getSelfPay($pid); +} + $order = getProceduresInfo($oid, $encounter); -if(empty($order)) { - echo xlt('procedure order not found in database contact tech support'); - exit; -} +if (empty($order)) { + echo xlt('procedure order not found in database contact tech support'); + exit; +} - $prov_id = $order[5]; + $prov_id = $order[5]; $lab = $order[7]; - $provider = getLabProviders($prov_id); - $npi = getNPI($prov_id); - $pp = getProcedureProvider($lab); - $provLabId = getLabconfig(); + $provider = getLabProviders($prov_id); + $npi = getNPI($prov_id); + $pp = getProcedureProvider($lab); + $provLabId = getLabconfig(); - ?> + ?> @@ -70,74 +70,74 @@ if(empty($order)) { @@ -153,34 +153,34 @@ table, th, td { * But save it the first time through. */ $lab_id = $order[0]; - $storeBar = getBarId($lab_id,$pid); + $storeBar = getBarId($lab_id, $pid); if (!empty($storeBar)) { $bar = $storeBar['req_id']; } else { - $bar = rand(1000,999999); - saveBarCode($bar,$pid,$order[0]); + $bar = rand(1000, 999999); + saveBarCode($bar, $pid, $order[0]); } ?> barcode
-       +      

:       :

- ". text($facility['street']) . "
" . + ". text($facility['street']) . "
" . text($facility['city']).",".text($facility['state']).",".text($facility['postal_code']) . "
" . text($facility['phone']); ?>

- ". - text($pp['street'])." | ".text($pp['city']).", ".text($pp['state'])." ".text($pp['zip'])."
". - "O:".text($pp['phone'])." | F:".text($pp['fax'])."
"; - ?>

+ ". + text($pp['street'])." | ".text($pp['city']).", ".text($pp['state'])." ".text($pp['zip'])."
". + "O:".text($pp['phone'])." | F:".text($pp['fax'])."
"; + ?>

@@ -189,13 +189,13 @@ table, th, td {
- :
- :
- :
- :
+ :
+ :
+ :
+ :
-
+
@@ -209,7 +209,7 @@ table, th, td {


-
+

@@ -219,31 +219,33 @@ table, th, td { :
- :
- :
- :
+ :
+ :
+ :

-
-
+
+
:
- :
- :
- :
- :
+ :
+ :
+ :
+ :

-
-
-
+
+
+ ?>
@@ -254,28 +256,31 @@ table, th, td { :
- :
- :
- :
- :
- :
- #:
- #:
- :
- :
- :
+ :
+ :
+ :
+ :
+ :
+ #:
+ #:
+ :
+ :
+ :
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -283,28 +288,32 @@ table, th, td { :
- :
- :
- :
- :
- :
- #:
- #:
- :
- :
- :
+ :
+ :
+ :
+ :
+ :
+ #:
+ #:
+ :
+ :
+ :
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
@@ -314,21 +323,21 @@ table, th, td {
:
-
-
-
+
+
+
:
- +
:
-
-
-
+
+
+
diff --git a/interface/forms/requisition/view.php b/interface/forms/requisition/view.php index 6af92a3f7..509e4e3dc 100644 --- a/interface/forms/requisition/view.php +++ b/interface/forms/requisition/view.php @@ -11,4 +11,3 @@ */ require("new.php"); -?> diff --git a/library/lab.inc b/library/lab.inc index f9d6c277d..a6404454a 100644 --- a/library/lab.inc +++ b/library/lab.inc @@ -19,10 +19,9 @@ function fetchProcedureId($pid, $encounter) { $sql = "SELECT procedure_order_id FROM procedure_order WHERE patient_id = ? AND encounter_id = ?"; - $res = sqlQuery($sql,array($pid,$encounter)); + $res = sqlQuery($sql, array($pid,$encounter)); return $res['procedure_order_id']; - } /** @@ -43,9 +42,9 @@ function getProceduresInfo($oid, $encounter) AND po.encounter_id = ? AND po.procedure_order_id = ?"; - $listOrders = sqlStatement($sql,array($oid,$encounter,$oid)); + $listOrders = sqlStatement($sql, array($oid,$encounter,$oid)); $orders = array(); - while($rows = sqlFetchArray($listOrders)){ + while ($rows = sqlFetchArray($listOrders)) { $orders[] = $rows['procedure_order_id']; $orders[] = $rows['procedure_order_seq']; $orders[] = $rows['procedure_code']; @@ -63,7 +62,6 @@ function getProceduresInfo($oid, $encounter) } return $orders; - } /** @@ -74,10 +72,9 @@ function getProceduresInfo($oid, $encounter) function getSelfPay($pid) { $sql = "SELECT subscriber_relationship FROM insurance_data WHERE pid = ?"; - $res = sqlQuery($sql,array($pid)); + $res = sqlQuery($sql, array($pid)); return $res['subscriber_relationship']; - } /** @@ -87,7 +84,7 @@ function getSelfPay($pid) function getNPI($prov_id) { $sql = "SELECT npi, upin FROM users WHERE id = ?"; - $res = sqlQuery($sql,array($prov_id)); + $res = sqlQuery($sql, array($prov_id)); return array($res['npi'], $res['upin']); } @@ -99,11 +96,10 @@ function getProcedureProvider($prov_id) $sql = "SELECT i.organization, i.street, i.city, i.state, i.zip, i.fax, i.phone, pi.lab_director ". "FROM users AS i, procedure_providers AS pi WHERE pi.ppid = ? AND pi.lab_director = i.id "; - $res = sqlStatement($sql,array($prov_id)); + $res = sqlStatement($sql, array($prov_id)); $labs = sqlFetchArray($res); return $labs; - } /** @@ -114,7 +110,7 @@ function getLabProviders($prov_id) { $sql = "select fname, lname from users where authorized = 1 and active = 1 and username != '' and id = ?"; - $rez = sqlQuery($sql,array($prov_id)); + $rez = sqlQuery($sql, array($prov_id)); return $rez; @@ -128,21 +124,19 @@ function getLabconfig() $sql = "SELECT recv_app_id, recv_fac_id FROM procedure_providers "; $res = sqlQuery($sql); return $res; - } -function saveBarCode($bar,$pid,$order) +function saveBarCode($bar, $pid, $order) { $sql = "INSERT INTO `requisition` (`id`, `req_id`, `pid`, `lab_id`) VALUES (NULL, ?, ?, ?)"; $inarr = array($bar,$pid,$order); - sqlStatement($sql,$inarr); - + sqlStatement($sql, $inarr); } -function getBarId($lab_id,$pid) +function getBarId($lab_id, $pid) { $sql = "SELECT req_id FROM requisition WHERE lab_id = ? AND pid = ?"; - $bar = sqlQuery($sql,array($lab_id,$pid)); + $bar = sqlQuery($sql, array($lab_id,$pid)); return $bar; -} \ No newline at end of file +} diff --git a/library/patient.inc b/library/patient.inc index 0127b645d..b7bcc301d 100644 --- a/library/patient.inc +++ b/library/patient.inc @@ -1876,14 +1876,15 @@ function getEffectiveInsurances($patient_id, $encdate) } /** - * Get all requisition insurance companies + * Get all requisition insurance companies * * */ -function getAllinsurances($pid){ - $insarr = array(); - $sql = "SELECT a.type, a.provider, a.plan_name, a.policy_number, a.group_number, +function getAllinsurances($pid) +{ + $insarr = array(); + $sql = "SELECT a.type, a.provider, a.plan_name, a.policy_number, a.group_number, a.subscriber_lname, a.subscriber_fname, a.subscriber_relationship, a.subscriber_employer, b.name, c.line1, c.line2, c.city, c.state, c.zip FROM `insurance_data` AS a @@ -1892,12 +1893,12 @@ function getAllinsurances($pid){ RIGHT JOIN addresses AS c ON a.provider = c.foreign_id WHERE a.pid = ? "; - $inco = sqlStatement($sql,array($pid)); + $inco = sqlStatement($sql, array($pid)); - while($icl = sqlFetchArray($inco)){ - $insarr[] = $icl; - } - return $insarr; + while ($icl = sqlFetchArray($inco)) { + $insarr[] = $icl; + } + return $insarr; } /** -- 2.11.4.GIT