Fee sheet enhancements
[openemr.git] / interface / forms / fee_sheet / review / code_check.php
blob5238a8828dd09d818bbaa4d59d7448aaf9be13ef
1 <?php
2 /**
3 * library to simplify processing code_types
4 *
5 * Copyright (C) 2013 Kevin Yeh <kevin.y@integralemr.com> and OEMR <www.oemr.org>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 3
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Kevin Yeh <kevin.y@integralemr.com>
20 * @link http://www.open-emr.org
24 function diag_code_types($format='json',$sqlEscape=false)
26 global $code_types;
27 $diagCodes=array();
28 foreach($code_types as $key=>$ct)
30 if($ct['active'] && $ct['diag'] )
32 if($format=='json')
34 $entry=array("key"=>$key,"id"=>$ct['id']);
36 else if($format=='keylist')
38 $entry="'";
39 $entry.= $sqlEscape ? add_escape_custom($key) : $key;
40 $entry.="'";
42 array_push($diagCodes,$entry);
45 if($format=='json')
47 return json_encode($diagCodes);
49 if($format=='keylist')
51 return implode(",",$diagCodes);