<?xml version="1.0"?>

<!--
SPDX-FileCopyrightText: 2008-2026 Luis Falcón <falcon@gnuhealth.org>
SPDX-FileCopyrightText: 2011-2026 GNU Solidario <health@gnusolidario.org>

SPDX-License-Identifier: GPL-3.0-or-later
-->

<form>
    <group string="Patient" colspan="4" id="evaluation_header">
      <group colspan="1" id="group_patient">
        <field name="patient"/>
        <field name="gender"/>
        <field name="computed_age"/>
      </group>
      <group colspan="1" id="group_patient_insurance">
          <label name="insurance"/>
          <field name="insurance"/>
          <field name="code"/>
      </group>
      <newline/>
      <group colspan="4" col="10" id="group_visit_type">
        <label name="visit_type"/>
        <field name="visit_type"/>
        <field name="related_condition"/>
        <label name="evaluation_type"/>
        <field name="evaluation_type"/>
        <label name="urgency"/>
        <field name="urgency"/>
        <label name="healthprof"/>
        <field name="healthprof"/>
      </group>
    </group>
    <newline/>

    <notebook>
        <page string="Main Info" id="page_patient_evaluation_main">
            <group col="9" colspan="4" string="Chief Complaint" id="eval_chief_complaint">
                <field name="chief_complaint" colspan="5"/>
                <label name="information_source"/>
                <field name="information_source"/>
                <label name="reliable_info"/>
                <field name="reliable_info"/>
            </group>
            <newline/>
            <separator colspan="2" string="Present Illness" id="separator_present_illness"/>
            <separator colspan="2" string="Physical exam" id="separator_physical_exam"/>
            <newline/>
            <field colspan="2" name="present_illness"/>
            <field colspan="2" name="evaluation_summary"/>
            <newline/>
            <separator colspan="2" string="Diagnostic Judgement" id="separator_diagnostic_judgement"/>
            <separator colspan="2" string="Therapeutic and Dx Plan" id="separator_plan"/>
            <newline/>
            <field name="info_diagnosis" colspan="2"/>
            <field name="directions" colspan="2"/>
            <group string="Main Condition" colspan="4" id="group_dx">
                <field name="diagnosis" colspan="4"/>
            </group>

            <newline/>
        </page>
        <page string="Clinical" id="page_patient_evaluation_signs">
            <group colspan="4" col="6" string="Vital Signs" id="group_patient_evaluation_vital_signs">
                <label name="temperature"/>
                <field name="temperature"/>
                <label name="systolic"/>
                <field name="systolic"/>
                <label name="diastolic"/>
                <field name="diastolic"/>
                <label name="bpm"/>
                <field name="bpm"/>
                <label name="respiratory_rate"/>
                <field name="respiratory_rate"/>
                <label name="osat"/>
                <field name="osat"/>
            </group>
            <newline/>
            <group colspan="4" col="6" string="Anthropometry" id="group_patient_evaluation_anthropometry">
                <label name="weight"/>
                <field name="weight"/>
                <label name="height"/>
                <field name="height"/>
                <label name="bmi"/>
                <field name="bmi"/>
                <label name="abdominal_circ"/>
                <field name="abdominal_circ"/>
                <label name="hip"/>
                <field name="hip"/>
                <label name="whr"/>
                <field name="whr"/>
                <label name="head_circumference"/>
                <field name="head_circumference"/>
            </group>

            <group colspan="4" col="8" string="Body Composition" id="group_patient_evaluation_body_composition">
                <label name="body_water"/>
                <field name="body_water"/>
                <label name="body_fat"/>
                <field name="body_fat"/>
                <label name="body_muscle"/>
                <field name="body_muscle"/>
                <label name="body_bone"/>
                <field name="body_bone"/>
            </group>
            <newline/>
            <group colspan="4" string="Nutrition" id="group_patient_evaluation_nutrition">
                <label name="malnutrition"/>
                <field name="malnutrition"/>
                <label name="dehydration"/>
                <field name="dehydration"/>
            </group>
            <newline/>
            <field name="signs_and_symptoms"/>
            <newline/>
            <group colspan="4" col="12" string="Glucose and Lipids Profile" id="group_patient_evaluation_glucose_lipid">
                <label name="glycemia"/>
                <field name="glycemia"/>
                <label name="hba1c"/>
                <field name="hba1c"/>
                <label name="cholesterol_total"/>
                <field name="cholesterol_total"/>
                <label name="hdl"/>
                <field name="hdl"/>
                <label name="ldl"/>
                <field name="ldl"/>
                <label name="tag"/>
                <field name="tag"/>
            </group>
        </page>
        <page string="Mental" id="page_patient_evaluation_mental">
            <group string="Psychological Assessment" colspan="4" id="group_psychological_assessment">
                <field name="psychological_assessment" height="200"/>
            </group>
            <newline/>
            <group string="Glasgow Coma Scale" colspan="4" id="group_patient_evaluation_glasgow">
                <label name="loc"/>
                <field name="loc"/>
                <label name="loc_eyes"/>
                <field name="loc_eyes"/>
                <label name="loc_verbal"/>
                <field name="loc_verbal"/>
                <label name="loc_motor"/>
                <field name="loc_motor"/>
            </group>
            <newline/>
            <group string="Mental Assessment and Impairments" id="group_patient_evaluation_mental">
                <label name="violent"/>
                <field name="violent"/>
                <label name="mood"/>
                <field name="mood"/>
                <newline/>
                <label name="orientation"/>
                <field name="orientation"/>
                <label name="memory"/>
                <field name="memory"/>
                <label name="knowledge_current_events"/>
                <field name="knowledge_current_events"/>
                <label name="judgment"/>
                <field name="judgment"/>
                <label name="abstraction"/>
                <field name="abstraction"/>
                <label name="vocabulary"/>
                <field name="vocabulary"/>
                <label name="calculation_ability"/>
                <field name="calculation_ability"/>
                <label name="object_recognition"/>
                <field name="object_recognition"/>
                <label name="praxis"/>
                <field name="praxis"/>
            </group>
        </page>
        <page string="Info Dx" id="page_patient_evaluation_extra_info">
            <separator string="Information on Diagnosis" colspan="2" id="separator_evaluation_diagnosis_1"/>
            <newline/>
            <field name="secondary_conditions" colspan="2"/>
            <field name="diagnostic_hypothesis" colspan="2"/>
        </page>
        <page string="Procedures" id="page_patient_evaluation_procedures">
            <field name="procedures" colspan="4"/>
        </page>
        <page string="Administrative" id="page_patient_evaluation_administrative">
            <group id='group_patient_evaluation_appointment' colspan="4" col="10">
                <label name="wait_time"/>
                <field name="wait_time"/>
                <label name="appointment"/>
                <field name="appointment"/>
                <label name="derived_from"/>
                <field name="derived_from"/>
                <label name="derived_to"/>
                <field name="derived_to"/>
            </group>
            <separator string="Extra info related to this evaluation" colspan="4" id="separator_evaluation_notes"/>
            <field name="notes" colspan="4"/>
            <newline/>
            <group id='group_patient_evaluation_institution_info' colspan="4" col="6">
                <label name="institution"/>
                <field name="institution"/>
                <label name="specialty"/>
                <field name="specialty"/>
            </group>
        </page>

    </notebook>
    <newline/>
    <group colspan="4" col="8" id="group_eval_times_and_state">
      <label name="evaluation_start"/>
      <field name="evaluation_start"/>
      <label name="evaluation_endtime"/>
      <field name="evaluation_endtime"/>
      <label name="state"/>
      <field name="state"/>
      <label name="next_evaluation"/>
      <field name="next_evaluation"/>
    </group>
    <newline/>
    <group colspan="4" col="8" id="group_eval_end_button">
      <label name="signed_by"/>
      <field name="signed_by"/>
      <label name="discharge_reason"/>
      <field name="discharge_reason"/>
      <button name="end_evaluation" 
              string="Discharge" 
              icon="tryton-go-next"
              confirm="Discharge patient / End this evaluation ?"
              help="Discharge patient / end this evaluation" />
      <button name="update_patient_disease_info" 
              string="Update Patient Disease Info" 
              icon="tryton-go-next"/>
    </group>

</form>
