/*!
 *
 * Copyright (c) 2020-2024 Diality Inc. - All Rights Reserved.
 * \copyright
 * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN
 * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER.
 *
 * \file    TreatmentVitals.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      16-Aug-2021
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  27-Jan-2020
 *
 */

// Qt
import QtQuick 2.12

// Project

//  Qml imports
import "qrc:/globals"
import "qrc:/components"
import "qrc:/pages/treatment"

/*!
 * \brief   Treatment Screen Vitals section
 */
TreatmentSection { id: _root
    readonly property string bloodSDSeparator: "/"

    header.title                    : qsTr("Vitals" )
    contentArea.anchors.topMargin   : 0

    contentItem: Column { id: _content
        spacing         : Variables.defaultMargin * 4.5

        LabelValue { id: _bloodPressure
            height      : 40
            width       : contentItem.width
            topTextFont.pixelSize   : Fonts.fontPixelVitals
            topTextFont.weight      : Font.Medium
            topText     : Variables.notSetVariable(vTreatmentVitals.systolic, 2) + bloodSDSeparator + Variables.notSetVariable(vTreatmentVitals.diastolic, 2)
            bottomText  : Variables.unitTextBloodPressure
            bottomTextFont.pixelSize: 20
            bottomTextFont.weight   : Font.Light
            bottomTextTopMargin     : 10
        }

        LabelValue { id: _heartBeat
            height      : 45
            width       : contentItem.width
            topTextFont.pixelSize   : Fonts.fontPixelVitals
            topTextFont.weight      : Font.Medium
            topText     : Variables.notSetVariable(vTreatmentVitals.heartRate, 2)
            bottomText  : Variables.unitTextHeartBeat
            bottomTextFont.pixelSize: 20
            bottomTextFont.weight   : Font.Light
            bottomTextTopMargin     : 10
        }

        Text { id: _lastRecorded
            height              : 30
            width               : contentItem.width
            font.pixelSize      : 16
            font.weight         : Font.Normal
            verticalAlignment   : Text.AlignBottom
            color               : Colors.textMain
            text                : qsTr("Last Read: %1").arg(vTreatmentVitals.lastRead)
        }
    }
}
