Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team Arcs_SY_78 #11

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 39 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,44 @@
# Buffer-4.0
Buffer is a Data Structures and Algorithms Project series, in which students can participate as mentees in teams of 3-4 people.
This year the themes on which students can create a project are-

1. Healthcare
2. Digital Society
3. Open Innovation
4. Custom data structure to store data
# PrioDoc - A Priority Queue Based Patient Management System

This repository is created for all the teams to be able to upload their final project source code for the same.
This is a web-based application that allows doctors to manage their patient queue. The application is built using HTML, CSS, and JavaScript and uses Firebase for real-time data synchronization and storage. The data structure used for the Priority Queue is arrays and the language used is JavaScript. The application allows doctors to view their current patient, next patient (if any), and completed patients, as well as to mark a patient as completed and remove them from the queue. The application is designed to improve the efficiency of patient management for doctors and ultimately improve patient care.

While submitting, note that:

Each folder should have the name of the team and inside a readme file with team member details, (name, year, branch) and their theme. The readme file should also contain the link to their presentation as well as the drive link where both the report documents would be stored.

Happy Coding :)
## Acknowledgements

- [Firebase](https://firebase.google.com/docs/auth)
- [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript)


## Tech Stack

**Front-end:** HTML, CSS, JavaScript

**Back-end:** Firebase (including Realtime Database and Authentication) for authentication

**Additional tools:** Visual Studio Code as the code editor and Local Storage for storing temporary data

## Instructions before Using
- Open up startpage.html on localhost
- Sign Up as a Patient
- Login as a Patient
- Register for an Appointment
- Head back and login as a doctor with the credentials email: [email protected] and password: 123456
- Service the patient based on the given queue

## Team Arcs

- Mrunal Shinde - SY - COMP
- Srushti Pophale - SY - COMP
- Sakshi Vaidya - SY - COMP


## Video Demonstration

https://drive.google.com/file/d/11DzaeFGXGXay4N_-JlS4lhmF7P1D8itM/view?usp=sharing

## FeedBack Reports

https://docs.google.com/document/d/13LsFH3T-BQZjuCsXr-FcfYV-NJQKRkL8/edit?usp=sharing&ouid=112103796661072165501&rtpof=true&sd=true

Binary file added TeamArcs_SY_78/Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
100 changes: 100 additions & 0 deletions TeamArcs_SY_78/LookUpPatients.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html>

<head>
<title>Doctor's View</title>
<link rel="stylesheet" type="text/css" href="styles-3.css">
</head>

<body>
<h1>Dr.Kelly Smith's View</h1>

<h2>Current Patient:</h2>
<div id="currentPatient"></div>

<h2>Next Patient:</h2>
<div id="nextPatient"></div>

<h2>Completed Patients:</h2>
<ul id="completedPatients"></ul>

<script>
// Initialize patient queue from local storage
let patientQueue = JSON.parse(localStorage.getItem("patientQueue"));

// Display current patient and next patient, if any
displayCurrentPatient();
displayNextPatient();

// Function to display the current patient
function displayCurrentPatient() {
if (patientQueue.length > 0) {
let currentPatient = patientQueue[0];
let priorityLabel = getPriorityLabel(currentPatient.priority);
document.getElementById("currentPatient").innerHTML = `
<h3>${currentPatient.name} - Priority: ${priorityLabel}</h3>

<button onclick="completePatient()">Service Current Patient</button>
`;
} else {
document.getElementById("currentPatient").innerHTML = `
<h3>No new patient</h3>
`;
}
}

// Function to display the next patient, if any
function displayNextPatient() {
if (patientQueue.length > 1) {
let nextPatient = patientQueue[1];
let priorityLabel = getPriorityLabel(nextPatient.priority);
document.getElementById("nextPatient").innerHTML = `
<h3>Next Patient:</h3>
<p>${nextPatient.name} - Priority: ${priorityLabel}</p>
`;
} else {
document.getElementById("nextPatient").innerHTML = `
<h3>No next patient</h3>
`;
}
}

// Function to complete the current patient
function completePatient() {
let completedPatient = patientQueue.shift(); // Remove current patient from queue
displayCurrentPatient(); // Display new current patient or no patient
displayNextPatient(); // Display new next patient or no patient
if (completedPatient) {
displayCompletedPatients(completedPatient); // Display completed patient in completed patients list
}
savePatientQueue(); // Save updated patient queue to local storage
}

// Function to display completed patients in the completed patients list
function displayCompletedPatients(patient) {
let priorityLabel = getPriorityLabel(patient.priority);
let listItem = document.createElement("li");
listItem.innerText = `${patient.name} - Priority: ${priorityLabel}`;
document.getElementById("completedPatients").appendChild(listItem);
}

// Function to get the priority label for a given priority value
function getPriorityLabel(priority) {
switch (priority) {
case 1:
return "High";
case 2:
return "Medium";
case 3:
return "Low";
}
}

// Function to save the patient queue to local storage
function savePatientQueue() {
localStorage.setItem("patientQueue", JSON.stringify(patientQueue));
}
</script>
</body>

</html>
66 changes: 66 additions & 0 deletions TeamArcs_SY_78/form-doc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
var firebaseConfig = {
apiKey: "AIzaSyCeE9c3jX_LfBWjRd6Rv2O7KY5NGPKwh4o",
authDomain: "teamloop-79b88.firebaseapp.com",
projectId: "teamloop-79b88",
storageBucket: "teamloop-79b88.appspot.com",
messagingSenderId: "18214010600",
appId: "1:18214010600:web:0818dfba3d291d1f51d35d"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

const auth = firebase.auth();

//signup function
function signUp() {
var email = document.getElementById("email");
var password = document.getElementById("password");

const promise = auth.createUserWithEmailAndPassword(email.value, password.value);

promise.catch(e => alert(e.message));
alert("SignUp Successfully");
}

//signIN function
function signIn() {
var email = document.getElementById("email");
var password = document.getElementById("password");
const promise = auth.signInWithEmailAndPassword(email.value, password.value);
promise.then(() => {
window.location.href = "LookUpPatients.html";
})
.catch(e => alert(e.message));

}


//signOut

function signOut() {
auth.signOut();
alert("SignOut Successfully from System");
}

//active user to homepage
firebase.auth().onAuthStateChanged((user) => {
if (user) {
var email = user.email;
alert("Your account has been created!!! " + email);

} else {
alert("No Active user Found")
}
})

function validateEmail() {
const email = document.getElementById("email").value.trim();
const emailRegex = /^dr\.kellysmith@myradoc\.in$/i; // regex to match required email format

if (!emailRegex.test(email)) {
alert("Invalid email format. Please enter a valid doctor email.");
return false;
}
return true;
}

54 changes: 54 additions & 0 deletions TeamArcs_SY_78/form-patient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
var firebaseConfig = {
apiKey: "AIzaSyCeE9c3jX_LfBWjRd6Rv2O7KY5NGPKwh4o",
authDomain: "teamloop-79b88.firebaseapp.com",
projectId: "teamloop-79b88",
storageBucket: "teamloop-79b88.appspot.com",
messagingSenderId: "18214010600",
appId: "1:18214010600:web:0818dfba3d291d1f51d35d"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);

const auth = firebase.auth();

//signup function
function signUp() {
var email = document.getElementById("email");
var password = document.getElementById("password");

const promise = auth.createUserWithEmailAndPassword(email.value, password.value);

promise.catch(e => alert(e.message));
alert("SignUp Successfully");
}

//signIN function
function signIn() {
var email = document.getElementById("email");
var password = document.getElementById("password");
const promise = auth.signInWithEmailAndPassword(email.value, password.value);
promise.then(() => {
window.location.href = "registration.html";
})
.catch(e => alert(e.message));

}


//signOut

function signOut() {
auth.signOut();
alert("SignOut Successfully from System");
}

//active user to homepage
firebase.auth().onAuthStateChanged((user) => {
if (user) {
var email = user.email;
alert("Your account has been created!!! " + email);

} else {
alert("No Active user Found")
}
})
26 changes: 26 additions & 0 deletions TeamArcs_SY_78/index-doc.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" type="text/css" href="styles-2.css">

<script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-auth.js"></script>
<script src="form-doc.js"></script>

<title>Login System Doctor</title>
</head>
<body>
<div class="formContainer">
<h1>Doctor Credentials:</h1>
<input type="email" placeholder="Type your email here" id="email"><br>
<input type="password" placeholder="Type your password here" id="password"><br>
<button onclick="signUp()" id="signUp">SignUp</button>
<button onclick="validateEmail() && signIn()" id="signIn">SignIn</button>
<!-- <button onclick="signOut()" id="signOut">SignOut</button> -->
</div>
</body>
</html>
30 changes: 30 additions & 0 deletions TeamArcs_SY_78/index-patient.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="stylesheet" type="text/css" href="styles-2.css">

<script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.2.7/firebase-auth.js"></script>
<script src="form-patient.js"></script>

<title>Login System Patients</title>
</head>
<body>
<div class="formContainer">
<h1>Patient Credentials:</h1>
<input type="email" placeholder="Type your email here" id="email"><br>
<input type="password" placeholder="Type your password here" id="password"><br>
<button onclick="signUp()" id="signUp">SignUp</button>
<button onclick="signIn()" id="signIn">SignIn</button>

</div>



</body>
</html>

Loading