public static void main(String[] args) { /* HourlyEmployee joe = new HourlyEmployee("Joe Worker", new Date("January", 1, 2004), 50.50, 160); System.out.println("joe's longer name is " + joe.getName( )); System.out.println("Changing joe's name to Josephine."); joe.setName("Josephine"); System.out.println("joe's record is as follows:"); System.out.println(joe); */ Doctor bob = new Doctor("Joe Worker", new Date("January", 1, 2004), 150000.00, "Physician", 49.99); System.out.println(bob.toString()); }
/** @return total value of registration owed to the council */ private double totalRegistrationOwed() { double totalRegistration = 0; for (Doctor doctor : doctors) { totalRegistration += doctor.calculateRegistrationFee(); } return totalRegistration; }
/** @return total value of registration owed to the council by Specialists */ private double totalSpecialistRegistrationOwed() { double totalSpecialistRegistration = 0; for (Doctor doctor : doctors) { if (doctor instanceof Specialist) { totalSpecialistRegistration += doctor.calculateRegistrationFee(); } } return totalSpecialistRegistration; }
/** @return total value of registration owed to the council by General doctors */ private double totalGeneralRegistrationOwed() { double totalGeneralRegistration = 0; for (Doctor doctor : doctors) { if (doctor instanceof General) { totalGeneralRegistration += doctor.calculateRegistrationFee(); } } return totalGeneralRegistration; }
/** @return total value of registration owed to the council by Interns */ private double totalInternRegistrationOwed() { double totalInternRegistration = 0; for (Doctor doctor : doctors) { if (doctor instanceof Internship) { totalInternRegistration += doctor.calculateRegistrationFee(); } } return totalInternRegistration; }
/** * @return String containing names of all doctors in ascending order or "There are no doctors in * the Council" String, if no doctors */ public String allDoctors() { if (doctors.size() == 0) { return "There are no doctors in the Council"; } else { String doctorsNames = "\n"; sortDoctors(); doctorsNames += "Doctors in the council:\n"; for (Doctor doctor : doctors) { doctorsNames += "\t" + doctor.getName() + "\n"; } return doctorsNames; } }
public String showMedicalHistory() throws Exception { client = ClientDao.getClientById(getId()); medicalHistory = MedicalHistoryDao.getMedicalHistoryByClientId(client.getId()); visitsList = VisitDao.getVisitsListByMedicalHistoryId(medicalHistory.getId()); for (Visit visit : visitsList) { Order order = OrderDao.getOrderById(visit.getOrderId()); Doctor doctor = DoctorDao.getDoctorById(order.getDoctorId()); visit.setDoctorFullname(doctor.getFullname()); visit.setDoctorSpeciality(doctor.getSpeciality()); visit.setDate(UnixTimeConverter.convertUnixTimeToTime(order.getDate(), "yyyy-MM-dd")); } return Action.SUCCESS; }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.my_test); Intent i = getIntent(); doctor = (Doctor) i.getSerializableExtra("doc_details"); TextView name = (TextView) findViewById(R.id.detail_name); name.setText(doctor.getDoctor_name()); TextView category = (TextView) findViewById(R.id.detail_field); category.setText(doctor.getCaregory()); TabLayout tabLayout = (TabLayout) findViewById(R.id.tab_layout); tabLayout.addTab(tabLayout.newTab().setText("Details")); tabLayout.addTab(tabLayout.newTab().setText("Chambers")); tabLayout.addTab(tabLayout.newTab().setText("Comment")); tabLayout.setTabGravity(TabLayout.GRAVITY_FILL); final ViewPager viewPager = (ViewPager) findViewById(R.id.pager); final ViewPagerTabFragmentAdapter adapter = new ViewPagerTabFragmentAdapter( doctor, getSupportFragmentManager(), tabLayout.getTabCount()); viewPager.setAdapter(adapter); viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout)); tabLayout.setOnTabSelectedListener( new TabLayout.OnTabSelectedListener() { @Override public void onTabSelected(TabLayout.Tab tab) { viewPager.setCurrentItem(tab.getPosition()); } @Override public void onTabUnselected(TabLayout.Tab tab) {} @Override public void onTabReselected(TabLayout.Tab tab) {} }); }
/** * return String representation of MedicalCouncil, namely full details of all doctors or String * indicating that there are no doctors, if doctors size is 0 */ public String toString() { if (doctors.size() == 0) { return "There are no doctors in the council"; } else { String allDoctors = "Doctors in the council: "; for (Doctor doctor : doctors) { allDoctors += doctor.toString(); } allDoctors += "\nTotal Amount of Registration Owed To The Council is: " + totalRegistrationOwed() + "\nTotal Amount of Registration Owed By Interns is: " + +totalInternRegistrationOwed() + "\nTotal Amount of Registration Owed By General Doctors is: " + totalGeneralRegistrationOwed() + "\nTotal Amount of Registration Owed By Specialist Doctors is: " + totalSpecialistRegistrationOwed(); return allDoctors; } }
public Doctor removeDoctor(Doctor doctor) { getDoctors().remove(doctor); doctor.setSpeciality(null); return doctor; }
public Doctor addDoctor(Doctor doctor) { getDoctors().add(doctor); doctor.setSpeciality(this); return doctor; }
public Billing(Doctor theDoctor, Patient thePatient) { aDoctor = theDoctor.getName(); aPatient = thePatient.getName(); billingAmount = theDoctor.getOfficeFee(); }