Sequence Diagrams - SENG-350-2024-fall/Team-1 GitHub Wiki

Doctor Prescribing Medication

This diagram shows the interactions between a Doctor, the Login system, a Hospital, a PatientFile, and a Patient.

Diagram Description:

  1. Login Process:

    • The Doctor sends a login(username, password, StaffId) request to the Login system.
    • The Login system activates and authenticates the doctor's credentials if they have entered the correct information.
    • If the login is successful, the Login system confirms login back to the Doctor and the Login system deactivates.
  2. Retrieving a Patient from the Queue:

    • After logging in, the Doctor sends a popPatientFromQueue() request to the Hospital which keeps a queue of patients currently waiting to be seen.
    • The Hospital processes the request, retrieves a patient, and returns the patient information to the Doctor for the doctor to review.
    • The Hospital deactivates after this operation.
  3. Accessing and Modifying Patient Files:

    • The Doctor sends a request requestFileAccess(Patient, StaffId) to the PatientFile system to access the patient’s medical records.
    • The PatientFile system activates, processes the request, and returns a list of the patient's files to the Doctor.
    • After reviewing the patient files, the Doctor creates a new file in the PatientFile system.
    • The PatientFile system processes the new file creation and updates the patient's file.
  4. Viewing Diagnosis:

    • After the new file is created, the PatientFile system, the Patient can view their new diagnosis with the viewDiagnosis(file).
    • The PatientFile system deactivates, and the Patient briefly activates to view the new file, then deactivates.

Key Participants:

  • Doctor: Interacts with the system to log in, retrieve patients, and create/update patient files.
  • Login: Authenticates the doctor’s credentials.
  • Hospital: Manages the queue of patients waiting to see a physician and provides patient information to the doctor.
  • PatientFile: Handles patient medical records, granting access to files, and allowing updates or creation of new records.
  • Patient: The person whose file is being updated with a new diagnosis and treatment, and who can view the updated medical records.

This sequence diagram describes a happy path flow where a doctor logs in successfully, gets a patient from the hospital queue, accesses the patients medical file, adds a new diagnosis file, and allows the patient to view their updated medical records.

Diagram

image

`' Doctor Prescribes Medication for Patient @startuml actor Doctor participant Doctor participant Login participant Hospital participant PatientFile participant Patient

Doctor -> Login: login(username, password, StaffId) activate Login Login -> Doctor: authenticate() deactivate Login

Doctor -> Hospital: popPatientFromQueue() activate Hospital Hospital -> Doctor: return(Patient) deactivate Hospital

Doctor -> PatientFile: requestFileAccess(Patient, StaffId) activate PatientFile

PatientFile -> Doctor: return(list) Doctor -> PatientFile: createNewFile(diagnosis, treatment) PatientFile -> Patient: viewDiagnosis(file) deactivate PatientFile activate Patient deactivate Patient @enduml`

EMT assists Patient

The process where an EMT interacts with mister ED to manage a new patient request, edit a triage report, and admit the patient to a hospital, is shown in this sequence diagram.

Diagram Description:

  1. Login Process:

    • The EMT begins by requesting a login(username, password, StaffId) to the Login system.
    • The Login system activates and authenticates the EMT.
    • After the authentication is completed successfully, the Login system deactivates.
  2. Receiving a New Patient Request:

    • The NotificationSystem sends a message newPatientRequest() to the EMT, indicating that there is a new patient they must assist.
    • The EMT accepts this request by sending acceptRequest(patient) back to the NotificationSystem.
  3. Retrieving Patient Records:

    • The NotificationSystem requests the patient records by sending getPatientRecords(patient) to the PatientDB (patient database).
    • The PatientDB processes the request, activating to retrieve patient info, and sends the patient records to the EMT with sendPatientRecords(file).
  4. Editing the Triage Report:

    • The EMT then sends the message editTriageReport(patientReport) to the TriageSystem to update the patient’s triage report based on their in person assessment of the patient.
    • The TriageSystem confirms the update with confirmReportUpdate() to the EMT.
  5. Finding the Nearest Hospital:

    • The EMT requests the location of the nearest hospital by sending getNearestHospitalLocation(location) to the LocationService.
    • The LocationService responds by sending back the closest hospital's location with sendHospitalLocation(Hospital).
  6. Admitting the Patient to the Hospital:

    • The EMT then takes the patient to the Hospital and upon arrival can admit the patient to the hospital with admitPatient(patient).
    • The Hospital processes the admission request, activating to confirm the patient’s admission, and sends back a confirmation message confirmAdmission().
  7. Removing the Current Patient:

    • Now that the patient is at the hospital they are out og the EMT's care so EMT sends a message to the Patient to indicate that the current patient is being removed with removeCurrentPatient().
    • The Patient confirms this action by responding with confirmPatientRemoved(), after which the Patient deactivates.

Key Participants:

  • EMT: Interacts with various systems to log in, manage patient requests, and admit patients to hospitals.
  • Login: Authenticates the EMT's credentials.
  • NotificationSystem: Sends notifications for new patient requests and facilitates communication about patient records.
  • PatientDB: Stores and retrieves patient records.
  • TriageSystem: Handles updates to the patient's triage reports.
  • LocationService: Provides information about the nearest hospital location.
  • Hospital: Admits the patient and confirms their admission.

This sequence diagram depicts the comprehensive workflow that an EMT follows when responding to a new patient request, ensuring that all necessary information is gathered and the patient is safely admitted to the hospital.

Diagram :

image

`' EMT takes Patient to Emergency Department @startuml actor EMT participant Login participant NotificationSystem participant PatientDB as Patient participant TriageSystemFile as TriageSystem participant LocationService participant Hospital

EMT -> Login: login(username, password, StaffId) activate Login Login -> EMT: authenticate() deactivate Login

NotificationSystem -> EMT: newPatientRequest() EMT -> NotificationSystem: acceptRequest(patient) NotificationSystem -> Patient: getPatientRecords(patient) activate Patient Patient -> EMT: sendPatientRecords(file)

EMT -> TriageSystem: editTriageReport(patientReport) TriageSystem -> EMT: confirmReportUpdate()

EMT -> LocationService: getNearestHospitalLocation(location) LocationService -> EMT: sendHospitalLocation(Hospital)

EMT -> Hospital: admitPatient(patient) activate Hospital Hospital -> EMT: confirmAdmission() deactivate Hospital

EMT -> Patient: removeCurrentPatient() Patient -> EMT: confirmPatientRemoved() deactivate Patient @enduml`

Nurse Edits Triage Report

This sequence diagram shows how a Nurse can edit a patient's triage report using the Mister ED system.

Diagram Description:

  1. Login Process:

    • The Nurse initiates the process by sending a login(username, password, StaffId) request to the Login system.
    • The Login system activates and processes the authentication if the credentials provided are correct.
    • Once authentication is complete, the Login system deactivates.
  2. Retrieving a Patient from the Queue:

    • After logging in, the Nurse sends a popPatientFromQueue() request to the Hospital to retrieve a patient from the emergency department queue.
    • The Hospital returns the patient info.
    • The Hospital deactivates after this operation.
  3. Accessing the Triage Report:

    • The Nurse requests access to the patient's triage report with requestFileAccess(patient) to the TriageReportFile system.
    • The TriageReportFile system activates and returns the patient's relevant triage file.
  4. Updating the Triage Report:

    • The Nurse then updates the triage report by sending an updated report with updateReport(triageFile) to the TriageReportFile system.
    • After processing the update, the TriageReportFile system confirms the update.
    • The TriageReportFile system deactivates after the confirmation.

Key Participants:

  • Nurse: Interacts with system to log in, retrieve patients and files, and edit triage reports.
  • Login: Authenticates the nurse's credentials.
  • Hospital: Manages the queue of patients and provides patient information to the nurse.
  • TriageReportFile: Handles access to and updates of patient triage reports.

This sequence diagram displays the workflow of a nurse logging in, retrieving a patient from the hospital queue, accessing the patient's triage report, and updating it.

Diagram:

image

`' Nurse Edits Patient’s Triage Report @startuml actor Nurse participant Login participant Hospital participant TriageReportFile

Nurse -> Login: login(username, password, StaffId) activate Login Login -> Nurse: autenticate() deactivate Login

Nurse -> Hospital: popPatientFromQueue() activate Hospital Hospital -> Nurse: return(Patient) deactivate Hospital

Nurse -> TriageReportFile: requestFileAccess(patient) activate TriageReportFile TriageReportFile -> Nurse: return (triageFile) Nurse -> TriageReportFile: updateReport(triageFile) TriageReportFile --> Nurse: confirmUpdate()

deactivate TriageReportFile

@enduml`

Online Nurse creates a telehealth appointment

Diagram Description:

The process of an OnlineNurse arranging a telemedicine appointment for a patient is shown in this diagram.

  1. Login Process:

    • The OnlineNurse begins by requesting a login(username, password, StaffId) to the Login system.
    • The Login system activates and authenticates the Online Nurse.
    • After the authentication is completed successfully, the Login system deactivates.
  2. Retrieving the Next Patient:

    • The OnlineNurse requests the next patient in line by sending popNextPatient() to the PatientQueue.
    • The PatientQueue processes the request, returns the next patient returnPatientDetails(patient) containing the patient's info.
    • After providing the patient details, the PatientQueue deactivates.
  3. Reviewing the Triage Report:

    • The OnlineNurse sends a request reviewTriageReport(patient) to the TriageReport system to view the patient's triage report.
    • The TriageReport system activates and returns the patient's report with displayTriageReport(symptoms, history), which has the patient's symptoms and medical history.
    • Once the report is displayed, the TriageReport system deactivates.
  4. Checking Doctor Availability:

    • The OnlineNurse checks for an available doctor by sending checkDoctorAvailability(patient) to the Staff system.
    • The Staff system activates and returns the an available doctor.
    • The Staff system deactivates after returning the information.
  5. Scheduling the Telemedicine Appointment:

    • The OnlineNurse sends the appointment scheduling request scheduleTelemedicineAppointment(patient, date, doctor) to the Scheduler.
    • The Scheduler activates and does the following:
      • Sends a notification to the patient with NotifyAppointmentScheduled(doctor, date).
      • Sends a notification to the doctor with NotifyAppointmentScheduled(patient, date).
      • Confirms to the OnlineNurse that the appointment was successfully added with ConfirmAppointmentAdded().
    • After confirming the appointment the Scheduler deactivates.

Key Participants:

  • OnlineNurse: reviews a patient's triage report and schedules a telemedicine appointment.
  • Login: Authenticates the nurse's login.
  • PatientQueue: Provides the details of the next patient in the queue.
  • TriageReport: Gets the patient's symptoms and medical history.
  • Staff: Provides info about available doctors for an appointment.
  • Scheduler: Schedules the telemedicine appointment and notifies the patient and doctor of the confirmed date and time.

This diagram shows the role of the OnlineNurse in handling patient triage, and scheduling telemedicine appointments within the Mister ED system.

Diagram:

image

`' Online Nurse Schedules Telemedicine Appointment with Staff @startuml actor OnlineNurse

participant System as TelemedicineSystem participant PatientQueue participant TriageReport participant Scheduler participant Staff participant Patient

OnlineNurse -> TelemedicineSystem: login(username, password) activate TelemedicineSystem TelemedicineSystem -> OnlineNurse: authenticate() deactivate TelemedicineSystem

OnlineNurse -> PatientQueue: popNextPatient() activate PatientQueue PatientQueue -> OnlineNurse: returnPatientDetails(patient) deactivate PatientQueue

OnlineNurse -> TriageReport: reviewTriageReport(patient) activate TriageReport TriageReport -> OnlineNurse: displayTriageReport(symptoms, history) deactivate TriageReport

OnlineNurse -> Staff: checkDoctorAvailability(patient) activate Staff Staff -> OnlineNurse: returnAvailableDoctor(doctor) deactivate Staff

OnlineNurse -> Scheduler: scheduleTelemedicineAppointment(patient, date, doctor) activate Scheduler Scheduler -> Patient: NotifyAppointmentScheduled(doctor, date) Scheduler -> Staff: NotifyAppointmentScheduled(patient, date) Scheduler -> OnlineNurse: ConfirmAppointmentAdded() deactivate Scheduler

@enduml`

Patients gets triaged

Diagram Description:

This sequence diagram shows the steps for a Patient to create a triage report in the Mister ED system.

  1. Patient Login:

    • The Patient starts by logging into the system using their healthcare card number with a login(healthCareCardNumber) request to the Login System.
    • The Login System activates, processes the login request, and upon correct credentials will return with authenticate() to confirm successful login.
    • The Login System deactivates after authentication.
  2. Creating Triage Report:

    • The Patient initiates the process of creating a triage report by sending a createTriageReport(symptoms) request to the Triage System with a list of their symptoms.
    • The Triage System activates creates a triagefile and requests the a new triage report be added to the patient's files by sending addTriageReport(SymptomList) to the PatientFile system.
  3. Handling the Triage Report:

    • The PatientFile system activates and interacts with the Online Nurse to handle the triage report.
    • The PatientFile sends read(PatientSymptomsFile) to the Online Nurse, who then reviews the patient's symptoms.
    • The Online Nurse then can write updated information if needed back to the PatientFile with write(TriageReport).
    • Once the report is completed, the PatientFile responds to the Triage System with return(completedTriageReport).
  4. Assigning Priority and Displaying Report:

    • The Triage System assigns a priority level to the Patient by sending assignPriority(priority) based on the report the Online Nurse generated.
    • The Triage System then displays the completed triage report to the Patient with display(TriageReport).
    • After displaying the report, the Triage System deactivates, completing the process.

Key Participants:

  • Patient: Starts the triage report creation and views the final report.
  • Login System: Handles patient authentication.
  • Triage System: Manages the creation and processing of the triage report and assigns the patient's priority level.
  • PatientFile: Stores and updates the patient's triage report.
  • Online Nurse: Reads the patient's symptoms and reviews the triage report.

This diagram shows how a patient would use the Mister ED system to create a triage report with symptom details then and receive a priority assignment based on the completed report.

Diagram:

image

`' Patient creating triage report @startuml actor Patient

participant "Login System" as Login participant "Triage System" as Triage participant PatientFile participant "Online Nurse" as ON

Patient -> Login: login(healthCareCardNumber) activate Login Login -> Patient: authenticate() deactivate Login

Patient -> Triage: createTriageReport(symptoms) activate Triage Triage -> PatientFile: addTriageReport(SymptomList) activate PatientFile PatientFile -> ON: read(PatientSymptomsFile) ON->PatientFile: write(TriageReport) PatientFile -> Triage: return(completedTriageReport) deactivate PatientFile

Triage-> Patient: assignPriority(priority) Triage -> Patient: display(TriageReport) deactivate Triage @enduml `

⚠️ **GitHub.com Fallback** ⚠️