public static HttpServletRequest addBill(HttpServletRequest request){
        Models.DatabaseModel.Bill bill = new Models.DatabaseModel.Bill();
        Models.DatabaseModel.Patient patient = new Models.DatabaseModel.Patient();
        int patientID;
        if (request.getParameter("patientID") == null){
            patientID = patient.addPatient(request.getParameter("patientName"));
        } else {
            patientID = Integer.parseInt(request.getParameter("patientID"));
        }
        patient = patient.findPatient(patientID);
        
        int billID = bill.addBill(patientID, Integer.parseInt(request.getParameter("consultationCost")));
        bill = bill.findBill(billID);
        Models.ViewModel.Bill billView = new Models.ViewModel.Bill(bill, patient, bill.getBillTotalCost(billID));

        ArrayList<Models.DatabaseModel.BillItem> billItems = Models.DatabaseModel.BillItem.listBillItems(bill.getId());
        ArrayList<Models.DatabaseModel.Medicine> medicines = Models.DatabaseModel.Medicine.listMedicines();

        billView.setMedicines(medicines);
        billView.setBillItems(getBillItems(billItems, medicines));

        request.setAttribute("billView", billView);
        request.setAttribute("view", "billview.jsp");
        return request;
    }