[insert_php]

// Variables
if ($_POST) {
$a = $_POST[‘age’];
$b = $_POST[‘ast’];
$c = $_POST[‘alt’];
$d = $_POST[‘plt’];
$e = $_POST[‘bmi’];
$f = $_POST[‘alb’];
$g = $_POST[‘dm’];
$h = $_POST[‘ulnast’];

//Fibrosis 4 Score
if ((!empty($a)) && (!empty($b)) && (!empty($c)) && (!empty($d))) {
$var1 = $a * $b;
$var2 = sqrt($c);
$var3 = $d * $var2;
$var4 = $var1 / $var3;
$fib4 = round($var4, 2);
$fib4state = “Unclear Fibrosis”;
if ($fib4 >= 2.67) {
$fib4state = “Advanced fibrosis (Metavir F3/4)“;
}
if ($fib4 <= 1.3) { $fib4state = "Excludes advanced fibrosis (Metavir F3/4)"; } } // NAFLD Score if ((!empty($a)) && (!empty($b)) && (!empty($c)) && (!empty($d)) && (!empty($e)) && (!empty($f))) { $var21 = (0-1.675); $var22 = .037*$a; $var23 = $var21+$var22; $var24 = .094*$e; $var25 = $var23+$var24; $var26 = $g*1.13; $var27 = $var25+$var26; $var28 = $b/$c; $var29 = $var28*.99; $var210 = $var27+$var29; $var211 = .013*$d; $var212 = $var210-$var211; $var213 = $f*.66; $var214 = $var212-$var213; $nafld = round($var214, 2); $nafldstate = "Unclear Fibrosis"; if ($nafld >= 0.675) {
$nafldstate = “Advanced fibrosis (Metavir F3/4)“;
}
if ($nafld <= -1.455) { $nafldstate = "Excludes advanced fibrosis (Metavir F3/4)"; } } // APRI Index if ((!empty($b)) && (!empty($h)) && (!empty($d))) { $var31 = $b / $h; $var31 = $var31 * 100; $var31 = $var31 / $d; $apri = round($var31, 2); $apristate = "Unclear Fibrosis"; if ($apri >= 1.5) {
$apristate = “Advanced fibrosis (Metavir F3/4)“;
}
if ($apri <= 0.5) { $apristate = "Excludes advanced fibrosis (Metavir F3/4)"; } } // Fibrosis Index if ((!empty($f)) && (!empty($d))) { $var41 = $d * 0.01; $var42 = 1.08 * $f; $var41 = 8.28-$var41; $var41 = $var41-$var42; $fibrosisi = round($var41, 2); $fibrosisistate = "Advanced fibrosis (Metavir F3/4))”;
if ($fibrosisi >= 3.3) {
$fibrosisistate = “Cirrhosis“;
}
if ($fibrosisi <= 2.1) { $fibrosisistate = "Excludes advanced fibrosis (Metavir F3/4)"; } } // Pohl Index if ((!empty($b)) && (!empty($c)) && (!empty($d))) { $var51 = $b / $c; if ($d >= 150) {
$var52 = “1”;
}
if ($d < 150) { $var52 = "0"; } if ($var52 == 1) { $pohl = "Excludes advanced fibrosis (Metavir F3/4)"; } if (($var51 < 1) AND ($var52 == 0)) { $pohl = "Excludes advanced fibrosis (Metavir F3/4)"; } if (($var51 > 0.99) AND ($var52 == 0)) {
$pohl = “Advanced fibrosis (Metavir F3/4)“;
}
}

// Bard Index
if ((!empty($b)) && (!empty($c)) && (!empty($e))) {
$var61 = $b / $c;
if ($var61 < 0.8) { $aar6 = "0"; } if ($var61 >= 0.8) {
$aar6 = “1”;
}
if ($e >= 28) {
$bmi6 = “1”;
}
if ($e < 28) { $bmi6 = "0"; } $bard = $aar + $bmi + $g; if (($bard >= 2)) {
$bard = “Advanced fibrosis (Metavir F3/4)“;
}
if ($bard < 2) { $bard = "Excludes advanced fibrosis (Metavir F3/4)"; } } if ((!empty($a)) && (!empty($b)) && (!empty($c)) && (!empty($d))) { echo "Fibrosis 4 Score : “;
echo $fib4state;
echo “

“;
}
if ((!empty($a)) && (!empty($b)) && (!empty($c)) && (!empty($d)) && (!empty($e)) && (!empty($f))) {
echo “NAFLD Fibrosis Score : “;
echo $nafldstate;
echo “

“;
}
if ((!empty($b)) && (!empty($h)) && (!empty($d))) {
echo “APRI Index : “;
echo $apristate;
echo “

“;
}
if ((!empty($f)) && (!empty($d))) {
echo “Fibrosis Index : “;
echo $fibrosisistate;
echo “

“;
}
if ((!empty($b)) && (!empty($c)) && (!empty($d))) {
echo “Pohl Score : “;
echo $pohl;
echo “

“;
}
if ((!empty($b)) && (!empty($c)) && (!empty($e))) {
echo “BARD Score : “;
echo $bard;
}
}
[/insert_php]