I created a python script that uses proteus to generate patient records then returns the id of that patient (map_Mdata() below).
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'
__name__='aa'
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'