Improve how undo and redo handle "remove from family" operation in pedigree

Description

Currently if an unlinked patient is removed form the pedigree (by removing it from the "unlinked patients legend") there is no explicit "undo" state for that (which may be ok, since once removed from the family the patient may have been added to another family by someone else). At the same time if that patient was linked to a node before an undo operation may pring pedigree back to a state which has that patient linked to that node effectively bringing it back

The two possible improvements are:

1) treat "removed-from-family" patients as deleted and remove all references to them from all states (easy: there is an event for that, and code to do the removal, just need that code to be triggered on this event in addition to "patient deleted" event)

2) create an undo state when a patient is removed, and on `redo` check if that patient is still free (not in another family) and add it back if it is not (and do what is listed in 1) above if it is)

Environment

None

Assignee

Andrew Misyura

Reporter

Andrew Misyura

Labels

None

External issue ID

None

Components

Fix versions

Priority

Medium
Configure