[Top][All Lists]

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

[Health-dev] calling external script from a wizard

From: Demoy Blake
Subject: [Health-dev] calling external script from a wizard
Date: Wed, 31 Jul 2013 14:52:05 -0500

I created a python script that uses proteus to generate patient records then returns the id of that patient (map_Mdata() below).
want to create a tryton wizard which would executes this script then change to the form view of the newly created patient, however tryton wizard documention is quite lacking (providing only an example with no comments, explanation , etc).

This wizard was based on the "openappointmentreport" from gnuhealth but i been unsuccessful at executing the external script map_Mdata() in do_open

class aa(Wizard):
    'Import Patient Record'
    start = StateView('aas',
            'aa.aaForm', [
            Button('Cancel', 'end', 'tryton-cancel'),
            Button('Open', 'open_', 'tryton-ok', default=True),
    open_ = StateAction('health.action_gnuhealth_patient_view')

    def do_open_(self, action):
        action['pyson_context'] = PYSONEncoder().encode({
                'patient': map_Mdata(self.start.uid),

        return action, {}

    def transition_open_(self):
        return 'end'

advice is greatly appreciated

reply via email to

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