refactored patient_history on loading speed issues