/*!
 *
 * Copyright (c) 2021-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    PostTreatmentReview.qml
 * \author  (last)      Behrouz NematiPour
 * \date    (last)      31-Jul-2024
 * \author  (original)  Behrouz NematiPour
 * \date    (original)  21-Apr-2021
 *
 */

// Qt
import QtQuick 2.12

// Project
//  Qml imports
import "qrc:/globals"
import "qrc:/components"
import "qrc:/compounds"
import "qrc:/pages/posttreatment"

/*!
 * \brief   the post treatment Treatment Log review screen
 */
PostTreatmentBase { id: _root
    property int colSpacing: Variables.defaultMargin

    Flickable { id: _flickable
        anchors {
            top             : header.bottom
            topMargin       : Variables.defaultMargin * 2
            bottom          : _root.bottom
            bottomMargin    : Variables.notificationHeight + Variables.minVGap
            left            : parent.left
            leftMargin      : Variables.defaultMargin * 4
            right           : parent.right
            rightMargin     : Variables.defaultMargin * 4

        }

        contentWidth    : width
        contentHeight   : _row.height
        clip            : true

        Row { id: _row
            width   : _flickable.width
            spacing : Variables.defaultMargin

            Column {  id: _leftColumn
                width   : _flickable.width / 2
                spacing : _root.colSpacing

                ReviewContainer { id: _patientInfo
                    title   : qsTr("Patient Information")
                    width   : parent.width

                    label   : [ qsTr("Patient ID")          ,
                                qsTr("Secondary Patient ID")]

                    initial : [ vPostTreatmentAdjustmentTreatmentLog.patientID          ,
                                vPostTreatmentAdjustmentTreatmentLog.secondaryPatientID ]

                    actual  : [ "" , "" ]
                    units   : [ "" , "" ]
                }

                ReviewContainer { id: _bloodFlowDiaysate
                    title   : qsTr("Blood Flow Rate and Dialysate Settings")
                    width   : parent.width
                    label   : [ qsTr("Blood Flow Rate")         ,
                                qsTr("Dialysis Flow Rate")      ,
                                qsTr("Dialyzer Type")           ,
                                qsTr("Dialysate Temperature")   ,
                                qsTr("Dialysate Volume Used")   ]

                    initial : [ vPostTreatmentAdjustmentTreatmentLog.bloodFlowRate          ,
                                vPostTreatmentAdjustmentTreatmentLog.dialysateFlowRate      ,
                                vPostTreatmentAdjustmentTreatmentLog.dialyzerType           ,
                                vPostTreatmentAdjustmentTreatmentLog.dialysateTemp          ,
                                vPostTreatmentAdjustmentTreatmentLog.dialysateVolumeUsed    ]

                    actual  : [ vPostTreatmentAdjustmentTreatmentLog.bloodFlowRateActual        ,
                                vPostTreatmentAdjustmentTreatmentLog.dialysateFlowRateActual    ,
                                 ""                                                             , // leave empty
                                vPostTreatmentAdjustmentTreatmentLog.dialysateTemperatureActual ,
                                 ""                                                             ] // leave empty

                    precision   : [ 0,
                                    0,
                                    0,
                                    Variables.dialysateTempPrecision,
                                    Variables.ultrafiltrationPrecision  ]

                    units   : [ Variables.unitTextFlowRate      ,
                                Variables.unitTextFlowRate      ,
                                ""                              ,
                                Variables.unitTextTemperature   ,
                                Variables.unitVolume            ]
                }


            }

            Column { id: _rightColumn
                width   : _flickable.width / 2
                spacing : _root.colSpacing

            }
        }
    }

    ScrollBar { flickable: _flickable }

    reasonText      : vPostTreatmentAdjustmentTreatmentLog.text()
    informationText : vPostTreatmentAdjustmentTreatmentLog.notification
}
