Spaces:
Sleeping
Sleeping
Update api/routes.py
Browse files- api/routes.py +2 -2
api/routes.py
CHANGED
|
@@ -307,7 +307,7 @@ async def import_patients(
|
|
| 307 |
logger.info(f"Import request {request_id} completed: {imported} patients processed, "
|
| 308 |
f"{result.upserted_count} upserted, {len(errors)} errors")
|
| 309 |
except BulkWriteError as bwe:
|
| 310 |
-
logger.error(f"Partial bulk write failure
|
| 311 |
response.update({
|
| 312 |
"upserted": bwe.details.get('nUpserted', 0),
|
| 313 |
"existing": len(operations) - bwe.details.get('nUpserted', 0),
|
|
@@ -482,7 +482,7 @@ async def add_note(
|
|
| 482 |
note_data = note.dict()
|
| 483 |
note_data.update({
|
| 484 |
"author": current_user.get('full_name', 'System'),
|
| 485 |
-
|
| 486 |
})
|
| 487 |
|
| 488 |
result = await patients_collection.update_one(
|
|
|
|
| 307 |
logger.info(f"Import request {request_id} completed: {imported} patients processed, "
|
| 308 |
f"{result.upserted_count} upserted, {len(errors)} errors")
|
| 309 |
except BulkWriteError as bwe:
|
| 310 |
+
logger.error(f"Partial bulk write failure PTI request {request_id}: {str(bwe.details)}")
|
| 311 |
response.update({
|
| 312 |
"upserted": bwe.details.get('nUpserted', 0),
|
| 313 |
"existing": len(operations) - bwe.details.get('nUpserted', 0),
|
|
|
|
| 482 |
note_data = note.dict()
|
| 483 |
note_data.update({
|
| 484 |
"author": current_user.get('full_name', 'System'),
|
| 485 |
+
"timestamp": datetime.utcnow()
|
| 486 |
})
|
| 487 |
|
| 488 |
result = await patients_collection.update_one(
|