health-dev
[Top][All Lists]
Advanced

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

Re: [Health-dev] update/set patient address in transaction


From: Luis Falcon
Subject: Re: [Health-dev] update/set patient address in transaction
Date: Tue, 13 Aug 2013 18:16:21 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130701 Icedove/17.0.7

Hi Demoy

On 13/08/2013 17:28, Demoy Blake wrote:
> I intend to create patient records from data received remotely. I am
> already able to create patient records but I don't know how to access
> and set the address field of the newly create patient. Code snippet
> below. help is greatly appreciated
The address is part of the party demographics. The address at the
patient form is a functional field that retrieves de info from the party.

Best,
> 
> ## rest not show
> with Transaction().start(dbname, user_id, context=CONTEXT) as transaction:
>         patient_obj = pool.get('gnuhealth.patient')
>         new_patient = patient_obj.create([{'name':new_party_id,
>         'marital_status':marital_status}])[0]
>         new_patient_id = new_patient.id
>         transaction.cursor.commit()
> 
> ##
> ## should set/update address field here
> ##
> 
> Cache.resets(dbname)
> 
> 
> 


-- 
Luis Falcon
http://health.gnu.org



reply via email to

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