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

Added C&C_patient_management.drawio #24

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
ed6f50d
Added C&C_patient_management.drawio
minhn201 Oct 11, 2023
af930ce
Update C&C_patient_management.drawio
minhn201 Oct 14, 2023
72c920f
Update C&C_patient_management.drawio
minhn201 Oct 14, 2023
d03a8c2
Update C&C_patient_management.drawio
dhuruvan13 Oct 14, 2023
5c14df3
Update C&C_patient_management.drawio
dhuruvan13 Oct 14, 2023
a3991ec
Added patient_management_dc.drawio
minhn201 Oct 14, 2023
357e329
Update C&C_patient_management.drawio
minhn201 Oct 14, 2023
5ce1b29
Update patient_management_dc.drawio
minhn201 Oct 14, 2023
ed7eb0f
Update patient_management_dc.drawio
dhuruvan13 Oct 14, 2023
606d392
Update C&C_patient_management.drawio
minhn201 Oct 14, 2023
fc0a1b7
Update C&C_patient_management.drawio
minhn201 Oct 14, 2023
9ca6eaa
Update patient_management_dc.drawio
minhn201 Oct 14, 2023
268e2eb
Add files via upload
minhn201 Oct 14, 2023
42dbbfd
Update C&C_patient_management.drawio
dhuruvan13 Oct 14, 2023
4b92455
Update C&C_patient_management.drawio
minhn201 Oct 14, 2023
4cebb03
Update patient_management_dc.drawio
minhn201 Oct 14, 2023
da197a6
Update AccountInformation.py
minhn201 Oct 14, 2023
4417fa5
Update AccountInformation.py
minhn201 Oct 15, 2023
c5b33f9
Add files via upload
minhn201 Oct 15, 2023
d1a1c74
Delete Patient_Mangement/AccountInformation.py
minhn201 Oct 15, 2023
d7edb19
Delete Patient_Mangement directory
minhn201 Oct 15, 2023
92114e6
Add files via upload
minhn201 Oct 15, 2023
a74b957
Delete Patient_Mangement/components/TriageRecord.py
minhn201 Oct 15, 2023
86d111d
Add files via upload
minhn201 Oct 15, 2023
20fd395
Add files via upload
minhn201 Oct 15, 2023
e9022e0
Add files via upload
minhn201 Oct 15, 2023
738de92
Create Component-Diagram-Description-Patient_Management
dhuruvan13 Oct 15, 2023
cb86b14
Create Deployment-Diagram-Description-Patient_Management
dhuruvan13 Oct 15, 2023
81aee4b
Add files via upload
minhn201 Oct 15, 2023
124d3e4
Add files via upload
minhn201 Oct 15, 2023
138bc32
Update main.py
minhn201 Oct 15, 2023
1544ebf
Update main.py
minhn201 Oct 15, 2023
a508118
Update main.py
minhn201 Oct 15, 2023
0b89653
Update main.py
minhn201 Oct 15, 2023
47880fc
Update main.py
minhn201 Oct 15, 2023
a5a0ed4
Made some minor tweak to make the diagram cleaner.
lapis2002 Oct 15, 2023
b4a138d
Made some minor tweaks to make the diagram cleaner
lapis2002 Oct 15, 2023
1b9f4ca
Update C&C_patient_management.drawio
minhn201 Oct 15, 2023
4847727
Update C&C_patient_management.drawio
minhn201 Oct 16, 2023
2813963
Update main.py
minhn201 Oct 16, 2023
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
10 changes: 10 additions & 0 deletions Deployment-Diagram-Description-Patient_Management
OllieWare marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
At the heart of the system lies a Patient Database Server, running on a Linux operating system, serving as the central repository for
patient data. This server hosts two critical schemas: TriageRecordSchema and UserHealthInfoSchema, which define the structure and
relationships within the patient records. The communication between the server and the application components is facilitated through
FastApi, a modern and efficient web framework. FastApi acts as the bridge, ensuring seamless interactions between the server and the
User Interface (UI). The system's architecture extends further with the incorporation of an Account Management execution environment.
This component manages user accounts and interactions, ensuring data security and access control. Additionally, the system incorporates
a Patient: RDBMS execution environment, emphasizing the utilization of relational database management systems tailored specifically for
patient data. The integration of SQLAlchemy, a powerful SQL toolkit, enhances database management efficiency, ensuring smooth communication
between the server and the schemas. In this configuration, the system's components are interlinked, guaranteeing a secure, efficient, and
highly responsive healthcare management system that caters to diverse user needs.
68 changes: 68 additions & 0 deletions Patient_Mangement/components/AccountInformation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
class AccountInfo:
def _init_(self, patient_id, username, password, first, last, phone, email, str_num, str_name, city, province, postal_code):

self.patient_id = patient_id
self.username = username
self.password = password
self.name = [first, last]
self.phone = phone
self.email = email
self.address = [str_num, str_name, city, province, postal_code]



@property
def patient_id(self):
return self.patient_id

@patient_id.setter
def patient_id(self, value):
self.patient_id = value

@property
def username(self):
return self.username

@username.setter
def username(self, value):
self.username = value

@property
def password(self):
return self.password

@password.setter
def password(self, value):
self.password = value

@property
def name(self):
return self.name

@name.setter
def name(self, first, last):
self.name = [first, last]

@property
def phone(self):
return self.phone

@phone.setter
def phone(self, value):
self.phone = value

@property
def email(self):
return self.email

@email.setter
def email(self, value):
self.email = value

@property
def address(self):
return self.address

@address.setter
def address(self, str_num, str_name, city, province, postal_code):
self.address = [str_num, str_name, city, province, postal_code]
44 changes: 44 additions & 0 deletions Patient_Mangement/components/TriageRecord.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
class TriageRecord():

def _init_(self, patient_id, triage_id, available_date, summary):
self.patient_id = patient_id
self.triage_id = triage_id
self.available_date = available_date
self.summary = summary

@property
def patient_id(self):
return self.patient_id

@patient_id.setter
def patient_id(self, value):
self.patient_id = value

@property
def triage_id(self):
return self.triage_id

@triage_id.setter
def triage_id(self, value):
self.triage_id = value

@property
def available_date(self):
return self.available_date

@available_date.setter
def available_date(self, value):
self.available_date = value

@property
def summary(self):
return self.summary

@summary.setter
def summary(self, value):
self.summary = value





77 changes: 77 additions & 0 deletions Patient_Mangement/components/UserHealthInfo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
class UserHealthInfo:

def _init_(self, patient_id: str, height: float, weight: float, blood_type: str, blood_pressure: float, allergies: str, complications: str):
self.patient_id = patient_id
self.height = height
self.weight = weight
self.blood_type = blood_type
self.blood_pressure = blood_pressure
self.allergies = allergies
self.complication = complications

@property
def patient_id(self):
return self.patient_id

@patient_id.setter
def patient_id(self, value):
self.patient_id = value

@property
def height(self):
return self.height

@height.setter
def height(self, value):
self.height = value

@property
def weight(self):
return self.weight

@weight.setter
def weight(self, value):
self.weight = value

@property
def blood_type(self):
return self.blood_type

@blood_type.setter
def blood_type(self, value):
self.blood_type = value

@property
def blood_pressure(self):
return self.blood_pressure

@blood_pressure.setter
def blood_pressure(self, value):
self.blood_pressure = value

@property
def allergies(self):
return self.allergies

@allergies.setter
def allergies(self, value):
self.allergies = value

@property
def complication(self):
return self.complication

@complication.setter
def complication(self, value):
self.complication = value











51 changes: 51 additions & 0 deletions Patient_Mangement/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from fastapi import FastAPI
# from services import AccountInfoManagement, TriageManagement

app = FastAPI()
# manageTriage = TriageManagement()
# manageAccount = AccountInfoManagement()



@app.get("/{patient_id}/triages/")
async def get_triage_list(patient_id):
#mangeTriage.getTriageRecordList(patient_id)
return [
{
"patient_id": "13479",
"triage_id": "45382",
"available_date": "1944-06-06",
"summary": "Upon initial assessment, the patient, a 44-year-old male, presented with acute chest pain, shortness of breath, and profuse sweating. Vital signs upon arrival: BP 160/95 mmHg, HR 110 bpm, RR 22 breaths/min, Temp 98.6°F (37°C), and O2 Sat 92%. The patient described the pain as sharp, radiating to the left arm, and rated it 8/10 on the pain scale. ECG revealed ST-segment elevation in leads II, III, and aVF. The patient was categorized as Triage Level 2 - Emergency, requiring rapid medical intervention. He was promptly administered a chewable aspirin, nitroglycerin, and was prepared for further emergency diagnostic and therapeutic procedures. The patient's family was updated regarding the situation and the next steps in medical management."
},
{
"patient_id": "13479",
"triage_id": "10439",
"available_date": "1975-07-15",
"summary": "The 75-year-old male patient was urgently categorized as Triage Level 1 following a rapid assessment that identified severe respiratory distress, cyanosis, and a significantly altered level of consciousness. Immediate interventions, including airway management and high-flow oxygen therapy, were initiated, and the critical care team was mobilized to ensure advanced support and ongoing management of her critical condition."
},
{
"patient_id": "13479",
"triage_id": "86241",
"available_date": "1980-03-23",
"summary": "The 80-year-old male patient was classified as Triage Level 2 after an evaluation revealed persistent chest pain, mild dyspnea, and a history of hypertension. Quick interventions, such as administering nitroglycerin and continuous ECG monitoring, were employed, and the cardiology department was alerted for a comprehensive cardiac assessment."
}
]

@app.get("/{patient_id}/triages/{triage_id}")
async def get_specific_triage(patient_id, triage_id):
#mangeTriage.getTriageRecord(patient_id, triage_id)
return {
"patient_id": "13479",
"triage_id": "45382",
"available_date": "1944-06-06",
"summary": "Upon initial assessment, the patient, a 44-year-old male, presented with acute chest pain, shortness of breath, and profuse sweating. Vital signs upon arrival: BP 160/95 mmHg, HR 110 bpm, RR 22 breaths/min, Temp 98.6°F (37°C), and O2 Sat 92%. The patient described the pain as sharp, radiating to the left arm, and rated it 8/10 on the pain scale. ECG revealed ST-segment elevation in leads II, III, and aVF. The patient was categorized as Triage Level 2 - Emergency, requiring rapid medical intervention. He was promptly administered a chewable aspirin, nitroglycerin, and was prepared for further emergency diagnostic and therapeutic procedures. The patient's family was updated regarding the situation and the next steps in medical management."
}

@app.get("/{patient_id}/{username}-{password}/")
async def user_validation(username, password):
#manageAccount.validate_user(username, password)
if (username == "juliuscaesar") and (password == "js1544"):
return [True, "Login successful"]
else:
return [False, "Invalid username or password"]

52 changes: 52 additions & 0 deletions Patient_Mangement/services/AccountInfoManagement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
from components import UserHealthInfo, AccountInformation

class AccountInfoManagement():
def _init_(self):
# Initialize any necessary variables or data structures
pass

def validate_user(self, username: str, password: str) -> bool:
"""
Check if user credentials are correct by comparing the username and password.

Args:
username (str): Username of the user.
password (str): Password of the user.

Returns:
bool: True if the user's credentials are valid, False otherwise.
"""
pass


def get_user_info(self, patient_id: str) -> UserHealthInfo:
"""
Retrieve the user's health information based on the provided patient ID.

Args:
patient_id (str): The patient ID of the user.

Returns:
UserHealthInfo: A UserHealthInfo object containing the user's health information.
"""
pass


def create_account(self, account_info: AccountInformation, health_info: UserHealthInfo) -> str:
"""
Create a user account using provided account and health information.

Args:
account_info (AccountInformation): An object containing the user's
information to create an account.
health_info (UserHealthInfo): An object containing basic health
information to complete the account creation.

Returns:
str: Message confirming account creation, or indicating an unsuccessful attempt.
"""
pass




33 changes: 33 additions & 0 deletions Patient_Mangement/services/TriageManagement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
from components import TriageRecord
from typing import List

class ERService:
def _init_(self):
# Initialize any necessary variables or data structures
pass

def getTriageRecordList(self, patient_id) -> List:
"""
Retrieve a list of triage instances from a patient's history.

Args:
patient_id (str): ID of patient to check

Returns:
List: A list of TriageRecord objects, each containing basic information about individual triage instances in the patient's history.
"""
pass

def get_triage_record(self, patient_id: str, triage_id: str) -> TriageRecord:
"""
Retrieve a specific triage record from a patient's history.

Args:
patient_id (str): ID of the patient to check.
triage_id (str): ID of the triage to retrieve.

Returns:
TriageRecord: An object containing basic information about the specified triage.
"""
pass

Loading