gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] vaccinations


From: Ian Haywood
Subject: Re: [Gnumed-devel] vaccinations
Date: Tue, 27 Sep 2005 08:46:46 +1000
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050912)

Karsten Hilbert wrote:


> IOW, passing self.__problem to cResizingSTC is bad design IMO.
Yes, that's right, and now academic given your solution below.


> Upon instantiating a cResizingSTC a "master dict root" is
> passed in which must be a dict. The STC gets the data dict
> from the popup and stores it into that master dict like so:
[snip]
> items. The 'ID' field is needed to allow selection of which
> field is to be re-edited.
This seems like the best solution.


> cResizingSoapPanel.save() would do:
> 
> for popup_type in self.master_dict.keys():
>       if popup_type == 'vaccination':
>               data_list = self.master_dict['vaccination']
>               for popup_data in data_list:
>                       gmVaccination.create_vaccination(data_list['data'])
>       elif popup_type == ...:
>               ...
>       else:
>               log(unknown type)
This if-cascade could get rather large. (hopefully)
cResizingSoapPanel should be passed a dict of (popup_function, 
commit_dict_to_backend_function) tuples.
The latter could be a method object, so it is already bound to the emr and 
episode, so cResizingSoapPanel
doesn't need to know anything about that.

Currently the key of the dict is the "magic keywords" used to bring up the 
popups.
In the fullness of time,  the keys could be the coding system, and the 
cResizingSTCs are passed
a gmMatchProvider to grab codes from the backend.

Ian

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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