gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] Open Office templates


From: Jerzy Luszawski
Subject: Re: [Gnumed-devel] Open Office templates
Date: Mon, 01 Sep 2008 11:52:26 +0200

Dnia 01-09-2008, pon o godzinie 11:59 +0200, Karsten Hilbert napisaƂ(a):
> I am not sure I see too much of a significant difference between the two
> approaches:

> 2) proposed
> 
> - create template
> - create list of placeholders for template
> 
> ... time passes ...
> 
> - load template
> - load placeholder list
> - retrieve data for placeholders in list
>   - may involve user interaction
That's what I want to avoid. My assumption (based on my own experience,
hence the unavoidable bias) is that user most of the time wants to print
what is already displayed. So, there is no need to ask him anything when
he hits "print" button.

> - parse template
>   - find placeholder
>   - insert data for placeholder
> - open template in OOo
> 

> But frankly I am not sure I see the benefit ? In fact, it
> would involve parsing the template twice instead of once.
Why twice? You parse it and get the replacement data straight from the
retrieved list.
> > This would make template handling independent of calling module.
> Can you elaborate on the benefit ?
Yes, but now I cannot look into the code to describe it in details.
Later :-)

> > The calling module has all context information available (current patient, 
> > encounter, etc.) and IMHO it is
> > easier and far more efficient to pass data as a parameter to the
> > parser,
> But there is no net gain in efficient because the data needs
> to be gotten at some stage anyhow.
(...)
> It doesn't seem to make the slightest difference at what
> time in the processing chain the values are actually
> retrieved.
> 
> However, there IS a downside the retrieving values in a
> single scoop and passing them to the replace code:
> 
> You need to store ALL the data in memory at once while the
> retrieve-replace-throw_away approach only needs to consume
> as much memory as is required for the placeholder data
> currently processed.
I strongly disagree with this. 
1. Memory is fast (and cheap). Network connection is extremely slow
compared to memory access.
2. Making a query to DB takes so much resources, than it is even hard to
compare with storing a variable (or list of variables) in memory.
3. If data are already displayed there in no need to query DB at all,
just pass the data as parameters. Saves lots of processing time both in
client and server.
4. DB engine performs better when processing one query returning all
necessary data, than several queries returning partial results. When you
make these multiple queries executed in separate batches the performance
is even poorer.

I'm not sure: what happens when the same placeholder is used many times
in the template?

When server is fast and there are only few clients, you may not notice
it, but when number of clients grows, the impact will become noticeable.

***
Creating letters from data chosen by user from a list of possibilities,
or creating serial correspondence is different matter. I just need to
make a nicely formatted report of displayed data, and plain text from
EMR journal is not enough. I try to use OO for this and to make it as
simple as possible. Maybe it needs separate approach? I'll work on it.

Best regards,
Jerzy Luszawski






reply via email to

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