Appcardio Development Docs

A technical overview of how Appcardio calculators are structured, processed, and rendered. This documentation explains the common architecture behind the tools and the principles used to keep them readable, consistent, and maintainable.

Appcardio tools are intentionally built around a simple technical flow: collect the input, normalize the data, execute the clinical model, and present the result. Keeping this structure predictable makes individual calculators easier to review, update, and maintain.

Sample Tool Code

A simplified example showing the typical structure of an Appcardio calculator.

sample-calculator.php
// ---- SAMPLE APPCARDIO TOOL ----

<form method="post" action="">

    <label for="age">Age (years)</label>

    <input
        type="text"
        name="age"
        id="age"
        value="<?php echo isset($_POST['age']) ? $_POST['age'] : ''; ?>"
        required
    >


    <label for="troponin">
        High-sensitivity Troponin T (ng/L)
    </label>

    <input
        type="text"
        name="troponin"
        id="troponin"
        value="<?php echo isset($_POST['troponin']) ? $_POST['troponin'] : ''; ?>"
        required
    >


    <label for="ntprobnp">
        NT-proBNP (pg/mL)
    </label>

    <input
        type="text"
        name="ntprobnp"
        id="ntprobnp"
        value="<?php echo isset($_POST['ntprobnp']) ? $_POST['ntprobnp'] : ''; ?>"
        required
    >


    <label for="stroke_history">
        History of Stroke or TIA
    </label>

    <select
        name="stroke_history"
        id="stroke_history"
    >
        <option value="0">No</option>
        <option value="1">Yes</option>
    </select>


    <button type="submit" name="calculate">
        Calculate
    </button>

</form>


<?php

if (isset($_POST['calculate'])) {

    $age = floatval($_POST['age']);
    $troponin = floatval($_POST['troponin']);
    $ntprobnp = floatval($_POST['ntprobnp']);
    $stroke_history = intval($_POST['stroke_history']);


    // Transform biomarkers

    $log_trop = log($troponin + 1);
    $log_ntp = log($ntprobnp + 1);


    // Calculate model score

    $score =
        (0.02 * $age)
        + (0.48 * $stroke_history)
        + (0.35 * $log_trop)
        + (0.33 * $log_ntp);


    // Convert score into predicted risk

    $predicted_risk =
        100 * (1 - pow(0.98, exp($score - 3.5)));


    // Risk classification

    if ($predicted_risk < 1.5) {

        $risk_cat = "Low Risk";

    } elseif ($predicted_risk < 3.0) {

        $risk_cat = "Intermediate Risk";

    } else {

        $risk_cat = "High Risk";
    }


    // Render result

    echo "<p>Predicted Risk: $predicted_risk%</p>";
    echo "<p>Category: $risk_cat</p>";
}

?>
The example above is intentionally simplified. Production calculators should additionally apply appropriate validation, sanitization, range checking, and clinical model verification.

Tool Architecture

The common processing pipeline used across Appcardio tools.

01

Input

Collect clinical variables through a structured and user-friendly form.

02

Validation

Normalize values and ensure the input is suitable for the calculation.

03

Calculation

Apply the published formula, score, model, or clinical algorithm.

04

Output

Present the result clearly with appropriate interpretation and supporting information.

Code Breakdown

The major components of a typical calculator.

The form uses the POST method to capture user input. Each clinical variable is represented by an appropriate input field.

  • Clear clinical label
  • Input or select element
  • Persistent values after submission
  • Required fields where appropriate
<input
    type="text"
    name="age"
    value="<?php echo isset($_POST['age']) ? $_POST['age'] : ''; ?>"
>

Submitted values are converted into appropriate numerical formats before being passed to the calculation.

$age = floatval($_POST['age']);

$troponin = floatval($_POST['troponin']);

$stroke_history =
    intval($_POST['stroke_history']);

This section contains the actual clinical equation or scoring algorithm. The implementation should correspond directly to the validated source model.

$log_trop =
    log($troponin + 1);

$score =
    (0.02 * $age)
    + (0.48 * $stroke_history)
    + (0.35 * $log_trop)
    + (0.33 * $log_ntp);

The calculated value is transformed into a clinically readable result. Risk categories and supporting information should be displayed clearly.

echo "<p>Predicted Risk: $predicted_risk%</p>";

echo "<p>Category: $risk_cat</p>";

Design Philosophy

Technical and clinical principles that guide the development of Appcardio tools.

PRINCIPLE 01

Simplicity First

Interfaces should remain simple, focused, and intuitive. Every element should have a clear purpose.

PRINCIPLE 02

Clinical Accuracy

Formulas, thresholds, classifications, and algorithms should be traceable to established scientific literature.

PRINCIPLE 03

Consistent Structure

Tools follow a predictable architecture: input, validation, calculation, and output.

PRINCIPLE 04

Accessible by Design

Cardiovascular decision tools should be straightforward to access and usable across different clinical environments.

PRINCIPLE 05

Minimal Dependencies

Lightweight PHP and restrained JavaScript help keep the platform maintainable and reduce unnecessary technical complexity.

PRINCIPLE 06

Readable Output

Results should be immediately understandable, with clinically important values receiving appropriate visual emphasis.

Contribute to Appcardio

Ideas, corrections, validated models, and technical improvements are welcome.

How you can contribute

Contributions may come from clinicians, researchers, developers, educators, or anyone working with cardiovascular clinical tools.

  • Suggest a cardiovascular calculator or clinical decision model
  • Report an issue or potential calculation error
  • Suggest improvements to an existing tool
  • Share a validated clinical formula or published model
  • Help improve documentation and educational resources

Submissions are reviewed for scientific accuracy, usability, technical consistency, and relevance to the Appcardio platform.

Submit an idea