Context.getPersonService().savePerson(patient);
}
// exit the patient from care or process patient's death
if (submissionActions.getExitFromCareProperty() != null) {
ExitFromCareProperty exitFromCareProperty =
submissionActions.getExitFromCareProperty();
if (exitFromCareProperty.getCauseOfDeathConcept() != null) {
Context.getPatientService().processDeath(this.getPatient(), exitFromCareProperty.getDateOfExit(),
exitFromCareProperty.getCauseOfDeathConcept(), exitFromCareProperty.getOtherReason());
} else {
Context.getPatientService().exitFromCare(this.getPatient(), exitFromCareProperty.getDateOfExit(), exitFromCareProperty.getReasonExitConcept());
}
}
// handle any custom actions (for an example of a custom action, see: https://github.com/PIH/openmrs-module-appointmentschedulingui/commit/e2cda8de1caa8a45d319ae4fbf7714c90c9adb8b)