I’ve been thinking about how could we decrease the number of documents affected by a move-contact operation and I’ve in mind two ideas:
- if the longuer workflow in a given project is of X days, I think that we do not need to modify reports that are older than X day
- if the documents are purged the modifications of this documents could be skiped
The problem is if the things changes later, and some skiped documents, because purged or because they are older of this max workflow duration, get unpurged, or are needed now because the max workflow duration has been extended, the skipped docs won’t have the “contact lineage” modified.
if I’m purging patient_assessments data_records older than 45 days, and now I have another workflow that has a duranton of 120 days which tasks depend on patient_assessment I will modify the purge.js and set patient_assessment to be purged if older than 120 days, so I will have some data_records that will be unpurged, but as a CHT app workflow developer could I expect that this data_records in the past (near past) will trigger tasks that are “important” for my workflow ? it’s really possible but usualy when I’m developing a workflow and I deploy the workflow at a given date, I expect to have this workflow working with data submitted after the deploying date.
I’m thinking about a possibility to add some configuration something like, modify_purged_reports_when_move_contacts and if false move_contacts command should skip this modifications, I mean, if a form in its context is intendeed for a role, (maybe we should add an intended_for_role field to forms context ??) and the document is purged for this role skip the modification of the doc.
If this is difficult or makes no sense we could think about a parameter passed to cht-conf with the move-contact operation something like cht --url=xxxx --move-contacts --skip-older-than=300
and cht-conf would not download reports older than 300 days
So the responsability of doing this would be by project .
Another idea is to take out of couchdb all purged docs or docs that are older than a given duration, so unpurged it later will be impossible.