health
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Health] Configuration


From: Feng Shu
Subject: Re: [Health] Configuration
Date: Wed, 05 Jun 2024 14:42:32 +0800
User-agent: Gnus/5.13 (Gnus v5.13)

Zahra Magdub <zahra.magdub@gmail.com> writes:

> Hello everyone
> I want to represent a process flow. The doctor documents after the operation 
> in the area Health / Surgery. As soon as they
> record the surgical intervention, the associated supplies should appear 
> directly in the supplies section. I want to configure
> this for them. I can configure a lot through the interface and have created a 
> submodule in the area Health / Configuration
> / Procedures / Procedures. I created a module called Config Supplier that 
> should work so that I can link suppliers to the
> respective procedures. But I can't create the correct view. I have made 
> several attempts to create the correct window
> action. I am stuck. My question is whether it is possible to do it this way 
> because I thought the suppliers are created in
> Product / Products, therefore they are stored in the database, and the 
> procedures are also created. Do I need to change
> something in the code, or can I do it through the user interface?

Maybe complete_criteareas button in health_lab can help you.


    @classmethod
    def __setup__(cls):
        super(Lab, cls).__setup__()
        t = cls.__table__()
        cls._sql_constraints = [
            ('id_uniq', Unique(t, t.name),
             'The test ID code must be unique')
        ]
        cls._order.insert(0, ('date_requested', 'DESC'))
        cls._buttons.update({'complete_criteareas': {}})


    @classmethod
    @ModelView.button
    def complete_criteareas(cls, labs):
        pool = Pool()
        Critearea = pool.get('gnuhealth.lab.test.critearea')

        lab = labs[0]
        test_cases = []

        for critearea in (lab and lab.test and lab.test.critearea):
            test_cases.append({
                'gnuhealth_lab_id': lab.id,
                'name': critearea.name,
                'code': critearea.code,
                'sequence': critearea.sequence,
                'limits_verified': critearea.limits_verified,
                'lower_limit': critearea.lower_limit,
                'upper_limit': critearea.upper_limit,
                'normal_range': critearea.normal_range,
                "to_integer": critearea.to_integer,
                'units': critearea.units and critearea.units.id})

        if test_cases:
            Critearea.create(test_cases)



>
> Lg

-- 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]