Class AppointmentHealthController

java.lang.Object
com.ehealthsystem.appointment.AppointmentHealthController
All Implemented Interfaces:
javafx.fxml.Initializable

public class AppointmentHealthController extends Object implements javafx.fxml.Initializable
Class for loading the health information
  • Field Details

    • healthGridPane

      javafx.scene.layout.GridPane healthGridPane
      attributes with a fx:id of the view
    • continueButton

      javafx.scene.control.Button continueButton
    • backButton

      javafx.scene.control.Button backButton
    • errorLabel

      javafx.scene.control.Label errorLabel
    • selectedHealthInformation

      private ArrayList<HealthInformation> selectedHealthInformation
      stores all from the user selected health informaiton
    • allHealthInformation

      private ArrayList<HealthInformation> allHealthInformation
      stores all the from the database loaded health information
    • numberOfCheckBoxes

      private ArrayList<javafx.scene.control.CheckBox> numberOfCheckBoxes
      stores all the checkboxes to determine which is selected
  • Constructor Details

    • AppointmentHealthController

      public AppointmentHealthController()
  • Method Details

    • initialize

      public void initialize(URL url, ResourceBundle resourceBundle)
      First method that is called when scene is switched. Used to call the method for initalizing the health information
      Specified by:
      initialize in interface javafx.fxml.Initializable
      Parameters:
      url -
      resourceBundle -
    • handleContinueButton

      public void handleContinueButton(javafx.event.ActionEvent event) throws IOException
      load the next scene
      Parameters:
      event -
      Throws:
      IOException
    • handleBackButton

      public void handleBackButton(javafx.event.ActionEvent event) throws IOException
      load the previous scene
      Parameters:
      event -
      Throws:
      IOException
    • loadHealthInformation

      private void loadHealthInformation() throws SQLException
      load the health information of the user from the database
      Throws:
      SQLException
    • fillHealthTable

      private void fillHealthTable(ArrayList<HealthInformation> allHealthInformation)
      fill the grid pane with the loaded health information
      Parameters:
      allHealthInformation -
    • setStyle

      private void setStyle(javafx.scene.control.Label ICD, javafx.scene.control.Label health_problem, javafx.scene.control.Label medication, javafx.scene.control.CheckBox selection)
      set the style for labels and buttons
      Parameters:
      ICD - the parameter of the first column of the grid pane
      health_problem - the parameter of the second column of the grid pane
      medication - the third parameter of the grid pane
      selection - the created checkbox of a row
    • handleCheckBox

      private void handleCheckBox(javafx.scene.control.CheckBox selection, HealthInformation selectedRow, int row)
      dynamically added eventhandler for checkbox
      Parameters:
      selection -
      selectedRow -
      row -
    • removeMatchingHealthInformation

      private void removeMatchingHealthInformation(HealthInformation c)
      Compare the data instead of the object because the object is a different one when switching scenes
      Parameters:
      c -
    • healthInformationsMatch

      private boolean healthInformationsMatch(HealthInformation a, HealthInformation b)
    • handleSelectAllButton

      public void handleSelectAllButton(javafx.event.ActionEvent event)
      select all the checkboxes/health information in the grid pane
      Parameters:
      event - the event triggered the method
    • handleDeselectAllButton

      public void handleDeselectAllButton(javafx.event.ActionEvent event)
      deselects all the checkboxes/health information in the grid pane
      Parameters:
      event - the event triggered the method
    • manuallySelect

      private void manuallySelect(javafx.scene.control.CheckBox c, HealthInformation h, boolean selected)
      if a check box is selected and add the health information to the grid pane
      Parameters:
      c - the checkbox selected
      h - the health information of the row
      selected - paramter to determine if checkbox is selected