Package org.rioproject.examples.hospital

Examples of org.rioproject.examples.hospital.Patient


                Patient.PatientInfo pInfo =
                    new Patient.PatientInfo(name.getText(),
                                            (String) gender.getSelectedItem(),
                                            birthDay);
                Patient patient = new Patient(pInfo);
                if(listener!=null)
                    listener.patientCreated(patient);
                name.setText("");
                years.setText(null);
                days.removeAllItems();
View Full Code Here


                    String name = getRandomName(fNames, rand)+" "+getRandomName(LAST_NAMES, rand);
                    Patient.PatientInfo pInfo =
                        new Patient.PatientInfo(name,
                                                gender,
                                                createRandomBirthday(rand));
                    Patient patient = new Patient(pInfo);
                    if(listener!=null)
                        listener.patientCreated(patient);
                }

            }
View Full Code Here

            private void showPopup(MouseEvent e, final int row) {
                JPopupMenu popup = new JPopupMenu();
                JMenuItem checkout = new JMenuItem("Check Patient Out");
                checkout.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent ae) {
                        Patient p = patientModel.getPatient(row);
                        if(p!=null) {
                            try {
                                p = h.release(p);
                                if(p!=null && listener!=null) {
                                    patientModel.removePatient(row);
View Full Code Here

            return columnNames[col];
        }

        public Object getValueAt(int row, int col) {
            Object value = null;
            Patient p;
            synchronized(patients) {
                p = patients.get(row);
            }
            switch(col) {
                case 0:
                    value = p.getPatientInfo().getName();
                    break;
                case 1:
                    value = p.getPatientInfo().getAge();
                    break;
                case 2:
                    value = p.getPatientInfo().getGender();
                    break;
                case 3:
                    try {
                        value = p.getBed().getRoomNumber();
                    } catch (IOException e) {
                        value = e.getClass().getName()+": "+e.getLocalizedMessage();
                    }
                    break;
                case 4:
                    try {
                        value = p.getDoctor().getName();
                    } catch (IOException e) {
                        value = e.getClass().getName()+": "+e.getLocalizedMessage();
                    }
            }
            return value;
View Full Code Here

        b.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
                Bed bed = findSelectedBed((JButton) actionEvent.getSource());
                if(bed!=null) {
                    try {
                        Patient p = bed.getPatient();
                        if(p!=null && listener!=null) {
                            listener.patientSelected(p);
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
View Full Code Here

    public Patient removePatient() {
        if(scheduler!=null)
            scheduler.shutdownNow();
        scheduler = null;
        Patient p = new Patient(patient.getPatientInfo());
        p.setDoctor(patient.getDoctor());
        p.setBed(patient.getBed());
        patient = null;
        return p;
    }
View Full Code Here

TOP

Related Classes of org.rioproject.examples.hospital.Patient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.