Class Hospital
java.lang.Object
cz.cuni.kubinja.hospitalsystem.Hospital
Hospital system for managing patients, doctors and appointments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAppointment(AppointmentData appointmentData) Adds new appointment into the system.addDoctor(DoctorData doctorData) Adds new doctor into the system.addPatient(PatientData patientData) Adds new patient into hospital system.Returns list of information about every doctor in the system.Returns list of information about every patient in the system.delete()Deletes all data from hospital system.deleteAppointment(int id) Deletes appointment with provided id.deleteDoctor(int id) Deletes doctor with provided id.deletePatient(int id) Deletes patient with provided id.export()Exports all hospital system into CSV files (patients, doctors, appointments - one file for each)Exports appointments into file in CSV format.Exports doctors into file in CSV format.Exports patients into file in CSV formatgetAllDoctorsWithName(String firstName, String lastName) Returns list of doctors with provided first name and last name.getAllPatientWithName(String firstName, String lastName) Returns list of patients with the provided first name and last name.getAppointment(int id) Returns appointment with the provided id.getAppointmentsForPersonnel(int id, PersonKinds kind) Returns list of all appointments connected to the person with provided id and kind.Returns calendar for the hospital.getCalendarForDepartment(String department, boolean fromToday) Returns string representing calendar for the provided department.getCalendarRepresentation(boolean fromToday) Returns list of strings representing the calendar of the whole hospital.getDoctor(int id) Returns object representing doctor with provided id.getPatient(int id) Returns info about patient with provided id.updateAppointment(Appointment appointment) Updates information about appointment with provided id and based on provided new data.updateDoctor(Doctor doctor) Updates information about doctor with provided id and based on provided new data.updatePatient(Patient patient) Updates information about patient with provided id and based on provided new data.
-
Constructor Details
-
Hospital
Creates Hospital which content is based on the data in provided database.- Parameters:
databasePath- Path to the database.- Throws:
DatabaseException- Errors connected to the unability to open/create database.
-
-
Method Details
-
addPatient
Adds new patient into hospital system.- Parameters:
patientData- Patients data which describes new patient.- Returns:
- Data packet providing caller with information about successfulness of the query. And also contains object of the patient with provided ID.
-
getPatient
Returns info about patient with provided id.- Parameters:
id- Id that identifies patient.- Returns:
- Data packet providing caller with information about successfulness of the query. And also contains object of the patient with provided ID.
-
getAllPatientWithName
Returns list of patients with the provided first name and last name.- Parameters:
firstName- First name of the patient.lastName- Last name of the patient.- Returns:
- List of patients with the provided first and last name.
-
updatePatient
Updates information about patient with provided id and based on provided new data.- Parameters:
patient- State to which will be patient changed.- Returns:
- General packet which provide caller with information about successfulness of the update.
-
deletePatient
Deletes patient with provided id.- Parameters:
id- Identifier of the patient that will be removed from the system.- Returns:
- General packet which provide caller with information about successfulness of delete.
-
allPatients
Returns list of information about every patient in the system.- Returns:
- Data packet that provide caller with information about successfulness of the query and provides array of data strings about every patient.
-
addDoctor
Adds new doctor into the system.- Parameters:
doctorData- Doctor data that describes the new doctor.- Returns:
- Data packet that provide caller with information about successfulness of the addition of doctor into the system. And also provides doctor object representing the same doctor.
-
getDoctor
Returns object representing doctor with provided id.- Parameters:
id- Identification number of the required doctor.- Returns:
- Data packet that provide caller with information about successfulness of the query of doctor. And also provides doctor object.
-
getAllDoctorsWithName
Returns list of doctors with provided first name and last name.- Parameters:
firstName- First name of the doctor.lastName- Last name of the doctor.- Returns:
- List of doctors with provided first name and last name.
-
updateDoctor
Updates information about doctor with provided id and based on provided new data.- Parameters:
doctor- State to which will be doctor changed.- Returns:
- General packet which provide caller with information about successfulness of the update.
-
deleteDoctor
Deletes doctor with provided id.- Parameters:
id- Identifier of the doctor that will be removed from the system.- Returns:
- General packet which provide caller with information about successfulness of delete.
-
allDoctors
Returns list of information about every doctor in the system.- Returns:
- Data packet that provide caller with information about successfulness of the query and provides array of data strings about every doctor.
-
addAppointment
Adds new appointment into the system.- Parameters:
appointmentData- Calendar Entry data that describes the new appointment.- Returns:
- General packet that provide caller with the information whether the addition of the appointment into the system was successful.
-
getAppointment
Returns appointment with the provided id.- Parameters:
id- Identifier of the appointment.- Returns:
- General packet which provides caller with the information about successfulness of the query. And provides the object of the appointment.
-
updateAppointment
Updates information about appointment with provided id and based on provided new data.- Parameters:
appointment- State to which will be appointment changed.- Returns:
- General packet which provide caller with information about successfulness of the update.
-
deleteAppointment
Deletes appointment with provided id.- Parameters:
id- Identifier of the appointment that will be removed from the system.- Returns:
- General packet which provide caller with information about successfulness of delete.
-
getAppointmentsForPersonnel
Returns list of all appointments connected to the person with provided id and kind.- Parameters:
id- Identification number of the person.kind- Kind of person.- Returns:
- List of all appointment connected to the person with provided id and kind.
-
getCalendarForDepartment
Returns string representing calendar for the provided department.- Parameters:
department- Name of department.fromToday- Denotes whether calendar will be exported whole or only appointments in the present and future.- Returns:
- String representing calendar for the provided department.
-
getCalendarRepresentation
Returns list of strings representing the calendar of the whole hospital.- Parameters:
fromToday- Denotes whether calendar will be exported whole or only appointments in the present and future.- Returns:
- list of strings representing the calendar of the whole hospital.
-
getCalendar
Returns calendar for the hospital.- Returns:
- Calendar for the hospital.
-
exportPatients
Exports patients into file in CSV format- Returns:
- General packet providing caller with the information about successfulness of the export.
-
exportDoctors
Exports doctors into file in CSV format.- Returns:
- General packet providing caller with the information about successfulness of the export.
-
exportAppointments
Exports appointments into file in CSV format.- Returns:
- General packet providing caller with the information about successfulness of the export.
-
export
Exports all hospital system into CSV files (patients, doctors, appointments - one file for each)- Returns:
- General packet providing caller with the information about successfulness of the export.
-
delete
Deletes all data from hospital system.For the purpose of the unit testing to ensure same database for tests.
- Returns:
- General packet providing caller with the information about successfulness of the cleanup.
-