At PIH, we’ve a functional request to close all a patient’s active programs when that patient is marked as dead.
This used to be handled (I believe) by the Exit from Care functionality that existed in OpenMRS Core, it looks like this has been removed? (Along with the functionality to close orders).
Was there a reason for this?
Honestly, it would likely be straightforward to build our own custom logic for this, but there’s no reason we couldn’t build it into the current “Mark Patient Deceased” page provided by Core Apps if others are interested in it.
We’d likely be building the following functionality:
When a Patient is Marked as Dead, and saved, close all programs for the patient
When a patient is marked as death, check all active programs for that patient. For all active programs with an possible outcome of “Patient Died” (could be defined by a global property), set the program to that outcome on the date of death.
Perhaps more controversially, we’d like to build this functionality as well:
When a Patient is Marked as not dead, and saved, reopen patient programs
When a patient is marked as not dead, look for any patient programs that have an outcome of “Patient Died” and outcome date = date_of_death. Remove those outcomes.
Assumedly, we’d also add some functionality to close the orders and any visit active visits for a patient, but haven’t worked out the exact logic or priority for this yet.
We would add alerts/warning to the user letting them know that this would happen.
We are talking about building this into the “Mark Patient Deceased” page provided by Core Apps (likely delegating to logic we add to EMR API or Core):
We’re happy to build this functionality into a custom PIH page if there isn’t consensus, but seems like it would be preferably to build it into the Ref App for others to use if others think it makes sense.
Take care, Mark