Archive for September, 2009

Some of the first things I needed to get straight to move from Microsoft Office scripting to Open Office scripting:

  • The BASIC isn't quite compatible: I know the object model is completely different, but even the underlying language isn't quite the same. I wanted to use the InStrRev function, but it wasn't there! Then I found option VBASupport 1 which puts it in. It's (as far as I can tell) undocumented but mentioned all over on the web. I'm not sure what else it changes (again, in the language, not the object model).
  • The name of the program is OpenOffice.org; evidently Open Office is trademarked by someone else. I'll do my best to comply.
  • Sizes are in hundredths of a millimeter (dekamicrons? abbreviated as daµ; I can't find anyone using a better abbreviation), so my code has a lot of x = y * 2540/72: 2540 mm per inch, 72 points per inch.
  • Inserting control elements is more complicated than I would have thought; the object model divides them into "model" and "view" and figuring out which properties belong to which takes some searching and experimenting:
    	Dim rng as com.sun.star.text.TextRange, checkModel, checkbox
    	checkModel = doc.createInstance("com.sun.star.form.component.CheckBox")
    	checkView = doc.createInstance("com.sun.star.drawing.ControlShape")
    	checkView.control = checkModel
    	rng.Text.insertTextContent(rng, checkView, True)
    

My hospital isn't fully electronic yet; they use a hybrid system where doctors notes and orders are written on paper, to be scanned into the electronic chart at the end of the patient's stay. Everything else (nurse's notes, labs, radiology results) are electronic. It actually works pretty well, with most of the advantages of an EMR (Electronic Medical Record) without forcing the older doctors to use the computer. That's coming, of course, but it won't be pretty.

But those of us for whom the computer is mother's milk, and whose handwriting is somewhere between chicken scratch and Linear A, we'd rather do it all online. I've been writing my admission notes for a few years with a Microsoft Word template, printing them out and putting them in the chart, with nary a problem. And the medical records department clearly used PDF's for the pages, both the blank order sheets and the preprinted, fill-in-the-blanks "standard orders" since they were available on the hospital intranet. So let's create PDF's with actual editable text boxes and check boxes (these are mockups, but they look right):

physician order sheetgastroenteritis order sheet

Continue reading ‘Diving into OpenOffice.org’ »