A Standard Form with Barcodes and Custom Entries

From Scribus Wiki
Revision as of 01:31, 11 August 2010 by Gpittman (talk | contribs)
Jump to: navigation, search

Having made a script for generating Code 39 barcodes, I wanted to take this one step further, and use that script inside a larger script that creates a form that I use which has barcodes on it.

Here it is:

Standard form.png As you can see, this is something designed for a hospital chart, which was the intended use. When I first began doing this, the idea was to begin to generate my notes in charts using Scribus, so I went about creating a template form with Scribus. Since I wanted to have this blend in with existing notes in the chart, I faithfully measured, created, edited the basic features of the form so that it would be indistinguishable from the stock forms that the hospital buys, except for the fact that I wanted to make the notes in the right hand column with Scribus instead of my variably legible handwriting.

The initial faithful rendering had the lines running all the way across the page. Technically, they're still there, but now covered with a text frame having a white background, so that the Scribus text did not have to compete visually with unnecessary lines.

The information in the upper right hand corner is specific to the patient, even this fictitious one, so the template does not have that. This comes from a script with a series of valueDialogs, after which the text frame is generated and the contents entered, one again to duplicate the hospital's computer-generated forms. After that script ran, then I needed to run Barcode Generator in Scribus, then place the barcode and size it properly.

This is where the Code 39 barcode script came in, since I wanted to create the entire label and barcode with the script.

The final step, the topic of this wiki article, involves taking those parts and now simply generating the entire page from scratch. This required going back to my template, taking down dimensions, positions, font sizes to be able to do all of what you see with a script. As you can see, there are two barcodes, the one on the upper left simply indicating the name of the form, since once a patient is discharged, their paper chart is scanned into the hospital's electronic record, so all of this kind of form ends up in the same section in the record, and the patient's record makes sure that it ends up not only in the right patient's chart but the right admission for the right patient.

To avoid repetition, I transformed the barcode creation into a function, makebars which you see near the beginning of the script. I also wanted to make sure that I did not mess up my basic layout while editing the notes frame, so this frame is generated on a newly created layer, separate from all the other content.