1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610
|
import javax.swing.event.*; import java.awt.event.*; import javax.swing.*; import java.awt.*; import javax.swing.JTable; import javax.swing.table.*; public class EMS_Incident extends JPanel implements ActionListener { GridBagConstraints gbc = new GridBagConstraints(); String strQuery = new String(); JTextField incidentnumber = new JTextField(6); JComboBox dayBox = new JComboBox(); JComboBox monthBox = new JComboBox(); JComboBox yearBox = new JComboBox(); JComboBox ambulanceBox = new JComboBox(); JTextField badge = new JTextField (7); JLabel incidentnumberLabel = new JLabel ("Incident Number:"); JLabel dateLabel = new JLabel ("Date:"); JLabel ambulanceLabel = new JLabel ("Ambulance:"); JLabel badgeLabel = new JLabel ("Badge:"); JTextField location = new JTextField (20); JTextField complaint = new JTextField (20); JLabel locationLabel = new JLabel ("Location Of Incident:"); JLabel complaintLabel = new JLabel ("Chief Complaint:"); JTextField timeofcall = new JTextField (3); JTextField mob = new JTextField(3); JTextField ia = new JTextField (3); JTextField ls = new JTextField (3); JTextField ah = new JTextField (3); JComboBox hospitalBox = new JComboBox(); JTextField mav = new JTextField (3); JTextField cd = new JTextField (3); JLabel timeofcallLabel = new JLabel ("Time Of Call:"); JLabel mobLabel = new JLabel ("Mob:"); JLabel iaLabel = new JLabel ("Ia:"); JLabel lsLabel = new JLabel ("Ls:"); JLabel ahLabel = new JLabel ("Ah:"); JLabel hospLabel = new JLabel ("Hosp:"); JLabel mavLabel = new JLabel ("Mav:"); JLabel cdLabel = new JLabel ("Cd:"); JRadioButton[] d = new JRadioButton[1]; ButtonGroup group = new ButtonGroup(); JLabel surnameLabel = new JLabel ("Surname:"); JLabel firstnameLabel = new JLabel ("First Name:"); JTextField surname = new JTextField (15); JTextField firstname = new JTextField (15);
JRadioButton[] disposition = new JRadioButton[12]; JLabel dispositionLabel = new JLabel ("Disposition:"); JComboBox genderBox = new JComboBox(); JComboBox birthdayBox = new JComboBox(); JComboBox birthmonthBox = new JComboBox(); JComboBox birthyearBox = new JComboBox(); JLabel genderLabel = new JLabel ("Gender:"); JLabel dateofbirthLabel = new JLabel ("Date Of Birth:");
JComboBox foundBox = new JComboBox(); JComboBox agentBox = new JComboBox(); JComboBox vehicle1Box = new JComboBox(); JComboBox vehicle2Box = new JComboBox(); JLabel historyLabel = new JLabel ("Patient History:"); JLabel foundLabel = new JLabel ("Found:"); JLabel agentLabel = new JLabel ("Agent Of Injury:"); JLabel vehicleLabel = new JLabel ("Patient was:"); JLabel vehicle1Label = new JLabel ("In/On/Under:"); JLabel vehicle2Label = new JLabel ("Involved With:"); JList historylist; private String histories [] = {"Cancer","CVA/Stroke","Diabetes","C.O.A.D.", "Seizure Disorder","Heart Condition"}; JList vehiclelist; private String vehicles [] = {"Driver","Passenger","Pedestrian","Helmut Worn", "Seat Belt Worn","Infant Seat Used"};
JComboBox injuryBox = new JComboBox(); JComboBox actionBox = new JComboBox(); JComboBox levelBox = new JComboBox(); JLabel actionLabel = new JLabel ("Bystander Action:"); JLabel levelLabel = new JLabel ("Consiousness Level:"); JLabel pupilsLabel = new JLabel ("Pupils:"); JLabel skinconLabel = new JLabel ("Skin Condition:"); JLabel skincolLabel = new JLabel ("Skin Colour:"); JLabel injuryLabel = new JLabel ("Other Injuries:"); JList pupilslist; private String pupils [] = {"EQUAL","REACTIVE","UNREACTIVE","DILATED","MIDPOINT", "CONSTRICTED"}; JList skinconlist; private String skincons [] = {"WET","DRY","WARM","COLD","HOT","NORMAL"}; JList skincollist; private String skincols [] = {"NORMAL","FLUSHED","PALE","CYANOTIC"};
final JTable table; JList mylist; private String mys [] = {"AIRWAY EMERGENCY","RESPIRATORY EMERGENCY","RESPIRATORY ARREST", "CARDIC EMERGENCY","CARDIAC ARREST","SHOCK","STROKE/CVA","SEIZURE","OVERDOSE", "POISONING","DRUG/ALCOHOL","DIABETIC EMERGENCY","ENVIRONMENTAL","NEONATE", "BEHAVIOURAL PROBLEMS","ABDOMINAL DISTRESS"}; JList carelist; private String cares [] = {"O2 THERAPY","AIRWAY MANOEUVRE","AIRWAY ADJUNCT", "VENTILATE","SUCTION","CPR","SAED","DEFIB","ENTONOX","BLEEDING CONTROL", "DRESSING","BURN DRESSING","CERVICAL COLLAR","KED","BACKBOARD","RESTRAINTS", "HEAD RESTRAINTS","SPLINT","TRACTION","OB DELIVERY"};
Icon quitbug = new ImageIcon("door.gif"); Icon submitbug = new ImageIcon("satelite.gif"); Icon clearfieldsbug = new ImageIcon("trash.gif"); Icon menubug = new ImageIcon("inventory.gif");
JButton quit = new JButton ("Quit",quitbug); JButton submit = new JButton ("Submit",submitbug); JButton clearfields = new JButton ("ClearFields",clearfieldsbug); JFrame f = new JFrame("Fire and Emergency Medical Services, Logistics, Administration and Mobilization.");
public EMS_Incident(){
//////////////////////// //make the general row// ////////////////////////
JPanel generalRow = new JPanel(); generalRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),"Incident Details"));
gbc.fill = GridBagConstraints.BOTH; gbc.weightx = 1.0; gbc.weighty = 1.0;
addGB(generalRow,incidentnumberLabel, 0, 0); addGB(generalRow,incidentnumber, 1, 0); addGB(generalRow,badgeLabel, 4, 0); addGB(generalRow,badge, 5, 0);
addGB(generalRow,dateLabel, 0, 1); addGB(generalRow,dayBox, 1, 1); dayBox.addItem("DAY"); for (int j=1; j<32; j++) dayBox.addItem("" + j); addGB(generalRow,monthBox, 2, 1); monthBox.addItem("MONTH"); for (int k=1; k<13; k++) monthBox.addItem("" + k); addGB(generalRow,yearBox, 3, 1); yearBox.addItem("YEAR"); for (int l=2001; l<2011; l++) yearBox.addItem("" + l);
addGB(generalRow,ambulanceLabel, 4, 1); addGB(generalRow,ambulanceBox, 5, 1); ambulanceBox.addItem("AMBO"); for (int m=1; m<12; m++) ambulanceBox.addItem("D" + m +"4"); addGB(generalRow,hospLabel, 6, 1); hospitalBox.addItem("Hosp"); hospitalBox.addItem("Ma"); hospitalBox.addItem("Jcm"); hospitalBox.addItem("Ja"); hospitalBox.addItem("Ta"); hospitalBox.addItem("Be"); hospitalBox.addItem("Te"); hospitalBox.addItem("Ol"); hospitalBox.addItem("Ro"); hospitalBox.addItem("Ho"); hospitalBox.addItem("Co"); addGB(generalRow,hospitalBox, 7, 1); addGB(this, generalRow, 0, 0);
JPanel general1Row = new JPanel(); general1Row.setBorder(BorderFactory.createEtchedBorder());
JPanel locationRow = new JPanel(); locationRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Location / Complaint Details"));
addGB(locationRow,locationLabel, 0, 0); addGB(locationRow,location, 0, 1); addGB(locationRow,complaintLabel, 0, 2); addGB(locationRow,complaint, 0, 3); addGB(general1Row,locationRow, 0, 0);
JPanel timeRow = new JPanel(); timeRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Incident Times"));
addGB(timeRow,timeofcallLabel, 0, 0); addGB(timeRow,timeofcall, 1, 0); addGB(timeRow,mobLabel, 0, 1); addGB(timeRow,mob, 1, 1); addGB(timeRow,iaLabel, 0, 2); addGB(timeRow,ia, 1, 2); addGB(timeRow,lsLabel, 0, 3); addGB(timeRow,ls, 1, 3); addGB(timeRow,ahLabel, 2, 0); addGB(timeRow,ah, 3, 0); addGB(timeRow,mavLabel, 2, 1); addGB(timeRow,mav, 3, 1); addGB(timeRow,cdLabel, 2, 2); addGB(timeRow,cd, 3, 2); addGB(timeRow,new JLabel("R/T:"), 2, 3); d[0] = new JRadioButton (""); group.add (d[0]); addGB(timeRow,d[0], 3, 3); addGB(general1Row,timeRow, 1, 0);
addGB(this, general1Row, 0, 1);
//////////////////////// //make the patient row// ////////////////////////
JPanel patientRow = new JPanel(); patientRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Patient Details"));
addGB(patientRow,surnameLabel, 0, 0); addGB(patientRow,surname, 1, 0); addGB(patientRow,firstnameLabel, 4, 0); addGB(patientRow,firstname, 5, 0);
addGB(patientRow,dateofbirthLabel, 0, 1); birthdayBox.setMaximumRowCount(2); birthmonthBox.setMaximumRowCount(2); birthyearBox.setMaximumRowCount(2); addGB(patientRow,birthdayBox, 1, 1); birthdayBox.addItem("Day"); for (int o=1; o<32; o++) birthdayBox.addItem("" + o); addGB(patientRow,birthmonthBox, 2, 1); birthmonthBox.addItem("Month"); for (int p=1; p<13; p++) birthmonthBox.addItem("" + p); addGB(patientRow,birthyearBox, 3, 1); birthyearBox.addItem("Year"); for (int q=1900; q<2002; q++) birthyearBox.addItem("" + q);
addGB(patientRow,genderLabel, 4, 1); genderBox.addItem("Gender"); genderBox.addItem("Male"); genderBox.addItem("Female"); addGB(patientRow,genderBox, 5, 1); addGB(patientRow,dispositionLabel, 0, 2); disposition[0] = new JRadioButton ("B.I.D."); addGB(patientRow,disposition[0], 1, 2); disposition[1] = new JRadioButton ("Transport"); addGB(patientRow,disposition[1], 2, 2); disposition[2] = new JRadioButton ("Cancelled"); addGB(patientRow,disposition[2], 3, 2); disposition[3] = new JRadioButton ("False"); addGB(patientRow,disposition[3], 4, 2); disposition[4] = new JRadioButton ("Fire"); addGB(patientRow,disposition[4], 5, 2); disposition[5] = new JRadioButton ("Refusal"); addGB(patientRow,disposition[5], 6, 2); disposition[6] = new JRadioButton ("Minor Medical"); addGB(patientRow,disposition[6], 1, 3); disposition[7] = new JRadioButton ("Major Medical"); addGB(patientRow,disposition[7], 2, 3); disposition[8] = new JRadioButton ("Minor Trauma"); addGB(patientRow,disposition[8], 3, 3); disposition[9] = new JRadioButton ("Major Trauma"); addGB(patientRow,disposition[9], 4, 3); disposition[10] = new JRadioButton ("No Service"); addGB(patientRow,disposition[10], 5, 3); disposition[11] = new JRadioButton ("Other"); addGB(patientRow,disposition[11], 6, 3); for (int i=0; i<disposition.length; i++){ group.add(disposition[i]); } addGB(this, patientRow, 0, 2);
//////////////////////// //make the history row// ////////////////////////
JPanel historyRow = new JPanel(); historyRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Patient History Details"));
addGB(historyRow,historyLabel, 0, 0); historylist = new JList (histories); historylist.setVisibleRowCount(3); historylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane historyPane = new JScrollPane(historylist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(historyRow,historyPane, 1, 0);
addGB(historyRow,foundLabel, 2, 0); foundBox.setMaximumRowCount(2); foundBox.addItem("Found"); foundBox.addItem("Bed"); foundBox.addItem("Floor"); foundBox.addItem("Road"); foundBox.addItem("Other"); addGB(historyRow,foundBox, 3, 0);
addGB(historyRow,agentLabel, 4, 0); agentBox.setMaximumRowCount(2); agentBox.addItem("Agent Of Injury"); agentBox.addItem("Blunt Object"); agentBox.addItem("Sharp Object/Knife"); agentBox.addItem("Firearm"); agentBox.addItem("Toxin/Drug"); agentBox.addItem("Smoke"); agentBox.addItem("Other"); addGB(historyRow,agentBox, 5, 0);
addGB(historyRow,vehicleLabel, 0, 1); vehiclelist = new JList (vehicles); vehiclelist.setVisibleRowCount(3); vehiclelist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane vehiclePane = new JScrollPane(vehiclelist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(historyRow,vehiclePane, 1, 1);
addGB(historyRow,vehicle1Label, 2, 1); vehicle1Box.setMaximumRowCount(2); vehicle1Box.addItem("In/On/Under"); vehicle1Box.addItem("Car"); vehicle1Box.addItem("Truck/Bus"); vehicle1Box.addItem("Motorcycle"); vehicle1Box.addItem("Fixed Object"); vehicle1Box.addItem("Cycle"); addGB(historyRow,vehicle1Box, 3, 1);
addGB(historyRow,vehicle2Label, 4, 1); vehicle2Box.setMaximumRowCount(2); vehicle2Box.addItem("Involved With"); vehicle2Box.addItem("Car"); vehicle2Box.addItem("Truck/Bus"); vehicle2Box.addItem("Motorcycle"); vehicle2Box.addItem("Fixed Object"); vehicle2Box.addItem("Cycle"); addGB(historyRow,vehicle2Box, 5, 1);
addGB(this, historyRow, 0, 3);
/////////////////////// //make the action row// ///////////////////////
JPanel actionRow = new JPanel(); actionRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Injury / Status Details"));
addGB(actionRow,injuryLabel, 0, 0); injuryBox.setMaximumRowCount(2); injuryBox.addItem("OTHER INJURIES"); injuryBox.addItem("SPORT INJURY"); injuryBox.addItem("ELECTRIC SHOCK"); injuryBox.addItem("FALL"); injuryBox.addItem("FIGHT/VIOLENCE"); injuryBox.addItem("DROWNING"); injuryBox.addItem("FIRE"); injuryBox.addItem("MACHINERY"); injuryBox.addItem("SELF INFLICTED"); injuryBox.addItem("MEDICAL"); injuryBox.addItem("OTHER"); addGB(actionRow,injuryBox, 1, 0);
skinconlist = new JList (skincons); skinconlist.setVisibleRowCount(3); skinconlist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane skinconPane = new JScrollPane(skinconlist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(actionRow,skinconLabel, 2, 0); addGB(actionRow,skinconPane, 3, 0);
skincollist = new JList (skincols); skincollist.setVisibleRowCount(3); skincollist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane skincolPane = new JScrollPane(skincollist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(actionRow,skincolLabel, 4, 0); addGB(actionRow,skincolPane, 5, 0);
addGB(actionRow,actionLabel, 0, 1); actionBox.setMaximumRowCount(2); actionBox.addItem("BYSTANDER ACTION"); actionBox.addItem("CPR"); actionBox.addItem("EXTRICATED"); actionBox.addItem("BANDAGED"); actionBox.addItem("DIA"); addGB(actionRow,actionBox, 1, 1);
addGB(actionRow,levelLabel, 2, 1); levelBox.setMaximumRowCount(2); levelBox.addItem("AVPU SCALE"); levelBox.addItem("ALERT"); levelBox.addItem("VERBAL"); levelBox.addItem("PAIN"); levelBox.addItem("UNRESPONSIVE"); addGB(actionRow,levelBox, 3, 1);
pupilslist = new JList (pupils); pupilslist.setVisibleRowCount(3); pupilslist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane pupilsPane = new JScrollPane(pupilslist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(actionRow,pupilsLabel, 4, 1); addGB(actionRow,pupilsPane, 5, 1);
addGB(this, actionRow, 0, 4);
///////////////////// //make the care row// /////////////////////
JPanel careRow = new JPanel();
JPanel tableRow = new JPanel(); careRow.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Vital Signs - Codes :- (R)Regular,(I)Irregular,(N)Normal,(W)Weak,(S)Shallow,(B)Bounding,(D)Deep"));
String[] headings = new String[] {"Time","Resp Rate","Resp Code","Pulse Rate","Pulse Code","SPO2","B.P."}; Object[][] data = new Object[][] {{"","","","","","","",""},{"","","","","","","",""}}; table = new JTable(data,headings); addGB(tableRow, table.getTableHeader(),0,0); addGB(tableRow,table, 0, 1); table.setVisible(true); addGB(careRow, tableRow, 0, 0);
JPanel care1Row = new JPanel(); care1Row.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Clinical Impression - Pre Hospital Care"));
mylist = new JList (mys); mylist.setVisibleRowCount(3); mylist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane myPane = new JScrollPane(mylist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(care1Row,myPane, 0, 0);
carelist = new JList (cares); carelist.setVisibleRowCount(3); carelist.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION ); JScrollPane carePane = new JScrollPane(carelist, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); addGB(care1Row,carePane, 1, 0);
addGB(careRow, care1Row, 0, 1);
addGB(this, careRow, 0, 5);
///////////////////// //add the fifth row// ///////////////////// JPanel fifthRow = new JPanel();
gbc.fill = GridBagConstraints.HORIZONTAL; addGB(fifthRow, quit, 0, 0); quit.addActionListener(this); addGB(fifthRow, new JLabel(""), 3, 0); addGB(fifthRow, submit, 4, 0); submit.addActionListener(this); addGB(fifthRow, new JLabel(""), 5, 0); addGB(fifthRow, clearfields, 6, 0); clearfields.addActionListener(this);
addGB(this, fifthRow, 0, 6); }
public void actionPerformed(ActionEvent event) { try { String myEvent = event.getActionCommand(); if ( event.getSource() instanceof JButton) { if ( "Quit".equals(myEvent)) { System.exit(0); } if ( "Submit".equals(myEvent)) { Submit s = new Submit(); s.Open();
strQuery = "INSERT INTO ems_details(ems_number,ems_date,badge,ambo,hosp)"; strQuery += "values (" + incidentnumber.getText() + ",'" + dayBox.getSelectedItem() + "/"; strQuery += monthBox.getSelectedItem() + "/" + yearBox.getSelectedItem() + "',"; strQuery += badge.getText() + ",'" + ambulanceBox.getSelectedItem() + "','"; strQuery += hospitalBox.getSelectedItem() + "')"; System.out.println(strQuery); s.Select(strQuery);
strQuery = "INSERT INTO ems_location(ems_number,location,complaint,timeofcall,mob,ia,ls,ah,mav,cd,rt)"; strQuery += "values (" + incidentnumber.getText() + ",'" + location.getText() + "','"; strQuery += complaint.getText() + "','" + timeofcall.getText() + "','" + mob.getText() + "','"; strQuery += ia.getText() + "','" + ls.getText() + "','" + ah.getText() + "','" + mav.getText(); strQuery += "','" + cd.getText() + "','"; if (d[0].isSelected()) strQuery += "Yes')"; else strQuery += "No')"; System.out.println(strQuery); s.Select(strQuery);
strQuery = "INSERT INTO ems_patient(ems_number,name,dob,gender,disposition)"; strQuery += "values (" + incidentnumber.getText() + ",'" + firstname.getText() + " " + surname.getText(); strQuery += "','" + birthdayBox.getSelectedItem() + "/" + birthmonthBox.getSelectedItem() + "/"; strQuery += birthyearBox.getSelectedItem() + "','" + genderBox.getSelectedItem() + "','"; if (disposition[0].isSelected()) strQuery += "B.I.D.')"; else if (disposition[1].isSelected()) strQuery += "Transport')"; else if (disposition[2].isSelected()) strQuery += "Cancelled')"; else if (disposition[3].isSelected()) strQuery += "False')"; else if (disposition[4].isSelected()) strQuery += "Fire')"; else if (disposition[5].isSelected()) strQuery += "Refusal')"; else if (disposition[6].isSelected()) strQuery += "Minor Medical')"; else if (disposition[7].isSelected()) strQuery += "Major Medical')"; else if (disposition[8].isSelected()) strQuery += "Minor Trauma')"; else if (disposition[9].isSelected()) strQuery += "Major Trauma')"; else if (disposition[10].isSelected()) strQuery += "No Service')"; else if (disposition[11].isSelected()) strQuery += "Other')"; System.out.println(strQuery); s.Select(strQuery);
strQuery = "INSERT INTO ems_patient_history(ems_number,history,found,agent,rta)"; strQuery += "values (" + incidentnumber.getText() + ",'" + historylist.getSelectedValue() + "','"; strQuery += foundBox.getSelectedItem() + "','" + agentBox.getSelectedItem() + "','"; strQuery += vehiclelist.getSelectedValue() + " - " + vehicle1Box.getSelectedItem() + " - "; strQuery += vehicle2Box.getSelectedItem() + "')"; System.out.println(strQuery); s.Select(strQuery); strQuery = "INSERT INTO ems_patient_status(ems_number,other_inj,skin,bystander,avpu,pupils)"; strQuery += "values (" + incidentnumber.getText() + ",'" + injuryBox.getSelectedItem() + "','"; strQuery += skinconlist.getSelectedValue() + " - " + skincollist.getSelectedValue() + "','"; strQuery += actionBox.getSelectedItem() + "','" + levelBox.getSelectedItem() + "','"; strQuery += pupilslist.getSelectedValue() + "')"; System.out.println(strQuery); s.Select(strQuery);
strQuery = "INSERT INTO ems_patient_vitals(ems_number,vitals)"; strQuery += "values (" + incidentnumber.getText() + ",'" + table.getValueAt(0,0) + " , "; strQuery += table.getValueAt(0,1) + "" + table.getValueAt(0,2) + " , " + table.getValueAt(0,3); strQuery += table.getValueAt(0,4) + " , " + table.getValueAt(0,5) + " , " + table.getValueAt(0,6); strQuery += " - " + table.getValueAt(1,0) + " , "; strQuery += table.getValueAt(1,1) + "" + table.getValueAt(1,2) + " , " + table.getValueAt(1,3); strQuery += table.getValueAt(1,4) + " , " + table.getValueAt(1,5) + " , " + table.getValueAt(1,6); strQuery += "')"; System.out.println(strQuery); s.Select(strQuery);
strQuery = "INSERT INTO ems_patient_impression(ems_number,impression,treatment)"; strQuery += "values (" + incidentnumber.getText() + ",'" + mylist.getSelectedValue(); strQuery += "','" + carelist.getSelectedValue() + "')"; System.out.println(strQuery); s.Select(strQuery);
s.Close(); } if ("ClearFields".equals(myEvent)) { incidentnumber.setText(""); badge.setText(""); location.setText(""); complaint.setText(""); timeofcall.setText(""); mob.setText(""); ia.setText(""); ls.setText(""); ah.setText(""); mav.setText(""); cd.setText(""); surname.setText(""); firstname.setText(""); } } } catch (Exception e) { System.out.println("An Error has occured at ListenForButtonPress :"+e.toString()); } }
void addGB(Container cont, Component comp, int x, int y) { if ((cont.getLayout( ) instanceof GridBagLayout) == false) cont.setLayout(new GridBagLayout( )); gbc.gridx = x; gbc.gridy = y; cont.add(comp, gbc); }
public static void main(String[] args){ JFrame f = new JFrame("Ambulance Service Pre-Hospital Care Report Form"); f.addWindowListener(new WindowAdapter(){ public void windowClosing(WindowEvent e) { System.exit(0); } }); f.setSize(1024,768); f.setLocation(0,0); f.setContentPane(new EMS_Incident()); f.setVisible(true); } } |