Skip to content

Commit 5ee1b27

Browse files
authored
Merge pull request #6 from 135dragon/135dragon-patch-1
Billing Cosmetic Overhaul
2 parents 8ce8d83 + 96d1a8c commit 5ee1b27

File tree

7 files changed

+76
-38
lines changed

7 files changed

+76
-38
lines changed

RIS/src/main/java/aasim/ris/Administrator.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ private void createTableUsers() {
165165
buttonCol.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
166166

167167
//Couldn't put all the styling
168-
pfpCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
169-
userIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
168+
pfpCol.prefWidthProperty().bind(table.widthProperty().multiply(0.03));
169+
userIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
170170
emailCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
171171
fullNameCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
172172
usernameCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
173173
roleCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
174-
enabledCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
174+
enabledCol.prefWidthProperty().bind(table.widthProperty().multiply(0.04));
175175
buttonCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
176176
table.setStyle("-fx-background-color: #25A18E; -fx-text-fill: WHITE; ");
177177
//Together again
@@ -511,7 +511,7 @@ private void createTablePatients() {
511511
insuranceCol.setCellValueFactory(new PropertyValueFactory<>("insurance"));
512512

513513
//Couldn't put the table
514-
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
514+
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
515515
fullNameCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
516516
emailCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
517517
DOBCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
@@ -635,8 +635,8 @@ private void createTableAppointments() {
635635
status.setCellValueFactory(new PropertyValueFactory<>("status"));
636636

637637
//Set Column Widths
638-
apptIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
639-
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.04));
638+
apptIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
639+
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
640640
firstNameCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
641641
timeCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
642642
orderCol.prefWidthProperty().bind(table.widthProperty().multiply(0.4));
@@ -748,7 +748,7 @@ private void createTableModalities() {
748748
costCol.setCellValueFactory(new PropertyValueFactory<>("cost"));
749749

750750
//Couldn't put all the styling
751-
orderIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
751+
orderIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
752752
orderCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
753753
buttonCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
754754
//Together again
@@ -828,6 +828,9 @@ private void addModality() {
828828
submit.setOnAction(new EventHandler<ActionEvent>() {
829829
@Override
830830
public void handle(ActionEvent eh) {
831+
if (!InputValidation.validatePayment(cost.getText())) {
832+
return;
833+
}
831834
String sql = "INSERT INTO orderCodes(orders,cost) VALUES ('" + order.getText() + "','" + cost.getText() + "') ;";
832835
App.executeSQLStatement(sql);
833836
populateTableModalities();
@@ -877,7 +880,7 @@ private void createTablePatientAlerts() {
877880
buttonCol.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
878881

879882
//Couldn't put all the styling
880-
alertIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
883+
alertIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
881884
alertCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
882885
flagsCol.prefWidthProperty().bind(table.widthProperty().multiply(0.5));
883886
buttonCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));

RIS/src/main/java/aasim/ris/Billing.java

Lines changed: 51 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ public class Billing extends Stage {
6666
TextField search = new TextField("Search Appointments");
6767

6868
//Buttons
69-
Button addBilling = new Button("Add Bill");
7069
Button refreshTable = new Button("Refresh Appointments");
7170
//Containers
7271
HBox searchContainer = new HBox(choiceBox, search);
73-
HBox buttonContainer = new HBox(addBilling, refreshTable, searchContainer);
72+
HBox buttonContainer = new HBox(refreshTable, searchContainer);
7473
VBox tableContainer = new VBox(table, buttonContainer);
7574

7675
//</editor-fold>
@@ -107,12 +106,7 @@ public void handle(ActionEvent e) {
107106
// addAppointment();
108107
// }
109108
// });
110-
addBilling.setOnAction(new EventHandler<ActionEvent>() {
111-
@Override
112-
public void handle(ActionEvent e) {
113-
addBilling();
114-
}
115-
});
109+
116110
refreshTable.setOnAction(new EventHandler<ActionEvent>() {
117111
@Override
118112
public void handle(ActionEvent e) {
@@ -193,13 +187,13 @@ private void loadCenter() {
193187
delAppt.setCellValueFactory(new PropertyValueFactory<>("placeholder1"));
194188
makePayment.setCellValueFactory(new PropertyValueFactory<>("button"));
195189
//Set Column Widths
196-
apptIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
197-
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.04));
190+
apptIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
191+
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
198192
firstNameCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
199193
timeCol.prefWidthProperty().bind(table.widthProperty().multiply(0.06));
200194
orderCol.prefWidthProperty().bind(table.widthProperty().multiply(0.2));
201-
updateAppt.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
202-
status.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
195+
updateAppt.prefWidthProperty().bind(table.widthProperty().multiply(0.08));
196+
status.prefWidthProperty().bind(table.widthProperty().multiply(0.08));
203197
totalCost.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
204198

205199
//Add columns to table
@@ -303,10 +297,6 @@ private void logOut() {
303297
// }
304298
//On button press, open up a new stage (calls private nested class)
305299

306-
private void addBilling() {
307-
308-
}
309-
310300
private float calculateTotalCost(Appointment appt) {
311301

312302
String sql = "Select orderCodes.cost "
@@ -352,16 +342,18 @@ private void viewBill(Appointment appt) {
352342
// code goes here
353343
//header
354344
HBox header = new HBox();
355-
Label patientName = new Label(appt.getFullName());
356-
Label patientEmail = new Label(getEmail(appt.getPatientID()));
357-
Label patientAddress = new Label(getAddress(appt.getPatientID()));
358-
Label patientInsurance = new Label(getInsurance(appt.getPatientID()));
345+
Label patientName = new Label("Patient Name:\n" + appt.getFullName());
346+
Label patientEmail = new Label("Email:\n" + getEmail(appt.getPatientID()));
347+
Label patientAddress = new Label("Address:\n" + getAddress(appt.getPatientID()));
348+
Label patientInsurance = new Label("Insurance:\n" + getInsurance(appt.getPatientID()));
359349
header.getChildren().addAll(patientName, patientEmail, patientAddress, patientInsurance);
360350
bp.setTop(header);
361351
//end header
362352
//center
363353
float paybox = 0;
364354
GridPane grid = new GridPane();
355+
grid.setGridLinesVisible(true);
356+
365357
VBox center = new VBox(grid);
366358
ScrollPane sp = new ScrollPane(center);
367359
String order[] = appt.getOrder().split(",");
@@ -375,7 +367,8 @@ private void viewBill(Appointment appt) {
375367
paybox += a.getCost();
376368
}
377369
}
378-
HBox he = new HBox(tempOrder, tempCost);
370+
Label apptDate = new Label(appt.getTime().split(" ")[0]);
371+
grid.add(apptDate, 1, i);
379372
grid.add(tempOrder, 0, i);
380373
grid.add(tempCost, 2, i);
381374
counter = i;
@@ -389,7 +382,22 @@ private void viewBill(Appointment appt) {
389382
byWhom.setText("Insurance Paid");
390383
}
391384
Label tempPaymentDate = new Label(p.getTime());
392-
Label tempPayment = new Label("" + p.getPayment());
385+
float num = -1 * p.getPayment();
386+
String positive = "";
387+
if (num > 0) {
388+
positive = "+";
389+
}
390+
Label tempPayment = new Label(positive + num);
391+
if (num > 0) {
392+
byWhom.setId("shadeRed");
393+
tempPaymentDate.setId("shadeRed");
394+
tempPayment.setId("shadeRed");
395+
} else {
396+
byWhom.setId("shadeGreen");
397+
tempPaymentDate.setId("shadeGreen");
398+
tempPayment.setId("shadeGreen");
399+
400+
}
393401

394402
grid.add(byWhom, 0, counter);
395403
grid.add(tempPaymentDate, 1, counter);
@@ -400,10 +408,29 @@ private void viewBill(Appointment appt) {
400408
bp.setCenter(sp);
401409
//end center
402410
//footer
411+
Button btn = new Button("Go Back");
412+
btn.setId("cancel");
413+
btn.setOnAction(new EventHandler<ActionEvent>() {
414+
@Override
415+
public void handle(ActionEvent eh) {
416+
x.close();
417+
}
418+
});
419+
Button btn1 = new Button("Make Payment");
420+
btn1.setId("complete");
421+
btn1.setOnAction(new EventHandler<ActionEvent>() {
422+
@Override
423+
public void handle(ActionEvent eh) {
424+
makePayment(appt);
425+
x.close();
426+
viewBill(appt);
427+
}
428+
});
403429
HBox footer = new HBox();
404430
Label blank = new Label("Total Bill Remaining: ");
405431
Label tc = new Label("" + paybox);
406-
footer.getChildren().addAll(blank, tc);
432+
433+
footer.getChildren().addAll(btn, blank, tc, btn1);
407434
bp.setBottom(footer);
408435
//end footer
409436
x.show();
@@ -561,7 +588,6 @@ private void makePayment(Appointment appt) {
561588
Button b = new Button("Submit");
562589
hello.getChildren().addAll(enterpay, ep, dropdown, b);
563590
container.getChildren().addAll(hello);
564-
x.show();
565591
b.setOnAction(new EventHandler<ActionEvent>() {
566592
@Override
567593
public void handle(ActionEvent eh) {
@@ -581,6 +607,7 @@ public void handle(ActionEvent eh) {
581607
//sql = "INSERT INTO patientPayments(apptID, time, patientPayment, byPatient) VALUES ('"+appt.getApptID()+"', '"+LocalDate.now() +"' , '"+ep.getText()+"', '1' )";
582608
}
583609
});
610+
x.showAndWait();
584611
}
585612

586613
private void removeAppointment(Appointment appt) {

RIS/src/main/java/aasim/ris/Rad.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private void createTableAppointments() {
158158
reportCol.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
159159

160160
//Couldn't put all the styling
161-
patientIDCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.04));
161+
patientIDCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.09));
162162
fullNameCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.06));
163163
timeCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.2));
164164
orderIDCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.3));

RIS/src/main/java/aasim/ris/Receptionist.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ private void loadCenter() {
174174
updateAppt.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
175175

176176
//Set Column Widths
177-
apptIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.05));
177+
apptIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.09));
178178
patientIDCol.prefWidthProperty().bind(table.widthProperty().multiply(0.04));
179179
firstNameCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));
180180
timeCol.prefWidthProperty().bind(table.widthProperty().multiply(0.1));

RIS/src/main/java/aasim/ris/ReferralDoctor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ private void createTablePatients() {
181181
updateStatusCol.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
182182

183183
//Couldn't put the table
184-
patientIDCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.05));
184+
patientIDCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.09));
185185
fullNameCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.1));
186186
emailCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.2));
187187
DOBCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.1));
@@ -488,7 +488,7 @@ private void patientOverviewScreen(Patient z) {
488488
statusCol.setCellValueFactory(new PropertyValueFactory<>("status"));
489489
updateStatusCol.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
490490
//Set tableColumn sizes
491-
apptIDCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.05));
491+
apptIDCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.09));
492492
timeCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.1));
493493
ordersCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.2));
494494
statusCol.prefWidthProperty().bind(patientsTable.widthProperty().multiply(0.1));

RIS/src/main/java/aasim/ris/Technician.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private void createTableAppointments() {
147147
updateStatusCol.setCellValueFactory(new PropertyValueFactory<>("placeholder"));
148148

149149
//Couldn't put all the styling
150-
patientIDCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.04));
150+
patientIDCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.09));
151151
fullNameCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.06));
152152
timeCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.2));
153153
orderIDCol.prefWidthProperty().bind(appointmentsTable.widthProperty().multiply(0.3));

RIS/stylesheet.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,12 @@
8181
-fx-border-color: black;
8282
-fx-background-color: grey;
8383

84-
}
84+
}
85+
86+
#shadeRed{
87+
-fx-background-color: rgba(136, 8, 8, 0.1);
88+
}
89+
90+
#shadeGreen{
91+
-fx-background-color: rgba(8, 136, 8, 0.1);
92+
}

0 commit comments

Comments
 (0)