Menu Content/Inhalt
Startseite arrow Plugins arrow Cases And Bills
Cases And Bills Drucken
In Elexis, billing and accounting is delegated to the plugin system. But there are some conventions to obey for a successful billing-plugin. This article describes the necessary steps.

We recommend that you take the plugin elexis-privatrechnung as a template for your own development. Here I discuss this plugin.

1) The plugin.xml

A billing plugin should plug into the following extension points:
  • ch.elexis.Verrechnungscode: Here we define a Code System. As such it consists of a Data Class derived from PersistentObject (discussed below), an Element Factoryclass, a code browser class (CodeSelectorFactory) and a code detail display class (CodeDetailDisplay). Optionally, we might also define an "Optifyer" (Optimizer/Verifyer) and a "MandantFilter" (To differentiate between mandators)

  • ch.elexis.PersistentReference: This is needed to save accountings in the database

  • ch.elexis.RechnungsManager: This is needed to output bills (print, transmit etc.)

  • org.eclipse.ui.PreferencePages: If we need to define our own preferences.

2. The Data Class

ch.elexis.privatrechnung.data.Leistung is the items class for our plugin. We subclass PersistentObject, which is definitely the recommended way to define persistent data in elexis.  A subclass of persistentObject needs only to meet some formal requirements and then relies on the framework to persist data, to handle different underlying databases and to connect smoothly to elexis.

Please refer to the plugin introduction article for an in-depth discussion of the PersistentObjett concept.
For our billing plugin, we define a class that has fields for the name, neccessary time, cost and values of every service, as well as a validity period.

At least the  methods shown  in Leistung.java should be implemented by every billing- codeclass.

3. The Importer class

Normally, the user will receive the code system from  his or her system vendor or form a public health service. In many cases, it will be in a computer readable format. An Importer is a tool to transfer such external data into elexis. Here we take a simple table as data source (Excel or CSV-format). The table must have a specific format. (See ch.elexis.privatrechnung.data.Importer). An Importer consists manly of two parts: the createPage Method, that let's the user select an input souce, and the doImport Method that does the actual work.

4. The Code Browser class

ch.elexis.privatrechnung.views.Leistungsselektor defines the class that lets the user select codes and transfer them to the accounting by drag&drop keyboard  or doubleclick. The framework handles almost all parts of this work. One must only make sure to plug correctly into it. Please refer to the source which is quite trivial.

5. The Code Detail display class

ch.elexis.privatrechnung.views.Leistungsdetail defines the class that lets the user view deatils of a selected code. Again, we can use the framework to do most of the work, if we don't have very specific needs.
The InputData class is the recommended method to display data out of PersistentObjects: InputData can manage transparently data from Database-fields, ExtInfo-Hashtables and accessor methods.

6. The outputter class

ch.elexis.privatrechnung.rechnung.RechnungsDrucker is an example of an outputter class. Of course, the destination of a bill can not only be a printer, but as well an internet-Destination (see elexis-trustx) or a file.

Plugging things together

After installing this Plugin, its Code System and Outputter will be available from the settings-billing methods Menu.


 
< zurück   weiter >