You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.1 KiB
38 lines
1.1 KiB
<?php |
|
|
|
/** |
|
* library to simplify processing code_types |
|
* |
|
* @package OpenEMR |
|
* @link http://www.open-emr.org |
|
* @author Kevin Yeh <kevin.y@integralemr.com> |
|
* @copyright Copyright (c) 2013 Kevin Yeh <kevin.y@integralemr.com> and OEMR <www.oemr.org> |
|
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 |
|
*/ |
|
|
|
function diag_code_types($format = 'json', $sqlEscape = false) |
|
{ |
|
global $code_types; |
|
$diagCodes = array(); |
|
foreach ($code_types as $key => $ct) { |
|
if ($ct['active'] && $ct['diag']) { |
|
if ($format == 'json') { |
|
$entry = array("key" => $key,"id" => $ct['id']); |
|
} elseif ($format == 'keylist') { |
|
$entry = "'"; |
|
$entry .= $sqlEscape ? add_escape_custom($key) : $key; |
|
$entry .= "'"; |
|
} |
|
|
|
array_push($diagCodes, $entry); |
|
} |
|
} |
|
|
|
if ($format == 'json') { |
|
return json_encode($diagCodes); |
|
} |
|
|
|
if ($format == 'keylist') { |
|
return implode(",", $diagCodes); |
|
} |
|
}
|
|
|