예제 #1
0
/**
 * Return listing of pertinent and active code types.
 *
 * Function will return listing (ct_key) of pertinent
 * active code types, such as diagnosis codes or procedure
 * codes in a chosen format. Supported returned formats include
 * as 1) an array and as 2) a comma-separated lists that has been
 * process by urlencode() in order to place into URL  address safely.
 *
 * @param  string       $category       category of code types('diagnosis', 'procedure', 'clinical_term', 'active' or 'medical_problem')
 * @param  string       $return_format  format or returned code types ('array' or 'csv')
 * @return string/array
 */
function collect_codetypes($category, $return_format = "array")
{
    global $code_types;
    $return = array();
    foreach ($code_types as $ct_key => $ct_arr) {
        if (!$ct_arr['active']) {
            continue;
        }
        if ($category == "diagnosis") {
            if ($ct_arr['diag']) {
                array_push($return, $ct_key);
            }
        } else {
            if ($category == "procedure") {
                if ($ct_arr['proc']) {
                    array_push($return, $ct_key);
                }
            } else {
                if ($category == "clinical_term") {
                    if ($ct_arr['term']) {
                        array_push($return, $ct_key);
                    }
                } else {
                    if ($category == "active") {
                        if ($ct_arr['active']) {
                            array_push($return, $ct_key);
                        }
                    } else {
                        if ($category == "medical_problem") {
                            if ($ct_arr['problem']) {
                                array_push($return, $ct_key);
                            }
                        } else {
                            //return nothing since no supported category was chosen
                        }
                    }
                }
            }
        }
    }
    if ($return_format == "csv") {
        //return it as a csv string
        return csv_like_join($return);
    } else {
        //$return_format == "array"
        //return the array
        return $return;
    }
}
예제 #2
0
    require_once "{$srcdir}/football_injury.inc.php";
}
if ($ISSUE_TYPES['ippf_gcac']) {
    // Similarly for IPPF issues.
    require_once "{$srcdir}/ippf_issues.inc.php";
}
$diagnosis_types = array();
foreach ($code_types as $code => $data) {
    if ($data['diag']) {
        array_push($diagnosis_types, $code);
    }
}
if (count($diagnosis_types) < 1) {
    $diagnosis_type = 'ICD9';
} else {
    $diagnosis_type = csv_like_join($diagnosis_types);
}
$issue = $_REQUEST['issue'];
$thispid = 0 + (empty($_REQUEST['thispid']) ? $pid : $_REQUEST['thispid']);
$info_msg = "";
// A nonempty thisenc means we are to link the issue to the encounter.
$thisenc = 0 + (empty($_REQUEST['thisenc']) ? 0 : $_REQUEST['thisenc']);
// A nonempty thistype is an issue type to be forced for a new issue.
$thistype = empty($_REQUEST['thistype']) ? '' : $_REQUEST['thistype'];
$thisauth = acl_check('patients', 'med');
if ($issue && $thisauth != 'write') {
    die("Edit is not authorized!");
}
if ($thisauth != 'write' && $thisauth != 'addonly') {
    die("Add is not authorized!");
}