Welcome to myHealth’s documentation!¶
myHealth is a Python app that helps patients generate simple personal medical history reports for doctor’s appointments.
Note
The modules are:
myHealth : The main module which should be executed to run the programme. medication : Implements myMedication, which stores key information about the patient’s medications,
including their purpose, dosage, and dose times.
vitals : Implements myVitals, which tracks the patient’s vital signs (blood pressure, pulse, blood glucose levels). utility : Implements helper functions and exceptions used in the user interface. visualisation : Graphs the patient’s vitals records with beautiful, colourful charts.
utility implements helper functions and exceptions used in the user interface.
- Functions:
clear_screen clear_line clear_screen_deco : Decorate a function such that the screen is cleared before its execution. repeat : Decorate a function such that it is executed multiple times. clear_5_lines display : Print a line of text on the terminal window and clear it after the stipulated period. clear_and_display : Clear the screen before printing a line of text for a stipulated period. yes_or_no : Implement a simple command-line “yes-or-no” selector. backtrack : Allow the user to press the “enter” key to return to the parent menu. default_response (Not in use)
- Exceptions:
DuplicateError : Raise an exception if the user tries to create a duplicate Medicine object/vitals record.
- exception src.myHealth.utility.DuplicateError(name: str, destination: str)¶
Raise an exception if the user tries to create a Medicine object with a name that is already taken.
- msg¶
The error message to displayed.
- Type:
str
- src.myHealth.utility.backtrack(target: str) str ¶
Allow the user to press the “enter” key to return to the parent menu.
- Parameters:
target (str) – The name of the parent menu.
- Returns:
A redirection message to the user.
- Return type:
str
- src.myHealth.utility.clear_screen_deco(func)¶
Decorate a function such that the screen is cleared before its execution.
- Parameters:
func (function) – The function to be decorated.
- Returns:
The decorated function.
- Return type:
function
- src.myHealth.utility.display(text, pause: int = 3) None ¶
Print a line of text on the terminal window and clear it after the stipulated period.
- Parameters:
text – The line of text to be displayed.
pause (optional) – The time to elapse before the text is cleared. Defaults to 3.
- src.myHealth.utility.repeat(reps: int = 2)¶
Decorate a function such that it is executed multiple times.
- Parameters:
reps (int, optional) – The number of repetitions. Defaults to 2.
- src.myHealth.utility.yes_or_no(prompt: str) bool ¶
Implement a simple command-line “yes-or-no” selector.
- Parameters:
prompt – The instructions to be displayed.
- Returns:
The user’s choice.