-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix issue #380: cascading delete for patient records; delete related records first and then patient record #457
Conversation
…te related records first and then patient record
…italrun-frontend'
@aboma thanks for the PR. 🎉
Can you please add a screenshots to the view you added? |
@jglovier the view is a database view, not a screen, so I don't think we need a screenshot here. |
There is no change to the UI in these commits; the view referenced is a Pouch DB view. |
To test this, find or setup a patient record with invoices, visits and labs associated to him/her. Delete the patient using the delete button. Go to the labs view and verify labs are deleted for selected patient and no error occurs on labs list page. Go to invoices list page and verify invoices are deleted for selected patient and no error occurs on invoices list page. |
@aboma good work here. I did notice that there are some orphan records that get left behind because they are children records that don't get directly deleted. Specifically:
A couple of other observations:
|
I will add the progress modal (definitely need this) and delete the additional records. |
…take some time to delete all associated records
Marking as in progress until this PR is complete. |
…ts, invoice line items and proc charges
I have made the suggested changes. It is now deleting patient appointments, billing line items, payments and proc charges. I have also added a progress modal. This pull request should be complete. |
@aboma thanks for all the good work on this. It appears that there's one test failing on this branch related to the patient-appointments mixin. See below. If you'd prefer that I or someone else address this fix, I'm happy to do that. If you want to make this change, we should be able to officially "pass" the build.
cc: @jkleinsc for any further feedback / review. |
…troller inadverdently not committed
I fixed this and also added some changes I mistakenly forgot to check-in. Tests are passing now. |
Thanks @aboma ! Looks good, but I want to test it locally before merging, so I hope to do that tomorrow. |
@aboma in testing this locally, it appears that if I have a payment on a invoice, the delete errors out with: "ember.debug.js:32110 Error: Attempted to handle event Also when I don't have a payment the following child records don't appear to delete:
|
Ok, I will review again and fix. Also, you may want to consider creating a service that wraps the store and enforces data integrity. If all model saving/update/deletes are made through the service then it will prevent data corruption. |
Fixes #380 Cascading Delete for patient records.
Changes proposed in this pull request:
cc @HospitalRun/core-maintainers