Spaces:
Sleeping
Sleeping
teest
Browse files- api/routes/patients.py +2 -4
api/routes/patients.py
CHANGED
|
@@ -258,7 +258,7 @@ async def process_synthea_patient(bundle: dict, file_path: str) -> Optional[dict
|
|
| 258 |
raw_full_name = f"{' '.join(name.get('given', ['']))} {name.get('family', '')}".strip()
|
| 259 |
clean_full_name = re.sub(r'\d+', '', raw_full_name).strip()
|
| 260 |
|
| 261 |
-
|
| 262 |
'fhir_id': resource.get('id'),
|
| 263 |
'full_name': clean_full_name,
|
| 264 |
'gender': resource.get('gender', 'unknown'),
|
|
@@ -318,7 +318,7 @@ async def process_synthea_patient(bundle: dict, file_path: str) -> Optional[dict
|
|
| 318 |
logger.error(f"Error processing {resource_type} in {file_path}: {str(e)}")
|
| 319 |
continue
|
| 320 |
|
| 321 |
-
|
| 322 |
patient_data.update({
|
| 323 |
'allergies': [], # Convert conditions to allergies if needed
|
| 324 |
'chronic_conditions': conditions,
|
|
@@ -328,8 +328,6 @@ async def process_synthea_patient(bundle: dict, file_path: str) -> Optional[dict
|
|
| 328 |
'medical_notes': '',
|
| 329 |
'emergency_contact_name': '',
|
| 330 |
'emergency_contact_phone': '',
|
| 331 |
-
'insurance_provider': '',
|
| 332 |
-
'insurance_policy_number': '',
|
| 333 |
'national_id': '',
|
| 334 |
'blood_type': ''
|
| 335 |
})
|
|
|
|
| 258 |
raw_full_name = f"{' '.join(name.get('given', ['']))} {name.get('family', '')}".strip()
|
| 259 |
clean_full_name = re.sub(r'\d+', '', raw_full_name).strip()
|
| 260 |
|
| 261 |
+
patient_data = {
|
| 262 |
'fhir_id': resource.get('id'),
|
| 263 |
'full_name': clean_full_name,
|
| 264 |
'gender': resource.get('gender', 'unknown'),
|
|
|
|
| 318 |
logger.error(f"Error processing {resource_type} in {file_path}: {str(e)}")
|
| 319 |
continue
|
| 320 |
|
| 321 |
+
if patient_data:
|
| 322 |
patient_data.update({
|
| 323 |
'allergies': [], # Convert conditions to allergies if needed
|
| 324 |
'chronic_conditions': conditions,
|
|
|
|
| 328 |
'medical_notes': '',
|
| 329 |
'emergency_contact_name': '',
|
| 330 |
'emergency_contact_phone': '',
|
|
|
|
|
|
|
| 331 |
'national_id': '',
|
| 332 |
'blood_type': ''
|
| 333 |
})
|