gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] Release Candidate 1.3.rc2 - Placeholders


From: Karsten Hilbert
Subject: Re: [Gnumed-devel] Release Candidate 1.3.rc2 - Placeholders
Date: Wed, 26 Dec 2012 13:22:05 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Dec 24, 2012 at 11:52:00PM +0000, Jim Busser wrote:

> Can some clearer elaboration of the use of templates in
> placeholders be provided?

Not easily because it can be different for different
placeholders. Some will require a template like this:

        template text (%s) more template text

where %s is replaced by the value specified by the
placeholder while other will allow for

        text %(field)s more text (%(another field)s) other text

which gives access to subfields of the items defined by the
placeholder. Maybe an example sheds more light on this: While

        $<adr_street::home::250>$

will always output the .street field of an address the same
thing could be achieved by

        $<patient_address::home//%(street)s::250>$

where the placeholder gives access to the full address (but
here the template restricts actual output to just the
street).

> 1) Despite that the acceptance of %Y %B %d is not
>    documented,

Added.

> the placeholder date_of_birth supports %Y %B %d as in
>
>       $<date_of_birth::%Y %B %d>$

In nitpicking mode one might point out that date_of_birth is
a special case in that it works in both adorned and
unadorned forms:

        $<date_of_birth>$

as well as

        $<date_of_birth::%Y %B %d>$

but that doesn't change the fact that the latter was
underdocumented.

> and so will all placeholders which represent dates accept %Y %B %d in their 
> argument?

Some will, some won't. Tell me which you need to support
that and I'll see to providing that.

> 2) Where -- next to 'patient_tags' -- the page lists as follows
> 
>       # "args" holds: <%(key)s-template>//<separator>
> 
> my question is about what I have expressed as ??? in the following expression
> 
>       $<patient_tags::???>$
> 
> Does ??? accept only a single value of 'key' or does the 's' in the expression
> 
>       %()s
> 
> imply plural

Neither.

> or that one can place multiple key values in a string

Yes. One can access subfields of dem.v_identity_tags by
means of keys (this is a standard Python string formatting
technique). Using a template of

        template: %(l10n_description)s (%(comment)s)

will give

        template: speech disabled (always use intercom)

IF there was tag "speech disabled" with comment = "always
use intercom" on the active patient.

Most "complex-object" (patient_address rather than
adr_street) allow (require) use of subfield %(field)s
syntax.

> (such as with soap identifiers 'soapu'

It might have been that way but isn't. The "soapu " (note
BLANK for None = administrative) is a preselection of
categories the user is interested in to be applied to the
actual selector function (whether that be via the user or
simply loaded from the database). It has got nothing to do
with *formatting* of the output. Said formatting can, again,
contain reference to the SOAP category, namely via a
%(soap_cat)s subfield access at the appropriate place in the
formatting template.

> or is the situation
> of the SOAPU rows a special case and the only placeholder in
> which it is supported to designate multiple values to be
> directed into the LaTex file?

No. It can be used for any target format allowing construction
of valid domain language snippets from within a single-line
text format template ;-)

> 3) For the placeholder
> 
>       $<patient_comm>$
> 
> where the argument was previously the channel type (e.g. $< 
> patient_comm::mobile>$) will it henceforth become, if no comment is desired
> 
>       $<patient_comm::%(mobile)s>$
> 
> but if a comment is desired
> 
>       $<patient_comm::%(mobile)s %(comment)s>$

No. It would require

        $<patient_comm::mobile//%(url)s::max length>$

or

        $<patient_comm::mobile//%(url)s (%(comment)s)::max length>$

The "mobile" pre-designates which type of patient comm to
use while the "%(url)s (%(comment)s)" designates what to do
with the selected comm channel (IOW how to format it for
output).

I'd be much delighted if

        http://wiki.gnumed.de/bin/view/Gnumed/GmManualLettersForms

was improved with appropriate amalgamations of the above. I
have now included a function to show a list of placeholders
available in any given client right from the Paperwork menu.

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]