Writing letters in GNUmed
GNUmed uses OpenOffice for writing letters. Letter definitions are stored in the database in the form of an OOo template file (.ott) along with some metadata (see table ref.paperwork_templates
). When the user selects a certain letter template by name GNUmed exports the corresponding template file, starts OOo and opens the template in it. It searches for known placeholders within the new OOo document and replaces them with values corresponding to the current state of GNUmed (active patient etc). It then sets up a callback in OOo in order to be notified about closure of the document. Eventually, GNUmed imports the document into the document archive under the current patient.
- in OpenOffice open a new document
- design the letter template as you please
- where appropriate include placeholders within the document
- placeholders can simply be written into the text
- placeholder can also be added via the Insert / Field menu
- save it as an .ott OpenOffice document template
- in the Office menu go to Manage Master Data
- use the menu item paperwork templates
- in the dialog fill in the fields as needed and select the .ott file you created above as the template
The new template should now be available from within GNUmed.
Placeholders are usually category words that will be replaced by specific instances of that category for the current patient, say lastname is replaced by Kirk
. Here is a list of currently known placeholders. Ask for more placeholders on the mailing list.
Placeholders come in the format $<placeholder-name::optional-arguments::optional-maximum-length>$
. If there are no arguments for a given placeholder (say, lastname) the arguments field must be left empty if you want to set a maximum length. So, $< lastname>$
is a valid placeholder as is $<lastname::::5>$
(the arguments field in the middle is empty) but not $<lastname::5>$
. Exactly what can be put into the arguments field depends on the placeholder in question. The data is passed to the placeholder handler as is. The maximum length field can be left off (but not empty). So, $<soap::ap::25>$
is valid, as is $<soap::ap>$
, but not $<soap::ap::>$
(the length field is empty).
Examples are:
- date of birth:
$<date_of_birth::%Y-%m-%d>$
- progress notes:
$<soap::ap::300>$
- show soAP rows but maximum of 300 characters
- GNUmed will let the user select which soAP rows from which encounters
Next: Test Result Management