SlideShare a Scribd company logo
1 of 7
Download to read offline
In this programming assignment, you will be creating a Health Information System that uses
biomedical signals to produce an electronic medical record for each patient. The system will read
patient data from a plain-text file that is separated by commas, allowing new patient information
to be added through user input to update the plain-text file..
In programming, the term "backend" refers to the part of a software system or application that is
responsible for handling data processing, and other functionality that is not directly visible to the
user. This includes database management, and other aspects of a system that do not involve the
user interface (UI). The backend is typically responsible for processing requests and delivering
data to the frontend (user-facing part of the software) for display to the user. It is often designed
to be scalable, flexible, and able to handle large volumes of data efficiently.
Though we will not be focusing on User-Interface design (UXD) in this assignment, your work
in this assignment will provide a possible core information system backend to help improve a
healthcare system.
The program will provide the following features, plus more as described in the function sections
below:
A function to read patient data from a plaintext file.
A function to display various statistics about the patients, such as the average vital signs about
the patients or for a specific patient.
A function to display patient data for all patients or for a specific patient by ID.
A function to add new patient data to the patient list.
A function to find patient visits in a certain month or year
A function to find patients who need follow-ups depending on their vital statistics
A text-based interface to list the patients and allow the user to select which feature they would
like to use.
We will use a text file containing data from patient visits in a file, called patients.txt. The file
contains one line for every unique visit by any patient to the clinic. Note that it is possible that
each patient may visit the clinic multiple times. The file has the following columns, with each
data element being separated with a comma and each new record on a new line.
The data in the file will look like the following:
1
2
3
4
5
6
1,2022-06-01,37.2,72,16,120,80,97
1,2022-09-15,37.5,73,18,125,82,96
2,2022-06-10,36.9,69,18,123,80,96
2,2023-01-03,37.1,71,19,124,81,97
3,2022-08-05,37.3,74,20,126,83,95
3,2023-03-01,37.4,75,18,123,79,98
This data will be structured with the delimiter being a comma, and the types of information as
follows:
Patient ID
Integer
Date of visit (YYYY-MM-DD)
String
Body temperature (Celsius)
Float
Heart rate (beats per minute)
Integer
Respiratory rate (breaths per minute)
Integer
Systolic blood pressure (mmHg)
Integer
Diastolic blood pressure (mmHg)
Integer
Oxygen saturation (%)
Integer
A full sample dataset is available online with the .txt extension. For testing purposes, you are
strongly encouraged to create your own datasets following the above convention to test your
code more thoroughly.
You are provided a sample main.py file with indications where youll put your own
implementation. You will submit one file named main.py to Gradescope. Please do not modify
the main function in this file.
Links to Provided Files:
main.py
This file contains the definitions of the functions you will write, as well as the main program the
creates the interface.
You will write code to implement these functions as per the specifications at the location
indicated by a comment "#Put your code here".
patients.txt
This is one sample dataset containing visits of patients and their medical data. You can use this
for testing. We encourage you to modify it and test with different data.
FUNCTION FIVE:
This function finds the visits by date provided and returns a list of tuples. See below.
1
2
3
4
5
6
7
8
9
def findVisitsByDate(patients, year=None, month=None):
"""
Find visits by year, month, or both.
patients: A dictionary of patient IDs, where each patient has a list of visits.
year: The year to filter by.
month: The month to filter by.
return: A list of tuples containing patient ID and visit that match the filter.
"""
The function should take in a dictionary of patient IDs, where each patient has a list of visits, as
well as an optional year and/or month to filter the visits by.
The function can accept a year only, or both a year and a month. It can't accept a month only:
If the year is only provided, the function returns all visits occurred in that year regardless of the
month and day.
If the month and year are provided, the function returns all visits occurred in that month of the
provided year regardless of the day.
If no year and/or month is provided, the function should return all visits for all patients.
The function should ignore visits in the dataset with incomplete or invalid date information (i.e.
dates that are missing year, month, or day).
For example, if the text file contained:
1
2
3
4
5
6
1,2022-06-01,37.2,72,16,120,80,97
1,2022-09-15,37.5,73,18,125,82,96
2,2022-07-10,36.9,69,18,123,80,96
2,2023-01-03,37.1,71,19,124,81,97
3,2022-08-05,37.3,74,20,126,83,95
3,2023-03-01,37.4,75,18,123,79,98
And month: 6 and year 2022 was provided, your function should return this:
1
[(1, ['2022-06-01', 37.2, 72, 16, 120, 80, 97]), (2, ['2022-06-10', 36.9, 69, 18, 123, 80, 96])]
The function should handle the case where the patient dictionary is empty, or where the patient
dictionary is not empty, but there are no visits in the given year/month . In these cases, your
program should return an empty list.
The function should handle the case where an invalid year or month is provided (e.g, the 14th
month or 35th day, etc) by ignoring the filter and returning an empty list.
The function should return a list of tuples where each tuple contains the patient ID (an integer)
and visit (a list).
The visit list should contain the following information in this order: date (a string in the format
'yyyy-mm-dd'), temperature (a float), heart rate (an integer), respiratory rate (an integer), systolic
blood pressure (an integer), diastolic blood pressure (an integer), and oxygen saturation (an
integer).
FUNCTION SIX:
1
2
3
4
5
6
7
def findPatientsWhoNeedFollowUp(patients):
"""
Find patients who need follow-up visits based on abnormal vital signs.
patients: A dictionary of patient IDs, where each patient has a list of visits.
return: A list of patient IDs that need follow-up visits due to abnormal health stats.
"""
The function takes in a dictionary of patient IDs and their visits as input.
It checks each visit of each patient for abnormal vital signs (heart rate, systolic and diastolic
blood pressure, and oxygen saturation level) using if conditions.
If any visit has any of the abnormal vital signs, the patient's ID is added to the followup_patients
list.
For the assignment, well assume if any of the following are true, the patient needs a followup
Heart rate > 100 or heart rate is < 60 or systolic is > 140 or diastolic is > 90 or blood oxygen
saturation is < 90:
The function returns a list of patient IDs that need follow-up visits.
If no patients require a follow-up, return an empty list.
The function should return a list of integers representing the patient IDs that need follow-up
visits.
Note that the main program provided will handle printing this list out for you.
For debugging/testing purposes, consider printing out the contents of your list, then removing
this print statement before submitting.
FUNCTION SEVEN:
1
2
3
4
5
6
7
8
9
def deleteAllVisitsOfPatient(patients, patientId, filename):
"""
Delete all visits of a particular patient.
patients: The dictionary of patient IDs, where each patient has a list of visits, to delete data
from.
patientId: The ID of the patient to delete data for.
filename: The name of the file to save the updated patient data.
return: None
"""
The function deleteAllVisitsOfPatient deletes all visits of a particular patient from the patients
dictionary.
It rewrites the text file with the updated patient data.
Arguments:
patients: A dictionary of patient IDs, where each patient has a list of visits.
patientId: The ID of the patient to delete data for.
filename: The name of the file to save the updated patient data.
If patientId is not found in patients, print "No data found for patient with ID {patientId}".
If data for the patient with patientId is deleted, print "Data for patient {patientId} has been
deleted.".
No output if patientId is not found in patients.
1
2
3
4
5
6
1,2022-06-01,37.2,72,16,120,80,97
1,2022-09-15,37.5,73,18,125,82,96
2,2022-06-10,36.9,69,18,123,80,96
2,2023-01-03,37.1,71,19,124,81,97
3,2022-08-05,37.3,74,20,126,83,95
3,2023-03-01,37.4,75,18,123,79,98 Welcome to the Health Information System 1. Display all
patient data 2. Display patient data by ID 3. Add patient data 4. Display patient statistics 5. Find
visits by year, month, or both 6. Find patients who need follow-up 7. Delete all visits of a
particular patient 8. Quit Enter your choice (18) :
- If the temperature value is not within the range of 35 to 42 , print the message: "Invalid
temperature value ([temp]) in line: [line]" And skips to the next line - If the heart rate value is not
within the range of 30 to 180 , print the message: "Invalid heart rate value ([hr]) in line: [line]"
And skips to the next line - If the respiratory rate value is not within the range of 5 to 40 , print
the message: "Invalid respiratory rate value ([rr]) in line: [line]" And skips to the next line - If the
systolic blood pressure value is not within the range of 70 to 200 , print the message: "Invalid
systolic blood pressure value ([sbp]) in line: [line]" And skips to the next line - If the diastolic
blood pressure value is not within the range of 40 to 120 , print the message: "Invalid diastolic
blood pressure value ([dbp]) in line: [line]" - If the oxygen saturation value is not within the
range of 70 to 100 , print the message: "Invalid oxygen saturation value ([spo2]) in line: [line]"
And skips to the next line

More Related Content

Similar to In this programming assignment, you will be creating a Health Inform.pdf

SRS for Hospital Management System
SRS for Hospital Management SystemSRS for Hospital Management System
SRS for Hospital Management Systemkataria Arvind
 
Heart Disease Prediction Using Data Mining
Heart Disease Prediction Using Data MiningHeart Disease Prediction Using Data Mining
Heart Disease Prediction Using Data MiningIRJET Journal
 
Hospital Management System Project
Hospital Management System ProjectHospital Management System Project
Hospital Management System ProjectSanjit Yadav
 
20137 mini projectdocumentation
20137 mini projectdocumentation20137 mini projectdocumentation
20137 mini projectdocumentationPriyankaSonawane40
 
Heart Disease Prediction using Machine Learning Algorithms
Heart Disease Prediction using Machine Learning AlgorithmsHeart Disease Prediction using Machine Learning Algorithms
Heart Disease Prediction using Machine Learning AlgorithmsIRJET Journal
 
76 s201915
76 s20191576 s201915
76 s201915IJRAT
 
Heart Disease Prediction using Machine Learning
Heart Disease Prediction using Machine LearningHeart Disease Prediction using Machine Learning
Heart Disease Prediction using Machine LearningIRJET Journal
 
Health Analyzer System
Health Analyzer SystemHealth Analyzer System
Health Analyzer SystemIRJET Journal
 
Blood bank Management System Salesforce
Blood bank Management System SalesforceBlood bank Management System Salesforce
Blood bank Management System Salesforcesonalighai
 
Smart Healthcare Prediction System Using Machine Learning
Smart Healthcare Prediction System Using Machine LearningSmart Healthcare Prediction System Using Machine Learning
Smart Healthcare Prediction System Using Machine LearningIRJET Journal
 
Ijarcet vol-2-issue-4-1393-1397
Ijarcet vol-2-issue-4-1393-1397Ijarcet vol-2-issue-4-1393-1397
Ijarcet vol-2-issue-4-1393-1397Editor IJARCET
 
Inventory manangement for medicine place finder
Inventory manangement for medicine place finderInventory manangement for medicine place finder
Inventory manangement for medicine place finderIRJET Journal
 
Hospital erp system
Hospital erp systemHospital erp system
Hospital erp systemAsma queen
 
Healthcare quality management certification
Healthcare quality management certificationHealthcare quality management certification
Healthcare quality management certificationselinasimpson361
 
IRJET- Heart Disease Prediction System
IRJET- Heart Disease Prediction SystemIRJET- Heart Disease Prediction System
IRJET- Heart Disease Prediction SystemIRJET Journal
 
E hdas e- healthcare diagnosis & advisory system
E  hdas e- healthcare diagnosis & advisory systemE  hdas e- healthcare diagnosis & advisory system
E hdas e- healthcare diagnosis & advisory systemeSAT Publishing House
 
Health Management System
Health Management SystemHealth Management System
Health Management SystemAsima Sadia
 

Similar to In this programming assignment, you will be creating a Health Inform.pdf (20)

SRS for Hospital Management System
SRS for Hospital Management SystemSRS for Hospital Management System
SRS for Hospital Management System
 
Heart Disease Prediction Using Data Mining
Heart Disease Prediction Using Data MiningHeart Disease Prediction Using Data Mining
Heart Disease Prediction Using Data Mining
 
Hospital Management System Project
Hospital Management System ProjectHospital Management System Project
Hospital Management System Project
 
Hospital management
Hospital managementHospital management
Hospital management
 
20137 mini projectdocumentation
20137 mini projectdocumentation20137 mini projectdocumentation
20137 mini projectdocumentation
 
K-MEANS AND D-STREAM ALGORITHM IN HEALTHCARE
K-MEANS AND D-STREAM ALGORITHM IN HEALTHCAREK-MEANS AND D-STREAM ALGORITHM IN HEALTHCARE
K-MEANS AND D-STREAM ALGORITHM IN HEALTHCARE
 
Heart Disease Prediction using Machine Learning Algorithms
Heart Disease Prediction using Machine Learning AlgorithmsHeart Disease Prediction using Machine Learning Algorithms
Heart Disease Prediction using Machine Learning Algorithms
 
VEPSER
VEPSERVEPSER
VEPSER
 
76 s201915
76 s20191576 s201915
76 s201915
 
Heart Disease Prediction using Machine Learning
Heart Disease Prediction using Machine LearningHeart Disease Prediction using Machine Learning
Heart Disease Prediction using Machine Learning
 
Health Analyzer System
Health Analyzer SystemHealth Analyzer System
Health Analyzer System
 
Blood bank Management System Salesforce
Blood bank Management System SalesforceBlood bank Management System Salesforce
Blood bank Management System Salesforce
 
Smart Healthcare Prediction System Using Machine Learning
Smart Healthcare Prediction System Using Machine LearningSmart Healthcare Prediction System Using Machine Learning
Smart Healthcare Prediction System Using Machine Learning
 
Ijarcet vol-2-issue-4-1393-1397
Ijarcet vol-2-issue-4-1393-1397Ijarcet vol-2-issue-4-1393-1397
Ijarcet vol-2-issue-4-1393-1397
 
Inventory manangement for medicine place finder
Inventory manangement for medicine place finderInventory manangement for medicine place finder
Inventory manangement for medicine place finder
 
Hospital erp system
Hospital erp systemHospital erp system
Hospital erp system
 
Healthcare quality management certification
Healthcare quality management certificationHealthcare quality management certification
Healthcare quality management certification
 
IRJET- Heart Disease Prediction System
IRJET- Heart Disease Prediction SystemIRJET- Heart Disease Prediction System
IRJET- Heart Disease Prediction System
 
E hdas e- healthcare diagnosis & advisory system
E  hdas e- healthcare diagnosis & advisory systemE  hdas e- healthcare diagnosis & advisory system
E hdas e- healthcare diagnosis & advisory system
 
Health Management System
Health Management SystemHealth Management System
Health Management System
 

More from sanjeevbansal1970

In the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdfIn the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdfsanjeevbansal1970
 
In the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdfIn the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdfsanjeevbansal1970
 
In the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdfIn the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdfsanjeevbansal1970
 
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdfIn PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdfsanjeevbansal1970
 
In the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdfIn the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdfsanjeevbansal1970
 
In the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdfIn the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdfsanjeevbansal1970
 
in the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdfin the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdfsanjeevbansal1970
 
In which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdfIn which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdfsanjeevbansal1970
 
In the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdfIn the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdfsanjeevbansal1970
 
In Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdfIn Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdfsanjeevbansal1970
 
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdfIn the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdfsanjeevbansal1970
 
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdfJohn y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdfsanjeevbansal1970
 
John is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdfJohn is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdfsanjeevbansal1970
 
John and Sara are married and live in AZ. They do not have a prenup.pdf
John and Sara are married and live in AZ.  They do not have a prenup.pdfJohn and Sara are married and live in AZ.  They do not have a prenup.pdf
John and Sara are married and live in AZ. They do not have a prenup.pdfsanjeevbansal1970
 
In Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdfIn Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdfsanjeevbansal1970
 
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdfJoel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdfsanjeevbansal1970
 
Jin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdfJin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdfsanjeevbansal1970
 
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdfJJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdfsanjeevbansal1970
 
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdfJim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdfsanjeevbansal1970
 
Jean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdfJean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdfsanjeevbansal1970
 

More from sanjeevbansal1970 (20)

In the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdfIn the year 3000, engineers at MIT finally created the technology ne.pdf
In the year 3000, engineers at MIT finally created the technology ne.pdf
 
In the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdfIn the context of fraud explain the differences between (1) incentiv.pdf
In the context of fraud explain the differences between (1) incentiv.pdf
 
In the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdfIn the article liars dont qualify by Junius Edwards, What does the .pdf
In the article liars dont qualify by Junius Edwards, What does the .pdf
 
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdfIn PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
In PYTHON please. I will upvote!Problem 1.8 Case Study Bounc.pdf
 
In the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdfIn the early 1970s, the US economy experienced a strong increase in.pdf
In the early 1970s, the US economy experienced a strong increase in.pdf
 
In the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdfIn the context of crystallization of monazite in a silicate melt, La.pdf
In the context of crystallization of monazite in a silicate melt, La.pdf
 
in the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdfin the article liars dont qualify, y Junius Edwards, What does the .pdf
in the article liars dont qualify, y Junius Edwards, What does the .pdf
 
In which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdfIn which of the following ways can you not use a subquery in a SELEC.pdf
In which of the following ways can you not use a subquery in a SELEC.pdf
 
In the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdfIn the Government of Canada, individuals within departments to whom .pdf
In the Government of Canada, individuals within departments to whom .pdf
 
In Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdfIn Xcode, Using decomposition, type the code that will most efficien.pdf
In Xcode, Using decomposition, type the code that will most efficien.pdf
 
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdfIn the article liars dont qualify by Junius Edwards, What is the pu.pdf
In the article liars dont qualify by Junius Edwards, What is the pu.pdf
 
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdfJohn y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
John y Jim tienen aversi�n al riesgo y solo se preocupan por la medi.pdf
 
John is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdfJohn is a minor who lives with his mother and stepfather and not his.pdf
John is a minor who lives with his mother and stepfather and not his.pdf
 
John and Sara are married and live in AZ. They do not have a prenup.pdf
John and Sara are married and live in AZ.  They do not have a prenup.pdfJohn and Sara are married and live in AZ.  They do not have a prenup.pdf
John and Sara are married and live in AZ. They do not have a prenup.pdf
 
In Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdfIn Visual Studios C# console app using multiple class files create a.pdf
In Visual Studios C# console app using multiple class files create a.pdf
 
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdfJoel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
Joel y Maria tienen un hijo llamado David, un estudiante de 20 a�os .pdf
 
Jin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdfJin has configured File History on his Windows 10 computer using an .pdf
Jin has configured File History on his Windows 10 computer using an .pdf
 
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdfJJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
JJ firm has a return on equity of 15 percent, a return on assets of 10.pdf
 
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdfJim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
Jim Harrod, hizmetin her eyden �nce m�terileri i�in �nemli olduunu b.pdf
 
Jean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdfJean has her first child at age 14. By the time she is 30, she has f.pdf
Jean has her first child at age 14. By the time she is 30, she has f.pdf
 

Recently uploaded

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 

Recently uploaded (20)

social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 

In this programming assignment, you will be creating a Health Inform.pdf

  • 1. In this programming assignment, you will be creating a Health Information System that uses biomedical signals to produce an electronic medical record for each patient. The system will read patient data from a plain-text file that is separated by commas, allowing new patient information to be added through user input to update the plain-text file.. In programming, the term "backend" refers to the part of a software system or application that is responsible for handling data processing, and other functionality that is not directly visible to the user. This includes database management, and other aspects of a system that do not involve the user interface (UI). The backend is typically responsible for processing requests and delivering data to the frontend (user-facing part of the software) for display to the user. It is often designed to be scalable, flexible, and able to handle large volumes of data efficiently. Though we will not be focusing on User-Interface design (UXD) in this assignment, your work in this assignment will provide a possible core information system backend to help improve a healthcare system. The program will provide the following features, plus more as described in the function sections below: A function to read patient data from a plaintext file. A function to display various statistics about the patients, such as the average vital signs about the patients or for a specific patient. A function to display patient data for all patients or for a specific patient by ID. A function to add new patient data to the patient list. A function to find patient visits in a certain month or year A function to find patients who need follow-ups depending on their vital statistics A text-based interface to list the patients and allow the user to select which feature they would like to use. We will use a text file containing data from patient visits in a file, called patients.txt. The file contains one line for every unique visit by any patient to the clinic. Note that it is possible that each patient may visit the clinic multiple times. The file has the following columns, with each data element being separated with a comma and each new record on a new line. The data in the file will look like the following: 1 2 3 4 5
  • 2. 6 1,2022-06-01,37.2,72,16,120,80,97 1,2022-09-15,37.5,73,18,125,82,96 2,2022-06-10,36.9,69,18,123,80,96 2,2023-01-03,37.1,71,19,124,81,97 3,2022-08-05,37.3,74,20,126,83,95 3,2023-03-01,37.4,75,18,123,79,98 This data will be structured with the delimiter being a comma, and the types of information as follows: Patient ID Integer Date of visit (YYYY-MM-DD) String Body temperature (Celsius) Float Heart rate (beats per minute) Integer Respiratory rate (breaths per minute) Integer Systolic blood pressure (mmHg) Integer Diastolic blood pressure (mmHg) Integer Oxygen saturation (%) Integer A full sample dataset is available online with the .txt extension. For testing purposes, you are strongly encouraged to create your own datasets following the above convention to test your code more thoroughly. You are provided a sample main.py file with indications where youll put your own implementation. You will submit one file named main.py to Gradescope. Please do not modify the main function in this file. Links to Provided Files: main.py This file contains the definitions of the functions you will write, as well as the main program the creates the interface.
  • 3. You will write code to implement these functions as per the specifications at the location indicated by a comment "#Put your code here". patients.txt This is one sample dataset containing visits of patients and their medical data. You can use this for testing. We encourage you to modify it and test with different data. FUNCTION FIVE: This function finds the visits by date provided and returns a list of tuples. See below. 1 2 3 4 5 6 7 8 9 def findVisitsByDate(patients, year=None, month=None): """ Find visits by year, month, or both. patients: A dictionary of patient IDs, where each patient has a list of visits. year: The year to filter by. month: The month to filter by. return: A list of tuples containing patient ID and visit that match the filter. """ The function should take in a dictionary of patient IDs, where each patient has a list of visits, as well as an optional year and/or month to filter the visits by. The function can accept a year only, or both a year and a month. It can't accept a month only: If the year is only provided, the function returns all visits occurred in that year regardless of the
  • 4. month and day. If the month and year are provided, the function returns all visits occurred in that month of the provided year regardless of the day. If no year and/or month is provided, the function should return all visits for all patients. The function should ignore visits in the dataset with incomplete or invalid date information (i.e. dates that are missing year, month, or day). For example, if the text file contained: 1 2 3 4 5 6 1,2022-06-01,37.2,72,16,120,80,97 1,2022-09-15,37.5,73,18,125,82,96 2,2022-07-10,36.9,69,18,123,80,96 2,2023-01-03,37.1,71,19,124,81,97 3,2022-08-05,37.3,74,20,126,83,95 3,2023-03-01,37.4,75,18,123,79,98 And month: 6 and year 2022 was provided, your function should return this: 1 [(1, ['2022-06-01', 37.2, 72, 16, 120, 80, 97]), (2, ['2022-06-10', 36.9, 69, 18, 123, 80, 96])] The function should handle the case where the patient dictionary is empty, or where the patient dictionary is not empty, but there are no visits in the given year/month . In these cases, your program should return an empty list. The function should handle the case where an invalid year or month is provided (e.g, the 14th month or 35th day, etc) by ignoring the filter and returning an empty list. The function should return a list of tuples where each tuple contains the patient ID (an integer) and visit (a list). The visit list should contain the following information in this order: date (a string in the format 'yyyy-mm-dd'), temperature (a float), heart rate (an integer), respiratory rate (an integer), systolic blood pressure (an integer), diastolic blood pressure (an integer), and oxygen saturation (an integer). FUNCTION SIX:
  • 5. 1 2 3 4 5 6 7 def findPatientsWhoNeedFollowUp(patients): """ Find patients who need follow-up visits based on abnormal vital signs. patients: A dictionary of patient IDs, where each patient has a list of visits. return: A list of patient IDs that need follow-up visits due to abnormal health stats. """ The function takes in a dictionary of patient IDs and their visits as input. It checks each visit of each patient for abnormal vital signs (heart rate, systolic and diastolic blood pressure, and oxygen saturation level) using if conditions. If any visit has any of the abnormal vital signs, the patient's ID is added to the followup_patients list. For the assignment, well assume if any of the following are true, the patient needs a followup Heart rate > 100 or heart rate is < 60 or systolic is > 140 or diastolic is > 90 or blood oxygen saturation is < 90: The function returns a list of patient IDs that need follow-up visits. If no patients require a follow-up, return an empty list. The function should return a list of integers representing the patient IDs that need follow-up visits. Note that the main program provided will handle printing this list out for you. For debugging/testing purposes, consider printing out the contents of your list, then removing this print statement before submitting. FUNCTION SEVEN: 1 2 3 4
  • 6. 5 6 7 8 9 def deleteAllVisitsOfPatient(patients, patientId, filename): """ Delete all visits of a particular patient. patients: The dictionary of patient IDs, where each patient has a list of visits, to delete data from. patientId: The ID of the patient to delete data for. filename: The name of the file to save the updated patient data. return: None """ The function deleteAllVisitsOfPatient deletes all visits of a particular patient from the patients dictionary. It rewrites the text file with the updated patient data. Arguments: patients: A dictionary of patient IDs, where each patient has a list of visits. patientId: The ID of the patient to delete data for. filename: The name of the file to save the updated patient data. If patientId is not found in patients, print "No data found for patient with ID {patientId}". If data for the patient with patientId is deleted, print "Data for patient {patientId} has been deleted.". No output if patientId is not found in patients. 1 2 3 4 5 6 1,2022-06-01,37.2,72,16,120,80,97 1,2022-09-15,37.5,73,18,125,82,96
  • 7. 2,2022-06-10,36.9,69,18,123,80,96 2,2023-01-03,37.1,71,19,124,81,97 3,2022-08-05,37.3,74,20,126,83,95 3,2023-03-01,37.4,75,18,123,79,98 Welcome to the Health Information System 1. Display all patient data 2. Display patient data by ID 3. Add patient data 4. Display patient statistics 5. Find visits by year, month, or both 6. Find patients who need follow-up 7. Delete all visits of a particular patient 8. Quit Enter your choice (18) : - If the temperature value is not within the range of 35 to 42 , print the message: "Invalid temperature value ([temp]) in line: [line]" And skips to the next line - If the heart rate value is not within the range of 30 to 180 , print the message: "Invalid heart rate value ([hr]) in line: [line]" And skips to the next line - If the respiratory rate value is not within the range of 5 to 40 , print the message: "Invalid respiratory rate value ([rr]) in line: [line]" And skips to the next line - If the systolic blood pressure value is not within the range of 70 to 200 , print the message: "Invalid systolic blood pressure value ([sbp]) in line: [line]" And skips to the next line - If the diastolic blood pressure value is not within the range of 40 to 120 , print the message: "Invalid diastolic blood pressure value ([dbp]) in line: [line]" - If the oxygen saturation value is not within the range of 70 to 100 , print the message: "Invalid oxygen saturation value ([spo2]) in line: [line]" And skips to the next line