Hi community,
CHT data_records have à contact json key with the lineage of the contact of this data_record.
For example if I have an offline user, a CHW, that triggers a form in a patient, in the device the CHW has the lineage, A->B->C->D but in the server the contact has been moved to A->E->F->G,
what will happen when the CHW syncs the data_record ?
the sent data_record will be modified to set contact _id lineage to the current one in couchDB (A->E->F->G) or the data record won’t be modified and so contact will have the old lineage A->B->C->D ?
The contact property in a data_record is the submitter of the report, the CHW or the supervisor that filled the form.
When a contact is moved, using the cht-conf move-contacts action, the contact property of every report submitted by the moved user will be updated to contain the changed lineage. This is, of course, only limited to the data_records that exist on the server at the time of the move-contacts command.
If there are unsynced reports created by these contacts, their lineage will not be changed when they are uploaded, you could call these reports “orphaned”.