Printed Forms
This is a design document for the printed forms module.
The printed forms module is used to print "standardized" or "official" forms based upon the data in the system. For example, it might be the registration number for a nurse.
The output will be either PDF (which Carl prefers) or html (which Luke prefers).
Source Data
The source data for the printed form will be a report which is based on a form relationship.
Interaction
At the first phase of this module, the only interaction is to produces the reports based on what is stored in magic data. There will be no "document design" component. The standard form will be accessed through a URL with the name of the standardized form and a GET/POST variable containing one or more of the id's for the primary form in the report relationship. For example:
http://<SITE_URL>/StandardForm/registration?ids[]=person|12&ids[]=person|14&ids=[]person|22
Hitting this URL would cause the following to happen:
- verify that a standarized form called registration exists
- verify that the user has the appropriate permission to view this standardized form:
- Check to see if the user has the task 'can_view_standarized_forms_all'
- If not, check to see if the task 'can_view_standarized_form_registration' exists and the user has this task
- for each of the ids, person|12, person|14, person|22 fill out the details of the standardized report by using the corresponding row in the report table if it exists (see below).
Magic Data Details
All standardized forms will be stored under the magic data node:
/modules/StandardForm/forms
In the example above the details defining the registration form would stored under:
/modules/StandardForm/forms/registration
The details for a specific form are as follows:
- report: Required scalar node. the name of the report that this form is based off of. It needs to be the name of a child node of /modules/CustomRepoumrts/reports
- layout_details: Optional parent node describing the page layout details for the form. It contains the following child nodes.
- orientation: Optional scalar node. Defaults to 'P' for portrait. The other option is 'L' for landscape
- size: Optional scalar node. Defaults to 'A4' to describe the paper to be used. Should be one of the ISO 216 standard paper sizes, e.g. 'A4', or one of the North American paper sizes, e.g. 'letter' or 'legal'
- unit: Optional scalar node: The unit of measurement for all dimensions. Defaults to 'mm'. Should be one of 'mm','in' or 'cm'.
- rows: Optional scalar node: Defaults to 1. The number of rows of forms to be printed on the page.
- cols: Optional scalar node: Defaults to 1. The number of columns of forms to be printed on the page.
- border: Optional scalar node. Defaults to 0 if rows and columns are 1, otherwise it to defaults to 1. The width of the border drawn around the forms.
- layers: Parent node. Children should be numerically indexed. Layers are added to the standard document in increasing numeric order of the node name of the layer.