I am trying to delete a person using API. This is a DELETE request.
openmrs-standalone/ws/rest/v1/person/dd709629-1691-11df-97a5-7038c432aabf?purge=true
I have double-checked and that ID really exists. The request is getting failed and this is the reason I’m getting from the logs:
Cannot delete or update a parent row: a foreign key constraint fails (
openmrs
.encounter
, CONSTRAINTencounter_patient
FOREIGN KEY (patient_id
) REFERENCESpatient
(patient_id
) ON UPDATE CASCADE)
Here’s the full log. delete_error - Pastebin.com
How can I fix it?