Direct Messaging update: add CCR transmit, more meaningful attachment filenames
[openemr.git] / Tests / code_types / MainCodesTests.php
blob9bf9094b6603433f6f44fd66e1a14823bb77480f
1 <?php
2 $GLOBALS['OE_SITE_DIR']="/var/www/openemr/sites/default";
3 set_include_path(get_include_path() . PATH_SEPARATOR . "/var/www/openemr");
4 require_once("library/sql.inc");
5 require_once("library/htmlspecialchars.inc.php");
6 require_once("library/translation.inc.php");
7 require_once("custom/code_types.inc.php");
9 function main_search_test($type,$string,$limit=20,$modes=NULL,$count=false,$category=NULL)
11 echo "<ol>";
12 $res=main_code_set_search($type,$string,$limit,$category,true,$modes,$count);
13 if ($count) {
14 echo "<li>" . $res . "</li>";
16 else {
17 while ($code = sqlFetchArray($res))
19 echo "<li>". $code['code_type_name'].":".$code['code'].":".$code['code_text'].":".$code['code_text_short']."</li>";
22 echo "</ol>";
25 function return_code_info_test($type,$string,$limit=20,$modes=NULL,$count=false)
27 echo "<ol>";
28 $res=return_code_information($type,$string);
29 while ($code = sqlFetchArray($res))
31 echo "<li>". $code['code_type_name'].":".$code['code'].":".$code['code_text'].":".$code['code_text_short']."</li>";
33 echo "</ol>";
36 main_search_test("ICD9","hyperchol");
37 main_search_test("ICD9","401");
38 main_search_test(array("ICD9"),"401");
40 main_search_test("ICD10","hypert");
41 main_search_test("ICD10","I1");
42 main_search_test(array("ICD10"),"I1");
44 main_search_test("CPT4","99");
46 main_search_test("SNOMED","hypert");
47 main_search_test("SNOMED","1201005");
49 main_search_test("SNOMED-CT","hypert");
50 main_search_test("SNOMED-CT","1201005");
52 main_search_test("SNOMED-PR","Incision Drai");
54 main_search_test(array("ICD9","CVX","ICD10"),"100");
55 main_search_test(array("ICD9","CVX"),"100");
56 main_search_test(array("CVX","ICD10"),"100");
58 main_search_test(array("ICD9","ICD10","SNOMED"),"colon benign");
59 main_search_test(array("ICD9","SNOMED"),"colon benign");
61 main_search_test("","polio",40,NULL,false,"active");
62 main_search_test("","polio",40,NULL,false,"diagnosis");
63 main_search_test("","polio",40,NULL,false,"procedure");
64 main_search_test("","polio",40,NULL,false,"clinical_term");
66 main_search_test("ICD9","401",NULL,array('code','description'),true);
67 main_search_test("ICD9","401",NULL,array('description','code'),true);
68 main_search_test("ICD9","401",NULL,array('code'),true);
69 main_search_test("ICD9","401",NULL,array('description'),true);
70 main_search_test("ICD9","chol",NULL,array('code','description'),true);
71 main_search_test("ICD9","chol",NULL,array('description','code'),true);
72 main_search_test("ICD9","chol",NULL,array('code'),true);
73 main_search_test("ICD9","chol",NULL,array('description'),true);
75 return_code_info_test("ICD9","045.10");
76 return_code_info_test("CVX","2");
77 return_code_info_test("ICD10","A80.2");
78 return_code_info_test("SNOMED","172672006");
79 return_code_info_test("SNOMED-CT","14535005");
80 return_code_info_test("SNOMED-PR","170420002");