I need to delete some locations used in many encounters with demo patients. Is there a way to delete all the demo patients so I can delete those locations?
Thank you
I need to delete some locations used in many encounters with demo patients. Is there a way to delete all the demo patients so I can delete those locations?
Thank you
What about SQL Delete based on their IDs. Something as follows may be help. But please makesure that you are executing them against the correct table.
Ex : To delete patients delete from patient where patient_id > [sample_patient_start] and patient_id <= [sample_patient_end]
Hope it helps!
I won’t recommending firing delete statements for patients… since patient data may also be referenced by other entities in DB. Maybe there is a delete patient API in OpenMRS, or some “supported” script for deleting patients?
Yes. That is true. You have to be careful with the relationships between the database relations. But the best way is to findout whether there are any API s or scripts provided as @gsluthra has suggested. Will try to find some.
I was able to delete all demo patents. Here are the queries I used: NB: make sure you first stop openmrs or tomcat before proceeding. Also ensure you make a copy of your database first before proceeding.
select_Demo_Data_TABLES_and_Data.txt (813 Bytes) These queries select the tables and data that will be deleted. Make sure you review the result of these queries before proceeding to the Next delete queries below.
deleting_Demo_Data_Leaving_Live_Data.txt (850 Bytes) This list of queries deletes all the demo patients.
its to delete demo patients delete from patient where patient_id>[sample_patient_start] and patient_id <=[sample_patient_end] i hope it will help you .