feat(csv-import): Enhance CSV import processing and validation
- Updated the CSV import logic to support new row processing specifications for weight and vitals baseline, allowing for better data aggregation and validation. - Implemented handling for multiple rows on the same day, enabling aggregation of values such as averages for vitals and last values for weight. - Enhanced test coverage for the new import functionalities, ensuring correct behavior during data processing and validation. - Refactored the module registry to include default import row processing options for better flexibility in handling CSV data.
This commit is contained in:
1 parent
c0fcdea1fe
commit
e35d167055
5 files changed
+165
-9
No files matched your search
@@ -69,6 +69,16 @@ MODULE_DEFINITIONS: Dict[str, Dict[str, Any]] = {
|
||||
},
|
||||
"duplicate_key": ["profile_id", "date"],
|
||||
"duplicate_strategy": "update",
|
||||
"import_row_processing_default": {
|
||||
"group_by": ["date"],
|
||||
"aggregates": {
|
||||
"resting_hr": "mean",
|
||||
"hrv": "mean",
|
||||
"vo2_max": "mean",
|
||||
"spo2": "mean",
|
||||
"respiratory_rate": "mean",
|
||||
},
|
||||
},
|
||||
},
|
||||
"blood_pressure": {
|
||||
"table": "blood_pressure_log",
|
||||
@@ -92,6 +102,14 @@ MODULE_DEFINITIONS: Dict[str, Dict[str, Any]] = {
|
||||
},
|
||||
"duplicate_key": ["profile_id", "date"],
|
||||
"duplicate_strategy": "update",
|
||||
# Mehrere CSV-Zeilen pro Tag → ein Eintrag (letzte Zeile im Export zählt)
|
||||
"import_row_processing_default": {
|
||||
"group_by": ["date"],
|
||||
"aggregates": {
|
||||
"weight": "last",
|
||||
"note": "last",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user