Snippets

Daniela Barroso health_br_husj

Created by Daniela Barroso
1
2
3
4
5
6
7
8
from trytond.pool import Pool
from .health import *

def register():
    Pool.register(
        PatientEvaluation,
        module='silex_party_health_br_husj', type_='model'
    )
<?xml version="1.0"?>
<data>
   <!-- Aba Informações Importantes -->
    <!-- Remover Queixa Principal-->
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_main']/group[@id='eval_chief_complaint']" position="replace">
    </xpath>

    <!--Remover Doença atual -->
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_main']/separator[@id='separator_present_illness']" position="replace">
    </xpath>
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_main']/field[@name='present_illness']" position="replace">
    </xpath>

    <!-- Remover Sumário da avaliação-->
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_main']/separator[@id='separator_evaluation_summary']" position="replace">
    </xpath>
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_main']/field[@name='evaluation_summary']" position="replace">
    </xpath>

    <!-- buscar da aba Clinico para Informações Importantes-->
    <!-- Sinais Vitais-->
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_main']/group[@id='evaluation_header']" position="after">
        <group colspan="4" col="6" string="Controles Clínicos" id="group_patient_evaluation_vital_signs">
                <label name="weight"/>
                <field name="weight"/>
                <label name="systolic"/>
                <field name="systolic"/>
                <label name="diastolic"/>
                <field name="diastolic"/>
                <label name="bpm"/>
                <field name="bpm"/>
                <label name="temperature"/>
                <field name="temperature"/>
        </group>
        <newline/>
        <separator colspan="4" id="separator_imunossupressao"/>
        <newline/>
        <group colspan="4" col="6" string="Imunossupressão" id="group_patient_evaluation_imunossupressao">

        </group>
        <newline/>
        <separator colspan="4" id="separator_bioquimica"/>
        <newline/>
        <group colspan="4" col="6" string="Bioquímica" id="group_patient_evaluation_glucose_lipid">
            <label name="potassio"/>
            <field name="potassio"/>
            <label name="creatinina"/>
            <field name="creatinina"/>
            <label name="ureia"/>
            <field name="ureia"/>
            <label name="sodio"/>
            <field name="sodio"/>
            <label name="cholesterol_total"/>
            <field name="cholesterol_total"/>

            <label name="ph"/>
            <field name="ph"/>
            <label name="bic"/>
            <field name="bic"/>
            <label name="glycemia"/>
            <field name="glycemia"/>
            <label name="hba1c"/>
            <field name="hba1c"/>

            <label name="hdl"/>
            <field name="hdl"/>
            <label name="ldl"/>
            <field name="ldl"/>
            <label name="tag"/>
            <field name="tag"/>
        </group>
        <newline/>

        <separator colspan="4" id="separator_hematologico"/>
        <newline/>
        <group colspan="4" col="6" string="Hematológico" id="group_patient_evaluation_hematologico">

        </group>
        <newline/>

        <separator colspan="4" id="separator_culturas"/>
        <newline/>
        <group colspan="4" col="6" string="Culturas" id="group_patient_evaluation_culturas">

        </group>
        <newline/>

        <separator colspan="4" id="separator_monitorizacao"/>
        <newline/>
        <group colspan="4" col="6" string="Monitorização" id="group_patient_evaluation_monitorizacao">

        </group>

        <newline/>
        <separator colspan="4" id="separator_biopsia"/>
        <newline/>
        <group colspan="4" col="6" string="Biópsia" id="group_patient_evaluation_biopsia">

        </group>
        <newline/>

        <separator colspan="4" id="separator_observacoes"/>
        <newline/>
        <group colspan="4" col="6" string="Conduta/Observações" id="group_patient_evaluation_observacoes">
            <field name="evaluation_summary" colspan="4"/>
        </group>
    </xpath>
    <!-- Remover aba Clínico -->
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_signs']" position="replace">
    </xpath>
   
    <!-- Remover aba Estado Mental -->
    <xpath expr="/form/notebook/page[@id='page_patient_evaluation_mental']" position="replace">

    </xpath>
</data>
from trytond.model import ModelView,ModelSQL, fields
from trytond.pyson import Eval

class PatientEvaluation(ModelSQL, ModelView):
    'Patient Evaluation'
    __name__ = 'gnuhealth.patient.evaluation'

    STATES = {'readonly': Eval('state') == 'signed'}

    potassio = fields.Float(
        'K',
        help='Nível de Potássio no sangue.',
        states = STATES)
    creatinina = fields.Float(
        'Creatinina',
        help='Nível de creatinina.',
        states = STATES)

    ureia = fields.Float(
        'Uréia',
        help='Nível de uréia.',
        states = STATES)

    sodio = fields.Float(
        'Na',
        help='Nível de sódio.',
        states = STATES)

    ph = fields.Float(
        'pH',
        help='Nível do pH.',
        states = STATES)

    bic = fields.Float(
        'Bic',
        help='Nível de Bic.',
        states = STATES)
<?xml version="1.0"?>
<tryton>
    <data>
        <!-- Mudança no form da Avaliação do Paciente-->


<!-- PATIENT EVALUATION -->

        <record model="ir.ui.view" id="gnuhealth_patient_evaluation_view_husj">
            <!-- Alterei o id para o husj-->
            <field name="model">gnuhealth.patient.evaluation</field>
            <field name="inherit" ref="health.gnuhealth_patient_evaluation_view"/>
            <!-- referenciando ao form na pasta views, deve possuir o mesmo nome do id do modelo de origem-->
            <field name="type">form</field>
            <field name="name">gnuhealth_patient_evaluation</field>
        </record>

        <record model="ir.ui.view" id="gnuhealth_patient_evaluation_tree_husj">
            <field name="model">gnuhealth.patient.evaluation</field>
            <field name="inherit" ref="health.gnuhealth_patient_evaluation_tree"/>
            <field name="type">tree</field>
            <field name="name">gnuhealth_patient_evaluation_tree</field>
        </record>

    </data>
</tryton>
[tryton]
version=3.4.0
depends:
    company
    currency
    health
    ir
    party
    product
    res
xml:
    health_view.xml

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.