[php]
// BEGIN DILI in NASH Trials CALCULATOR
// Pull in variables
$baselineALT = $_POST[‘baselineALT’];
$currentALT = $_POST[‘currentALT’];
$ULNALT = $_POST[‘ULNALT’];
$currentTBILI = $_POST[‘currentTBILI’];
$ULNTBILI = $_POST[‘ULNTBILI’];
$baselineDBILI = $_POST[‘baselineDBILI’];
$currentDBILI = $_POST[‘currentDBILI’];
$inr = $_POST[‘inr’];
$liversymptoms = $_POST[‘liversymptoms’];
$gilberts = $_POST[‘gilberts’];
// Calculation Elevated baseline
if ($baselineALT >= (1.5 * $ULNALT)) {
$elevated = 1;
$haselevated = “Elevated baseline ALT”;
}
if ($baselineALT < (1.5 * $ULNALT)) {
$elevated = 0;
$haselevated = "Normal baseline ALT";
}
// Calculation X above ULN ALT
$numaboveULN = round(($currentALT / $ULNALT), 2);
// Calculation X above Baseline ALT
$numaboveBASELINE = round(($currentALT / $baselineALT), 2);
// Has Liver Symptoms?
$hasliversymptoms = "No liver symptoms";
if ($liversymptoms == 1) {
$hasliversymptoms = "Has liver symptoms";
}
// Has Liver Symptoms?
$hasgilberts = "No Gilbert's";
if ($gilberts == 1) {
$hasgilberts = "Has Gilbert's";
}
// Bilirubin X
$changeDBILI = $currentDBILI / $baselineDBILI;
// Baseline recommendation
$interpretation = "No specific recommendation";
// Table Variables #1
if ($numaboveULN >= 5 AND ($ULNTBILI >= $currentTBILI OR $gilberts == 1) AND $liversymptoms == 0) {
$interpretation = “Repeat ALT, AST, ALP, TBL, in 2‐5 d. Follow‐up for symptoms. Initiate evaluation for other etiologies of abnormal liver tests.”;
}
if (($numaboveBASELINE >= 3 OR $currentALT >=300) AND $elevated == 1 AND ($ULNTBILI >= $currentTBILI OR $gilbrerts == 1) AND $liversymptoms == 0) {
$interpretation = “Repeat ALT, AST, ALP, TBL, in 2‐5 d. Follow‐up for symptoms. Initiate evaluation for other etiologies of abnormal liver tests.”;
}
// Table Variables #2
if ($numaboveULN >= 3 AND ($ULNTBILI >= $currentTBILI OR $gilberts == 1) AND $liversymptoms == 1) {
$interpretation = “Repeat ALT, AST, ALP, TBL, in 2‐5 d. Follow‐up for symptoms. Initiate evaluation for other etiologies of abnormal liver tests.”;
}
if (($numaboveBASELINE >= 2 OR $currentALT >=300) AND $elevated == 1 AND ($ULNTBILI >= $currentTBILI OR $gilberts == 1) AND $liversymptoms == 0) {
$interpretation = “Repeat ALT, AST, ALP, TBL, in 2‐5 d. Follow‐up for symptoms. Initiate evaluation for other etiologies of abnormal liver tests.”;
}
// Table Variables #3
if ($numaboveULN >= 8) {
$interpretation = “Interrupt study drug. Initiate close monitoring and workup for competing etiologies. Study drug can be restarted only if another etiology is identified and liver enzymes return to baseline.”;
}
if (($numaboveBASELINE >= 5 OR $currentALT >=500) AND $elevated == 1) {
$interpretation = “Interrupt study drug. Initiate close monitoring and workup for competing etiologies. Study drug can be restarted only if another etiology is identified and liver enzymes return to baseline.”;
}
// Table Variables #4
if ($numaboveULN >= 3 AND ($currentTBILI >= (2 * $ULNTBILI) OR ($gilberts == 1 AND ($changeDBILI >=2 OR $inr > 1.5))) AND $liversymptoms == 0) {
$interpretation = “Interrupt study drug. Initiate close monitoring and workup for competing etiologies. Study drug can be restarted only if another etiology is identified and liver enzymes return to baseline.”;
}
if (($numaboveBASELINE >= 2 OR $currentALT >=300) AND (($currentTBILI >= (2 * $ULNTBILI)) OR ($gilberts == 1 AND ($changeDBILI >=2 OR $inr > 1.5)) AND $liversymptoms == 0)) {
$interpretation = “Interrupt study drug. Initiate close monitoring and workup for competing etiologies. Study drug can be restarted only if another etiology is identified and liver enzymes return to baseline.”;
}
// Table Variables #5
if ($liversymptoms == 1 AND $numaboveULN >=5) {
$interpretation = “Interrupt study drug. Initiate close monitoring and workup for competing etiologies. Study drug can be restarted only if another etiology is identified and liver enzymes return to baseline.”;
}
if ($liversymptoms == 1 AND $elevated == 1 AND ($numaboveULN >= 3 OR $currentALT >=300)) {
$interpretation = “Interrupt study drug. Initiate close monitoring and workup for competing etiologies. Study drug can be restarted only if another etiology is identified and liver enzymes return to baseline.”;
}
// Write out result if valid
if ($_POST) {
echo “Interpreation : ” .$interpretation . “
“;
echo “Ratio above ULN ALT : ” . $numaboveULN . “
“;
}
[/php]