<?php

use App\Models\Point;

$category = 'STOPBANG_QUESTIONNAIRE';
$endPoint = 'upsertNoteSingleton';

$point = Point::getOrCreateOnlyTopLevelPointOfCategory($note, 'STOPBANG_QUESTIONNAIRE', $sessionKey, true);
$contentData = [
    "snore_loudly" => null,
    "often_feel_tired_sleepy" => null,
    "observed_stop_breathing_during_sleep" => null,
    "treated_for_hbp" => null,

    "weight_in_pounds" => null,
    "height_in_inches" => null,
    "calculated__bmi" => null,
    "calculated__bmi_gt_35" => null,

    "age_gt_50" => null,
    "neck_size_gt_40cm" => null,
    "gender_is_male" => null,
];
if (!!@$point->data) {
    $contentData = $point->data;
}
?>

<table class="table table-sm table-bordered mb-2">
    <tbody>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Do you snore loudly?</div>
            <div class="text-sm text-secondary">Louder than talking or loud enough to be heard through closed doors</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['snore_loudly'] ?: '-'}}
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Do you often feel tired, fatigued, or sleepy during the daytime?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['often_feel_tired_sleepy'] ?: '-'}}
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Has anyone observed you stop breathing during sleep?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['observed_stop_breathing_during_sleep'] ?: '-'}}
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Do you have (or are you being treated for) high blood pressure?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['treated_for_hbp'] ?: '-'}}
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Is your BMI &gt;= 35?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['calculated__bmi_gt_35'] ?: '-'}}
            <span class="font-weight-normal text-secondary">(BMI: {{@$contentData['calculated__bmi'] ?: '-'}})</span>
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Is your age &gt;= 50?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['age_gt_50'] ?: '-'}}
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Is your neck circumference &gt;= 40cm/16in?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['neck_size_gt_40cm'] ?: '-'}}
        </td>
    </tr>
    <tr>
        <td class="pl-1 align-middle bg-light width-250px">
            <div class="mb-1">Is your gender male?</div>
        </td>
        <td class="font-weight-bold">
            {{@$contentData['gender_is_male'] ?: '-'}}
        </td>
    </tr>
    </tbody>
</table>
