Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,6 +42,25 @@ class ReminderStatus(Enum):
|
|
42 |
def save_user_data(user_id: str, patient_name: str, dr_name: str, prescription_date: datetime,
|
43 |
age: int, sex: str, medicines: list, notification_type: str = "Push",
|
44 |
notification_time: int = 30, status: ReminderStatus = ReminderStatus.ACTIVE):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
reminder = {
|
46 |
"user_id": user_id,
|
47 |
"patient_name": patient_name,
|
|
|
42 |
def save_user_data(user_id: str, patient_name: str, dr_name: str, prescription_date: datetime,
|
43 |
age: int, sex: str, medicines: list, notification_type: str = "Push",
|
44 |
notification_time: int = 30, status: ReminderStatus = ReminderStatus.ACTIVE):
|
45 |
+
"""
|
46 |
+
Adds a new patient-related reminder to the MongoDB collection, allowing multiple medicines for Flutter notifications.
|
47 |
+
|
48 |
+
Args:
|
49 |
+
user_id: Identifier for the user creating the reminder.
|
50 |
+
patient_name: Name of the patient.
|
51 |
+
dr_name: Name of the doctor.
|
52 |
+
prescription_date: ISO Format Date of the prescription (typically today) for example, "2000-10-31T01:30:00.000-05:00".
|
53 |
+
age: Age of the patient.
|
54 |
+
sex: Sex of the patient.
|
55 |
+
medicines: List of medicines, where each medicine is a dictionary with 'name', 'dosage', 'frequency', and 'refill_date'.
|
56 |
+
notification_type: Type of notification to send (e.g., "Push" for app notifications).
|
57 |
+
notification_time: Time before the reminder should trigger (in minutes).
|
58 |
+
status: Current status of the reminder (active, completed, etc.).
|
59 |
+
|
60 |
+
Returns:
|
61 |
+
The inserted document ID.
|
62 |
+
"""
|
63 |
+
|
64 |
reminder = {
|
65 |
"user_id": user_id,
|
66 |
"patient_name": patient_name,
|