Hi James
I am not able to access the Test server. Getting a 502 Bad Gateway error. So let me try to explain what I did step by step. This will explain things better
Step 1
=====
updated the HAPI.PROPERTIES File as mentioned below to allow cascade deletion. After making this change, generated the WAR file and deployed it on the server
cascading_delete.enabled=true
Step 2
=====
Created a Patient resource. It created one with ID 265411
Step 3
=====
Created 2 Medication administration resources for the above Patient 265411. The IDs of the 2 MedicationAdministration resources created were 265412 and 265413
Step 4
=====
Invoked the DELETE API by using the following request (used POSTMAN)
It deleted the Patient resource with ID 265411. This was confirmed by the DELETE API response. It DID NOT delete the 2 MedicationAdministration resources as there was no mention of that in the JSON response.
Step 5
=====
I confirmed the deletion of Patient 265411 by trying to retrieve it. The response came back indicating that this ID does not exist and was deleted.
I tried to retrieve the 2 MedicationAdministration resources using their respective IDs 265412 and 265413. I was able to retrieve both of them
My first issue
===========
Why did the cascade deletion not happen in Step 4? I was expecting in Step 4 the 2 MedicationAdministration resources to also get deleted. How can I resolve my issue and make cascade deletion work where the Patient gets deleted along with its child MedicationAdministration resources?
Please also confirm if my expected behavior below from the system is correct or not
=========================================================================
If cascade deletion is not working, I expect the Patient deletion without the deletion of MedicationAdministration resources to fail since the system should prevent orphan data to be left in the repository. But Step 4 deleted the Patient leaving the orphan MedicationAdministration resources. Isn't this an issue?
Hope I am able to do a better job explaining my issue this time. Appreciate your help looking into my issue.
Thanks again
Vikas