gov.lanl.Pids
Class PidsClientPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--gov.lanl.Pids.PidsClientPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, PidsSelectionObserver, java.lang.Runnable, java.io.Serializable

public class PidsClientPanel
extends javax.swing.JPanel
implements java.awt.event.ActionListener, PidsSelectionObserver, java.lang.Runnable

The class HM is test client for PIDS and MedTraits. This client enables the user to add, edit, and search patients.

Based on a batch client from Tim Brinson and uses an extension of his original server.

See Also:
Serialized Form
 

Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PidsClientPanel(java.util.Properties props, org.omg.CORBA.ORB theORB, java.lang.String imageDirectory)
          creates the GUI with buttons for actions, text fields for entry and status, and a table for the demographic data
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          handles the actions of the buttons Validate PIDS, Get Profile, and Find Candidates
 void displayPatientPicture(int row)
          displays a picture of the patient in a separate window
 void doAddEditPatient(boolean isAddDlg)
          opens a dialog window that allows the user to add or edit patient data
 void doClearTable()
          resets the patient table by removing all entries
 void doDeactivatePatient(java.lang.String id)
          deactivates a specified patient profile by deprecating his/her identifier
 void doFindPatients()
          searches the remote patient database for patients that meet the search criteria trait specified in the search table or the selector field; the candidates are displayed in the table at the end of the search
 org.omg.PersonIdService.Trait[] doGetProfile(java.lang.String id)
          obtains the profile of a specified patient
 void doSelectPids()
          opens a PIDS selection dialog window
 void fillTraitRow(int row, java.lang.String id, org.omg.PersonIdService.Trait[] theProfile)
          inserts the traits of a patient into a table row
 void fillTraitTable(org.omg.PersonIdService.TaggedProfile[] tp)
          fills the table with a set of patient data
 gov.lanl.Pids.PatientListNotifier getPatientListNotifier()
          Returns a reference to the patient list notifier object.
 gov.lanl.Pids.PidsSelectionNotifier getPidsSelectionNotifier()
          Returns a reference to the PIDS selection notifier object.
 void notifyPidsSelectionObserver(int event, java.util.Vector pidsSelectionVector)
          notifyPidsSelectionObserver() implements the interface PidsSelectionObserver.
 void registerWindow(java.lang.Object aWindow)
          registers a window with the panel; this is necessary to keep track of the patient image windows
 void run()
          implementation of the runnable interface; used to start the find candidates or get profile operations in a background thread
 void unregisterWindow(java.lang.Object aWindow)
          unregisters a window with the panel; this is necessary to keep track of the patient image windows
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PidsClientPanel

public PidsClientPanel(java.util.Properties props,
                       org.omg.CORBA.ORB theORB,
                       java.lang.String imageDirectory)
creates the GUI with buttons for actions, text fields for entry and status, and a table for the demographic data

Parameters:
props - Input Properties
theORB - reference to the ORB
imageDirectory - location of the image files
Method Detail

getPidsSelectionNotifier

public gov.lanl.Pids.PidsSelectionNotifier getPidsSelectionNotifier()
Returns a reference to the PIDS selection notifier object. This reference can then be used to register an observer object to PIDS selection change events.

Returns:
a reference to the PIDS selection notifier object

getPatientListNotifier

public gov.lanl.Pids.PatientListNotifier getPatientListNotifier()
Returns a reference to the patient list notifier object. This reference can then be used to register an observer object to patient list change events.

Returns:
a reference to the patient list notifier object

run

public void run()
implementation of the runnable interface; used to start the find candidates or get profile operations in a background thread

Specified by:
run in interface java.lang.Runnable

registerWindow

public void registerWindow(java.lang.Object aWindow)
registers a window with the panel; this is necessary to keep track of the patient image windows

Parameters:
aWindow - a window that displays a patient picture

unregisterWindow

public void unregisterWindow(java.lang.Object aWindow)
unregisters a window with the panel; this is necessary to keep track of the patient image windows

Parameters:
aWindow - a window that displays a patient picture

doSelectPids

public void doSelectPids()
opens a PIDS selection dialog window


doGetProfile

public org.omg.PersonIdService.Trait[] doGetProfile(java.lang.String id)
obtains the profile of a specified patient

Parameters:
id - the patient identifier
Returns:
array of type Traits[] containing the profile traits if the operation was successfull; empty array otherwise

doAddEditPatient

public void doAddEditPatient(boolean isAddDlg)
opens a dialog window that allows the user to add or edit patient data

Parameters:
isAddDlg - true if add patient dialog is requested; false> if edit patient dialog is requested

doDeactivatePatient

public void doDeactivatePatient(java.lang.String id)
deactivates a specified patient profile by deprecating his/her identifier

Parameters:
id - the identifier of the patient to be deactivated

doFindPatients

public void doFindPatients()
searches the remote patient database for patients that meet the search criteria trait specified in the search table or the selector field; the candidates are displayed in the table at the end of the search


doClearTable

public void doClearTable()
resets the patient table by removing all entries


fillTraitRow

public void fillTraitRow(int row,
                         java.lang.String id,
                         org.omg.PersonIdService.Trait[] theProfile)
inserts the traits of a patient into a table row

Parameters:
row - the table row at which the HL7 is to be inserted
id - the patient identifier
theProfile - the patient profile data to be inserted

fillTraitTable

public void fillTraitTable(org.omg.PersonIdService.TaggedProfile[] tp)
fills the table with a set of patient data

Parameters:
tp - the patient profile information to be inserted into the table

displayPatientPicture

public void displayPatientPicture(int row)
displays a picture of the patient in a separate window

Parameters:
row - index of the table row in which the patient is located

notifyPidsSelectionObserver

public void notifyPidsSelectionObserver(int event,
                                        java.util.Vector pidsSelectionVector)
notifyPidsSelectionObserver() implements the interface PidsSelectionObserver. This method is called every time the PIDS selection in the PIDS selection dialog or the PIDS client panel changes. It is also called when the PIDS selection dialog window is closed.

Specified by:
notifyPidsSelectionObserver in interface PidsSelectionObserver
Parameters:
event - describes the type of event, such as INACTIVE_PIDS_SELECTION_CHANGED - the PIDS selection in the PIDS selection frame changed ACTIVE_PIDS_SELECTION_CHANGED - the PIDS selection in the PIDS client panel changed INACTIVE_PIDS_SELECTION_FINALIZED- the user finished selecting PIDS in the PIDS selection frame
pidsSelectionVector - a vector that contains the current PIDS selection in form of String objects

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
handles the actions of the buttons Validate PIDS, Get Profile, and Find Candidates

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - the button event