Cornerstone deactivates a patient when a cremation / euthanasia event happens. Due to the fact that the patient is deactivated, report pdf's can't attach to the EMR automatically. 


Patients can have any of the following status in CornerStone: 'Active', 'Deceased', 'Inactive'.
PDF-reports from Smart Flow can be attached only when the patient in CornerStone has status 'Active'.



There are 2 solutions:


1. When the patient is being discharged on CornerStone side:  Before discharging the patient in CornerStone, please discharge the patient in Smart Flow and then deactivate it in CornerStone. Otherwise, Smart Flow cannot send PDF reports for this patient to CornerStone (patient will have inactive status in CornerStone and the report upload will fail).


2. When the patient is being marked as cremated / euthanized in CornerStone: Before discharging the patient in CornerStone, please discharge the patient in Smart Flow and then run the code for cremation / euthanasia in CornerStone. Otherwise, Smart Flow cannot send PDF reports for this patient to CornerStone (patient will have Inactive status in CornerStone and report upload will fail).