function checkbox_ptgroup() { if (func_num_args()) { $arg_list = func_get_args(); $age = $arg_list[0]; $gender = $arg_list[1]; } $sql = "select ptgroup_id, ptgroup_name, ptgroup_condition ". "from m_lib_ptgroup order by ptgroup_name"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { while(list($id, $name, $cond) = mysql_fetch_array($result)) { if (strlen($cond)>0) { if (eregi('is_childbearing_age',$cond)) { if (ptgroup::is_childbearing_age($age, $gender)) { print "<input type='checkbox' name='ptgroup[]' value='$id'> $name<br/>"; } } elseif (eregi('is_child', $cond)) { if (ptgroup::is_child($age)) { print "<input type='checkbox' name='ptgroup[]' value='$id'> $name<br/>"; } } } else { print "<input type='checkbox' name='ptgroup[]' value='$id'> $name<br/>"; } } } } }
function _details_imci() { if (func_num_args() > 0) { $arg_list = func_get_args(); $menu_id = $arg_list[0]; $post_vars = $arg_list[1]; $get_vars = $arg_list[2]; $validuser = $arg_list[3]; $isadmin = $arg_list[4]; //print_r($arg_list); } // check if age correct $patient_id = healthcenter::get_patient_id($get_vars["consult_id"]); if (!ptgroup::is_child(patient::get_age($patient_id))) { return print "<font color='red'>Module inappropriate for age.</font><br/>"; } }
function checkbox_ptgroup() { if (func_num_args()) { $arg_list = func_get_args(); $age = $arg_list[0]; $gender = $arg_list[1]; } $sql = "select ptgroup_id, ptgroup_name, ptgroup_condition " . "from m_lib_ptgroup order by ptgroup_name"; if ($result = mysql_query($sql)) { if (mysql_num_rows($result)) { while (list($id, $name, $cond) = mysql_fetch_array($result)) { if (strlen($cond) > 0) { if (eregi('is_childbearing_age', $cond)) { if (ptgroup::is_childbearing_age($age, $gender)) { print "<input type='checkbox' name='ptgroup[]' value='{$id}'> {$name}<br/>"; } } elseif (eregi('is_child', $cond)) { if (ptgroup::is_child($age)) { print "<input type='checkbox' name='ptgroup[]' value='{$id}'> {$name}<br/>"; } } } else { if ($id == 'FP' && ($age >= 50 || $age <= 14)) { //do not display FP checkbox if patient is >=50 or <=14 } else { print "<input type='checkbox' name='ptgroup[]' value='{$id}'> {$name}<br/>"; } } } } } }