gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] placeholders


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] placeholders
Date: Thu, 24 Jan 2013 10:15:12 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jan 22, 2013 at 06:48:44AM +0000, Jim Busser wrote:

> > Can we have placeholders for s, o, a, p and may be for
> > measurements for CURRENT Visit /encounter separately. This
> > should easily facilitate creating simple templates where
> > visit is to be printed. 
> 
> What Vaibhav desires might be achievable with current placeholders depending 
> on a few things …
> 
> 1) 'soap_for_encounters'  lets the user select a list of
> encounters for which LaTeX formatted progress notes are
> emitted, which should offer the ability to choose the
> encounter despite that it involves a bit of work to make the
> selection

That selection is, IMO, necessary because GNUmed cannot know
which encounter is desired - or even what is meant by
"current encounter" (as different people will have different
opinions on that).

> 2) 'emr_journal' accepts a <time range> in weeks but I do
> not know whether a value less than 1 week (such as 0.2
> corresponding to 1.4 days) would throw an error.

It would not but currently it would revert to "infinite"
because currently it does this:

        # part[3]: weeks going back in time
        if len(data_parts) > 3:
                try:
                        time_range = 7 * int(data_parts[3])
                except:
                        time_range = None

I changed this to

        try:
                time_range = 7 * int(data_parts[3])
        except:
                #time_range = None
                pass            # pass on literally, meaning it must be a valid 
PG interval string

meaning that any valid PostgreSQL interval string can be
used. This is closer to what the user wanted: it will either
fail (because it's not a valid interval def - rather than
silently revert to returning ALL data) or else it will do
what the user wants. A single integer will retain the
original meaning of N weeks.

So, '7' will mean 7 weeks while '7 weeks 3 days' will do the expected.

> Also, this has the disadvantage of saving the desired
> <time range> hard coded into the template. I have been
> wondering whether the desired time frame could be inputted
> interactively

Well, with 1.3 you could use this approach:

Into the template put a placeholder accessing a(n active)
text snippet which in itself asks for user input.

Template:

        $<text_snippet::variable_emr_journal//%s::>$

Text snippet (textual keyword expansion):

        variable_emr_journal:

        %% this expansion creates an EMR Journal placeholder
        %% and allows selection of categories and input of
        %% the desired time range
        $<emr_journal::$Enter "SOAPU " categories for EMR 
journal!$//%s//100//$Enter time range to go back (PostgreSQL interval format) 
!$//tex::>$

which would (now) first make GNUmed expand the text snippet
-- thereby asking the user for input of the SOAP categories
and for entering a time range -- and then exporting an EMR
journal placeholder into the template which gets expanded
into the journal on the second run over the file.

Something similar might be construable with the free_text
placeholder but I haven't tested that.

Karsten
-- 
GPG key ID E4071346 @ gpg-keyserver.de
E167 67FD A291 2BEA 73BD  4537 78B9 A9F9 E407 1346



reply via email to

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