health-dev
[Top][All Lists]
Advanced

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

[Health-dev] Health Services v4.0 - Proposal - Update on_change_patient


From: Francisco Maria Moyano Casco
Subject: [Health-dev] Health Services v4.0 - Proposal - Update on_change_patient and add on_change_insurance_holder
Date: Wed, 25 May 2022 10:56:12 -0300

Hi everyone,
     To automate the fetch of the insurance plan on the health services form I proposed to update the on_change_patient function and add an on_change_insurance_holder. I think it will be a time saving for the end-user.

      At the most cases the patient record has a current insurance field, once you select the patient on the health services the insurance holder will be selected like the party of the patient (like it currently does) plus it will select and fill the patient current insurance as the insurance plan field.

      If the insurance holder is not the party of the patient, then it will blank the insurance plan field.

     It could be something like this:

    @fields.depends('patient', 'insurance_holder')
    def on_change_patient(self):
        if self.patient and not self.insurance_holder:
            self.insurance_holder = self.patient.name
            self.insurance_plan = \
                self.patient.current_insurance and self.patient.current_insurance.id
        else:
            self.insurance_holder = None
            self.insurance_plan = None

    @fields.depends('insurance_holder', 'patient')
    def on_change_insurance_holder(self):
        if not self.insurance_holder or \
            self.insurance_holder and self.patient and \
            self.insurance_holder.id != self.patient.name.id :
            self.insurance_plan = None
        if self.insurance_holder and self.patient and \
            self.insurance_holder.id == self.patient.name.id:
            self.insurance_plan = \
                self.patient.current_insurance and \
                self.patient.current_insurance.id

   Regards
       Francisco

reply via email to

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