State Models - SENG-350-2024-fall/Team-11 GitHub Wiki

Describe the stateful bahviour with a UML Statemachine.

Make sure that the Statemachines can communicate with appropriate events (or messages) that are also consistent with your Sequence Diagrams and Activity Diagrams. There should be a minimum of 5 State Models.

Please add a textual explanation (not just the diagrams).

Login Function

The diagram involves the following states:

  1. Website Home State:

    • The process begins when the user lands on the Website Home page. Here, they have the option to start the login process by clicking the "Log In" button. This action transitions the system to the Log In Page.
  2. Log In Page State:

    • Once in the Log In Page state, the user needs to enter their login credentials. First, they input their email address, moving the system to the EmailEntry state.
    • After entering their email, the user proceeds to input their password, which transitions the system to the PasswordEntry state.
    • Once both pieces of information are entered, the user clicks the "Log In" button, moving to the SubmitLogin state.
  3. Verifying State:

    • At this point, the system enters the Verifying state, where it checks the provided credentials against the database.
    • There are two possible outcomes during this state:
      • If the credentials are correct, the state transitions to AccountAccess, indicating that the user has successfully logged in.
      • If the credentials are incorrect, the system moves to the ErrorState, indicating a login failure.
  4. Account Access State:

    • If the verification is successful, the user gains access to their account, which leads to the AccountHome state. Here, the user can interact with various account features and settings.
  5. Error State:

    • In the case of incorrect credentials, the ErrorState is activated. This state displays an error message to the user, encouraging them to try logging in again.
    • The user can then choose to return to the Log In Page to re-enter their credentials.
  6. End State:

    • The flow concludes either when the user successfully accesses their account or decides to exit the login process from the AccountHome state.

Virtual Triage Function

Triage-Picture

This diagram involves the following states:

  1. Access Website State

    • The process begins with the patient accessing the Mister Ed system. If already logged in, the system moves to the Prompt For Symptoms state. If patient is logged out, the system moves to Display Wait Time where an average estimated ED wait time is displayed and the processes is complete.
  2. Prompt For Symptoms State

    • After the patient is logged in, the system displays the virtual triage system for input where the patient can enter symptoms and any medical history
  3. Process Triage Results State

    • Once the patient has submitted the symptoms, the system processes the triage results and generates 1 or more potential care options
  4. Display Triage Results State

    • After the results have been processed, the system moves to one of 3 possible Display Results states. If there is only one possible care option, it goes to Display One Option. For two or more options, it moves to Display Multiple Options, or if no further care is necessary it moves to No Further Care state.
  5. Display One Option State

    • Here, the system displays the recommended care option to the patient from possible options of Emergency Room, Primary Care Clinic, or Nurse. Once this information has been confirmed by the patient, the system moves to the Provide Facility Details state
  6. Display Multiple Options State

    • If multiple care options are available to the patient, this state will display the options for the patient to choose from, then move to the Prompt Select Option State
  7. No Further Care State

    • If it is determined that no further care is necessary, the system displays this information in a message and the process is complete, moving to the end state.
  8. Prompt Select Option State

    • If the patient had multiple care options to choose from, this state prompts the patient to select the preferred care option. After an option has been selected, the system retrieves the facility details for the chosen option and moves to the Provide Facility Details state.
  9. Provide Facility Details State

    • In this state, the patient is provided with facility details which could include contact information or directions to the facility
  10. End State

    • The flow is completed when either a) a logged out patient views wait time, b) no care is necessary, c) no options are selected from the triage results, or d) the triage completes and the facility details are provided to the patient.

Update Patient Priority Function

priorityqueue

The diagram for Manage Patient Flow involves the following states

  1. Website Login State

    • The process begins by an authorized user such as ED worker logging in to the Mister Ed website
  2. Patient List Display State

    • Once the user is logged in, they can access the list of patients in the system. The system displays the queue of patients with their priority based on urgency determined from the Virtual Triage process.
  3. Patient Details Display State

    • Once the user selects a specific patient and clicks "View patient", they are brought to a patient information page where they can view associated triage information such as symptoms, medical history, and priority.
  4. Queue Edit State

    • By clicking "Edit priority" in the Patient Details State, the user can update the urgency level of a patient. They can modify the queue based on medical history or symptoms to rearrange the order of patients. If they choose to cancel the edits, the user is brought back to the Patient Details Display state
  5. Wait Time Update State

    • After queue updates are confirmed, the system recalculates the estimated wait times for patients in the queue based on the new order, to ensure patients are provided with an accurate wait time.
  6. End State

    • The process ends when the user finishes managing the patient flow or exits the system

Update Patient Data function

statetransitionforupdatedata

The diagram involves the following states:

  1. MisterED Website

    • The process starts when a user (e.g., a Nurse) visits the MisterED website and enters their credentials.
    • If the credentials are valid, the user is logged in and proceeds to the next state.
    • If the credentials are invalid, the system stays in the same login state, allowing the user to try again.
  2. Patient Records

    • Once logged in, the user can search for patient reports by entering a patient_username.
    • After entering the patient_username, the system retrieves and displays the relevant patient report.
  3. Patient Report

    • The user can view the patient report after a successful search.
    • There is an option to update the report, which transitions the system to the next state.
  4. Edit Patient Report

    • If the user chooses to update the report, the system switches the report into an editable format.
    • After making changes, the user is presented with the option to save the changes.
  5. Completed Patient Report

    • After saving the changes, the system processes the updates.
    • The system moves to the next state, where the updated patient report is displayed.
  6. New Patient Report

    • The system now shows the new version of the patient report, reflecting the recent changes made by the user.

Create Appointment function

statetransitionforcreateappointmentfunction