Client Deletion Question
First the background:
Yesterday I was having my day off when (as usual) I get the emergency phone call, a client file everyone had been looking at that morning had vanished!!!! I actually was lying in bed attempting to die from a cold..so I told them to take a card and I would deal with it tomorrow....anyway its now tomorrow, and I have investigated the case.
It appears the customer was deleted, leaving behind 3 orphaned pet entries, the client had been transfered from the old PMS with histories for each pet, but no account history or medication entries.
Given this hitting Delete allows for the complete removal of the client, I would argue the presence of relationships in the form of a patient should invoke the no delete inactivate rule. Forcing people to delete each patient or transfer them before deleting the customer.
Secondly, I cant tell who deleted the file, I can track queries in mysql using logging but that doesnt tell me who deleted it, I recall a discussion on auditing, not that it matters who, because that is a staff straining issue anyway, but I would really like to be able to confirm that someone really did hit the delete and then subsequent confirmation window to effect the process.
Ben
Re: Client Deletion Question
Ben - this probably does not help you, but I know that in a 1.7 system, deleting a customer with patients cannot be done. The Delete Confirm message says something like '..has relationships, cannot delete - Deactivate instead?' If you say OK, the customer gets deactivated and the patients are left as active and still attached to the deactivated customer.
You cannot find the customer unless you tick the 'include deactivated' box. You can find the patients by name (provided you check the 'all patients' box).
Regards, Tim G
Re: Client Deletion Question
Yeah I think that if the client has any invoice history or appointments present you can not delete and you get the above ? regarding deactivation, but try a client with just patient relationships in 1.7. No appointments or invoices.
Re: Client Deletion Question
You are correct Ben. For the earlier test I took a 'normal' customer with 3 pets and a stack of history.
I created a test customer Ztest1 with two patients. I then went to delete the customer and got the confirm screen below. After I OK'ed the delete, there were two orphan patients (easy to find because I have called them Zrover1 and Zrover2).
I must admit that I am in two minds as to whether this should have been possible to do. I lean on the side of 'if the customer has patients, then it should have been a case of 'can't delete - can deactivate' rather than allowing it to go ahead.
Note however that one does get into the situation that to delete in this situation one would have to manually disconnect the patients, and the delete the customer.
A bit more testing shows that the switch to 'can't delete - can deactivate' occurs when the customer has invoices. Adding a visit and note to the patient still allowed the customer to be deleted.
Hence the behaviour is:
So the customer-patient link causes the 'has relationships' warning but does not block deletion.
Regards, Tim
Re: Client Deletion Question
It isnt just invoices its appointments as well, personally I think that if a client has pets/patients it should not be allowed to be deleted, those pets must be moved first. or deleted them selves individually.
Tim A?
Re: Client Deletion Question
I'll JIRA this for 1.7. Should this apply to every party (e.g. customer, patient, supplier organisation), that has a relationship?
How about every product, and entity?
-Tim
Re: Client Deletion Question
My 2 cents:
Where an entity/party/product has a relationship with another entity/party/product and it is considered the source it cant be deleted.
Where it has participations and it is the source or target it cant be deleted.
An entity with just detail relationships ie, price, contacts, alias,detail etc can be deleted and the deletion will cascade to the detail automatically.
In the case above the client still has a entity relationship with the party.patient hence should not be able to be deleted, however the patients even though they have a relationship with the client could be deleted as long as they have no history/medication disp/document/appointment (ie participation).
That being said if you wanted to get really funky you could allow a party.patient with no history more recent that 5 years and where the patient is deceased to be deleted, coforming with medical storage guidelines and to allow future database compaction/archiving
Ben
Re: Client Deletion Question
Raised as OVPMS-1337
-Tim