functions of inpatient department