Dear Joe On Wed, 8 Oct 2014 00:22:25 +0800 Joe Gene Quesada <[email protected]> wrote:
> Dear Luis, > > Thank you for your reply. I'm still staring at the health_inpatient > module code, and figuring out how to write a searcher definition. I > haven't found an example that I can follow. > You might want to take a look at function field for retrieving the person PUID for the Health Professional http://hg.savannah.gnu.org/hgweb/health/file/f1e9fe6963ad/tryton/health/health.py#l1162 and it's corresponding searcher method http://hg.savannah.gnu.org/hgweb/health/file/f1e9fe6963ad/tryton/health/health.py#l1175 Hope it helps ! All the best, > Will see you in Kyoto soon. > > Best regards, > > Joe Gene > > On Tue, Oct 7, 2014 at 8:35 PM, Luis Falcon <[email protected]> wrote: > > > Dear Joe > > > > On Tue, 7 Oct 2014 09:26:55 +0800 > > Joe Gene Quesada <[email protected]> wrote: > > > > > Hi Emilien, > > > > > > I have made some progress in this issue. > > > > > > First, I have figured out how to write a proper domain rule. > > > > > > I used the following model for the record rules I tested below: > > > > > > Model Description: Patient related information > > > Model Name: gnuhealth.patient > > > > > > Domain statements that worked under record rules of the above > > > model: [('diet_info', 'like', 'sugar')] > > > [('puid', 'like', '%2014%')] > > > [('lastname', 'like', '%')] > > > > > > The domain statements above filter the patient data that match the > > > rules. > > > > > > The domain statement that is still not working: > > > [('patient_status', 'like', 'hospitalized')] > > > > > > There is now a Tryton error message box that pops up on the client > > > with the following message: > > > Missing search function on field "patient_status" > > > > > It looks like you are missing the searcher definition on the > > function field. > > > > Let me know if you solved it. > > > > PS: I'm flying to Japan tomorrow. Since you're assisting to the > > Kyoto conference, we can see it there :) Please bring your laptop. > > > > PS2: I'm moving this thread to health-dev , dedicated to > > development. Please in the next reply, write to health-dev only. > > > > All the best, > > Luis > > > > > I have attached some screenshots to clarify this. > > > > > > > > Thank you, > > > > > > Joe Gene Quesada > > > > > > > > > > > > On Tue, Oct 7, 2014 at 12:00 AM, <[email protected]> wrote: > > > > > > > Send Health mailing list submissions to > > > > [email protected] > > > > > > > > To subscribe or unsubscribe via the World Wide Web, visit > > > > https://lists.gnu.org/mailman/listinfo/health > > > > or, via email, send a message with subject or body 'help' to > > > > [email protected] > > > > > > > > You can reach the person managing the list at > > > > [email protected] > > > > > > > > When replying, please edit your Subject line so it is more > > > > specific than "Re: Contents of Health digest..." > > > > > > > > > > > > Today's Topics: > > > > > > > > 1. Re: Patient filter for nursing (Emilien Klein) > > > > > > > > > > > > ---------------------------------------------------------------------- > > > > > > > > Message: 1 > > > > Date: Mon, 6 Oct 2014 07:15:57 +0200 > > > > From: Emilien Klein <[email protected]> > > > > To: General GNU Health discussion and help <[email protected]> > > > > Subject: Re: [Health] Patient filter for nursing > > > > Message-ID: > > > > <CANqxmqHD2kp7C4MQ-c3RQbYTzton7oR9mGwAX7qb7Ht7= > > > > [email protected]> > > > > Content-Type: text/plain; charset="utf-8" > > > > > > > > Hi Jose, > > > > > > > > Le 5 oct. 2014 07:33, "Jose Eugenio Quesada" > > > > <[email protected]> a ?crit > > > > : > > > > > > > > > > Hello GNU Health friends, > > > > > > > > > > I'm from the Philippines working on a project to implement GNU > > > > > Health in > > > > a local city government hospital. > > > > > > > > > > My question has to do with limiting the list of patients that > > > > > a nurse > > > > assigned to the maternity ward can view. > > > > > > > > > > I would like to set the filter using the Tryton client adding > > > > > a rule to a > > > > new group that I called "Health Nursing Maternity" > > > > > > > > > > The new rule should limit a nurse that is assigned to "Health > > > > > Nursing > > > > Maternity" to be able to view records of patients whose patient > > > > status = 'hospitalized', and whose inpatient registration type = > > > > 'maternity. > > > > > > > > > > I created two rules that used Patient Admission History > > > > > model, and > > > > Patient related information model. > > > > > > > > > > Inside of the Patient Admission History rule, I added the > > > > > following > > > > domain: > > > > > [('gnuhealth_inpatient_registration.admission_type', '=', > > > > > 'maternity')] > > > > > > > > > > Inside of the Patient related information model, I added the > > > > > following > > > > domain: > > > > > [('gnuhealth_patient.patient_status', '=', 'hospitalized')] > > > > > > > > > > When I then log in as a nurse assigned to the group "Health > > > > > Nursing > > > > Maternity", I get a python error complaining about > > > > gnuhealth_patient > > > > > > > > Please paste this specific error in the email. > > > > > > > > > > > > > > Would appreciate help and guidance on how to properly > > > > > configure these > > > > kinds of filters in GNU Health. > > > > > > > > > > Thank you in advance, > > > > > > > > > > Joe Gene Quesada > > > > -------------- next part -------------- > > > > An HTML attachment was scrubbed... > > > > URL: < > > > > > > http://lists.gnu.org/archive/html/health/attachments/20141006/6f0884aa/attachment.html > > > > > > > > > > > > > ------------------------------ > > > > > > > > _______________________________________________ > > > > Health mailing list > > > > [email protected] > > > > https://lists.gnu.org/mailman/listinfo/health > > > > > > > > > > > > End of Health Digest, Vol 39, Issue 6 > > > > ************************************* > > > > > > > > > > > > -- > > Dr. Luis Falcon > > GNU Health > > Freedom and Equity in Healthcare > > http://health.gnu.org > > > >
