We recommend to write a little SQL script file for each placeholder you want to define yourself, like in this example
INSERT INTO letter.placeholders (name, type, comment, script) VALUES ('[MY_PAT_OCCUPATION]', 'DUMMY', 'dummy', 'dummy'); UPDATE letter.placeholders SET type = 'PATIENT_INFO', comment = 'The patient''s occupation', script = '/** * [MY_PAT_OCCUPATION] */ PATIENT.getJob() == null ? "" : PATIENT.getJob();' WHERE name = '[MY_PAT_OCCUPATION]';
The above script has the following advantages over a direct INSERT:
Once finished you can put all the single placeholder creation scripts into one bigger file (easier to load), or keep them apart and add a load script on top of them.
Moreover, with a Java-aware IDE like Eclipse you can use the autocompleter function (Ctl-Space) to get a listing af all known methods for a given object, like PATIENT. This makes it much easier to figure out which methods are actually available. (see below)
To test if your new placeholder works, you have to put it into a letter template and try it out.
If there are errors, this will be marked in the generated letter at the place where the placeholder once stood. It loks like taht:
Moreover, the client log file has more information about the nature of the error, like this one:
In this case the error was that “patient” has to be written in all uper case, because this is how the constant is defined.