Spaces:
Sleeping
Sleeping
Update api/routes/patients.py
Browse files- api/routes/patients.py +1 -10
api/routes/patients.py
CHANGED
|
@@ -146,15 +146,7 @@ async def delete_patient(
|
|
| 146 |
detail="Patient not found"
|
| 147 |
)
|
| 148 |
|
| 149 |
-
#
|
| 150 |
-
if patient.get('source') == 'synthea':
|
| 151 |
-
logger.warning(f"Attempt to delete Synthea patient: {patient_id}")
|
| 152 |
-
raise HTTPException(
|
| 153 |
-
status_code=status.HTTP_403_FORBIDDEN,
|
| 154 |
-
detail="Cannot delete Synthea-generated patients"
|
| 155 |
-
)
|
| 156 |
-
|
| 157 |
-
# Perform deletion
|
| 158 |
result = await patients_collection.delete_one({
|
| 159 |
"$or": [
|
| 160 |
{"_id": ObjectId(patient_id)},
|
|
@@ -186,7 +178,6 @@ async def delete_patient(
|
|
| 186 |
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
| 187 |
detail=f"Failed to delete patient: {str(e)}"
|
| 188 |
)
|
| 189 |
-
|
| 190 |
async def process_synthea_patient(bundle: dict, file_path: str) -> Optional[dict]:
|
| 191 |
logger.debug(f"Processing patient from file: {file_path}")
|
| 192 |
patient_data = {}
|
|
|
|
| 146 |
detail="Patient not found"
|
| 147 |
)
|
| 148 |
|
| 149 |
+
# Perform deletion (removed the source check)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
result = await patients_collection.delete_one({
|
| 151 |
"$or": [
|
| 152 |
{"_id": ObjectId(patient_id)},
|
|
|
|
| 178 |
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
|
| 179 |
detail=f"Failed to delete patient: {str(e)}"
|
| 180 |
)
|
|
|
|
| 181 |
async def process_synthea_patient(bundle: dict, file_path: str) -> Optional[dict]:
|
| 182 |
logger.debug(f"Processing patient from file: {file_path}")
|
| 183 |
patient_data = {}
|