Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.befunde
Class Messwert

java.lang.Object
  extended by ch.elexis.data.PersistentObject
      extended by ch.elexis.befunde.Messwert
All Implemented Interfaces:
IPersistentObject, ISelectable

public class Messwert
extends PersistentObject

Here we define our own data type for our "measurements"-Plugin. The Type is derived from ch.elexis.data.PersistentObject, and thereby the mananagement of the object persistence is completely delegated to elexis. The Method getSetup() creates (if necessary) a new table for our type. Some methods are required for every class derived from PersistentObject to work properly. Those methods are herafter marked with -required- Hier wird ein eigener Datentyp für unser "Messwerte"-Plugin definiert. Der Datentyp wird von PersistentObject abgeleitet, was das Persistenzmanagement an Elexis delegiert. In der Methode getSetup() wird wenn nötig eine neue Tabelle zur Speicherung der Daten dieses Datentyps erstellt. Einige Methoden _müssen_ vorhanden sein, damit eine von PersistentObject abgeleitetes Klasse korrekt funktioniert. Diese sind im Folgenden mit -Zwingend- markiert.

Author:
Gerry

Nested Class Summary
 
Nested classes/interfaces inherited from class ch.elexis.data.PersistentObject
PersistentObject.FieldType
 
Field Summary
static java.lang.String _FIELDS
           
static java.lang.String FLD_BEFUNDE
           
static java.lang.String FLD_NAME
           
static java.lang.String FLD_PATIENT_ID
           
static java.lang.String HASH_NAMES
           
static java.lang.String PLUGIN_ID
           
static java.lang.String SETUP_CHECKSEPARATOR
           
static java.lang.String SETUP_SEPARATOR
           
static int VERSION
           
 
Fields inherited from class ch.elexis.data.PersistentObject
CACHE_DEFAULT_LIFETIME, CACHE_MIN_LIFETIME, CFG_CONNECTSTRING, CFG_DRIVER, CFG_PWD, CFG_TYPE, CFG_USER, DELETED, EXISTS, INEXISTENT, INVALID_ID, MATCH_AUTO, MATCH_CONTAINS, MATCH_EXACT, MATCH_REGEXP, MATCH_START
 
Fields inherited from interface ch.elexis.core.data.IPersistentObject
FLD_DATE, FLD_DELETED, FLD_EXTINFO, FLD_ID, FLD_LASTUPDATE, STATE_EXISTING, STATE_INEXISTENT, STATE_INVALID_ID
 
Constructor Summary
Messwert(Patient pat, java.lang.String name, java.lang.String date, java.util.Map<java.lang.Object,java.lang.Object> bf)
          This is the only public constructor.
 
Method Summary
 java.lang.String getDate()
           
 java.lang.String getLabel()
          a concise, human readable indentification for the measurement.
 java.lang.String getResult(java.lang.String field)
           
static Messwert getSetup()
          Here are configuration details read.
static Messwert load(java.lang.String id)
          -required- This is the standard method to construct a PersistentObject from its representation in the database.
 
Methods inherited from class ch.elexis.data.PersistentObject
addChangeListener, addSticker, addToList, addXid, begin, checkNull, checkZero, checkZeroDouble, clearCache, connect, connect, delete, deleteList, disconnect, equals, executeSQLScript, exists, exportData, fireChangeEvent, flatten, fold, get, get, getCacheTime, getConnection, getDefaultCacheLifetime, getFieldType, getId, getInt, getLastUpdate, getList, getList, getMap, getSticker, getStickers, getWrappedId, getXid, getXid, getXids, hashCode, isAvailable, isDeleted, isDragOK, isMatching, isMatching, isMatching, isMatching, isShowDeleted, isValid, lock, map, relock, removeChangeListener, removeFromList, removeFromList, removeSticker, resetCache, set, set, setDefaultCacheLifetime, setInt, setMap, setShowDeleted, setTrace, state, storeToString, tableExists, ts, undelete, unlock
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HASH_NAMES

public static final java.lang.String HASH_NAMES
See Also:
Constant Field Values

_FIELDS

public static final java.lang.String _FIELDS
See Also:
Constant Field Values

FLD_BEFUNDE

public static final java.lang.String FLD_BEFUNDE
See Also:
Constant Field Values

FLD_NAME

public static final java.lang.String FLD_NAME
See Also:
Constant Field Values

FLD_PATIENT_ID

public static final java.lang.String FLD_PATIENT_ID
See Also:
Constant Field Values

VERSION

public static final int VERSION
See Also:
Constant Field Values

PLUGIN_ID

public static final java.lang.String PLUGIN_ID
See Also:
Constant Field Values

SETUP_SEPARATOR

public static final java.lang.String SETUP_SEPARATOR
See Also:
Constant Field Values

SETUP_CHECKSEPARATOR

public static final java.lang.String SETUP_CHECKSEPARATOR
See Also:
Constant Field Values
Constructor Detail

Messwert

public Messwert(Patient pat,
                java.lang.String name,
                java.lang.String date,
                java.util.Map<java.lang.Object,java.lang.Object> bf)
This is the only public constructor. The parameterless constructor should never be used, as it does not create the object in the database. The constructor with a single string parameter should never be called from outside the class itself. Dies ist der einzige öffentliche Konstruktor. Der parameterlose Konstruktor sollte nie verwendet werden, da er das Objekt nicht persistiert, und der Konstruktor mit einem einzelnen String Element sollte nie direkt aufgerufen werden (s. dort)

Parameters:
pat - Der Patient, dem dieser Messwert zugeordnet werden soll
name - Name des Messwerts
date - Datum des Messwerts
bf - Der Messwert in beliebige komplexer Form, wird als Black Box betrachtet
Method Detail

getDate

public java.lang.String getDate()

getLabel

public java.lang.String getLabel()
a concise, human readable indentification for the measurement. Subclasses should always override this, because the abse implementation of PersistentObject gives only an empty string. Eine kurze menschenlesbare Identifikation für den Messwert liefern. Sollte überschrieben werden; die Standardimplementation von PersistentObject liefert einfach einen Leerstring zurück.

Specified by:
getLabel in interface IPersistentObject
Specified by:
getLabel in class PersistentObject

getResult

public java.lang.String getResult(java.lang.String field)

getSetup

public static Messwert getSetup()
Here are configuration details read. If reading fails, the method assumes, that the table does not exist yet an creates it. Hier werden Konfigurationseinzelheiten eingelesen. Wenn das Lesen fehlschlägt, nimmt die Methode an, dass die Tabelle noch nicht existiert und legt sie neu an.

Returns:

load

public static Messwert load(java.lang.String id)
-required- This is the standard method to construct a PersistentObject from its representation in the database. For semantic reasons we intenionally do not use the "new" constructor for that purpose. "New" should only be used to create really "new" Objects and not to load existing objects from the database. Internally, however, load simply calls new(String). The static method load(String) must exist in every sublclass of PersistentObject, but it can always be written just exacly as here. The method needs not to guarantee that the returned object exists. It can, if desired, return a null value to indicate a inexistent object. Here we return just whatever the superclass gives us. -Zwingend- Dies ist die Standardmethode zum Konstruieren eines PersistentObjects aus der Datenbank. Aus semantischen Gründen wurde hierfür bewusst nicht der "new" Konstruktor verwendet. "New" bleibt gegen aussen für die Erstellung "neuer" Objekte reserviert. Intern allerdings ruft load einfach new(String) auf. Das kann immer exakt so formuliert werden.

Parameters:
id - ID des zu ladenden Objektes
Returns:
Das Objekt (kann auch null oder inexistent sein)

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis