4 import java
.awt
.Dimension
;
5 import java
.awt
.event
.ActionEvent
;
6 import java
.awt
.event
.ActionListener
;
7 import java
.util
.Vector
;
9 import javax
.swing
.JButton
;
10 import javax
.swing
.JComboBox
;
11 import javax
.swing
.JDialog
;
12 import javax
.swing
.JEditorPane
;
13 import javax
.swing
.SwingUtilities
;
15 import org
.jdesktop
.swingworker
.SwingWorker
;
16 import org
.jdesktop
.swingx
.JXPanel
;
18 import CommonTools
.ButtonTools
;
19 import CommonTools
.DatFunk
;
20 import CommonTools
.JRtaComboBox
;
21 import CommonTools
.SqlInfo
;
22 import CommonTools
.StringTools
;
24 import com
.jgoodies
.forms
.layout
.CellConstraints
;
25 import com
.jgoodies
.forms
.layout
.FormLayout
;
27 public class Reha301PatAuswahl
extends JDialog
{
32 private static final long serialVersionUID
= 1L;
33 JComboBox combo
= null;
34 ActionListener al
= null;
35 JButton
[] buts
= {null,null};
36 JEditorPane htmlPane
= null;
37 Reha301Auswerten eltern
= null;
38 String nachrichtenid
= null;
39 Vector
<Vector
<String
>> patvec
= new Vector
<Vector
<String
>>();
40 Vector
<Vector
<String
>> nachrichtenvec
= new Vector
<Vector
<String
>>();
41 String verordnungsart
= null;
42 String eilfall
= null;
44 public Reha301PatAuswahl(Reha301Auswerten xeltern
,String id
){
46 setTitle("Patient auswählen");
47 this.setPreferredSize(new Dimension(300,300));
48 this.activateListener();
49 this.setContentPane(getContent());
50 this.eltern
= xeltern
;
51 this.nachrichtenid
= id
;
52 this.setDefaultCloseOperation(JDialog
.DISPOSE_ON_CLOSE
);
53 new SwingWorker
<Void
,Void
>(){
55 protected Void
doInBackground() throws Exception
{
67 private JXPanel
getContent(){
68 JXPanel pan
= new JXPanel();
69 //Color piColor = new Color(231,120,23);
70 //pan.setBackground(piColor.brighter().brighter().brighter());
72 pan
.setBackground(Color
.WHITE
);
73 String xwerte
= "5dlu,fill:0:grow(1.0),5dlu";
75 String ywerte
= "5dlu,p,2dlu,fill:0:grow(1.0),5dlu,p,5dlu";
76 FormLayout lay
= new FormLayout(xwerte
,ywerte
);
77 CellConstraints cc
= new CellConstraints();
80 combo
= new JRtaComboBox();
81 combo
.addActionListener(new ActionListener(){
83 public void actionPerformed(ActionEvent arg0
) {
84 SwingUtilities
.invokeLater(new Runnable(){
86 macheHtml(combo
.getSelectedIndex(),null);
91 pan
.add(combo
,cc
.xy(2,2,CellConstraints
.FILL
,CellConstraints
.FILL
));
92 htmlPane
= new JEditorPane();
93 htmlPane
.setContentType("text/html");
94 htmlPane
.setEditable(false);
95 htmlPane
.setOpaque(false);
96 pan
.add(htmlPane
,cc
.xy(2,4,CellConstraints
.FILL
,CellConstraints
.FILL
));
98 pan
.add( (buts
[0] = ButtonTools
.macheButton("Einweisungsunterlagen einlesen", "einlesen", al
)) ,cc
.xy(2,6));
103 private void holePatienten(){
104 nachrichtenvec
= SqlInfo
.holeFelder("select * from dta301 where id ='"+this.nachrichtenid
+"' LIMIT 1");
105 String
[] patdaten
= nachrichtenvec
.get(0).get(22).split("#");
106 String cmd
= "select concat(n_name,', ',v_name) as name,geboren,strasse,plz,ort,pat_intern,id from pat5 where n_name='"+StringTools
.Escaped(patdaten
[1])+"' and "+
107 "v_name='"+StringTools
.Escaped(patdaten
[2])+"' and geboren = '"+patdaten
[3]+"'";
109 patvec
= SqlInfo
.holeFelder(cmd
);
110 for(int i
= 0; i
< patvec
.size();i
++){
111 combo
.addItem(StringTools
.EGross((String
) patvec
.get(i
).get(0))+" - "+Integer
.toString(i
+1));
113 macheHtml(combo
.getSelectedIndex(),nachrichtenvec
);
115 private void macheHtml(int item
,Vector
<Vector
<String
>> nachricht
){
116 Vector
<Vector
<String
>> pnachricht
= null;
118 pnachricht
= SqlInfo
.holeFelder("select * from dta301 where id ='"+this.nachrichtenid
+"' LIMIT 1");
120 pnachricht
= nachricht
;
122 String vart
= pnachricht
.get(0).get(25);
123 verordnungsart
= "unbekannt";
124 if(vart
.equals("MED")){
125 verordnungsart
= "medizinische Reha";
126 }else if(vart
.equals("AR")){
127 verordnungsart
= "Anschlußheilbehandlung";
128 }else if(vart
.equals("NACHSORGE")){
129 verordnungsart
= "Reha-Nachsorge";
131 eilfall
= pnachricht
.get(0).get(24);
134 String html
= "<html><font face=\"Tahoma\"><br><b>"+StringTools
.EGross(patvec
.get(item
).get(0))+"<br><br>"+
135 DatFunk
.sDatInDeutsch(patvec
.get(item
).get(1))+"<br><br>"+
136 StringTools
.EGross(patvec
.get(item
).get(2))+"<br><br>"+
137 StringTools
.EGross(patvec
.get(item
).get(3))+" "+StringTools
.EGross(patvec
.get(item
).get(4))+"<br><br>"+
138 verordnungsart
+"<br>"+eilfall
+"</b></font></html>";
139 htmlPane
.setText(html
);
141 private void activateListener(){
142 al
= new ActionListener(){
144 public void actionPerformed(ActionEvent arg0
) {
145 String cmd
= arg0
.getActionCommand();
146 if(cmd
.equals("einlesen")){
147 //eltern.doSetPatientFuerNachricht(patvec.get(combo.getSelectedIndex()).get(5));