Task:
- In file
update.py, function append_overrides() instead of detecting duplicate overrides and failing (using exit(1)) find all rows affecting the same doctor position by looking at doctor, type, id_inst (index columns)
- merge the rows affecting the same doctor position by applying chronologically the latest (by looking at
date_override) non-empty values (in columns accepts_override, availability_override, address, city, post, phone, website, email, orderform) on top of the earlier values.
- Treat address columns (in columns
address, city, post) as one - always take the latest all 3 fields fields to form complete address (take all 3 latest field values even if city is empty but both other fields are provided)
- keep the latest
date_override at each doctor position
- save the deduplicated data with merged rows to
csv/overrides-deduplicated.csv file for easier process supervision and possibly troubleshooting.
- keep saving the raw (non-deduplicated) data to
csv/overrides.csv as before.
Keep the edits clean (don't change unrelated stuff, but feel free to warn about possible issues), minimal (easy for review), comment the purpose of larger/more complex (non-obvious) functionality.
Task:
update.py, functionappend_overrides()instead of detecting duplicate overrides and failing (usingexit(1)) find all rows affecting the same doctor position by looking atdoctor,type,id_inst(index columns)date_override) non-empty values (in columnsaccepts_override,availability_override,address,city,post,phone,website,email,orderform) on top of the earlier values.address,city,post) as one - always take the latest all 3 fields fields to form complete address (take all 3 latest field values even ifcityis empty but both other fields are provided)date_overrideat each doctor positioncsv/overrides-deduplicated.csvfile for easier process supervision and possibly troubleshooting.csv/overrides.csvas before.Keep the edits clean (don't change unrelated stuff, but feel free to warn about possible issues), minimal (easy for review), comment the purpose of larger/more complex (non-obvious) functionality.