feat(csv-import): Add blood pressure and activity row diagnosis functionality
- Introduced `diagnose_blood_pressure_row` and `diagnose_activity_row` functions to validate and analyze blood pressure and activity data from CSV imports. - Updated the CSV import logic to handle combined datetime columns for blood pressure and activity, improving data integrity during import. - Enhanced type conversion specifications to include `start_time` for blood pressure and activity, ensuring accurate data mapping. - Added tests to validate the new diagnosis functions and their integration with existing import processes, ensuring robustness and reliability. - Updated frontend messages to provide clearer guidance on blood pressure and activity data handling during CSV imports.
This commit is contained in:
1 parent
c5b0540b11
commit
5b96bd4f75
9 files changed
+295
-9
No files matched your search
@@ -15,7 +15,12 @@ from auth import require_auth, check_feature_access, increment_feature_usage
|
||||
from feature_logger import log_feature_usage
|
||||
from db import get_db, get_cursor, r2d
|
||||
from routers.profiles import get_pid
|
||||
from csv_parser.executor import diagnose_vitals_row, run_universal_csv_import
|
||||
from csv_parser.executor import (
|
||||
diagnose_activity_row,
|
||||
diagnose_blood_pressure_row,
|
||||
diagnose_vitals_row,
|
||||
run_universal_csv_import,
|
||||
)
|
||||
from csv_parser.core import (
|
||||
decode_raw_bytes,
|
||||
column_signature,
|
||||
@@ -392,6 +397,10 @@ async def csv_import_diagnose(
|
||||
}
|
||||
if exec_module == "vitals_baseline":
|
||||
entry["vitals"] = diagnose_vitals_row(typed)
|
||||
elif exec_module == "blood_pressure":
|
||||
entry["blood_pressure"] = diagnose_blood_pressure_row(typed)
|
||||
elif exec_module == "activity":
|
||||
entry["activity"] = diagnose_activity_row(typed)
|
||||
rows_out.append(entry)
|
||||
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user